diff --git a/share/tools/web_config/fishconfig.css b/share/tools/web_config/fishconfig.css index 2553d0aa7..6c4aa77ad 100644 --- a/share/tools/web_config/fishconfig.css +++ b/share/tools/web_config/fishconfig.css @@ -390,18 +390,34 @@ img.delete_icon { } .prompt_demo { - /* This is the div that holds what the prompt looks like */ - width: 100%; - background-color: black; - border-radius: 5px; - display: table; + font-size: 12pt; + padding: 25px; + margin: 5px 20px 25px 20px; /* top right bottom left */ + cursor: pointer; + line-height: 1.8em; + border: solid #777 1px; + position: relative; /* so that our absolutely positioned elements work */ +} + +.prompt_demo_tight { + font-size: 10pt; + padding: 10px; + margin: 5px 20px 25px; /* top right bottom left */ + cursor: pointer; + line-height: 1.8em; + border: solid #777 1px; + position: relative; /* so that our absolutely positioned elements work */ +} + +.prompt_demo_tight_selected { + border: solid #00ff00 1px; } .save_button, .prompt_save_button { border-radius: 5px; border: solid rgba(71,71,71,0.5) 1px; padding: 5px 8px; - font-size: 12pt; + font-size: 10pt; display: inline-block; margin-top: 12px; background-color: rgba(128,128,128,0.2); @@ -412,7 +428,14 @@ img.delete_icon { .prompt_save_button:hover { background-color: #333; border: solid #525252 1px; - color: #EEE; + color: #ffffff; +} + +.prompt_demo_choice_label { + margin: 5px 20px 5px; + cursor: pointer; + font-size: 12pt; + white-space: normal; } .prompt_demo_text { @@ -428,15 +451,19 @@ img.delete_icon { } .prompt_function { - /* This is the div that holds the prompt function's definition */ - width: 100%; - color: #BBB; - font-size: 10pt; + display: block; + border: 1px solid #555; + background-color: #181818; + margin: 5px 20px 25px; + border-radius: 5; } .prompt_function_text { white-space: pre-wrap; - padding: 25px 3px; + padding: 15px 3px; + width: 100%; + height: 25%; + overflow: auto; } .external_link_img { diff --git a/share/tools/web_config/js/controllers.js b/share/tools/web_config/js/controllers.js index bd79dd613..9ae5c1a35 100644 --- a/share/tools/web_config/js/controllers.js +++ b/share/tools/web_config/js/controllers.js @@ -66,7 +66,6 @@ controllers.controller("colorsController", function($scope, $http) { 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) { - console.log(data); }) } }; @@ -77,40 +76,27 @@ controllers.controller("colorsController", function($scope, $http) { controllers.controller("promptController", function($scope, $http) { $scope.selectedPrompt = null; - $scope.fetchCurrentPrompt = function(currenttPrompt) { - $http.get("/current_prompt/").success(function(data, status, headers, config) { - currenttPrompt.function = data.function; - })}; - $scope.fetchSamplePrompts= function() { $http.get("/sample_prompts/").success(function(data, status, headers, config) { $scope.samplePrompts = data; + $scope.samplePromptsArrayArray = get_colors_as_nested_array($scope.samplePrompts, 1); + if ($scope.selectedPrompt == null) { $scope.selectPrompt($scope.samplePrompts[0]); } })}; - $scope.fetchSamplePrompt = function(selectedPrompt) { - console.log("Fetcing sample prompt"); - $http.post("/get_sample_prompt/","what=" + encodeURIComponent(selectedPrompt.function), { headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(data, status, headers, config) { - console.log("Data is " + JSON.stringify(data[0])); - $scope.demoText= data[0].demo; - $scope.demoTextFontSize = data[0].font_size; - console.log("Demo text is " + $scope.demoText); - })}; - $scope.selectPrompt = function(promptt) { $scope.selectedPrompt= promptt; - if ($scope.selectedPrompt.name == "Current") { - $scope.fetchCurrentPrompt($scope.selectedPrompt); - } - $scope.fetchSamplePrompt($scope.selectedPrompt); } $scope.setNewPrompt = function(selectedPrompt) { - console.log("Set new prompt" + selectedPrompt); $http.post("/set_prompt/","what=" + encodeURIComponent(selectedPrompt.function), { headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(function(data, status, headers, config){ - console.log("Data is " + JSON.stringify(data)); + + // Update attributes of current prompt + $scope.samplePrompts[0].demo = selectedPrompt.demo; + $scope.samplePrompts[0].function = selectedPrompt.function; + $scope.samplePrompts[0].font_size = selectedPrompt.font_size; })}; $scope.fetchSamplePrompts(); diff --git a/share/tools/web_config/partials/functions.html b/share/tools/web_config/partials/functions.html index 4ed3afcea..7442b1cee 100644 --- a/share/tools/web_config/partials/functions.html +++ b/share/tools/web_config/partials/functions.html @@ -8,4 +8,5 @@