mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Removed unrequired code from colors controller
This commit is contained in:
parent
976a0a6264
commit
2069094f55
1 changed files with 0 additions and 64 deletions
|
@ -634,70 +634,6 @@ fishconfig.controller("colorsController", function($scope, $http) {
|
|||
})
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
range = function(start, end) {
|
||||
var result = [];
|
||||
for (var i = start; i <= end; i++) {
|
||||
result.push(i);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
$scope.selectedColorConfig = null;
|
||||
$scope.itemsPerRow = range(0, 15);
|
||||
$scope.totalRows = range(0, $scope.term256Colors.length/$scope.itemsPerRow.length);
|
||||
$scope.selectedCell = null;
|
||||
$scope.target = "text";
|
||||
|
||||
$scope.selectConfig = function(newSelection) {
|
||||
$scope.selectedColorConfig = newSelection;
|
||||
//console.log("Color :" + $scope.colorConfig[$scope.selectedColorConfig].color.toLowerCase() + $scope.term256Colors.indexOf($scope.colorConfig[$scope.selectedColorConfig].color.toLowerCase()));
|
||||
if ($scope.target == "background") {
|
||||
$scope.selectedCell = $scope.term256Colors.indexOf($scope.selectedColorConfig.background.toLowerCase());
|
||||
}
|
||||
else {
|
||||
$scope.selectedCell = $scope.term256Colors.indexOf($scope.selectedColorConfig.color.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
$scope.pickedColorCell = function(index) {
|
||||
console.log("color picked" + index + " " + $scope.term256Colors[index]);
|
||||
$scope.selectedCell = index;
|
||||
|
||||
if ($scope.target == "background") {
|
||||
$scope.selectedColorConfig.background = $scope.term256Colors[$scope.selectedCell];
|
||||
}
|
||||
else {
|
||||
$scope.selectedColorConfig.color = $scope.term256Colors[$scope.selectedCell];
|
||||
}
|
||||
|
||||
$scope.setColor();
|
||||
}
|
||||
|
||||
$scope.pickedColorPickerTarget = function(target) {
|
||||
console.log("Picked " + target);
|
||||
$scope.target = target;
|
||||
// Update selection in color picker
|
||||
$scope.selectConfig($scope.selectedColorConfig);
|
||||
}
|
||||
|
||||
$scope.setUnderline = function() {
|
||||
$scope.selectedColorConfig.underline = !$scope.selectedColorConfig.underline;
|
||||
$scope.setColor();
|
||||
}
|
||||
|
||||
$scope.fetchColors = function() {
|
||||
$http.get("/colors/").success(function(data, status, headers, config) {
|
||||
$scope.colorConfigs = data;
|
||||
$scope.selectedColorConfig = data[0];
|
||||
$scope.selectedCell = $scope.term256Colors.indexOf($scope.selectedColorConfig.color);
|
||||
})};
|
||||
|
||||
|
||||
$scope.fetchColors();
|
||||
});
|
||||
|
||||
fishconfig.controller("promptController", function($scope, $http) {
|
||||
|
|
Loading…
Reference in a new issue