From 85ba8bcf822fec42845a0f3bd2f0daed087930e8 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Thu, 20 Jun 2013 13:27:23 +0000 Subject: [PATCH] refactor mkws_html_all() --- experiments/spclient/mkws.js | 87 ++++++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 37 deletions(-) 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; } /* -- 1.7.10.4