diff --git a/boot/boot.js b/boot/boot.js index ce656e09d..42010b72b 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -639,22 +639,22 @@ $tw.Wiki.prototype.addTiddlers = function(tiddlers) { /* Extract constituent tiddlers from plugin tiddlers so that we can easily access them in getTiddler() */ -$tw.Wiki.prototype.unpackPluginTiddlers = function() { +$tw.Wiki.prototype.unpackPluginTiddlers = function(pluginType) { // Collect up the titles of all the plugin tiddlers var self = this, pluginInfoList = []; $tw.utils.each(this.tiddlers,function(tiddler,title,object) { - if(tiddler.fields.type === "application/json" && tiddler.hasField("plugin")) { + if(tiddler.fields.type === "application/json" && tiddler.hasField("plugin") && tiddler.fields["plugin-type"] === pluginType) { pluginInfoList.push(tiddler); } }); - // Sort the titles by the `pluginPriority` field + // Sort the titles by the `plugin-priority` field pluginInfoList.sort(function(a,b) { - if("pluginPriority" in a.fields && "pluginPriority" in b.fields) { - return a.fields.pluginPriority - b.fields.pluginPriority; - } else if("pluginPriority" in a.fields) { + if("plugin-priority" in a.fields && "plugin-priority" in b.fields) { + return a.fields["plugin-priority"] - b.fields["plugin-priority"]; + } else if("plugin-priority" in a.fields) { return -1; - } else if("pluginPriority" in b.fields) { + } else if("plugin-priority" in b.fields) { return +1; } else if(a.fields.title < b.fields.title) { return -1; @@ -1039,8 +1039,8 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) { type: "application/json", plugin: "yes", text: JSON.stringify(pluginInfo,null,4), - pluginPriority: pluginInfo.pluginPriority, - pluginType: pluginInfo.pluginType || "plugin" + "plugin-priority": pluginInfo["plugin-priority"], + "plugin-type": pluginInfo["plugin-type"] || "plugin" } return fields; } else { @@ -1206,7 +1206,7 @@ $tw.boot.startup = function() { // Load tiddlers $tw.loadTiddlers(); // Unpack plugin tiddlers - $tw.wiki.unpackPluginTiddlers(); + $tw.wiki.unpackPluginTiddlers("plugin"); // Register typed modules from the tiddlers we've just loaded $tw.wiki.defineTiddlerModules(); // And any modules within plugins diff --git a/core/modules/startup.js b/core/modules/startup.js index 4cee81be0..f087d3354 100644 --- a/core/modules/startup.js +++ b/core/modules/startup.js @@ -89,8 +89,10 @@ exports.startup = function() { document.addEventListener("tw-clear-password",function(event) { $tw.crypto.setPassword(null); }); + // Unpack the current theme tiddlers + $tw.wiki.unpackPluginTiddlers("theme"); // Apply stylesheets - var stylesheetTiddlers = $tw.wiki.filterTiddlers("[tag[$:/tags/stylesheet]]"); + var stylesheetTiddlers = $tw.wiki.filterTiddlers("[is[shadow]tag[$:/tags/stylesheet]]"); $tw.utils.each(stylesheetTiddlers,function(title,index) { // Stylesheets don't refresh, yet var parser = $tw.wiki.parseTiddler(title), diff --git a/core/plugin.info b/core/plugin.info index 726de4c49..4fc7c1c5e 100644 --- a/core/plugin.info +++ b/core/plugin.info @@ -3,6 +3,6 @@ "description": "TiddlyWiki5 core plugin", "author": "JeremyRuston", "version": "0.0.0", - "coreVersion": ">=5.0.0", - "pluginPriority": "0" + "core-version": ">=5.0.0", + "plugin-priority": "0" } diff --git a/plugins/tiddlywiki/filesystem/plugin.info b/plugins/tiddlywiki/filesystem/plugin.info index 0109abd1d..d279057db 100644 --- a/plugins/tiddlywiki/filesystem/plugin.info +++ b/plugins/tiddlywiki/filesystem/plugin.info @@ -3,5 +3,5 @@ "description": "File system synchronisation", "author": "JeremyRuston", "version": "0.0.0", - "coreVersion": ">=5.0.0" + "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/fullscreen/plugin.info b/plugins/tiddlywiki/fullscreen/plugin.info index 916b27ad9..2ab0534b5 100644 --- a/plugins/tiddlywiki/fullscreen/plugin.info +++ b/plugins/tiddlywiki/fullscreen/plugin.info @@ -3,5 +3,5 @@ "description": "Adds support for HTML5 full screen mode", "author": "JeremyRuston", "version": "0.0.0", - "coreVersion": ">=5.0.0" + "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/jasmine/plugin.info b/plugins/tiddlywiki/jasmine/plugin.info index 5fa623423..a92ef03b6 100644 --- a/plugins/tiddlywiki/jasmine/plugin.info +++ b/plugins/tiddlywiki/jasmine/plugin.info @@ -3,5 +3,5 @@ "description": "Jasmine test framework plugin for TiddlyWiki5", "author": "JeremyRuston", "version": "0.0.0", - "coreVersion": ">=5.0.0" + "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/loadrecipe/plugin.info b/plugins/tiddlywiki/loadrecipe/plugin.info index a474c9e64..222c56ef4 100644 --- a/plugins/tiddlywiki/loadrecipe/plugin.info +++ b/plugins/tiddlywiki/loadrecipe/plugin.info @@ -3,5 +3,5 @@ "description": "Loads tiddlers from an old-style TiddlyWiki 2.x.x recipe file", "author": "JeremyRuston", "version": "0.0.0", - "coreVersion": ">=5.0.0" + "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/stripcomments/plugin.info b/plugins/tiddlywiki/stripcomments/plugin.info index d77ecf134..4827a52ce 100644 --- a/plugins/tiddlywiki/stripcomments/plugin.info +++ b/plugins/tiddlywiki/stripcomments/plugin.info @@ -3,5 +3,5 @@ "description": "Strips //# comments from JavaScript source", "author": "JeremyRuston", "version": "0.0.0", - "coreVersion": ">=5.0.0" + "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/tahoelafs/plugin.info b/plugins/tiddlywiki/tahoelafs/plugin.info index 5cf716bae..6b57c8377 100644 --- a/plugins/tiddlywiki/tahoelafs/plugin.info +++ b/plugins/tiddlywiki/tahoelafs/plugin.info @@ -3,5 +3,5 @@ "description": "Support for saving changes to Tahoe-LAFS", "author": "JeremyRuston", "version": "0.0.0", - "coreVersion": ">=5.0.0" + "core-version": ">=5.0.0" } diff --git a/plugins/tiddlywiki/tiddlyweb/plugin.info b/plugins/tiddlywiki/tiddlyweb/plugin.info index 882ecb543..1ce0093e8 100644 --- a/plugins/tiddlywiki/tiddlyweb/plugin.info +++ b/plugins/tiddlywiki/tiddlyweb/plugin.info @@ -3,5 +3,5 @@ "description": "TiddlyWeb and TiddlySpace components", "author": "JeremyRuston", "version": "0.0.0", - "coreVersion": ">=5.0.0" + "core-version": ">=5.0.0" } diff --git a/themes/tiddlywiki/snowwhite/plugin.info b/themes/tiddlywiki/snowwhite/plugin.info index 10a90aca0..dd9ecede0 100644 --- a/themes/tiddlywiki/snowwhite/plugin.info +++ b/themes/tiddlywiki/snowwhite/plugin.info @@ -3,6 +3,6 @@ "description": "A simple, plain layout", "author": "JeremyRuston", "version": "0.0.0", - "coreVersion": ">=5.0.0", - "pluginType": "theme" + "core-version": ">=5.0.0", + "plugin-type": "theme" }