diff --git a/.gitignore b/.gitignore
index 0ab5b300f..412759161 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ node_modules/
/test-results/
/playwright-report/
/playwright/.cache/
+$__StoryList.tid
diff --git a/boot/boot.js b/boot/boot.js
index 1965efb5c..d993499b6 100644
--- a/boot/boot.js
+++ b/boot/boot.js
@@ -177,6 +177,7 @@ document: defaults to current document
eventListeners: array of event listeners (this option won't work until $tw.utils.addEventListeners() has been loaded)
*/
$tw.utils.domMaker = function(tag,options) {
+ var options = options || {};
var doc = options.document || document;
var element = doc.createElementNS(options.namespace || "http://www.w3.org/1999/xhtml",tag);
if(options["class"]) {
@@ -218,9 +219,34 @@ $tw.utils.error = function(err) {
heading = dm("h1",{text: errHeading}),
prompt = dm("div",{text: promptMsg, "class": "tc-error-prompt"}),
message = dm("div",{text: err, "class":"tc-error-message"}),
- button = dm("div",{children: [dm("button",{text: ( $tw.language == undefined ? "close" : $tw.language.getString("Buttons/Close/Caption") )})], "class": "tc-error-prompt"}),
- form = dm("form",{children: [heading,prompt,message,button], "class": "tc-error-form"});
+ closeButton = dm("div",{children: [dm("button",{text: ( $tw.language == undefined ? "close" : $tw.language.getString("Buttons/Close/Caption") )})], "class": "tc-error-prompt"}),
+ downloadButton = dm("div",{children: [dm("button",{text: ( $tw.language == undefined ? "download tiddlers" : $tw.language.getString("Buttons/EmergencyDownload/Caption") )})], "class": "tc-error-prompt"}),
+ form = dm("form",{children: [heading,prompt,downloadButton,message,closeButton], "class": "tc-error-form"});
document.body.insertBefore(form,document.body.firstChild);
+ downloadButton.addEventListener("click",function(event) {
+ if($tw && $tw.wiki) {
+ var tiddlers = [];
+ $tw.wiki.each(function(tiddler,title) {
+ tiddlers.push(tiddler.fields);
+ });
+ var link = dm("a"),
+ text = JSON.stringify(tiddlers);
+ if(Blob !== undefined) {
+ var blob = new Blob([text], {type: "text/html"});
+ link.setAttribute("href", URL.createObjectURL(blob));
+ } else {
+ link.setAttribute("href","data:text/html," + encodeURIComponent(text));
+ }
+ link.setAttribute("download","emergency-tiddlers-" + (new Date()) + ".json");
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ } else {
+ alert("Emergency tiddler download is not available");
+ }
+ event.preventDefault();
+ return false;
+ },true);
form.addEventListener("submit",function(event) {
document.body.removeChild(form);
event.preventDefault();
@@ -786,6 +812,7 @@ $tw.utils.Crypto = function() {
}
return outputText;
};
+ $tw.sjcl = sjcl;
this.setPassword = function(newPassword) {
currentPassword = newPassword;
this.updateCryptoStateTiddler();
@@ -1967,10 +1994,10 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) {
var value = tiddler[name];
switch(fieldInfo.source) {
case "subdirectories":
- value = path.relative(rootPath, filename).split('/').slice(0, -1);
+ value = path.relative(rootPath, filename).split(path.sep).slice(0, -1);
break;
case "filepath":
- value = path.relative(rootPath, filename);
+ value = path.relative(rootPath, filename).split(path.sep).join('/');
break;
case "filename":
value = path.basename(filename);
@@ -2453,8 +2480,12 @@ $tw.boot.initStartup = function(options) {
$tw.utils.registerFileType("text/x-markdown","utf8",[".md",".markdown"]);
$tw.utils.registerFileType("application/enex+xml","utf8",".enex");
$tw.utils.registerFileType("application/vnd.openxmlformats-officedocument.wordprocessingml.document","base64",".docx");
+ $tw.utils.registerFileType("application/msword","base64",".doc");
$tw.utils.registerFileType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","base64",".xlsx");
+ $tw.utils.registerFileType("application/excel","base64",".xls");
+ $tw.utils.registerFileType("application/vnd.ms-excel","base64",".xls");
$tw.utils.registerFileType("application/vnd.openxmlformats-officedocument.presentationml.presentation","base64",".pptx");
+ $tw.utils.registerFileType("application/mspowerpoint","base64",".ppt");
$tw.utils.registerFileType("text/x-bibtex","utf8",".bib",{deserializerType:"application/x-bibtex"});
$tw.utils.registerFileType("application/x-bibtex","utf8",".bib");
$tw.utils.registerFileType("application/epub+zip","base64",".epub");
diff --git a/core/images/default-layout.tid b/core/images/default-layout.tid
new file mode 100644
index 000000000..4e5295d76
--- /dev/null
+++ b/core/images/default-layout.tid
@@ -0,0 +1,7 @@
+title: $:/core/images/default-layout
+tags: $:/tags/Image
+
+\parameters (size:"22pt")
+> height=<> class="tc-image-default-layout tc-image-button" viewBox="0 0 128 128">
+
+
\ No newline at end of file
diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids
index fa769d117..3ee898b4f 100644
--- a/core/language/en-GB/Buttons.multids
+++ b/core/language/en-GB/Buttons.multids
@@ -28,6 +28,7 @@ Encryption/ClearPassword/Caption: clear password
Encryption/ClearPassword/Hint: Clear the password and save this wiki without encryption
Encryption/SetPassword/Caption: set password
Encryption/SetPassword/Hint: Set a password for saving this wiki with encryption
+EmergencyDownload/Caption: download tiddlers as json
ExportPage/Caption: export all
ExportPage/Hint: Export all tiddlers
ExportTiddler/Caption: export tiddler
diff --git a/core/language/en-GB/Docs/ModuleTypes.multids b/core/language/en-GB/Docs/ModuleTypes.multids
index 9a03d8887..5d5902c76 100644
--- a/core/language/en-GB/Docs/ModuleTypes.multids
+++ b/core/language/en-GB/Docs/ModuleTypes.multids
@@ -9,7 +9,7 @@ config: Data to be inserted into `$tw.config`.
filteroperator: Individual filter operator methods.
global: Global data to be inserted into `$tw`.
info: Publishes system information via the [[$:/temp/info-plugin]] pseudo-plugin.
-isfilteroperator: Operands for the ''is'' filter operator.
+isfilteroperator: Parameters for the ''is'' filter operator.
library: Generic module type for general purpose JavaScript modules.
macro: JavaScript macro definitions.
parser: Parsers for different content types.
diff --git a/core/language/en-GB/Misc.multids b/core/language/en-GB/Misc.multids
index 2c10d1acb..b5e6e2374 100644
--- a/core/language/en-GB/Misc.multids
+++ b/core/language/en-GB/Misc.multids
@@ -30,7 +30,7 @@ Error/DeserializeOperator/UnknownDeserializer: Filter Error: Unknown deserialize
Error/Filter: Filter error
Error/FilterSyntax: Syntax error in filter expression
Error/FilterRunPrefix: Filter Error: Unknown prefix for filter run
-Error/IsFilterOperator: Filter Error: Unknown operand for the 'is' filter operator
+Error/IsFilterOperator: Filter Error: Unknown parameter for the 'is' filter operator
Error/FormatFilterOperator: Filter Error: Unknown suffix for the 'format' filter operator
Error/LoadingPluginLibrary: Error loading plugin library
Error/NetworkErrorAlert: `
''Network Error'' It looks like the connection to the server has been lost. This may indicate a problem with your network connection. Please attempt to restore network connectivity before continuing. ''Any unsaved changes will be automatically synchronised when connectivity is restored''.`
diff --git a/core/modules/commands/listen.js b/core/modules/commands/listen.js
index 3c5f6a63a..ca6e6e076 100644
--- a/core/modules/commands/listen.js
+++ b/core/modules/commands/listen.js
@@ -18,7 +18,7 @@ exports.info = {
name: "listen",
synchronous: true,
namedParameterMode: true,
- mandatoryParameters: [],
+ mandatoryParameters: []
};
var Command = function(params,commander,callback) {
diff --git a/core/modules/filters/backtranscludes.js b/core/modules/filters/backtranscludes.js
new file mode 100644
index 000000000..7d4215073
--- /dev/null
+++ b/core/modules/filters/backtranscludes.js
@@ -0,0 +1,26 @@
+/*\
+title: $:/core/modules/filters/backtranscludes.js
+type: application/javascript
+module-type: filteroperator
+
+Filter operator for returning all the backtranscludes from a tiddler
+
+\*/
+(function(){
+
+/*jslint node: true, browser: true */
+/*global $tw: false */
+"use strict";
+
+/*
+Export our filter function
+*/
+exports.backtranscludes = function(source,operator,options) {
+ var results = [];
+ source(function(tiddler,title) {
+ $tw.utils.pushTop(results,options.wiki.getTiddlerBacktranscludes(title));
+ });
+ return results;
+};
+
+})();
diff --git a/core/modules/filters/crypto.js b/core/modules/filters/crypto.js
index 24f1a0df9..cfb524d06 100644
--- a/core/modules/filters/crypto.js
+++ b/core/modules/filters/crypto.js
@@ -14,12 +14,9 @@ Filter operators for cryptography, using the Stanford JavaScript library
exports.sha256 = function(source,operator,options) {
var results = [],
- length = parseInt(operator.operand,10) || 20,
- sha256 = function(text) {
- return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(text)).substr(0,length);
- };
+ length = parseInt(operator.operand,10) || 20;
source(function(tiddler,title) {
- results.push(sha256(title));
+ results.push($tw.utils.sha256(title,{length: length}));
});
return results;
};
diff --git a/core/modules/filters/transcludes.js b/core/modules/filters/transcludes.js
new file mode 100644
index 000000000..bd618296b
--- /dev/null
+++ b/core/modules/filters/transcludes.js
@@ -0,0 +1,26 @@
+/*\
+title: $:/core/modules/filters/transcludes.js
+type: application/javascript
+module-type: filteroperator
+
+Filter operator for returning all the transcludes from a tiddler
+
+\*/
+(function(){
+
+/*jslint node: true, browser: true */
+/*global $tw: false */
+"use strict";
+
+/*
+Export our filter function
+*/
+exports.transcludes = function(source,operator,options) {
+ var results = new $tw.utils.LinkedList();
+ source(function(tiddler,title) {
+ results.pushTop(options.wiki.getTiddlerTranscludes(title));
+ });
+ return results.toArray();
+};
+
+})();
diff --git a/core/modules/indexers/back-indexer.js b/core/modules/indexers/back-indexer.js
new file mode 100644
index 000000000..609d62bfc
--- /dev/null
+++ b/core/modules/indexers/back-indexer.js
@@ -0,0 +1,119 @@
+/*\
+title: $:/core/modules/indexers/back-indexer.js
+type: application/javascript
+module-type: indexer
+
+By parsing the tiddler text, indexes the tiddlers' back links, back transclusions, block level back links.
+
+\*/
+function BackIndexer(wiki) {
+ this.wiki = wiki;
+}
+
+BackIndexer.prototype.init = function() {
+ this.subIndexers = {
+ link: new BackSubIndexer(this,"extractLinks"),
+ transclude: new BackSubIndexer(this,"extractTranscludes"),
+ };
+};
+
+BackIndexer.prototype.rebuild = function() {
+ $tw.utils.each(this.subIndexers,function(subIndexer) {
+ subIndexer.rebuild();
+ });
+};
+
+BackIndexer.prototype.update = function(updateDescriptor) {
+ $tw.utils.each(this.subIndexers,function(subIndexer) {
+ subIndexer.update(updateDescriptor);
+ });
+};
+function BackSubIndexer(indexer,extractor) {
+ this.wiki = indexer.wiki;
+ this.indexer = indexer;
+ this.extractor = extractor;
+ /**
+ * {
+ * [target title, e.g. tiddler title being linked to]:
+ * {
+ * [source title, e.g. tiddler title that has link syntax in its text]: true
+ * }
+ * }
+ */
+ this.index = null;
+}
+
+BackSubIndexer.prototype.init = function() {
+ // lazy init until first lookup
+ this.index = null;
+}
+
+BackSubIndexer.prototype._init = function() {
+ this.index = Object.create(null);
+ var self = this;
+ this.wiki.forEachTiddler(function(sourceTitle,tiddler) {
+ var newTargets = self._getTarget(tiddler);
+ $tw.utils.each(newTargets, function(target) {
+ if(!self.index[target]) {
+ self.index[target] = Object.create(null);
+ }
+ self.index[target][sourceTitle] = true;
+ });
+ });
+}
+
+BackSubIndexer.prototype.rebuild = function() {
+ this.index = null;
+}
+
+/*
+* Get things that is being referenced in the text, e.g. tiddler names in the link syntax.
+*/
+BackSubIndexer.prototype._getTarget = function(tiddler) {
+ var parser = this.wiki.parseText(tiddler.fields.type, tiddler.fields.text, {});
+ if(parser) {
+ return this.wiki[this.extractor](parser.tree);
+ }
+ return [];
+}
+
+BackSubIndexer.prototype.update = function(updateDescriptor) {
+ // lazy init/update until first lookup
+ if(!this.index) {
+ return;
+ }
+ var newTargets = [],
+ oldTargets = [],
+ self = this;
+ if(updateDescriptor.old.exists) {
+ oldTargets = this._getTarget(updateDescriptor.old.tiddler);
+ }
+ if(updateDescriptor.new.exists) {
+ newTargets = this._getTarget(updateDescriptor.new.tiddler);
+ }
+
+ $tw.utils.each(oldTargets,function(target) {
+ if(self.index[target]) {
+ delete self.index[target][updateDescriptor.old.tiddler.fields.title];
+ }
+ });
+ $tw.utils.each(newTargets,function(target) {
+ if(!self.index[target]) {
+ self.index[target] = Object.create(null);
+ }
+ self.index[target][updateDescriptor.new.tiddler.fields.title] = true;
+ });
+}
+
+BackSubIndexer.prototype.lookup = function(title) {
+ if(!this.index) {
+ this._init();
+ }
+ if(this.index[title]) {
+ return Object.keys(this.index[title]);
+ } else {
+ return [];
+ }
+}
+
+exports.BackIndexer = BackIndexer;
diff --git a/core/modules/indexers/backlinks-index.js b/core/modules/indexers/backlinks-index.js
deleted file mode 100644
index 5902e2829..000000000
--- a/core/modules/indexers/backlinks-index.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*\
-title: $:/core/modules/indexers/backlinks-indexer.js
-type: application/javascript
-module-type: indexer
-
-Indexes the tiddlers' backlinks
-
-\*/
-(function(){
-
-/*jslint node: true, browser: true */
-/*global modules: false */
-"use strict";
-
-
-function BacklinksIndexer(wiki) {
- this.wiki = wiki;
-}
-
-BacklinksIndexer.prototype.init = function() {
- this.index = null;
-}
-
-BacklinksIndexer.prototype.rebuild = function() {
- this.index = null;
-}
-
-BacklinksIndexer.prototype._getLinks = function(tiddler) {
- var parser = this.wiki.parseText(tiddler.fields.type, tiddler.fields.text, {});
- if(parser) {
- return this.wiki.extractLinks(parser.tree);
- }
- return [];
-}
-
-BacklinksIndexer.prototype.update = function(updateDescriptor) {
- if(!this.index) {
- return;
- }
- var newLinks = [],
- oldLinks = [],
- self = this;
- if(updateDescriptor.old.exists) {
- oldLinks = this._getLinks(updateDescriptor.old.tiddler);
- }
- if(updateDescriptor.new.exists) {
- newLinks = this._getLinks(updateDescriptor.new.tiddler);
- }
-
- $tw.utils.each(oldLinks,function(link) {
- if(self.index[link]) {
- delete self.index[link][updateDescriptor.old.tiddler.fields.title];
- }
- });
- $tw.utils.each(newLinks,function(link) {
- if(!self.index[link]) {
- self.index[link] = Object.create(null);
- }
- self.index[link][updateDescriptor.new.tiddler.fields.title] = true;
- });
-}
-
-BacklinksIndexer.prototype.lookup = function(title) {
- if(!this.index) {
- this.index = Object.create(null);
- var self = this;
- this.wiki.forEachTiddler(function(title,tiddler) {
- var links = self._getLinks(tiddler);
- $tw.utils.each(links, function(link) {
- if(!self.index[link]) {
- self.index[link] = Object.create(null);
- }
- self.index[link][title] = true;
- });
- });
- }
- if(this.index[title]) {
- return Object.keys(this.index[title]);
- } else {
- return [];
- }
-}
-
-exports.BacklinksIndexer = BacklinksIndexer;
-
-})();
diff --git a/core/modules/macros/csvtiddlers.js b/core/modules/macros/csvtiddlers.js
index 7b34ce04d..a492fd81c 100644
--- a/core/modules/macros/csvtiddlers.js
+++ b/core/modules/macros/csvtiddlers.js
@@ -35,9 +35,11 @@ exports.run = function(filter,format) {
// Collect all the fields
for(t=0;t 0 ? 1 : -1;
@@ -935,7 +944,7 @@ exports.strEndsWith = function(str,ending,position) {
if(str.endsWith) {
return str.endsWith(ending,position);
} else {
- if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > str.length) {
+ if(typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > str.length) {
position = str.length;
}
position -= ending.length;
diff --git a/core/modules/widgets/draggable.js b/core/modules/widgets/draggable.js
index 22fdc37e9..97e795ae4 100644
--- a/core/modules/widgets/draggable.js
+++ b/core/modules/widgets/draggable.js
@@ -119,7 +119,7 @@ DraggableWidget.prototype.refresh = function(changedTiddlers) {
return true;
} else {
if(changedAttributes["class"]) {
- this.assignDomNodeClasses();
+ this.updateDomNodeClasses();
}
this.assignAttributes(this.domNodes[0],{
changedAttributes: changedAttributes,
@@ -132,4 +132,4 @@ DraggableWidget.prototype.refresh = function(changedTiddlers) {
exports.draggable = DraggableWidget;
-})();
\ No newline at end of file
+})();
diff --git a/core/modules/widgets/importvariables.js b/core/modules/widgets/importvariables.js
index a8bb483b6..3e1ac3fc6 100644
--- a/core/modules/widgets/importvariables.js
+++ b/core/modules/widgets/importvariables.js
@@ -49,7 +49,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
// Accumulate the <$set> widgets from each tiddler
$tw.utils.each(this.tiddlerList,function(title) {
- var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:true});
+ var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:false});
if(parser) {
var parseTreeNode = parser.tree[0];
while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) {
diff --git a/core/modules/wiki.js b/core/modules/wiki.js
index 430c46466..96e40a708 100755
--- a/core/modules/wiki.js
+++ b/core/modules/wiki.js
@@ -534,8 +534,8 @@ Return an array of tiddler titles that link to the specified tiddler
*/
exports.getTiddlerBacklinks = function(targetTitle) {
var self = this,
- backlinksIndexer = this.getIndexer("BacklinksIndexer"),
- backlinks = backlinksIndexer && backlinksIndexer.lookup(targetTitle);
+ backIndexer = this.getIndexer("BackIndexer"),
+ backlinks = backIndexer && backIndexer.subIndexers.link.lookup(targetTitle);
if(!backlinks) {
backlinks = [];
@@ -549,6 +549,68 @@ exports.getTiddlerBacklinks = function(targetTitle) {
return backlinks;
};
+
+/*
+Return an array of tiddler titles that are directly transcluded within the given parse tree
+ */
+exports.extractTranscludes = function(parseTreeRoot) {
+ // Count up the transcludes
+ var transcludes = [],
+ checkParseTree = function(parseTree, parentNode) {
+ for(var t=0; tget[text]] }}}/>
$list>$list>
\end
-
\whitespace trim
<>
-
<$keyboard key="((input-tab-right))" actions=<>>
<$keyboard key="((input-tab-left))" actions=<>>
@@ -65,11 +63,10 @@ caption: {{$:/language/Search/Filter/Caption}}
<$list filter="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"><$transclude/>$list>
-
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>">
-<
>
+<>
<$list filter={{$:/temp/advancedsearch}}>
addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}>
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
diff --git a/core/ui/AdvancedSearch/Standard.tid b/core/ui/AdvancedSearch/Standard.tid
index 0690130e4..e6ed18a7a 100644
--- a/core/ui/AdvancedSearch/Standard.tid
+++ b/core/ui/AdvancedSearch/Standard.tid
@@ -54,17 +54,18 @@ caption: {{$:/language/Search/Standard/Caption}}
variable="listItem">
<$vars
userInput={{{ [[$:/temp/advancedsearch]get[text]] }}}
- configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}}
+ configTiddler={{{ [[$:/state/advancedsearch/standard/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}}
searchListState="$:/temp/advancedsearch/selected-item">
-<$list
- filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]"
- emptyMessage="<$list filter='[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]'><$transclude/>$list>">
+<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]">
<$macrocall $name="tabs"
tabsList="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"
default={{$:/config/SearchResults/Default}}
actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<>/>"
explicitState="$:/state/tab/search-results/advancedsearch" />
$list>
+<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]] :else[[]]">
+<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"><$transclude mode="block"/>$list>
+$list>
$vars>
$list>
$reveal>
diff --git a/core/ui/ControlPanel/Saving/DownloadSaver.tid b/core/ui/ControlPanel/Saving/DownloadSaver.tid
index 42e4dc3a9..be658a1ff 100644
--- a/core/ui/ControlPanel/Saving/DownloadSaver.tid
+++ b/core/ui/ControlPanel/Saving/DownloadSaver.tid
@@ -2,10 +2,19 @@ title: $:/core/ui/ControlPanel/Saving/DownloadSaver
tags: $:/tags/ControlPanel/Saving
caption: {{$:/language/ControlPanel/Saving/DownloadSaver/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Saving/DownloadSaver/
+>>
+
<>
-!! <$link to="$:/config/DownloadSaver/AutoSave"><>$link>
+!!.tc-control-panel-accent <$link to="$:/config/DownloadSaver/AutoSave"><>$link>
-<$checkbox tiddler="$:/config/DownloadSaver/AutoSave" field="text" checked="yes" unchecked="no" default="no"> <> $checkbox>
+<$checkbox tiddler="$:/config/DownloadSaver/AutoSave"
+ field="text" checked="yes" unchecked="no" default="no"
+ class="tc-control-panel-item"
+>
+ <>
+$checkbox>
+
\ No newline at end of file
diff --git a/core/ui/ControlPanel/Saving/General.tid b/core/ui/ControlPanel/Saving/General.tid
index d1b096281..38c3f34fb 100644
--- a/core/ui/ControlPanel/Saving/General.tid
+++ b/core/ui/ControlPanel/Saving/General.tid
@@ -3,14 +3,22 @@ tags: $:/tags/ControlPanel/Saving
caption: {{$:/language/ControlPanel/Saving/General/Caption}}
list-before:
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/
+>>
+
{{$:/language/ControlPanel/Saving/General/Hint}}
-!! <$link to="$:/config/AutoSave"><>$link>
+!!.tc-control-panel-accent <$link to="$:/config/AutoSave"><>$link>
<>
-<$radio tiddler="$:/config/AutoSave" value="yes"> <> $radio>
+<$radio tiddler="$:/config/AutoSave" value="yes">
+ <>
+$radio>
-<$radio tiddler="$:/config/AutoSave" value="no"> <> $radio>
+<$radio tiddler="$:/config/AutoSave" value="no">
+ <>
+$radio>
+
\ No newline at end of file
diff --git a/core/ui/ControlPanel/Settings/CamelCase.tid b/core/ui/ControlPanel/Settings/CamelCase.tid
index 36377bb85..3feace84b 100644
--- a/core/ui/ControlPanel/Settings/CamelCase.tid
+++ b/core/ui/ControlPanel/Settings/CamelCase.tid
@@ -2,7 +2,16 @@ title: $:/core/ui/ControlPanel/Settings/CamelCase
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/CamelCase/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/CamelCase/
+
<>
-<$checkbox tiddler="$:/config/WikiParserRules/Inline/wikilink" field="text" checked="enable" unchecked="disable" default="enable"> <$link to="$:/config/WikiParserRules/Inline/wikilink"><>$link> $checkbox>
+<$checkbox tiddler="$:/config/WikiParserRules/Inline/wikilink"
+ field="text" checked="enable" unchecked="disable" default="enable"
+ class="tc-control-panel-item"
+>
+ <$link to="$:/config/WikiParserRules/Inline/wikilink" class="tc-tiny-gap-left">
+ <>
+ $link>
+$checkbox>
diff --git a/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab.tid b/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab.tid
index 47f277bd4..c3ad60aac 100644
--- a/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab.tid
+++ b/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab.tid
@@ -2,13 +2,18 @@ caption: {{$:/language/ControlPanel/Settings/DefaultMoreSidebarTab/Caption}}
tags: $:/tags/ControlPanel/Settings
title: $:/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab
-\define lingo-base() $:/language/ControlPanel/Settings/DefaultMoreSidebarTab/
\whitespace trim
+\define lingo-base() $:/language/ControlPanel/Settings/DefaultMoreSidebarTab/
-<$link to="$:/config/DefaultMoreSidebarTab"><>$link>
+<$link to="$:/config/DefaultMoreSidebarTab" class="tc-control-panel-item">
+ <>
+$link>
-<$select tiddler="$:/config/DefaultMoreSidebarTab">
-<$list filter="[all[shadows+tiddlers]tag[$:/tags/MoreSideBar]!has[draft.of]]">
->><$transclude field="caption"><$text text=<>/>$transclude>
-$list>
+<$select tiddler="$:/config/DefaultMoreSidebarTab" class="tc-select">
+ <$list filter="[all[shadows+tiddlers]tag[$:/tags/MoreSideBar]!has[draft.of]]">
+ >><$transclude field="caption">
+ <$text text=<>/>
+ $transclude>
+
+ $list>
$select>
diff --git a/core/ui/ControlPanel/Settings/DefaultSidebarTab.tid b/core/ui/ControlPanel/Settings/DefaultSidebarTab.tid
index acd3421c7..1f4c5fc7b 100644
--- a/core/ui/ControlPanel/Settings/DefaultSidebarTab.tid
+++ b/core/ui/ControlPanel/Settings/DefaultSidebarTab.tid
@@ -5,10 +5,16 @@ title: $:/core/ui/ControlPanel/Settings/DefaultSidebarTab
\define lingo-base() $:/language/ControlPanel/Settings/DefaultSidebarTab/
\whitespace trim
-<$link to="$:/config/DefaultSidebarTab"><>$link>
+<$link to="$:/config/DefaultSidebarTab" class="tc-control-panel-item">
+ <>
+$link>
-<$select tiddler="$:/config/DefaultSidebarTab">
-<$list filter="[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]">
->><$transclude field="caption"><$text text=<>/>$transclude>
-$list>
+<$select tiddler="$:/config/DefaultSidebarTab" class="tc-select">
+ <$list filter="[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]">
+ >>
+ <$transclude field="caption">
+ <$text text=<>/>
+ $transclude>
+
+ $list>
$select>
diff --git a/core/ui/ControlPanel/Settings/EditorToolbar.tid b/core/ui/ControlPanel/Settings/EditorToolbar.tid
index aa142bf62..ad7384568 100644
--- a/core/ui/ControlPanel/Settings/EditorToolbar.tid
+++ b/core/ui/ControlPanel/Settings/EditorToolbar.tid
@@ -2,8 +2,15 @@ title: $:/core/ui/ControlPanel/Settings/EditorToolbar
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/EditorToolbar/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/EditorToolbar/
<>
-<$checkbox tiddler="$:/config/TextEditor/EnableToolbar" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/TextEditor/EnableToolbar"><>$link> $checkbox>
-
+<$checkbox tiddler="$:/config/TextEditor/EnableToolbar"
+ field="text" checked="yes" unchecked="no" default="yes"
+ class="tc-control-panel-item"
+>
+ <$link to="$:/config/TextEditor/EnableToolbar" class="tc-tiny-gap-left">
+ <>
+ $link>
+$checkbox>
diff --git a/core/ui/ControlPanel/Settings/InfoPanelMode.tid b/core/ui/ControlPanel/Settings/InfoPanelMode.tid
index 371b6d61b..e539b8f82 100644
--- a/core/ui/ControlPanel/Settings/InfoPanelMode.tid
+++ b/core/ui/ControlPanel/Settings/InfoPanelMode.tid
@@ -2,9 +2,17 @@ title: $:/core/ui/ControlPanel/Settings/InfoPanelMode
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/InfoPanelMode/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/InfoPanelMode/
-<$link to="$:/config/TiddlerInfo/Mode"><>$link>
-<$radio tiddler="$:/config/TiddlerInfo/Mode" value="popup"> <> $radio>
+<$link to="$:/config/TiddlerInfo/Mode" class="tc-control-panel-item">
+ <>
+$link>
-<$radio tiddler="$:/config/TiddlerInfo/Mode" value="sticky"> <> $radio>
+<$radio tiddler="$:/config/TiddlerInfo/Mode" value="popup">
+ <>
+$radio>
+
+<$radio tiddler="$:/config/TiddlerInfo/Mode" value="sticky">
+ <>
+$radio>
diff --git a/core/ui/ControlPanel/Settings/LinkToBehaviour.tid b/core/ui/ControlPanel/Settings/LinkToBehaviour.tid
index 92d46601e..dc98b1ae6 100644
--- a/core/ui/ControlPanel/Settings/LinkToBehaviour.tid
+++ b/core/ui/ControlPanel/Settings/LinkToBehaviour.tid
@@ -2,21 +2,25 @@ title: $:/core/ui/ControlPanel/Settings/LinkToBehaviour
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/LinkToBehaviour/Caption}}
-\define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/
\whitespace trim
+\define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/
-<$link to="$:/config/Navigation/openLinkFromInsideRiver"><>$link>
+<$link to="$:/config/Navigation/openLinkFromInsideRiver" class="tc-control-panel-item">
+ <>
+$link>
-<$select tiddler="$:/config/Navigation/openLinkFromInsideRiver">
- <>
- <>
- <>
- <>
+<$select tiddler="$:/config/Navigation/openLinkFromInsideRiver" class="tc-select">
+ <>
+ <>
+ <>
+ <>
$select>
-<$link to="$:/config/Navigation/openLinkFromOutsideRiver"><>$link>
+<$link to="$:/config/Navigation/openLinkFromOutsideRiver" class="tc-control-panel-item">
+ <>
+$link>
-<$select tiddler="$:/config/Navigation/openLinkFromOutsideRiver">
- <>
- <>
+<$select tiddler="$:/config/Navigation/openLinkFromOutsideRiver" class="tc-select">
+ <>
+ <>
$select>
diff --git a/core/ui/ControlPanel/Settings/MissingLinks.tid b/core/ui/ControlPanel/Settings/MissingLinks.tid
index 4a7ba5f2e..e0149c9a1 100644
--- a/core/ui/ControlPanel/Settings/MissingLinks.tid
+++ b/core/ui/ControlPanel/Settings/MissingLinks.tid
@@ -2,8 +2,12 @@ title: $:/core/ui/ControlPanel/Settings/MissingLinks
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/MissingLinks/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/MissingLinks/
<>
-<$checkbox tiddler="$:/config/MissingLinks" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/MissingLinks"><>$link> $checkbox>
-
+<$checkbox tiddler="$:/config/MissingLinks" field="text" checked="yes" unchecked="no" default="yes">
+ <$link to="$:/config/MissingLinks" class="tc-control-panel-item">
+ <>
+ $link>
+$checkbox>
diff --git a/core/ui/ControlPanel/Settings/NavigationAddressBar.tid b/core/ui/ControlPanel/Settings/NavigationAddressBar.tid
index 4a123ba99..f35f8a1f1 100644
--- a/core/ui/ControlPanel/Settings/NavigationAddressBar.tid
+++ b/core/ui/ControlPanel/Settings/NavigationAddressBar.tid
@@ -2,12 +2,21 @@ title: $:/core/ui/ControlPanel/Settings/NavigationAddressBar
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/NavigationAddressBar/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/NavigationAddressBar/
-<$link to="$:/config/Navigation/UpdateAddressBar"><>$link>
+<$link to="$:/config/Navigation/UpdateAddressBar" class="tc-control-panel-item">
+ <>
+$link>
-<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="permaview"> <> $radio>
+<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="permaview">
+ <>
+$radio>
-<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="permalink"> <> $radio>
+<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="permalink">
+ <>
+$radio>
-<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="no"> <> $radio>
+<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="no">
+ <>
+$radio>
diff --git a/core/ui/ControlPanel/Settings/NavigationHistory.tid b/core/ui/ControlPanel/Settings/NavigationHistory.tid
index af63de1ee..bd118a103 100644
--- a/core/ui/ControlPanel/Settings/NavigationHistory.tid
+++ b/core/ui/ControlPanel/Settings/NavigationHistory.tid
@@ -2,9 +2,17 @@ title: $:/core/ui/ControlPanel/Settings/NavigationHistory
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/NavigationHistory/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/NavigationHistory/
-<$link to="$:/config/Navigation/UpdateHistory"><>$link>
-<$radio tiddler="$:/config/Navigation/UpdateHistory" value="yes"> <> $radio>
+<$link to="$:/config/Navigation/UpdateHistory" class="tc-control-panel-item">
+ <>
+$link>
-<$radio tiddler="$:/config/Navigation/UpdateHistory" value="no"> <> $radio>
+<$radio tiddler="$:/config/Navigation/UpdateHistory" value="yes">
+ <>
+$radio>
+
+<$radio tiddler="$:/config/Navigation/UpdateHistory" value="no">
+ <>
+$radio>
diff --git a/core/ui/ControlPanel/Settings/NavigationPermalinkviewMode.tid b/core/ui/ControlPanel/Settings/NavigationPermalinkviewMode.tid
index 5a496d5e1..6c15936e7 100644
--- a/core/ui/ControlPanel/Settings/NavigationPermalinkviewMode.tid
+++ b/core/ui/ControlPanel/Settings/NavigationPermalinkviewMode.tid
@@ -2,9 +2,24 @@ title: $:/core/ui/ControlPanel/Settings/NavigationPermalinkviewMode
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/NavigationPermalinkviewMode/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/NavigationPermalinkviewMode/
<>
-<$checkbox tiddler="$:/config/Navigation/Permalinkview/CopyToClipboard" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/Navigation/Permalinkview/CopyToClipboard"><>$link> $checkbox>
+<$checkbox tiddler="$:/config/Navigation/Permalinkview/CopyToClipboard"
+ field="text" checked="yes" unchecked="no" default="yes"
+ class="tc-control-panel-item"
+>
+ <$link to="$:/config/Navigation/Permalinkview/CopyToClipboard" class="tc-tiny-gap-left">
+ <>
+ $link>
+$checkbox>
-<$checkbox tiddler="$:/config/Navigation/Permalinkview/UpdateAddressBar" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/Navigation/Permalinkview/UpdateAddressBar"><>$link> $checkbox>
+<$checkbox tiddler="$:/config/Navigation/Permalinkview/UpdateAddressBar"
+ field="text" checked="yes" unchecked="no" default="yes"
+ class="tc-control-panel-item"
+>
+ <$link to="$:/config/Navigation/Permalinkview/UpdateAddressBar" class="tc-tiny-gap-left">
+ <>
+ $link>
+$checkbox>
diff --git a/core/ui/ControlPanel/Settings/PerformanceInstrumentation.tid b/core/ui/ControlPanel/Settings/PerformanceInstrumentation.tid
index b3d1d9763..1ea9061ae 100644
--- a/core/ui/ControlPanel/Settings/PerformanceInstrumentation.tid
+++ b/core/ui/ControlPanel/Settings/PerformanceInstrumentation.tid
@@ -2,7 +2,15 @@ title: $:/core/ui/ControlPanel/Settings/PerformanceInstrumentation
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/PerformanceInstrumentation/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/PerformanceInstrumentation/
<>
-<$checkbox tiddler="$:/config/Performance/Instrumentation" field="text" checked="yes" unchecked="no" default="no"> <$link to="$:/config/Performance/Instrumentation"><>$link> $checkbox>
+<$checkbox tiddler="$:/config/Performance/Instrumentation"
+ field="text" checked="yes" unchecked="no" default="no"
+ class="tc-control-panel-item"
+>
+ <$link to="$:/config/Performance/Instrumentation" class="tc-tiny-gap-left">
+ <>
+ $link>
+$checkbox>
diff --git a/core/ui/ControlPanel/Settings/TitleLinks.tid b/core/ui/ControlPanel/Settings/TitleLinks.tid
index c1acdc7bd..1620dfe39 100644
--- a/core/ui/ControlPanel/Settings/TitleLinks.tid
+++ b/core/ui/ControlPanel/Settings/TitleLinks.tid
@@ -2,9 +2,17 @@ title: $:/core/ui/ControlPanel/Settings/TitleLinks
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/TitleLinks/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/TitleLinks/
-<$link to="$:/config/Tiddlers/TitleLinks"><>$link>
-<$radio tiddler="$:/config/Tiddlers/TitleLinks" value="yes"> <> $radio>
+<$link to="$:/config/Tiddlers/TitleLinks" class="tc-control-panel-item">
+ <>
+$link>
-<$radio tiddler="$:/config/Tiddlers/TitleLinks" value="no"> <> $radio>
+<$radio tiddler="$:/config/Tiddlers/TitleLinks" value="yes">
+ <>
+$radio>
+
+<$radio tiddler="$:/config/Tiddlers/TitleLinks" value="no">
+ <>
+$radio>
diff --git a/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid b/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid
index a25b2a39e..c02d653d7 100644
--- a/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid
+++ b/core/ui/ControlPanel/Settings/ToolbarButtonStyle.tid
@@ -2,12 +2,15 @@ title: $:/core/ui/ControlPanel/Settings/ToolbarButtonStyle
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption}}
-\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/
\whitespace trim
-<$link to="$:/config/Toolbar/ButtonClass"><>$link>
+\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/
-<$select tiddler="$:/config/Toolbar/ButtonClass">
-<$list filter="[all[shadows+tiddlers]tag[$:/tags/ToolbarButtonStyle]]">
-{{!!caption}}
-$list>
+<$link to="$:/config/Toolbar/ButtonClass" class="tc-control-panel-item">
+ <>
+$link>
+
+<$select tiddler="$:/config/Toolbar/ButtonClass" class="tc-select">
+ <$list filter="[all[shadows+tiddlers]tag[$:/tags/ToolbarButtonStyle]]">
+ {{!!caption}}
+ $list>
$select>
diff --git a/core/ui/ControlPanel/Settings/ToolbarButtons.tid b/core/ui/ControlPanel/Settings/ToolbarButtons.tid
index 00bdb191e..d76394ee8 100644
--- a/core/ui/ControlPanel/Settings/ToolbarButtons.tid
+++ b/core/ui/ControlPanel/Settings/ToolbarButtons.tid
@@ -2,9 +2,24 @@ title: $:/core/ui/ControlPanel/Settings/ToolbarButtons
tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/ToolbarButtons/Caption}}
+\whitespace trim
\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtons/
<>
-<$checkbox tiddler="$:/config/Toolbar/Icons" field="text" checked="yes" unchecked="no" default="yes"> <$link to="$:/config/Toolbar/Icons"><>$link> $checkbox>
+<$checkbox tiddler="$:/config/Toolbar/Icons"
+ field="text" checked="yes" unchecked="no" default="yes"
+ class="tc-control-panel-item"
+>
+ <$link to="$:/config/Toolbar/Icons" class="tc-tiny-gap-left">
+ <>
+ $link>
+$checkbox>
-<$checkbox tiddler="$:/config/Toolbar/Text" field="text" checked="yes" unchecked="no" default="no"> <$link to="$:/config/Toolbar/Text"><>$link> $checkbox>
+<$checkbox tiddler="$:/config/Toolbar/Text"
+ field="text" checked="yes" unchecked="no" default="no"
+ class="tc-control-panel-item"
+>
+ <$link to="$:/config/Toolbar/Text" class="tc-tiny-gap-left">
+ <>
+ $link>
+$checkbox>
diff --git a/core/ui/ControlPanel/TiddlyWiki.tid b/core/ui/ControlPanel/TiddlyWiki.tid
index 40be32139..ca3c88831 100644
--- a/core/ui/ControlPanel/TiddlyWiki.tid
+++ b/core/ui/ControlPanel/TiddlyWiki.tid
@@ -9,9 +9,9 @@ list-before:
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings]]">
-
+
> style="border-top:1px solid #eee;">
-!! <$link><$transclude field="caption"/>$link>
+!!.tc-control-panel-accent <$link><$transclude field="caption"/>$link>
<$transclude/>
diff --git a/core/ui/EditTemplate/body/default.tid b/core/ui/EditTemplate/body/default.tid
index 04cc64436..d004032f1 100644
--- a/core/ui/EditTemplate/body/default.tid
+++ b/core/ui/EditTemplate/body/default.tid
@@ -1,5 +1,9 @@
title: $:/core/ui/EditTemplate/body/default
+\function edit-preview-state()
+[{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[
] +[get[text]] :else[[no]]
+\end
+
\define config-visibility-title()
$:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
\end
@@ -10,12 +14,13 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
\whitespace trim
<$let
- editPreviewStateTiddler={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[] }}}
+ qualified-preview-state=<>
+ editPreviewStateTiddler={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[] }}}
importTitle=<>
importState=<> >
<$dropzone importTitle=<> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<> >
-
get[text]match[yes]then[tc-tiddler-preview]else[tc-tiddler-preview-hidden]] [[tc-tiddler-editor]] +[join[ ]] }}}>
+
match[yes]then[tc-tiddler-preview]else[tc-tiddler-preview-hidden]] [[tc-tiddler-editor]] +[join[ ]] }}}>
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
diff --git a/core/ui/EditTemplate/tags.tid b/core/ui/EditTemplate/tags.tid
index 5084478b4..c8d4131fe 100644
--- a/core/ui/EditTemplate/tags.tid
+++ b/core/ui/EditTemplate/tags.tid
@@ -3,39 +3,63 @@ tags: $:/tags/EditTemplate
\whitespace trim
-\define lingo-base() $:/language/EditTemplate/
+\procedure lingo-base() $:/language/EditTemplate/
-\define tag-styles()
-background-color:$(backgroundColor)$;
-fill:$(foregroundColor)$;
-color:$(foregroundColor)$;
+\procedure tag-body-inner(colour,fallbackTarget,colourA,colourB,icon,tagField:"tags")
+<$wikify name="foregroundColor"
+ text="""<$macrocall $name="contrastcolour"
+ target=<
>
+ fallbackTarget=<>
+ colourA=<>
+ colourB=<>/>
+ """
+>
+ <$let backgroundColor=<> >
+ >
+ style.color=<>
+ style.fill=<>
+ style.background-color=<>
+ >
+ <$transclude tiddler=<>/>
+ <$view field="title" format="text"/>
+ <$button class="tc-btn-invisible tc-remove-tag-button"
+ style.fill=<>
+ >
+ <$action-listops $tiddler=<> $field=<> $subfilter="-[{!!title}]"/>
+ {{$:/core/images/close-button}}
+ $button>
+
+ $let>
+$wikify>
\end
-\define tag-body-inner(colour,fallbackTarget,colourA,colourB,icon,tagField:"tags")
-\whitespace trim
-<$vars foregroundColor=<> backgroundColor="""$colour$""">
-> class="tc-tag-label tc-tag-list-item tc-small-gap-right" data-tag-title=<>>
-<$transclude tiddler="""$icon$"""/><$view field="title" format="text"/>
-<$button class="tc-btn-invisible tc-remove-tag-button" style=<>><$action-listops $tiddler=<> $field=<<__tagField__>> $subfilter="-[{!!title}]"/>{{$:/core/images/close-button}}$button>
-
-$vars>
+\procedure tag-body(colour,palette,icon,tagField:"tags")
+<$macrocall $name="tag-body-inner"
+ colour=`$(colour)$`
+ colourA={{{ [getindex[foreground]] }}}
+ colourB={{{ [getindex[background]] }}}
+ fallbackTarget={{{ [getindex[tag-background]] }}}
+ icon=<>
+ tagField=<>
+/>
\end
-\define tag-body(colour,palette,icon,tagField:"tags")
-<$macrocall $name="tag-body-inner" colour="""$colour$""" fallbackTarget={{$palette$##tag-background}} colourA={{$palette$##foreground}} colourB={{$palette$##background}} icon="""$icon$""" tagField=<<__tagField__>>/>
-\end
-
-\define edit-tags-template(tagField:"tags")
-\whitespace trim
+\procedure edit-tags-template(tagField:"tags")
-<$list filter="[list[!!$tagField$]sort[title]]" storyview="pop">
-<$macrocall $name="tag-body" colour={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}} palette={{$:/palette}} icon={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}} tagField=<<__tagField__>>/>
-$list>
-<$vars tabIndex={{$:/config/EditTabIndex}} cancelPopups="yes">
-<$macrocall $name="tag-picker" tagField=<<__tagField__>>/>
-$vars>
+ <$list filter="[getenlist-input[]sort[title]]" storyview="pop">
+ <$macrocall $name="tag-body"
+ colour={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}
+ palette={{$:/palette}}
+ icon={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}
+ tagField=<>
+ />
+ $list>
+ <$let tabIndex={{$:/config/EditTabIndex}} cancelPopups="yes">
+ <$macrocall $name="tag-picker" tagField=<>/>
+ $let>
\end
-<$set name="saveTiddler" value=<>>
-<$macrocall $name="edit-tags-template" tagField=<>/>
-$set>
+<$let saveTiddler=<>>
+ <$macrocall $name="edit-tags-template" tagField=<>/>
+$let>
diff --git a/core/ui/EditorToolbar/preview.tid b/core/ui/EditorToolbar/preview.tid
index ea49c971a..d5c63eb5f 100644
--- a/core/ui/EditorToolbar/preview.tid
+++ b/core/ui/EditorToolbar/preview.tid
@@ -10,7 +10,7 @@ shortcuts: ((preview))
\whitespace trim
- <$transclude $tiddler={{{ [get[text]match[yes]then[$:/core/images/preview-open]else[$:/core/images/preview-closed]] }}} />
+ <$transclude $tiddler={{{ [match[yes]then[$:/core/images/preview-open]else[$:/core/images/preview-closed]] }}} />
<$action-setfield $tiddler=<> $value={{{ [get[text]toggle[yes],[no]] }}} />
-<$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/>
\ No newline at end of file
+<$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/>
diff --git a/core/ui/PageTemplate.tid b/core/ui/PageTemplate.tid
index 20891e35d..7e78f1e20 100644
--- a/core/ui/PageTemplate.tid
+++ b/core/ui/PageTemplate.tid
@@ -1,7 +1,7 @@
title: $:/core/ui/PageTemplate
name: {{$:/language/PageTemplate/Name}}
description: {{$:/language/PageTemplate/Description}}
-icon: $:/core/images/layout-button
+icon: $:/core/images/default-layout
code-body: yes
\whitespace trim
diff --git a/core/wiki/macros/CSS.tid b/core/wiki/macros/CSS.tid
index 9e6239e90..2aca2c363 100644
--- a/core/wiki/macros/CSS.tid
+++ b/core/wiki/macros/CSS.tid
@@ -1,76 +1,69 @@
title: $:/core/macros/CSS
-tags: $:/tags/Macro
+tags: $:/tags/Macro $:/tags/Global
-\define colour(name)
-<$transclude tiddler={{$:/palette}} index="$name$"><$transclude tiddler="$:/palettes/Vanilla" index="$name$"><$transclude tiddler="$:/config/DefaultColourMappings/$name$"/>$transclude>$transclude>
+\procedure colour(name)
+\whitespace trim
+<$transclude $tiddler={{$:/palette}} $index=`$(name)$`>
+ <$transclude $tiddler="$:/palettes/Vanilla" $index=`$(name)$`>
+ <$transclude $tiddler=`$:/config/DefaultColourMappings/$(name)$`/>
+ $transclude>
+$transclude>
\end
-\define color(name)
-<>
+\procedure color(name)
+<$macrocall $name=colour name=`$(name)$`/>
\end
-\define box-shadow(shadow)
-``
- -webkit-box-shadow: $shadow$;
- -moz-box-shadow: $shadow$;
- box-shadow: $shadow$;
-``
+\function box-shadow(shadow)
+[[ -webkit-box-shadow: $(shadow)$;
+ -moz-box-shadow: $(shadow)$;
+ box-shadow: $(shadow)$;]substitute[]]
\end
-\define filter(filter)
-``
- -webkit-filter: $filter$;
- -moz-filter: $filter$;
- filter: $filter$;
-``
+\function filter(filter)
+[[ -webkit-filter: $(filter)$;
+ -moz-filter: $(filter)$;
+ filter: $(filter)$;]substitute[]]
\end
-\define transition(transition)
-``
- -webkit-transition: $transition$;
- -moz-transition: $transition$;
- transition: $transition$;
-``
+\function transition(transition)
+[[ -webkit-transition: $(transition)$;
+ -moz-transition: $(transition)$;
+ transition: $(transition)$;]substitute[]]
\end
-\define transform-origin(origin)
-``
- -webkit-transform-origin: $origin$;
- -moz-transform-origin: $origin$;
- transform-origin: $origin$;
-``
+\function transform-origin(origin)
+[[ -webkit-transform-origin: $(origin)$;
+ -moz-transform-origin: $(origin)$;
+ transform-origin: $(origin)$;]substitute[]]
\end
-\define background-linear-gradient(gradient)
-``
-background-image: linear-gradient($gradient$);
-background-image: -o-linear-gradient($gradient$);
-background-image: -moz-linear-gradient($gradient$);
-background-image: -webkit-linear-gradient($gradient$);
-background-image: -ms-linear-gradient($gradient$);
-``
+\function background-linear-gradient(gradient)
+[[ background-image: linear-gradient($(gradient)$);
+ background-image: -o-linear-gradient($(gradient)$);
+ background-image: -moz-linear-gradient($(gradient)$);
+ background-image: -webkit-linear-gradient($(gradient)$);
+ background-image: -ms-linear-gradient($(gradient)$);]substitute[]]
\end
-\define column-count(columns)
-``
--moz-column-count: $columns$;
--webkit-column-count: $columns$;
-column-count: $columns$;
-``
+\function column-count(columns)
+[[-moz-column-count: $(columns)$;
+ -webkit-column-count: $(columns)$;
+ column-count: $(columns)$;]substitute[]]
\end
-\define datauri(title)
-<$macrocall $name="makedatauri" type={{$title$!!type}} text={{$title$}} _canonical_uri={{$title$!!_canonical_uri}}/>
+\procedure datauri(title)
+<$macrocall $name="makedatauri" type={{{ [get[type]] }}} text={{{ [get[text]] }}} _canonical_uri={{{ [get[_canonical_uri]] }}}/>
\end
-\define if-sidebar(text)
-<$reveal state="$:/state/sidebar" type="match" text="yes" default="yes">$text$$reveal>
+\procedure if-sidebar(text)
+<$reveal state="$:/state/sidebar" type="match" text="yes" default="yes"><>$reveal>
\end
-\define if-no-sidebar(text)
-<$reveal state="$:/state/sidebar" type="nomatch" text="yes" default="yes">$text$$reveal>
+\procedure if-no-sidebar(text)
+<$reveal state="$:/state/sidebar" type="nomatch" text="yes" default="yes"><>$reveal>
\end
-\define if-background-attachment(text)
-<$reveal state="$:/themes/tiddlywiki/vanilla/settings/backgroundimage" type="nomatch" text="">$text$$reveal>
+\procedure if-background-attachment(text)
+<$reveal state="$:/themes/tiddlywiki/vanilla/settings/backgroundimage" type="nomatch" text=""><>$reveal>
\end
diff --git a/core/wiki/macros/copy-to-clipboard.tid b/core/wiki/macros/copy-to-clipboard.tid
index 910e955a9..c0d177d7e 100644
--- a/core/wiki/macros/copy-to-clipboard.tid
+++ b/core/wiki/macros/copy-to-clipboard.tid
@@ -1,20 +1,26 @@
title: $:/core/macros/copy-to-clipboard
-tags: $:/tags/Macro
+tags: $:/tags/Macro $:/tags/Global
-\define copy-to-clipboard(src,class:"tc-btn-invisible",style)
\whitespace trim
-<$button class=<<__class__>> style=<<__style__>> message="tm-copy-to-clipboard" param=<<__src__>> tooltip={{$:/language/Buttons/CopyToClipboard/Hint}}>
-{{$:/core/images/copy-clipboard}}
-
-<$text text={{$:/language/Buttons/CopyToClipboard/Caption}}/>
+
+\procedure copy-to-clipboard(src,class:"tc-btn-invisible",style)
+<$button message="tm-copy-to-clipboard"
+ param=<>
+ class=<>
+ style=<