1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-28 02:50:27 +00:00

Refactored Dependencies() constructor

Now it's much easier to call
This commit is contained in:
Jeremy Ruston 2012-02-20 18:03:51 +00:00
parent 707a08540c
commit 0c4f877093

View File

@ -14,9 +14,26 @@ Represents the dependencies of a tiddler or a parser node as two fields:
var utils = require("./Utils.js");
var Dependencies = function(tiddlers,dependentAll) {
this.tiddlers = tiddlers || {};
var Dependencies = function(skinnyTiddlers,fatTiddlers,dependentAll) {
var t,tiddlerTitle;
this.tiddlers = {};
this.dependentAll = dependentAll;
if(skinnyTiddlers) {
for(t=0; t<skinnyTiddlers.length; t++) {
tiddlerTitle = skinnyTiddlers[t];
if(typeof tiddlerTitle === "string" && tiddlerTitle !== "") {
this.tiddlers[tiddlerTitle] = false;
}
}
}
if(fatTiddlers) {
for(t=0; t<fatTiddlers.length; t++) {
tiddlerTitle = fatTiddlers[t];
if(typeof tiddlerTitle === "string" && tiddlerTitle !== "") {
this.tiddlers[tiddlerTitle] = true;
}
}
}
};
/*