1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-07-03 10:32:50 +00:00

Cleaning up

This commit is contained in:
Jeremy Ruston 2025-02-26 20:01:32 +00:00
parent 094428b1ab
commit 752c5cfbda

View File

@ -53,8 +53,7 @@ PluginSwitcher.prototype.switchPlugins = function() {
var tiddler = self.wiki.getTiddler(title); var tiddler = self.wiki.getTiddler(title);
if(tiddler && tiddler.isPlugin() && plugins.indexOf(title) === -1) { if(tiddler && tiddler.isPlugin() && plugins.indexOf(title) === -1) {
plugins.push(title); plugins.push(title);
var pluginInfo = $tw.utils.parseJSONSafe(self.wiki.getTiddlerText(title)), var dependents = $tw.utils.parseStringArray(tiddler.fields.dependents || "");
dependents = $tw.utils.parseStringArray(tiddler.fields.dependents || "");
$tw.utils.each(dependents,function(title) { $tw.utils.each(dependents,function(title) {
accumulatePlugin(title); accumulatePlugin(title);
}); });
@ -82,17 +81,16 @@ PluginSwitcher.prototype.switchPlugins = function() {
}); });
} }
}); });
// Unregister any existing theme tiddlers // Unregister any existing theme/language tiddlers
var unregisteredTiddlers = this.wiki.unregisterPluginTiddlers(this.pluginType); var unregisteredTiddlers = this.wiki.unregisterPluginTiddlers(this.pluginType);
// Register any new theme tiddlers // Register any new theme/language tiddlers
var registeredTiddlers = this.wiki.registerPluginTiddlers(this.pluginType,plugins); var registeredTiddlers = this.wiki.registerPluginTiddlers(this.pluginType,plugins);
// Unpack the current theme tiddlers // Unpack the current theme/language tiddlers
this.wiki.unpackPluginTiddlers(this.doDebug); this.wiki.unpackPluginTiddlers(this.doDebug);
// Queue change events for the changed shadow tiddlers // Queue change events for the changed shadow tiddlers
$tw.utils.each(changedShadowTiddlers,function(status,title) { $tw.utils.each(changedShadowTiddlers,function(status,title) {
self.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title], true); self.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title], true);
}); });
// Call the switch handler // Call the switch handler
if(this.onSwitch) { if(this.onSwitch) {
this.onSwitch(plugins); this.onSwitch(plugins);