From 31a378b64ca612ae2eb4a3c2d68e10d2c3cc6f61 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 28 Apr 2013 09:42:48 +0100 Subject: [PATCH] Start support for themes To start with, we move the current stylesheets into a theme plugin called "Snow White". Wikis have to specify at least one theme in their `tiddlywiki.info` file. Next we'll add a mechanism for switching between loaded themes --- boot/boot.js | 11 +++++++++++ editions/clientserver/tiddlywiki.info | 3 +++ editions/empty/tiddlywiki.info | 3 +++ editions/tahoelafs/tiddlywiki.info | 3 +++ editions/test/tiddlywiki.info | 3 +++ editions/tw5.com/tiddlywiki.info | 3 +++ editions/tw5tiddlyweb/tiddlywiki.info | 3 +++ {core/styles => themes/tiddlywiki/snowwhite}/base.tid | 0 .../tiddlywiki/snowwhite}/colourmappings.tid | 0 .../tiddlywiki/snowwhite}/colours.tid | 0 .../tiddlywiki/snowwhite}/metrics.tid | 0 themes/tiddlywiki/snowwhite/plugin.info | 7 +++++++ .../styles => themes/tiddlywiki/snowwhite}/reset.tid | 0 13 files changed, 36 insertions(+) rename {core/styles => themes/tiddlywiki/snowwhite}/base.tid (100%) rename {core/styles => themes/tiddlywiki/snowwhite}/colourmappings.tid (100%) rename {core/styles => themes/tiddlywiki/snowwhite}/colours.tid (100%) rename {core/styles => themes/tiddlywiki/snowwhite}/metrics.tid (100%) create mode 100644 themes/tiddlywiki/snowwhite/plugin.info rename {core/styles => themes/tiddlywiki/snowwhite}/reset.tid (100%) diff --git a/boot/boot.js b/boot/boot.js index 9e1ddabb9..89c88b8f2 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1086,6 +1086,16 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) { } } } + // Load any themes listed in the wiki info file + if(wikiInfo.themes) { + var themesBasePath = path.resolve($tw.boot.corePath,$tw.config.themesPath); + for(var t=0; t=5.0.0" +} diff --git a/core/styles/reset.tid b/themes/tiddlywiki/snowwhite/reset.tid similarity index 100% rename from core/styles/reset.tid rename to themes/tiddlywiki/snowwhite/reset.tid