From 26926551cf74d442867fce9aeaa7cfaff4787ced Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Sun, 13 Oct 2013 13:50:21 +0530 Subject: [PATCH] Minor clean up of index.html --- share/tools/web_config/fishconfig.js | 5 ++-- share/tools/web_config/index.html | 40 ---------------------------- 2 files changed, 2 insertions(+), 43 deletions(-) diff --git a/share/tools/web_config/fishconfig.js b/share/tools/web_config/fishconfig.js index 0326fad52..b2abddeed 100644 --- a/share/tools/web_config/fishconfig.js +++ b/share/tools/web_config/fishconfig.js @@ -621,12 +621,11 @@ fishconfig.controller("colorsController", function($scope, $http) { for (var i=0; i < additional_color_schemes.length; i++) $scope.color_schemes.push(additional_color_schemes[i]) - var supported_setting_names = ['autosuggestion', 'command', 'comment', 'end', 'error', 'param', 'quote', 'redirection']; - $scope.changeSelectedColorScheme($scope.color_schemes[0]); $scope.color_settings = $scope.color_schemes.colors; + $scope.setTheme = function() { - var settingNames = ["autosuggestion", "command", "param", "redirection", "comment", "error", "escape", "operator", "quote", "end"]; + var settingNames = ["autosuggestion", "command", "param", "redirection", "comment", "error", "quote", "end"]; for (name in settingNames) { var postData = "what=" + settingNames[name] + "&color=" + $scope.selectedColorScheme[settingNames[name]] + "&background_color=&bold=&underline="; $http.post("/set_color/", postData, { headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(data, status, headers, config) { diff --git a/share/tools/web_config/index.html b/share/tools/web_config/index.html index 66307ebab..9e644fbc3 100644 --- a/share/tools/web_config/index.html +++ b/share/tools/web_config/index.html @@ -59,30 +59,6 @@ function hsl_to_rgb(h, s, l){ return [r * 255, g * 255, b * 255] } -/* Given an RGB color as a hex string, like FF0033, convert to HSL, apply the function to adjust its lightness, then return the new color as an RGB string */ -function adjust_lightness(color_str, func) { - /* Hack to handle for example F00 */ - if (color_str.length == 3) { - color_str = color_str[0] + color_str[0] + color_str[1] + color_str[1] + color_str[2] + color_str[2] - } - - rgb = parseInt(color_str, 16) - r = (rgb >> 16) & 0xFF - g = (rgb >> 8) & 0xFF - b = (rgb >> 0) & 0xFF - - hsl = rgb_to_hsl(r, g, b) - new_lightness = func(hsl[2]) - function to_int_str(val) { - str = Math.round(val).toString(16) - while (str.length < 2) - str = '0' + str - return str - } - - new_rgb = hsl_to_rgb(hsl[0], hsl[1], new_lightness) - return to_int_str(new_rgb[0]) + to_int_str(new_rgb[1]) + to_int_str(new_rgb[2]) -} /* Given a color, compute the master text color for it, by giving it a minimum brightness */ function master_color_for_color(color_str) { @@ -94,22 +70,6 @@ function master_color_for_color(color_str) { }) } -function post_style_to_server() { - style = current_style() - if (! style) - return - - run_post_request('/set_color/', { - what: current_master_element_name(), - color: style.color, - background_color: style.background_color, - bold: style.bold, - underline: style.underline - }, function(contents){ - - }) -} - /* Given a color name, like 'normal' or 'red' or 'FF00F0', return an RGB color string (or empty string) */ function interpret_color(str) { str = str.toLowerCase()