Major reorganisation of wikitext rendering

Getting ready to support selective refresh of DOM elements
This commit is contained in:
Jeremy Ruston
2012-01-24 16:26:37 +00:00
parent 870529f76b
commit 398831b0d9
13 changed files with 286 additions and 104 deletions

View File

@@ -83,6 +83,18 @@ WikiTextParser.prototype.addDependency = function(dependency) {
}
};
WikiTextParser.prototype.addDependencies = function(dependencies) {
if(dependencies === null) {
this.dependencies = null;
} else if(this.dependencies !== null){
for(var t=0; t<dependencies.length; t++) {
if(this.dependencies.indexOf(dependencies[t]) === -1) {
this.dependencies.push(dependencies[t]);
}
}
}
};
WikiTextParser.prototype.outputText = function(place,startPos,endPos) {
if(startPos < endPos) {
place.push({type: "text", value: this.source.substring(startPos,endPos)});