mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-17 07:11:22 +00:00
Refactored shadow tiddlers to not be in a separate store
Shortly there will be a flag to mark them
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user