Merge branch 'master' of ssh://git.indexdata.com/home/git/private/mkws
authorMike Taylor <mike@indexdata.com>
Fri, 1 Nov 2013 18:38:17 +0000 (18:38 +0000)
committerMike Taylor <mike@indexdata.com>
Fri, 1 Nov 2013 18:38:17 +0000 (18:38 +0000)
27 files changed:
examples/htdocs/dict.html [new file with mode: 0644]
examples/htdocs/index-full.html [deleted file]
examples/htdocs/index-jakub.html [deleted file]
examples/htdocs/index-jasmine-popup.html [deleted file]
examples/htdocs/index-jasmine.html [deleted file]
examples/htdocs/index-jquery.html [deleted file]
examples/htdocs/index-lowlevel.html [deleted file]
examples/htdocs/index-mike.html [deleted file]
examples/htdocs/index-mobile.html [deleted file]
examples/htdocs/index-popup.html [deleted file]
examples/htdocs/index-wolfram.html [deleted file]
examples/htdocs/jakub.html [new file with mode: 0644]
examples/htdocs/jasmine-popup.html [new file with mode: 0644]
examples/htdocs/jasmine.html [new file with mode: 0644]
examples/htdocs/jquery.html [new file with mode: 0644]
examples/htdocs/language.html [new file with mode: 0644]
examples/htdocs/lowlevel.html [new file with mode: 0644]
examples/htdocs/mike.html [new file with mode: 0644]
examples/htdocs/mobile.html [new file with mode: 0644]
examples/htdocs/popup.html [new file with mode: 0644]
examples/htdocs/wolfram.html [new file with mode: 0644]
test/Makefile
test/spec/mkws-index-jsdom-remote.spec.js
test/spec/mkws-index-jsdom.spec.js
test/spec/mkws-index-simple.spec.js
tools/htdocs/debugging-notes.txt [new file with mode: 0644]
tools/htdocs/index.html

