From 3e3f18556223dd93a49af245cbec7c23b7b17dfb Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Wed, 25 Nov 2020 09:44:48 +0000 Subject: [PATCH 01/21] Clarify behaviour of self closing tags --- .../tw5.com/tiddlers/wikitext/HTML in WikiText.tid | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid index d491a8700..412963adc 100644 --- a/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid +++ b/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid @@ -1,6 +1,6 @@ caption: HTML created: 20131205160816081 -modified: 20161021102422842 +modified: 20201125094415933 tags: WikiText title: HTML in WikiText type: text/vnd.tiddlywiki @@ -22,6 +22,14 @@ To get the content of an HTML element to be parsed in block mode, the opening ta Without the two linebreaks, the tag content will be parsed in inline mode which means that block mode formatting such as wikitext tables, lists and headings is not recognised. +! Self closing elements + +The following tags are treated as 'void'. This means that `` is treated as if it were ``, and that no terminating `` is needed (if one is provided it will be ignored and treated as plain text). + +* ``, ``, `
`, ``, ``, ``, `
`, ``, ``, ``, ``, ``, ``, ``, ``, `` + +If you don’t close any other tag then it will behave as if the missing closing tag were at the end of the tiddler. + ! Attributes In an extension of conventional HTML syntax, attributes of elements/widgets can be specified in several different ways: From 706fc3e06ed0998545918aafda8951080f15a955 Mon Sep 17 00:00:00 2001 From: Florian Kohrt Date: Mon, 30 Nov 2020 22:33:16 +0100 Subject: [PATCH 02/21] Fix typo; closes #4815 (#4844) --- .../webserver/WebServer Parameter_ tiddler-render-type.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/webserver/WebServer Parameter_ tiddler-render-type.tid b/editions/tw5.com/tiddlers/webserver/WebServer Parameter_ tiddler-render-type.tid index d674b0e5f..900a80b91 100644 --- a/editions/tw5.com/tiddlers/webserver/WebServer Parameter_ tiddler-render-type.tid +++ b/editions/tw5.com/tiddlers/webserver/WebServer Parameter_ tiddler-render-type.tid @@ -5,6 +5,6 @@ tags: [[WebServer Parameters]] title: WebServer Parameter: tiddler-render-type type: text/vnd.tiddlywiki -The [[web server configuration parameter|WebServer Parameters]] ''tiddler-render-type'' is used to specify the render type for serving ordinary, non-system tiddlers in the [[read-only single tiddler view|Using the read-only single tiddler view]]. The default value is `text/html`, causing the full HTML of the rendered output to be returned. Alternatively, `text/html` can be used to cause the raw text of rendered system tiddlers to be returned. +The [[web server configuration parameter|WebServer Parameters]] ''tiddler-render-type'' is used to specify the render type for serving ordinary, non-system tiddlers in the [[read-only single tiddler view|Using the read-only single tiddler view]]. The default value is `text/html`, causing the full HTML of the rendered output to be returned. Alternatively, `text/plain` can be used to cause the raw text of rendered system tiddlers to be returned. -<<.tip "This setting may be overwritten by specifying the `_render_type` field of a tiddler.">> \ No newline at end of file +<<.tip "This setting may be overwritten by specifying the `_render_type` field of a tiddler.">> From 6f09a5ee652f78f251a958a64ce10139bf4b60c0 Mon Sep 17 00:00:00 2001 From: Florian Kohrt Date: Mon, 30 Nov 2020 22:34:00 +0100 Subject: [PATCH 03/21] Fix link to TiddlyWikiFolders (#4843) * Fix link to TiddlyWikiFolders * Better link to tiddlywiki.info reference tiddler --- .../howtos/How to add a banner for GitHub contributions.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/howtos/How to add a banner for GitHub contributions.tid b/editions/tw5.com/tiddlers/howtos/How to add a banner for GitHub contributions.tid index 086b45a64..5482b3dc1 100644 --- a/editions/tw5.com/tiddlers/howtos/How to add a banner for GitHub contributions.tid +++ b/editions/tw5.com/tiddlers/howtos/How to add a banner for GitHub contributions.tid @@ -7,7 +7,7 @@ When you edit a tiddler on https://tiddlywiki.com you will see a small ribbon in If you are using Node.js, you can replicate this feature for your own TiddlyWiki-based site as follows: -# Make sure the following setting is included in the `tiddlywiki.info` file in your WikiFolder: +# Make sure the following setting is included in the <$link to="tiddlywiki.info Files">`tiddlywiki.info` file in your [[wiki folder|TiddlyWikiFolders]]: #>
	"config": {
 		"retain-original-tiddler-path": true
 	}
