webconfig: Remove the abbreviations tab

Since the new expanded abbreviations in 3.6.0, abbr no longer accepts
new universal variables. That means this tab is now
non-functional (except that it could technically remove abbrs that
were set in universal variables).

Because making it work with the expanded abbreviations requires some
awkwardness like a dedicated conf.d snippet (or writing into
config.fish!), we simply remove it.
This commit is contained in:
Fabian Boehm
2023-01-10 17:19:20 +01:00
parent 1d29ae7847
commit 4ceb497bfb
7 changed files with 0 additions and 152 deletions

View File

@@ -34,10 +34,6 @@ fishconfig.config(
controller: "bindingsController",
templateUrl: "partials/bindings.html"
})
.when("/abbreviations", {
controller: "abbreviationsController",
templateUrl: "partials/abbreviations.html"
})
.otherwise({
redirectTo: "/colors"
})

View File

@@ -395,49 +395,3 @@ controllers.controller("bindingsController", function($scope, $http) {
$scope.fetchBindings();
});
controllers.controller("abbreviationsController", function($scope, $http) {
$scope.abbreviations = [];
$scope.addBlank = function() {
// Add blank entry if it is missing
var hasBlank = {hasBlank: false}
angular.forEach($scope.abbreviations, function(value, key) {
if (value.phrase === "" && value.word === "") {
this.hasBlank = true;
}
}, hasBlank);
if (!$scope.abbreviations) $scope.abbreviations = [];
if (! hasBlank.hasBlank) {
$scope.abbreviations.push({phrase: "", word: "", editable: true})
}
}
$scope.fetchAbbreviations = function() {
$http.get("abbreviations/").then(function(arg) {
$scope.abbreviations = arg.data;
$scope.addBlank();
})};
$scope.editAbbreviation = function(abbreviation) {
abbreviation.editable = true;
}
$scope.saveAbbreviation = function(abbreviation) {
if (abbreviation.word && abbreviation.phrase) {
$http.post("save_abbreviation/", abbreviation).then(function(arg) {
abbreviation.editable = false;
$scope.addBlank();
});
}
};
$scope.removeAbbreviation = function(abbreviation) {
if (abbreviation.word) {
$http.post("remove_abbreviation/", abbreviation).then(function(arg) {
$scope.abbreviations.splice($scope.abbreviations.indexOf(abbreviation), 1);
$scope.addBlank();
});
}
};
$scope.fetchAbbreviations();
});

View File

@@ -41,20 +41,3 @@ filters.filter("filterBinding", function() {
return result;
}
});
filters.filter("filterAbbreviations", function() {
return function(abbreviations, query) {
var result = []
if (abbreviations == undefined) return result;
if (query == null) { return abbreviations};
for(var i=0; i<abbreviations.length; ++i) {
var abbr = abbreviations[i];
if (abbr.word.toLowerCase().indexOf(query) != -1 || abbr.phrase.toLowerCase().indexOf(query.toLowerCase()) != -1) {
result.push(abbr);
}
}
return result;
}
});