diff --git a/Themes/api/module.php b/Themes/api/module.php index a0ee183..c173cfb8 100644 --- a/Themes/api/module.php +++ b/Themes/api/module.php @@ -248,9 +248,9 @@ class Themes extends Module return true; } /* - * searchAndReplaceFile - * $s -> substring to find - * return: true or false showing succcessful string replacement + * searchAndReplaceFile + * $s -> substring to find + * return: true or false showing succcessful string replacement */ public function searchAndReplaceFile($f, $s) { @@ -258,8 +258,8 @@ class Themes extends Module return (exec("sed -i 's/fill:\(.*\);/fill:#{$s};/g' $f") == 0); } /* - * setCurrentTheme - * $theme -> modify CURRENT_CSS file with new theme + * setCurrentTheme + * $theme -> modify CURRENT_CSS file with new theme */ public function setCurrentTheme($theme) { @@ -267,8 +267,8 @@ class Themes extends Module exec('echo '.$theme.' > /pineapple/modules/Themes/css/CURRENT_CSS'); } /* - * getCurrentTheme - * return current theme, and all parameters for icon colors/brightness + * getCurrentTheme + * return current theme, and all parameters for icon colors/brightness */ public function getCurrentTheme() { diff --git a/Themes/js/module.js b/Themes/js/module.js index d6d787c..7f5bb04 100644 --- a/Themes/js/module.js +++ b/Themes/js/module.js @@ -4,34 +4,31 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h getCurrentTheme(); backupFiles(); - $scope.debug = true; - - $scope.themes = []; - $scope.themeToDelete = null; + $scope.debug = false; + $scope.themes = []; + $scope.themeToDelete = null; $scope.themeDeleteValidation = ''; - $scope.messages = []; - $scope.newThemeName = ''; - $scope.throbber = true; - $scope.running = false; - $scope.current = ''; - $scope.library = true; - $scope.editor = true; - $scope.workshopTheme = {themeName: "", file: "", code: "", title: ""}; - $scope.editThemeFile = {themeName: "", file: "", code: ""}; - $scope.colors = ['dark', 'light', 'red', 'blue', 'green', 'purple', 'orange', 'yellow', 'pink']; - $scope.brightness = ['light', 'normal', 'dark']; - $scope.working = false; - + $scope.messages = []; + $scope.newThemeName = ''; + $scope.throbber = true; + $scope.running = false; + $scope.current = ''; + $scope.library = true; + $scope.editor = true; + $scope.workshopTheme = {themeName: "", file: "", code: "", title: ""}; + $scope.editThemeFile = {themeName: "", file: "", code: ""}; + $scope.colors = ['dark', 'light', 'red', 'blue', 'green', 'purple', 'orange', 'yellow', 'pink']; + $scope.brightness = ['light', 'normal', 'dark']; + $scope.working = false; // Dark and White - $scope.throbbercontrast = true; // true == light -> false == dark - $scope.logocontrast = true; - $scope.faviconcontrast = true; - $scope.reconcontrast = true; - $scope.logocontrastText = 'light'; - $scope.faviconcontrastText = 'light'; + $scope.throbbercontrast = true; // true == light -> false == dark + $scope.logocontrast = true; + $scope.faviconcontrast = true; + $scope.reconcontrast = true; + $scope.logocontrastText = 'light'; + $scope.faviconcontrastText = 'light'; $scope.throbbercontrastText = 'light'; - - // Collor and brightness + // Color and brightness $scope.allcontrastText = 'light'; $scope.allcontrastBrightness = 'normal'; $scope.dashboardcontrastText = 'light'; @@ -51,8 +48,8 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h $scope.trackingcontrastText = 'light'; $scope.trackingcontrastBrightness = 'normal'; $scope.loggingcontrastText = 'light'; - $scope.loggingcontrastBrightness = 'normal'; - $scope.reportingcontrastText = 'light'; + $scope.loggingcontrastBrightness = 'normal'; + $scope.reportingcontrastText = 'light'; $scope.reportingcontrastBrightness = 'normal'; $scope.networkingcontrastText = 'light'; $scope.networkingcontrastBrightness = 'normal'; @@ -60,9 +57,8 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h $scope.configurationcontrastBrightness = 'normal'; $scope.advancedcontrastText = 'light'; $scope.advancedcontrastBrightness = 'normal'; - $scope.helpcontrastText = 'light'; - $scope.helpcontrastBrightness = 'normal'; - + $scope.helpcontrastText = 'light'; + $scope.helpcontrastBrightness = 'normal'; $scope.switchOn = { "position" : "relative", "display" : "block", @@ -73,7 +69,6 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h "background-color" : "darkgray", "border-radius" : "40px" } - $scope.switchOff = { "position" : "relative", "display" : "block", @@ -109,9 +104,9 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Throbber", "set to " + $scope.throbbercontrastText); log("changeThrobber", response.message); + $window.location.reload(); }); }; - $scope.changeLogo = function(){ $scope.logocontrast = !$scope.logocontrast; $scope.logocontrastText = 'light'; @@ -126,6 +121,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Logo", "set to " + $scope.logocontrastText); log("changeLogo", response.message); + $window.location.reload(); }); }; @@ -143,6 +139,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Icon", "set to " + $scope.faviconcontrastText); log("changeFavicon", response.message); + $window.location.reload(); }); }; $scope.changeAllIcons = function(){ @@ -154,9 +151,11 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h brightness: $scope.allcontrastBrightness }, function(response) { for (msg in response) { - $scope.sendMessage("All Icons", "set to " + $scope.allcontrastText + "(" + allcontrastBrightness + ")"); + $scope.sendMessage("All Icons", "set to " + $scope.allcontrastText + "(" + $scope.allcontrastBrightness + ")"); log("changeAllIcons", "Success? " + response.success + " " + response.message); } + $route.reload(); + $window.location.reload(); }); }; $scope.changeDashboard = function(){ @@ -169,6 +168,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Dashboard Icon", "set to " + $scope.dashboardcontrastText + " (" + $scope.dashboardcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeRecon = function(){ @@ -181,6 +181,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Recon Icon", "set to " + $scope.reconcontrastText + " (" + $scope.reconcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeProfiling = function(){ @@ -193,6 +194,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Profiling Icon", "set to " + $scope.profilingcontrastText + " (" + $scope.profilingcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeClients = function(){ @@ -205,6 +207,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Clients Icon", "set to " + $scope.clientscontrastText + " (" + $scope.clientscontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeModules = function(){ @@ -217,6 +220,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("ModuleManager Icon", "set to " + $scope.modulescontrastText + " (" + $scope.modulescontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeFilters = function(){ @@ -229,6 +233,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Filters Icon", "set to " + $scope.filterscontrastText + " (" + $scope.filterscontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changePineap = function(){ @@ -241,6 +246,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Filters Icon", "set to " + $scope.pineapcontrastText + " (" + $scope.pineapcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeTracking = function(){ @@ -253,6 +259,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Tracking Icon", "set to " + $scope.trackingcontrastText + " (" + $scope.trackingcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeLogging = function(){ @@ -265,6 +272,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Logging Icon", "set to " + $scope.loggingcontrastText + " (" + $scope.loggingcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeReporting = function(){ @@ -277,6 +285,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Reporting Icon", "set to " + $scope.reportingcontrastText + " (" + $scope.reportingcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeNetworking = function(){ @@ -289,6 +298,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Networking Icon", "set to " + $scope.networkingcontrastText + " (" + $scope.networkingcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeConfiguration = function(){ @@ -301,6 +311,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Configuration Icon", "set to " + $scope.configurationcontrastText + " (" + $scope.configurationcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeAdvanced = function(){ @@ -313,6 +324,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Advanced Icon", "set to " + $scope.advancedcontrastText + " (" + $scope.advancedcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; $scope.changeHelp = function(){ @@ -325,6 +337,7 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }, function(response) { $scope.sendMessage("Help Icon", "set to " + $scope.helpcontrastText + " (" + $scope.helpcontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); + $window.location.reload(); }); }; function log(fn, message) { @@ -334,84 +347,83 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h }; function backupFiles() { $api.request({ - module: "Themes", - action: "backupFiles" - }, function(response) { - log('backupFiles', response.message); - for (i=0; iConfiguration {{ configurationcontrastText }} {{ configurationcontrastBrightness }} Advanced {{ advancedcontrastText }} {{ advancedcontrastBrightness }} Help {{ helpcontrastText }} {{ helpcontrastBrightness }} - - + diff --git a/Themes/module.info b/Themes/module.info index 54f518f..b886385 100644 --- a/Themes/module.info +++ b/Themes/module.info @@ -1,6 +1,6 @@ { "title": "Themes", - "description": "Download, create, and share custom themes! With cross domain persistence and custom icon color adjustment", + "description": "Create or download custom themes!", "version": "1.0", "author": "trashbo4t" -} +} \ No newline at end of file