From abe9af13691bc7c43d3a37184cf81eafa66d42f1 Mon Sep 17 00:00:00 2001 From: Rob Hoelz Date: Mon, 30 Nov 2020 16:10:07 -0600 Subject: [PATCH 04/21] Add documentation for indexer modules (#4873) --- .../wikimethod module type.tid | 5 +- editions/dev/tiddlers/indexer modules.tid | 55 +++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 editions/dev/tiddlers/indexer modules.tid diff --git a/editions/dev/tiddlers/from Heigele and Jurke/wikimethod module type.tid b/editions/dev/tiddlers/from Heigele and Jurke/wikimethod module type.tid index fe3061d10..907f67336 100644 --- a/editions/dev/tiddlers/from Heigele and Jurke/wikimethod module type.tid +++ b/editions/dev/tiddlers/from Heigele and Jurke/wikimethod module type.tid @@ -1,5 +1,6 @@ created: 20140710185051844 -modified: 20140710185339032 +modified: 20201002010124844 title: wikimethod module type +tags: moduletypes -The startup module [[$:/core/modules/startup/load-modules.js]] in the TiddlyWiki core plug-in loads all modules of type``wikimethod`` and puts their exported functions into the wiki store. \ No newline at end of file +The startup module [[$:/core/modules/startup/load-modules.js]] in the TiddlyWiki core plug-in loads all modules of type``wikimethod`` and puts their exported functions into the wiki store. diff --git a/editions/dev/tiddlers/indexer modules.tid b/editions/dev/tiddlers/indexer modules.tid new file mode 100644 index 000000000..2a3119d05 --- /dev/null +++ b/editions/dev/tiddlers/indexer modules.tid @@ -0,0 +1,55 @@ +created: 20201002010134640 +modified: 20201002012758239 +tags: moduletypes dev +title: indexer modules + +Indexer modules maintain indexes of tiddlers organized in a manner that's more efficient for different types of access, typically to speed up things like certain filter operators. An example of this would be the tag indexer - it's much faster to maintain a lookup table listing which tiddlers have a given tag than to iterate over //all// of the tiddlers in a wiki and ask each of them if they have the tag you're interested in! + +Indexer modules have a `module-type` of `indexer`, and the indexers that are included with TiddlyWiki can be found under `core/modules/indexers`. + +! Methods + +Indexer modules must export a constructor function, which takes the current wiki object as its only argument. The object built by the construction function must implement the following methods: + +!! `init()` + +This performs any initial setup required by an indexer. + +!! `rebuild()` + +This rebuilds an index from scratch, usually after a large number of changes have happened to a wiki. + +!! `update(updateDescriptor)` + +This is called every time a tiddler is added, changed, or deleted. The `updateDescriptor` value is an object with two fields - `old` and `new` - which represent the pre-update and post-update state of the tiddler, respectively. Each of these has three fields of their own: + + * `tiddler` - the state of the tiddler (may be `null`) + * `shadow` - a boolean indicating whether or not the tiddler is a shadow + * `exists` - a boolean indicating whether or not the tiddler exists + +For example, let's say you have an indexer `idx` and you create a tiddler T with the text "test" - that would result in your indexer's `update` method being called like this: + +```javascript +idx.update({ + old: { tiddler: null, shadow: false, exists: false }, + new: { tiddler: new $tw.Tiddler({title: 'T', text: 'test'}), shadow: false, exists: true } +}); +``` + +If you then change the text from "test" to "testing", `update` would be called like this: + +```javascript +idx.update({ + old: { tiddler: new $tw.Tiddler({title: 'T', text: 'test'}), shadow: false, exists: true }, + new: { tiddler: new $tw.Tiddler({title: 'T', text: 'testing'}), shadow: false, exists: true } +}); +``` + +And finally, if you delete T, `update` will be called like this: + +```javascript +idx.update({ + old: { tiddler: new $tw.Tiddler({title: 'T', text: 'testing'}), shadow: false, exists: true }, + new: { tiddler: null, shadow: false, exists: false } +}); +``` \ No newline at end of file From e620aaed809e52e0585613012d675056bf84e004 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Wed, 2 Dec 2020 23:59:04 +0700 Subject: [PATCH 05/21] Fix a couple typos in "deprecated feature" warning (#5174) One tiddler had been renamed since the deprecation warning tiddler was created, and there were also a couple of minor punctuation and/or spelling errors. --- .../tiddlers/system/Deprecated_-_What_does_it_mean.tid | 4 ++-- editions/tw5.com/tiddlers/system/version-macros.tid | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editions/tw5.com/tiddlers/system/Deprecated_-_What_does_it_mean.tid b/editions/tw5.com/tiddlers/system/Deprecated_-_What_does_it_mean.tid index 37f98c3f1..5fdbca026 100644 --- a/editions/tw5.com/tiddlers/system/Deprecated_-_What_does_it_mean.tid +++ b/editions/tw5.com/tiddlers/system/Deprecated_-_What_does_it_mean.tid @@ -7,9 +7,9 @@ First of all: ''Keep calm!'' {{$:/deprecated}} -For ~TiddlyWiki it means, that you should not use this mechanism for new content anymore! ''AND you should update your existing content''! +For ~TiddlyWiki it means that you should not use this mechanism for new content anymore, ''AND you should update your existing content''! -Deprecated features have a marker. see: [[Custom styles by tag]] +Deprecated features have a marker. See: [[How to apply custom styles by tag]] ''Tiddlers tagged `$:/deprecated`'' diff --git a/editions/tw5.com/tiddlers/system/version-macros.tid b/editions/tw5.com/tiddlers/system/version-macros.tid index 763252000..b3893d358 100644 --- a/editions/tw5.com/tiddlers/system/version-macros.tid +++ b/editions/tw5.com/tiddlers/system/version-macros.tid @@ -8,8 +8,8 @@ type: text/vnd.tiddlywiki {{$:/core/images/warning}} New in: $version$ \end -\define .deprecated-since(version, superseeded:"TODO-Link") -<$button to="Deprecated - What does it mean" class="doc-deprecated-version tc-btn-invisible">{{$:/core/images/warning}} Deprecated since: $version$ use [[$superseeded$]] instead! +\define .deprecated-since(version, superseded:"TODO-Link") +<$button to="Deprecated - What does it mean" class="doc-deprecated-version tc-btn-invisible">{{$:/core/images/warning}} Deprecated since: $version$ . Use [[$superseded$]] instead \end
<$view field="text"/>
\ No newline at end of file From 2bbcc94b4dd6a1c6a8c82837c4d022d34edd7c81 Mon Sep 17 00:00:00 2001 From: Rob Hoelz Date: Thu, 3 Dec 2020 15:19:25 -0600 Subject: [PATCH 06/21] Add documentation for shortcuts introduced in 5.1.20 (#4324) --- editions/tw5.com/tiddlers/howtos/KeyboardShortcuts.tid | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/editions/tw5.com/tiddlers/howtos/KeyboardShortcuts.tid b/editions/tw5.com/tiddlers/howtos/KeyboardShortcuts.tid index 9ecece61d..421f99dce 100644 --- a/editions/tw5.com/tiddlers/howtos/KeyboardShortcuts.tid +++ b/editions/tw5.com/tiddlers/howtos/KeyboardShortcuts.tid @@ -20,9 +20,13 @@ Keyboard shortcuts are available for common editing operations within the Text E <<.from-version 5.1.18>> : New ''global'' Keyboard shortcuts: -* Creating a new tiddler (defaults to alt-N ) -* Creating a new journal (defaults to alt-J ) -* Creating a new image (defaults to alt-I ) +|!Action |!Default Shortcut| +|Creating a new tiddler |alt-N | +|Creating a new journal |alt-J | +|Creating a new image |alt-I | +|Focusing sidebar search |<<.from-version 5.1.20>>ctrl-shift-F | +|Toggling the sidebar |<<.from-version 5.1.20>>shift-alt-S | +|Advanced search |<<.from-version 5.1.20>>ctrl-shift-A | The current shortcuts can be inspected and customised in the "Keyboard Shortcuts" tab of the [[Control Panel|$:/ControlPanel]] <<.icon $:/core/images/options-button>>. From 15be409c42350a7d9b0d97f706c61456602cce7f Mon Sep 17 00:00:00 2001 From: Mohammad Rahmani <830394+kookma@users.noreply.github.com> Date: Fri, 4 Dec 2020 01:57:21 +0330 Subject: [PATCH 07/21] Minor issue in example of Import Variables Widget (#5165) an unbalanced [ was resolved. --- editions/tw5.com/tiddlers/widgets/ImportVariablesWidget.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/widgets/ImportVariablesWidget.tid b/editions/tw5.com/tiddlers/widgets/ImportVariablesWidget.tid index 674526e37..a9451bc63 100644 --- a/editions/tw5.com/tiddlers/widgets/ImportVariablesWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/ImportVariablesWidget.tid @@ -37,5 +37,5 @@ So-called global macros are implemented within the main page template ([[$:/core <<.from-version "5.1.18">> The `\import` [[pragma|Pragma]] is an alternative syntax for using the ImportVariablesWidget. For example, the previous example could be expressed as: ``` -\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of] +\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] ``` \ No newline at end of file From f798eab33f0621f20b79f794d4c51ec776f6fd62 Mon Sep 17 00:00:00 2001 From: Saq Imtiaz Date: Sat, 5 Dec 2020 17:30:49 +0100 Subject: [PATCH 08/21] Update documentation on Performance (#5203) --- editions/tw5.com/tiddlers/workingwithtw/Performance.tid | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/workingwithtw/Performance.tid b/editions/tw5.com/tiddlers/workingwithtw/Performance.tid index 83ee7de91..68fa1f230 100644 --- a/editions/tw5.com/tiddlers/workingwithtw/Performance.tid +++ b/editions/tw5.com/tiddlers/workingwithtw/Performance.tid @@ -1,5 +1,5 @@ created: 20150330155120127 -modified: 20191014091943444 +modified: 20201205104857625 tags: [[Working with TiddlyWiki]] title: Performance type: text/vnd.tiddlywiki @@ -28,4 +28,5 @@ TiddlyWiki ships with defaults that are designed to get the best out of modern d ** Note that the field indexer currently defaults to indexing field values of less than 128 characters; longer values can still be searched for, but no index will be constructed ** Also note that the “field” operator is also used when the operator name is a fieldname, so, for example, `[all[shadows+tiddlers]caption[x]...` is optimised. * Use the [[throttling|RefreshThrottling]] feature of the RefreshMechanism judiciously - +* Keep in mind that ''transcluding separate tiddlers is more performant than heavy use of macros'' and the difference can be significant in some situations. The result of parsing each tiddler is cached and reused the next time if the tiddler has not changed. The same technique cannot be used for macros and they have to be re-parsed every time, as they are not global but local to the widget tree. +* Where possible ''use the SetWidget or VarsWidget with filters instead of the WikifyWidget'' for declaring variables and string concatenation. The performance of the wikify mechanism is relatively poor as there is no opportunity to cache the parse tree or widget tree. From 7fd24de372b5022e9266049101a12700f668eaca Mon Sep 17 00:00:00 2001 From: Saq Imtiaz Date: Sun, 6 Dec 2020 00:10:51 +0100 Subject: [PATCH 09/21] Tests for filter prefixes (#5209) --- core/modules/filterrunprefixes/filter.js | 4 +- .../tiddlers/tests/test-prefixes-filter.js | 113 ++++++++++++++++++ 2 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 editions/test/tiddlers/tests/test-prefixes-filter.js diff --git a/core/modules/filterrunprefixes/filter.js b/core/modules/filterrunprefixes/filter.js index 726732c8e..72b7ce24c 100644 --- a/core/modules/filterrunprefixes/filter.js +++ b/core/modules/filterrunprefixes/filter.js @@ -13,12 +13,12 @@ module-type: filterrunprefix /* Export our filter function */ -exports.filter = function(operationSubFunction) { +exports.filter = function(operationSubFunction,options) { return function(results,source,widget) { if(results.length > 0) { var resultsToRemove = []; $tw.utils.each(results,function(result) { - var filtered = operationSubFunction($tw.wiki.makeTiddlerIterator([result]),widget); + var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([result]),widget); if(filtered.length === 0) { resultsToRemove.push(result); } diff --git a/editions/test/tiddlers/tests/test-prefixes-filter.js b/editions/test/tiddlers/tests/test-prefixes-filter.js new file mode 100644 index 000000000..7c88aeaf2 --- /dev/null +++ b/editions/test/tiddlers/tests/test-prefixes-filter.js @@ -0,0 +1,113 @@ +/*\ +title: test-prefixes-filters.js +type: application/javascript +tags: [[$:/tags/test-spec]] +Tests the reduce prefix and filter. +\*/ +(function(){ + +/* jslint node: true, browser: true */ +/* eslint-env node, browser, jasmine */ +/* eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/ +/* global $tw, require */ +"use strict"; + +describe("'reduce' and 'intersection' filter prefix tests", function() { + + var wiki = new $tw.Wiki(); + + wiki.addTiddler({ + title: "Brownies", + text: "//This is a sample shopping list item for the [[Shopping List Example]]//", + tags: ["shopping","food"], + price: "4.99", + quantity: "1" + }); + wiki.addTiddler({ + title: "Chick Peas", + text: "//This is a sample shopping list item for the [[Shopping List Example]]//", + tags: ["shopping","food"], + price: "1.32", + quantity: "5" + }); + wiki.addTiddler({ + title: "Milk", + text: "//This is a sample shopping list item for the [[Shopping List Example]]//", + tags: ["shopping", "dairy", "drinks"], + price: "0.46", + quantity: "12" + }); + wiki.addTiddler({ + title: "Rice Pudding", + price: "2.66", + quantity: "4", + tags: ["shopping", "dairy"], + text: "//This is a sample shopping list item for the [[Shopping List Example]]//" + }); + wiki.addTiddler({ + title: "Sparkling water", + tags: ["drinks", "mineral water", "textexample"], + text: "This is some text" + }); + wiki.addTiddler({ + title: "Red wine", + tags: ["drinks", "wine", "textexample"], + text: "This is some more text" + }); + wiki.addTiddler({ + title: "Cheesecake", + tags: ["cakes", "food", "textexample"], + text: "This is even even even more text" + }); + wiki.addTiddler({ + title: "Chocolate Cake", + tags: ["cakes", "food", "textexample"], + text: "This is even more text" + }); + + it("should handle the :reduce filter prefix", function() { + expect(wiki.filterTiddlers("[tag[shopping]] :reduce[get[quantity]add]").join(",")).toBe("22"); + expect(wiki.filterTiddlers("[tag[shopping]] :reduce[get[price]multiply{!!quantity}add]").join(",")).toBe("27.75"); + expect(wiki.filterTiddlers("[tag[shopping]] :reduce[compare:number:gt[0]thenaddsuffix[, ]addsuffixelse]").join(",")).toBe("Brownies, Chick Peas, Milk, Rice Pudding"); + expect(wiki.filterTiddlers("[tag[non-existent]] :reduce[get[price]multiply{!!quantity}add] :else[[0]]").join(",")).toBe("0"); + }); + + it("should handle the reduce operator", function() { + var widget = require("$:/core/modules/widgets/widget.js"); + var rootWidget = new widget.widget({ type:"widget", children:[ {type:"widget", children:[]} ] }, + { wiki:wiki, document:$tw.document}); + rootWidget.makeChildWidgets(); + var anchorWidget = rootWidget.children[0]; + rootWidget.setVariable("add-price","[get[price]multiply{!!quantity}add]"); + rootWidget.setVariable("num-items","[get[quantity]add]"); + rootWidget.setVariable("join-with-commas","[compare:number:gt[0]thenaddsuffix[, ]addsuffixelse]"); + + expect(wiki.filterTiddlers("[tag[shopping]reduce]",anchorWidget).join(",")).toBe("22"); + expect(wiki.filterTiddlers("[tag[shopping]reduce]",anchorWidget).join(",")).toBe("27.75"); + expect(wiki.filterTiddlers("[tag[shopping]reduce]",anchorWidget).join(",")).toBe("Brownies, Chick Peas, Milk, Rice Pudding"); + expect(wiki.filterTiddlers("[tag[non-existent]reduce,[0]]",anchorWidget).join(",")).toBe("0"); + }); + + it("should handle the :intersection prefix", function() { + expect(wiki.filterTiddlers("[[Sparkling water]tags[]] :intersection[[Red wine]tags[]]").join(",")).toBe("drinks,textexample"); + expect(wiki.filterTiddlers("[[Brownies]tags[]] :intersection[[Chocolate Cake]tags[]]").join(",")).toBe("food"); + expect(wiki.filterTiddlers("[tag[shopping]] :intersection[tag[food]]").join(",")).toBe("Brownies,Chick Peas"); + expect(wiki.filterTiddlers("[tag[shopping]] :intersection[tag[drinks]]").join(",")).toBe("Milk"); + expect(wiki.filterTiddlers("[tag[shopping]] :intersection[tag[wine]]").join(",")).toBe(""); + }); + + it("should handle the :filter prefix and filter operator", function() { + var widget = require("$:/core/modules/widgets/widget.js"); + var rootWidget = new widget.widget({ type:"widget", children:[ {type:"widget", children:[]} ] }, + { wiki:wiki, document:$tw.document}); + rootWidget.makeChildWidgets(); + var anchorWidget = rootWidget.children[0]; + rootWidget.setVariable("larger-than-18","[get[text]length[]compare:integer:gteq[18]]"); + expect(wiki.filterTiddlers("[tag[textexample]] :filter[get[text]length[]compare:integer:gteq[18]]",anchorWidget).join(",")).toBe("Red wine,Cheesecake,Chocolate Cake"); + expect(wiki.filterTiddlers("[tag[textexample]]",anchorWidget).join(",")).toBe("Sparkling water,Red wine,Cheesecake,Chocolate Cake"); + expect(wiki.filterTiddlers("[tag[textexample]filter]",anchorWidget).join(",")).toBe("Red wine,Cheesecake,Chocolate Cake"); + }) + +}); + +})(); \ No newline at end of file From c4dcf510ef44ccb4882bb272f68e5c8600a14559 Mon Sep 17 00:00:00 2001 From: ento Date: Sat, 5 Dec 2020 23:29:34 -0800 Subject: [PATCH 10/21] Ensure jasmine-plugin startup module is executed in the right order (#5210) --- plugins/tiddlywiki/jasmine/jasmine-plugin.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/tiddlywiki/jasmine/jasmine-plugin.js b/plugins/tiddlywiki/jasmine/jasmine-plugin.js index 3c79201c6..34c5b5831 100644 --- a/plugins/tiddlywiki/jasmine/jasmine-plugin.js +++ b/plugins/tiddlywiki/jasmine/jasmine-plugin.js @@ -14,6 +14,15 @@ The main module of the Jasmine test plugin for TiddlyWiki5 var TEST_TIDDLER_FILTER = "[type[application/javascript]tag[$:/tags/test-spec]]"; +// Ensure this startup module is executed in the right order. +// Jasmine calls `process.exit()` with a non-zero exit code if there's +// any failed tests. Because of that, we want to make sure all critical +// startup modules are run before this one. +// * The "commands" module handles the --rendertiddler command-line flag, +// which is typically given to export an HTML file that can be opened with +// a browser to run tests. +exports.after = ["commands"]; + /* Startup function for running tests From a857b4ab9a9c828708c4e7a5d03f1ea97ba782c4 Mon Sep 17 00:00:00 2001 From: Cameron Fischer Date: Sun, 6 Dec 2020 03:54:57 -0500 Subject: [PATCH 11/21] use a linked list for filter runs. (#5206) * Changed the filterrunprefixes to use LinkedList * Testing for Linked List * Finishing touches to LinkedList * Minor corrections to link-list coding style * Corrected for sneaky bug in linkedList --- core/modules/filterrunprefixes/all.js | 2 +- core/modules/filterrunprefixes/and.js | 6 +- core/modules/filterrunprefixes/else.js | 2 +- core/modules/filterrunprefixes/except.js | 2 +- core/modules/filterrunprefixes/filter.js | 4 +- .../modules/filterrunprefixes/intersection.js | 5 +- core/modules/filterrunprefixes/or.js | 2 +- core/modules/filterrunprefixes/reduce.js | 11 +- core/modules/filters.js | 4 +- core/modules/utils/linked-list.js | 118 ++++++++++++++++ .../test/tiddlers/tests/test-linked-list.js | 130 ++++++++++++++++++ 11 files changed, 268 insertions(+), 18 deletions(-) create mode 100644 core/modules/utils/linked-list.js create mode 100644 editions/test/tiddlers/tests/test-linked-list.js diff --git a/core/modules/filterrunprefixes/all.js b/core/modules/filterrunprefixes/all.js index 2e25bbc4d..652936de0 100644 --- a/core/modules/filterrunprefixes/all.js +++ b/core/modules/filterrunprefixes/all.js @@ -18,7 +18,7 @@ Export our filter prefix function */ exports.all = function(operationSubFunction) { return function(results,source,widget) { - Array.prototype.push.apply(results,operationSubFunction(source,widget)); + results.push.apply(results, operationSubFunction(source,widget)); }; }; diff --git a/core/modules/filterrunprefixes/and.js b/core/modules/filterrunprefixes/and.js index ad41c049c..309c228e6 100644 --- a/core/modules/filterrunprefixes/and.js +++ b/core/modules/filterrunprefixes/and.js @@ -19,9 +19,9 @@ Export our filter prefix function exports.and = function(operationSubFunction,options) { return function(results,source,widget) { // This replaces all the elements of the array, but keeps the actual array so that references to it are preserved - source = options.wiki.makeTiddlerIterator(results); - results.splice(0,results.length); - $tw.utils.pushTop(results,operationSubFunction(source,widget)); + source = options.wiki.makeTiddlerIterator(results.toArray()); + results.clear(); + results.pushTop(operationSubFunction(source,widget)); }; }; diff --git a/core/modules/filterrunprefixes/else.js b/core/modules/filterrunprefixes/else.js index c39b9e8fe..6e9ef29b3 100644 --- a/core/modules/filterrunprefixes/else.js +++ b/core/modules/filterrunprefixes/else.js @@ -19,7 +19,7 @@ exports.else = function(operationSubFunction) { return function(results,source,widget) { if(results.length === 0) { // Main result so far is empty - $tw.utils.pushTop(results,operationSubFunction(source,widget)); + results.pushTop(operationSubFunction(source,widget)); } }; }; diff --git a/core/modules/filterrunprefixes/except.js b/core/modules/filterrunprefixes/except.js index 18d649627..659f14228 100644 --- a/core/modules/filterrunprefixes/except.js +++ b/core/modules/filterrunprefixes/except.js @@ -18,7 +18,7 @@ Export our filter prefix function */ exports.except = function(operationSubFunction) { return function(results,source,widget) { - $tw.utils.removeArrayEntries(results,operationSubFunction(source,widget)); + results.remove(operationSubFunction(source,widget)); }; }; diff --git a/core/modules/filterrunprefixes/filter.js b/core/modules/filterrunprefixes/filter.js index 72b7ce24c..555f8981b 100644 --- a/core/modules/filterrunprefixes/filter.js +++ b/core/modules/filterrunprefixes/filter.js @@ -17,13 +17,13 @@ exports.filter = function(operationSubFunction,options) { return function(results,source,widget) { if(results.length > 0) { var resultsToRemove = []; - $tw.utils.each(results,function(result) { + results.each(function(result) { var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([result]),widget); if(filtered.length === 0) { resultsToRemove.push(result); } }); - $tw.utils.removeArrayEntries(results,resultsToRemove); + results.remove(resultsToRemove); } } }; diff --git a/core/modules/filterrunprefixes/intersection.js b/core/modules/filterrunprefixes/intersection.js index 2874125d4..34d36066f 100644 --- a/core/modules/filterrunprefixes/intersection.js +++ b/core/modules/filterrunprefixes/intersection.js @@ -17,7 +17,8 @@ exports.intersection = function(operationSubFunction) { return function(results,source,widget) { if(results.length !== 0) { var secondRunResults = operationSubFunction(source,widget); - var firstRunResults = results.splice(0); + var firstRunResults = results.toArray(); + results.clear(); $tw.utils.each(firstRunResults,function(title) { if(secondRunResults.indexOf(title) !== -1) { results.push(title); @@ -27,4 +28,4 @@ exports.intersection = function(operationSubFunction) { }; }; -})(); \ No newline at end of file +})(); diff --git a/core/modules/filterrunprefixes/or.js b/core/modules/filterrunprefixes/or.js index 5192f490b..82eff083a 100644 --- a/core/modules/filterrunprefixes/or.js +++ b/core/modules/filterrunprefixes/or.js @@ -17,7 +17,7 @@ Export our filter prefix function */ exports.or = function(operationSubFunction) { return function(results,source,widget) { - $tw.utils.pushTop(results,operationSubFunction(source,widget)); + results.pushTop(operationSubFunction(source,widget)); }; }; diff --git a/core/modules/filterrunprefixes/reduce.js b/core/modules/filterrunprefixes/reduce.js index 4dcef4bc7..534c3e450 100644 --- a/core/modules/filterrunprefixes/reduce.js +++ b/core/modules/filterrunprefixes/reduce.js @@ -16,9 +16,9 @@ exports.reduce = function(operationSubFunction,options) { return function(results,source,widget) { if(results.length > 0) { var accumulator = ""; - for(var index=0; index 0) { accumulator = "" + list[0]; } - } - results.splice(0,results.length); + ++index; + }); + results.clear(); results.push(accumulator); } } diff --git a/core/modules/filters.js b/core/modules/filters.js index 0fc0a3dc9..4fec05964 100644 --- a/core/modules/filters.js +++ b/core/modules/filters.js @@ -311,11 +311,11 @@ exports.compileFilter = function(filterString) { } else if(typeof source === "object") { // Array or hashmap source = self.makeTiddlerIterator(source); } - var results = []; + var results = new $tw.utils.LinkedList(); $tw.utils.each(operationFunctions,function(operationFunction) { operationFunction(results,source,widget); }); - return results; + return results.toArray(); }); }; diff --git a/core/modules/utils/linked-list.js b/core/modules/utils/linked-list.js new file mode 100644 index 000000000..50421ab56 --- /dev/null +++ b/core/modules/utils/linked-list.js @@ -0,0 +1,118 @@ +/*\ +module-type: utils +title: $:/core/modules/utils/linkedlist.js +type: application/javascript + +This is a doubly-linked indexed list intended for manipulation, particularly +pushTop, which it does with significantly better performance than an array. + +\*/ +(function(){ + +function LinkedList() { + this.clear(); +}; + +LinkedList.prototype.clear = function() { + this.index = Object.create(null); + // LinkedList performs the duty of both the head and tail node + this.next = this; + this.prev = this; + this.length = 0; +}; + +LinkedList.prototype.remove = function(value) { + if($tw.utils.isArray(value)) { + for(var t=0; t Date: Sun, 6 Dec 2020 09:56:06 +0100 Subject: [PATCH 12/21] CodeMirror: Ensure linenumber-gutter has a right border (#5212) * Ensure linenumber-gutter has a right border * Update GruvBoxDark.tid * Update Nord.tid --- core/palettes/GruvBoxDark.tid | 2 +- core/palettes/Nord.tid | 2 +- plugins/tiddlywiki/codemirror/styles.tid | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/palettes/GruvBoxDark.tid b/core/palettes/GruvBoxDark.tid index d53ec61e0..9c2aaaa31 100644 --- a/core/palettes/GruvBoxDark.tid +++ b/core/palettes/GruvBoxDark.tid @@ -97,7 +97,7 @@ tiddler-border: <> tiddler-controls-foreground-hover: #7c6f64 tiddler-controls-foreground-selected: <> tiddler-controls-foreground: #665c54 -tiddler-editor-background: #282828 +tiddler-editor-background: #32302f tiddler-editor-border-image: #282828 tiddler-editor-border: #282828 tiddler-editor-fields-even: #504945 diff --git a/core/palettes/Nord.tid b/core/palettes/Nord.tid index 21d93a759..b2b618e72 100644 --- a/core/palettes/Nord.tid +++ b/core/palettes/Nord.tid @@ -99,7 +99,7 @@ tiddler-controls-foreground-selected: #EBCB8B tiddler-controls-foreground: #4C566A tiddler-editor-background: #2e3440 tiddler-editor-border-image: #2e3440 -tiddler-editor-border: #2e3440 +tiddler-editor-border: #3b4252 tiddler-editor-fields-even: #2e3440 tiddler-editor-fields-odd: #2e3440 tiddler-info-background: #2e3440 diff --git a/plugins/tiddlywiki/codemirror/styles.tid b/plugins/tiddlywiki/codemirror/styles.tid index d2b1e3916..30c9e731a 100755 --- a/plugins/tiddlywiki/codemirror/styles.tid +++ b/plugins/tiddlywiki/codemirror/styles.tid @@ -50,7 +50,7 @@ name: tiddlywiki } .cm-s-tiddlywiki.CodeMirror, .cm-s-tiddlywiki .CodeMirror-gutters { background-color: <>; color: <>; } -.cm-s-tiddlywiki .CodeMirror-gutters {background: <>; border-right: 0px;} +.cm-s-tiddlywiki .CodeMirror-gutters {background: <>; border-right: 1px solid <>;} .cm-s-tiddlywiki .CodeMirror-linenumber {color: <>;} .cm-s-tiddlywiki .CodeMirror-cursor { border-left: 2px solid <>; } .cm-s-tiddlywiki span.cm-comment { color: #586e75; font-style:italic; font-weight:normal; } From b0f6d50b6096955b93725c88f6204a971de6110e Mon Sep 17 00:00:00 2001 From: Joshua Fontany Date: Sun, 6 Dec 2020 01:41:03 -0800 Subject: [PATCH 13/21] fix filesystem bugs (#5213) --- core/modules/utils/filesystem.js | 40 ++++++++++--------- .../filesystem/filesystemadaptor.js | 12 ++++-- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/core/modules/utils/filesystem.js b/core/modules/utils/filesystem.js index 9ee2e8acd..370a1eaf5 100644 --- a/core/modules/utils/filesystem.js +++ b/core/modules/utils/filesystem.js @@ -217,6 +217,10 @@ Options include: */ exports.generateTiddlerFileInfo = function(tiddler,options) { var fileInfo = {}, metaExt; + // Propigate the isEditableFile flag + if(options.fileInfo) { + fileInfo.isEditableFile = options.fileInfo.isEditableFile || false; + } // Check if the tiddler has any unsafe fields that can't be expressed in a .tid or .meta file: containing control characters, or leading/trailing whitespace var hasUnsafeFields = false; $tw.utils.each(tiddler.getFieldStrings(),function(value,fieldName) { @@ -248,20 +252,22 @@ exports.generateTiddlerFileInfo = function(tiddler,options) { extFilters: options.extFilters, wiki: options.wiki }); - if(metaExt === ".tid") { - // Overriding to the .tid extension needs special handling - fileInfo.type = "application/x-tiddler"; - fileInfo.hasMetaFile = false; - } else if (metaExt === ".json") { - // Overriding to the .json extension needs special handling - fileInfo.type = "application/json"; - fileInfo.hasMetaFile = false; - } else if (metaExt) { - //If the new type matches a known extention, use that MIME type's encoding - var extInfo = $tw.utils.getFileExtensionInfo(metaExt); - fileInfo.type = extInfo ? extInfo.type : null; - fileInfo.encoding = $tw.utils.getTypeEncoding(metaExt); - fileInfo.hasMetaFile = true; + if(metaExt){ + if(metaExt === ".tid") { + // Overriding to the .tid extension needs special handling + fileInfo.type = "application/x-tiddler"; + fileInfo.hasMetaFile = false; + } else if (metaExt === ".json") { + // Overriding to the .json extension needs special handling + fileInfo.type = "application/json"; + fileInfo.hasMetaFile = false; + } else { + //If the new type matches a known extention, use that MIME type's encoding + var extInfo = $tw.utils.getFileExtensionInfo(metaExt); + fileInfo.type = extInfo ? extInfo.type : null; + fileInfo.encoding = $tw.utils.getTypeEncoding(metaExt); + fileInfo.hasMetaFile = true; + } } } } @@ -276,10 +282,6 @@ exports.generateTiddlerFileInfo = function(tiddler,options) { fileInfo: options.fileInfo, originalpath: options.originalpath }); - // Propigate the isEditableFile flag - if(options.fileInfo) { - fileInfo.isEditableFile = options.fileInfo.isEditableFile || false; - } return fileInfo; }; @@ -380,7 +382,7 @@ exports.generateTiddlerFilepath = function(title,options) { count++; } while(fs.existsSync(fullPath)); //If the path does not start with the wikiPath directory or the wikiTiddlersPath directory, or if the last write failed - var encode = !(fullPath.indexOf($tw.boot.wikiPath) == 0 || fullPath.indexOf($tw.boot.wikiTiddlersPath) == 0) || ((options.fileInfo || {writeError: false}).writeError == true); + var encode = !(fullPath.indexOf(path.resolve($tw.boot.wikiPath)) == 0 || fullPath.indexOf($tw.boot.wikiTiddlersPath) == 0) || ((options.fileInfo || {writeError: false}).writeError == true); if(encode){ //encodeURIComponent() and then resolve to tiddler directory fullPath = path.resolve(directory, encodeURIComponent(fullPath)); diff --git a/plugins/tiddlywiki/filesystem/filesystemadaptor.js b/plugins/tiddlywiki/filesystem/filesystemadaptor.js index 5cef917bf..7e3cd2fa2 100644 --- a/plugins/tiddlywiki/filesystem/filesystemadaptor.js +++ b/plugins/tiddlywiki/filesystem/filesystemadaptor.js @@ -53,11 +53,17 @@ It is the responsibility of the filesystem adaptor to update this.boot.files for */ FileSystemAdaptor.prototype.getTiddlerFileInfo = function(tiddler,callback) { // Always generate a fileInfo object when this fuction is called - var title = tiddler.fields.title, newInfo; + var title = tiddler.fields.title, newInfo, pathFilters, extFilters; + if(this.wiki.tiddlerExists("$:/config/FileSystemPaths")){ + pathFilters = this.wiki.getTiddlerText("$:/config/FileSystemPaths","").split("\n"); + } + if(this.wiki.tiddlerExists("$:/config/FileSystemExtensions")){ + extFilters = this.wiki.getTiddlerText("$:/config/FileSystemExtensions","").split("\n"); + } newInfo = $tw.utils.generateTiddlerFileInfo(tiddler,{ directory: this.boot.wikiTiddlersPath, - pathFilters: this.wiki.getTiddlerText("$:/config/FileSystemPaths","").split("\n"), - extFilters: this.wiki.getTiddlerText("$:/config/FileSystemExtensions","").split("\n"), + pathFilters: pathFilters, + extFilters: extFilters, wiki: this.wiki, fileInfo: this.boot.files[title], originalpath: this.wiki.extractTiddlerDataItem("$:/config/OriginalTiddlerPaths",title, "") From 0b1a05d10d3bda97c36953bb8e8f3e97d333c191 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 6 Dec 2020 09:43:06 +0000 Subject: [PATCH 14/21] Cache result of parsing macro calls which don't use text subsitution (#5205) --- core/modules/widgets/macrocall.js | 15 ++++++++++++--- core/modules/widgets/widget.js | 7 +++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/core/modules/widgets/macrocall.js b/core/modules/widgets/macrocall.js index 2f527cc96..bc013cbf4 100644 --- a/core/modules/widgets/macrocall.js +++ b/core/modules/widgets/macrocall.js @@ -55,9 +55,18 @@ MacroCallWidget.prototype.execute = function() { // Are we rendering to HTML? if(this.renderOutput === "text/html") { // If so we'll return the parsed macro - var parser = this.wiki.parseText(this.parseType,text, - {parseAsInline: !this.parseTreeNode.isBlock}); - parseTreeNodes = parser ? parser.tree : []; + // Check if we've already cached parsing this macro + var parser; + if(variableInfo.srcVariable && variableInfo.srcVariable.parser) { + parser = variableInfo.srcVariable.parser; + } else { + parser = this.wiki.parseText(this.parseType,text, + {parseAsInline: !this.parseTreeNode.isBlock}); + if(variableInfo.isCacheable && variableInfo.srcVariable) { + // variableInfo.srcVariable.parser = parser; + } + } + var parseTreeNodes = parser ? parser.tree : []; // Wrap the parse tree in a vars widget assigning the parameters to variables named "__paramname__" var attributes = {}; $tw.utils.each(variableInfo.params,function(param) { diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index 22112a516..1925bfe00 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -113,7 +113,8 @@ Widget.prototype.getVariableInfo = function(name,options) { // Check for the variable defined in the parent widget (or an ancestor in the prototype chain) if(parentWidget && name in parentWidget.variables) { var variable = parentWidget.variables[name], - value = variable.value, + originalValue = variable.value, + value = originalValue, params = this.resolveVariableParameters(variable.params,actualParams); // Substitute any parameters specified in the definition $tw.utils.each(params,function(param) { @@ -125,7 +126,9 @@ Widget.prototype.getVariableInfo = function(name,options) { } return { text: value, - params: params + params: params, + srcVariable: variable, + isCacheable: originalValue === value }; } // If the variable doesn't exist in the parent widget then look for a macro module From 122306fc24968a800f3a0eb237d350e81d0bf836 Mon Sep 17 00:00:00 2001 From: Simon Huber Date: Sun, 6 Dec 2020 10:58:02 +0100 Subject: [PATCH 15/21] Update GruvboxDark, CupertinoDark and Nord palettes to work better with TiddlyDesktop (#5214) * Update CupertinoDark.tid * Update GruvBoxDark.tid * Update Nord.tid --- core/palettes/CupertinoDark.tid | 4 ++-- core/palettes/GruvBoxDark.tid | 2 +- core/palettes/Nord.tid | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/core/palettes/CupertinoDark.tid b/core/palettes/CupertinoDark.tid index 8097322cc..f0930f548 100644 --- a/core/palettes/CupertinoDark.tid +++ b/core/palettes/CupertinoDark.tid @@ -112,8 +112,8 @@ very-muted-foreground: #464646 selection-background: #3F638B selection-foreground: #ffffff wikilist-background: <> -wikilist-button-background: <> -wikilist-button-foreground: <> +wikilist-button-background: #3F638B +wikilist-button-foreground: <> wikilist-button-open: #32D74B wikilist-button-open-hover: #32D74B wikilist-button-reveal: #0A84FF diff --git a/core/palettes/GruvBoxDark.tid b/core/palettes/GruvBoxDark.tid index 9c2aaaa31..494a9349b 100644 --- a/core/palettes/GruvBoxDark.tid +++ b/core/palettes/GruvBoxDark.tid @@ -121,7 +121,7 @@ toolbar-done-button: untagged-background: #504945 very-muted-foreground: #bdae93 wikilist-background: <> -wikilist-button-background: <> +wikilist-button-background: #acacac wikilist-button-foreground: <> wikilist-item: <> wikilist-toolbar-background: <> diff --git a/core/palettes/Nord.tid b/core/palettes/Nord.tid index b2b618e72..7af3b01e4 100644 --- a/core/palettes/Nord.tid +++ b/core/palettes/Nord.tid @@ -120,3 +120,14 @@ toolbar-cancel-button: toolbar-done-button: untagged-background: #2d3038 very-muted-foreground: #2d3038 +wikilist-background: <> +wikilist-toolbar-background: <> +wikilist-item: <> +wikilist-title: <> +wikilist-info: <> +wikilist-button-open: #A3BE8C +wikilist-button-open-hover: #A3BE8C +wikilist-button-reveal: #81A1C1 +wikilist-button-reveal-hover: #81A1C1 +wikilist-button-remove: #B48EAD +wikilist-button-remove-hover: #B48EAD From 005f7c55b69e61ed8a30f2a457468907c78e9320 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Sun, 6 Dec 2020 10:50:59 +0000 Subject: [PATCH 16/21] Restore accidental commenting in 0b1a05d10 --- core/modules/widgets/macrocall.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/widgets/macrocall.js b/core/modules/widgets/macrocall.js index bc013cbf4..adf1f908c 100644 --- a/core/modules/widgets/macrocall.js +++ b/core/modules/widgets/macrocall.js @@ -63,7 +63,7 @@ MacroCallWidget.prototype.execute = function() { parser = this.wiki.parseText(this.parseType,text, {parseAsInline: !this.parseTreeNode.isBlock}); if(variableInfo.isCacheable && variableInfo.srcVariable) { - // variableInfo.srcVariable.parser = parser; + variableInfo.srcVariable.parser = parser; } } var parseTreeNodes = parser ? parser.tree : []; From b2d270a7e87bb5f16443a5c760a8e437a59661bc Mon Sep 17 00:00:00 2001 From: Simon Huber Date: Sun, 6 Dec 2020 14:00:19 +0100 Subject: [PATCH 17/21] CodeMirror: Make colored selections based on palette work in chrome, too (#5215) * Make colored selections based on palette work in chrome, too * Update styles.tid --- plugins/tiddlywiki/codemirror/styles.tid | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/tiddlywiki/codemirror/styles.tid b/plugins/tiddlywiki/codemirror/styles.tid index 30c9e731a..d1a324847 100755 --- a/plugins/tiddlywiki/codemirror/styles.tid +++ b/plugins/tiddlywiki/codemirror/styles.tid @@ -17,7 +17,10 @@ name: tiddlywiki \end \define set-selection-background-css(colour,colourA,colourB) <$set name="backgroundColour" value=<>> -.cm-s-tiddlywiki div.CodeMirror-selected, .cm-s-tiddlywiki .CodeMirror-selectedtext, .cm-s-tiddlywiki .CodeMirror-selected, .cm-s-tiddlywiki .CodeMirror-line::selection, .cm-s-tiddlywiki .CodeMirror-line > span::selection, .cm-s-tiddlywiki .CodeMirror-line > span > span::selection, .cm-s-tiddlywiki .CodeMirror-line::-moz-selection, .cm-s-tiddlywiki .CodeMirror-line > span::-moz-selection, .cm-s-tiddlywiki .CodeMirror-line > span > span::-moz-selection { background: <> ; } +.cm-s-tiddlywiki div.CodeMirror-selected { background: <>; } +.cm-s-tiddlywiki.CodeMirror ::selection { background: <>; } +.cm-s-tiddlywiki .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: <>; } +.cm-s-tiddlywiki .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: <>; } \end \define set-selection-background-colours(palette) From 43a3228200e6e18622b1d193c503c2ea23cfd218 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Sun, 6 Dec 2020 14:02:06 +0000 Subject: [PATCH 18/21] Update Performance docs for macro parsing optimisation Replacing #5216 --- editions/tw5.com/tiddlers/workingwithtw/Performance.tid | 1 + 1 file changed, 1 insertion(+) diff --git a/editions/tw5.com/tiddlers/workingwithtw/Performance.tid b/editions/tw5.com/tiddlers/workingwithtw/Performance.tid index 68fa1f230..2aec04e36 100644 --- a/editions/tw5.com/tiddlers/workingwithtw/Performance.tid +++ b/editions/tw5.com/tiddlers/workingwithtw/Performance.tid @@ -29,4 +29,5 @@ TiddlyWiki ships with defaults that are designed to get the best out of modern d ** Also note that the “field” operator is also used when the operator name is a fieldname, so, for example, `[all[shadows+tiddlers]caption[x]...` is optimised. * Use the [[throttling|RefreshThrottling]] feature of the RefreshMechanism judiciously * Keep in mind that ''transcluding separate tiddlers is more performant than heavy use of macros'' and the difference can be significant in some situations. The result of parsing each tiddler is cached and reused the next time if the tiddler has not changed. The same technique cannot be used for macros and they have to be re-parsed every time, as they are not global but local to the widget tree. +** <<.from-version "5.1.23">> Parse trees are now cached for macros that do ''not'' perform any text substitution either via parameters or variables (i.e. `$parameter$` or `$(variable)$`). * Where possible ''use the SetWidget or VarsWidget with filters instead of the WikifyWidget'' for declaring variables and string concatenation. The performance of the wikify mechanism is relatively poor as there is no opportunity to cache the parse tree or widget tree. From 958f57f2c0c2138ca1756fa67999ed59570db33b Mon Sep 17 00:00:00 2001 From: Simon Huber Date: Sun, 6 Dec 2020 18:15:40 +0100 Subject: [PATCH 19/21] Make editTiddler in sidebarsegments/search available as variable (#5218) --- core/ui/SideBarSegments/search.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/ui/SideBarSegments/search.tid b/core/ui/SideBarSegments/search.tid index a5b6f1b97..91d4fe922 100644 --- a/core/ui/SideBarSegments/search.tid +++ b/core/ui/SideBarSegments/search.tid @@ -46,12 +46,12 @@ tags: $:/tags/SideBarSegment