X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-team.js;h=cf4794bb93f298cfb3dcec7bb45745dde2fd6324;hb=df823384f61228cdcedc53999e44dc4704c858f9;hp=7f5531287c1b9616572db3bf0f56601e2cbc13f1;hpb=603bad4161d59a9d62e0f03054f66a770cd23fb1;p=mkws-moved-to-github.git diff --git a/src/mkws-team.js b/src/mkws-team.js index 7f55312..cf4794b 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -26,7 +26,8 @@ function team($, teamName) { "last": $.now() }; var m_paz; // will be initialised below - var m_template = {}; + var m_tempateText = {}; // widgets can register tempates to be compiled + var m_template = {}; // compiled templates, from any source var m_config = mkws.objectInheritingFrom(mkws.config); var m_widgets = {}; // Maps widget-type to object @@ -267,7 +268,7 @@ function team($, teamName) { if (query) m_query = query; if (sortOrder) m_sortOrder = sortOrder; if (perpage) m_perpage = perpage; - if (targets) m_filterSet.add(targetFilter(id, id)); + if (targets) m_filterSet.add(targetFilter(targets, targets)); var pp2filter = m_filterSet.pp2filter(); var pp2limit = m_filterSet.pp2limit(limit); @@ -420,7 +421,10 @@ function team($, teamName) { }); // on first page, hide the termlist - $(document).ready(function() { widgetNode("Termlists").hide(); }); + $(document).ready(function() { + var t = widgetNode("Termlists"); + if (t) t.hide(); + }); var container = findnode(".mkwsMOTDContainer"); if (container.length) { // Move the MOTD from the provided element down into the container @@ -613,6 +617,11 @@ function team($, teamName) { that.renderDetails = renderDetails; + that.registerTemplate = function(name, text) { + m_tempateText[name] = text; + }; + + function loadTemplate(name) { var template = m_template[name]; @@ -628,6 +637,9 @@ function team($, teamName) { } if (!source) { + source = m_tempateText[name]; + } + if (!source) { source = defaultTemplate(name); }