diff --git a/examples/htdocs/dict.html b/examples/htdocs/dict.html
new file mode 100644 (file)
index 0000000..12ee573
--- /dev/null
@@ -0,0 +1,171 @@
+\r
+<html>\r
+  <head>\r
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+    <title>A-group silly demo</title>\r
+    <script type="text/javascript">\r
+      var mkws_config = {\r
+            //responsive_design_width: 990\r
+            //perpage_default: 10,\r
+            service_proxy_auth: "http://mkws.indexdata.com/service-proxy/?command=auth&action=login&username=dic&password=dic"\r
+        };\r
+    </script>\r
+    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />\r
+    <script src="http://mkws.indexdata.com/mkws-complete.js"></script>\r
+  </head>\r
+  <body>\r
+\r
+  <table height="100%" width="100%">\r
+  <tr valign="top" height="100%">\r
+    <td width="60%" valign="top">\r
+\r
+    <h1>MKWS: the MasterKey Widget Set</h1>\r
+    <p>\r
+      This site contains tools, not content:\r
+    </p>\r
+    <ul>\r
+      <li>\r
+        <a href="mkws.js">mkws.js</a>\r
+        --\r
+        JavaScript code that powers the MasterKey Widget Set\r
+      </li>\r
+      <li>\r
+        <a href="/libjs-pz2/pz2api.1.js">/libjs-pz2/pz2api.1.js</a>\r
+        --\r
+        Low-level JavaScript library for access to the MasterKey web\r
+        service.\r
+      </li>\r
+      <li>\r
+        <a href="mkws-complete.js"\r
+                >mkws-complete.js</a>\r
+        --\r
+        A single large JavaScript file containing everything needed for\r
+        MKWS to work: the widget-set itself, the API library, and any\r
+        additional prerequisites such as jQuery.\r
+      </li>\r
+      <li>\r
+        <a href="mkws.css">mkws.css</a>\r
+        --\r
+        A stylesheet which styles only MasterKey widgets, and does not\r
+        otherwise interfere with application-site's styles.\r
+    <!--\r
+        <p style="color:darkred">\r
+          Note. This is not yet quite true: the stylesheet needs tweaking\r
+          to make it more specific to only the MKWS components. At present\r
+          it spills over into styling parts of the containing site, too.\r
+        </p>\r
+    -->\r
+      </li>\r
+    </ul>\r
+    <p>\r
+      For examples of how to use the widget-set, see:\r
+    </p>\r
+    <ul>\r
+      <li>\r
+        A very simple application at\r
+        <a href="http://example.indexdata.com/"\r
+                >http://example.indexdata.com/</a>.\r
+        It's worth viewing the source to see how small it is.\r
+      </li>\r
+      <li>\r
+        <a href="http://example.indexdata.com/index-full.html"\r
+           >A more detailed version</a>\r
+       that contains a configuration structure instead of accepting\r
+        the defaults. Includes a custom translation option to present\r
+        the application in Arabic.\r
+      </li>\r
+      <li>\r
+        The\r
+        <a href="http://example.indexdata.com/index-jquery.html"\r
+           >jQuery plugin</a>\r
+        version, consisting of a single line of JavaScript code.\r
+      </li>\r
+      <li>\r
+       An application that\r
+       <a href="http://example.indexdata.com/index-lowlevel.html"\r
+          >uses lower-level MKWS components</a>\r
+       rather than the all-in-one <tt>#mkwsResults</tt> division,\r
+       allowing it to use a rather different layout.\r
+      </li>\r
+      <li>\r
+        <a href="http://example.indexdata.com/index-mobile.html"\r
+           >A version suitable for mobile devices</a>,\r
+       with a responsive design that moves components around\r
+        depending on the screen size.\r
+      </li>\r
+      <li>\r
+        <a href="http://example.indexdata.com/index-popup.html"\r
+           >A version that uses a jQuery popup</a>.\r
+      </li>\r
+      <li>\r
+        An existing web-site,\r
+        <a href="http://sagp.miketaylor.org.uk/"\r
+           >The Self-Appointed Grammar Police</a>,\r
+        which has been fitted with an MKWS searching widget.\r
+        (See also the MKWS-widget customisations in\r
+        <a href="http://sagp.miketaylor.org.uk/style.css"\r
+           >that site's stylesheet</a>.)\r
+      </li>\r
+      <li>\r
+       Another existing web-site,\r
+        <a href="http://zthes.z3950.org/"\r
+           >The Zthes specifications</a>,\r
+       which has been fitted with a popup MKWS search-box.\r
+      </li>\r
+    </ul>\r
+    <p>\r
+      The set of targets can be maintained:\r
+    </p>\r
+    <ul>\r
+      <li>\r
+       Use the main\r
+       <a href="http://mk2.indexdata.com/console/"\r
+          >MasterKey Admin Console</a>,\r
+       and act as the "MK Demo" library administrator.\r
+      </li>\r
+    </ul>\r
+    <p>\r
+      Documentation:\r
+    </p>\r
+    <ul>\r
+      <li>\r
+        The <a href="whitepaper.html">The whitepaper, including a reference section.</a>\r
+      </li>\r
+      <li>\r
+        The <a href="README.html">README.html</a>\r
+      </li>\r
+      <li>\r
+        The <a href="html-structure.txt"\r
+               >structure of the HTML generated by the MKWS widgets</a>,\r
+        which can be used to guide the customisation of its CSS styles.\r
+      </li>\r
+    </ul>\r
+  </td>\r
+  <td width="40%" align="top">\r
+       <div id="mkwsSearch"></div>\r
+       <div id="mkwsRecords"></div>\r
+       <div id="mkwsPager"></div>\r
+  </td>\r
+  </tr>\r
+  </table>\r
+    <script type="text/javascript">\r
+      $("#mkwsSearch").hide();\r
+      $("#mkwsPager").hide();\r
+\r
+      document.onclick = clickfunc;\r
+      var selectedtext="";\r
+      var clicking = false;\r
+      function clickfunc(e) {\r
+        var sel = window.getSelection();\r
+        //console.log("click: " + sel + "  clicking=" + clicking );\r
+        if ( sel != "" && ! clicking ) {\r
+          clicking  = true;\r
+          $("input#mkwsQuery").val(sel);\r
+          //console.log("click: Set value " + sel + "  clicking=" + clicking );\r
+          $("input#mkwsButton").trigger("click");\r
+          clicking = false;\r
+        }\r
+      }\r
+    </script>\r
+  </body>\r
+</html>\r
diff --git a/examples/htdocs/index-full.html b/examples/htdocs/index-full.html
deleted file mode 100644 (file)
index 3cf6e31..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <meta name="copyright" content="(c) 1999-2013 IndexData ApS, http://indexdata.com" />
-    <title>MKWS demo: full configuration</title>
-    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
-    <script type="text/javascript">
-       var mkws_config = {
-               lang: "da",
-               debug_level: 1,
-               use_service_proxy: true,
-               show_lang: true,
-               sort_default: "relevance",
-               query_width: 50,
-               perpage_default: 20,
-               language_Arabic: {
-                       "Authors": "الكتاب",
-                       "Subjects": "المواضيع",
-                       "Sources": "مصادر",
-                       "Termlists": "العضو الأجل",
-                       "Next": "التالي",
-                       "Prev": "السابق",
-                       "Search": "بحث",
-                       "Sort by": "الترتيب حسب",
-                       "and show": "وعرض",
-                       "per page": "في كل صفحة",
-                       "Displaying": "عرض",
-                       "to": "إلى",
-                       "of": "من",
-                       "found": "أسس",
-                       "Title": "لقب",
-                       "Author": "الكاتب",
-                       "Date": "تاريخ",
-                       "Subject": "موضوع",
-                       "Location": "موقع",
-                       "Records": "أهداف",
-                       "Targets": "السجلات"
-               }
-       };
-    </script>
-    <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
-  </head>
-  <body>
-    <div id="mkwsSwitch"></div>
-    <div id="mkwsLang"></div>
-    <div id="mkwsSearch"></div>
-    <div id="mkwsResults"></div>
-    <div id="mkwsTargets"></div>
-    <div id="mkwsMOTD">
-      <p>
-       <b>Welcome to the MasterKey Widget Set demo.</b>
-      </p>
-      <p>
-       Enter a search above to begin, or
-       <a href="http://mkws.indexdata.com/"
-          >Visit the MKWS home page to find out more</a>.
-      </p>
-    </div>
-    <div id="footer">
-      <div id="mkwsStat"></div>
-      <span>Powered by MKWS &copy; 2013 <a target="_new" href="http://www.indexdata.com">Index Data</a></span>
-    </div>
-  </body>
-</html>
diff --git a/examples/htdocs/index-jakub.html b/examples/htdocs/index-jakub.html
deleted file mode 100644 (file)
index 9433603..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo client</title>
-    <link rel="stylesheet" type="text/css" href="http://mkws-origin/mkws.css" />
-    <script type="text/javascript">
-      var mkws_config = {
-        pazpar2_url: "http://mkws-origin/service-proxy/",
-        service_proxy_auth: "http://mkws-origin/service-proxy-auth/"
-      };
-    </script>
-    <script type="text/javascript" src="http://mkws-origin/mkws-complete.js"></script>
-  </head>
-  <body>
-    <div id="mkwsSwitch"></div>
-    <div id="mkwsLang"></div>
-    <div id="mkwsSearch"></div>
-    <div id="mkwsResults"></div>
-    <div id="mkwsTargets"></div>
-    <div id="mkwsStat"></div>
-  </body>
-</html>
diff --git a/examples/htdocs/index-jasmine-popup.html b/examples/htdocs/index-jasmine-popup.html
deleted file mode 100644 (file)
index 38e673b..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo: jQuery popup plugin with jasmine</title>
-
-    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
-    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
-
-    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
-    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
-    <script type="text/javascript" src="../../tools/htdocs/mkws.js"></script>
-    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
-
-    <link rel="shortcut icon" type="image/png" href="../../../jasmine/lib/jasmine-1.3.1/jasmine_favicon.png">
-    <link rel="stylesheet" type="text/css" href="../../../jasmine/lib/jasmine-1.3.1/jasmine.css">
-    <script type="text/javascript" src="../../../jasmine/lib/jasmine-1.3.1/jasmine.js"></script>
-    <script type="text/javascript" src="../../../jasmine/lib/jasmine-1.3.1/jasmine-html.js"></script>
-
-    <script type="text/javascript" src="../../test/spec/true.spec.js"></script>
-    <script type="text/javascript" src="../../test/spec/mkws-config.js"></script>
-    <script type="text/javascript" src="../../test/spec/mkws-pazpar2.js"></script>
-
-    <script type="text/javascript" src="../../test/js/mkws-jasmine-run.js"></script>
-    <script type="text/javascript"> mkws_jasmine_init(500); </script>
-  </head>
-
-  <body>
-    <script type="text/javascript">
-    jQuery.pazpar2({
-        "layout": "popup",               /* "table" [default], "div", "popup" */
-        "id_button": "input#mkwsButton", /* submit button id in search field */
-        "id_popup": "#mkwsPopup",        /* internal id of popup window */
-        "width": 880,                    /* popup width, should be at least 800 */
-        "height": 760                    /* popup height, should be at least 600 */
-    });
-    </script>
-
-    <pre>
-An embryonic MasterKey Widget Set
-=================================
-
-This directory contains an embryonic MasterKey Widget Set, based
-initially on "jsdemo" though now far removed from those beginnnings.
-[...]
-    </pre>
-  </body>
-</html>
diff --git a/examples/htdocs/index-jasmine.html b/examples/htdocs/index-jasmine.html
deleted file mode 100644 (file)
index 818123c..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo: Wolfram's playground</title>
-    <link rel="stylesheet" type="text/css" href="../../tools/htdocs/mkws.css" />
-    <script type="text/javascript">
-      var mkws_config = {
-         /*
-         pazpar2_url : "/service-proxy/",
-         service_proxy_auth : "/service-proxy-auth/",
-         */
-      };
-    </script>
-    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
-    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
-    <script type="text/javascript" src="../../tools/htdocs/mkws.js"></script>
-    <style type="text/css">
-      #mkwsTermlists div.facet {
-      float:left;
-      width: 30%;
-      margin: 0.3em;
-      }
-      #mkwsStat {
-      text-align: right;
-      }
-    </style>
-
-  <!-- SECTION jasmine -->
-    <link rel="shortcut icon" type="image/png" href="../../../jasmine/lib/jasmine-1.3.1/jasmine_favicon.png">
-    <link rel="stylesheet" type="text/css" href="../../../jasmine/lib/jasmine-1.3.1/jasmine.css">
-    <script type="text/javascript" src="../../../jasmine/lib/jasmine-1.3.1/jasmine.js"></script>
-    <script type="text/javascript" src="../../../jasmine/lib/jasmine-1.3.1/jasmine-html.js"></script>
-
-    <!-- include MKWS spec files ... -->
-    <script type="text/javascript" src="../../test/spec/true.spec.js"></script>
-    <script type="text/javascript" src="../../test/spec/mkws-config.js"></script>
-    <script type="text/javascript" src="../../test/spec/mkws-pazpar2.js"></script>
-
-    <!-- init and run jasmine -->
-    <script type="text/javascript" src="../../test/js/mkws-jasmine-run.js"></script>
-    <script type="text/javascript">
-      mkws_jasmine_init(500);
-    </script>
-  <!-- EOF jasmine -->
-
-  </head>
-  <body>
-    <table width="100%" border="0">
-      <tr>
-        <td>
-          <div id="mkwsSwitch"></div>
-          <div id="mkwsLang"></div>
-          <div id="mkwsSearch"></div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div style="height:500px; overflow: auto">
-            <div id="mkwsPager"></div>
-            <div id="mkwsNavi"></div>
-            <div id="mkwsRecords"></div>
-            <div id="mkwsTargets"></div>
-            <div id="mkwsRanking"></div>
-          </div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div style="height:300px; overflow: hidden">
-            <div id="mkwsTermlists"></div>
-          </div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div id="mkwsStat"></div>
-        </td>
-      </tr>
-    </table>
-
-  </body>
-</html>
diff --git a/examples/htdocs/index-jquery.html b/examples/htdocs/index-jquery.html
deleted file mode 100644 (file)
index f46a040..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo: jQuery plugin</title>
-    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
-    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
-    <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
-    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
-  </head>
-  <body>
-    <script type="text/javascript">
-    jQuery.pazpar2({
-        "layout": "popup",               /* "table" [default], "div", "popup" */
-        "id_button": "input#mkwsButton", /* submit button id in search field */
-        "id_popup": "#mkwsPopup",        /* internal id of popup window */
-        "width": 880,                    /* popup width, should be at least 800 */ 
-        "height": 760                    /* popup height, should be at least 600 */
-    });
-    </script>
-  </body>
-</html>
diff --git a/examples/htdocs/index-lowlevel.html b/examples/htdocs/index-lowlevel.html
deleted file mode 100644 (file)
index d2e8ed7..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo: low-level subcomponents</title>
-    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
-    <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
-    <style type="text/css">
-      #mkwsTermlists div.facet {
-      float:left;
-      width: 30%;
-      margin: 0.3em;
-      }
-      #mkwsStat {
-      text-align: right;
-      }
-    </style>
-  </head>
-  <body>
-    <table width="100%" border="0">
-      <tr>
-        <td>
-          <div id="mkwsSwitch"></div>
-          <div id="mkwsLang"></div>
-          <div id="mkwsSearch"></div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div style="height:500px; overflow: auto">
-            <div id="mkwsPager"></div>
-            <div id="mkwsNavi"></div>
-            <div id="mkwsRecords"></div>
-            <div id="mkwsTargets"></div>
-            <div id="mkwsRanking"></div>
-          </div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div style="height:300px; overflow: hidden">
-            <div id="mkwsTermlists"></div>
-          </div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div id="mkwsStat"></div>
-        </td>
-      </tr>
-    </table>
-  </body>
-</html>
diff --git a/examples/htdocs/index-mike.html b/examples/htdocs/index-mike.html
deleted file mode 100644 (file)
index 47848f8..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo: Mike's playground</title>
-    <link rel="stylesheet" type="text/css" href="http://mkws-git.indexdata.com/mkws.css" />
-    <script type="text/javascript">
-      var mkws_config = {
-        responsive_design_width: 600,
-        debug_level: 1,
-        //service_proxy_auth: "/service-proxy-auth-mike"
-      };
-    </script>
-    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
-    <script type="text/javascript" src="http://mkws-git.indexdata.com/libjs-pz2/pz2api.1.js"></script>
-    <script type="text/javascript" src="http://mkws-git.indexdata.com/mkws.js"></script>
-    <style type="text/css">
-      #mkwsTermlists div.facet {
-      float:left;
-      width: 30%;
-      margin: 0.3em;
-      }
-      #mkwsStat {
-      text-align: right;
-      }
-    </style>
-  </head>
-  <body>
-    <table width="100%" border="0">
-      <tr>
-        <td>
-          <div id="mkwsSwitch"></div>
-          <div id="mkwsLang"></div>
-          <div id="mkwsSearch"></div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div style="height:500px; overflow: auto">
-            <div id="mkwsPager"></div>
-            <div id="mkwsNavi"></div>
-            <div id="mkwsRecords"></div>
-            <div id="mkwsTargets"></div>
-            <div id="mkwsRanking"></div>
-          </div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div style="height:300px; overflow: hidden">
-            <div id="mkwsTermlists"></div>
-          </div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div id="mkwsStat"></div>
-        </td>
-      </tr>
-    </table>
-  </body>
-</html>
diff --git a/examples/htdocs/index-mobile.html b/examples/htdocs/index-mobile.html
deleted file mode 100644 (file)
index 268528a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <meta name="copyright" content="(c) 1999-2013 IndexData ApS, http://indexdata.com" />
-    <title>MKWS demo: mobile-screen resizing</title>
-    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
-    <script type="text/javascript">
-       var mkws_config = {
-               lang: "da",
-               debug_level: 1,
-               use_service_proxy: true,
-               show_lang: true,
-               lang_options: ["da", "en"],
-               sort_default: "relevance",
-               query_width: 50,
-               facets: ["authors", "sources", "subjects"],
-               responsive_design_width: 990,
-               perpage_default: 20
-        };
-    </script>
-    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
-    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
-    <script type="text/javascript" src="http://mkws.indexdata.com/mkws.js"></script>
-  </head>
-  <body>
-    <div id="mkwsLang"></div>
-    <div id="mkwsSearch"></div>
-    <div id="mkwsResults"></div>
-    <div id="mkwsTargets"></div>
-    <div id="mkwsStat"></div>
-  </body>
-</html>
diff --git a/examples/htdocs/index-popup.html b/examples/htdocs/index-popup.html
deleted file mode 100644 (file)
index b27b252..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo: popup search box</title>
-
-    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
-    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
-
-    <script type="text/javascript">
-      mkws_config = {
-       show_lang: false,
-       perpage_default: 10,
-       query_width: 50,
-        service_proxy_auth: "http://mkws.indexdata.com/service-proxy-auth"
-     };
-    </script>
-
-    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
-    <!-- legacy libs for testing
-    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
-    <script src="http://code.jquery.com/ui/1.8.0/jquery-ui.min.js"></script>
-    -->
-
-    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
-    <script type="text/javascript" src="http://mkws.indexdata.com/mkws.js"></script>
-
-  </head>
-  <body>
-    <script type="text/javascript">
-     jQuery.pazpar2({ "layout":"popup", width: 800, height: 500 } );
-    </script>
-
-    <pre>
-      An embryonic MasterKey Widget Set
-=================================
-
-This directory contains an embryonic MasterKey Widget Set, based
-initially on "jsdemo" though now far removed from those beginnnings.
-
-
-How this works
---------------
-
-The goal is to make it that as much of the searching functionality as
-possible is hosted on
-        http://mkws.indexdata.com/
-so that very simple websites such as
-        http://example.indexdata.com/
-can have MasterKey searching with minimal effort.
-
-The following files must be hosted on mkws.indexdata.com:
-        mkws.js
-        mkws.css
-        /libjs-pz2/pz2api.1.js (*)
-
-The following files make up the application:
-        index.html
-        favicon.ico [optional]
-        robots.txt [optional]
-
-(At present, the client application's configuruation also needs an
-Alias for /service-proxy/, to avoid cross-site scripting issues. We
-will fix this.)
-
-(*) if you don't have already installed libjs-pz2 on the machine, you can
-do it by installing a debian package or check it out from GIT:
-$ git clone ssh://git.indexdata.com:222/home/git/pub/libjs-pz2
-
-Configuring a client
---------------------
-
-The application's HTML must contains the following elements as well as
-whatever makes up the application itself:
-
-[...]
-    </pre>
-    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
-  </body>
-</html>
diff --git a/examples/htdocs/index-wolfram.html b/examples/htdocs/index-wolfram.html
deleted file mode 100644 (file)
index 29f9642..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>MKWS demo: Wolfram's playground</title>
-    <link rel="stylesheet" type="text/css" href="../../tools/htdocs/mkws.css" />
-    <script type="text/javascript">
-      var mkws_config = {
-       /*
-         pazpar2_url : "/service-proxy/",
-         service_proxy_auth : "/service-proxy-auth/",
-         */
-      };
-    </script>
-    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
-    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
-    <script type="text/javascript" src="../../tools/htdocs/mkws.js"></script>
-    <style type="text/css">
-      #mkwsTermlists div.facet {
-      float:left;
-      width: 30%;
-      margin: 0.3em;
-      }
-      #mkwsStat {
-      text-align: right;
-      }
-    </style>
-  </head>
-  <body>
-    <table width="100%" border="0">
-      <tr>
-        <td>
-         <div id="mkwsSwitch"></div>
-          <div id="mkwsLang"></div>
-          <div id="mkwsSearch"></div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div style="height:500px; overflow: auto">
-            <div id="mkwsPager"></div>
-            <div id="mkwsNavi"></div>
-            <div id="mkwsRecords"></div>
-            <div id="mkwsTargets"></div>
-            <div id="mkwsRanking"></div>
-          </div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div style="height:300px; overflow: hidden">
-            <div id="mkwsTermlists"></div>
-          </div>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <div id="mkwsStat"></div>
-        </td>
-      </tr>
-    </table>
-  </body>
-</html>
diff --git a/examples/htdocs/jakub.html b/examples/htdocs/jakub.html
new file mode 100644 (file)
index 0000000..9433603
--- /dev/null
@@ -0,0 +1,22 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>MKWS demo client</title>
+    <link rel="stylesheet" type="text/css" href="http://mkws-origin/mkws.css" />
+    <script type="text/javascript">
+      var mkws_config = {
+        pazpar2_url: "http://mkws-origin/service-proxy/",
+        service_proxy_auth: "http://mkws-origin/service-proxy-auth/"
+      };
+    </script>
+    <script type="text/javascript" src="http://mkws-origin/mkws-complete.js"></script>
+  </head>
+  <body>
+    <div id="mkwsSwitch"></div>
+    <div id="mkwsLang"></div>
+    <div id="mkwsSearch"></div>
+    <div id="mkwsResults"></div>
+    <div id="mkwsTargets"></div>
+    <div id="mkwsStat"></div>
+  </body>
+</html>
diff --git a/examples/htdocs/jasmine-popup.html b/examples/htdocs/jasmine-popup.html
new file mode 100644 (file)
index 0000000..38e673b
--- /dev/null
@@ -0,0 +1,47 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>MKWS demo: jQuery popup plugin with jasmine</title>
+
+    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
+    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
+
+    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
+    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
+    <script type="text/javascript" src="../../tools/htdocs/mkws.js"></script>
+    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
+
+    <link rel="shortcut icon" type="image/png" href="../../../jasmine/lib/jasmine-1.3.1/jasmine_favicon.png">
+    <link rel="stylesheet" type="text/css" href="../../../jasmine/lib/jasmine-1.3.1/jasmine.css">
+    <script type="text/javascript" src="../../../jasmine/lib/jasmine-1.3.1/jasmine.js"></script>
+    <script type="text/javascript" src="../../../jasmine/lib/jasmine-1.3.1/jasmine-html.js"></script>
+
+    <script type="text/javascript" src="../../test/spec/true.spec.js"></script>
+    <script type="text/javascript" src="../../test/spec/mkws-config.js"></script>
+    <script type="text/javascript" src="../../test/spec/mkws-pazpar2.js"></script>
+
+    <script type="text/javascript" src="../../test/js/mkws-jasmine-run.js"></script>
+    <script type="text/javascript"> mkws_jasmine_init(500); </script>
+  </head>
+
+  <body>
+    <script type="text/javascript">
+    jQuery.pazpar2({
+        "layout": "popup",               /* "table" [default], "div", "popup" */
+        "id_button": "input#mkwsButton", /* submit button id in search field */
+        "id_popup": "#mkwsPopup",        /* internal id of popup window */
+        "width": 880,                    /* popup width, should be at least 800 */
+        "height": 760                    /* popup height, should be at least 600 */
+    });
+    </script>
+
+    <pre>
+An embryonic MasterKey Widget Set
+=================================
+
+This directory contains an embryonic MasterKey Widget Set, based
+initially on "jsdemo" though now far removed from those beginnnings.
+[...]
+    </pre>
+  </body>
+</html>
diff --git a/examples/htdocs/jasmine.html b/examples/htdocs/jasmine.html
new file mode 100644 (file)
index 0000000..818123c
--- /dev/null
@@ -0,0 +1,82 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>MKWS demo: Wolfram's playground</title>
+    <link rel="stylesheet" type="text/css" href="../../tools/htdocs/mkws.css" />
+    <script type="text/javascript">
+      var mkws_config = {
+         /*
+         pazpar2_url : "/service-proxy/",
+         service_proxy_auth : "/service-proxy-auth/",
+         */
+      };
+    </script>
+    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
+    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
+    <script type="text/javascript" src="../../tools/htdocs/mkws.js"></script>
+    <style type="text/css">
+      #mkwsTermlists div.facet {
+      float:left;
+      width: 30%;
+      margin: 0.3em;
+      }
+      #mkwsStat {
+      text-align: right;
+      }
+    </style>
+
+  <!-- SECTION jasmine -->
+    <link rel="shortcut icon" type="image/png" href="../../../jasmine/lib/jasmine-1.3.1/jasmine_favicon.png">
+    <link rel="stylesheet" type="text/css" href="../../../jasmine/lib/jasmine-1.3.1/jasmine.css">
+    <script type="text/javascript" src="../../../jasmine/lib/jasmine-1.3.1/jasmine.js"></script>
+    <script type="text/javascript" src="../../../jasmine/lib/jasmine-1.3.1/jasmine-html.js"></script>
+
+    <!-- include MKWS spec files ... -->
+    <script type="text/javascript" src="../../test/spec/true.spec.js"></script>
+    <script type="text/javascript" src="../../test/spec/mkws-config.js"></script>
+    <script type="text/javascript" src="../../test/spec/mkws-pazpar2.js"></script>
+
+    <!-- init and run jasmine -->
+    <script type="text/javascript" src="../../test/js/mkws-jasmine-run.js"></script>
+    <script type="text/javascript">
+      mkws_jasmine_init(500);
+    </script>
+  <!-- EOF jasmine -->
+
+  </head>
+  <body>
+    <table width="100%" border="0">
+      <tr>
+        <td>
+          <div id="mkwsSwitch"></div>
+          <div id="mkwsLang"></div>
+          <div id="mkwsSearch"></div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div style="height:500px; overflow: auto">
+            <div id="mkwsPager"></div>
+            <div id="mkwsNavi"></div>
+            <div id="mkwsRecords"></div>
+            <div id="mkwsTargets"></div>
+            <div id="mkwsRanking"></div>
+          </div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div style="height:300px; overflow: hidden">
+            <div id="mkwsTermlists"></div>
+          </div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div id="mkwsStat"></div>
+        </td>
+      </tr>
+    </table>
+
+  </body>
+</html>
diff --git a/examples/htdocs/jquery.html b/examples/htdocs/jquery.html
new file mode 100644 (file)
index 0000000..f46a040
--- /dev/null
@@ -0,0 +1,21 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>MKWS demo: jQuery plugin</title>
+    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
+    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
+    <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
+    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
+  </head>
+  <body>
+    <script type="text/javascript">
+    jQuery.pazpar2({
+        "layout": "popup",               /* "table" [default], "div", "popup" */
+        "id_button": "input#mkwsButton", /* submit button id in search field */
+        "id_popup": "#mkwsPopup",        /* internal id of popup window */
+        "width": 880,                    /* popup width, should be at least 800 */ 
+        "height": 760                    /* popup height, should be at least 600 */
+    });
+    </script>
+  </body>
+</html>
diff --git a/examples/htdocs/language.html b/examples/htdocs/language.html
new file mode 100644 (file)
index 0000000..3cf6e31
--- /dev/null
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <meta name="copyright" content="(c) 1999-2013 IndexData ApS, http://indexdata.com" />
+    <title>MKWS demo: full configuration</title>
+    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
+    <script type="text/javascript">
+       var mkws_config = {
+               lang: "da",
+               debug_level: 1,
+               use_service_proxy: true,
+               show_lang: true,
+               sort_default: "relevance",
+               query_width: 50,
+               perpage_default: 20,
+               language_Arabic: {
+                       "Authors": "الكتاب",
+                       "Subjects": "المواضيع",
+                       "Sources": "مصادر",
+                       "Termlists": "العضو الأجل",
+                       "Next": "التالي",
+                       "Prev": "السابق",
+                       "Search": "بحث",
+                       "Sort by": "الترتيب حسب",
+                       "and show": "وعرض",
+                       "per page": "في كل صفحة",
+                       "Displaying": "عرض",
+                       "to": "إلى",
+                       "of": "من",
+                       "found": "أسس",
+                       "Title": "لقب",
+                       "Author": "الكاتب",
+                       "Date": "تاريخ",
+                       "Subject": "موضوع",
+                       "Location": "موقع",
+                       "Records": "أهداف",
+                       "Targets": "السجلات"
+               }
+       };
+    </script>
+    <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
+  </head>
+  <body>
+    <div id="mkwsSwitch"></div>
+    <div id="mkwsLang"></div>
+    <div id="mkwsSearch"></div>
+    <div id="mkwsResults"></div>
+    <div id="mkwsTargets"></div>
+    <div id="mkwsMOTD">
+      <p>
+       <b>Welcome to the MasterKey Widget Set demo.</b>
+      </p>
+      <p>
+       Enter a search above to begin, or
+       <a href="http://mkws.indexdata.com/"
+          >Visit the MKWS home page to find out more</a>.
+      </p>
+    </div>
+    <div id="footer">
+      <div id="mkwsStat"></div>
+      <span>Powered by MKWS &copy; 2013 <a target="_new" href="http://www.indexdata.com">Index Data</a></span>
+    </div>
+  </body>
+</html>
diff --git a/examples/htdocs/lowlevel.html b/examples/htdocs/lowlevel.html
new file mode 100644 (file)
index 0000000..d2e8ed7
--- /dev/null
@@ -0,0 +1,52 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>MKWS demo: low-level subcomponents</title>
+    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
+    <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
+    <style type="text/css">
+      #mkwsTermlists div.facet {
+      float:left;
+      width: 30%;
+      margin: 0.3em;
+      }
+      #mkwsStat {
+      text-align: right;
+      }
+    </style>
+  </head>
+  <body>
+    <table width="100%" border="0">
+      <tr>
+        <td>
+          <div id="mkwsSwitch"></div>
+          <div id="mkwsLang"></div>
+          <div id="mkwsSearch"></div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div style="height:500px; overflow: auto">
+            <div id="mkwsPager"></div>
+            <div id="mkwsNavi"></div>
+            <div id="mkwsRecords"></div>
+            <div id="mkwsTargets"></div>
+            <div id="mkwsRanking"></div>
+          </div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div style="height:300px; overflow: hidden">
+            <div id="mkwsTermlists"></div>
+          </div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div id="mkwsStat"></div>
+        </td>
+      </tr>
+    </table>
+  </body>
+</html>
diff --git a/examples/htdocs/mike.html b/examples/htdocs/mike.html
new file mode 100644 (file)
index 0000000..47848f8
--- /dev/null
@@ -0,0 +1,61 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>MKWS demo: Mike's playground</title>
+    <link rel="stylesheet" type="text/css" href="http://mkws-git.indexdata.com/mkws.css" />
+    <script type="text/javascript">
+      var mkws_config = {
+        responsive_design_width: 600,
+        debug_level: 1,
+        //service_proxy_auth: "/service-proxy-auth-mike"
+      };
+    </script>
+    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
+    <script type="text/javascript" src="http://mkws-git.indexdata.com/libjs-pz2/pz2api.1.js"></script>
+    <script type="text/javascript" src="http://mkws-git.indexdata.com/mkws.js"></script>
+    <style type="text/css">
+      #mkwsTermlists div.facet {
+      float:left;
+      width: 30%;
+      margin: 0.3em;
+      }
+      #mkwsStat {
+      text-align: right;
+      }
+    </style>
+  </head>
+  <body>
+    <table width="100%" border="0">
+      <tr>
+        <td>
+          <div id="mkwsSwitch"></div>
+          <div id="mkwsLang"></div>
+          <div id="mkwsSearch"></div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div style="height:500px; overflow: auto">
+            <div id="mkwsPager"></div>
+            <div id="mkwsNavi"></div>
+            <div id="mkwsRecords"></div>
+            <div id="mkwsTargets"></div>
+            <div id="mkwsRanking"></div>
+          </div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div style="height:300px; overflow: hidden">
+            <div id="mkwsTermlists"></div>
+          </div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div id="mkwsStat"></div>
+        </td>
+      </tr>
+    </table>
+  </body>
+</html>
diff --git a/examples/htdocs/mobile.html b/examples/htdocs/mobile.html
new file mode 100644 (file)
index 0000000..268528a
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <meta name="copyright" content="(c) 1999-2013 IndexData ApS, http://indexdata.com" />
+    <title>MKWS demo: mobile-screen resizing</title>
+    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
+    <script type="text/javascript">
+       var mkws_config = {
+               lang: "da",
+               debug_level: 1,
+               use_service_proxy: true,
+               show_lang: true,
+               lang_options: ["da", "en"],
+               sort_default: "relevance",
+               query_width: 50,
+               facets: ["authors", "sources", "subjects"],
+               responsive_design_width: 990,
+               perpage_default: 20
+        };
+    </script>
+    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
+    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
+    <script type="text/javascript" src="http://mkws.indexdata.com/mkws.js"></script>
+  </head>
+  <body>
+    <div id="mkwsLang"></div>
+    <div id="mkwsSearch"></div>
+    <div id="mkwsResults"></div>
+    <div id="mkwsTargets"></div>
+    <div id="mkwsStat"></div>
+  </body>
+</html>
diff --git a/examples/htdocs/popup.html b/examples/htdocs/popup.html
new file mode 100644 (file)
index 0000000..b27b252
--- /dev/null
@@ -0,0 +1,79 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>MKWS demo: popup search box</title>
+
+    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
+    <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkws.css" />
+
+    <script type="text/javascript">
+      mkws_config = {
+       show_lang: false,
+       perpage_default: 10,
+       query_width: 50,
+        service_proxy_auth: "http://mkws.indexdata.com/service-proxy-auth"
+     };
+    </script>
+
+    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
+    <!-- legacy libs for testing
+    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
+    <script src="http://code.jquery.com/ui/1.8.0/jquery-ui.min.js"></script>
+    -->
+
+    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
+    <script type="text/javascript" src="http://mkws.indexdata.com/mkws.js"></script>
+
+  </head>
+  <body>
+    <script type="text/javascript">
+     jQuery.pazpar2({ "layout":"popup", width: 800, height: 500 } );
+    </script>
+
+    <pre>
+      An embryonic MasterKey Widget Set
+=================================
+
+This directory contains an embryonic MasterKey Widget Set, based
+initially on "jsdemo" though now far removed from those beginnnings.
+
+
+How this works
+--------------
+
+The goal is to make it that as much of the searching functionality as
+possible is hosted on
+        http://mkws.indexdata.com/
+so that very simple websites such as
+        http://example.indexdata.com/
+can have MasterKey searching with minimal effort.
+
+The following files must be hosted on mkws.indexdata.com:
+        mkws.js
+        mkws.css
+        /libjs-pz2/pz2api.1.js (*)
+
+The following files make up the application:
+        index.html
+        favicon.ico [optional]
+        robots.txt [optional]
+
+(At present, the client application's configuruation also needs an
+Alias for /service-proxy/, to avoid cross-site scripting issues. We
+will fix this.)
+
+(*) if you don't have already installed libjs-pz2 on the machine, you can
+do it by installing a debian package or check it out from GIT:
+$ git clone ssh://git.indexdata.com:222/home/git/pub/libjs-pz2
+
+Configuring a client
+--------------------
+
+The application's HTML must contains the following elements as well as
+whatever makes up the application itself:
+
+[...]
+    </pre>
+    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
+  </body>
+</html>
diff --git a/examples/htdocs/wolfram.html b/examples/htdocs/wolfram.html
new file mode 100644 (file)
index 0000000..29f9642
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>MKWS demo: Wolfram's playground</title>
+    <link rel="stylesheet" type="text/css" href="../../tools/htdocs/mkws.css" />
+    <script type="text/javascript">
+      var mkws_config = {
+       /*
+         pazpar2_url : "/service-proxy/",
+         service_proxy_auth : "/service-proxy-auth/",
+         */
+      };
+    </script>
+    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
+    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
+    <script type="text/javascript" src="../../tools/htdocs/mkws.js"></script>
+    <style type="text/css">
+      #mkwsTermlists div.facet {
+      float:left;
+      width: 30%;
+      margin: 0.3em;
+      }
+      #mkwsStat {
+      text-align: right;
+      }
+    </style>
+  </head>
+  <body>
+    <table width="100%" border="0">
+      <tr>
+        <td>
+         <div id="mkwsSwitch"></div>
+          <div id="mkwsLang"></div>
+          <div id="mkwsSearch"></div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div style="height:500px; overflow: auto">
+            <div id="mkwsPager"></div>
+            <div id="mkwsNavi"></div>
+            <div id="mkwsRecords"></div>
+            <div id="mkwsTargets"></div>
+            <div id="mkwsRanking"></div>
+          </div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div style="height:300px; overflow: hidden">
+            <div id="mkwsTermlists"></div>
+          </div>
+        </td>
+      </tr>
+      <tr>
+        <td>
+          <div id="mkwsStat"></div>
+        </td>
+      </tr>
+    </table>
+  </body>
+</html>
index 532e776..8891679 100644 (file)
@@ -9,7 +9,7 @@ distclean:
        
 
 check:
