From: Wolfram Schneider Date: Thu, 20 Jun 2013 13:27:23 +0000 (+0000) Subject: refactor mkws_html_all() X-Git-Tag: 0.9.1~574^2~19 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=85ba8bcf822fec42845a0f3bd2f0daed087930e8;p=mkws-moved-to-github.git refactor mkws_html_all() --- diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index 9e14bdb..d8f43e3 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -394,7 +394,48 @@ function mkws_html_all(data) { config[k] = data[k]; } + mkws_html_switch(config); + // For some reason, doing this programmatically results in + // document.search.query being undefined, hence the raw HTML. + $("#mkwsSearch").html('\ +
\ + \ + \ +
'); + + $("#mkwsRecords").html('\ + \ + \ + \ + \ + \ +
\ +
\ +
\ +
\ +
\ + Sort by' + mkws_html_sort(config) + '\ + and show ' + mkws_html_perpage(config) + '\ + per page.\ +
\ +
\ +
\ + \ +
\ +
\ + '); + + $("#mkwsTargets").html('\ +
\ + No information available yet.\ +
'); + $("#mkwsTargets").css("display", "none"); + + domReady(); +} + +function mkws_html_switch(config) { $("#mkwsSwitch").html($("", { href: '#', onclick: "switchView(\'records\')", @@ -410,8 +451,11 @@ function mkws_html_all(data) { if (!config.mkws_switch) { $("#mkwsSwitch").css("display", "none"); } +} +function mkws_html_sort(config) { var sort_html = ''; + return sort_html; +} + +function mkws_html_perpage(config) { var perpage_html = ''; - // For some reason, doing this programmatically results in - // document.search.query being undefined, hence the raw HTML. - $("#mkwsSearch").html('\ -
\ - \ - \ -
'); - - $("#mkwsRecords").html('\ - \ - \ - \ - \ - \ -
\ -
\ -
\ -
\ -
\ - Sort by' + sort_html + '\ - and show ' + perpage_html + '\ - per page.\ -
\ -
\ -
\ - \ -
\ -
\ - '); - - $("#mkwsTargets").html('\ -
\ - No information available yet.\ -
'); - $("#mkwsTargets").css("display", "none"); - - domReady(); + return perpage_html; } /*