From 3c77b1b3a66d71e73e8574ae50db9991e937c494 Mon Sep 17 00:00:00 2001 From: trashbo4t Date: Thu, 23 Aug 2018 17:06:59 -0400 Subject: [PATCH] update themes module (#38) --- Themes/api/module.php | 11 +++++++++-- Themes/js/module.js | 23 +++++++++++++---------- Themes/module.html | 30 +++++++++++++++++++++--------- Themes/module.info | 4 +++- 4 files changed, 46 insertions(+), 22 deletions(-) diff --git a/Themes/api/module.php b/Themes/api/module.php index c173cfb8..1a2a2a9 100644 --- a/Themes/api/module.php +++ b/Themes/api/module.php @@ -1,5 +1,9 @@ String name of module, can be any format (nEtWoRkIng) because it gets formatted * $color -> string name of the color, used for index of mapping * $brightness -> string name of brightness, used for map selection + * + * This is a neat little technique to change image colors, since the images are SVG we search and + * replace the original RBG colors in the image file with the new RBG hex values. */ public function replaceModuleImage($moduleName, $color, $brightness) { @@ -562,4 +569,4 @@ class Themes extends Module } return false; } -} \ No newline at end of file +} diff --git a/Themes/js/module.js b/Themes/js/module.js index 38bbaa3..68c142f 100644 --- a/Themes/js/module.js +++ b/Themes/js/module.js @@ -1,5 +1,8 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$http', function ($api, $scope, $window, $route, $http) { + /* + * Author: trashbo4t (github.com/trashbo4t) + */ getThemes(); getCurrentTheme(); backupFiles(); @@ -36,8 +39,8 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h $scope.dashboardcontrastBrightness = 'normal'; $scope.reconcontrastText = 'light'; $scope.reconcontrastBrightness = 'normal'; - $scope.profilingcontrastText = 'light'; - $scope.profilingcontrastBrightness = 'normal'; + $scope.notescontrastText = 'light'; + $scope.notescontrastBrightness = 'normal'; $scope.clientscontrastText = 'light'; $scope.clientscontrastBrightness = 'normal'; $scope.modulescontrastText = 'light'; @@ -196,15 +199,15 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h } }); }; - $scope.changeProfiling = function(){ + $scope.changeNotes = function(){ $api.request({ module: "Themes", action: "replaceImage", - img: 'Profiling', - color: $scope.profilingcontrastText, - brightness: $scope.profilingcontrastBrightness + img: 'Notes', + color: $scope.notescontrastText, + brightness: $scope.notescontrastBrightness }, function(response) { - $scope.sendMessage("Profiling Icon", "set to " + $scope.profilingcontrastText + " (" + $scope.profilingcontrastBrightness + ")"); + $scope.sendMessage("Notes Icon", "set to " + $scope.notescontrastText + " (" + $scope.notescontrastBrightness + ")"); log("changeDashboard", "Success? " + response.success + " " + response.message); if ($scope.autoRefresh) { $window.location.reload(); @@ -405,8 +408,8 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h $scope.dashboardcontrastBrightness = response.dashboardbrightness; $scope.reconcontrastText = response.recon; $scope.reconcontrastBrightness = response.reconbrightness; - $scope.profilingcontrastText = response.profiling; - $scope.profilingcontrastBrightness = response.profilingbrightness; + $scope.notescontrastText = response.notes; + $scope.notescontrastBrightness = response.notesbrightness; $scope.clientscontrastText = response.clients; $scope.clientscontrastBrightness = response.clientsbrightness; $scope.modulescontrastText = response.modulemanager; @@ -601,4 +604,4 @@ registerController("ThemesController", ['$api', '$scope','$window','$route', '$h } }); } -}]); \ No newline at end of file +}]); diff --git a/Themes/module.html b/Themes/module.html index 174bdfa..7df92c9 100644 --- a/Themes/module.html +++ b/Themes/module.html @@ -1,3 +1,7 @@ + + + +
@@ -78,7 +82,6 @@ Favicon {{ faviconcontrastText }} N/A Dashboard {{ dashboardcontrastText }} {{ dashboardcontrastBrightness }} Recon {{ reconcontrastText }} {{ reconcontrastBrightness }} - Profiling {{ profilingcontrastText }} {{ profilingcontrastBrightness }} Clients {{ clientscontrastText }} {{ clientscontrastBrightness }} Modules {{ modulescontrastText }} {{ modulescontrastBrightness }} Filters {{ filterscontrastText }} {{ filterscontrastBrightness }} @@ -89,6 +92,7 @@ Networking {{ networkingcontrastText }} {{ networkingcontrastBrightness }} Configuration {{ configurationcontrastText }} {{ configurationcontrastBrightness }} Advanced {{ advancedcontrastText }} {{ advancedcontrastBrightness }} + Notes {{ notescontrastText }} {{ notescontrastBrightness }} Help {{ helpcontrastText }} {{ helpcontrastBrightness }} @@ -376,26 +380,27 @@ - Profiling - - - @@ -755,6 +760,13 @@
+
    +
  • 1.1
  • +
      +
    • Removed profiling icon options
    • +
    • Added "Notes" icon options
    • +
    +
  • 1.0
    • @@ -783,4 +795,4 @@
- \ No newline at end of file + diff --git a/Themes/module.info b/Themes/module.info index 4eb03b9..29ae1b2 100644 --- a/Themes/module.info +++ b/Themes/module.info @@ -6,5 +6,7 @@ "tetra" ], "title": "Themes", - "version": "1.0" + "description": "Create, download, and share custom themes", + "version": "1.1", + "author": "trashbo4t" }