translate "Locations" to de + da
[mkws-moved-to-github.git] / src / mkws-core.js
index 3087120..137ae38 100644 (file)
@@ -1,5 +1,5 @@
 /*! MKWS, the MasterKey Widget Set.
- *  Copyright (C) 2013-2014 Index Data
+ *  Copyright (C) 2013-2015 Index Data
  *  See the file LICENSE for details
  */
 
@@ -45,9 +45,15 @@ window.mkws = {
       "Date": "Datum",
       "Subject": "Schlagwort",
       "subject": "schlagwort",
-      "Location": "Ort",
+      "Location": "Bestand",
+      "Locations": "Bestand",
       "Records": "Datensätze",
       "Targets": "Datenbanken",
+      "State": "Status",
+      "relevance": "Relevanz",
+      "title": "Titel",
+      "newest": "Neueste",
+      "oldest": "Älteste",
 
       "dummy": "dummy"
     },
@@ -75,8 +81,14 @@ window.mkws = {
       "Subject": "Emneord",
       "subject": "emneord",
       "Location": "Lokation",
+      "Locations": "Lokation",
       "Records": "Poster",
       "Targets": "Baser",
+      "State": "Status",
+      "relevance": "Relevans",
+      "title": "Titel",
+      "newest": "Nyeste",
+      "oldest": "Ældste",
 
       "dummy": "dummy"
     }
@@ -114,7 +126,11 @@ var consoleAppender = JL.createConsoleAppender('consoleAppender');
 mkws.logger.setOptions({ "appenders": [consoleAppender] });
 
 
-function _log(fn, string) { fn.call(mkws.logger, string); };
+function _log() {
+  var argsAsARealArray = Array.prototype.slice.call(arguments);
+  var fn = argsAsARealArray.shift();
+  fn.apply(mkws.logger, argsAsARealArray);
+};
 mkws.trace = function(x) { _log(mkws.logger.trace, x) };
 mkws.debug = function(x) { _log(mkws.logger.debug, x) };
 mkws.info = function(x) { _log(mkws.logger.info, x) };
@@ -155,6 +171,12 @@ mkws.registerWidgetType = function(name, fn) {
   mkws.info("registered widget-type '" + name + "'");
 };
 
+mkws.aliasWidgetType = function(newName, oldName) {
+  mkws.widgetType2function[newName] = mkws.widgetType2function[oldName];
+  mkws.info("aliased widget-type '" + newName + "' to '" + oldName + "'");
+
+};
+
 mkws.promotionFunction = function(name) {
   return mkws.widgetType2function[name];
 };
@@ -528,7 +550,7 @@ mkws.info("Using window.name '" + window.name + "'");
   // or a selector string you would like to constrain the search for widgets to.
   //
   // This function has no side effects if run again on an operating session,
-  // even if the element/selector passed causes existing widgets to be reparsed: 
+  // even if the element/selector passed causes existing widgets to be reparsed:
   //
   // (TODO: that last bit isn't true and we currently have to avoid reinitialising
   // widgets, MKWS-261)
@@ -539,7 +561,7 @@ mkws.info("Using window.name '" + window.name + "'");
   mkws.init = function(message, rootsel) {
     var greet = "MKWS initialised";
     if (rootsel) greet += " (limited to " + rootsel + ")"
-    if (message) greet += " :: " + message; 
+    if (message) greet += " :: " + message;
     mkws.info(greet);
 
     // MKWS is not active until init() has been run against an object with widget nodes.
@@ -648,8 +670,11 @@ mkws.info("Using window.name '" + window.name + "'");
     } else if (!mkws.authenticating) {
       // raw pp2 or we have a session already open
       runAutoSearches();
+      for (var teamName in mkws.teams) {
+        mkws.teams[teamName].queue("authenticated").publish();
+      }
     }
-    
+
     mkws.isActive = true;
     return true;
   };