2012-12-13 21:34:31 +00:00
|
|
|
/*\
|
|
|
|
title: $:/core/modules/parsers/wikiparser/wikivocabulary.js
|
|
|
|
type: application/javascript
|
|
|
|
module-type: global
|
|
|
|
|
|
|
|
\*/
|
|
|
|
(function(){
|
|
|
|
|
|
|
|
/*jslint node: true, browser: true */
|
|
|
|
/*global $tw: false */
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var WikiVocabulary = function(options) {
|
|
|
|
this.wiki = options.wiki;
|
|
|
|
// Hashmaps of the various parse rule classes
|
2012-12-14 15:51:23 +00:00
|
|
|
this.pragmaRuleClasses = $tw.modules.createClassesFromModules("wikipragmarule",$tw.WikiRule);
|
|
|
|
this.blockRuleClasses = $tw.modules.createClassesFromModules("wikiblockrule",$tw.WikiRule);
|
|
|
|
this.runRuleClasses = $tw.modules.createClassesFromModules("wikirunrule",$tw.WikiRule);
|
2012-12-13 21:34:31 +00:00
|
|
|
// Hashmap of the various renderer classes
|
|
|
|
this.rendererClasses = $tw.modules.applyMethods("wikirenderer");
|
|
|
|
// Hashmap of the available widgets
|
2012-12-14 16:01:37 +00:00
|
|
|
this.widgetClasses = $tw.modules.createClassesFromModules("widget");
|
2012-12-13 21:34:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
WikiVocabulary.prototype.parseText = function(type,text) {
|
|
|
|
return new $tw.WikiParser(this,type,text,{wiki: this.wiki});
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.WikiVocabulary = WikiVocabulary;
|
|
|
|
|
|
|
|
})();
|
|
|
|
|