From 7d6769f6fd557103796da067ead561db1c9145b6 Mon Sep 17 00:00:00 2001 From: ng110 Date: Sun, 4 Jan 2015 12:22:00 +0000 Subject: [PATCH 01/16] Update select.js test change --- core/modules/widgets/select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/widgets/select.js b/core/modules/widgets/select.js index 79a169f7e..837c2504a 100644 --- a/core/modules/widgets/select.js +++ b/core/modules/widgets/select.js @@ -3,7 +3,7 @@ title: $:/core/modules/widgets/select.js type: application/javascript module-type: widget -Select widget: +Select widget (NG mod): ``` <$select tiddler="MyTiddler" field="text"> From 77c9918338f9ff9a81f1365bba54df98e9f80080 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Tue, 20 Jan 2015 12:06:09 +0100 Subject: [PATCH 02/16] shows better message for backup dir with custom store.php relates to #1387 --- core/language/en-GB/ControlPanel.multids | 1 + core/ui/ControlPanel/Saving.tid | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index 8fbaf59cc..f616a42bc 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -61,6 +61,7 @@ Saving/TiddlySpot/Password: Password Saving/TiddlySpot/ServerURL: Server URL Saving/TiddlySpot/UploadDir: Upload Directory Saving/TiddlySpot/UserName: Wiki Name +Saving/TiddlySpot/RelativeURL: relative to ''Server URL'' Settings/AutoSave/Caption: Autosave Settings/AutoSave/Disabled/Description: Do not save changes automatically Settings/AutoSave/Enabled/Description: Save changes automatically diff --git a/core/ui/ControlPanel/Saving.tid b/core/ui/ControlPanel/Saving.tid index 10583513d..f1d31f18e 100644 --- a/core/ui/ControlPanel/Saving.tid +++ b/core/ui/ControlPanel/Saving.tid @@ -9,7 +9,12 @@ http://$(userName)$.tiddlyspot.com/backup/ \define backupLink() <$reveal type="nomatch" state="$:/UploadName" text=""> <$set name="userName" value={{$:/UploadName}}> +<$reveal type="match" state="$:/UploadURL" text=""> >><$macrocall $name="backupURL" $type="text/plain" $output="text/plain"/> + +<$reveal type="nomatch" state="$:/UploadURL" text=""> +<> + \end From f9c4f6898e4e52137a6e5a87ff353839408c409b Mon Sep 17 00:00:00 2001 From: ng110 Date: Tue, 20 Jan 2015 12:34:24 +0000 Subject: [PATCH 03/16] Add capability for widgets to trigger all descendant action widgets, rather than just immediate children. Preserves compatibility with existing invokeActions call in button widget by creating a separate 'invokeActionCall' function to carry out the recursion. Triggering all descendants permits use of action widgets inside list widgets or macros. Also makes it possible to add triggering capability to select widget. --- core/modules/widgets/widget.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index c04f1bf96..b90558192 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -476,15 +476,25 @@ Widget.prototype.removeChildDomNodes = function() { }; /* -Invoke any action widgets that are immediate children of this widget +Invoke any action widgets that are descendants of this widget. */ Widget.prototype.invokeActions = function(event) { + return this.invokeActionCall(this, event); +}; + +/* +Recursively search through descendants, invoking all actions encountered. +*/ +Widget.prototype.invokeActionCall = function(here, event) { var handled = false; - for(var t=0; t Date: Tue, 20 Jan 2015 13:02:06 +0000 Subject: [PATCH 04/16] Update select.js --- core/modules/widgets/select.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/select.js b/core/modules/widgets/select.js index 837c2504a..0068608b7 100644 --- a/core/modules/widgets/select.js +++ b/core/modules/widgets/select.js @@ -3,7 +3,7 @@ title: $:/core/modules/widgets/select.js type: application/javascript module-type: widget -Select widget (NG mod): +Select widget: ``` <$select tiddler="MyTiddler" field="text"> @@ -53,6 +53,7 @@ Handle a change event SelectWidget.prototype.handleChangeEvent = function(event) { var value = this.getSelectDomNode().value; this.wiki.setText(this.selectTitle,this.selectField,this.selectIndex,value); + this.invokeActions(event); }; /* From e50453000588f58e7e3f6712d478ac8da1be55b8 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Fri, 23 Jan 2015 11:26:14 +0100 Subject: [PATCH 05/16] introduce serverpath macro for now, computes path to backup directory, appending the relative path of UploadBackupDir to the absolute one from the UploadURL Also added example for store.php to hint --- core/language/en-GB/ControlPanel.multids | 3 +- core/modules/macros/serverpath.js | 41 ++++++++++++++++++++++++ core/ui/ControlPanel/Saving.tid | 7 ++-- 3 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 core/modules/macros/serverpath.js diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index f616a42bc..6c8d989fa 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -56,12 +56,11 @@ Saving/TiddlySpot/Backups: Backups Saving/TiddlySpot/Description: These settings are only used when saving to http://tiddlyspot.com or a compatible remote server Saving/TiddlySpot/Filename: Upload Filename Saving/TiddlySpot/Heading: ~TiddlySpot -Saving/TiddlySpot/Hint: //The server URL defaults to `http://.tiddlyspot.com/store.cgi` and can be changed to use a custom server address// +Saving/TiddlySpot/Hint: //The server URL defaults to `http://.tiddlyspot.com/store.cgi` and can be changed to use a custom server address, e.g. `http://me.com/store.php`.// Saving/TiddlySpot/Password: Password Saving/TiddlySpot/ServerURL: Server URL Saving/TiddlySpot/UploadDir: Upload Directory Saving/TiddlySpot/UserName: Wiki Name -Saving/TiddlySpot/RelativeURL: relative to ''Server URL'' Settings/AutoSave/Caption: Autosave Settings/AutoSave/Disabled/Description: Do not save changes automatically Settings/AutoSave/Enabled/Description: Save changes automatically diff --git a/core/modules/macros/serverpath.js b/core/modules/macros/serverpath.js new file mode 100644 index 000000000..7fe47a2c1 --- /dev/null +++ b/core/modules/macros/serverpath.js @@ -0,0 +1,41 @@ +/*\ +title: $:/core/modules/macros/serverpath.js +type: application/javascript +module-type: macro + +Outputs a server-path based on parameters, +by default appends a relative path to an absolute one, +e.g. constructs path to TiddlySpot backup directory + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports.name = "serverpath"; + +exports.params = [ + {name: "source"}, + {name: "target"}, + {name: "mode"} +]; + +/* +Run the macro +*/ +exports.run = function(source, target, mode) { + var result = target; + mode = mode || ""; + switch (mode){ + case "": + case "append-relative": + target = ("." == target || "./" == target) ? "" : target; + result = source.substr(0,1+source.lastIndexOf('/')) + target; + break; + } + return result; +}; + +})(); diff --git a/core/ui/ControlPanel/Saving.tid b/core/ui/ControlPanel/Saving.tid index f1d31f18e..65b3b687e 100644 --- a/core/ui/ControlPanel/Saving.tid +++ b/core/ui/ControlPanel/Saving.tid @@ -10,10 +10,10 @@ http://$(userName)$.tiddlyspot.com/backup/ <$reveal type="nomatch" state="$:/UploadName" text=""> <$set name="userName" value={{$:/UploadName}}> <$reveal type="match" state="$:/UploadURL" text=""> ->><$macrocall $name="backupURL" $type="text/plain" $output="text/plain"/> +<> <$reveal type="nomatch" state="$:/UploadURL" text=""> -<> +<$macrocall $name=serverpath source={{$:/UploadURL}} target={{$:/UploadBackupDir}}>> @@ -33,5 +33,4 @@ http://$(userName)$.tiddlyspot.com/backup/ |<> |<$edit-text tiddler="$:/UploadDir" default="." tag="input"/> | |<> |<$edit-text tiddler="$:/UploadBackupDir" default="." tag="input"/> | -<> - +<> \ No newline at end of file From a7a205a754df0dac63e68cda1e1cfaf1a37fde28 Mon Sep 17 00:00:00 2001 From: ng110 Date: Wed, 28 Jan 2015 16:00:34 +0000 Subject: [PATCH 06/16] Update select.js --- core/modules/widgets/select.js | 1 - 1 file changed, 1 deletion(-) diff --git a/core/modules/widgets/select.js b/core/modules/widgets/select.js index 0068608b7..79a169f7e 100644 --- a/core/modules/widgets/select.js +++ b/core/modules/widgets/select.js @@ -53,7 +53,6 @@ Handle a change event SelectWidget.prototype.handleChangeEvent = function(event) { var value = this.getSelectDomNode().value; this.wiki.setText(this.selectTitle,this.selectField,this.selectIndex,value); - this.invokeActions(event); }; /* From 3300ed960211d0266ab7a19f18509be3ed92aa5c Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 28 Jan 2015 16:31:49 +0000 Subject: [PATCH 07/16] Update action widget docs for 4cd8466adb6a0c8e98803c7e99eebb29d92c8afe --- editions/tw5.com/tiddlers/widgets/ActionWidgets.tid | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/editions/tw5.com/tiddlers/widgets/ActionWidgets.tid b/editions/tw5.com/tiddlers/widgets/ActionWidgets.tid index f1f9de2ca..5a6301b14 100644 --- a/editions/tw5.com/tiddlers/widgets/ActionWidgets.tid +++ b/editions/tw5.com/tiddlers/widgets/ActionWidgets.tid @@ -1,12 +1,12 @@ created: 20141008134425548 -modified: 20141008144957192 +modified: 20150128163157192 tags: Widgets title: ActionWidgets type: text/vnd.tiddlywiki Action widgets are a special type of widget that perform an action such as sending a message, navigating to a tiddler, or changing the value of a tiddler. They are used in association with other widgets that trigger those actions (for example, the ButtonWidget). -Action widgets are invisible. They must be the immediate children of their parent triggering widget. The actions are performed in sequence. For example, here is a button that triggers two actions of sending different messages: +Action widgets are invisible. They need not be immediate children of their triggering widget, but they must be descendents of it. The actions are performed in sequence. For example, here is a button that triggers two actions of sending different messages: ``` <$button> @@ -16,8 +16,6 @@ Click me! ``` -Take care not to accidentally introduce an extra line break after the opening tag of the button widget. Doing so will trigger the WikiText parser to wrap the action widgets in a paragraph element. This means that the action widgets will not be triggered as they are no longer immediate children of the triggering widget. - The following action widgets are provided: <> From 2db6cbed2d1f81483251c49c75721f066cfd6a29 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 28 Jan 2015 17:35:10 +0000 Subject: [PATCH 08/16] Add warning about not using File/Save menu option --- editions/tw5.com/tiddlers/gettingstarted/GettingStarted.tid | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/gettingstarted/GettingStarted.tid b/editions/tw5.com/tiddlers/gettingstarted/GettingStarted.tid index 1d95d35cb..70ef3b03f 100644 --- a/editions/tw5.com/tiddlers/gettingstarted/GettingStarted.tid +++ b/editions/tw5.com/tiddlers/gettingstarted/GettingStarted.tid @@ -1,5 +1,5 @@ created: 20131129090249275 -modified: 20140916140523223 +modified: 20150128172523223 tags: [[Working with TiddlyWiki]] title: GettingStarted type: text/vnd.tiddlywiki @@ -13,6 +13,10 @@ Instructions for getting started using TiddlyWiki on the different platforms and <$macrocall $name="tabs" state="$:/state/tabs/platform" tabsList="[prefix[GettingStarted - ]]" default=<> class="tc-vertical"/> +Troubleshooting: + +* Don't attempt to use the browser ''File''/''Save'' menu option to save changes (it doesn't work) + See also: * [[Encryption]] explains how to use TiddlyWiki's built-in encryption to protect your content with a password From 4a05bd10e948d9d44b9b231873fda45836c2a0d0 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Thu, 29 Jan 2015 00:38:08 +0100 Subject: [PATCH 09/16] renamed to resolvePath using $tw.utils.resolvePath adapted ControlPanel / Saving accordingly --- core/modules/macros/resolvePath.js | 29 +++++++++++++++++++++ core/modules/macros/serverpath.js | 41 ------------------------------ core/ui/ControlPanel/Saving.tid | 2 +- 3 files changed, 30 insertions(+), 42 deletions(-) create mode 100644 core/modules/macros/resolvePath.js delete mode 100644 core/modules/macros/serverpath.js diff --git a/core/modules/macros/resolvePath.js b/core/modules/macros/resolvePath.js new file mode 100644 index 000000000..22bedb7de --- /dev/null +++ b/core/modules/macros/resolvePath.js @@ -0,0 +1,29 @@ +/*\ +title: $:/core/modules/macros/resolvePath.js +type: application/javascript +module-type: macro + +Resolves a relative path for an absolute rootpath. + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +exports.name = "resolvePath"; + +exports.params = [ + {name: "source"}, + {name: "root"} +]; + +/* +Run the macro +*/ +exports.run = function(source, root) { + return $tw.utils.resolvePath(source, root); +}; + +})(); diff --git a/core/modules/macros/serverpath.js b/core/modules/macros/serverpath.js deleted file mode 100644 index 7fe47a2c1..000000000 --- a/core/modules/macros/serverpath.js +++ /dev/null @@ -1,41 +0,0 @@ -/*\ -title: $:/core/modules/macros/serverpath.js -type: application/javascript -module-type: macro - -Outputs a server-path based on parameters, -by default appends a relative path to an absolute one, -e.g. constructs path to TiddlySpot backup directory - -\*/ -(function(){ - -/*jslint node: true, browser: true */ -/*global $tw: false */ -"use strict"; - -exports.name = "serverpath"; - -exports.params = [ - {name: "source"}, - {name: "target"}, - {name: "mode"} -]; - -/* -Run the macro -*/ -exports.run = function(source, target, mode) { - var result = target; - mode = mode || ""; - switch (mode){ - case "": - case "append-relative": - target = ("." == target || "./" == target) ? "" : target; - result = source.substr(0,1+source.lastIndexOf('/')) + target; - break; - } - return result; -}; - -})(); diff --git a/core/ui/ControlPanel/Saving.tid b/core/ui/ControlPanel/Saving.tid index 65b3b687e..5c54b37df 100644 --- a/core/ui/ControlPanel/Saving.tid +++ b/core/ui/ControlPanel/Saving.tid @@ -13,7 +13,7 @@ http://$(userName)$.tiddlyspot.com/backup/ <> <$reveal type="nomatch" state="$:/UploadURL" text=""> -<$macrocall $name=serverpath source={{$:/UploadURL}} target={{$:/UploadBackupDir}}>> +<$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}>> From a5d54a0adaadfb34914d9380111f352fcc19de0a Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Thu, 29 Jan 2015 13:23:24 +0000 Subject: [PATCH 10/16] Rename AbsoluteOperators.tid --- .../{AbsoluteOperators.tid => ConstructorsAndModifiers.tid} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename editions/tw5.com/tiddlers/concepts/{AbsoluteOperators.tid => ConstructorsAndModifiers.tid} (100%) diff --git a/editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid b/editions/tw5.com/tiddlers/concepts/ConstructorsAndModifiers.tid similarity index 100% rename from editions/tw5.com/tiddlers/concepts/AbsoluteOperators.tid rename to editions/tw5.com/tiddlers/concepts/ConstructorsAndModifiers.tid From 9a7bda28e9e4987a20dfcf0bde538a2f59ad4423 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Thu, 29 Jan 2015 13:40:18 +0000 Subject: [PATCH 11/16] Revise filter terminology: constructors and modifiers --- .../tiddlers/concepts/ConstructorsAndModifiers.tid | 10 +++++----- editions/tw5.com/tiddlers/filters/FilterOperators.tid | 4 ++-- editions/tw5.com/tiddlers/filters/all.tid | 4 ++-- editions/tw5.com/tiddlers/filters/commands.tid | 4 ++-- editions/tw5.com/tiddlers/filters/editions.tid | 4 ++-- editions/tw5.com/tiddlers/filters/list.tid | 4 ++-- editions/tw5.com/tiddlers/filters/moduletypes.tid | 4 ++-- editions/tw5.com/tiddlers/filters/syntax/FilterRun.tid | 4 ++-- editions/tw5.com/tiddlers/filters/title.tid | 6 +++--- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/editions/tw5.com/tiddlers/concepts/ConstructorsAndModifiers.tid b/editions/tw5.com/tiddlers/concepts/ConstructorsAndModifiers.tid index b6736293b..ad8199734 100644 --- a/editions/tw5.com/tiddlers/concepts/ConstructorsAndModifiers.tid +++ b/editions/tw5.com/tiddlers/concepts/ConstructorsAndModifiers.tid @@ -1,13 +1,13 @@ created: 20150117204109000 -modified: 20150124185709000 +modified: 20150129133830000 tags: Concepts -title: Absolute Operators +title: Selection Constructors type: text/vnd.tiddlywiki The output of a [[filter|Filters]] step depends on its [[operator|Filter Operators]]: -* Most operators perform <<.def relative>> to their input. They examine each input title in turn and filter out any that don't match. Such steps narrow down the output of a run. +* Most operators derive their output from their input. For example, many of them output a subset of their input, and thus truly live up to the name of <<.word filters>>, narrowing down the overall output of the containing [[run|Filter Run]]. These operators are called <<.def "selection modifiers">>. -* <<.def Absolute>> operators ignore their input and generate an independent output instead. +* A few operators ignore their input and generate an independent output instead. These are called <<.def "selection constructors">>: they construct an entirely new [[selection|Title Selection]]. -A good example of an absolute operator is <<.olink title>>. The output of `[title[A]title[B]]` is just <<.tid B>>. But the <<.olink field>> operator is relative, so `[title[A]field:title[B]` outputs nothing at all. +A good example of a constructor is <<.olink title>>. The output of `[title[A]title[B]]` is just <<.tid B>>. But the <<.olink field>> operator is a modifier, so `[title[A]field:title[B]` outputs nothing at all. diff --git a/editions/tw5.com/tiddlers/filters/FilterOperators.tid b/editions/tw5.com/tiddlers/filters/FilterOperators.tid index 80b3755ab..8ad03c34c 100644 --- a/editions/tw5.com/tiddlers/filters/FilterOperators.tid +++ b/editions/tw5.com/tiddlers/filters/FilterOperators.tid @@ -1,5 +1,5 @@ created: 20140410103123179 -modified: 20150124200331000 +modified: 20150129133657000 tags: Concepts Filters title: Filter Operators type: text/vnd.tiddlywiki @@ -39,4 +39,4 @@ The following table lists all the core operators. The commonest ones are checkma A typical step is written as `[operator[parameter]]`, although not all of the operators need a [[parameter|Filter Parameter]]. -Most steps process the [[selection of titles|Title Selection]] that are supplied as their input, but a few are [[absolute|Absolute Operators]]. For the exact rules, see [[Filter Syntax]]. +Most steps process the [[selection of titles|Title Selection]] that are supplied as their input, but a few [[construct an entirely new selection|Selection Constructors]] instead. For the exact rules, see [[Filter Syntax]]. diff --git a/editions/tw5.com/tiddlers/filters/all.tid b/editions/tw5.com/tiddlers/filters/all.tid index 39e250be7..69c0913a5 100644 --- a/editions/tw5.com/tiddlers/filters/all.tid +++ b/editions/tw5.com/tiddlers/filters/all.tid @@ -1,6 +1,6 @@ created: 20140410103123179 -modified: 20150124200847000 -tags: [[Filter Operators]] [[Common Operators]] [[Absolute Operators]] +modified: 20150129133636000 +tags: [[Filter Operators]] [[Common Operators]] [[Selection Constructors]] title: all Operator type: text/vnd.tiddlywiki caption: all diff --git a/editions/tw5.com/tiddlers/filters/commands.tid b/editions/tw5.com/tiddlers/filters/commands.tid index de6b2abe0..854fe89d7 100644 --- a/editions/tw5.com/tiddlers/filters/commands.tid +++ b/editions/tw5.com/tiddlers/filters/commands.tid @@ -1,6 +1,6 @@ created: 20140410103123179 -modified: 20150124155303000 -tags: [[Filter Operators]] [[Special Operators]] [[Absolute Operators]] +modified: 20150129133643000 +tags: [[Filter Operators]] [[Special Operators]] [[Selection Constructors]] title: commands Operator type: text/vnd.tiddlywiki caption: commands diff --git a/editions/tw5.com/tiddlers/filters/editions.tid b/editions/tw5.com/tiddlers/filters/editions.tid index f7ce355e6..4c2ee9e4d 100644 --- a/editions/tw5.com/tiddlers/filters/editions.tid +++ b/editions/tw5.com/tiddlers/filters/editions.tid @@ -1,6 +1,6 @@ created: 20150111145738451 -modified: 20150124150912000 -tags: [[Filter Operators]] [[Special Operators]] [[Absolute Operators]] +modified: 20150129133647000 +tags: [[Filter Operators]] [[Special Operators]] [[Selection Constructors]] title: editions Operator type: text/vnd.tiddlywiki caption: editions diff --git a/editions/tw5.com/tiddlers/filters/list.tid b/editions/tw5.com/tiddlers/filters/list.tid index fcdb7581e..49f791021 100644 --- a/editions/tw5.com/tiddlers/filters/list.tid +++ b/editions/tw5.com/tiddlers/filters/list.tid @@ -1,6 +1,6 @@ created: 20140410103123179 -modified: 20150124203324000 -tags: [[Filter Operators]] [[Field Operators]] [[Absolute Operators]] [[Negatable Operators]] +modified: 20150129133705000 +tags: [[Filter Operators]] [[Field Operators]] [[Selection Constructors]] [[Negatable Operators]] title: list Operator type: text/vnd.tiddlywiki caption: list diff --git a/editions/tw5.com/tiddlers/filters/moduletypes.tid b/editions/tw5.com/tiddlers/filters/moduletypes.tid index d47d1580d..e931d37ec 100644 --- a/editions/tw5.com/tiddlers/filters/moduletypes.tid +++ b/editions/tw5.com/tiddlers/filters/moduletypes.tid @@ -1,6 +1,6 @@ created: 20140410103123179 -modified: 20150124170640000 -tags: [[Filter Operators]] [[Special Operators]] [[Absolute Operators]] +modified: 20150129133709000 +tags: [[Filter Operators]] [[Special Operators]] [[Selection Constructors]] title: moduletypes Operator type: text/vnd.tiddlywiki caption: moduletypes diff --git a/editions/tw5.com/tiddlers/filters/syntax/FilterRun.tid b/editions/tw5.com/tiddlers/filters/syntax/FilterRun.tid index ecc5e381b..640891906 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/FilterRun.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/FilterRun.tid @@ -1,5 +1,5 @@ created: 20150124182117000 -modified: 20150124190233000 +modified: 20150129133716000 tags: [[Filter Syntax]] title: Filter Run type: text/vnd.tiddlywiki @@ -19,7 +19,7 @@ A <<.def run>> consists of [[steps|Filter Step]], and it outputs a [[selection|T The steps are processed from left to right. The input to the first step is same as the input to the run. For each subsequent step, the input is the output of the previous step. -{{Absolute Operators}} +{{Selection Constructors}} The lower three options in the diagram match syntax like `HelloThere`, `"HelloThere"`, `'HelloThere'` and `"Filter Operators"`. They are short for `[title[...]]`. diff --git a/editions/tw5.com/tiddlers/filters/title.tid b/editions/tw5.com/tiddlers/filters/title.tid index 5dda38e29..53966239f 100644 --- a/editions/tw5.com/tiddlers/filters/title.tid +++ b/editions/tw5.com/tiddlers/filters/title.tid @@ -1,6 +1,6 @@ created: 20140410103123179 -modified: 20150124192051000 -tags: [[Filter Operators]] [[Common Operators]] [[Absolute Operators]] [[Negatable Operators]] +modified: 20150129133732000 +tags: [[Filter Operators]] [[Common Operators]] [[Selection Constructors]] [[Negatable Operators]] title: title Operator type: text/vnd.tiddlywiki caption: title @@ -17,6 +17,6 @@ negationOutput="the input, but with tiddler <<.place t>> filtered out if it exis `[title[An Example]]` can be shortened to `[[An Example]]`, because <<.op title>> is the default filter operator. -<<.op title>> is an [[absolute operator|Absolute Operators]] (except in the form `!title`), but <<.olink2 "field:title" field>> is relative. +<<.op title>> is a [[constructor|Selection Constructors]] (except in the form `!title`), but <<.olink2 "field:title" field>> is a [[modifier|Selection Constructors]]. <<.operator-examples "title">> From 3dd4f943ce9e48a464a2593b68f3fac1912f4163 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Thu, 29 Jan 2015 13:41:11 +0000 Subject: [PATCH 12/16] Rename to SelectionConstructors.tid --- .../{ConstructorsAndModifiers.tid => SelectionConstructors.tid} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename editions/tw5.com/tiddlers/concepts/{ConstructorsAndModifiers.tid => SelectionConstructors.tid} (100%) diff --git a/editions/tw5.com/tiddlers/concepts/ConstructorsAndModifiers.tid b/editions/tw5.com/tiddlers/concepts/SelectionConstructors.tid similarity index 100% rename from editions/tw5.com/tiddlers/concepts/ConstructorsAndModifiers.tid rename to editions/tw5.com/tiddlers/concepts/SelectionConstructors.tid From 8cd0c2afcd0a971ede1bb856d19e23afbe5647a1 Mon Sep 17 00:00:00 2001 From: Jim Lehmer Date: Sun, 1 Feb 2015 12:33:40 -0600 Subject: [PATCH 13/16] Make sure all "get" access to `$tw.config.fileExtensionInfo` goes through a `$tw.utils.getFileExtensionInfo` helper function that ensures the parameter is cast to lowercase. Fixes #1418. --- boot/boot.js | 16 ++++++++++++---- core/modules/wiki.js | 6 +++--- .../tiddlywiki/classictools/modules/recipe.js | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 9687d5fb4..8d2d877c1 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -397,12 +397,20 @@ $tw.utils.registerFileType = function(type,encoding,extension,options) { $tw.config.contentTypeInfo[type] = {encoding: encoding, extension: extension, flags: options.flags || [], deserializerType: options.deserializerType || type}; }; +/* +Given an extension, always access the $tw.config.fileExtensionInfo +using a lowercase extension only. +*/ +$tw.utils.getFileExtensionInfo = function(ext) { + return ext ? $tw.config.fileExtensionInfo[ext.toLowerCase()] : null; +} + /* Given an extension, get the correct encoding for that file. defaults to utf8 */ $tw.utils.getTypeEncoding = function(ext) { - var extensionInfo = $tw.config.fileExtensionInfo[ext], + var extensionInfo = $tw.util.getFileExtensionInfo(ext), type = extensionInfo ? extensionInfo.type : null, typeInfo = type ? $tw.config.contentTypeInfo[type] : null; return typeInfo ? typeInfo.encoding : "utf8"; @@ -1137,9 +1145,9 @@ $tw.Wiki.prototype.deserializeTiddlers = function(type,text,srcFields) { srcFields = srcFields || Object.create(null); var deserializer = $tw.Wiki.tiddlerDeserializerModules[type], fields = Object.create(null); - if(!deserializer && $tw.config.fileExtensionInfo[type]) { + if(!deserializer && $tw.utils.getFileExtensionInfo(type)) { // If we didn't find the serializer, try converting it from an extension to a content type - type = $tw.config.fileExtensionInfo[type].type; + type = $tw.utils.getFileExtensionInfo(type).type; deserializer = $tw.Wiki.tiddlerDeserializerModules[type]; } if(!deserializer && $tw.config.contentTypeInfo[type]) { @@ -1386,7 +1394,7 @@ Load the tiddlers contained in a particular file (and optionally extract fields */ $tw.loadTiddlersFromFile = function(filepath,fields) { var ext = path.extname(filepath), - extensionInfo = $tw.config.fileExtensionInfo[ext], + extensionInfo = $tw.utils.getFileExtensionInfo(ext), type = extensionInfo ? extensionInfo.type : null, typeInfo = type ? $tw.config.contentTypeInfo[type] : null, data = fs.readFileSync(filepath,typeInfo ? typeInfo.encoding : "utf8"), diff --git a/core/modules/wiki.js b/core/modules/wiki.js index bfc0f146a..f1b3c83f8 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -761,8 +761,8 @@ exports.old_parseText = function(type,text,options) { options = options || {}; // Select a parser var Parser = $tw.Wiki.parsers[type]; - if(!Parser && $tw.config.fileExtensionInfo[type]) { - Parser = $tw.Wiki.parsers[$tw.config.fileExtensionInfo[type].type]; + if(!Parser && $tw.utils.getFileExtensionInfo(type)) { + Parser = $tw.Wiki.parsers[$tw.utils.getFileExtensionInfo(type).type]; } if(!Parser) { Parser = $tw.Wiki.parsers[options.defaultType || "text/vnd.tiddlywiki"]; @@ -1104,7 +1104,7 @@ exports.readFile = function(file,callback) { if(type === "" || !type) { var dotPos = file.name.lastIndexOf("."); if(dotPos !== -1) { - var fileExtensionInfo = $tw.config.fileExtensionInfo[file.name.substr(dotPos)]; + var fileExtensionInfo = $tw.utils.getFileExtensionInfo(file.name.substr(dotPos)); if(fileExtensionInfo) { type = fileExtensionInfo.type; } diff --git a/plugins/tiddlywiki/classictools/modules/recipe.js b/plugins/tiddlywiki/classictools/modules/recipe.js index 836356ca0..5b3a0b019 100644 --- a/plugins/tiddlywiki/classictools/modules/recipe.js +++ b/plugins/tiddlywiki/classictools/modules/recipe.js @@ -38,7 +38,7 @@ exports["text/vnd.tiddlywiki2-recipe"] = function(text,fields) { }, loadTiddlersFromFile = function(sourcePath,prefix) { var ext = path.extname(sourcePath), - extensionInfo = $tw.config.fileExtensionInfo[ext], + extensionInfo = $tw.utils.getFileExtensionInfo(ext), typeInfo = extensionInfo ? $tw.config.contentTypeInfo[extensionInfo.type] : null, data = fs.readFileSync(sourcePath,typeInfo ? typeInfo.encoding : "utf8"), fields = {title: sourcePath}, From 0ee06bb1440c77185df67c54c767182c4da7c278 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sun, 1 Feb 2015 20:04:10 +0100 Subject: [PATCH 14/16] moved tw on node.js to editions removed empty toplevel "TiddlyWiki Configurations", also from French added TiddlyDesktop to Editions --- editions/fr-FR/tiddlers/TableOfContents.tid | 2 +- editions/fr-FR/tiddlers/TiddlyWiki Configurations.tid | 7 ------- editions/fr-FR/tiddlers/TiddlyWiki on Node.js.tid | 2 +- editions/tw5.com/tiddlers/TableOfContents.tid | 2 +- editions/tw5.com/tiddlers/TiddlyWiki Configurations.tid | 7 ------- editions/tw5.com/tiddlers/definitions/TiddlyDesktop.tid | 2 +- editions/tw5.com/tiddlers/nodejs/TiddlyWiki on Node.js.tid | 2 +- 7 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 editions/fr-FR/tiddlers/TiddlyWiki Configurations.tid delete mode 100644 editions/tw5.com/tiddlers/TiddlyWiki Configurations.tid diff --git a/editions/fr-FR/tiddlers/TableOfContents.tid b/editions/fr-FR/tiddlers/TableOfContents.tid index 097024ec0..1b622d802 100644 --- a/editions/fr-FR/tiddlers/TableOfContents.tid +++ b/editions/fr-FR/tiddlers/TableOfContents.tid @@ -1,6 +1,6 @@ caption: {{$:/language/SideBar/Contents/Caption}} created: 20140809114010378 -list: HelloThere [[Working with TiddlyWiki]] Learning [[Customise TiddlyWiki]] Features Languages Editions Plugins [[TiddlyWiki Configurations]] Reference Community About +list: HelloThere [[Working with TiddlyWiki]] Learning [[Customise TiddlyWiki]] Features Languages Editions Plugins Reference Community About list-after: $:/core/ui/SideBar/Open modified: 20141203120652586 tags: $:/tags/SideBar diff --git a/editions/fr-FR/tiddlers/TiddlyWiki Configurations.tid b/editions/fr-FR/tiddlers/TiddlyWiki Configurations.tid deleted file mode 100644 index 494211404..000000000 --- a/editions/fr-FR/tiddlers/TiddlyWiki Configurations.tid +++ /dev/null @@ -1,7 +0,0 @@ -created: 20140904101900000 -modified: 20141115215018256 -tags: TableOfContents -title: TiddlyWiki Configurations -fr-title: Configurations de TiddlyWiki -type: text/vnd.tiddlywiki - diff --git a/editions/fr-FR/tiddlers/TiddlyWiki on Node.js.tid b/editions/fr-FR/tiddlers/TiddlyWiki on Node.js.tid index 0502c5b63..37bc2fafc 100644 --- a/editions/fr-FR/tiddlers/TiddlyWiki on Node.js.tid +++ b/editions/fr-FR/tiddlers/TiddlyWiki on Node.js.tid @@ -1,7 +1,7 @@ created: 20131129094353704 fr-title: TiddlyWiki sur Node.js modified: 20141203153032034 -tags: [[TiddlyWiki Configurations]] +tags: [[Editions]] title: TiddlyWiki on Node.js type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/TableOfContents.tid b/editions/tw5.com/tiddlers/TableOfContents.tid index 8d0f5360c..db0a2f22f 100644 --- a/editions/tw5.com/tiddlers/TableOfContents.tid +++ b/editions/tw5.com/tiddlers/TableOfContents.tid @@ -1,6 +1,6 @@ caption: {{$:/language/SideBar/Contents/Caption}} created: 20140809114010378 -list: [[HelloThere]] [[Working with TiddlyWiki]] [[Learning]] [[Customise TiddlyWiki]] [[Features]] [[Languages]] [[Editions]] [[Plugins]] [[TiddlyWiki Configurations]] [[Reference]] [[Community]] [[About]] +list: [[HelloThere]] [[Working with TiddlyWiki]] [[Learning]] [[Customise TiddlyWiki]] [[Features]] [[Languages]] [[Editions]] [[Plugins]] [[Reference]] [[Community]] [[About]] list-after: $:/core/ui/SideBar/Open modified: 20140912145302498 tags: $:/tags/SideBar diff --git a/editions/tw5.com/tiddlers/TiddlyWiki Configurations.tid b/editions/tw5.com/tiddlers/TiddlyWiki Configurations.tid deleted file mode 100644 index 89de2b63b..000000000 --- a/editions/tw5.com/tiddlers/TiddlyWiki Configurations.tid +++ /dev/null @@ -1,7 +0,0 @@ -created: 20140904101900000 -modified: 20140916131606392 -tags: TableOfContents -title: TiddlyWiki Configurations -type: text/vnd.tiddlywiki - -<> diff --git a/editions/tw5.com/tiddlers/definitions/TiddlyDesktop.tid b/editions/tw5.com/tiddlers/definitions/TiddlyDesktop.tid index a0bebca23..f5f9bd7f4 100644 --- a/editions/tw5.com/tiddlers/definitions/TiddlyDesktop.tid +++ b/editions/tw5.com/tiddlers/definitions/TiddlyDesktop.tid @@ -1,6 +1,6 @@ created: 20140126125259638 modified: 20140916131440645 -tags: Definitions Features Saving +tags: Definitions Features Saving Editions title: TiddlyDesktop type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/nodejs/TiddlyWiki on Node.js.tid b/editions/tw5.com/tiddlers/nodejs/TiddlyWiki on Node.js.tid index b85073d72..d39526e21 100644 --- a/editions/tw5.com/tiddlers/nodejs/TiddlyWiki on Node.js.tid +++ b/editions/tw5.com/tiddlers/nodejs/TiddlyWiki on Node.js.tid @@ -1,6 +1,6 @@ created: 20131129094353704 modified: 20140916131624754 -tags: [[TiddlyWiki Configurations]] +tags: [[Editions]] title: TiddlyWiki on Node.js type: text/vnd.tiddlywiki From e4bd0c86330614cdc250e3807ab64c559512c906 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Tue, 3 Feb 2015 15:18:38 +0100 Subject: [PATCH 15/16] added documentation temporary documentation demo: http://goto.bplaced.net/tw5/5.1.7.html#ResolvePath --- .../{resolvePath.js => resolve_path.js} | 4 ++-- .../tw5.com/tiddlers/macros/ResolvePath.tid | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) rename core/modules/macros/{resolvePath.js => resolve_path.js} (83%) create mode 100644 editions/tw5.com/tiddlers/macros/ResolvePath.tid diff --git a/core/modules/macros/resolvePath.js b/core/modules/macros/resolve_path.js similarity index 83% rename from core/modules/macros/resolvePath.js rename to core/modules/macros/resolve_path.js index 22bedb7de..d84d87563 100644 --- a/core/modules/macros/resolvePath.js +++ b/core/modules/macros/resolve_path.js @@ -1,5 +1,5 @@ /*\ -title: $:/core/modules/macros/resolvePath.js +title: $:/core/modules/macros/resolvepath.js type: application/javascript module-type: macro @@ -12,7 +12,7 @@ Resolves a relative path for an absolute rootpath. /*global $tw: false */ "use strict"; -exports.name = "resolvePath"; +exports.name = "resolvepath"; exports.params = [ {name: "source"}, diff --git a/editions/tw5.com/tiddlers/macros/ResolvePath.tid b/editions/tw5.com/tiddlers/macros/ResolvePath.tid new file mode 100644 index 000000000..be0a2951f --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/ResolvePath.tid @@ -0,0 +1,23 @@ +created: 20150203152000000 +modified: 20150203152000000 +title: ResolvePath +type: text/vnd.tiddlywiki +caption: resolvepath + +The ''resolvepath'' macro constructs a url for a relative source path with respect to an absolute root path, trailing filenames being cut-off. + +! Parameters + +|!Position |!Name |!Description |!Default | +|1st |source |the relative path to be appended| | +|2nd |root |the absolute path to be appended to | | + +! Examples + +A trivial example to show how the macro works: + +``` +<> +``` + +<> \ No newline at end of file From 32fd03d2f5d423d98928e1128a364522585af3e0 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Tue, 3 Feb 2015 15:19:03 +0100 Subject: [PATCH 16/16] rename macro --- core/modules/macros/{resolve_path.js => resolvepath.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename core/modules/macros/{resolve_path.js => resolvepath.js} (100%) diff --git a/core/modules/macros/resolve_path.js b/core/modules/macros/resolvepath.js similarity index 100% rename from core/modules/macros/resolve_path.js rename to core/modules/macros/resolvepath.js