X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-core.js;h=d88e751f6b32415481f936a93e7822657c2f20c5;hb=8abb8fd5799c2c161f04fa622f1df2617953d480;hp=6b3e00d781c5f7c86d82eadd7b75afa7f83cd327;hpb=c815978123f4bff4d986a9d16a525acd8cc8b218;p=mkws-moved-to-github.git diff --git a/src/mkws-core.js b/src/mkws-core.js index 6b3e00d..d88e751 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -20,6 +20,7 @@ window.mkws = { // initial value allows jQuery popup to use logging. teams: {}, widgetType2function: {}, + defaultTemplates: {}, locale_lang: { "de": { @@ -108,24 +109,6 @@ mkws.log = function(string) { }; -// Incredible that the standard JavaScript runtime doesn't define a -// unique windowId. Instead, we have to make one up. And since there's -// no global area shared between windows, the best we can do for -// ensuring uniqueness is generating a random ID and crossing our -// fingers. We stash this in window.name, as it's the only place to -// keep data that is preserved across reloads and within-site -// navigation. pz2.js picks this up and uses it as part of the -// cookie-name, to ensure each tab gets its own session. -if (window.name) { - mkws.log("Using existing window.name '" + window.name + "'"); -} else { - // Ten chars from 26 alpha-numerics = 36^10 = 3.65e15 combinations. - // At one per second, it will take 116 million years to duplicate a session - window.name = Math.random().toString(36).slice(2, 12); - mkws.log("Generated new window.name '" + window.name + "'"); -} - - // Translation function. mkws.M = function(word) { var lang = mkws.config.lang; @@ -188,6 +171,7 @@ mkws.setMkwsConfig = function(overrides) { facets: ["xtargets", "subject", "author"], /* display facets, in this order, [] for none */ responsive_design_width: undefined, /* a page with less pixel width considered as narrow */ log_level: 1, /* log level for development: 0..2 */ + template_vars: {}, /* values that may be exposed to templates */ dummy: "dummy" }; @@ -211,110 +195,6 @@ mkws.objectInheritingFrom = function(o) { } -mkws.defaultTemplate = function(name) { - if (name === 'Record') { - return '\ -
{{mkws-translate "Title"}} | \ -\ - {{md-title}}\ - {{#if md-title-remainder}}\ - ({{md-title-remainder}})\ - {{/if}}\ - {{#if md-title-responsibility}}\ - {{md-title-responsibility}}\ - {{/if}}\ - | \ -
---|---|
{{mkws-translate "Date"}} | \ -{{md-date}} | \ -
{{mkws-translate "Author"}} | \ -{{md-author}} | \ -
{{mkws-translate "Links"}} | \ -\ - {{#each md-electronic-url}}\ - Link{{mkws-index1}}\ - {{/each}}\ - | \ -
{{mkws-translate "Subject"}} | \ -\ - {{#mkws-first location having="md-subject"}}\ - {{#if md-subject}}\ - {{#mkws-commaList md-subject}}\ - {{this}}{{/mkws-commaList}}\ - {{/if}}\ - {{/mkws-first}}\ - | \ -
{{mkws-translate "Locations"}} | \ -\ - {{#mkws-commaList location}}\ - {{mkws-attr "@name"}}{{/mkws-commaList}}\ - | \ -