Get rid of the wikivocabulary object

This commit is contained in:
Jeremy Ruston
2012-12-26 22:02:59 +00:00
parent cbc08fcc1c
commit c703fb1267
8 changed files with 49 additions and 84 deletions
+5 -1
View File
@@ -20,11 +20,15 @@ var WidgetRenderer = function(renderTree,renderContext,parseTreeNode) {
this.renderTree = renderTree;
this.renderContext = renderContext;
this.parseTreeNode = parseTreeNode;
// Widget classes
if(!this.widgetClasses) {
WidgetRenderer.prototype.widgetClasses = $tw.modules.createClassesFromModules("widget",null,$tw.WidgetBase);
}
// Compute our attributes
this.attributes = {};
this.computeAttributes();
// Create the widget object
var WidgetClass = this.renderTree.parser.vocabulary.widgetClasses[this.parseTreeNode.tag];
var WidgetClass = this.widgetClasses[this.parseTreeNode.tag];
if(WidgetClass) {
this.widget = new WidgetClass();
this.widget.init(this);