From: Mike Taylor Date: Fri, 1 Nov 2013 18:38:17 +0000 (+0000) Subject: Merge branch 'master' of ssh://git.indexdata.com/home/git/private/mkws X-Git-Tag: 0.9.1~150 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=98275ba017020e645cb4f980537fba0f2d3ab34d;hp=094f90166dcf6543cfe026f97befd50a76364799;p=mkws-moved-to-github.git Merge branch 'master' of ssh://git.indexdata.com/home/git/private/mkws --- diff --git a/examples/htdocs/dict.html b/examples/htdocs/dict.html new file mode 100644 index 0000000..12ee573 --- /dev/null +++ b/examples/htdocs/dict.html @@ -0,0 +1,171 @@ + + + + + A-group silly demo + + + + + + + + + + + +
+ +

MKWS: the MasterKey Widget Set

+

+ This site contains tools, not content: +

+
    +
  • + mkws.js + -- + JavaScript code that powers the MasterKey Widget Set +
  • +
  • + /libjs-pz2/pz2api.1.js + -- + Low-level JavaScript library for access to the MasterKey web + service. +
  • +
  • + mkws-complete.js + -- + A single large JavaScript file containing everything needed for + MKWS to work: the widget-set itself, the API library, and any + additional prerequisites such as jQuery. +
  • +
  • + mkws.css + -- + A stylesheet which styles only MasterKey widgets, and does not + otherwise interfere with application-site's styles. + +
  • +
+

+ For examples of how to use the widget-set, see: +

+ +

+ The set of targets can be maintained: +

+ +

+ Documentation: +

+ +
+
+
+
+
+ + + diff --git a/examples/htdocs/index-full.html b/examples/htdocs/index-full.html deleted file mode 100644 index 3cf6e31..0000000 --- a/examples/htdocs/index-full.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - MKWS demo: full configuration - - - - - -
-
-
-
-
-
-

- Welcome to the MasterKey Widget Set demo. -

-

- Enter a search above to begin, or - Visit the MKWS home page to find out more. -

-
- - - diff --git a/examples/htdocs/index-jakub.html b/examples/htdocs/index-jakub.html deleted file mode 100644 index 9433603..0000000 --- a/examples/htdocs/index-jakub.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - MKWS demo client - - - - - -
-
-
-
-
-
- - diff --git a/examples/htdocs/index-jasmine-popup.html b/examples/htdocs/index-jasmine-popup.html deleted file mode 100644 index 38e673b..0000000 --- a/examples/htdocs/index-jasmine-popup.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - MKWS demo: jQuery popup plugin with jasmine - - - - - - - - - - - - - - - - - - - - - - - - - -
-An embryonic MasterKey Widget Set
-=================================
-
-This directory contains an embryonic MasterKey Widget Set, based
-initially on "jsdemo" though now far removed from those beginnnings.
-[...]
-    
- - diff --git a/examples/htdocs/index-jasmine.html b/examples/htdocs/index-jasmine.html deleted file mode 100644 index 818123c..0000000 --- a/examples/htdocs/index-jasmine.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - MKWS demo: Wolfram's playground - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/examples/htdocs/index-jquery.html b/examples/htdocs/index-jquery.html deleted file mode 100644 index f46a040..0000000 --- a/examples/htdocs/index-jquery.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - MKWS demo: jQuery plugin - - - - - - - - - diff --git a/examples/htdocs/index-lowlevel.html b/examples/htdocs/index-lowlevel.html deleted file mode 100644 index d2e8ed7..0000000 --- a/examples/htdocs/index-lowlevel.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - MKWS demo: low-level subcomponents - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/examples/htdocs/index-mike.html b/examples/htdocs/index-mike.html deleted file mode 100644 index 47848f8..0000000 --- a/examples/htdocs/index-mike.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - MKWS demo: Mike's playground - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/examples/htdocs/index-mobile.html b/examples/htdocs/index-mobile.html deleted file mode 100644 index 268528a..0000000 --- a/examples/htdocs/index-mobile.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - MKWS demo: mobile-screen resizing - - - - - - - -
-
-
-
-
- - diff --git a/examples/htdocs/index-popup.html b/examples/htdocs/index-popup.html deleted file mode 100644 index b27b252..0000000 --- a/examples/htdocs/index-popup.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - MKWS demo: popup search box - - - - - - - - - - - - - - - - -
-      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:
-
-[...]
-    
- - - diff --git a/examples/htdocs/index-wolfram.html b/examples/htdocs/index-wolfram.html deleted file mode 100644 index 29f9642..0000000 --- a/examples/htdocs/index-wolfram.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - MKWS demo: Wolfram's playground - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/examples/htdocs/jakub.html b/examples/htdocs/jakub.html new file mode 100644 index 0000000..9433603 --- /dev/null +++ b/examples/htdocs/jakub.html @@ -0,0 +1,22 @@ + + + + MKWS demo client + + + + + +
+
+
+
+
+
+ + diff --git a/examples/htdocs/jasmine-popup.html b/examples/htdocs/jasmine-popup.html new file mode 100644 index 0000000..38e673b --- /dev/null +++ b/examples/htdocs/jasmine-popup.html @@ -0,0 +1,47 @@ + + + + MKWS demo: jQuery popup plugin with jasmine + + + + + + + + + + + + + + + + + + + + + + + + + +
+An embryonic MasterKey Widget Set
+=================================
+
+This directory contains an embryonic MasterKey Widget Set, based
+initially on "jsdemo" though now far removed from those beginnnings.
+[...]
+    
+ + diff --git a/examples/htdocs/jasmine.html b/examples/htdocs/jasmine.html new file mode 100644 index 0000000..818123c --- /dev/null +++ b/examples/htdocs/jasmine.html @@ -0,0 +1,82 @@ + + + + MKWS demo: Wolfram's playground + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + diff --git a/examples/htdocs/jquery.html b/examples/htdocs/jquery.html new file mode 100644 index 0000000..f46a040 --- /dev/null +++ b/examples/htdocs/jquery.html @@ -0,0 +1,21 @@ + + + + MKWS demo: jQuery plugin + + + + + + + + + diff --git a/examples/htdocs/language.html b/examples/htdocs/language.html new file mode 100644 index 0000000..3cf6e31 --- /dev/null +++ b/examples/htdocs/language.html @@ -0,0 +1,66 @@ + + + + + + + MKWS demo: full configuration + + + + + +
+
+
+
+
+
+

