From 623a3ec8f8a13b72129a6f75f9c10781e7276347 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 15 Mar 2013 22:00:19 +0000 Subject: [PATCH] Rename "shadow" tiddlers to "system" tiddlers What we have at the moment isn't really the same as TiddlyWiki classic's shadow tiddlers, it's a much simpler system for excluding tiddlers. We'll use the term "shadow" instead to refer to the way that tiddlers in plugins behave, which is exactly like TiddlyWiki classic's shadow tiddlers. --- bld.sh | 2 +- core/boot.js | 6 +++--- core/modules/commands/dump.js | 6 +++--- core/modules/filters.js | 8 ++++---- core/modules/tiddler.js | 8 ++++---- core/modules/widgets/list/list.js | 8 ++++---- core/modules/wiki.js | 8 ++++---- core/templates/StaticContent.tid | 2 +- core/templates/static.template.css.tid | 2 +- core/templates/static.template.html.tid | 2 +- core/templates/store.area.template.html.tid | 4 ++-- core/templates/tiddlywiki5.template.html.tid | 12 ++++++------ editions/tw2/wiki/tiddlywiki2.template.html.tid | 4 ++-- editions/tw5.com/tiddlers/Demos.tid | 2 +- editions/tw5.com/tiddlers/Docs.tid | 2 +- editions/tw5.com/tiddlers/commands/DumpCommand.tid | 6 +++--- .../tiddlers/commands/SaveTiddlersCommand.tid | 2 +- .../tw5.com/tiddlers/concepts/ShadowTiddlers.tid | 10 ---------- .../tw5.com/tiddlers/concepts/SystemTiddlers.tid | 10 ++++++++++ .../tw5.com/tiddlers/concepts/TiddlerFilters.tid | 2 +- .../editions/TiddlyWiki5_Static_Site_Generation.tid | 2 +- .../tw5.com/tiddlers/mechanisms/BootMechanism.tid | 2 +- editions/tw5dropbox/appwiki/wiki/AllTiddlers.tid | 2 +- .../tw5dropbox/appwiki/wiki/index.template.html.tid | 2 +- .../tw5dropbox/appwiki/wiki/styles.template.css.tid | 2 +- .../appwiki/wiki/tw5dropbox.template.js.tid | 6 +++--- .../tw5dropbox/mainwiki/wiki/index.template.html.tid | 12 ++++++------ plugins/tiddlywiki/dropbox-app/dropbox-app.js | 2 +- plugins/tiddlywiki/dropbox/dropbox.js | 8 ++++---- readme.md | 8 ++++---- 30 files changed, 76 insertions(+), 76 deletions(-) delete mode 100644 editions/tw5.com/tiddlers/concepts/ShadowTiddlers.tid create mode 100644 editions/tw5.com/tiddlers/concepts/SystemTiddlers.tid diff --git a/bld.sh b/bld.sh index 14f29ae1e..4300b0e73 100755 --- a/bld.sh +++ b/bld.sh @@ -35,7 +35,7 @@ node ./tiddlywiki.js \ --savetiddler $:/core/templates/tiddlywiki5.template.html $TW5_BUILD_OUTPUT/index.html text/plain \ --savetiddler $:/core/templates/static.template.html $TW5_BUILD_OUTPUT/static.html text/plain \ --savetiddler $:/core/templates/static.template.css $TW5_BUILD_OUTPUT/static/static.css text/plain \ - --savetiddlers [!is[shadow]] $:/core/templates/static.tiddler.html $TW5_BUILD_OUTPUT/static text/plain \ + --savetiddlers [!is[system]] $:/core/templates/static.tiddler.html $TW5_BUILD_OUTPUT/static text/plain \ || exit 1 # Second, encrypted.html: a version of the main file encrypted with the password "password" diff --git a/core/boot.js b/core/boot.js index 168b2014a..b7400e96e 100644 --- a/core/boot.js +++ b/core/boot.js @@ -57,7 +57,7 @@ $tw.config = $tw.config || {}; $tw.config.pluginsPath = "../plugins/"; $tw.config.wikiInfo = $tw.config.wikiInfo || "./tiddlywiki.info"; $tw.config.wikiPluginsSubDir = $tw.config.wikiPluginsSubDir || "./plugins"; -$tw.config.wikiShadowsSubDir = $tw.config.wikiShadowsSubDir || "./wiki"; +$tw.config.wikiSystemSubDir = $tw.config.wikiSystemSubDir || "./wiki"; $tw.config.wikiTiddlersSubDir = $tw.config.wikiTiddlersSubDir || "./tiddlers"; $tw.config.jsModuleHeaderRegExpString = "^\\/\\*\\\\\\n((?:^[^\\n]*\\n)+?)(^\\\\\\*\\/$\\n?)"; @@ -880,7 +880,7 @@ $tw.loadTiddlers = function() { "bootKernel", "styleArea", "storeArea", - "shadowArea" + "systemArea" ]; for(var t=0; t=0; r--) {if(" + op + "this.getTiddler(subResults[r]).isShadow()) {subResults.splice(r,1);}}"; + case "system": + return "for(r=subResults.length-1; r>=0; r--) {if(" + op + "this.getTiddler(subResults[r]).isSystem()) {subResults.splice(r,1);}}"; default: throw "Unknown operand for 'is' filter operator"; } diff --git a/core/modules/tiddler.js b/core/modules/tiddler.js index f9c74d25d..5ff0c0d4b 100644 --- a/core/modules/tiddler.js +++ b/core/modules/tiddler.js @@ -16,11 +16,11 @@ exports.hasTag = function(tag) { return this.fields.tags && this.fields.tags.indexOf(tag) !== -1; }; -exports.isShadow = function() { - if(!$tw.utils.hop(this,"shadowFlag")) { - this.shadowFlag = this.fields.title.indexOf("$:/") === 0; +exports.isSystem = function() { + if(!$tw.utils.hop(this,"systemFlag")) { + this.systemFlag = this.fields.title.indexOf("$:/") === 0; } - return this.shadowFlag; + return this.systemFlag; }; exports.isTemporary = function() { diff --git a/core/modules/widgets/list/list.js b/core/modules/widgets/list/list.js index 06e42fb6c..feb81ef7e 100644 --- a/core/modules/widgets/list/list.js +++ b/core/modules/widgets/list/list.js @@ -28,11 +28,11 @@ var ListWidget = function(renderer) { These types are shorthands for particular filters */ var typeMappings = { - all: "[!is[shadow]sort[title]]", - recent: "[!is[shadow]sort[modified]]", + all: "[!is[system]sort[title]]", + recent: "[!is[system]sort[modified]]", missing: "[is[missing]sort[title]]", orphans: "[is[orphan]sort[title]]", - shadows: "[is[shadow]sort[title]]" + system: "[is[system]sort[title]]" }; ListWidget.prototype.generate = function() { @@ -70,7 +70,7 @@ ListWidget.prototype.getTiddlerList = function() { filter = this.renderer.getAttribute("filter"); } if(!filter) { - filter = "[!is[shadow]]"; + filter = "[!is[system]]"; } this.list = this.renderer.renderTree.wiki.filterTiddlers(filter,this.renderer.getContextTiddlerTitle()); }; diff --git a/core/modules/wiki.js b/core/modules/wiki.js index c7f79b681..acaaa64bb 100644 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -171,13 +171,13 @@ exports.addTiddler = function(tiddler) { }; /* -Return a sorted array of non-shadow tiddler titles, optionally filtered by a tag +Return a sorted array of non-system tiddler titles, optionally filtered by a tag */ exports.getTiddlers = function(sortField,excludeTag) { sortField = sortField || "title"; var tiddlers = [], t, titles = []; for(t in this.tiddlers) { - if($tw.utils.hop(this.tiddlers,t) && !this.tiddlers[t].isShadow() && (!excludeTag || !this.tiddlers[t].hasTag(excludeTag))) { + if($tw.utils.hop(this.tiddlers,t) && !this.tiddlers[t].isSystem() && (!excludeTag || !this.tiddlers[t].hasTag(excludeTag))) { tiddlers.push(this.tiddlers[t]); } } @@ -257,10 +257,10 @@ exports.getOrphanTitles = function() { return []; // Todo }; -exports.getShadowTitles = function() { +exports.getSystemTitles = function() { var titles = []; for(var title in this.tiddlers) { - if(this.tiddlers[title].isShadow()) { + if(this.tiddlers[title].isSystem()) { titles.push(title); } } diff --git a/core/templates/StaticContent.tid b/core/templates/StaticContent.tid index a02a74e58..ceb153979 100644 --- a/core/templates/StaticContent.tid +++ b/core/templates/StaticContent.tid @@ -2,6 +2,6 @@ title: $:/templates/StaticContent type: text/vnd.tiddlywiki -<$list filter="[!is[shadow]sort[title]]" > +<$list filter="[!is[system]sort[title]]" > <$view field="title" format="text"> diff --git a/core/templates/static.template.css.tid b/core/templates/static.template.css.tid index df40bdfde..07399b8a6 100644 --- a/core/templates/static.template.css.tid +++ b/core/templates/static.template.css.tid @@ -1,4 +1,4 @@ title: $:/core/templates/static.template.css -{{{ [is[shadow]type[text/css]] ||$:/core/templates/plain-text-tiddler}}} +{{{ [is[system]type[text/css]] ||$:/core/templates/plain-text-tiddler}}} {{$:/core/styles/base}} diff --git a/core/templates/static.template.html.tid b/core/templates/static.template.html.tid index 349e79d6c..808d18df9 100644 --- a/core/templates/static.template.html.tid +++ b/core/templates/static.template.html.tid @@ -11,7 +11,7 @@ type: text/vnd.tiddlywiki-html {{$:/core/wiki/title}}
-{{{ [is[shadow]type[text/css]] ||$:/core/templates/css-tiddler}}} +{{{ [is[system]type[text/css]] ||$:/core/templates/css-tiddler}}}