From 63fd149ea9b9b60b44fe5fdab5d599a7434aa695 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 28 Mar 2013 17:15:52 +0000 Subject: [PATCH] Relaxed restrictions on the names of constituent tiddlers within plugins Thus allowing us to give a more sensible title to the core plugin --- boot/boot.js | 14 +++----------- core/plugin.info | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 5325d0a37..518e508df 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -554,15 +554,13 @@ $tw.Wiki.prototype.unpackPluginTiddlers = function() { // Save the plugin information var pluginInfo = self.plugins[title] = JSON.parse(tiddler.fields.text); // Extract the constituent tiddlers - for(var t in pluginInfo.tiddlers) { - var constituentTiddler = pluginInfo.tiddlers[t], - constituentTitle = pluginInfo.title + "/" + t; + $tw.utils.each(pluginInfo.tiddlers,function(constituentTiddler,constituentTitle) { // Don't overwrite tiddlers that already exist if(!$tw.utils.hop(self.shadowTiddlers,constituentTitle)) { // Save the tiddler object self.shadowTiddlers[constituentTitle] = new $tw.Tiddler(constituentTiddler,{title: constituentTitle}); } - } + }); } }); }; @@ -986,14 +984,8 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) { } // Save the plugin tiddlers into the plugin info pluginInfo.tiddlers = pluginInfo.tiddlers || {}; - titlePrefix = pluginInfo.title + "/"; for(t=0; t titlePrefix.length) { - pluginInfo.tiddlers[pluginTiddlers[t].title.substr(titlePrefix.length)] = pluginTiddlers[t]; - } else { - console.log("Error extracting plugin: The plugin '" + pluginInfo.title + "' cannot contain a tiddler titled '" + pluginTiddlers[t].title + "'"); - } + pluginInfo.tiddlers[pluginTiddlers[t].title] = pluginTiddlers[t]; } } } diff --git a/core/plugin.info b/core/plugin.info index 5976346f0..7cc3dc5af 100644 --- a/core/plugin.info +++ b/core/plugin.info @@ -1,5 +1,5 @@ { - "title": "$:", + "title": "$:/core", "description": "TiddlyWiki5 core plugin", "author": "JeremyRuston", "version": "0.0.0",