mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-13 21:31:23 +00:00
Make shadowTiddlers, pluginTiddlers and pluginInfo be private to the Wiki object constructor
This commit is contained in:
@@ -34,7 +34,7 @@ exports.shadow = function(source,prefix,options) {
|
||||
});
|
||||
} else {
|
||||
if(prefix !== "!") {
|
||||
$tw.utils.each(options.wiki.shadowTiddlers,function(tiddler,title) {
|
||||
options.wiki.eachShadow(function(tiddler,title) {
|
||||
results.push(title);
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -18,9 +18,9 @@ Export our filter function
|
||||
exports.shadowsource = function(source,operator,options) {
|
||||
var results = [],
|
||||
pushShadowSource = function(title) {
|
||||
var shadowInfo = options.wiki.shadowTiddlers[title];
|
||||
if(shadowInfo) {
|
||||
$tw.utils.pushTop(results,shadowInfo.source);
|
||||
var source = options.wiki.getShadowSource(title);
|
||||
if(source) {
|
||||
$tw.utils.pushTop(results,source);
|
||||
}
|
||||
};
|
||||
// Iterate through the source tiddlers
|
||||
|
||||
@@ -62,8 +62,9 @@ PluginSwitcher.prototype.switchPlugins = function() {
|
||||
var unregisteredTiddlers = $tw.wiki.unregisterPluginTiddlers(this.pluginType);
|
||||
// Accumulate the titles of shadow tiddlers that have changed as a result of this switch
|
||||
var changedTiddlers = {};
|
||||
$tw.utils.each(this.wiki.shadowTiddlers,function(shadowInfo,title) {
|
||||
if(unregisteredTiddlers.indexOf(shadowInfo.source) !== -1) {
|
||||
this.wiki.eachShadow(function(tiddler,title) {
|
||||
var source = self.wiki.getShadowSource(title);
|
||||
if(unregisteredTiddlers.indexOf(source) !== -1) {
|
||||
changedTiddlers[title] = true; // isDeleted?
|
||||
}
|
||||
});
|
||||
@@ -72,8 +73,9 @@ PluginSwitcher.prototype.switchPlugins = function() {
|
||||
// Unpack the current theme tiddlers
|
||||
$tw.wiki.unpackPluginTiddlers();
|
||||
// Accumulate the affected shadow tiddlers
|
||||
$tw.utils.each(this.wiki.shadowTiddlers,function(shadowInfo,title) {
|
||||
if(registeredTiddlers.indexOf(shadowInfo.source) !== -1) {
|
||||
this.wiki.eachShadow(function(tiddler,title) {
|
||||
var source = self.wiki.getShadowSource(title);
|
||||
if(registeredTiddlers.indexOf(source) !== -1) {
|
||||
changedTiddlers[title] = false; // isDeleted?
|
||||
}
|
||||
});
|
||||
|
||||
+3
-10
@@ -178,13 +178,6 @@ exports.isTemporaryTiddler = function(title) {
|
||||
return title.indexOf("$:/temp/") === 0;
|
||||
};
|
||||
|
||||
/*
|
||||
Determines if a tiddler is a shadow tiddler, regardless of whether it has been overridden by a real tiddler
|
||||
*/
|
||||
exports.isShadowTiddler = function(title) {
|
||||
return $tw.utils.hop(this.shadowTiddlers,title);
|
||||
};
|
||||
|
||||
exports.isImageTiddler = function(title) {
|
||||
var tiddler = this.getTiddler(title);
|
||||
if(tiddler) {
|
||||
@@ -453,12 +446,12 @@ exports.getTagMap = function() {
|
||||
},
|
||||
title, tiddler;
|
||||
// Collect up all the tags
|
||||
for(title in self.shadowTiddlers) {
|
||||
self.eachShadow(function(tiddler,title) {
|
||||
if(!self.tiddlerExists(title)) {
|
||||
tiddler = self.shadowTiddlers[title].tiddler;
|
||||
tiddler = self.getTiddler(title);
|
||||
storeTags(tiddler.fields.tags,title);
|
||||
}
|
||||
}
|
||||
});
|
||||
self.each(function(tiddler,title) {
|
||||
storeTags(tiddler.fields.tags,title);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user