+ /*
+ * All the HTML stuff to render the search forms and
+ * result pages.
+ */
+ function mkws_html_all() {
+ mkws_set_lang();
+ if (mkws_config.show_lang)
+ mkws_html_lang();
+
+ // For some reason, doing this programmatically results in
+ // document.mkwsSearchForm.mkwsQuery being undefined, hence the raw HTML.
+ debug("HTML search form");
+ // ### There is only one match here by design: fix not to bother looping
+ $('.mkwsSearch.mkwsTeam_' + m_teamName).each(function (i, obj) {
+ var node = this;
+ mkws.handle_node_with_team(node, function(tname) {
+ $(node).html('\
+<form name="mkwsSearchForm" class="mkwsSearchForm mkwsTeam_' + tname + '" action="" >\
+ <input id="mkwsQuery" class="mkwsQuery mkwsTeam_' + tname + '" type="text" size="' + mkws_config.query_width + '" />\
+ <input id="mkwsButton" class="mkwsButton mkwsTeam_' + tname + '" type="submit" value="' + M('Search') + '" />\
+</form>');
+ });
+ });
+
+ debug("HTML records");
+ // If the team has a .mkwsResults, populate it in the usual
+ // way. If not, assume that it's a smarter application that
+ // defines its own subcomponents, some or all of the
+ // following:
+ // .mkwsTermlists
+ // .mkwsRanking
+ // .mkwsPager
+ // .mkwsNavi
+ // .mkwsRecords
+ if ($(".mkwsResults.mkwsTeam_" + m_teamName).length) {
+ $(".mkwsResults.mkwsTeam_" + m_teamName).html('\
+<table width="100%" border="0" cellpadding="6" cellspacing="0">\
+ <tr>\
+ <td class="mkwsTermlistContainer1 mkwsTeam_' + m_teamName + '" width="250" valign="top">\
+ <div id="mkwsTermlists" class="mkwsTermlists mkwsTeam_' + m_teamName + '"></div>\
+ </td>\
+ <td class="mkwsMOTDContainer mkwsTeam_' + m_teamName + '" valign="top">\
+ <div id="mkwsRanking" class="mkwsRanking mkwsTeam_' + m_teamName + '"></div>\
+ <div id="mkwsPager" class="mkwsPager mkwsTeam_' + m_teamName + '"></div>\
+ <div id="mkwsNavi" class="mkwsNavi mkwsTeam_' + m_teamName + '"></div>\
+ <div id="mkwsRecords" class="mkwsRecords mkwsTeam_' + m_teamName + '"></div>\
+ </td>\
+ </tr>\
+ <tr>\
+ <td colspan="2">\
+ <div class="mkwsTermlistContainer2 mkwsTeam_' + m_teamName + '"></div>\
+ </td>\
+ </tr>\
+</table>');
+ }
+
+ if ($("#mkwsRanking").length) {
+ var ranking_data = '';
+ ranking_data += '<form name="mkwsSelect" id="mkwsSelect" action="" >';
+ if (mkws_config.show_sort) {
+ ranking_data += M('Sort by') + ' ' + mkws_html_sort() + ' ';
+ }
+ if (mkws_config.show_perpage) {
+ ranking_data += M('and show') + ' ' + mkws_html_perpage() + ' ' + M('per page') + '.';
+ }
+ ranking_data += '</form>';
+
+ $("#mkwsRanking").html(ranking_data);
+ }
+
+ mkws_html_switch();