X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=2b962a2ff5a8b05ca4f1d6545fa4f4a4f2057173;hb=fccf768cf4e1a2a4c8747cb4c7c807315f226304;hp=ac427e5bd0a9a57f01047dce3257f5ab88891501;hpb=0110825c865a30c5684711b4af596e4910b598af;p=mkws-moved-to-github.git diff --git a/src/mkws-team.js b/src/mkws-team.js index ac427e5..2b962a2 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 + "'"); } @@ -353,8 +346,6 @@ function team($, teamName) { * result pages. */ function mkwsHtmlAll() { - mkwsSetLang(); - var container = findnode(".mkwsMOTDContainer"); if (container.length) { // Move the MOTD from the provided element down into the container @@ -449,7 +440,7 @@ function team($, teamName) { source = m_tempateText[name]; } if (!source) { - source = defaultTemplate(name); + source = mkws.defaultTemplate(name); } template = Handlebars.compile(source); @@ -462,94 +453,6 @@ function team($, teamName) { that.loadTemplate = loadTemplate; - function defaultTemplate(name) { - if (name === 'Record') { - return '\ -\ - \ - \ - \ - \ - {{#if md-date}}\ - \ - \ - \ - \ - {{/if}}\ - {{#if md-author}}\ - \ - \ - \ - \ - {{/if}}\ - {{#if md-electronic-url}}\ - \ - \ - \ - \ - {{/if}}\ - {{#if-any location having="md-subject"}}\ - \ - \ - \ - \ - {{/if-any}}\ - \ - \ - \ - \ -
{{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}}\ -
\ -'; - } else if (name === "Summary") { - return '\ -\ - {{md-title}}\ -\ -{{#if md-title-remainder}}\ - {{md-title-remainder}}\ -{{/if}}\ -{{#if md-title-responsibility}}\ - {{md-title-responsibility}}\ -{{/if}}\ -'; - } else if (name === "Image") { - return '\ - \ - {{#first md-thumburl}}\ - {{../md-title}}\ - {{/first}}\ -
\ -
\ -'; - } - - var s = "There is no default '" + name +"' template!"; - alert(s); - return s; - } - that.addWidget = function(w) { if (!m_widgets[w.type]) { m_widgets[w.type] = w; @@ -574,6 +477,7 @@ function team($, teamName) { } mkwsHtmlAll() + mkwsSetLang(); return that; };