X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=c5f7d48aac55175293866fe1c01a0f19be1467e4;hb=6de2b7eb50eb03025dec13adbde99f786468cd75;hp=4eb2f203fa15cfacfa97e847966c2f32ab94e2af;hpb=c200e1da760e7e0bde6442a17383cda1659c2479;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 4eb2f20..c5f7d48 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -204,6 +204,7 @@ function add_single_facet(acc, caption, data, max, cclIndex) { acc.push('
'); acc.push('
' + M(caption) + '
'); for (var i = 0; i < data.length && i < max; i++ ) { + acc.push('
'); acc.push('' + data[i].name + '' - + ' (' + data[i].freq + ')
'); + + ' ' + data[i].freq + ''); + acc.push('
'); } acc.push('
'); } @@ -902,8 +904,7 @@ jQuery.extend({
\
\
\ - \ - '; + ' if (config && config.layout == 'div') { this.debug2("jquery plugin layout: div"); @@ -911,6 +912,7 @@ jQuery.extend({ } else if (config && config.layout == 'popup') { this.debug2("jquery plugin layout: popup"); document.write(popup); + $(document).ready( function() { init_popup(config); } ); } else { this.debug2("jquery plugin layout: table"); document.write(table); @@ -918,12 +920,21 @@ jQuery.extend({ } }); -function init_popup(config) { - $("#mkwsPopup").dialog({ +function init_popup(obj) { + var config = obj ? obj : {}; + + var height = config.height || 760; + var width = config.width || 880; + var id_button = config.button || "input#mkwsButton"; + var id_popup = config.popup || "#mkwsPopup"; + + debug("popup height: " + height + ", width: " + width); + + $(id_popup).dialog({ closeOnEscape: true, autoOpen: false, - height: 760, - width: 880, + height: height, + width: width, modal: true, resizable: true, buttons: { @@ -931,15 +942,13 @@ function init_popup(config) { $(this).dialog("close"); } }, - close: function() { - // allFields.val( "" ).removeClass( "ui-state-error" ); - } + close: function() { } }); - $("input#mkwsButton") + $(id_button) .button() .click(function() { - $("#mkwsPopup").dialog("open"); + $(id_popup).dialog("open"); }); };