Refactored shadow tiddlers to not be in a separate store

Shortly there will be a flag to mark them
This commit is contained in:
Jeremy Ruston
2012-06-06 12:07:33 +01:00
parent 7c382c5f43
commit e2ea8ff436
6 changed files with 33 additions and 46 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ Command.prototype.subcommands.tiddlers = function() {
};
Command.prototype.subcommands.shadows = function() {
var tiddlers = this.commander.wiki.shadows.getTiddlers();
var tiddlers = this.commander.wiki.getShadowTitles();
this.output.write("Wiki contains these shadow tiddlers:\n");
for(var t=0; t<tiddlers.length; t++) {
this.output.write(tiddlers[t] + "\n");
+1 -3
View File
@@ -17,17 +17,15 @@ exports.info = {
params: {
filter: {byPos: 0, type: "filter"},
as: {byPos: 1, type: "text"},
shadow: {byPos: 2, type: "text"},
removePrefix: {byName: true, type: "text"}
}
};
exports.executeMacro = function() {
var as = this.params.as || "text/plain",
wiki = this.hasParameter("shadow") ? this.wiki.shadows : this.wiki,
t;
if(this.hasParameter("filter")) {
var titles = wiki.filterTiddlers(this.params.filter),
var titles = this.wiki.filterTiddlers(this.params.filter),
result = [];
if(this.hasParameter("removePrefix")) {
for(t=0; t<titles.length; t++) {
+2 -6
View File
@@ -100,11 +100,7 @@ exports.deleteTiddler = function(title) {
};
exports.tiddlerExists = function(title) {
if(this.tiddlers[title]) {
return true;
} else if (this.shadows) {
return this.shadows.tiddlerExists(title);
}
return !!this.tiddlers[title];
};
exports.addTiddler = function(tiddler) {
@@ -210,7 +206,7 @@ exports.getOrphanTitles = function() {
};
exports.getShadowTitles = function() {
return this.shadows ? this.shadows.getTiddlers() : [];
return [];
};
// Return the named cache object for a tiddler. If the cache doesn't exist then the initializer function is invoked to create it