From 17f18daa89088381f3038e9482fea827dd2ab165 Mon Sep 17 00:00:00 2001 From: Mohammad Rahmani <830394+kookma@users.noreply.github.com> Date: Fri, 5 May 2023 21:17:03 +0330 Subject: [PATCH 01/27] =?UTF-8?q?Docs:=20Fix=20typo=20in=20=E2=80=9CProced?= =?UTF-8?q?ure=20Calls.tid=E2=80=9D=20(#7429)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix typo in procedure call --- editions/tw5.com/tiddlers/procedures/Procedure Calls.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/procedures/Procedure Calls.tid b/editions/tw5.com/tiddlers/procedures/Procedure Calls.tid index d66d8f274..a6bca3dba 100644 --- a/editions/tw5.com/tiddlers/procedures/Procedure Calls.tid +++ b/editions/tw5.com/tiddlers/procedures/Procedure Calls.tid @@ -7,7 +7,7 @@ type: text/vnd.tiddlywiki !! Introduction -This tiddler describes the different ways in which [[macros|Procedures]] can be called. +This tiddler describes the different ways in which [[procedure|Procedures]] can be called. !! Procedure Call Transclusion Shortcut From 4e641f4fc0f2822f49e91eccd90b151b7adbd9ee Mon Sep 17 00:00:00 2001 From: Michelle Saad Date: Sat, 6 May 2023 10:26:40 +0000 Subject: [PATCH 02/27] Add 'filepath' source attribute to tiddlywiki.files (#7253) * Add 'filepath' source attribute to tiddlywiki.files Adds a new source attribute to facilitate importing subdirectories with the `searchSubdirectories` attribute. The `filepath` atttribute is like `filename` except it includes the full pathname relative to the directory path. Consequently it only works with `directories` sections (not `tiddlers`). * Add `subdirectories` source attribute to tiddlywiki.files Adds another new source attribute to facilitate importing subdirectories with the `searchSubdirectories` attribute. The `subdirectories` source attribute is only usable with `directories` sections (not `tiddlers`). It resolves to an array containing all the directories in the file's path relative to the directory path. Eg, if the directory path is `files`, `{ source: 'subdirectories' }` for a file in `files/images/photos` would resolve to `['images', 'photos']. This commit also adds an example to the "tiddlywiki.files Files" documentation tiddler that demonstrates using the `filepath` and `subdirectories` source attributes to import and auto-tag image files as external-image tiddlers. --- boot/boot.js | 10 ++++- .../nodejs/tiddlywiki.files_Files.tid | 42 ++++++++++++++++++- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 89fafce6a..44dd5b4e3 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -1920,7 +1920,7 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) { // Read the specification var filesInfo = $tw.utils.parseJSONSafe(fs.readFileSync(filepath + path.sep + "tiddlywiki.files","utf8")); // Helper to process a file - var processFile = function(filename,isTiddlerFile,fields,isEditableFile) { + var processFile = function(filename,isTiddlerFile,fields,isEditableFile,rootPath) { var extInfo = $tw.config.fileExtensionInfo[path.extname(filename)], type = (extInfo || {}).type || fields.type || "text/plain", typeInfo = $tw.config.contentTypeInfo[type] || {}, @@ -1941,6 +1941,12 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) { } else { var value = tiddler[name]; switch(fieldInfo.source) { + case "subdirectories": + value = path.relative(rootPath, filename).split('/').slice(0, -1); + break; + case "filepath": + value = path.relative(rootPath, filename); + break; case "filename": value = path.basename(filename); break; @@ -2023,7 +2029,7 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) { var thisPath = path.relative(filepath, files[t]), filename = path.basename(thisPath); if(filename !== "tiddlywiki.files" && !metaRegExp.test(filename) && fileRegExp.test(filename)) { - processFile(thisPath,dirSpec.isTiddlerFile,dirSpec.fields,dirSpec.isEditableFile); + processFile(thisPath,dirSpec.isTiddlerFile,dirSpec.fields,dirSpec.isEditableFile,dirSpec.path); } } } else { diff --git a/editions/tw5.com/tiddlers/nodejs/tiddlywiki.files_Files.tid b/editions/tw5.com/tiddlers/nodejs/tiddlywiki.files_Files.tid index 6086dfebc..87ddf9b40 100644 --- a/editions/tw5.com/tiddlers/nodejs/tiddlywiki.files_Files.tid +++ b/editions/tw5.com/tiddlers/nodejs/tiddlywiki.files_Files.tid @@ -29,6 +29,8 @@ Each field can be specified as either a ''string'' or ''array'' value to be assi ** //extname// the extension of the filename of the file containing the tiddler ** //created// the creation date/time of the file containing the tiddler ** //modified// the modification date/time of the file containing the tiddler +** <<.from-version "5.3.0">> //filepath// the path of the file containing the tiddler, relative to the ''path'' property of the directory (only usable in ''directories'' declarations) +** <<.from-version "5.3.0">> //subdirectories// an array of the subdirectories in the file's path relative, to the ''path'' property of the directory (only usable in ''directories'' declarations) * ''prefix'' - (optional) a string to be prepended to the value of the field * ''suffix'' - (optional) a string to be appended to the value of the field @@ -52,7 +54,7 @@ Directory specifications in the `directories` array may take the following forms ** ''filesRegExp'' - (optional) a [[regular expression|https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions]] that matches the filenames of the files that should be processed within the directory ** ''isTiddlerFile'' - (required) if `true`, the file will be treated as a [[tiddler file|TiddlerFiles]] and deserialised to extract the tiddlers. Otherwise, the raw content of the file is assigned to the `text` field without any parsing ** ''isEditableFile'' - <<.from-version "5.1.23">> (optional) if `true`, changes to the tiddler be saved back to the original file. The tiddler will be saved back to the original filepath as long as it does not generate a result from the $:/config/FileSystemPath filters, which will override the final filepath generated if a result is returned from a filter. -** ''searchSubdirectories'' - <<.from-version "5.1.23">> (optional) if `true`, all subdirectories of the //path// are searched recursively for files that match the (optional) //filesRegExp//. If no //filesRegExp// is provided, all files in all subdirectories of the //path// are loaded. Tiddler titles generated via a //source// attribute (see above) will only include the filename, not any of the subdirectories of the path. If this results in multiple files with loaded with the same tiddler title, then only the last file loaded under that tiddler title will be in memory. In order to prevent this, you must have multiple directory objects listed and customise the title field with a //prefix// or //suffix// alongside the //source// attribute. +** ''searchSubdirectories'' - <<.from-version "5.1.23">> (optional) if `true`, all subdirectories of the //path// are searched recursively for files that match the (optional) //filesRegExp//. If no //filesRegExp// is provided, all files in all subdirectories of the //path// are loaded. Tiddler titles generated via the //source// attribute //filename// (see above) will only include the filename, not any of the subdirectories of the path. If this results in multiple files with loaded with the same tiddler title, then only the last file loaded under that tiddler title will be in memory. In order to prevent this, you can use the //filepath// attribute instead of //filename//. Alternately, you can include multiple directory objects and customise the title field with a //prefix// or //suffix// alongside the //source// attribute. ** ''fields'' - (required) an object containing values that override or customise the fields provided in the tiddler file (see above) Fields can also be overridden for particular files by creating a file with the same name plus the suffix `.meta` -- see TiddlerFiles. @@ -95,6 +97,7 @@ This example retrieves all the files with the extension `.pdf` from a folder spe ] } ``` + !! Importing a folder of text files This example retrieves all the files with the extension `.txt` from a folder specified by a relative path. This folder is within the wiki's base directory, and the current config file is in a directory within the wiki's "tiddlers/" directory. So, in this case the path starts with "../../" to traverse upwards two directory levels, and then down into the "externalnotes/" directory. Each tiddler is set up with the following fields: @@ -130,4 +133,39 @@ This will load all text files in the `../../externalnotes/` directory into the w From the examples in [[Customising Tiddler File Naming]] we see that the final `[!tag[externalnote]addprefix[wiki/]]` filter in the $:/config/FileSystemPaths tiddler excludes all tiddlers tagged with `externalnotes` (that have not matched an earlier filter). These tiddlers have their filepath retrieved from the $:/config/OriginalTiddlerPaths generated upon boot startup. -Then, the `[tag[.txt]then[.txt]]` filter in the $:/config/FileSystemExtensions tiddler forces all these tiddlers to be saved back to disk as *.txt and accompanying *.txt.meta files (overriding the normal tiddler-type to file-type mapping). In this case, allowing the snippets of Tiddlywiki wikitext or markdown-text to be saved back to "text" *.txt files. \ No newline at end of file +Then, the `[tag[.txt]then[.txt]]` filter in the $:/config/FileSystemExtensions tiddler forces all these tiddlers to be saved back to disk as *.txt and accompanying *.txt.meta files (overriding the normal tiddler-type to file-type mapping). In this case, allowing the snippets of Tiddlywiki wikitext or markdown-text to be saved back to "text" *.txt files. + +!! Importing and auto-tagging images + +This example imports all the image files in the `files` directory and all its subdirectories as external-image tiddlers, and tags them based on their filepath. Each tiddler is set up with the following fields: + +* ''title'' - set to the URI decoded base filename of the text file +* ''created'' - set to the creation date/time of the text file +* ''modified'' - set to the modification date/time of the text file +* ''type'' - set to `image/jpeg`. There is currently no way to infer the correct ContentType of the image tiddler from the file, but `image/jpeg` tiddlers should render correctly even with png or gif images. As an alternative, you could create separate definitions for jpg, png, and gif files with the `image/jpeg`, `image/png`, and `image/gif` types respectively. +* ''tags'' - generated based on the path of the image relative to the parent directory (`files` in this case). Eg, images in `files/photos` will be tagged with `photos`, those in `files/photos/family` will be tagged with both `photos` and `family`, and those in the root `files` directory will have no tags. +* ''text'' - set to an empty string +* ''_canonical_uri'' - set to the full filepath of the image relative to the wiki root + + +``` +{ + "directories": [ + { + "path": "../../files/", + "filesRegExp": "^.*\\.(?:jpg|jpeg|png|gif)$", + "isTiddlerFile": false, + "searchSubdirectories": true, + "fields": { + "title": {"source": "basename-uri-decoded"}, + "created": {"source": "created"}, + "modified": {"source": "modified"}, + "type": "image/jpeg", + "tags": { "source": "subdirectories" }, + "text": "", + "_canonical_uri": { "source": "filepath", "prefix": "files/" } + } + } + ] +} +``` From 2340d48844f00f39bc6697b86d2e10dc6825efcf Mon Sep 17 00:00:00 2001 From: yaisog Date: Sat, 6 May 2023 12:30:21 +0200 Subject: [PATCH 03/27] Add additional searchModes to Dynannotate (#7260) * Add searchModes: literal, some and words * Add additional search modes Description of selection tracker config tiddlers was also changed. * Update simple.tid * Improve View Template examples Transcludes a sample tiddler for demonstration instead of the dynannotate view template code. Adds an example for usage with $genesis to add state tiddler controlled per-tiddler highlights. * Make search highlights not case sensitive * Remove created and modified fields * Add another example text (Searching in Tiddlywiki) * Add dynannotate for vercel deployment This should probably not be merged... * Create LegacySelectionTracker.tid * Create SelectionTracker.tid * Revert putting the SelectionTracker config titles in code blocks * Replace inline styles with CSS class * Add class for view template examples Class name is tc-dynannotate-example-frame. * Remove some
line breaks. * Remove first example transclusion and fix some tab spacing * Add class to override control panel table layout * Add class to settings table * More tab shenanigans Great Scott! * Add explanatory comment to example macro * Change defaults to match widget behavior * Make previous macro comment more concise * Change example to transclude CP tiddler $:/core/ui/ControlPanel/TiddlerFields * Delete unnecessary example tiddler --- editions/tw5.com/tiddlywiki.info | 3 +- .../config/LegacySelectionTracker.tid | 3 + .../dynannotate/config/SelectionTracker.tid | 3 + .../tiddlywiki/dynannotate/docs/readme.tid | 9 +- .../dynannotate/examples/simple.tid | 88 +++++++++---------- .../examples/viewtemplate-text.tid | 1 + .../dynannotate/examples/viewtemplate.tid | 59 +++++++++++-- .../tiddlywiki/dynannotate/modules/textmap.js | 13 ++- plugins/tiddlywiki/dynannotate/styles.tid | 10 +++ 9 files changed, 125 insertions(+), 64 deletions(-) create mode 100644 plugins/tiddlywiki/dynannotate/config/LegacySelectionTracker.tid create mode 100644 plugins/tiddlywiki/dynannotate/config/SelectionTracker.tid diff --git a/editions/tw5.com/tiddlywiki.info b/editions/tw5.com/tiddlywiki.info index 7379908ee..b71c9ad1f 100644 --- a/editions/tw5.com/tiddlywiki.info +++ b/editions/tw5.com/tiddlywiki.info @@ -6,7 +6,8 @@ "tiddlywiki/railroad", "tiddlywiki/evernote", "tiddlywiki/internals", - "tiddlywiki/menubar" + "tiddlywiki/menubar", + "tiddlywiki/dynannotate" ], "themes": [ "tiddlywiki/vanilla", diff --git a/plugins/tiddlywiki/dynannotate/config/LegacySelectionTracker.tid b/plugins/tiddlywiki/dynannotate/config/LegacySelectionTracker.tid new file mode 100644 index 000000000..83a547633 --- /dev/null +++ b/plugins/tiddlywiki/dynannotate/config/LegacySelectionTracker.tid @@ -0,0 +1,3 @@ +title: $:/config/Dynannotate/LegacySelectionTracker/Enable + +no diff --git a/plugins/tiddlywiki/dynannotate/config/SelectionTracker.tid b/plugins/tiddlywiki/dynannotate/config/SelectionTracker.tid new file mode 100644 index 000000000..6162c992c --- /dev/null +++ b/plugins/tiddlywiki/dynannotate/config/SelectionTracker.tid @@ -0,0 +1,3 @@ +title: $:/config/Dynannotate/SelectionTracker/Enable + +no diff --git a/plugins/tiddlywiki/dynannotate/docs/readme.tid b/plugins/tiddlywiki/dynannotate/docs/readme.tid index 487c25561..ff0483a79 100644 --- a/plugins/tiddlywiki/dynannotate/docs/readme.tid +++ b/plugins/tiddlywiki/dynannotate/docs/readme.tid @@ -25,7 +25,7 @@ The `<$dynannotate>` widget uses the selection tracker to support a popup that d |popup |Popup state tiddler to be used to trigger a popup when an annotation is clicked | |search |Search text to be highlighted within the widget | |searchDisplay |"overlay" or "snippet" (see below) | -|searchMode |"normal" (default), "regexp" or "whitespace" (see below) | +|searchMode |"literal" (default), "regexp", "whitespace", "words" or "some" (see below) | |searchMinLength |Optional minimum length of search string | |searchCaseSensitive |"yes" (the default) for a case sensitive search, or "no" for a case insensitive search| |searchClass |Optional CSS class to be added to search overlays | @@ -46,9 +46,10 @@ The values supported by the `searchDisplay` attribute are: The search modes supported by the `searchMode` attribute are: -* `normal` - a literal string of plain text to match +* `literal` or `normal` - a literal string of plain text to match (default). * `regexp` - a JavaScript-style regular expression (without the quoting backslashes and flags) -* `whitespace` - a literal string to match while normalising runs of whitespace. This allows `a. b` to match `a. b` +* `whitespace` - a literal string to match while normalising runs of whitespace. Thus `A B` matches `A B`. +* `words` or `some` - treats the search string as a list of tokens separated by whitespace, and matches all tokens (regardless of ordering and whether there is other text in between) When the selection popup is triggered, the currently selected text can be found in the tiddler named in the `selection` attribute, with the disambiguating prefix and suffix in the tiddlers named in the `selectionPrefix` and `selectionPopup` tiddlers. Note that the selection text will be an empty string if the selection popup was triggered in response to a click (ie zero width selection). @@ -95,7 +96,7 @@ Note that using the `annotate-tiddler` field to associate an annotation with the !! Selection Trackers -The following configuration tiddlers can be used to control whether the selection trackers are enabled when the following configuration tiddlers are set to ''yes'' (the default). +The selection trackers are enabled when the following configuration tiddlers are set to ''yes''. * $:/config/Dynannotate/SelectionTracker/Enable for the main selection tracker * $:/config/Dynannotate/LegacySelectionTracker/Enable for the legacy selection tracker diff --git a/plugins/tiddlywiki/dynannotate/examples/simple.tid b/plugins/tiddlywiki/dynannotate/examples/simple.tid index aa1837b78..59a8d7e1d 100644 --- a/plugins/tiddlywiki/dynannotate/examples/simple.tid +++ b/plugins/tiddlywiki/dynannotate/examples/simple.tid @@ -10,16 +10,33 @@ caption: Simple $example$ \end +\define search-example-code() + +\rules only filteredtranscludeinline +<$dynannotate + search="{{{ [{$:/temp/dynannotate-example/search}!is[blank]else[The human mind]] }}}"{{{ [{$:/temp/dynannotate-example/searchMode}!search::some[literal normal]addprefix[ + searchMode="]addsuffix["]] }}} + searchCaseSensitive="{{{ [{$:/temp/dynannotate-example/searchCaseSensitive}!is[blank]else[yes]] }}}"{{{ [{$:/temp/dynannotate-example/searchClass}!is[blank]addprefix[ + searchClass="]addsuffix["]] }}} +> +<$transclude tiddler="$:/plugins/tiddlywiki/dynannotate/example-text-1" mode="block"/> +<$transclude tiddler="$:/plugins/tiddlywiki/dynannotate/example-text-2" mode="block"/> + +\end +
-!! Simple annotation +!! Annotations with `target` -We use the `target*` attributes to specify a target string for the annotation and optionally a prefix and suffix for disambiguating multiple occurances. +We use the `target*` attributes to specify a target string for the annotation and optionally a prefix and suffix for disambiguating multiple occurences.
-< -!! Plain text searching +!! Highlights with `search` -We use the `search` attribute to specify a search string for highlighting: +We use the `search` attribute to specify a search string for highlighting. + +The search type can be set with the `searchMode` and `searchCaseSensitive` attributes. + +We can style the highlights with the `searchClass` attribute, which has some predefined values. -<| +|search mode |<$select tiddler="$:/temp/dynannotate-example/searchMode" field="text" default="literal"> | +|case sensitive |<$checkbox tiddler="$:/temp/dynannotate-example/searchCaseSensitive" field="text" checked="yes" unchecked="no" default="yes"> <$text text={{{ [{$:/temp/dynannotate-example/searchCaseSensitive}!is[blank]else[yes]] }}} /> | +|search class |<$select tiddler="$:/temp/dynannotate-example/searchClass" field="text" default=""> | + <$dynannotate - search="the" + search={{{ [{$:/temp/dynannotate-example/search}!is[blank]else[The human mind]] }}} + searchMode={{{ [{$:/temp/dynannotate-example/searchMode}] }}} + searchCaseSensitive={{{ [{$:/temp/dynannotate-example/searchCaseSensitive}!is[blank]else[yes]] }}} + searchClass={{{ [{$:/temp/dynannotate-example/searchClass}] }}} > <$transclude tiddler="$:/plugins/tiddlywiki/dynannotate/example-text-1" mode="block"/> +<$transclude tiddler="$:/plugins/tiddlywiki/dynannotate/example-text-2" mode="block"/> -""">> -
- -!! Regular expression searching - -We use the `mode` attribute set to `regexp` to highlight matches of a regular expression: - -
- -< -<$transclude tiddler="$:/plugins/tiddlywiki/dynannotate/example-text-1" mode="block"/> - -""">> - -
- -!! Normalised whitespace searching - -We use the `mode` attribute set to `whitespace` to search for a string with whitespace normalised (ie runs of whitespace are collapsed to a single space for matching purposes): - -
- -< -<$transclude tiddler="$:/plugins/tiddlywiki/dynannotate/example-text-1" mode="block"/> - -""">> +<$wikify name="wikifiedCode" text=<> mode="block" output="text"> +<$codeblock code=<>/> +
@@ -90,8 +87,7 @@ Annotation tiddlers can be used to describe annotations. This example references <> -< <$transclude tiddler="$:/plugins/tiddlywiki/dynannotate/example-text-1" mode="block"/> diff --git a/plugins/tiddlywiki/dynannotate/examples/viewtemplate-text.tid b/plugins/tiddlywiki/dynannotate/examples/viewtemplate-text.tid index 15588c420..81c3c2b25 100644 --- a/plugins/tiddlywiki/dynannotate/examples/viewtemplate-text.tid +++ b/plugins/tiddlywiki/dynannotate/examples/viewtemplate-text.tid @@ -34,6 +34,7 @@ title: $:/plugins/tiddlywiki/dynannotate/examples/viewtemplate/text selectionPopup={{{ [addprefix[$:/state/dynannotate/popup-selection/]] }}} search={{$:/temp/search}} searchClass="tc-dynannotation-search-overlay-blurred" + searchCaseSensitive="no" searchMinLength={{$:/config/Search/MinLength}} > <$transclude mode="block"> diff --git a/plugins/tiddlywiki/dynannotate/examples/viewtemplate.tid b/plugins/tiddlywiki/dynannotate/examples/viewtemplate.tid index a0b99eb79..150a6f88f 100644 --- a/plugins/tiddlywiki/dynannotate/examples/viewtemplate.tid +++ b/plugins/tiddlywiki/dynannotate/examples/viewtemplate.tid @@ -1,28 +1,69 @@ -title: $:/plugins/tiddlywiki/dynannotate/examples/viewtemplate -tags: $:/tags/dynannotateExamples caption: View Template +tags: $:/tags/dynannotateExamples +title: $:/plugins/tiddlywiki/dynannotate/examples/viewtemplate + +\define show-example(example) +<$codeblock code=<<__example__>>/> + +//''Displays as:''// + +$example$ +\end
!! Using Dynannotate in the view template -This example shows how to override the core view template with a custom template that includes dynannotate. It is disabled by default but can be enabled by clicking the button below. (Clicking the button below copies the custom view template from $:/plugins/tiddlywiki/dynannotate/examples/viewtemplate/text to $:/core/ui/ViewTemplate/body). +This example shows how to override the core view template with a custom template that includes dynannotate. It is disabled by default but can be enabled by clicking the corresponding button below. The example transcludes the [[Searching in TiddlyWiki|$:/plugins/tiddlywiki/dynannotate/searching-in-tiddlywiki]] tiddler for illustration purposes, but the chosen view template is applied to all open tiddlers. -Once enabled, this example demonstrates several features: +Once enabled, this example demonstrates several features of Dynannotate: -* Highlighting of search results within tiddler bodies -* Creating annotations on any tiddler by selecting text and then clicking a colour in the resulting dropdown +* Highlight text within tiddler bodies -- any text entered in the sidebar search input will be highlighted (in all tiddlers) +* Create annotations (on any tiddler) by selecting text and then clicking //Create annotation// in the resulting dropdown + +(Clicking the buttons below either puts the custom body view template [[$:/plugins/tiddlywiki/dynannotate/examples/viewtemplate/text]] in front of the default in the [[View Template Body Cascade|https://tiddlywiki.com/#View%20Template%20Body%20Cascade]] or removes it from the cascade).
<$button> -<$action-setfield $tiddler="$:/config/ViewTemplateTitleFilters/dynannotate" tags="$:/tags/ViewTemplateTitleFilter" text="[[$:/plugins/tiddlywiki/dynannotate/examples/viewtemplate/text]]" list-before="$:/config/ViewTemplateBodyFilters/default"/> +<$action-setfield $tiddler="$:/config/ViewTemplateBodyFilters/dynannotate" tags="$:/tags/ViewTemplateBodyFilter" text="[[$:/plugins/tiddlywiki/dynannotate/examples/viewtemplate/text]]" list-before="$:/config/ViewTemplateBodyFilters/default"/> Click here to use the custom view template <$button> -<$action-deletetiddler $tiddler="$:/config/ViewTemplateTitleFilters/dynannotate"/> +<$action-deletetiddler $tiddler="$:/config/ViewTemplateBodyFilters/dynannotate"/> Click here to revert to the core view template -<$codeblock code={{$:/plugins/tiddlywiki/dynannotate/examples/viewtemplate/text}}/> \ No newline at end of file +

+ +

+ +!! Using Dynannotate to highlight text on a per-tiddler basis + +Using state tiddlers containing the text which is to be highlighted, Dynannotate highlights can be applied on a per-tiddler basis when used in the body view template. This can also be combined with the [[GenesisWidget]] to insert the Dynannotate widget into the DOM only when such a highlight is configured. + +This example uses a transcluded tiddler, but Dynannotate could be added to the view template (to show highlights in all parts of a tiddler) or to the body view template (to show highlights only in the tiddler body) in the same way. Note how in this example, Dynannotate only affects the transcluded content. + +
+ +<Highlight "tiddler" +<$button set="$:/state/dynannotate/examples/viewtemplate" setTo="created">Highlight "created" +<$button set="$:/state/dynannotate/examples/viewtemplate" setTo="">Clear highlights +

+<$let dynannotateText={{$:/state/dynannotate/examples/viewtemplate}}> + <$genesis $type={{{ [!is[blank]then[$dynannotate]] }}} + search=<> + searchDisplay="overlay" + searchClass="tc-dynannotation-search-overlay-animated" + searchCaseSensitive="no"> +

+ + !! `$:/core/ui/ControlPanel/TiddlerFields`: + <$transclude tiddler="$:/core/ui/ControlPanel/TiddlerFields" mode="block" /> +
+ + +""">> + +When used in the view template, the state tiddler title could be derived from the current tiddler, e.g. `<$let dynannotateText={{{ [addprefix[$:/state/dynannotate/]get[text]] }}}>`, to configure highlights for each tiddler separately. diff --git a/plugins/tiddlywiki/dynannotate/modules/textmap.js b/plugins/tiddlywiki/dynannotate/modules/textmap.js index 9f9dbbbe3..934ceb0ff 100644 --- a/plugins/tiddlywiki/dynannotate/modules/textmap.js +++ b/plugins/tiddlywiki/dynannotate/modules/textmap.js @@ -15,7 +15,7 @@ Structure for modelling mapping between a string and its representation in the D var PREFIX_SUFFIX_LENGTH = 50; /* -Build a map of the text content of a dom node and its descendents: +Build a map of the text content of a DOM node and its descendants: string: concatenation of the text content of child nodes metadata: array of {start,end,domNode} where start and end identify position in the string @@ -60,7 +60,7 @@ exports.TextMap.prototype.locateMetadata = function(position) { }; /* -Search for the first occurance of a target string within the textmap of a dom node +Search for the first occurrence of a target string within the textmap of a DOM node Returns an object with the following properties: startNode: node containing the start of the text @@ -92,10 +92,10 @@ exports.TextMap.prototype.findText = function(targetString,targetPrefix,targetSu }; /* -Search for all occurances of a string within the textmap of a dom node +Search for all occurrences of a string within the textmap of a DOM node Options include: - mode: "normal", "regexp" or "whitespace" + mode: "normal", "literal", "regexp", "whitespace", "some" or "words" caseSensitive: true if the search should be case sensitive Returns an array of objects with the following properties: @@ -121,6 +121,11 @@ exports.TextMap.prototype.search = function(searchString,options) { regExpString = "(" + searchString.split(/\s+/g).filter(function(word) { return !!word }).map($tw.utils.escapeRegExp).join("\\s+") + ")"; + } else if(options.mode === "words" || options.mode === "some") { + // Match any word separated by whitespace + regExpString = "(" + searchString.split(/\s+/g).filter(function(word) { + return !!word + }).map($tw.utils.escapeRegExp).join("|") + ")"; } else { // Normal search regExpString = "(" + $tw.utils.escapeRegExp(searchString) + ")"; diff --git a/plugins/tiddlywiki/dynannotate/styles.tid b/plugins/tiddlywiki/dynannotate/styles.tid index cd635eed5..8b13eba58 100644 --- a/plugins/tiddlywiki/dynannotate/styles.tid +++ b/plugins/tiddlywiki/dynannotate/styles.tid @@ -34,6 +34,16 @@ tags: [[$:/tags/Stylesheet]] animation: ta-dynannotation-search-overlay-animated 12s linear infinite; } +.tc-dynannotate-example-frame { + border: 1px solid black; + border-radius: 20px; + padding: 1em; +} + +.tc-control-panel table.tc-dynannotate-search-parameters, .tc-control-panel table.tc-dynannotate-search-parameters input { + width: initial; +} + .tc-dynannotate-snippet-highlight { background: #efef53; } From a1b706a945797da9f24ca7e908241ffd4f04fb2c Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Sat, 6 May 2023 11:36:36 +0100 Subject: [PATCH 04/27] Remove dynannotate plugin fro tw5.com edition It was added temporarily to make #7260 easier to work on --- editions/tw5.com/tiddlywiki.info | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlywiki.info b/editions/tw5.com/tiddlywiki.info index b71c9ad1f..7379908ee 100644 --- a/editions/tw5.com/tiddlywiki.info +++ b/editions/tw5.com/tiddlywiki.info @@ -6,8 +6,7 @@ "tiddlywiki/railroad", "tiddlywiki/evernote", "tiddlywiki/internals", - "tiddlywiki/menubar", - "tiddlywiki/dynannotate" + "tiddlywiki/menubar" ], "themes": [ "tiddlywiki/vanilla", From b61aef27d7979bf6c46f99f419803fec952cf70e Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Sat, 6 May 2023 12:37:05 +0200 Subject: [PATCH 05/27] External-js file naming adjusted. import docs form tw5.com. make extrnal-js more visible (#7361) * external-js file naming adjusted. import docs form tw5.com. make external-js more visible * add comment about doc usage in server-external-js edition * add changes suggested by cdruan * change modifed date to start vercel rebuild process --- core/templates/external-js/save-all-external-js.tid | 3 +++ .../tiddlers/config/$__DefaultTiddlers.tid | 7 +++++++ .../tiddlers/config/$__config_SaveWikiButton_Filename.tid | 4 ++++ .../server-external-js/tiddlers/external/tiddlywiki.files | 8 ++++++++ editions/server-external-js/tiddlywiki.info | 5 ++--- .../webserver/Using the external JavaScript template.tid | 8 ++++++-- 6 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 editions/server-external-js/tiddlers/config/$__DefaultTiddlers.tid create mode 100644 editions/server-external-js/tiddlers/config/$__config_SaveWikiButton_Filename.tid create mode 100644 editions/server-external-js/tiddlers/external/tiddlywiki.files diff --git a/core/templates/external-js/save-all-external-js.tid b/core/templates/external-js/save-all-external-js.tid index 2616fed20..193b6e90c 100644 --- a/core/templates/external-js/save-all-external-js.tid +++ b/core/templates/external-js/save-all-external-js.tid @@ -5,7 +5,10 @@ title: $:/core/save/all-external-js \define saveTiddlerFilter() [is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$ \end + + \define defaultCoreURL() %24%3A%2Fcore%2Ftemplates%2Ftiddlywiki5.js + <$let coreURL={{{ [[coreURL]is[variable]thenelse] }}}> {{$:/core/templates/tiddlywiki5-external-js.html}} diff --git a/editions/server-external-js/tiddlers/config/$__DefaultTiddlers.tid b/editions/server-external-js/tiddlers/config/$__DefaultTiddlers.tid new file mode 100644 index 000000000..a1f1a0a27 --- /dev/null +++ b/editions/server-external-js/tiddlers/config/$__DefaultTiddlers.tid @@ -0,0 +1,7 @@ +created: 20230314153132081 +modified: 20230314153243008 +title: $:/DefaultTiddlers +type: text/vnd.tiddlywiki + +GettingStarted +[[Using the external JavaScript template]] diff --git a/editions/server-external-js/tiddlers/config/$__config_SaveWikiButton_Filename.tid b/editions/server-external-js/tiddlers/config/$__config_SaveWikiButton_Filename.tid new file mode 100644 index 000000000..071c85fe9 --- /dev/null +++ b/editions/server-external-js/tiddlers/config/$__config_SaveWikiButton_Filename.tid @@ -0,0 +1,4 @@ +title: $:/config/SaveWikiButton/Filename +type: text/vnd.tiddlywiki + +external-<>.html \ No newline at end of file diff --git a/editions/server-external-js/tiddlers/external/tiddlywiki.files b/editions/server-external-js/tiddlers/external/tiddlywiki.files new file mode 100644 index 000000000..73474d2ce --- /dev/null +++ b/editions/server-external-js/tiddlers/external/tiddlywiki.files @@ -0,0 +1,8 @@ +{ + "tiddlers": [ + { + "file": "../../../tw5.com/tiddlers/webserver/Using the external JavaScript template.tid", + "isTiddlerFile": true + } + ] +} \ No newline at end of file diff --git a/editions/server-external-js/tiddlywiki.info b/editions/server-external-js/tiddlywiki.info index b8d4c37ee..cb02accd5 100644 --- a/editions/server-external-js/tiddlywiki.info +++ b/editions/server-external-js/tiddlywiki.info @@ -2,8 +2,7 @@ "description": "Client-server edition with external tiddlywiki.js", "plugins": [ "tiddlywiki/tiddlyweb", - "tiddlywiki/filesystem", - "tiddlywiki/highlight" + "tiddlywiki/filesystem" ], "themes": [ "tiddlywiki/vanilla", @@ -13,7 +12,7 @@ "listen": [ "--listen","root-tiddler=$:/core/save/all-external-js","use-browser-cache=yes"], "index": [ - "--render","$:/core/save/offline-external-js","index.html","text/plain", + "--render","$:/core/save/offline-external-js","[[external-]addsuffixaddsuffix[.html]]","text/plain", "--render","$:/core/templates/tiddlywiki5.js","[[tiddlywikicore-]addsuffixaddsuffix[.js]]","text/plain"], "static": [ "--render","$:/core/templates/static.template.html","static.html","text/plain", diff --git a/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid b/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid index 1aa61e86a..75b5f1484 100644 --- a/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid +++ b/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid @@ -1,9 +1,13 @@ created: 20180905075846391 -modified: 20221207112242775 +modified: 20230319130830880 tags: [[WebServer Guides]] title: Using the external JavaScript template type: text/vnd.tiddlywiki + + You can use a special template to externalise ~TiddlyWiki's core code into a separate file. This configuration allows the browser to cache the core for improved efficiency. ! Background @@ -60,7 +64,7 @@ The "server-external-js" edition lets you save the snapshot from the command lin tiddlywiki YOUR_WIKI_FOLDER --build index ``` -The files `index.html` and `tiddlywikicore-5.x.x.js` will be saved in your wiki folder's `output` directory. +The files `external-5-x-x.html` and `tiddlywikicore-5.x.x.js` will be saved in your wiki folder's `output` directory. !! Obtaining the ~TiddlyWiki core in the browser From a6ced74a136ebafd83370281cd3fc32b46376491 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 6 May 2023 11:40:22 +0100 Subject: [PATCH 06/27] Introduce "thisTiddler" variable (#7182) * Initial Commit * Change of mind: Do not blank thisTiddler within macros * Revert previous implementation * Somewhat simpler implementation * Add docs * Add docs version tag --- core/modules/widgets/transclude.js | 2 ++ .../tests/data/this-tiddler/Simple.tid | 29 +++++++++++++++++++ .../tw5.com/tiddlers/system/doc-macros.tid | 6 +++- .../thisTiddler Variable (Examples).tid | 13 +++++++++ .../tw5.com/tiddlers/thisTiddler Variable.tid | 12 ++++++++ 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 editions/test/tiddlers/tests/data/this-tiddler/Simple.tid create mode 100644 editions/tw5.com/tiddlers/thisTiddler Variable (Examples).tid create mode 100644 editions/tw5.com/tiddlers/thisTiddler Variable.tid diff --git a/core/modules/widgets/transclude.js b/core/modules/widgets/transclude.js index 1831f6b6d..b0a84a13a 100755 --- a/core/modules/widgets/transclude.js +++ b/core/modules/widgets/transclude.js @@ -279,6 +279,8 @@ TranscludeWidget.prototype.getTransclusionTarget = function() { defaultType: this.transcludeType }); } + // Set 'thisTiddler' + this.setVariable("thisTiddler",this.transcludeTitle); // Return the parse tree if(parser) { return { diff --git a/editions/test/tiddlers/tests/data/this-tiddler/Simple.tid b/editions/test/tiddlers/tests/data/this-tiddler/Simple.tid new file mode 100644 index 000000000..4aad83c98 --- /dev/null +++ b/editions/test/tiddlers/tests/data/this-tiddler/Simple.tid @@ -0,0 +1,29 @@ +title: ThisTiddler/Simple +description: Simple usage of thisTiddler variable +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +\whitespace trim +\import Macro +\define print-this-tiddler() +<$text text=<>/> +\end + +(<$text text=<>/>) + +(<>) + +(<>) + ++ +title: Macro + +\define imported-print-this-tiddler() +<$text text=<>/> +\end ++ +title: ExpectedResult + +

(Output)

(Output)

(Output)

\ No newline at end of file diff --git a/editions/tw5.com/tiddlers/system/doc-macros.tid b/editions/tw5.com/tiddlers/system/doc-macros.tid index f1c99b748..e4a425f9a 100644 --- a/editions/tw5.com/tiddlers/system/doc-macros.tid +++ b/editions/tw5.com/tiddlers/system/doc-macros.tid @@ -134,7 +134,11 @@ This is an example tiddler. See [[Table-of-Contents Macros (Examples)]].
<$reveal default="$egvar$" type="match" text="NO-SUCH-VAR"> - $eg$ + +$$$text/vnd.tiddlywiki +$eg$ +$$$ + <$reveal default="$egvar$" type="nomatch" text="NO-SUCH-VAR"> <<$egvar$>> diff --git a/editions/tw5.com/tiddlers/thisTiddler Variable (Examples).tid b/editions/tw5.com/tiddlers/thisTiddler Variable (Examples).tid new file mode 100644 index 000000000..d0adc6167 --- /dev/null +++ b/editions/tw5.com/tiddlers/thisTiddler Variable (Examples).tid @@ -0,0 +1,13 @@ +created: 20230304123606350 +modified: 20230304124149055 +tags: [[currentTiddler Variable]] [[Variable Examples]] +title: thisTiddler Variable (Examples) +type: text/vnd.tiddlywiki + + + +<$macrocall $name=".example" n="1" eg="""<$text text=<>/>"""/> + +<$macrocall $name=".example" n="2" eg="""\define example() <$text text=<>/> +<> +"""/> diff --git a/editions/tw5.com/tiddlers/thisTiddler Variable.tid b/editions/tw5.com/tiddlers/thisTiddler Variable.tid new file mode 100644 index 000000000..95b6b901c --- /dev/null +++ b/editions/tw5.com/tiddlers/thisTiddler Variable.tid @@ -0,0 +1,12 @@ +caption: currentTiddler +created: 20230304122810114 +modified: 20230304123557862 +tags: Variables [[Core Variables]] +title: thisTiddler Variable +type: text/vnd.tiddlywiki + +<<.from-version "5.3.0">> The <<.def thisTiddler>> [[variable|Variables]] is set by the <<.wlink TranscludeWidget>> widget to contain the title of the tiddler that was transcluded. This means that within a tiddler <<.def thisTiddler>> will contain the title of that tiddler. It is not affected by macros, which means that within a macro <<.def thisTiddler>> will contain the title of the tiddler from which the macro was invoked. Intermediate, nested macro calls are ignored. + +Compare <<.vlink storyTiddler>> and <<.vlink currentTiddler>>. + +<<.variable-examples "thisTiddler">> From 3ee5f1036286561f88fbcc29169fc5c38734f6e4 Mon Sep 17 00:00:00 2001 From: btheado Date: Sat, 6 May 2023 05:41:22 -0500 Subject: [PATCH 07/27] BrowserStoragePlugin: Do not save shadow tiddlers to local storage (#7365) If a tiddler is only a shadow tiddler, then do not save it to local storage. Otherwise when installing a plugin, each individual tiddler will be expanded and saved individually. In order to uninstall such a plugin, the plugin tiddler and each tiddler needs to be deleted. This can be prevented by including a run like `-[is[shadow]!is[tiddler]]` in the save filter, but that has the side effect of preventing overwritten shadow tiddlers from being deleted from local storage. --- .../tiddlywiki/browser-storage/settings.tid | 4 +- plugins/tiddlywiki/browser-storage/util.js | 39 +++++++++++-------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/plugins/tiddlywiki/browser-storage/settings.tid b/plugins/tiddlywiki/browser-storage/settings.tid index 33d8ef0e1..7bf0e26e5 100644 --- a/plugins/tiddlywiki/browser-storage/settings.tid +++ b/plugins/tiddlywiki/browser-storage/settings.tid @@ -17,8 +17,8 @@ Click this button to clear browser storage and disable its use: This filter determines which tiddlers will be saved to local storage. * `[prefix[$:/state/]] -[prefix[$:/state/popup/]]` - the default value. Save state tiddlers except popup state tiddlers, thus preserving selected tabs and the open/closed status of table of contents entries. Any other tiddlers created or changed will be lost after reloading the page. -* `[all[]]` - attempt to save all changed tiddlers. This means even popup state tiddlers and temporary tiddlers will be saved. In addition, when a plugin is installed, all the shadow tiddlers are individually "exploded" into local storage. Deleting the plugin requires deleting all the tiddlers individually. Not recommended unless these issues are unimportant. -* `[all[]] -[is[shadow]!is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]]` - save all tiddlers except unmodified shadow tiddlers, popup state tiddlers, temp tiddlers and the history list. Solves the aforementioned issues with `[all[]]`. Recommended. +* `[all[]]` - attempt to save all changed tiddlers. This means even popup state tiddlers and temporary tiddlers will be saved. +* `[all[]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]]` - save all tiddlers except popup state tiddlers, temp tiddlers and the history list. <$link to="$:/config/BrowserStorage/SaveFilter">Browser Storage Save Filter: <$edit-text tiddler="$:/config/BrowserStorage/SaveFilter" default="" tag="input" size="50"/> diff --git a/plugins/tiddlywiki/browser-storage/util.js b/plugins/tiddlywiki/browser-storage/util.js index a88c358f6..7474a367c 100644 --- a/plugins/tiddlywiki/browser-storage/util.js +++ b/plugins/tiddlywiki/browser-storage/util.js @@ -53,24 +53,31 @@ BrowserStorageUtil.prototype.saveTiddlerToLocalStorage = function(title) { // Get the tiddler var tiddler = $tw.wiki.getTiddler(title); if(tiddler) { - console.log("browser-storage: Saving",title); - // Get the JSON of the tiddler - var json = JSON.stringify(tiddler.getFieldStrings()); - // Try to save it to local storage - try { - window.localStorage.setItem(this.options.prefix + title,json); - } catch(e) { - if(e.name === "QuotaExceededError") { - // Complain if we failed - var msg = $tw.wiki.getTiddlerText(this.QUOTA_EXCEEDED_ALERT_TITLE,this.DEFAULT_QUOTA_EXCEEDED_ALERT_PREFIX + title + this.DEFAULT_QUOTA_EXCEEDED_ALERT_SUFFIX); - if(this.options.logger) { - this.options.logger.alert(msg); + if (this.wiki.tiddlerExists(title)) { + // This is not a shadow tiddler + console.log("browser-storage: Saving",title); + // Get the JSON of the tiddler + var json = JSON.stringify(tiddler.getFieldStrings()); + // Try to save it to local storage + try { + window.localStorage.setItem(this.options.prefix + title,json); + } catch(e) { + if(e.name === "QuotaExceededError") { + // Complain if we failed + var msg = $tw.wiki.getTiddlerText(this.QUOTA_EXCEEDED_ALERT_TITLE,this.DEFAULT_QUOTA_EXCEEDED_ALERT_PREFIX + title + this.DEFAULT_QUOTA_EXCEEDED_ALERT_SUFFIX); + if(this.options.logger) { + this.options.logger.alert(msg); + } + // No point in keeping old values around for this tiddler + window.localStorage.removeItem(this.options.prefix + title); + } else { + console.log("Browser-storage error:",e); } - // No point in keeping old values around for this tiddler - window.localStorage.removeItem(this.options.prefix + title); - } else { - console.log("Browser-storage error:",e); } + } else { + // Shadow tiddler which is no longer overwritten (or never was) + // Ensure it is not in local storage + this.removeTiddlerFromLocalStorage(title); } } else { // In local storage, use the special value of empty string to mark the tiddler as deleted From d6533b9ee165976184629db6af3b54c75463abab Mon Sep 17 00:00:00 2001 From: yaisog Date: Sat, 6 May 2023 12:44:22 +0200 Subject: [PATCH 08/27] Add the timestamp suffix to the format operator (#7292) * Create timestamp.js Taken verbatim from @ericshulman. * Add description of the timestamp suffix * Add an example for timestamp use I also snuck it a couple of cosmetic corrections, because I was too lazy to open a new PR. :cry: * Correct example 4 to use the right date formats * Correct description of the default date format * Add a test for the timestamp suffix * Add more format:timestamp tests * Drop invalid input * Update version tag in docs --------- Co-authored-by: jeremy@jermolene.com --- core/modules/filters/format/timestamp.js | 25 +++++++++++++++++++ editions/test/tiddlers/tests/test-filters.js | 3 +++ .../examples/format Operator (Examples).tid | 15 ++++++----- editions/tw5.com/tiddlers/filters/format.tid | 3 +++ 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 core/modules/filters/format/timestamp.js diff --git a/core/modules/filters/format/timestamp.js b/core/modules/filters/format/timestamp.js new file mode 100644 index 000000000..d6f5afe30 --- /dev/null +++ b/core/modules/filters/format/timestamp.js @@ -0,0 +1,25 @@ +/*\ +title: $:/core/modules/filters/format/timestamp.js +type: application/javascript +module-type: formatfilteroperator +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +/* +Export our filter function +*/ +exports.timestamp = function(source,operand,options) { + var results = []; + source(function(tiddler,title) { + if (title.match(/^-?\d+$/)) { + var value = new Date(Number(title)); + results.push($tw.utils.formatDateString(value,operand || "[UTC]YYYY0MM0DD0hh0mm0ss0XXX")); + } + }); + return results; +}; +})(); \ No newline at end of file diff --git a/editions/test/tiddlers/tests/test-filters.js b/editions/test/tiddlers/tests/test-filters.js index e00d0bf8d..49a790166 100644 --- a/editions/test/tiddlers/tests/test-filters.js +++ b/editions/test/tiddlers/tests/test-filters.js @@ -1060,6 +1060,9 @@ Tests the filtering mechanism. expect(wiki.filterTiddlers("[[Hello There]] [[GettingStarted]] +[format:titlelist[]]").join(" ")).toBe("[[Hello There]] GettingStarted"); expect(wiki.filterTiddlers("[title[Hello There]] +[format:titlelist[]]").join(" ")).toBe("[[Hello There]]"); expect(wiki.filterTiddlers("[title[HelloThere]] +[format:titlelist[]]").join(" ")).toBe("HelloThere"); + expect(wiki.filterTiddlers("0 +[format:timestamp[]]").join(",")).toBe("19700101000000000"); + expect(wiki.filterTiddlers("1603188514443 +[format:timestamp[]]").join(",")).toBe("20201020100834443"); + expect(wiki.filterTiddlers("void +[format:timestamp[]]").join(",")).toBe(""); }); it("should handle the deserializers operator", function() { diff --git a/editions/tw5.com/tiddlers/filters/examples/format Operator (Examples).tid b/editions/tw5.com/tiddlers/filters/examples/format Operator (Examples).tid index c1d79ea8c..b6ad505a1 100644 --- a/editions/tw5.com/tiddlers/filters/examples/format Operator (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/examples/format Operator (Examples).tid @@ -1,5 +1,5 @@ created: 20201020102735123 -modified: 20220611104737314 +modified: 20230226135641976 tags: [[Operator Examples]] [[format Operator]] title: format Operator (Examples) type: text/vnd.tiddlywiki @@ -15,20 +15,23 @@ Created date with a format string supplied as operator parameter: Modified date shown as a relative date: <<.operator-example 3 "[[HelloThere]get[modified]format:relativedate[]]">> +Get the date and time exactly 24 hours (86,400,000 milliseconds) from now: +<<.operator-example 4 "[format:date[TIMESTAMP]add[86400000]format:timestamp[DDth mmm YYYY 0hh:0mm:0ss]]">> + A tiddler title with spaces formatted as a title list: -<<.operator-example 4 """[[Hello There]format:titlelist[]]""">> +<<.operator-example 5 """[[Hello There]format:titlelist[]]""">> All tiddler titles tagged with <> formatted as a title list: -<<.operator-example 5 """[tag[TableOfContents]format:titlelist[]]""">> +<<.operator-example 6 """[tag[TableOfContents]format:titlelist[]]""">> A JSON string formatted as JSON – note how the JSON string is normalised to remove the duplicated properties: -<<.operator-example 6 """[[{"one":"first","one":"another","two":"second"}]format:json[]]""">> +<<.operator-example 7 """[[{"one":"first","one":"another","two":"second"}]format:json[]]""">> <<.tip "To create a string to save a [[title list|Title List]] into a list field, use `format:titlelist[]` with the [[join operator|join Operator]]">> -<<.operator-example 6 """[tag[TableOfContents]format:titlelist[]join[ ]]""">> +<<.operator-example 8 """[tag[TableOfContents]format:titlelist[]join[ ]]""">> For example, to save titles tagged `TableOfContents` to the titles field of the tiddler [[format titlelist test]]: <$macrocall $name='wikitext-example-without-html' -src='<$button> test +src='<$button>Try it <$action-setfield $tiddler="format titlelist test" titles={{{ [tag[TableOfContents]format:titlelist[]join[ ]] }}}/> '/> diff --git a/editions/tw5.com/tiddlers/filters/format.tid b/editions/tw5.com/tiddlers/filters/format.tid index e5b12b134..d62a82169 100644 --- a/editions/tw5.com/tiddlers/filters/format.tid +++ b/editions/tw5.com/tiddlers/filters/format.tid @@ -20,8 +20,11 @@ The suffix <<.place B>> is one of the following supported string formats: |^`date` |The input string is interpreted as a UTC date and displayed according to the DateFormat specified in the optional operator operand. (Defaults to "YYYY MM DD 0hh:0mm") | |^`json` |<<.from-version "5.2.4">> The input string is interpreted as JSON and displayed with standard formatting. The optional operator operand specifies the number of spaces to use for indenting, or a string to use for indenting. Nothing is returned if the input string is not valid JSON | |^`relativedate` |The input string is interpreted as a UTC date and displayed as the interval from the present instant. Any operator parameters are ignored | +|^`timestamp` |<<.from-version "5.3.0">> The input string is interpreted as number of milliseconds since the [[ECMAScript epoch|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_ecmascript_epoch_and_timestamps]], 1 January 1970, and displayed according to the DateFormat specified in the optional operator operand. (Defaults to "[UTC]YYYY0MM0DD0hh0mm0ss0XXX") | |^`titlelist` |<<.from-version "5.2.0">> The input string wrapped in double square brackets if it contains a space. Appropriate for use in a [[title list|Title List]]. | +Invalid input strings are dropped by the <<.op format>> operator. + <<.warning """The [[Title List]] format cannot reliably represent items that contain certain specific character sequences such as `]] `. Thus it should not be used where there is a possibility of such sequences occurring.""">> <<.operator-examples "format">> From 6820d45bf0ca2a552f3ed968e0fa89797c50840c Mon Sep 17 00:00:00 2001 From: yaisog Date: Sat, 6 May 2023 12:53:58 +0200 Subject: [PATCH 09/27] Improve the StoryTiddlerTemplate fallback (#7332) * Initial commit * Update StoryTiddlerTemplate.tid * Extend cascades hint to help in case of problems * Remove note about debugging from docs I think that this brief note is more confusing than anything else --------- Co-authored-by: jeremy@jermolene.com --- core/ui/StoryTiddlerTemplate.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ui/StoryTiddlerTemplate.tid b/core/ui/StoryTiddlerTemplate.tid index 7379f00b1..7cc26a849 100644 --- a/core/ui/StoryTiddlerTemplate.tid +++ b/core/ui/StoryTiddlerTemplate.tid @@ -1,3 +1,3 @@ title: $:/core/ui/StoryTiddlerTemplate -<$transclude tiddler={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/StoryTiddlerTemplateFilter]!is[draft]get[text]] :and[!is[blank]else{$:/config/ui/ViewTemplate}] }}} /> +<$transclude tiddler={{{ [] :cascade[all[shadows+tiddlers]tag[$:/tags/StoryTiddlerTemplateFilter]!is[draft]get[text]] :and[has[title]else[$:/core/ui/ViewTemplate]] }}} /> From e92e125697a5fc5c44928dd6341130fd0ab90163 Mon Sep 17 00:00:00 2001 From: yaisog Date: Sat, 6 May 2023 12:54:54 +0200 Subject: [PATCH 10/27] Add the querySelectorSafe() function and replace querySelector() usage (#7380) * Initial commit * Correct the over-estimation of my abilities * Add fallback and move code to dom.js * Use new function for tm-focus-selector * Replace other uses of querySelector* * Undo rash replacements of querySelector() --- core/modules/startup/rootwidget.js | 8 ++------ core/modules/storyviews/zoomin.js | 2 +- core/modules/utils/dom/dom.js | 20 ++++++++++++++++++++ core/modules/utils/dom/scroller.js | 4 ++-- core/modules/widgets/scrollable.js | 4 ++-- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/core/modules/startup/rootwidget.js b/core/modules/startup/rootwidget.js index a8ad5f8c6..1175f6f25 100644 --- a/core/modules/startup/rootwidget.js +++ b/core/modules/startup/rootwidget.js @@ -41,12 +41,8 @@ exports.startup = function() { $tw.rootWidget.addEventListener("tm-focus-selector",function(event) { var selector = event.param || "", element, - doc = event.event && event.event.target ? event.event.target.ownerDocument : document; - try { - element = doc.querySelector(selector); - } catch(e) { - console.log("Error in selector: ",selector) - } + baseElement = event.event && event.event.target ? event.event.target.ownerDocument : document; + element = $tw.utils.querySelectorSafe(selector,baseElement); if(element && element.focus) { element.focus(event.paramObject); } diff --git a/core/modules/storyviews/zoomin.js b/core/modules/storyviews/zoomin.js index 6452e6225..d02f705e7 100644 --- a/core/modules/storyviews/zoomin.js +++ b/core/modules/storyviews/zoomin.js @@ -129,7 +129,7 @@ function findTitleDomNode(widget,targetClass) { targetClass = targetClass || "tc-title"; var domNode = widget.findFirstDomNode(); if(domNode && domNode.querySelector) { - return domNode.querySelector("." + targetClass); + return $tw.utils.querySelectorSafe("." + targetClass,domNode); } return null; } diff --git a/core/modules/utils/dom/dom.js b/core/modules/utils/dom/dom.js index 6d8f2a76d..9c06fc8b0 100644 --- a/core/modules/utils/dom/dom.js +++ b/core/modules/utils/dom/dom.js @@ -365,5 +365,25 @@ exports.collectDOMVariables = function(selectedNode,domNode,event) { return variables; }; +/* +Make sure the CSS selector is not invalid +*/ +exports.querySelectorSafe = function(selector,baseElement) { + baseElement = baseElement || document; + try { + return baseElement.querySelector(selector); + } catch(e) { + console.log("Invalid selector: ",selector); + } +}; + +exports.querySelectorAllSafe = function(selector,baseElement) { + baseElement = baseElement || document; + try { + return baseElement.querySelectorAll(selector); + } catch(e) { + console.log("Invalid selector: ",selector); + } +}; })(); diff --git a/core/modules/utils/dom/scroller.js b/core/modules/utils/dom/scroller.js index 73be0f0a8..905bb2750 100644 --- a/core/modules/utils/dom/scroller.js +++ b/core/modules/utils/dom/scroller.js @@ -127,8 +127,8 @@ PageScroller.prototype.scrollIntoView = function(element,callback,options) { }; PageScroller.prototype.scrollSelectorIntoView = function(baseElement,selector,callback,options) { - baseElement = baseElement || document.body; - var element = baseElement.querySelector(selector); + baseElement = baseElement || document; + var element = $tw.utils.querySelectorSafe(selector,baseElement); if(element) { this.scrollIntoView(element,callback,options); } diff --git a/core/modules/widgets/scrollable.js b/core/modules/widgets/scrollable.js index aadc040df..15b61e0c8 100644 --- a/core/modules/widgets/scrollable.js +++ b/core/modules/widgets/scrollable.js @@ -119,8 +119,8 @@ ScrollableWidget.prototype.scrollIntoView = function(element,callback,options) { }; ScrollableWidget.prototype.scrollSelectorIntoView = function(baseElement,selector,callback,options) { - baseElement = baseElement || document.body; - var element = baseElement.querySelector(selector); + baseElement = baseElement || document; + var element = $tw.utils.querySelectorSafe(selector,baseElement); if(element) { this.scrollIntoView(element,callback,options); } From 4e96a012f6b6020448e882a6594d39f2fb9afd8e Mon Sep 17 00:00:00 2001 From: donmor Date: Sat, 6 May 2023 18:55:41 +0800 Subject: [PATCH 11/27] Add missing extensions for audio/mpeg (#7378) Add missing extensions for audio/mpeg --- boot/boot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/boot.js b/boot/boot.js index 44dd5b4e3..1bf6814fa 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -2414,7 +2414,7 @@ $tw.boot.initStartup = function(options) { $tw.utils.registerFileType("video/webm","base64",".webm"); $tw.utils.registerFileType("video/mp4","base64",".mp4"); $tw.utils.registerFileType("audio/mp3","base64",".mp3"); - $tw.utils.registerFileType("audio/mpeg","base64"); + $tw.utils.registerFileType("audio/mpeg","base64",[".mp3",".m2a",".mp2",".mpa",".mpg",".mpga"]); $tw.utils.registerFileType("text/markdown","utf8",[".md",".markdown"],{deserializerType:"text/x-markdown"}); $tw.utils.registerFileType("text/x-markdown","utf8",[".md",".markdown"]); $tw.utils.registerFileType("application/enex+xml","utf8",".enex"); From 9cdb38d8008af5c9e2660fd8d9dea083875b9a1f Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Sat, 6 May 2023 13:07:55 +0200 Subject: [PATCH 12/27] Linkcatcher should pass through event objects (#7401) --- core/modules/widgets/linkcatcher.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/modules/widgets/linkcatcher.js b/core/modules/widgets/linkcatcher.js index 78322d0f6..4f4a66b17 100644 --- a/core/modules/widgets/linkcatcher.js +++ b/core/modules/widgets/linkcatcher.js @@ -92,12 +92,9 @@ LinkCatcherWidget.prototype.handleNavigateEvent = function(event) { this.executingActions = false; } } else { - // This is a navigate event generated by the actions of this linkcatcher, so we don't trap it again, but just pass it to the parent - this.parentWidget.dispatchEvent({ - type: "tm-navigate", - param: event.navigateTo, - navigateTo: event.navigateTo - }); + // This is a navigate event generated by the actions of this linkcatcher, + // so we don't trap it again, but just pass it to the parent + this.parentWidget.dispatchEvent(event); } return false; }; From 96f97f237a850475f280ca5dd51ddea8fea658b1 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 6 May 2023 12:08:20 +0100 Subject: [PATCH 13/27] Remove "direction" CSS property from framed version of editor (#7409) --- core/modules/editor/engines/framed.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/modules/editor/engines/framed.js b/core/modules/editor/engines/framed.js index 948890645..a4cf983b0 100644 --- a/core/modules/editor/engines/framed.js +++ b/core/modules/editor/engines/framed.js @@ -118,6 +118,8 @@ FramedEngine.prototype.copyStyles = function() { this.domNode.style.margin = "0"; // In Chrome setting -webkit-text-fill-color overrides the placeholder text colour this.domNode.style["-webkit-text-fill-color"] = "currentcolor"; + // Ensure we don't force text direction to LTR + this.domNode.style.removeProperty("direction"); }; /* From 2bfefe3880d00f3d40e5461ec4e3799617ab1053 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 6 May 2023 12:08:46 +0100 Subject: [PATCH 14/27] Parameterise core icons (#7413) * Parameterise all the icons * Improve splash screen macro for rendering icons * Add new example from @kookma --- core/icon.tid | 3 +- core/images/add-comment.tid | 3 +- core/images/advanced-search-button.tid | 3 +- core/images/auto-height.tid | 3 +- core/images/blank.tid | 3 +- core/images/bold.tid | 3 +- core/images/cancel-button.tid | 3 +- core/images/chevron-down.tid | 3 +- core/images/chevron-left.tid | 3 +- core/images/chevron-right.tid | 3 +- core/images/chevron-up.tid | 3 +- core/images/clone-button.tid | 3 +- core/images/close-all-button.tid | 3 +- core/images/close-button.tid | 3 +- core/images/close-others-button.tid | 3 +- core/images/copy-clipboard.tid | 3 +- core/images/delete-button.tid | 3 +- core/images/done-button.tid | 3 +- core/images/down-arrow.tid | 3 +- core/images/download-button.tid | 3 +- core/images/edit-button.tid | 3 +- core/images/erase.tid | 3 +- core/images/excise.tid | 3 +- core/images/export-button.tid | 3 +- core/images/file.tid | 3 +- core/images/fixed-height.tid | 3 +- core/images/fold-all-button.tid | 3 +- core/images/fold-button.tid | 3 +- core/images/fold-others-button.tid | 3 +- core/images/folder.tid | 3 +- core/images/full-screen-button.tid | 3 +- core/images/github.tid | 3 +- core/images/gitter.tid | 3 +- core/images/globe.tid | 3 +- core/images/heading-1.tid | 3 +- core/images/heading-2.tid | 3 +- core/images/heading-3.tid | 3 +- core/images/heading-4.tid | 3 +- core/images/heading-5.tid | 3 +- core/images/heading-6.tid | 3 +- core/images/help.tid | 3 +- core/images/home-button.tid | 3 +- core/images/import-button.tid | 3 +- core/images/info-button.tid | 3 +- core/images/italic.tid | 3 +- core/images/layout-button.tid | 3 +- core/images/left-arrow.tid | 3 +- core/images/line-width.tid | 3 +- core/images/link.tid | 3 +- core/images/linkify.tid | 3 +- core/images/list-bullet.tid | 3 +- core/images/list-number.tid | 3 +- core/images/list.tid | 3 +- core/images/locked-padlock.tid | 3 +- core/images/mail.tid | 3 +- core/images/mastodon.tid | 3 +- core/images/menu-button.tid | 3 +- core/images/minus-button.tid | 3 +- core/images/mono-block.tid | 3 +- core/images/mono-line.tid | 3 +- core/images/new-button.tid | 3 +- core/images/new-here-button.tid | 3 +- core/images/new-image-button.tid | 3 +- core/images/new-journal-button.tid | 4 +- core/images/opacity.tid | 3 +- core/images/open-window.tid | 3 +- core/images/options-button.tid | 3 +- core/images/paint.tid | 3 +- core/images/palette.tid | 3 +- core/images/permalink-button.tid | 3 +- core/images/permaview-button.tid | 3 +- core/images/picture.tid | 3 +- core/images/plugin-generic-language.tid | 3 +- core/images/plugin-generic-plugin.tid | 3 +- core/images/plugin-generic-theme.tid | 3 +- core/images/plus-button.tid | 3 +- core/images/preview-closed.tid | 3 +- core/images/preview-open.tid | 3 +- core/images/print-button.tid | 3 +- core/images/quote.tid | 3 +- core/images/refresh-button.tid | 3 +- core/images/right-arrow.tid | 3 +- core/images/rotate-left.tid | 3 +- core/images/save-button-dynamic.tid | 3 +- core/images/save-button.tid | 3 +- core/images/size.tid | 3 +- core/images/spiral.tid | 3 +- core/images/stamp.tid | 3 +- core/images/star-filled.tid | 3 +- core/images/storyview-classic.tid | 3 +- core/images/storyview-pop.tid | 3 +- core/images/storyview-zoomin.tid | 3 +- core/images/strikethrough.tid | 3 +- core/images/subscript.tid | 3 +- core/images/superscript.tid | 3 +- core/images/tag-button.tid | 3 +- core/images/theme-button.tid | 3 +- core/images/timestamp-off.tid | 3 +- core/images/timestamp-on.tid | 3 +- core/images/tip.tid | 3 +- core/images/transcludify.tid | 3 +- core/images/twitter.tid | 3 +- core/images/underline.tid | 3 +- core/images/unfold-all-button.tid | 3 +- core/images/unfold-button.tid | 3 +- core/images/unlocked-padlock.tid | 3 +- core/images/up-arrow.tid | 3 +- core/images/video.tid | 3 +- core/images/warning.tid | 3 +- .../demonstrations/ImageGallery Example.tid | 1 - .../tw5.com/tiddlers/features/Core Icons.tid | 41 +++++++++++++++++++ .../tw5.com/tiddlers/images/Icon Gallery.tid | 2 +- .../tw5.com/tiddlers/images/Reddit Logo.tid | 3 +- .../tiddlers/system/$__SplashScreen.tid | 9 +++- .../images/markdown-linkify.tid | 3 +- .../markdown/images/markdown-linkify.tid | 3 +- 116 files changed, 275 insertions(+), 115 deletions(-) create mode 100644 editions/tw5.com/tiddlers/features/Core Icons.tid diff --git a/core/icon.tid b/core/icon.tid index b327440df..21246d176 100644 --- a/core/icon.tid +++ b/core/icon.tid @@ -1,4 +1,5 @@ title: $:/core/icon tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/add-comment.tid b/core/images/add-comment.tid index 178221806..a118506ed 100644 --- a/core/images/add-comment.tid +++ b/core/images/add-comment.tid @@ -1,4 +1,5 @@ title: $:/core/images/add-comment tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-add-comment tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/advanced-search-button.tid b/core/images/advanced-search-button.tid index 6fda3fe8b..8e5699c4d 100755 --- a/core/images/advanced-search-button.tid +++ b/core/images/advanced-search-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/advanced-search-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-advanced-search-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/auto-height.tid b/core/images/auto-height.tid index 78f95418b..76deecbad 100755 --- a/core/images/auto-height.tid +++ b/core/images/auto-height.tid @@ -1,4 +1,5 @@ title: $:/core/images/auto-height tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-auto-height tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/blank.tid b/core/images/blank.tid index 731b55a5a..565ef6bec 100755 --- a/core/images/blank.tid +++ b/core/images/blank.tid @@ -1,4 +1,5 @@ title: $:/core/images/blank tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-blank tc-image-button" viewBox="0 0 128 128"/> \ No newline at end of file diff --git a/core/images/bold.tid b/core/images/bold.tid index 67a00f894..d9259e4a1 100755 --- a/core/images/bold.tid +++ b/core/images/bold.tid @@ -1,4 +1,5 @@ title: $:/core/images/bold tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-bold tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/cancel-button.tid b/core/images/cancel-button.tid index c55620b06..3bb982bc1 100755 --- a/core/images/cancel-button.tid +++ b/core/images/cancel-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/cancel-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-cancel-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/chevron-down.tid b/core/images/chevron-down.tid index f1b363dfc..df28c87a4 100755 --- a/core/images/chevron-down.tid +++ b/core/images/chevron-down.tid @@ -1,4 +1,5 @@ title: $:/core/images/chevron-down tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-chevron-down tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/chevron-left.tid b/core/images/chevron-left.tid index e4c69d95a..b7f9ad7ae 100755 --- a/core/images/chevron-left.tid +++ b/core/images/chevron-left.tid @@ -1,4 +1,5 @@ title: $:/core/images/chevron-left tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-chevron-left tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/chevron-right.tid b/core/images/chevron-right.tid index 6ff5b6c0d..9ec7c96fe 100755 --- a/core/images/chevron-right.tid +++ b/core/images/chevron-right.tid @@ -1,4 +1,5 @@ title: $:/core/images/chevron-right tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-chevron-right tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/chevron-up.tid b/core/images/chevron-up.tid index 9acbdec40..45366f286 100755 --- a/core/images/chevron-up.tid +++ b/core/images/chevron-up.tid @@ -1,4 +1,5 @@ title: $:/core/images/chevron-up tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-chevron-up tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/clone-button.tid b/core/images/clone-button.tid index 9ff4903ad..cc0ed7595 100755 --- a/core/images/clone-button.tid +++ b/core/images/clone-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/clone-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-clone-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/close-all-button.tid b/core/images/close-all-button.tid index 3334c5dbc..02d25fa6f 100755 --- a/core/images/close-all-button.tid +++ b/core/images/close-all-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/close-all-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-close-all-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/close-button.tid b/core/images/close-button.tid index c462c9bac..a05669ccd 100755 --- a/core/images/close-button.tid +++ b/core/images/close-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/close-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-close-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/close-others-button.tid b/core/images/close-others-button.tid index 1cd54d797..6eb779018 100755 --- a/core/images/close-others-button.tid +++ b/core/images/close-others-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/close-others-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-close-others-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/copy-clipboard.tid b/core/images/copy-clipboard.tid index e4e55b6e9..d6514ad7c 100644 --- a/core/images/copy-clipboard.tid +++ b/core/images/copy-clipboard.tid @@ -1,4 +1,5 @@ title: $:/core/images/copy-clipboard tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-copy-clipboard tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/delete-button.tid b/core/images/delete-button.tid index e8c9b6108..99f83b3ba 100755 --- a/core/images/delete-button.tid +++ b/core/images/delete-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/delete-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-delete-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/done-button.tid b/core/images/done-button.tid index 265528d06..7672b7d27 100755 --- a/core/images/done-button.tid +++ b/core/images/done-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/done-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-done-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/down-arrow.tid b/core/images/down-arrow.tid index 4cac65a00..7f1273b2c 100755 --- a/core/images/down-arrow.tid +++ b/core/images/down-arrow.tid @@ -1,4 +1,5 @@ title: $:/core/images/down-arrow tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-down-arrow tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/download-button.tid b/core/images/download-button.tid index e3a549639..8b06356ab 100755 --- a/core/images/download-button.tid +++ b/core/images/download-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/download-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-download-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/edit-button.tid b/core/images/edit-button.tid index 190dffc41..e4644ef7c 100755 --- a/core/images/edit-button.tid +++ b/core/images/edit-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/edit-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-edit-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/erase.tid b/core/images/erase.tid index 22b31e7cc..6cc2011a9 100755 --- a/core/images/erase.tid +++ b/core/images/erase.tid @@ -1,4 +1,5 @@ title: $:/core/images/erase tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-erase tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/excise.tid b/core/images/excise.tid index e6c2c9404..fa351baff 100755 --- a/core/images/excise.tid +++ b/core/images/excise.tid @@ -1,4 +1,5 @@ title: $:/core/images/excise tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-excise tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/export-button.tid b/core/images/export-button.tid index eb3284c80..b9f0dca7f 100755 --- a/core/images/export-button.tid +++ b/core/images/export-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/export-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-export-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/file.tid b/core/images/file.tid index 67ebc22ac..682796fbf 100755 --- a/core/images/file.tid +++ b/core/images/file.tid @@ -1,4 +1,5 @@ title: $:/core/images/file tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-file tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/fixed-height.tid b/core/images/fixed-height.tid index c15162267..b2b5083b9 100755 --- a/core/images/fixed-height.tid +++ b/core/images/fixed-height.tid @@ -1,4 +1,5 @@ title: $:/core/images/fixed-height tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-fixed-height tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/fold-all-button.tid b/core/images/fold-all-button.tid index edff8b22b..260efe9b8 100755 --- a/core/images/fold-all-button.tid +++ b/core/images/fold-all-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/fold-all-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-fold-all tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/fold-button.tid b/core/images/fold-button.tid index f0b2b474d..cfc2291a5 100755 --- a/core/images/fold-button.tid +++ b/core/images/fold-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/fold-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-fold tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/fold-others-button.tid b/core/images/fold-others-button.tid index 5cb086f85..a5457c461 100755 --- a/core/images/fold-others-button.tid +++ b/core/images/fold-others-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/fold-others-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-fold-others tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/folder.tid b/core/images/folder.tid index 4b89418ff..8c5d7efb1 100755 --- a/core/images/folder.tid +++ b/core/images/folder.tid @@ -1,4 +1,5 @@ title: $:/core/images/folder tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-folder tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/full-screen-button.tid b/core/images/full-screen-button.tid index 8572ff646..7e20183b7 100755 --- a/core/images/full-screen-button.tid +++ b/core/images/full-screen-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/full-screen-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-full-screen-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/github.tid b/core/images/github.tid index 6389f5cdc..b82c54e72 100755 --- a/core/images/github.tid +++ b/core/images/github.tid @@ -1,4 +1,5 @@ title: $:/core/images/github tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-github tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/gitter.tid b/core/images/gitter.tid index 876fc3da1..4af54ddba 100644 --- a/core/images/gitter.tid +++ b/core/images/gitter.tid @@ -1,4 +1,5 @@ title: $:/core/images/gitter tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-gitter tc-image-button" viewBox="0 0 18 25"> \ No newline at end of file diff --git a/core/images/globe.tid b/core/images/globe.tid index 9448ed7a4..0e2c56b40 100755 --- a/core/images/globe.tid +++ b/core/images/globe.tid @@ -1,4 +1,5 @@ title: $:/core/images/globe tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-globe tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/heading-1.tid b/core/images/heading-1.tid index f8a98123b..d160284c9 100755 --- a/core/images/heading-1.tid +++ b/core/images/heading-1.tid @@ -1,4 +1,5 @@ title: $:/core/images/heading-1 tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-heading-1 tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/heading-2.tid b/core/images/heading-2.tid index ef0022cc6..8daad0f10 100755 --- a/core/images/heading-2.tid +++ b/core/images/heading-2.tid @@ -1,4 +1,5 @@ title: $:/core/images/heading-2 tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-heading-2 tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/heading-3.tid b/core/images/heading-3.tid index d706d067b..8a489e799 100755 --- a/core/images/heading-3.tid +++ b/core/images/heading-3.tid @@ -1,4 +1,5 @@ title: $:/core/images/heading-3 tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-heading-3 tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/heading-4.tid b/core/images/heading-4.tid index 16d4440db..5aee3f3f8 100755 --- a/core/images/heading-4.tid +++ b/core/images/heading-4.tid @@ -1,4 +1,5 @@ title: $:/core/images/heading-4 tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-heading-4 tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/heading-5.tid b/core/images/heading-5.tid index 8f34b7058..c9a54a335 100755 --- a/core/images/heading-5.tid +++ b/core/images/heading-5.tid @@ -1,4 +1,5 @@ title: $:/core/images/heading-5 tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-heading-5 tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/heading-6.tid b/core/images/heading-6.tid index b348c70af..1034e7116 100755 --- a/core/images/heading-6.tid +++ b/core/images/heading-6.tid @@ -1,4 +1,5 @@ title: $:/core/images/heading-6 tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-heading-6 tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/help.tid b/core/images/help.tid index 07167ae93..5c0cf13ab 100755 --- a/core/images/help.tid +++ b/core/images/help.tid @@ -1,4 +1,5 @@ title: $:/core/images/help tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-help tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/home-button.tid b/core/images/home-button.tid index 10c00626a..952ab9a60 100755 --- a/core/images/home-button.tid +++ b/core/images/home-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/home-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-home-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/import-button.tid b/core/images/import-button.tid index 6850513ef..a42c416e5 100755 --- a/core/images/import-button.tid +++ b/core/images/import-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/import-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-import-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/info-button.tid b/core/images/info-button.tid index 2679a135a..e8f8e98c4 100755 --- a/core/images/info-button.tid +++ b/core/images/info-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/info-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-info-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/italic.tid b/core/images/italic.tid index 06aada589..766d3707a 100755 --- a/core/images/italic.tid +++ b/core/images/italic.tid @@ -1,4 +1,5 @@ title: $:/core/images/italic tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-italic tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/layout-button.tid b/core/images/layout-button.tid index 19371cde1..a859edbc5 100755 --- a/core/images/layout-button.tid +++ b/core/images/layout-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/layout-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-layout-button tc-image-button" viewBox="0 0 24 24" stroke-width="1" stroke="none"> \ No newline at end of file diff --git a/core/images/left-arrow.tid b/core/images/left-arrow.tid index a418581cd..b64fc2ab6 100755 --- a/core/images/left-arrow.tid +++ b/core/images/left-arrow.tid @@ -3,4 +3,5 @@ modified: 20150315235324760 tags: $:/tags/Image title: $:/core/images/left-arrow - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-left-arrow tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/line-width.tid b/core/images/line-width.tid index f77763ce6..9cecc33cb 100755 --- a/core/images/line-width.tid +++ b/core/images/line-width.tid @@ -1,4 +1,5 @@ title: $:/core/images/line-width tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-line-width tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/link.tid b/core/images/link.tid index 395307c42..c1d134f7e 100644 --- a/core/images/link.tid +++ b/core/images/link.tid @@ -1,4 +1,5 @@ title: $:/core/images/link tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-link tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/linkify.tid b/core/images/linkify.tid index 40acdc19a..d616c2ac9 100644 --- a/core/images/linkify.tid +++ b/core/images/linkify.tid @@ -1,4 +1,5 @@ title: $:/core/images/linkify tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-linkify-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/list-bullet.tid b/core/images/list-bullet.tid index 322dd4ae6..065d96c4f 100755 --- a/core/images/list-bullet.tid +++ b/core/images/list-bullet.tid @@ -1,4 +1,5 @@ title: $:/core/images/list-bullet tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-list-bullet tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/list-number.tid b/core/images/list-number.tid index 161917823..b70d4db15 100755 --- a/core/images/list-number.tid +++ b/core/images/list-number.tid @@ -1,4 +1,5 @@ title: $:/core/images/list-number tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-list-number tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/list.tid b/core/images/list.tid index 22b784bfe..793b47957 100644 --- a/core/images/list.tid +++ b/core/images/list.tid @@ -1,4 +1,5 @@ title: $:/core/images/list tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-list tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/locked-padlock.tid b/core/images/locked-padlock.tid index 14d95560c..f6722cddd 100755 --- a/core/images/locked-padlock.tid +++ b/core/images/locked-padlock.tid @@ -1,4 +1,5 @@ title: $:/core/images/locked-padlock tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-locked-padlock tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/mail.tid b/core/images/mail.tid index cf0f4eab7..9d46d6eff 100755 --- a/core/images/mail.tid +++ b/core/images/mail.tid @@ -1,4 +1,5 @@ title: $:/core/images/mail tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-mail tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/mastodon.tid b/core/images/mastodon.tid index b27c751fd..a6b41d355 100644 --- a/core/images/mastodon.tid +++ b/core/images/mastodon.tid @@ -1,6 +1,7 @@ title: $:/core/images/mastodon tags: $:/tags/Image - +\parameters (size:"22pt") +> height=<> class="tc-image-mastodon tc-image-button" viewBox="0 0 128 128"> diff --git a/core/images/menu-button.tid b/core/images/menu-button.tid index 6d1872e4c..958721d31 100755 --- a/core/images/menu-button.tid +++ b/core/images/menu-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/menu-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-menu-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/minus-button.tid b/core/images/minus-button.tid index 7132ed3e9..40ee75a8e 100644 --- a/core/images/minus-button.tid +++ b/core/images/minus-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/minus-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-minus-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/mono-block.tid b/core/images/mono-block.tid index f8695302b..bf58400aa 100755 --- a/core/images/mono-block.tid +++ b/core/images/mono-block.tid @@ -1,4 +1,5 @@ title: $:/core/images/mono-block tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-mono-block tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/mono-line.tid b/core/images/mono-line.tid index 09cfe513e..1ab73b829 100755 --- a/core/images/mono-line.tid +++ b/core/images/mono-line.tid @@ -1,4 +1,5 @@ title: $:/core/images/mono-line tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-mono-line tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/new-button.tid b/core/images/new-button.tid index 6e592ada9..d4cfd34f6 100755 --- a/core/images/new-button.tid +++ b/core/images/new-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/new-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-new-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/new-here-button.tid b/core/images/new-here-button.tid index ab0f7a6f3..8e304f5e7 100755 --- a/core/images/new-here-button.tid +++ b/core/images/new-here-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/new-here-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-new-here-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/new-image-button.tid b/core/images/new-image-button.tid index 16b63c3c3..53b10d481 100755 --- a/core/images/new-image-button.tid +++ b/core/images/new-image-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/new-image-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-new-image-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/new-journal-button.tid b/core/images/new-journal-button.tid index fb67c8007..3b04d5786 100755 --- a/core/images/new-journal-button.tid +++ b/core/images/new-journal-button.tid @@ -1,4 +1,6 @@ title: $:/core/images/new-journal-button tags: $:/tags/Image -<> \ No newline at end of file +<$parameters size="22pt" day=<>> +> height=<> class="tc-image-new-journal-button tc-image-button" viewBox="0 0 128 128"><$text text=<>/> + \ No newline at end of file diff --git a/core/images/opacity.tid b/core/images/opacity.tid index e9a29aea2..0211644f9 100755 --- a/core/images/opacity.tid +++ b/core/images/opacity.tid @@ -1,4 +1,5 @@ title: $:/core/images/opacity tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-opacity tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/open-window.tid b/core/images/open-window.tid index 14b556484..d918b1fc8 100755 --- a/core/images/open-window.tid +++ b/core/images/open-window.tid @@ -1,4 +1,5 @@ title: $:/core/images/open-window tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-open-window tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/options-button.tid b/core/images/options-button.tid index bd0ffcb1a..18fbf8b00 100755 --- a/core/images/options-button.tid +++ b/core/images/options-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/options-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-options-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/paint.tid b/core/images/paint.tid index bb536b53a..660fda2bf 100755 --- a/core/images/paint.tid +++ b/core/images/paint.tid @@ -1,4 +1,5 @@ title: $:/core/images/paint tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-paint tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/palette.tid b/core/images/palette.tid index d605fd853..1c7903549 100755 --- a/core/images/palette.tid +++ b/core/images/palette.tid @@ -1,4 +1,5 @@ title: $:/core/images/palette tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-palette tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/permalink-button.tid b/core/images/permalink-button.tid index e8fd0aecd..f1cf38b41 100755 --- a/core/images/permalink-button.tid +++ b/core/images/permalink-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/permalink-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-permalink-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/permaview-button.tid b/core/images/permaview-button.tid index b2ad9a408..82e533475 100755 --- a/core/images/permaview-button.tid +++ b/core/images/permaview-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/permaview-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-permaview-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/picture.tid b/core/images/picture.tid index 7d035e2fc..2af427e2e 100755 --- a/core/images/picture.tid +++ b/core/images/picture.tid @@ -1,4 +1,5 @@ title: $:/core/images/picture tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-picture tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/plugin-generic-language.tid b/core/images/plugin-generic-language.tid index 5c777d98d..d663d1563 100755 --- a/core/images/plugin-generic-language.tid +++ b/core/images/plugin-generic-language.tid @@ -1,4 +1,5 @@ title: $:/core/images/plugin-generic-language tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> viewBox="0 0 128 128" class="tc-image-plugin-generic-language tc-image-button"> \ No newline at end of file diff --git a/core/images/plugin-generic-plugin.tid b/core/images/plugin-generic-plugin.tid index ab2e6670e..06073dd7c 100755 --- a/core/images/plugin-generic-plugin.tid +++ b/core/images/plugin-generic-plugin.tid @@ -1,4 +1,5 @@ title: $:/core/images/plugin-generic-plugin tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> viewBox="0 0 128 128" class="tc-image-plugin-generic-plugin tc-image-button"> \ No newline at end of file diff --git a/core/images/plugin-generic-theme.tid b/core/images/plugin-generic-theme.tid index 9ae3cd779..ab899b3e4 100755 --- a/core/images/plugin-generic-theme.tid +++ b/core/images/plugin-generic-theme.tid @@ -1,4 +1,5 @@ title: $:/core/images/plugin-generic-theme tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> viewBox="0 0 128 128" class="tc-image-plugin-generic-theme tc-image-button"> \ No newline at end of file diff --git a/core/images/plus-button.tid b/core/images/plus-button.tid index b001f3e2f..c9a696d43 100644 --- a/core/images/plus-button.tid +++ b/core/images/plus-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/plus-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-plus-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/preview-closed.tid b/core/images/preview-closed.tid index 5986d8966..cf17730d5 100755 --- a/core/images/preview-closed.tid +++ b/core/images/preview-closed.tid @@ -1,4 +1,5 @@ title: $:/core/images/preview-closed tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-preview-closed tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/preview-open.tid b/core/images/preview-open.tid index 4664990b4..cb30bf474 100755 --- a/core/images/preview-open.tid +++ b/core/images/preview-open.tid @@ -1,4 +1,5 @@ title: $:/core/images/preview-open tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-preview-open tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/print-button.tid b/core/images/print-button.tid index 55b33c896..12bffd41d 100644 --- a/core/images/print-button.tid +++ b/core/images/print-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/print-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-print-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/quote.tid b/core/images/quote.tid index 7134306a6..0c4fcf25a 100755 --- a/core/images/quote.tid +++ b/core/images/quote.tid @@ -1,4 +1,5 @@ title: $:/core/images/quote tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-quote tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/refresh-button.tid b/core/images/refresh-button.tid index 2422b0679..f8e3fc69e 100755 --- a/core/images/refresh-button.tid +++ b/core/images/refresh-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/refresh-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-refresh-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/right-arrow.tid b/core/images/right-arrow.tid index 42e7dea56..64f839b55 100755 --- a/core/images/right-arrow.tid +++ b/core/images/right-arrow.tid @@ -1,4 +1,5 @@ title: $:/core/images/right-arrow tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-right-arrow tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/rotate-left.tid b/core/images/rotate-left.tid index 188d3b45c..da6034b19 100644 --- a/core/images/rotate-left.tid +++ b/core/images/rotate-left.tid @@ -1,4 +1,5 @@ title: $:/core/images/rotate-left tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-rotate-left tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/save-button-dynamic.tid b/core/images/save-button-dynamic.tid index d0aa13f83..7a351d617 100644 --- a/core/images/save-button-dynamic.tid +++ b/core/images/save-button-dynamic.tid @@ -1,7 +1,8 @@ title: $:/core/images/save-button-dynamic tags: $:/tags/Image - +\parameters (size:"22pt") +> height=<> class="tc-image-save-button-dynamic tc-image-button" viewBox="0 0 128 128"> diff --git a/core/images/save-button.tid b/core/images/save-button.tid index a66756616..912ad248c 100755 --- a/core/images/save-button.tid +++ b/core/images/save-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/save-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-save-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/size.tid b/core/images/size.tid index db84ecf9b..ea9aa1094 100755 --- a/core/images/size.tid +++ b/core/images/size.tid @@ -1,4 +1,5 @@ title: $:/core/images/size tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-size tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/spiral.tid b/core/images/spiral.tid index ca4684cab..f3a5271ac 100755 --- a/core/images/spiral.tid +++ b/core/images/spiral.tid @@ -1,4 +1,5 @@ title: $:/core/images/spiral tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-spiral tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/stamp.tid b/core/images/stamp.tid index ba385aaae..8511a457f 100755 --- a/core/images/stamp.tid +++ b/core/images/stamp.tid @@ -1,4 +1,5 @@ title: $:/core/images/stamp tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-stamp tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/star-filled.tid b/core/images/star-filled.tid index 10b8f1c3d..262448d51 100755 --- a/core/images/star-filled.tid +++ b/core/images/star-filled.tid @@ -1,4 +1,5 @@ title: $:/core/images/star-filled tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-star-filled tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/storyview-classic.tid b/core/images/storyview-classic.tid index 86872817b..457434bc9 100755 --- a/core/images/storyview-classic.tid +++ b/core/images/storyview-classic.tid @@ -1,4 +1,5 @@ title: $:/core/images/storyview-classic tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-storyview-classic tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/storyview-pop.tid b/core/images/storyview-pop.tid index a610c89d5..a4a9fb9ee 100755 --- a/core/images/storyview-pop.tid +++ b/core/images/storyview-pop.tid @@ -1,4 +1,5 @@ title: $:/core/images/storyview-pop tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-storyview-pop tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/storyview-zoomin.tid b/core/images/storyview-zoomin.tid index 61b7ff273..725f36e71 100755 --- a/core/images/storyview-zoomin.tid +++ b/core/images/storyview-zoomin.tid @@ -1,4 +1,5 @@ title: $:/core/images/storyview-zoomin tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-storyview-zoomin tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/strikethrough.tid b/core/images/strikethrough.tid index 1f7a1c202..de4eefeec 100755 --- a/core/images/strikethrough.tid +++ b/core/images/strikethrough.tid @@ -1,4 +1,5 @@ title: $:/core/images/strikethrough tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-strikethrough tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/subscript.tid b/core/images/subscript.tid index 96548bdb5..76ec35399 100755 --- a/core/images/subscript.tid +++ b/core/images/subscript.tid @@ -1,4 +1,5 @@ title: $:/core/images/subscript tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-subscript tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/superscript.tid b/core/images/superscript.tid index 149e44893..ab0d0d1b2 100755 --- a/core/images/superscript.tid +++ b/core/images/superscript.tid @@ -1,4 +1,5 @@ title: $:/core/images/superscript tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-superscript tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/tag-button.tid b/core/images/tag-button.tid index 9f6cad8b4..ab407f780 100755 --- a/core/images/tag-button.tid +++ b/core/images/tag-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/tag-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-tag-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/theme-button.tid b/core/images/theme-button.tid index d80a0e82a..6b7aab2af 100755 --- a/core/images/theme-button.tid +++ b/core/images/theme-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/theme-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-theme-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/timestamp-off.tid b/core/images/timestamp-off.tid index 0d20f28d6..33e018f3a 100644 --- a/core/images/timestamp-off.tid +++ b/core/images/timestamp-off.tid @@ -1,4 +1,5 @@ title: $:/core/images/timestamp-off tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-timestamp-off tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/timestamp-on.tid b/core/images/timestamp-on.tid index 3a16df7eb..cad04aada 100644 --- a/core/images/timestamp-on.tid +++ b/core/images/timestamp-on.tid @@ -1,4 +1,5 @@ title: $:/core/images/timestamp-on tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-timestamp-on tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/tip.tid b/core/images/tip.tid index f8109ada4..025918306 100755 --- a/core/images/tip.tid +++ b/core/images/tip.tid @@ -1,4 +1,5 @@ title: $:/core/images/tip tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-tip tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/transcludify.tid b/core/images/transcludify.tid index 0579feb10..5102d1370 100644 --- a/core/images/transcludify.tid +++ b/core/images/transcludify.tid @@ -1,4 +1,5 @@ title: $:/core/images/transcludify tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-transcludify-button tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/twitter.tid b/core/images/twitter.tid index 28cfccdbd..e3ae13dc1 100755 --- a/core/images/twitter.tid +++ b/core/images/twitter.tid @@ -1,4 +1,5 @@ title: $:/core/images/twitter tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-twitter tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/underline.tid b/core/images/underline.tid index 768d2a199..341b27cfa 100755 --- a/core/images/underline.tid +++ b/core/images/underline.tid @@ -1,4 +1,5 @@ title: $:/core/images/underline tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-underline tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/unfold-all-button.tid b/core/images/unfold-all-button.tid index e496bdd89..e44000b18 100755 --- a/core/images/unfold-all-button.tid +++ b/core/images/unfold-all-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/unfold-all-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-unfold-all tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/unfold-button.tid b/core/images/unfold-button.tid index cfad70570..57f53fd6f 100755 --- a/core/images/unfold-button.tid +++ b/core/images/unfold-button.tid @@ -1,4 +1,5 @@ title: $:/core/images/unfold-button tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-unfold tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/unlocked-padlock.tid b/core/images/unlocked-padlock.tid index c5367c085..941f7bec5 100755 --- a/core/images/unlocked-padlock.tid +++ b/core/images/unlocked-padlock.tid @@ -1,4 +1,5 @@ title: $:/core/images/unlocked-padlock tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-unlocked-padlock tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/up-arrow.tid b/core/images/up-arrow.tid index a1bd132bf..4d157352b 100755 --- a/core/images/up-arrow.tid +++ b/core/images/up-arrow.tid @@ -3,4 +3,5 @@ modified: 20150316000831867 tags: $:/tags/Image title: $:/core/images/up-arrow - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-up-arrow tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/video.tid b/core/images/video.tid index 3bf0bb259..b4fef628d 100755 --- a/core/images/video.tid +++ b/core/images/video.tid @@ -1,4 +1,5 @@ title: $:/core/images/video tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-video tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/core/images/warning.tid b/core/images/warning.tid index 53bff59ec..1822da89f 100755 --- a/core/images/warning.tid +++ b/core/images/warning.tid @@ -1,4 +1,5 @@ title: $:/core/images/warning tags: $:/tags/Image - \ No newline at end of file +\parameters (size:"22pt") +> height=<> class="tc-image-warning tc-image-button" viewBox="0 0 128 128"> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/demonstrations/ImageGallery Example.tid b/editions/tw5.com/tiddlers/demonstrations/ImageGallery Example.tid index c9df4ac0b..e702b16b7 100644 --- a/editions/tw5.com/tiddlers/demonstrations/ImageGallery Example.tid +++ b/editions/tw5.com/tiddlers/demonstrations/ImageGallery Example.tid @@ -1,6 +1,5 @@ created: 20140809113603449 modified: 20211022195248529 -tags: Learning title: ImageGallery Example type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/features/Core Icons.tid b/editions/tw5.com/tiddlers/features/Core Icons.tid new file mode 100644 index 000000000..9799f48d7 --- /dev/null +++ b/editions/tw5.com/tiddlers/features/Core Icons.tid @@ -0,0 +1,41 @@ +title: Core Icons +tags: Features +modified: 20230423103154329 +created: 20230423103154329 + + +!! Introduction + +TiddlyWiki includes over 100 custom vector icons. They feature in the user interface and are also available for authors to use in their own applications. See [[Icon Gallery]] for a complete listing. + +!! Usage + +The core icons are used by transcluding them. For example: + +<> + +The core icons are parameterised. The first parameter `size` specified the size at which the icon should be rendered: + +< +""">> + +Here is an example of dynamically resizing icons: + +< +<$text text={{{ [addsuffix[px]] }}} /> +<$transclude $tiddler="$:/core/icon" size=<>/> + +""">> + +Some icons take further parameters to customise how they are rendered. For example, the $:/core/images/new-journal-button icon takes an additional parameter `day` that specifies the day of the month that should be shown on the calendar. It defaults to the current date if not specified + +< +""">> + +The core icons are implemented as embedded [[SVG elements|Using SVG]], and not as full-blown SVG images. This means that they can be styled using CSS. For example, the CSS property `fill` can be used to change the colour of the icons. For example: + +<{{$:/core/images/opacity}} +""">> diff --git a/editions/tw5.com/tiddlers/images/Icon Gallery.tid b/editions/tw5.com/tiddlers/images/Icon Gallery.tid index 9985cbc0f..acd710a05 100644 --- a/editions/tw5.com/tiddlers/images/Icon Gallery.tid +++ b/editions/tw5.com/tiddlers/images/Icon Gallery.tid @@ -1,6 +1,6 @@ created: 20211013132515594 modified: 20211018102307833 -tags: Learning +tags: Learning [[Core Icons]] title: Icon Gallery type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/images/Reddit Logo.tid b/editions/tw5.com/tiddlers/images/Reddit Logo.tid index 76bb6bf7c..f4153ebb0 100644 --- a/editions/tw5.com/tiddlers/images/Reddit Logo.tid +++ b/editions/tw5.com/tiddlers/images/Reddit Logo.tid @@ -1,6 +1,7 @@ title: Reddit Logo - +\parameters (size:"22pt") +> height=<> viewBox="0 0 20 20"> diff --git a/editions/tw5.com/tiddlers/system/$__SplashScreen.tid b/editions/tw5.com/tiddlers/system/$__SplashScreen.tid index 7d632140f..044b6446e 100644 --- a/editions/tw5.com/tiddlers/system/$__SplashScreen.tid +++ b/editions/tw5.com/tiddlers/system/$__SplashScreen.tid @@ -5,6 +5,13 @@ title: $:/SplashScreen type: text/vnd.tiddlywiki \import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] + +\procedure show-icon(title) +<$wikify name="icon" text={{{ [addprefix[{{]addsuffix[}}]] }}} output="html"> +<$text text=<>/> + +\end + \rules only filteredtranscludeinline transcludeinline macrocallinline