From 41ff0f89f323744bdea421641a7f4f658df74693 Mon Sep 17 00:00:00 2001 From: Jason Skomorowski Date: Tue, 9 Dec 2014 15:57:39 -0500 Subject: [PATCH] Allow changes to mkws.config from tester.html WRIS-3 --- examples/htdocs/tester.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/examples/htdocs/tester.html b/examples/htdocs/tester.html index f178a17..3811653 100644 --- a/examples/htdocs/tester.html +++ b/examples/htdocs/tester.html @@ -191,6 +191,7 @@ header button:hover, header button:active, header button:focus { Settings: + @@ -219,6 +220,9 @@ header button:hover, header button:active, header button:focus {
+
+ +
@@ -244,8 +248,15 @@ if (localStorage.getItem('mkwstest-queries')) { if (localStorage.getItem('mkwstest-widget-markup')) { this.widgetMarkup = localStorage.getItem('mkwstest-widget-markup'); } +if (localStorage.getItem('mkwstest-mkws-config')) { + mkws_config = JSON.parse(localStorage.getItem('mkwstest-mkws-config')); +} $("#queries > textarea").html(this.queries.join("\n")); $("#widget-markup > textarea").html(this.widgetMarkup); +$("#mkws-config > textarea").html(JSON.stringify(mkws_config)); +mkws.setMkwsConfig(mkws_config); +mkws.authenticated = false; +mkws.authenticating = false; this.results = {}; var next = 0; @@ -309,6 +320,22 @@ $("#widget-markup").dialog("option", "buttons", [ {text: "Cancel", click: function() { $(this).dialog("close"); }} ]); +// MKWS config dialog +var updateConfig = function () { + mkws.setMkwsConfig(JSON.parse($("#mkws-config > textarea").val())); + mkws.authenticated = false; + mkws.authenticating = false; + localStorage.setItem("mkwstest-mkws-config", $("#mkws-config > textarea").val()); + startEval(); +} +$("#mkws-config-button").click(function () { + $("#mkws-config").dialog("open"); +}); +$("#mkws-config").dialog("option", "buttons", [ + {text: "Start new evaluation", click: updateConfig}, + {text: "Cancel", click: function() { $(this).dialog("close"); }} +]); + // Queries dialog var updateQueries = function () { context.queries = $("#queries > textarea").val().split("\n"); -- 1.7.10.4