-       jasmine-node ./spec 
+       jasmine-node --captureExceptions ./spec 
 
 test: check
 
index ed20b93..c885d67 100644 (file)
@@ -17,7 +17,7 @@ function jsdom_check(file, tags_array, ignore_doctype) {
     var html = fs.readFileSync(file, "utf-8");
     var tags = utils.flat_list(tags_array);
 
-    describe("index-full.html jsdom + jquery for " + file, function () {
+    describe("language.html jsdom + jquery for " + file, function () {
         var window = require('jsdom').jsdom(html, null, {
             FetchExternalResources: false,
             ProcessExternalResources: false,
@@ -51,9 +51,9 @@ function jsdom_check(file, tags_array, ignore_doctype) {
 }
 
 /*
-jsdom_check('../examples/htdocs/index-full.html', [utils.tags.required, utils.tags.optional, utils.tags.optional2]);
-jsdom_check('../examples/htdocs/index-mobile.html', [utils.tags.required, utils.tags.optional]);
-jsdom_check('../examples/htdocs/index-popup.html', [], true);
-jsdom_check('../examples/htdocs/index-jquery.html', []);
-jsdom_check('../examples/htdocs/index-mike.html', [utils.tags.required, utils.tags.optional], true);
+jsdom_check('../examples/htdocs/language.html', [utils.tags.required, utils.tags.optional, utils.tags.optional2]);
+jsdom_check('../examples/htdocs/mobile.html', [utils.tags.required, utils.tags.optional]);
+jsdom_check('../examples/htdocs/popup.html', [], true);
+jsdom_check('../examples/htdocs/jquery.html', []);
+jsdom_check('../examples/htdocs/mike.html', [utils.tags.required, utils.tags.optional], true);
 */
index 8106441..bd481c3 100644 (file)
@@ -17,7 +17,7 @@ function jsdom_check(file, tags_array, ignore_doctype) {
     var html = fs.readFileSync(file, "utf-8");
     var tags = utils.flat_list(tags_array);
 
-    describe("index-full.html jsdom + jquery for " + file, function () {
+    describe("language.html jsdom + jquery for " + file, function () {
         var window = require('jsdom').jsdom(html, null, {
             FetchExternalResources: false,
             ProcessExternalResources: false,
@@ -50,8 +50,8 @@ function jsdom_check(file, tags_array, ignore_doctype) {
     });
 }
 
-jsdom_check('../examples/htdocs/index-full.html', [utils.tags.required, utils.tags.optional, utils.tags.optional2]);
-jsdom_check('../examples/htdocs/index-mobile.html', [utils.tags.required, utils.tags.optional]);
-jsdom_check('../examples/htdocs/index-popup.html', [], true);
-jsdom_check('../examples/htdocs/index-jquery.html', []);
-jsdom_check('../examples/htdocs/index-mike.html', [utils.tags.required, utils.tags.optional], true);
+jsdom_check('../examples/htdocs/language.html', [utils.tags.required, utils.tags.optional, utils.tags.optional2]);
+jsdom_check('../examples/htdocs/mobile.html', [utils.tags.required, utils.tags.optional]);
+jsdom_check('../examples/htdocs/popup.html', [], true);
+jsdom_check('../examples/htdocs/jquery.html', []);
+jsdom_check('../examples/htdocs/mike.html', [utils.tags.required, utils.tags.optional], true);
index 9ae5a69..dd43bb9 100644 (file)
@@ -17,7 +17,7 @@ function html_check(file, tags_array, ignore_doctype) {
     var html = fs.readFileSync(file, "utf-8");
     var tags = utils.flat_list(tags_array);
 
-    describe("index-full.html string test for " + file, function () {
+    describe("language.html string test for " + file, function () {
         it("html test", function () {
             expect(html).toBeDefined();
 
@@ -45,8 +45,8 @@ function html_check(file, tags_array, ignore_doctype) {
     });
 }
 
-html_check('../examples/htdocs/index-full.html', [utils.tags.required, utils.tags.optional, utils.tags.optional2]);
-html_check('../examples/htdocs/index-mobile.html', [utils.tags.required, utils.tags.optional]);
-html_check('../examples/htdocs/index-popup.html', [], true);
-html_check('../examples/htdocs/index-jquery.html', []);
-html_check('../examples/htdocs/index-mike.html', [utils.tags.required, utils.tags.optional], true);
+html_check('../examples/htdocs/language.html', [utils.tags.required, utils.tags.optional, utils.tags.optional2]);
+html_check('../examples/htdocs/mobile.html', [utils.tags.required, utils.tags.optional]);
+html_check('../examples/htdocs/popup.html', [], true);
+html_check('../examples/htdocs/jquery.html', []);
+html_check('../examples/htdocs/mike.html', [utils.tags.required, utils.tags.optional], true);
diff --git a/tools/htdocs/debugging-notes.txt b/tools/htdocs/debugging-notes.txt
new file mode 100644 (file)
index 0000000..c28d520
--- /dev/null
@@ -0,0 +1,7 @@
+config_default.debug_level is initialised to 1
+mkws_config.debug_level may be set by the application
+mkws.debug_level is set from one of the above
+mkws.debug_time is self-contained, and used well
+mkws.debug_function is a function
+var debug is a local alias of mkws.debug_function
+debug2 is a function that calls debug after 500 ms -- what?!
index 1d929b5..8c8ec2d 100644 (file)
@@ -60,7 +60,7 @@
         It's worth viewing the source to see how small it is.
       </li>
       <li>
-        <a href="http://example.indexdata.com/index-full.html"
+        <a href="http://example.indexdata.com/language.html"
            >A more detailed version</a>
        that contains a configuration structure instead of accepting
         the defaults. Includes a custom translation option to present
       </li>
       <li>
         The
-        <a href="http://example.indexdata.com/index-jquery.html"
+        <a href="http://example.indexdata.com/jquery.html"
            >jQuery plugin</a>
         version, consisting of a single line of JavaScript code.
       </li>
       <li>
        An application that
-       <a href="http://example.indexdata.com/index-lowlevel.html"
+       <a href="http://example.indexdata.com/lowlevel.html"
           >uses lower-level MKWS components</a>
        rather than the all-in-one <tt>#mkwsResults</tt> division,
        allowing it to use a rather different layout.
       </li>
       <li>
-        <a href="http://example.indexdata.com/index-mobile.html"
+        <a href="http://example.indexdata.com/mobile.html"
            >A version suitable for mobile devices</a>,
        with a responsive design that moves components around
         depending on the screen size.
       </li>
       <li>
-        <a href="http://example.indexdata.com/index-popup.html"
+        <a href="http://example.indexdata.com/popup.html"
            >A version that uses a jQuery popup</a>.
       </li>
       <li>
+        <a href="http://example.indexdata.com/dict.html"
+           >An application that used MKWS to find dictionary
+           definitions of words when you highlight them</a>.
+      </li>
+      <li>
         An existing web-site,
         <a href="http://sagp.miketaylor.org.uk/"
            >The Self-Appointed Grammar Police</a>,