+ Welcome to the MasterKey Widget Set demo. +

+

+ Enter a search above to begin, or + Visit the MKWS home page to find out more. +

+
+ + + diff --git a/examples/htdocs/lowlevel.html b/examples/htdocs/lowlevel.html new file mode 100644 index 0000000..d2e8ed7 --- /dev/null +++ b/examples/htdocs/lowlevel.html @@ -0,0 +1,52 @@ + + + + MKWS demo: low-level subcomponents + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/examples/htdocs/mike.html b/examples/htdocs/mike.html new file mode 100644 index 0000000..47848f8 --- /dev/null +++ b/examples/htdocs/mike.html @@ -0,0 +1,61 @@ + + + + MKWS demo: Mike's playground + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/examples/htdocs/mobile.html b/examples/htdocs/mobile.html new file mode 100644 index 0000000..268528a --- /dev/null +++ b/examples/htdocs/mobile.html @@ -0,0 +1,34 @@ + + + + + + + MKWS demo: mobile-screen resizing + + + + + + + +
+
+
+
+
+ + diff --git a/examples/htdocs/popup.html b/examples/htdocs/popup.html new file mode 100644 index 0000000..b27b252 --- /dev/null +++ b/examples/htdocs/popup.html @@ -0,0 +1,79 @@ + + + + MKWS demo: popup search box + + + + + + + + + + + + + + + + +
+      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:
+
+[...]
+    
+ + + diff --git a/examples/htdocs/wolfram.html b/examples/htdocs/wolfram.html new file mode 100644 index 0000000..29f9642 --- /dev/null +++ b/examples/htdocs/wolfram.html @@ -0,0 +1,64 @@ + + + + + + MKWS demo: Wolfram's playground + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/test/Makefile b/test/Makefile index 532e776..8891679 100644 --- a/test/Makefile +++ b/test/Makefile @@ -9,7 +9,7 @@ distclean: check: - jasmine-node ./spec + jasmine-node --captureExceptions ./spec test: check diff --git a/test/spec/mkws-index-jsdom-remote.spec.js b/test/spec/mkws-index-jsdom-remote.spec.js index ed20b93..c885d67 100644 --- a/test/spec/mkws-index-jsdom-remote.spec.js +++ b/test/spec/mkws-index-jsdom-remote.spec.js @@ -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); */ diff --git a/test/spec/mkws-index-jsdom.spec.js b/test/spec/mkws-index-jsdom.spec.js index 8106441..bd481c3 100644 --- a/test/spec/mkws-index-jsdom.spec.js +++ b/test/spec/mkws-index-jsdom.spec.js @@ -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); diff --git a/test/spec/mkws-index-simple.spec.js b/test/spec/mkws-index-simple.spec.js index 9ae5a69..dd43bb9 100644 --- a/test/spec/mkws-index-simple.spec.js +++ b/test/spec/mkws-index-simple.spec.js @@ -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 index 0000000..c28d520 --- /dev/null +++ b/tools/htdocs/debugging-notes.txt @@ -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?! diff --git a/tools/htdocs/index.html b/tools/htdocs/index.html index 1d929b5..8c8ec2d 100644 --- a/tools/htdocs/index.html +++ b/tools/htdocs/index.html @@ -60,7 +60,7 @@ It's worth viewing the source to see how small it is.
  • - A more detailed version that contains a configuration structure instead of accepting the defaults. Includes a custom translation option to present @@ -68,28 +68,33 @@
  • The - jQuery plugin version, consisting of a single line of JavaScript code.
  • An application that - uses lower-level MKWS components rather than the all-in-one #mkwsResults division, allowing it to use a rather different layout.
  • - A version suitable for mobile devices, with a responsive design that moves components around depending on the screen size.
  • - A version that uses a jQuery popup.
  • + An application that used MKWS to find dictionary + definitions of words when you highlight them. +
  • +
  • An existing web-site, The Self-Appointed Grammar Police,