Add mkws.aliasWidgetType() function.
authorMike Taylor <mike@indexdata.com>
Mon, 12 Jan 2015 16:46:49 +0000 (16:46 +0000)
committerMike Taylor <mike@indexdata.com>
Mon, 12 Jan 2015 16:46:49 +0000 (16:46 +0000)
Will be used for making "reference" work like "wikipedia".

src/mkws-core.js

index 528ed94..327519a 100644 (file)
@@ -159,6 +159,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];
 };