Merge branch 'master' of ssh://git.indexdata.com/home/git/private/mkws
authorMike Taylor <mike@indexdata.com>
Mon, 11 Nov 2013 14:06:09 +0000 (14:06 +0000)
committerMike Taylor <mike@indexdata.com>
Mon, 11 Nov 2013 14:06:09 +0000 (14:06 +0000)
examples/htdocs/index-jasmine-popup.html [deleted file]
examples/htdocs/index-jasmine.html [deleted file]
examples/htdocs/jasmine-popup.html [new file with mode: 0644]
examples/htdocs/jasmine.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/Makefile

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/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>
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);
index 2abcb97..8ad95ce 100644 (file)
@@ -34,7 +34,7 @@ pz2api-git-checkout:
            ( cd $$(dirname $$(dirname ${PZ2API_JS})); git clone ${PZ2API_GIT} ); \
        fi
 
-mkws-js ${MKWS_JS}: ${PZ2API_JS} mkws.js
+mkws-js ${MKWS_JS}: mkws.js
        @if ! test -e ${PZ2API_JS}; then \
            echo "The pazpar2 JS file ${PZ2API_JS} does not exists."; \
            echo "Did you checked out the source from the git repo?"; \
@@ -44,7 +44,7 @@ mkws-js ${MKWS_JS}: ${PZ2API_JS} mkws.js
        ( echo "/* created at: $$(date)"; \
          echo "   mkws.js GIT id: $$(git log mkws.js | head -n 1 | perl -npe 's,\S+\s+,,') */"; \
          curl -sSf ${JQUERY_URL} | perl -npe 's,sourceMappingURL=jquery.*map,,'; \
-         cat ../../../libjs-pz2/pz2api.1.js mkws.js ) > ${MKWS_JS}.new 
+         cat ${PZ2API_JS} mkws.js ) > ${MKWS_JS}.new 
        mv -f ${MKWS_JS}.new ${MKWS_JS}
 
 distclean: clean