- mkws_set_lang(mkws_config);
- if (mkws_config.lang_menu)
- mkws_html_lang(mkws_config);
-
- // For some reason, doing this programmatically results in
- // document.mkwsSearchForm.mkwsQuery being undefined, hence the raw HTML.
- debug("HTML search form");
- $("#mkwsSearch").html('\
- <form name="mkwsSearchForm" action="" >\
- <input id="mkwsQuery" type="text" size="' + mkws_config.query_width + '" />\
- <input id="mkwsButton" type="submit" value="' + M('Search') + '" />\
- </form>');
-
- debug("HTML records");
- // If the application has an #mkwsResults, populate it in the
- // usual way. If not, assume that it's a smarter application that
- // defines its own subcomponents:
- // #mkwsTermlists
- // #mkwsRanking
- // #mkwsPager
- // #mkwsNavi
- // #mkwsRecords
- if ($("#mkwsResults").length) {
- $("#mkwsResults").html('\
- <table width="100%" border="0" cellpadding="6" cellspacing="0">\
- <tr>\
- <td width="250" valign="top">\
- <div id="mkwsTermlists"></div>\
- </td>\
- <td id="mkwsMOTDContainer" valign="top">\
- <div id="mkwsRanking"></div>\
- <div id="mkwsPager"></div>\
- <div id="mkwsNavi"></div>\
- <div id="mkwsRecords"></div>\
- </td>\
- </tr>\
- </table>');
- }
-
- if ($("#mkwsRanking").length) {
- var ranking_data = '';
- ranking_data += '<form name="mkwsSelect" id="mkwsSelect" action="" >';
- if (config.sort_menu) {
- ranking_data += M('Sort by') + ' ' + mkws_html_sort(config) + ' ';
- }
- if (config.perpage_menu) {
- ranking_data += M('and show') + ' ' + mkws_html_perpage(config) + ' ' + M('per page') + '.';
- }
- ranking_data += '</form>';
-
- $("#mkwsRanking").html(ranking_data);
- }
-
- mkws_html_switch(config);
-
- if (mkws_config.use_service_proxy)
- mkws_service_proxy_auth(config.service_proxy_auth);
-
- if (mkws_config.responsive_design) {
- // Responsive web design - change layout on the fly based on
- // current screen width. Required for mobile devices.
- $(window).resize( function(e) { mkws_mobile_resize() });
- // initial check after page load
- $(document).ready(function() { mkws_mobile_resize() });
- }
-
- domReady();
-
- // on first page, hide the termlist
- $(document).ready(function() { $("#mkwsTermlists").hide(); } );
- var motd = document.getElementById("mkwsMOTD");
- var container = document.getElementById("mkwsMOTDContainer");
- if (motd && container) {
- // Move the MOTD from the provided element down into the container
- motd.parentNode.removeChild(motd);
- container.appendChild(motd);