From: Mike Taylor Date: Mon, 20 Oct 2014 10:29:56 +0000 (+0100) Subject: Merge X-Git-Tag: 1.0.0~155^2~7 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=d7f7e11af10210fd9872cedc1489fe0b692ca589;hp=41ef5b94511ce7fcc3c1cee3795db1dd92a15a87 Merge --- diff --git a/doc/index.markdown b/doc/index.markdown index ae3382d..e830e89 100644 --- a/doc/index.markdown +++ b/doc/index.markdown @@ -175,7 +175,7 @@ are and how various things are done. [uses a local authentication regime](//example.indexdata.com/localauth.html) and the corresponding [Apache2 configuration stanza](//example.indexdata.com/apache-config.txt). -* [A version that uses a jQuery popup](//example.indexdata.com/popup.html). +* [A version that uses a jQuery popup](//example.indexdata.com/popup.html?q=sushi). ### Non-standard interfaces diff --git a/doc/mkws-manual.markdown b/doc/mkws-manual.markdown index 1e767d0..8f3cf42 100644 --- a/doc/mkws-manual.markdown +++ b/doc/mkws-manual.markdown @@ -252,8 +252,7 @@ Inspecting metadata for templating MKWS makes requests to Service Proxy or Pazpar2 that perform the actual searching. Depending on how these are configured and what is available from the targets you are searching there may be more data available than what is -presented by the default templates. In this case, you can redefine the -`Record` template to include more fields in the full-record popup. +presented by the default templates. Handlebars offers a convenient log helper that will output the contents of a variable for you to inspect. This lets you look at exactly what is being @@ -316,33 +315,6 @@ day, a welcome message or a help page. This can be done by placing an search is made. -Responsive design ------------------ - -Metasearching applications may need to appear differently on -small-screened mobile devices, or change their appearance when -screen-width changes (as when a small device is rotated). To achieve -this, MKWS supports responsive design which will move the termlists to -the bottom on narrow screens and to the sidebar on wide screens. - -To turn on this behaviour, set the `responsive_design_width` to the desired -threshhold width in pixels. For example: - - - -If individual result-related widgets are in use in place of the -all-in-one mkwsResults, then the redesigned application needs to -specify the locations where the termlists should appear in both -cases. In this case, wrap the wide-screen `mkwsTermlists` element in a -`mkwsTermlists-Container-wide` element; and provide an -`mkwsTermlists-Container-narrow` element in the place where the narrow-screen -termlists should appear. - - Popup results with jQuery UI ---------------------------- diff --git a/src/mkws-core.js b/src/mkws-core.js index fc63469..12fbcf4 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -304,7 +304,6 @@ mkws.log("Using window.name '" + window.name + "'"); } } - function handleNodeWithTeam(node, callback) { // First branch for DOM objects; second branch for jQuery objects var classes = node.className || node.attr('class'); @@ -321,11 +320,8 @@ mkws.log("Using window.name '" + window.name + "'"); for (var i = 0; i < list.length; i++) { var cname = list[i]; - if (cname.match(/^mkws-team-/)) { - teamName = cname.replace(/^mkws-team-/, ''); - } else if (cname.match(/^mkws-/)) { - // New-style names of the form mkws-foo-bar - type = cname.replace(/^mkws-/, ''); + if (cname.match(/^mkwsTeam_/)) { + teamName = cname.replace(/^mkwsTeam_/, ''); } else if (cname.match(/^mkws/)) { // Old-style names of the form mkwsFooBar var tmp = cname.replace(/^mkws/, ''); @@ -376,8 +372,8 @@ mkws.log("Using window.name '" + window.name + "'"); for (var tname in mkws.teams) { var team = mkws.teams[tname]; team.visitWidgets(function(t, w) { - var w1 = team.widget(t + "-container-" + from); - var w2 = team.widget(t + "-container-" + to); + var w1 = team.widget(t + "-Container-" + from); + var w2 = team.widget(t + "-Container-" + to); if (w1) { w1.node.hide(); } diff --git a/src/mkws-popup.js b/src/mkws-popup.js index ee26049..7496a07 100644 --- a/src/mkws-popup.js +++ b/src/mkws-popup.js @@ -4,13 +4,13 @@ //"use strict"; // $(document).ready(function () { -mkws.registerWidgetType('popup', function() { +mkws.registerWidgetType('Popup', function() { var $ = mkws.$; var debug = mkws.log; debug("init popup window"); var popup_window = $(this.node); - // var popup_window = $(".mkws-popup"); // $(document).ready() + // var popup_window = $(".mkwsPopup"); // $(document).ready() if (!popup_window) { debug("no popup found, skip..."); return; @@ -49,7 +49,7 @@ mkws.registerWidgetType('popup', function() { close: function() {} }); - // open at search query submit: "input.mkws-button" + // open at search query submit: "input.mkwsButton" var id_botton = that.attr("popup_button"); if (id_botton) { $(id_botton).button().click(function() { diff --git a/src/mkws-team.js b/src/mkws-team.js index ad0c77e..2cc27c0 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -191,13 +191,13 @@ mkws.makeTeam = function($, teamName) { // Used by the Records widget and onRecord() function recordElementId(s) { - return 'mkws-rec_' + s.replace(/[^a-z0-9]/ig, '_'); + return 'mkwsRec_' + s.replace(/[^a-z0-9]/ig, '_'); } that.recordElementId = recordElementId; // Used by onRecord(), showDetails() and renderDetails() function recordDetailsId(s) { - return 'mkws-det_' + s.replace(/[^a-z0-9]/ig, '_'); + return 'mkwsDet_' + s.replace(/[^a-z0-9]/ig, '_'); } @@ -390,10 +390,10 @@ mkws.makeTeam = function($, teamName) { teamName = teamName || m_teamName; if (teamName === 'AUTO') { - selector = (selector + '.mkws-team-' + teamName + ',' + - selector + ':not([class^="mkwsTeam"],[class*=" mkwsTeam"],[class^="mkws-team-"],[class*=" mkws-team-"])'); + selector = (selector + '.mkwsTeam_' + teamName + ',' + + selector + ':not([class^="mkwsTeam"],[class*=" mkwsTeam"])'); } else { - selector = selector + '.mkws-team-' + teamName; + selector = selector + '.mkwsTeam_' + teamName; } var node = $(selector); @@ -410,7 +410,7 @@ mkws.makeTeam = function($, teamName) { function renderDetails(data, marker) { var template = loadTemplate("Record"); var details = template(data); - return '
' + details + '
'; } that.renderDetails = renderDetails; @@ -425,9 +425,9 @@ mkws.makeTeam = function($, teamName) { var template = m_template[name]; if (template === undefined && Handlebars.compile) { var source; - var node = $(".mkws-template_" + name + " .mkws-team-" + that.name()); + var node = $(".mkwsTemplate_" + name + " .mkwsTeam_" + that.name()); if (node && node.length < 1) { - node = $(".mkws-template_" + name); + node = $(".mkwsTemplate_" + name); } if (node) source = node.html(); if (!source) source = m_templateText[name]; diff --git a/src/mkws-widget-authname.js b/src/mkws-widget-authname.js index b96dad2..b1e0b1f 100644 --- a/src/mkws-widget-authname.js +++ b/src/mkws-widget-authname.js @@ -1,4 +1,4 @@ -mkws.registerWidgetType('auth-name', function() { +mkws.registerWidgetType('Authname', function() { var that = this; this.team.queue("authenticated").subscribe(function(authName) { diff --git a/src/mkws-widget-builder.js b/src/mkws-widget-builder.js index dac54ab..6468e86 100644 --- a/src/mkws-widget-builder.js +++ b/src/mkws-widget-builder.js @@ -1,4 +1,4 @@ -mkws.registerWidgetType('builder', function() { +mkws.registerWidgetType('Builder', function() { var that = this; var team = this.team; @@ -8,11 +8,11 @@ mkws.registerWidgetType('builder', function() { }); this.node.append(button); button.click(function() { - var query = team.widget('query').value(); - var sort = team.widget('sort').value(); - var perpage = team.widget('per-page').value(); + var query = team.widget('Query').value(); + var sort = team.widget('Sort').value(); + var perpage = team.widget('Perpage').value(); - var html = ('
'); @@ -21,8 +21,8 @@ mkws.registerWidgetType('builder', function() { }); }); -mkws.registerWidgetType('console-builder', function() { - mkws.promotionFunction('builder').call(this); +mkws.registerWidgetType('ConsoleBuilder', function() { + mkws.promotionFunction('Builder').call(this); this.callback = function(s) { console.log("generated widget: " + s); } diff --git a/src/mkws-widget-categories.js b/src/mkws-widget-categories.js index 754e68b..6982db8 100644 --- a/src/mkws-widget-categories.js +++ b/src/mkws-widget-categories.js @@ -1,4 +1,4 @@ -mkws.registerWidgetType('categories', function() { +mkws.registerWidgetType('Categories', function() { var that = this; if (!mkws.authenticated) { @@ -20,7 +20,7 @@ mkws.registerWidgetType('categories', function() { var text = []; text.push("Select category: "); - text.push(" + +