<span id="settings">
Settings:
<button id="widget-markup-button">Widget</button>
+ <button id="mkws-config-button">MKWS config</button>
<button id="queries-button">Queries</button>
</span>
<span id="results">
<div id="widget-markup" class="dialog" title="Widget markup">
<textarea></textarea>
</div>
+<div id="mkws-config" class="dialog" title="MKWS configuration">
+ <textarea></textarea>
+</div>
<div id="queries" class="dialog" title="Queries">
<textarea></textarea>
</div>
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;
{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");