X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=ab53e940a65da7a48e9460608d453b0910d6adfa;hb=823cea5b1fc8a51b818e2a3a7784aac0c94447e7;hp=ac427e5bd0a9a57f01047dce3257f5ab88891501;hpb=0110825c865a30c5684711b4af596e4910b598af;p=mkws-moved-to-github.git diff --git a/src/mkws-team.js b/src/mkws-team.js index ac427e5..ab53e94 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -314,13 +314,6 @@ function team($, teamName) { if (blanket) blanket.css('display', 'block'); if (motd) motd.css('display', 'none'); break; - case 'none': - alert("mkws.switchView(" + m_teamName + ", 'none') shouldn't happen"); - if (targets) targets.css('display', 'none'); - if (results) results.css('display', 'none'); - if (blanket) blanket.css('display', 'none'); - if (motd) motd.css('display', 'none'); - break; default: alert("Unknown view '" + view + "'"); } @@ -348,34 +341,6 @@ function team($, teamName) { }; - /* - * All the HTML stuff to render the search forms and - * result pages. - */ - function mkwsHtmlAll() { - mkwsSetLang(); - - var container = findnode(".mkwsMOTDContainer"); - if (container.length) { - // Move the MOTD from the provided element down into the container - findnode(".mkwsMOTD").appendTo(container); - } - } - - - function mkwsSetLang() { - var lang = mkws.getParameterByName("lang") || m_config.lang; - if (!lang || !mkws.locale_lang[lang]) { - m_config.lang = "" - } else { - m_config.lang = lang; - } - - log("Locale language: " + (m_config.lang ? m_config.lang : "none")); - return m_config.lang; - } - - // Translation function. At present, this is properly a // global-level function (hence the assignment to mkws.M) but we // want to make it per-team so different teams can operate in @@ -449,7 +414,7 @@ function team($, teamName) { source = m_tempateText[name]; } if (!source) { - source = defaultTemplate(name); + source = mkws.defaultTemplate(name); } template = Handlebars.compile(source); @@ -462,104 +427,16 @@ function team($, teamName) { that.loadTemplate = loadTemplate; - function defaultTemplate(name) { - if (name === 'Record') { - return '\ -
{{translate "Title"}} | \ -\ - {{md-title}}\ - {{#if md-title-remainder}}\ - ({{md-title-remainder}})\ - {{/if}}\ - {{#if md-title-responsibility}}\ - {{md-title-responsibility}}\ - {{/if}}\ - | \ -
---|---|
{{translate "Date"}} | \ -{{md-date}} | \ -
{{translate "Author"}} | \ -{{md-author}} | \ -
{{translate "Links"}} | \ -\ - {{#each md-electronic-url}}\ - Link{{index1}}\ - {{/each}}\ - | \ -
{{translate "Subject"}} | \ -\ - {{#first location having="md-subject"}}\ - {{#if md-subject}}\ - {{#commaList md-subject}}\ - {{this}}{{/commaList}}\ - {{/if}}\ - {{/first}}\ - | \ -
{{translate "Locations"}} | \ -\ - {{#commaList location}}\ - {{attr "@name"}}{{/commaList}}\ - | \ -