diff --git a/core/language/en-GB/Import.multids b/core/language/en-GB/Import.multids index 074ec5806..869a76721 100644 --- a/core/language/en-GB/Import.multids +++ b/core/language/en-GB/Import.multids @@ -3,6 +3,7 @@ title: $:/language/Import/ Editor/Import/Heading: Import images and insert them into the editor. Imported/Hint: The following tiddlers were imported: Listing/Cancel/Caption: Cancel +Listing/Cancel/Warning: Do you wish to cancel the import? Listing/Hint: These tiddlers are ready to import: Listing/Import/Caption: Import Listing/Select/Caption: Select diff --git a/core/modules/filterrunprefixes/map.js b/core/modules/filterrunprefixes/map.js new file mode 100644 index 000000000..a70f6b0f4 --- /dev/null +++ b/core/modules/filterrunprefixes/map.js @@ -0,0 +1,39 @@ +/*\ +title: $:/core/modules/filterrunprefixes/map.js +type: application/javascript +module-type: filterrunprefix +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +/* +Export our filter prefix function +*/ +exports.map = function(operationSubFunction,options) { + return function(results,source,widget) { + if(results.length > 0) { + var inputTitles = results.toArray(); + results.clear(); + $tw.utils.each(inputTitles,function(title) { + var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{ + getVariable: function(name) { + switch(name) { + case "currentTiddler": + return "" + title; + case "..currentTiddler": + return widget.getVariable("currentTiddler"); + default: + return widget.getVariable(name); + } + } + }); + results.push(filtered[0] || ""); + }); + } + } +}; + +})(); \ No newline at end of file diff --git a/core/modules/filters/strings.js b/core/modules/filters/strings.js index 286907dca..6fd64df08 100644 --- a/core/modules/filters/strings.js +++ b/core/modules/filters/strings.js @@ -172,4 +172,14 @@ exports.pad = function(source,operator,options) { return results; } +exports.charcode = function(source,operator,options) { + var chars = []; + $tw.utils.each(operator.operands,function(operand) { + if(operand !== "") { + chars.push(String.fromCharCode($tw.utils.parseInt(operand))); + } + }); + return [chars.join("")]; +}; + })(); diff --git a/core/modules/keyboard.js b/core/modules/keyboard.js index 1d818a25f..5e02a706d 100644 --- a/core/modules/keyboard.js +++ b/core/modules/keyboard.js @@ -179,7 +179,7 @@ Key descriptors have the following format: ctrl+enter ctrl+shift+alt+A */ -KeyboardManager.prototype.parseKeyDescriptor = function(keyDescriptor) { +KeyboardManager.prototype.parseKeyDescriptor = function(keyDescriptor,options) { var components = keyDescriptor.split(/\+|\-/), info = { keyCode: 0, @@ -206,6 +206,9 @@ KeyboardManager.prototype.parseKeyDescriptor = function(keyDescriptor) { info.keyCode = this.namedKeys[s]; } } + if(options.keyDescriptor) { + info.keyDescriptor = options.keyDescriptor; + } if(info.keyCode) { return info; } else { @@ -237,6 +240,7 @@ KeyboardManager.prototype.parseKeyDescriptors = function(keyDescriptors,options) lookupName = function(configName) { var keyDescriptors = wiki.getTiddlerText("$:/config/" + configName + "/" + name); if(keyDescriptors) { + options.keyDescriptor = keyDescriptor; result.push.apply(result,self.parseKeyDescriptors(keyDescriptors,options)); } }; @@ -245,7 +249,7 @@ KeyboardManager.prototype.parseKeyDescriptors = function(keyDescriptors,options) }); } } else { - result.push(self.parseKeyDescriptor(keyDescriptor)); + result.push(self.parseKeyDescriptor(keyDescriptor,options)); } }); return result; @@ -276,12 +280,16 @@ KeyboardManager.prototype.checkKeyDescriptor = function(event,keyInfo) { }; KeyboardManager.prototype.checkKeyDescriptors = function(event,keyInfoArray) { + return (this.getMatchingKeyDescriptor(event,keyInfoArray) !== null); +}; + +KeyboardManager.prototype.getMatchingKeyDescriptor = function(event,keyInfoArray) { for(var t=0; t +\define macroX() + +xxxx +\end + + ``` Note that the syntax for comments is simplified to an opening "" sequence -- HTML itself implements a more complex format (see http://ostermiller.org/findhtmlcomment.html) @@ -19,7 +25,7 @@ Note that the syntax for comments is simplified to an opening "\n\\define aMacro()\nnothing\n\\end\n")).toEqual( + + [ { type : 'set', attributes : { name : { type : 'string', value : 'aMacro' }, value : { type : 'string', value : 'nothing' } }, children : [ ], params : [ ], isMacroDefinition : true } ] + + ); }); it("should parse inline macro calls", function() { diff --git a/editions/tw5.com/tiddlers/filters/charcode.tid b/editions/tw5.com/tiddlers/filters/charcode.tid new file mode 100644 index 000000000..85d70111e --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/charcode.tid @@ -0,0 +1,17 @@ +caption: charcode +created: 20210622214425635 +modified: 20210622214425635 +op-input: ignored +op-output: a string formed from concatenating the characters specified by the numeric codes given in the operand(s) +op-parameter: numeric character code +op-parameter-name: C +op-purpose: generates string characters from their numeric character codes +tags: [[Filter Operators]] +title: charcode Operator +type: text/vnd.tiddlywiki + +<<.from-version "5.1.24">> + +This operator returns a string formed from concatenating the characters specified by the numeric codes given in one or more operands. It is useful for generating special characters such as tab (`charcode[9]`) or new line (`charcode[13],[10]`). + +<<.operator-examples "charcode">> diff --git a/editions/tw5.com/tiddlers/filters/examples/charcode.tid b/editions/tw5.com/tiddlers/filters/examples/charcode.tid new file mode 100644 index 000000000..f68d23952 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/examples/charcode.tid @@ -0,0 +1,7 @@ +created: 20210622214849214 +modified: 20210622214849214 +tags: [[charcode Operator]] [[Operator Examples]] +title: charcode Operator (Examples) +type: text/vnd.tiddlywiki + +<<.operator-example 1 "[charcode[65]match[A]]">> diff --git a/editions/tw5.com/tiddlers/filters/syntax/Filter Expression.tid b/editions/tw5.com/tiddlers/filters/syntax/Filter Expression.tid index 34c07faea..fb621743b 100644 --- a/editions/tw5.com/tiddlers/filters/syntax/Filter Expression.tid +++ b/editions/tw5.com/tiddlers/filters/syntax/Filter Expression.tid @@ -1,5 +1,5 @@ created: 20150124182421000 -modified: 20210522162642994 +modified: 20210618153333369 tags: [[Filter Syntax]] title: Filter Expression type: text/vnd.tiddlywiki @@ -26,14 +26,17 @@ If a run has: * named prefix `:intersection` replaces all filter output so far with titles that are present in the output of this run, as well as the output from previous runs. Forms the input for the next run. <<.from-version "5.1.23">> * named prefix `:reduce` replaces all filter output so far with a single item by repeatedly applying a formula to each input title. A typical use is to add up the values in a given field of each input title. <<.from-version "5.1.23">> ** [[Examples|Filter Run Prefix (Examples)]] -* named prefix `:sort` sorts all filter output so far by applying this run to each input title and sorting according to that output. <<.from-version "5.1.24">> +* named prefix `:sort` sorts all filter output so far by applying this run to each input title and sorting according to that output. <<.from-version "5.2.0">> ** See [[Sort Filter Run Prefix]]. +* named prefix `:map` transforms all filter output so far by applying this run to each input title and replacing the input title with the output of this run for that title. +** See [[Map Filter Run Prefix]]. <<.from-version "5.2.0">> + <<.tip "Compare named filter run prefix `:filter` with [[filter Operator]] which applies a subfilter to every input title, removing the titles that return an empty result from the subfilter">> <<.tip "Compare named filter run prefix `:reduce` with [[reduce Operator]] which is used to used to flatten a list of items down to a single item by repeatedly applying a subfilter.">> -<<.tip """Within the filter runs prefixed with `:reduce`, `:sort` and `:filter`, the "currentTiddler" variable is set to the title of the tiddler being processed. The value of currentTiddler outside the subfilter is available in the variable "..currentTiddler".<<.from-version "5.1.24">>""" >> +<<.tip """Within the filter runs prefixed with `:reduce`, `:sort`, `:map` and `:filter`, the "currentTiddler" variable is set to the title of the tiddler being processed. The value of currentTiddler outside the subfilter is available in the variable "..currentTiddler".<<.from-version "5.2.0">>""" >> In technical / logical terms: diff --git a/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix (Examples).tid b/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix (Examples).tid new file mode 100644 index 000000000..7c3ff1ec5 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix (Examples).tid @@ -0,0 +1,16 @@ +created: 20210618134753828 +modified: 20210618140945870 +tags: [[Filter Syntax]] [[Filter Run Prefix Examples]] [[Map Filter Run Prefix]] +title: Map Filter Run Prefix (Examples) +type: text/vnd.tiddlywiki + +Replace the input titles with the caption field if it exists, otherwise preserve the input title: + +<<.operator-example 1 "[tag[Widgets]] :map[get[caption]else{!!title}]">> + +<<.tip "The above example is equivalent to `[tag[Widgets]] :map[get[{!!caption}!is[blank]else{!!title}]`. Note that referencing a field as a text reference such as `{!!caption}` returns an empty string for a non-existent or empty caption field. Therefore a check for `is[blank]` is needed before the `else` operator">> + + +For each title in a shopping list, calculate the total cost of purchasing each item: + +<<.operator-example 2 "[tag[shopping]] :map[get[quantity]else[0]multiply{!!price}]">> diff --git a/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix.tid b/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix.tid new file mode 100644 index 000000000..a2f09bc3a --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/syntax/Map Filter Run Prefix.tid @@ -0,0 +1,19 @@ +created: 20210618133745003 +modified: 20210618134747652 +tags: [[Filter Syntax]] [[Filter Run Prefix]] +title: Map Filter Run Prefix +type: text/vnd.tiddlywiki + +<<.from-version "5.2.0">> + +|''purpose'' |modify input titles by the result of evaluating this filter run for each item | +|''input'' |all titles from previous filter runs | +|''output''|the input titles as modified by the result of this filter run | + +Each input title from previous runs is passed to this run in turn. The filter run transforms the input titles and the output of this run replaces the input title. For example, the filter run `[get[caption]else{!!title}]` replaces each input title with its caption field, unless the field does not exist in which case the title is preserved. + +Note that within the filter run, the "currentTiddler" variable is set to the title of the tiddler being processed. This permits filter runs like `:map[{!!price}multiply{!!cost}]` to be used for computation. The value of currentTiddler outside the run is available in the variable "..currentTiddler". + +Filter runs used with the `:map` prefix should return the same number of items that they are passed. Any missing entries will be treated as an empty string. In particular, when retrieving the value of a field with the [[get Operator]] it is helpful to guard against a missing field value using the [[else Operator]]. For example `[get[myfield]else[default-value]...`. + +[[Examples|Map Filter Run Prefix (Examples)]] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/KeyboardWidget.tid b/editions/tw5.com/tiddlers/widgets/KeyboardWidget.tid index ce9e3b3e0..0f7a18473 100644 --- a/editions/tw5.com/tiddlers/widgets/KeyboardWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/KeyboardWidget.tid @@ -1,7 +1,7 @@ caption: keyboard created: 20140302192136805 list: [[Keyboard Codes]] [[Key Codes (Example)]] [[Key Codes (Example 1)]] [[Possible Keys (Example 2)]] -modified: 20210525102143381 +modified: 20210612101618855 tags: Widgets title: KeyboardWidget type: text/vnd.tiddlywiki @@ -30,6 +30,7 @@ The content of the `<$keyboard>` widget is rendered normally. The keyboard short |!Variables |!Description | |`event-key` |The <<.var event-key>> variable contains the character, if possible. eg: `1`. You can experiment with some settings at: [[Key Codes (Example)]] | |`event-code` |The <<.var event-code>> variable contains a character description. eg: `Digit1` instead of `1`. Or `Space` instead of an empty string ` `, which is hard to see| +|`event-key-descriptor` |The <<.var event-key-descriptor>> variable is available if the keyboard event captured was configured using a [[keyboard shortcut descriptor|Keyboard Shortcut Descriptor]] of the form `((my-shortcut))` which references a configuration tiddler. | |`modifier` |The [[modifier Variable]] contains the Modifier Key held during the event (can be normal, ctrl, shift, alt or combinations thereof) | ! Key Strings diff --git a/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid index 412963adc..ec19e8a84 100644 --- a/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid +++ b/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid @@ -1,10 +1,12 @@ caption: HTML created: 20131205160816081 -modified: 20201125094415933 +modified: 20210614100305329 tags: WikiText title: HTML in WikiText type: text/vnd.tiddlywiki +! HTML tags and comments + HTML tags and comments can be used directly in WikiText. For example: ``` @@ -14,7 +16,22 @@ This is my nice and simple block of text. HelloThere ``` -[[Widgets share the same syntax as HTML tags|Widgets in WikiText]], and so the following information applies to them, too. +!! Pragma Comments + +<<.from-version 5.2.0>> Comments can now be freely intermixed with pragmas as well as within the main body of a block of wikitext. + +``` + +\define test() +some text +\end + +<> +``` + +! Important + +<<.tip """[[Widgets share the same syntax as HTML tags|Widgets in WikiText]], and so the following information applies to them, too.""">> ! Block mode versus Inline mode diff --git a/languages/de-DE/ControlPanel.multids b/languages/de-DE/ControlPanel.multids index f7c9f46f4..ed5ef024d 100644 --- a/languages/de-DE/ControlPanel.multids +++ b/languages/de-DE/ControlPanel.multids @@ -17,6 +17,8 @@ Basics/NewJournal/Tags/Prompt: Tags des neuen Journal-Tiddlers Basics/NewTiddler/Title/Prompt: Titel des neuen Tiddlers Basics/NewTiddler/Tags/Prompt: Tags des neuen Tiddlers Basics/OverriddenShadowTiddlers/Prompt: Anzahl überschriebener Schatten-Tiddler +Basics/RemoveTags: Auf neues Format umstellen +Basics/RemoveTags/Hint: Die "tags" Konfiguration wird auf das aktuelle Format umgestellt Basics/ShadowTiddlers/Prompt: Anzahl Schatten-Tiddler Basics/Subtitle/Prompt: Untertitel Basics/SystemTiddlers/Prompt: Anzahl System-Tiddler @@ -44,6 +46,7 @@ KeyboardShortcuts/Platform/Linux: Nur Linux KeyboardShortcuts/Platform/NonLinux: Alle Plattformen, außer Linux KeyboardShortcuts/Platform/Windows: Nur Windows KeyboardShortcuts/Platform/NonWindows: Alle Plattformen, außer Windows +LayoutSwitcher/Caption: Layout LoadedModules/Caption: Geladene Module LoadedModules/Hint: Hier werden die geladenen Module und ihre Quelltext-Komponenten angezeigt. Kursiv hervorgehobene Tiddler haben keinen Quelltext. Sie werden während des Boot-Prozesses (Aufrufen des Tiddlywikis) erstellt. Palette/Caption: Palette @@ -120,11 +123,12 @@ Saving/TiddlySpot/BackupDir: Verzeichnis für das "Backup" Saving/TiddlySpot/ControlPanel: ~TiddlySpot Control Panel Saving/TiddlySpot/Backups: "Backups" Saving/TiddlySpot/Caption: Speichern auf ~TiddlySpot -Saving/TiddlySpot/Description: Diese Einstellungen sind nur für http://tiddlyspot.com und kompatible Server aktiv! +Saving/TiddlySpot/Description: Diese Einstellungen sind nur für [[TiddlySpot|http://tiddlyspot.com]], [[TiddlyHost|https://tiddlyhost.com]], und kompatible Server aktiv! [[Diese Beschreibung|https://github.com/simonbaird/tiddlyhost/wiki/TiddlySpot-Saver-configuration-for-Tiddlyhost-and-Tiddlyspot]] enthält weitergehende Informationen. Saving/TiddlySpot/Filename: Dateiname für den "Upload" Saving/TiddlySpot/Heading: ~TiddlySpot Saving/TiddlySpot/Hint: //Die Standard-Server-URL ist `http://.tiddlyspot.com/store.cgi` und kann im Feld 'Server-URL' verändert werden. zB: http://example.com/store.php// Saving/TiddlySpot/Password: Passwort +Saving/TiddlySpot/ReadOnly: ~TiddlySpot wurde durch https://tiddlyhost.com ersetzt. Neue Wikis können nur noch unter ~TiddlyHost erstellt werden. Bestehende Projekte können mit bekanntem Passwort gespeichert werden. Genaue Informationen finden Sie unter: http://tiddlyspot.com/ Saving/TiddlySpot/ServerURL: Server-URL Saving/TiddlySpot/UploadDir: Verzeichnis für den "Upload" Saving/TiddlySpot/UserName: Name des Wikis diff --git a/languages/de-DE/Docs/ModuleTypes.multids b/languages/de-DE/Docs/ModuleTypes.multids index 6e433d4f2..5b7738d84 100644 --- a/languages/de-DE/Docs/ModuleTypes.multids +++ b/languages/de-DE/Docs/ModuleTypes.multids @@ -23,6 +23,7 @@ tiddlerfield: Definiert das Verhalten, der unterschiedlichen Tiddler-Felder. tiddlermethod: Methoden werden dem `$tw.Tiddler` Prototypen hinzugefügt. upgrader: Führt spezifische Änderungen während des Upgrade- oder Import-prozesses durch. utils: Methoden werden `$tw.utils` hinzugefügt. +utils-browser: Browser-spezifische Methoden werden zu `$tw.utils` hinzugefügt. utils-node: Erweitert `$tw.utils` mit Methoden aus node.js. widget: Widgets verarbeiten das Rendern und Aktualisieren der Anzeige in der DOM. wikimethod: Methoden werden zu `$tw.Wiki` hinzugefügt. diff --git a/languages/de-DE/EditTemplate.multids b/languages/de-DE/EditTemplate.multids index 6fafba055..517d4334f 100644 --- a/languages/de-DE/EditTemplate.multids +++ b/languages/de-DE/EditTemplate.multids @@ -3,6 +3,8 @@ title: $:/language/EditTemplate/ Body/External/Hint: Dieser Tiddler zeigt den Inhalt einer Datei, die nicht im TW file gespeichert ist. Sie können die "Tags" und "Feld" Texte ändern, jedoch nicht den Inhalt des Tiddlers! Body/Placeholder: Geben Sie den Text für diesen Tiddler ein. Body/Preview/Type/Output: Anzeige +Body/Preview/Type/DiffShadow: Unterschiede zum Schatten-Tiddler (wenn vorhanden) +Body/Preview/Type/DiffCurrent: Unterschiede zum aktuellen Tiddler Field/Remove/Caption: Lösche Feld Field/Remove/Hint: Lösche Feld Field/Dropdown/Caption: Feld Liste diff --git a/languages/de-DE/Help/listen.tid b/languages/de-DE/Help/listen.tid index c1b71dda8..1d4760689 100644 --- a/languages/de-DE/Help/listen.tid +++ b/languages/de-DE/Help/listen.tid @@ -21,9 +21,10 @@ Mögliche Parameter: * ''username'' - Benutzername für die Basis-Authentifizierung * ''password'' - Passwort für die Basis-Authentifizierung * ''authenticated-user-header'' - HTTP Header-Name für vertrauenswürdige, authentifizierte Benutzer -* ''readers'' - Komma separierte Liste für Benutzer, mit Schreiberlaubnis -* ''writers'' - Komma separierte Liste für Benutzer, mit Leseerlaubnis +* ''readers'' - Komma-separierte Liste für Benutzer, mit Schreiberlaubnis +* ''writers'' - Komma-separierte Liste für Benutzer, mit Leseerlaubnis * ''csrf-disable'' - "yes" bedeutet, dass CSRF checks deaktiviert sind. (Standard: "no") +* ''sse-enabled'' - "yes" bedeuted, dass "Server-sent events" aktiv sind (Standard: "no") * ''root-tiddler'' - Tiddler, der für den "Root-Pfad" verwendet wird. (Standard: "$:/core/save/all") * ''root-render-type'' - Darstellungs-Type, die für den Root-Tiddler verwendet wird. (Standard: "text/plain") * ''root-serve-type'' - Inhalts-Type, die für den Root-Tiddler verwendet wird. (Standard: "text/html") diff --git a/languages/de-DE/Help/render.tid b/languages/de-DE/Help/render.tid index a35c59521..bb1b5cda8 100644 --- a/languages/de-DE/Help/render.tid +++ b/languages/de-DE/Help/render.tid @@ -8,7 +8,7 @@ Optionell kann eine Template-Datei angegeben werden. In diesem Fall wird nicht d Es können noch zusätzliche Variablen per Name und Wert gesetzt werden. ``` ---render [] [] [