X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=bfda71a7917190fb95134f89b4c6f00eee0a3cec;hb=59a8ae6bba5b82f9c6c851c579eff32fd46ccd31;hp=41ecb4b73560d751ce2c6dd1f65d51dc4de02d3b;hpb=3bb12e5cfdace6e2322d72a5e1ac89ffd6f3cc2a;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 41ecb4b..bfda71a 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -265,17 +265,17 @@ function _make_mkws_team($, teamName) { // create a parameters array and pass it to the pz2's constructor // then register the form submit event with the pz2.search function // autoInit is set to true on default - mkws.paz = new pz2( { "onshow": my_onshow, - "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way - "pazpar2path": mkws_config.pazpar2_url, - "oninit": my_oninit, - "onstat": my_onstat, - "onterm": my_onterm, - "termlist": "xtargets,subject,author", - "onbytarget": my_onbytarget, - "usesessions" : mkws_config.use_service_proxy ? false : true, - "showResponseType": '', // or "json" (for debugging?) - "onrecord": my_onrecord } ); + mkws.paz = new pz2({ "onshow": my_onshow, + "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way + "pazpar2path": mkws_config.pazpar2_url, + "oninit": my_oninit, + "onstat": my_onstat, + "onterm": my_onterm, + "termlist": "xtargets,subject,author", + "onbytarget": my_onbytarget, + "usesessions" : mkws_config.use_service_proxy ? false : true, + "showResponseType": '', // or "json" (for debugging?) + "onrecord": my_onrecord } ); if (!isNaN(parseInt(mkws_config.perpage_default))) { m_recPerPage = parseInt(mkws_config.perpage_default); @@ -1401,6 +1401,21 @@ function _mkws_jquery_plugin ($) { $(document).ready(function() { log("on load ready"); + + // Backwards compatibility: set new magic class names on any + // elements that have the old magic IDs. + var ids = [ "Switch", "Lang", "Search", "Pager", "Navi", + "Results", "Records", "Targets", "Ranking", + "Termlists", "Stat" ]; + for (var i = 0; i < ids.length; i++) { + var id = 'mkws' + ids[i]; + var node = $('#' + id); + if (node.attr('id')) { + node.addClass(id + " mkwsTeam_AUTO"); + log("added magic classes to '" + node.attr('id') + "'"); + } + } + // Backwards compatibility: the special-case undefined team mkws.teams[''] = _make_mkws_team(j, undefined); log("Made the unnamed MKWS team"); @@ -1428,6 +1443,5 @@ function _mkws_jquery_plugin ($) { log("Made MKWS team '" + tname + "'"); } }); - }); })(jQuery);