X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=blobdiff_plain;f=src%2Fmkws-jquery.js;h=73bd40670880d04a4b608a7521da1516bda4dbce;hp=2f79db462abf7c970db1d87784106e4987f3d6d3;hb=e6fc2ba40e38fd0d2a746082be32d2578460174c;hpb=e006a92c8bb9c2c6c49fd067ac1fb01327aa56e1 diff --git a/src/mkws-jquery.js b/src/mkws-jquery.js index 2f79db4..73bd406 100644 --- a/src/mkws-jquery.js +++ b/src/mkws-jquery.js @@ -10,61 +10,61 @@ * implement jQuery plugin $.pazpar2({}) */ function _mkws_jquery_plugin($) { - function debug (string) { - mkws.log("jquery.pazpar2: " + string); + function debug(string) { + mkws.log("jQuery.pazpar2: " + string); + } + + function init_popup(obj) { + var config = obj ? obj : {}; + + var height = config.height || 760; + var width = config.width || 880; + var id_button = config.id_button || "input.mkwsButton"; + var id_popup = config.id_popup || ".mkwsPopup"; + + debug("popup height: " + height + ", width: " + width); + + // make sure that jquery-ui was loaded afte jQuery core lib, e.g.: + // + if (!$.ui) { + debug("Error: jquery-ui.js is missing, did you include it after jQuery core in the HTML file?"); + return; } - function init_popup(obj) { - var config = obj ? obj : {}; - - var height = config.height || 760; - var width = config.width || 880; - var id_button = config.id_button || "input.mkwsButton"; - var id_popup = config.id_popup || ".mkwsPopup"; - - debug("popup height: " + height + ", width: " + width); - - // make sure that jquery-ui was loaded afte jQuery core lib, e.g.: - // - if (!$.ui) { - debug("Error: jquery-ui.js is missing, did you include it after jQuery core in the HTML file?"); - return; - } - - $(id_popup).dialog({ - closeOnEscape: true, - autoOpen: false, - height: height, - width: width, - modal: true, - resizable: true, - buttons: { - Cancel: function() { - $(this).dialog("close"); - } - }, - close: function() { } - }); - - $(id_button) - .button() - .click(function() { - $(id_popup).dialog("open"); - }); - }; - - $.extend({ - - // service-proxy or pazpar2 - pazpar2: function(config) { - if (config == null || typeof config != 'object') { - config = {}; - } - var id_popup = config.id_popup || ".mkwsPopup"; - id_popup = id_popup.replace(/^[#\.]/, ""); - - // simple layout - var div = '\ + $(id_popup).dialog({ + closeOnEscape: true, + autoOpen: false, + height: height, + width: width, + modal: true, + resizable: true, + buttons: { + Cancel: function() { + $(this).dialog("close"); + } + }, + close: function() { } + }); + + $(id_button) + .button() + .click(function() { + $(id_popup).dialog("open"); + }); + }; + + $.extend({ + + // service-proxy or pazpar2 + pazpar2: function(config) { + if (config == null || typeof config != 'object') { + config = {}; + } + var id_popup = config.id_popup || ".mkwsPopup"; + id_popup = id_popup.replace(/^[#\.]/, ""); + + // simple layout + var div = '\
\
\
\ @@ -72,8 +72,8 @@ function _mkws_jquery_plugin($) {
\
'; - // new table layout - var table = '\ + // new table layout + var table = '\