diff --git a/js/controller/AppController.js b/js/controller/AppController.js index bc3242e0d..195929214 100644 --- a/js/controller/AppController.js +++ b/js/controller/AppController.js @@ -20,10 +20,11 @@ * */ +/** global: OC */ app.controller('AppController', function ($scope, $location, $http, $route, $log, $rootScope, $stateParams) { - $rootScope.sidebar = { - show: false - }; - $scope.sidebar = $rootScope.sidebar; - $scope.user = oc_current_user; + $rootScope.sidebar = { + show: false + }; + $scope.sidebar = $rootScope.sidebar; + $scope.user = oc_current_user; }); \ No newline at end of file diff --git a/js/controller/BoardController.js b/js/controller/BoardController.js index cc80f2ad3..ca91d3b7d 100644 --- a/js/controller/BoardController.js +++ b/js/controller/BoardController.js @@ -20,6 +20,7 @@ * */ +/** global: oc_defaults */ app.controller('BoardController', function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions, $filter) { $scope.sidebar = $rootScope.sidebar; @@ -45,8 +46,8 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St $scope.board = BoardService.getCurrent(); StackService.clear(); //FIXME: Is this still needed? - $scope.setPageTitle = function() { - if(BoardService.getCurrent()) { + $scope.setPageTitle = function () { + if (BoardService.getCurrent()) { document.title = BoardService.getCurrent().title + " | Deck - " + oc_defaults.name; } else { document.title = "Deck - " + oc_defaults.name; diff --git a/js/filters/iconWhiteFilter.js b/js/filters/iconWhiteFilter.js index 13fcac7c8..27b0973bd 100644 --- a/js/filters/iconWhiteFilter.js +++ b/js/filters/iconWhiteFilter.js @@ -20,7 +20,7 @@ * */ -app.filter('iconWhiteFilter', function() { +app.filter('iconWhiteFilter', function () { return function (hex) { // RGB2HLS by Garry Tan // http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c @@ -30,36 +30,37 @@ app.filter('iconWhiteFilter', function() { g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; - if(result !== null) { - var r = color.r/255; - var g = color.g/255; - var b = color.b/255; - var max = Math.max(r, g, b), min = Math.min(r, g, b); - var h, s, l = (max + min) / 2; + if (result === null) { + return ""; + } + var r = color.r / 255; + var g = color.g / 255; + var b = color.b / 255; + var max = Math.max(r, g, b), min = Math.min(r, g, b); + var h, s, l = (max + min) / 2; - if(max == min){ - h = s = 0; // achromatic - }else{ - var d = max - min; - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch(max){ - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; + if (max == min) { + h = s = 0; // achromatic + } else { + var d = max - min; + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + switch (max) { + case r: + h = (g - b) / d + (g < b ? 6 : 0); + break; + case g: + h = (b - r) / d + 2; + break; + case b: + h = (r - g) / d + 4; + break; } - // TODO: Maybe just darken/lighten the color - if(l<0.5) { - return "-white"; - } else { - return ""; - } - //var rgba = "rgba(" + color.r + "," + color.g + "," + color.b + ",0.7)"; - //return rgba; + h /= 6; + } + if (l < 0.5) { + return "-white"; } else { return ""; } - } }); diff --git a/js/filters/textColorFilter.js b/js/filters/textColorFilter.js index caaf53ae2..8b7a524a2 100644 --- a/js/filters/textColorFilter.js +++ b/js/filters/textColorFilter.js @@ -20,7 +20,7 @@ * */ -app.filter('textColorFilter', function() { +app.filter('textColorFilter', function () { return function (hex) { // RGB2HLS by Garry Tan // http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c @@ -30,26 +30,32 @@ app.filter('textColorFilter', function() { g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; - if(result !== null) { - var r = color.r/255; - var g = color.g/255; - var b = color.b/255; + if (result !== null) { + var r = color.r / 255; + var g = color.g / 255; + var b = color.b / 255; var max = Math.max(r, g, b), min = Math.min(r, g, b); var h, s, l = (max + min) / 2; - if(max == min){ + if (max == min) { h = s = 0; // achromatic - }else{ + } else { var d = max - min; s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch(max){ - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; + switch (max) { + case r: + h = (g - b) / d + (g < b ? 6 : 0); + break; + case g: + h = (b - r) / d + 2; + break; + case b: + h = (r - g) / d + 4; + break; } h /= 6; } - if(l<0.5) { + if (l < 0.5) { return "#ffffff"; } else { return "#000000";