diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 737d523ef..ed16d707d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,17 +5,17 @@ on: - master - tiddlywiki-com env: - NODE_VERSION: "18" + NODE_VERSION: "22" jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "${{ env.NODE_VERSION }}" - run: "./bin/ci-test.sh" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: playwright-report @@ -30,8 +30,8 @@ jobs: TW5_BUILD_MAIN_EDITION: "./editions/prerelease" TW5_BUILD_OUTPUT: "./output/prerelease" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "${{ env.NODE_VERSION }}" - run: "./bin/ci-pre-build.sh" @@ -62,8 +62,8 @@ jobs: TW5_BUILD_OUTPUT: "./output" TW5_BUILD_ARCHIVE: "./output" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "${{ env.NODE_VERSION }}" - run: "./bin/ci-pre-build.sh" diff --git a/bin/build-site.sh b/bin/build-site.sh index 31cf171d0..7ddc180bd 100755 --- a/bin/build-site.sh +++ b/bin/build-site.sh @@ -5,7 +5,7 @@ # Default to the current version number for building the plugin library if [ -z "$TW5_BUILD_VERSION" ]; then - TW5_BUILD_VERSION=v5.3.6 + TW5_BUILD_VERSION=v5.3.7 fi echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]" @@ -97,7 +97,6 @@ if [ -n "$TW5_BUILD_ARCHIVE" ]; then node $TW5_BUILD_TIDDLYWIKI \ $TW5_BUILD_MAIN_EDITION \ - --verbose \ --version \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_ARCHIVE \ @@ -106,6 +105,7 @@ node $TW5_BUILD_TIDDLYWIKI \ fi # /index.html Main site +# /external-(version).html External core version of main site # /favicon.ico Favicon for main site # /static.html Static rendering of default tiddlers # /alltiddlers.html Static rendering of all tiddlers @@ -115,11 +115,10 @@ fi node $TW5_BUILD_TIDDLYWIKI \ $TW5_BUILD_MAIN_EDITION \ - --verbose \ --version \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ - --build favicon static index \ + --build favicon static index external-js \ || exit 1 # /empty.html Empty @@ -128,7 +127,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /tiddlywikicore-.js Core plugin javascript node $TW5_BUILD_TIDDLYWIKI \ ./editions/empty \ - --verbose \ --output $TW5_BUILD_OUTPUT \ --build empty emptyexternalcore \ || exit 1 @@ -137,7 +135,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /test.html Test edition node $TW5_BUILD_TIDDLYWIKI \ ./editions/test \ - --verbose \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all test.html text/plain \ || exit 1 @@ -150,7 +147,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /dev/static/static.css Static stylesheet node $TW5_BUILD_TIDDLYWIKI \ ./editions/dev \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/dev \ --build index favicon static \ @@ -159,7 +155,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /tour.html tour edition node $TW5_BUILD_TIDDLYWIKI \ ./editions/tour \ - --verbose \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all tour.html text/plain \ || exit 1 @@ -167,7 +162,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /share.html Custom edition for sharing via the URL node $TW5_BUILD_TIDDLYWIKI \ ./editions/share \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --build share \ @@ -176,7 +170,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /upgrade.html Custom edition for performing upgrades node $TW5_BUILD_TIDDLYWIKI \ ./editions/upgrade \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --build upgrade \ @@ -185,7 +178,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /encrypted.html Copy of the main file encrypted with the password "password" node $TW5_BUILD_TIDDLYWIKI \ $TW5_BUILD_MAIN_EDITION \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --build encrypted \ @@ -201,7 +193,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /editions/xlsx-utils/index.html xlsx-utils edition node $TW5_BUILD_TIDDLYWIKI \ ./editions/xlsx-utils \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/editions/xlsx-utils/ \ --build index \ @@ -210,7 +201,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /editions/resumebuilder/index.html Resume builder edition node $TW5_BUILD_TIDDLYWIKI \ ./editions/resumebuilder \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/editions/resumebuilder/ \ --build index \ @@ -219,7 +209,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /editions/text-slicer/index.html Text slicer edition node $TW5_BUILD_TIDDLYWIKI \ ./editions/text-slicer \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/editions/text-slicer/ \ --build index \ @@ -228,7 +217,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /editions/translators/index.html Translators edition node $TW5_BUILD_TIDDLYWIKI \ ./editions/translators \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/editions/translators/ \ --build index \ @@ -237,7 +225,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /editions/introduction/index.html Introduction edition node $TW5_BUILD_TIDDLYWIKI \ ./editions/introduction \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/editions/introduction/ \ --build index \ @@ -246,7 +233,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /editions/full/index.html Full edition node $TW5_BUILD_TIDDLYWIKI \ ./editions/full \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/editions/full/ \ --build index \ @@ -255,7 +241,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /editions/tw5.com-docs/index.html tiddlywiki.com docs edition node $TW5_BUILD_TIDDLYWIKI \ ./editions/tw5.com-docs \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/editions/tw5.com-docs/ \ --build index \ @@ -264,7 +249,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /editions/twitter-archivist/index.html Twitter Archivist edition node $TW5_BUILD_TIDDLYWIKI \ ./editions/twitter-archivist \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/editions/twitter-archivist/ \ --build index \ @@ -280,7 +264,6 @@ node $TW5_BUILD_TIDDLYWIKI \ node $TW5_BUILD_TIDDLYWIKI \ ./editions/innerwikidemo \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all plugins/tiddlywiki/innerwiki/index.html text/plain \ @@ -291,7 +274,6 @@ node $TW5_BUILD_TIDDLYWIKI \ node $TW5_BUILD_TIDDLYWIKI \ ./editions/dynaviewdemo \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all plugins/tiddlywiki/dynaview/index.html text/plain \ @@ -306,7 +288,6 @@ node $TW5_BUILD_TIDDLYWIKI \ node $TW5_BUILD_TIDDLYWIKI \ ./editions/katexdemo \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all plugins/tiddlywiki/katex/index.html text/plain \ @@ -317,7 +298,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /plugins/tiddlywiki/tahoelafs/empty.html Empty wiki with Tahoe-LAFS plugin node $TW5_BUILD_TIDDLYWIKI \ ./editions/tahoelafs \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all plugins/tiddlywiki/tahoelafs/index.html text/plain \ @@ -328,7 +308,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /plugins/tiddlywiki/d3/empty.html Empty wiki with D3 plugin node $TW5_BUILD_TIDDLYWIKI \ ./editions/d3demo \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all plugins/tiddlywiki/d3/index.html text/plain \ @@ -339,7 +318,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /plugins/tiddlywiki/codemirror/empty.html Empty wiki with codemirror plugin node $TW5_BUILD_TIDDLYWIKI \ ./editions/codemirrordemo \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all plugins/tiddlywiki/codemirror/index.html text/plain \ @@ -350,7 +328,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /plugins/tiddlywiki/markdown/empty.html Empty wiki with Markdown plugin node $TW5_BUILD_TIDDLYWIKI \ ./editions/markdowndemo \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all plugins/tiddlywiki/markdown/index.html text/plain \ @@ -361,7 +338,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /plugins/tiddlywiki/tw2parser/empty.html Empty wiki with tw2parser plugin node $TW5_BUILD_TIDDLYWIKI \ ./editions/classicparserdemo \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all plugins/tiddlywiki/tw2parser/index.html text/plain \ @@ -372,7 +348,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /plugins/tiddlywiki/highlight/empty.html Empty wiki with highlight plugin node $TW5_BUILD_TIDDLYWIKI \ ./editions/highlightdemo \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all plugins/tiddlywiki/highlight/index.html text/plain \ @@ -383,7 +358,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /plugins/tiddlywiki/geospatial/empty.html Empty wiki with geospatial plugin node $TW5_BUILD_TIDDLYWIKI \ ./editions/geospatialdemo \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --rendertiddler $:/core/save/all plugins/tiddlywiki/geospatial/index.html text/plain \ @@ -411,7 +385,6 @@ rm -rf $TW5_BUILD_OUTPUT/languages/zh-Hant/static/* # /languages/de-AT/empty.html Empty wiki with de-AT language node $TW5_BUILD_TIDDLYWIKI \ ./editions/de-AT \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/languages/de-AT \ --build favicon empty static index \ @@ -421,7 +394,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /languages/de-DE/empty.html Empty wiki with de-DE language node $TW5_BUILD_TIDDLYWIKI \ ./editions/de-DE \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/languages/de-DE \ --build favicon empty static index \ @@ -431,7 +403,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /languages/es-ES/empty.html Empty wiki with es-ES language node $TW5_BUILD_TIDDLYWIKI \ ./editions/es-ES \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/languages/es-ES \ --build favicon empty static index \ @@ -441,7 +412,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /languages/fr-FR/empty.html Empty wiki with fr-FR language node $TW5_BUILD_TIDDLYWIKI \ ./editions/fr-FR \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/languages/fr-FR \ --build favicon empty static index \ @@ -451,7 +421,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /languages/ja-JP/empty.html Empty wiki with ja-JP language node $TW5_BUILD_TIDDLYWIKI \ ./editions/ja-JP \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/languages/ja-JP \ --build empty index \ @@ -461,7 +430,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /languages/ko-KR/empty.html Empty wiki with ko-KR language node $TW5_BUILD_TIDDLYWIKI \ ./editions/ko-KR \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/languages/ko-KR \ --build favicon empty static index \ @@ -471,7 +439,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /languages/zh-Hans/empty.html Empty wiki with zh-Hans language node $TW5_BUILD_TIDDLYWIKI \ ./editions/zh-Hans \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/languages/zh-Hans \ --build empty index \ @@ -481,7 +448,6 @@ node $TW5_BUILD_TIDDLYWIKI \ # /languages/zh-Hant/empty.html Empty wiki with zh-Hant language node $TW5_BUILD_TIDDLYWIKI \ ./editions/zh-Hant \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/languages/zh-Hant \ --build empty index \ @@ -495,7 +461,6 @@ node $TW5_BUILD_TIDDLYWIKI \ node $TW5_BUILD_TIDDLYWIKI \ ./editions/pluginlibrary \ - --verbose \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT/library/$TW5_BUILD_VERSION \ --build library\ diff --git a/boot/boot.js b/boot/boot.js index b4bdc00f2..f1f6e4906 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -232,10 +232,10 @@ $tw.utils.error = function(err) { var link = dm("a"), text = JSON.stringify(tiddlers); if(Blob !== undefined) { - var blob = new Blob([text], {type: "text/html"}); + var blob = new Blob([text], {type: "application/json"}); link.setAttribute("href", URL.createObjectURL(blob)); } else { - link.setAttribute("href","data:text/html," + encodeURIComponent(text)); + link.setAttribute("href","data:application/json," + encodeURIComponent(text)); } link.setAttribute("download","emergency-tiddlers-" + (new Date()) + ".json"); document.body.appendChild(link); @@ -1470,17 +1470,15 @@ $tw.Wiki = function(options) { // Unpack the currently registered plugins, creating shadow tiddlers for their constituent tiddlers this.unpackPluginTiddlers = function() { var self = this; - // Sort the plugin titles by the `plugin-priority` field - pluginTiddlers.sort(function(a,b) { - if("plugin-priority" in a.fields && "plugin-priority" in b.fields) { - return a.fields["plugin-priority"] - b.fields["plugin-priority"]; - } else if("plugin-priority" in a.fields) { + // Sort the plugin titles by the `plugin-priority` field, if this field is missing, default to 1 + pluginTiddlers.sort(function(a, b) { + var priorityA = "plugin-priority" in a.fields ? a.fields["plugin-priority"] : 1; + var priorityB = "plugin-priority" in b.fields ? b.fields["plugin-priority"] : 1; + if (priorityA !== priorityB) { + return priorityA - priorityB; + } else if (a.fields.title < b.fields.title) { return -1; - } else if("plugin-priority" in b.fields) { - return +1; - } else if(a.fields.title < b.fields.title) { - return -1; - } else if(a.fields.title === b.fields.title) { + } else if (a.fields.title === b.fields.title) { return 0; } else { return +1; @@ -2465,13 +2463,15 @@ $tw.boot.initStartup = function(options) { $tw.utils.registerFileType("image/webp","base64",".webp",{flags:["image"]}); $tw.utils.registerFileType("image/heic","base64",".heic",{flags:["image"]}); $tw.utils.registerFileType("image/heif","base64",".heif",{flags:["image"]}); + $tw.utils.registerFileType("image/avif","base64",".avif",{flags:["image"]}); $tw.utils.registerFileType("image/svg+xml","utf8",".svg",{flags:["image"]}); $tw.utils.registerFileType("image/vnd.microsoft.icon","base64",".ico",{flags:["image"]}); $tw.utils.registerFileType("image/x-icon","base64",".ico",{flags:["image"]}); $tw.utils.registerFileType("application/wasm","base64",".wasm"); - $tw.utils.registerFileType("application/font-woff","base64",".woff"); - $tw.utils.registerFileType("application/x-font-ttf","base64",".woff"); - $tw.utils.registerFileType("application/font-woff2","base64",".woff2"); + $tw.utils.registerFileType("font/woff","base64",".woff"); + $tw.utils.registerFileType("font/woff2","base64",".woff2"); + $tw.utils.registerFileType("font/ttf","base64",".ttf"); + $tw.utils.registerFileType("font/otf","base64",".otf"); $tw.utils.registerFileType("audio/ogg","base64",".ogg"); $tw.utils.registerFileType("audio/mp4","base64",[".mp4",".m4a"]); $tw.utils.registerFileType("video/ogg","base64",[".ogm",".ogv",".ogg"]); diff --git a/core/acknowledgements.tid b/core/acknowledgements.tid index cb54e3d23..e1015e2c9 100644 --- a/core/acknowledgements.tid +++ b/core/acknowledgements.tid @@ -5,7 +5,3 @@ TiddlyWiki incorporates code from these fine OpenSource projects: * [[The Stanford Javascript Crypto Library|http://bitwiseshiftleft.github.io/sjcl/]] * [[The Jasmine JavaScript Test Framework|https://jasmine.github.io/]] * [[Normalize.css by Nicolas Gallagher|http://necolas.github.io/normalize.css/]] - -And media from these projects: - -* World flag icons from [[Wikipedia|http://commons.wikimedia.org/wiki/Category:SVG_flags_by_country]] diff --git a/core/copyright.tid b/core/copyright.tid index 3f52380cc..233295ce2 100644 --- a/core/copyright.tid +++ b/core/copyright.tid @@ -4,7 +4,7 @@ type: text/plain TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com) Copyright (c) 2004-2007, Jeremy Ruston -Copyright (c) 2007-2024, UnaMesa Association +Copyright (c) 2007-2025, UnaMesa Association All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/core/images/language.tid b/core/images/language.tid new file mode 100644 index 000000000..bb4061495 --- /dev/null +++ b/core/images/language.tid @@ -0,0 +1,5 @@ +title: $:/core/images/language +tags: $:/tags/Image + +\parameters (size:"22pt") +> height=<> class="tc-image-language tc-image-button" viewBox="0 0 92 92"> \ No newline at end of file diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index 7adf4aa04..129dab0b4 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -175,6 +175,8 @@ Settings/NavigationPermalinkviewMode/UpdateAddressBar/Description: Update addres Settings/PerformanceInstrumentation/Caption: Performance Instrumentation Settings/PerformanceInstrumentation/Hint: Displays performance statistics in the browser developer console. Requires reload to take effect Settings/PerformanceInstrumentation/Description: Enable performance instrumentation +Settings/RecentLimit/Caption: Recent Tab Limit +Settings/RecentLimit/Hint: Maximum number of tiddlers to be displayed under the sidebar "Recent" tab Settings/ToolbarButtonStyle/Caption: Toolbar Button Style Settings/ToolbarButtonStyle/Hint: Choose the style for toolbar buttons: Settings/ToolbarButtonStyle/Styles/Borderless: Borderless @@ -204,10 +206,10 @@ Settings/MissingLinks/Hint: Choose whether to link to tiddlers that do not exist Settings/MissingLinks/Description: Enable links to missing tiddlers SocialCard/Caption: Social Media Card SocialCard/Domain/Prompt: Domain name to display for the link (for example, ''tiddlywiki.com'') -SocialCard/Hint: This information is used by social and messaging services to display a preview card for links to this TiddlyWiki when hosted online -SocialCard/PreviewUrl/Prompt: Full URL to preview image for this TiddlyWiki +SocialCard/Hint: This information is used by social and messaging services to display a preview card for links to this ~TiddlyWiki when hosted online +SocialCard/PreviewUrl/Prompt: Full URL to preview image for this ~TiddlyWiki SocialCard/PreviewUrl/Preview: Preview image: -SocialCard/Url/Prompt: Full URL of this TiddlyWiki +SocialCard/Url/Prompt: Full URL of this ~TiddlyWiki StoryTiddler/Caption: Story Tiddler StoryTiddler/Hint: This rule cascade is used to dynamically choose the template for displaying a tiddler in the story river. StoryView/Caption: Story View diff --git a/core/language/en-GB/icon.tid b/core/language/en-GB/icon.tid deleted file mode 100644 index 1967b895f..000000000 --- a/core/language/en-GB/icon.tid +++ /dev/null @@ -1,13 +0,0 @@ -title: $:/languages/en-GB/icon -type: image/svg+xml - - - - - - - - - - - diff --git a/core/modules/commands/build.js b/core/modules/commands/build.js index 8471119d7..60456372d 100644 --- a/core/modules/commands/build.js +++ b/core/modules/commands/build.js @@ -24,7 +24,7 @@ var Command = function(params,commander) { Command.prototype.execute = function() { // Get the build targets defined in the wiki - var buildTargets = $tw.boot.wikiInfo.build; + var buildTargets = $tw.boot.wikiInfo && $tw.boot.wikiInfo.build; if(!buildTargets) { return "No build targets defined"; } diff --git a/core/modules/filters/function.js b/core/modules/filters/function.js index 79210fb78..bc0702cf4 100644 --- a/core/modules/filters/function.js +++ b/core/modules/filters/function.js @@ -17,19 +17,24 @@ Export our filter function */ exports.function = function(source,operator,options) { var functionName = operator.operands[0], - params = []; + params = [], + results; $tw.utils.each(operator.operands.slice(1),function(param) { params.push({value: param}); }); + // console.log(`Calling ${functionName} with params ${JSON.stringify(params)}`); var variableInfo = options.widget && options.widget.getVariableInfo && options.widget.getVariableInfo(functionName,{params: params, source: source}); if(variableInfo && variableInfo.srcVariable && variableInfo.srcVariable.isFunctionDefinition) { - return variableInfo.resultList ? variableInfo.resultList : [variableInfo.text]; + results = variableInfo.resultList ? variableInfo.resultList : [variableInfo.text]; } // Return the input list if the function wasn't found - var results = []; - source(function(tiddler,title) { - results.push(title); - }); + if(!results) { + results = []; + source(function(tiddler,title) { + results.push(title); + }); + } + // console.log(`function ${functionName} with params ${JSON.stringify(params)} results: ${JSON.stringify(results)}`); return results; }; diff --git a/core/modules/macros/unusedtitle.js b/core/modules/macros/unusedtitle.js index 8a61c425e..1078f650d 100644 --- a/core/modules/macros/unusedtitle.js +++ b/core/modules/macros/unusedtitle.js @@ -31,7 +31,7 @@ exports.run = function(baseName,separator,template,startCount) { } // $tw.wiki.generateNewTitle = function(baseTitle,options) // options.prefix must be a string! - return this.wiki.generateNewTitle(baseName, {"prefix": separator, "template": template, "startCount": startCount}); + return this.wiki.generateNewTitle(baseName, {"prefix": separator, "template": template, "startCount": startCount}).trim(); }; })(); diff --git a/core/modules/parsers/imageparser.js b/core/modules/parsers/imageparser.js index a964a4ba8..d594803b2 100644 --- a/core/modules/parsers/imageparser.js +++ b/core/modules/parsers/imageparser.js @@ -40,6 +40,7 @@ exports["image/gif"] = ImageParser; exports["image/webp"] = ImageParser; exports["image/heic"] = ImageParser; exports["image/heif"] = ImageParser; +exports["image/avif"] = ImageParser; exports["image/x-icon"] = ImageParser; exports["image/vnd.microsoft.icon"] = ImageParser; diff --git a/core/modules/saver-handler.js b/core/modules/saver-handler.js index 23056bcc2..e760fd8f1 100644 --- a/core/modules/saver-handler.js +++ b/core/modules/saver-handler.js @@ -46,8 +46,10 @@ function SaverHandler(options) { // Filter the changes so that we only count changes to tiddlers that we care about var filteredChanges = self.filterFn.call(self.wiki,function(iterator) { $tw.utils.each(changes,function(change,title) { - var tiddler = self.wiki.getTiddler(title); - iterator(tiddler,title); + if(change.normal) { + var tiddler = self.wiki.getTiddler(title); + iterator(tiddler,title); + } }); }); // Adjust the number of changes @@ -183,7 +185,7 @@ SaverHandler.prototype.saveWiki = function(options) { // Call the highest priority saver that supports this method for(var t=this.savers.length-1; t>=0; t--) { var saver = this.savers[t]; - if(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback,{variables: {filename: variables.filename}})) { + if(saver.info.capabilities.indexOf(method) !== -1 && saver.save(text,method,callback,{variables: {filename: variables.filename, type: variables.type}})) { this.logger.log("Saving wiki with method",method,"through saver",saver.info.name); return true; } diff --git a/core/modules/savers/download.js b/core/modules/savers/download.js index 0a1d565ce..003c332c3 100644 --- a/core/modules/savers/download.js +++ b/core/modules/savers/download.js @@ -22,6 +22,7 @@ DownloadSaver.prototype.save = function(text,method,callback,options) { options = options || {}; // Get the current filename var filename = options.variables.filename; + var type = options.variables.type; if(!filename) { var p = document.location.pathname.lastIndexOf("/"); if(p !== -1) { @@ -32,13 +33,16 @@ DownloadSaver.prototype.save = function(text,method,callback,options) { if(!filename) { filename = "tiddlywiki.html"; } + if(!type) { + type = "text/html"; + } // Set up the link var link = document.createElement("a"); if(Blob !== undefined) { - var blob = new Blob([text], {type: "text/html"}); + var blob = new Blob([text], {type: type}); link.setAttribute("href", URL.createObjectURL(blob)); } else { - link.setAttribute("href","data:text/html," + encodeURIComponent(text)); + link.setAttribute("href","data:" + type + "," + encodeURIComponent(text)); } link.setAttribute("download",filename); document.body.appendChild(link); diff --git a/core/modules/server/routes/get-login-basic.js b/core/modules/server/routes/get-login-basic.js index d573a0b5d..69d3bf908 100644 --- a/core/modules/server/routes/get-login-basic.js +++ b/core/modules/server/routes/get-login-basic.js @@ -25,7 +25,7 @@ exports.handler = function(request,response,state) { response.end(); } else { // Redirect to the root wiki if login worked - var location = ($tw.syncadaptor && $tw.syncadaptor.host)? $tw.syncadaptor.host: "/"; + var location = ($tw.syncadaptor && $tw.syncadaptor.host)? $tw.syncadaptor.host: `${state.pathPrefix}/`; response.writeHead(302,{ Location: location }); diff --git a/core/modules/startup/plugins.js b/core/modules/startup/plugins.js index fc8ba9589..af354c38e 100644 --- a/core/modules/startup/plugins.js +++ b/core/modules/startup/plugins.js @@ -75,7 +75,7 @@ exports.startup = function() { $tw.wiki.unpackPluginTiddlers(); // Queue change events for the changed shadow tiddlers $tw.utils.each(Object.keys(changedShadowTiddlers),function(title) { - $tw.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title]); + $tw.wiki.enqueueTiddlerEvent(title,changedShadowTiddlers[title], true); }); } } diff --git a/core/modules/startup/rootwidget.js b/core/modules/startup/rootwidget.js index d96d569c3..95e902db6 100644 --- a/core/modules/startup/rootwidget.js +++ b/core/modules/startup/rootwidget.js @@ -77,8 +77,9 @@ exports.startup = function() { $tw.rootWidget.addEventListener("tm-copy-to-clipboard",function(event) { $tw.utils.copyToClipboard(event.param,{ successNotification: event.paramObject && event.paramObject.successNotification, - failureNotification: event.paramObject && event.paramObject.failureNotification - }); + failureNotification: event.paramObject && event.paramObject.failureNotification, + plainText: event.paramObject && event.paramObject.plainText + },event.paramObject && event.paramObject.type); }); // Install the tm-focus-selector message $tw.rootWidget.addEventListener("tm-focus-selector",function(event) { diff --git a/core/modules/startup/startup.js b/core/modules/startup/startup.js index e09f6393f..b971e473b 100755 --- a/core/modules/startup/startup.js +++ b/core/modules/startup/startup.js @@ -88,8 +88,10 @@ exports.startup = function() { if($tw.browser) { var pluginTiddler = $tw.wiki.getTiddler(plugins[0]); if(pluginTiddler) { + document.documentElement.setAttribute("lang",pluginTiddler.getFieldString("name")); document.documentElement.setAttribute("dir",pluginTiddler.getFieldString("text-direction") || "auto"); } else { + document.documentElement.setAttribute("lang","en-GB"); document.documentElement.removeAttribute("dir"); } } diff --git a/core/modules/tiddler.js b/core/modules/tiddler.js index b0b6e6942..d8d67bf77 100644 --- a/core/modules/tiddler.js +++ b/core/modules/tiddler.js @@ -40,10 +40,10 @@ exports.getFieldString = function(field,defaultValue) { }; /* -Get the value of a field as a list +Get the value of a field as an array / list */ exports.getFieldList = function(field) { - var value = this.fields[field]; + var value = this.getFieldString(field,null); // Check for a missing field if(value === undefined || value === null) { return []; diff --git a/core/modules/utils/dom/dom.js b/core/modules/utils/dom/dom.js index 0b71e128c..5f33bbeea 100644 --- a/core/modules/utils/dom/dom.js +++ b/core/modules/utils/dom/dom.js @@ -268,9 +268,10 @@ exports.copyStyles = function(srcDomNode,dstDomNode) { /* Copy plain text to the clipboard on browsers that support it */ -exports.copyToClipboard = function(text,options) { - options = options || {}; - text = text || ""; +exports.copyToClipboard = function(text,options,type) { + var text = text || ""; + var options = options || {}; + var type = type || "text/plain"; var textArea = document.createElement("textarea"); textArea.style.position = "fixed"; textArea.style.top = 0; @@ -283,10 +284,16 @@ exports.copyToClipboard = function(text,options) { textArea.style.outline = "none"; textArea.style.boxShadow = "none"; textArea.style.background = "transparent"; - textArea.value = text; document.body.appendChild(textArea); textArea.select(); textArea.setSelectionRange(0,text.length); + textArea.addEventListener("copy",function(event) { + event.preventDefault(); + if (options.plainText) { + event.clipboardData.setData("text/plain",options.plainText); + } + event.clipboardData.setData(type,text); + }); var succeeded = false; try { succeeded = document.execCommand("copy"); diff --git a/core/modules/utils/dom/http.js b/core/modules/utils/dom/http.js index f16f1c512..37a7855a5 100644 --- a/core/modules/utils/dom/http.js +++ b/core/modules/utils/dom/http.js @@ -216,11 +216,11 @@ HttpClientRequest.prototype.send = function(callback) { if(lengthComputable) { setBinding(self.bindProgress,"" + Math.floor((loaded/total) * 100)) } - self.wiki.invokeActionString(self.progressActions,undefined,{ + self.wiki.invokeActionString(self.progressActions,undefined,$tw.utils.extend({},self.variables,{ lengthComputable: lengthComputable ? "yes" : "no", loaded: loaded, total: total - },{parentWidget: $tw.rootWidget}); + }),{parentWidget: $tw.rootWidget}); } }); } diff --git a/core/modules/utils/fakedom.js b/core/modules/utils/fakedom.js index fb28465fe..66f2314e2 100755 --- a/core/modules/utils/fakedom.js +++ b/core/modules/utils/fakedom.js @@ -56,36 +56,64 @@ Object.defineProperty(TW_TextNode.prototype, "formattedTextContent", { } }); -var TW_Element = function(tag,namespace) { +var TW_Style = function(el) { + // Define the internal style object + var styleObject = { + // Method to get the entire style object + get: function() { + return el._style; + }, + // Method to set styles using a string (e.g. "color:red; background-color:blue;") + set: function(str) { + var self = this; + str = str || ""; + $tw.utils.each(str.split(";"),function(declaration) { + var parts = declaration.split(":"), + name = $tw.utils.trim(parts[0]), + value = $tw.utils.trim(parts[1]); + if(name && value) { + el._style[$tw.utils.convertStyleNameToPropertyName(name)] = value; + } + }); + }, + // Method to set a specific property without transforming the property name, such as a custom property + setProperty: function(name, value) { + el._style[name] = value; + } + }; + + // Return a Proxy to handle direct access to individual style properties + return new Proxy(styleObject, { + get: function(target, property) { + // If the property exists on styleObject, return it (get, set, setProperty methods) + if (property in target) { + return target[property]; + } + // Otherwise, return the corresponding property from _style + return el._style[$tw.utils.convertStyleNameToPropertyName(property)] || ""; + }, + set: function(target, property, value) { + // Set the property in _style + el._style[$tw.utils.convertStyleNameToPropertyName(property)] = value; + return true; + } + }); +}; + +var TW_Element = function(tag, namespace) { bumpSequenceNumber(this); this.isTiddlyWikiFakeDom = true; this.tag = tag; this.attributes = {}; this.isRaw = false; this.children = []; - this._style = {}; + this._style = {}; // Internal style object + this.style = new TW_Style(this); // Proxy for style management this.namespaceURI = namespace || "http://www.w3.org/1999/xhtml"; }; -Object.setPrototypeOf(TW_Element.prototype,TW_Node.prototype); -Object.defineProperty(TW_Element.prototype, "style", { - get: function() { - return this._style; - }, - set: function(str) { - var self = this; - str = str || ""; - $tw.utils.each(str.split(";"),function(declaration) { - var parts = declaration.split(":"), - name = $tw.utils.trim(parts[0]), - value = $tw.utils.trim(parts[1]); - if(name && value) { - self._style[$tw.utils.convertStyleNameToPropertyName(name)] = value; - } - }); - } -}); +Object.setPrototypeOf(TW_Element.prototype,TW_Node.prototype); Object.defineProperty(TW_Element.prototype, "nodeType", { get: function() { @@ -105,7 +133,7 @@ TW_Element.prototype.setAttribute = function(name,value) { throw "Cannot setAttribute on a raw TW_Element"; } if(name === "style") { - this.style = value; + this.style.set(value); } else { this.attributes[name] = value + ""; } diff --git a/core/modules/widgets/browse.js b/core/modules/widgets/browse.js index 8130825b0..d3fc6f002 100644 --- a/core/modules/widgets/browse.js +++ b/core/modules/widgets/browse.js @@ -42,6 +42,9 @@ BrowseWidget.prototype.render = function(parent,nextSibling) { if(this.tooltip) { domNode.setAttribute("title",this.tooltip); } + if(this.tabIndex) { + domNode.setAttribute("tabindex", this.tabIndex); + } // Nw.js supports "nwsaveas" to force a "save as" dialogue that allows a new or existing file to be selected if(this.nwsaveas) { domNode.setAttribute("nwsaveas",this.nwsaveas); @@ -56,6 +59,9 @@ BrowseWidget.prototype.render = function(parent,nextSibling) { if(this.nwdirectory) { domNode.setAttribute("nwdirectory",this.nwdirectory); } + if(this.isDisabled === "yes") { + domNode.setAttribute("disabled", true); + } // Add a click event handler domNode.addEventListener("change",function (event) { if(self.message) { @@ -94,6 +100,8 @@ BrowseWidget.prototype.execute = function() { this.accept = this.getAttribute("accept"); this.webkitdirectory = this.getAttribute("webkitdirectory"); this.nwdirectory = this.getAttribute("nwdirectory"); + this.tabIndex = this.getAttribute("tabindex"); + this.isDisabled = this.getAttribute("disabled", "no"); }; /* diff --git a/core/modules/widgets/checkbox.js b/core/modules/widgets/checkbox.js index e07513b0a..bf0a7bb79 100644 --- a/core/modules/widgets/checkbox.js +++ b/core/modules/widgets/checkbox.js @@ -47,6 +47,9 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) { if(isChecked === undefined && this.checkboxIndeterminate === "yes") { this.inputDomNode.indeterminate = true; } + if(this.tabIndex) { + this.inputDomNode.setAttribute("tabindex", this.tabIndex); + } if(this.isDisabled === "yes") { this.inputDomNode.setAttribute("disabled",true); } @@ -305,6 +308,7 @@ CheckboxWidget.prototype.execute = function() { this.checkboxClass = this.getAttribute("class",""); this.checkboxInvertTag = this.getAttribute("invertTag",""); this.isDisabled = this.getAttribute("disabled","no"); + this.tabIndex = this.getAttribute(); // Make the child widgets this.makeChildWidgets(); }; @@ -314,7 +318,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of */ CheckboxWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.listField || changedAttributes.listIndex || changedAttributes.filter || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes.indeterminate || changedAttributes["class"] || changedAttributes.disabled) { + if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.listField || changedAttributes.listIndex || changedAttributes.filter || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes.indeterminate || changedAttributes["class"] || changedAttributes.disabled || changedAttributes.tabindex) { this.refreshSelf(); return true; } else { diff --git a/core/modules/widgets/droppable.js b/core/modules/widgets/droppable.js index 0dcba1688..ba54d8860 100644 --- a/core/modules/widgets/droppable.js +++ b/core/modules/widgets/droppable.js @@ -125,11 +125,23 @@ DroppableWidget.prototype.handleDropEvent = function(event) { // Remove highlighting $tw.utils.removeClass(this.domNodes[0],"tc-dragover"); // Try to import the various data types we understand - $tw.utils.importDataTransfer(dataTransfer,null,function(fieldsArray) { - fieldsArray.forEach(function(fields) { - self.performActions(fields.title || fields.text,event); + if(this.droppableActions) { + $tw.utils.importDataTransfer(dataTransfer,null,function(fieldsArray) { + fieldsArray.forEach(function(fields) { + self.performActions(fields.title || fields.text,event); + }); }); - }); + } + // Send a TitleList to performListActions + if(this.droppableListActions) { + $tw.utils.importDataTransfer(dataTransfer,null,function(fieldsArray) { + var titleList = []; + fieldsArray.forEach(function(fields) { + titleList.push(fields.title || fields.text); + }); + self.performListActions($tw.utils.stringifyList(titleList),event); + }); + } // Tell the browser that we handled the drop event.preventDefault(); // Stop the drop ripple up to any parent handlers @@ -137,6 +149,13 @@ DroppableWidget.prototype.handleDropEvent = function(event) { return false; }; +DroppableWidget.prototype.performListActions = function(titleList,event) { + if(this.droppableListActions) { + var modifierKey = $tw.keyboardManager.getEventModifierKeyDescriptor(event); + this.invokeActionString(this.droppableListActions,this,event,{actionTiddlerList: titleList, modifier: modifierKey}); + } +}; + DroppableWidget.prototype.performActions = function(title,event) { if(this.droppableActions) { var modifierKey = $tw.keyboardManager.getEventModifierKeyDescriptor(event); @@ -149,6 +168,7 @@ Compute the internal state of the widget */ DroppableWidget.prototype.execute = function() { this.droppableActions = this.getAttribute("actions"); + this.droppableListActions = this.getAttribute("listActions"); this.droppableEffect = this.getAttribute("effect","copy"); this.droppableTag = this.getAttribute("tag"); this.droppableEnable = (this.getAttribute("enable") || "yes") === "yes"; @@ -168,7 +188,8 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of */ DroppableWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - if(changedAttributes.tag || changedAttributes.enable || changedAttributes.disabledClass || changedAttributes.actions || changedAttributes.effect) { + if(changedAttributes.tag || changedAttributes.enable || changedAttributes.disabledClass || + changedAttributes.actions|| changedAttributes.listActions || changedAttributes.effect) { this.refreshSelf(); return true; } else { diff --git a/core/modules/widgets/edit-shortcut.js b/core/modules/widgets/edit-shortcut.js index 31d81b6b8..1935b2337 100644 --- a/core/modules/widgets/edit-shortcut.js +++ b/core/modules/widgets/edit-shortcut.js @@ -48,6 +48,9 @@ EditShortcutWidget.prototype.render = function(parent,nextSibling) { if(this.shortcutAriaLabel) { this.inputNode.setAttribute("aria-label",this.shortcutAriaLabel); } + if(this.isDisabled === "yes") { + this.inputNode.setAttribute("disabled", true); + } // Assign the current shortcut this.updateInputNode(); // Add event handlers @@ -77,6 +80,7 @@ EditShortcutWidget.prototype.execute = function() { this.shortcutTooltip = this.getAttribute("tooltip"); this.shortcutAriaLabel = this.getAttribute("aria-label"); this.shortcutFocus = this.getAttribute("focus"); + this.isDisabled = this.getAttribute("disabled", "no"); }; /* @@ -138,7 +142,7 @@ Selectively refreshes the widget if needed. Returns true if the widget needed re */ EditShortcutWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.placeholder || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.style || changedAttributes.tooltip || changedAttributes["aria-label"] || changedAttributes.focus) { + if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.placeholder || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.style || changedAttributes.tooltip || changedAttributes["aria-label"] || changedAttributes.focus || changedAttributes.disabled) { this.refreshSelf(); return true; } else if(changedTiddlers[this.shortcutTiddler]) { diff --git a/core/modules/widgets/edit.js b/core/modules/widgets/edit.js index eb7758e90..e4433e1da 100644 --- a/core/modules/widgets/edit.js +++ b/core/modules/widgets/edit.js @@ -43,15 +43,6 @@ EditWidget.prototype.execute = function() { // Get our parameters this.editTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler")); this.editField = this.getAttribute("field","text"); - this.editIndex = this.getAttribute("index"); - this.editClass = this.getAttribute("class"); - this.editPlaceholder = this.getAttribute("placeholder"); - this.editTabIndex = this.getAttribute("tabindex"); - this.editFocus = this.getAttribute("focus",""); - this.editCancelPopups = this.getAttribute("cancelPopups",""); - this.editInputActions = this.getAttribute("inputActions"); - this.editRefreshTitle = this.getAttribute("refreshTitle"); - this.editAutoComplete = this.getAttribute("autocomplete"); // Choose the appropriate edit widget this.editorType = this.getEditorType(); // Make the child widgets @@ -89,8 +80,8 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of */ EditWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - // Refresh if an attribute has changed, or the type associated with the target tiddler has changed - if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tabindex || changedAttributes.cancelPopups || changedAttributes.inputActions || changedAttributes.refreshTitle || changedAttributes.autocomplete || (this.getEditorType() !== this.editorType)) { + // Refresh if the editor type has changed + if(changedAttributes.tiddler || changedAttributes.field || (this.getEditorType() !== this.editorType)) { this.refreshSelf(); return true; } else { diff --git a/core/modules/widgets/fill.js b/core/modules/widgets/fill.js index de88c95af..870bf7878 100644 --- a/core/modules/widgets/fill.js +++ b/core/modules/widgets/fill.js @@ -24,6 +24,10 @@ Inherit from the base widget class */ FillWidget.prototype = new Widget(); +FillWidget.prototype.execute = function() { + // Do nothing. Make no child widgets. $Fill widgets should be invisible when naturally encountered. Instead, their parseTreeNodes are made available to $slot widgets that want it. +}; + exports.fill = FillWidget; })(); diff --git a/core/modules/widgets/genesis.js b/core/modules/widgets/genesis.js index c8403a3d4..a527553ad 100644 --- a/core/modules/widgets/genesis.js +++ b/core/modules/widgets/genesis.js @@ -23,15 +23,21 @@ Inherit from the base widget class */ GenesisWidget.prototype = new Widget(); +GenesisWidget.prototype.computeAttributes = function(options) { + options = options || Object.create(null); + options.filterFn = function(name) { + // Only compute our own attributes which start with a single dollar + return name.charAt(0) === "$" && name.charAt(1) !== "$"; + } + return Widget.prototype.computeAttributes.call(this,options); +}; + /* Render this widget into the DOM */ GenesisWidget.prototype.render = function(parent,nextSibling) { this.parentDomNode = parent; - this.computeAttributes({filterFn: function(name) { - // Only compute our own attributes which start with a single dollar - return name.charAt(0) === "$" && name.charAt(1) !== "$"; - }}); + this.computeAttributes(); this.execute(); this.renderChildren(parent,nextSibling); }; @@ -65,6 +71,16 @@ GenesisWidget.prototype.execute = function() { children: this.parseTreeNode.children || [], isNotRemappable: !this.genesisRemappable }]; + // Apply attributes in $names/$values + this.attributeNames = []; + this.attributeValues = []; + if(this.genesisNames && this.genesisValues) { + this.attributeNames = this.wiki.filterTiddlers(self.genesisNames,this); + this.attributeValues = this.wiki.filterTiddlers(self.genesisValues,this); + $tw.utils.each(this.attributeNames,function(varname,index) { + $tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],varname,self.attributeValues[index] || ""); + }); + } // Apply explicit attributes $tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(this.parseTreeNode),function(attribute) { var name = attribute.name; @@ -79,16 +95,6 @@ GenesisWidget.prototype.execute = function() { } $tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],$tw.utils.extend({},attribute,{name: name})); }); - // Apply attributes in $names/$values - this.attributeNames = []; - this.attributeValues = []; - if(this.genesisNames && this.genesisValues) { - this.attributeNames = this.wiki.filterTiddlers(self.genesisNames,this); - this.attributeValues = this.wiki.filterTiddlers(self.genesisValues,this); - $tw.utils.each(this.attributeNames,function(varname,index) { - $tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],varname,self.attributeValues[index] || ""); - }); - } // Construct the child widgets this.makeChildWidgets(parseTreeNodes); }; diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index e9bec7682..205db4c91 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -277,6 +277,8 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) { } // Get the current value of the tiddler we're editing var tiddler = this.wiki.getTiddler(targetTitle); + var defaultType = this.wiki.getTiddlerText("$:/config/DefaultMissingType", "").trim(); + var defaultFields = { type: defaultType }; // Save the initial value of the draft tiddler draftTitle = this.generateDraftTitle(targetTitle); var draftTiddler = new $tw.Tiddler({ @@ -288,7 +290,8 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) { "draft.title": targetTitle, "draft.of": targetTitle }, - this.wiki.getModificationFields() + this.wiki.getModificationFields(), + tiddler === null || tiddler === undefined ? defaultFields : {} ); this.wiki.addTiddler(draftTiddler); return draftTiddler; diff --git a/core/modules/widgets/radio.js b/core/modules/widgets/radio.js index aa7a32cf1..838455266 100644 --- a/core/modules/widgets/radio.js +++ b/core/modules/widgets/radio.js @@ -47,6 +47,9 @@ RadioWidget.prototype.render = function(parent,nextSibling) { if(isChecked) { this.inputDomNode.checked = true; } + if(this.tabIndex) { + this.inputDomNode.setAttribute("tabindex", this.tabIndex); + } if(this.isDisabled === "yes") { this.inputDomNode.setAttribute("disabled",true); } @@ -111,6 +114,7 @@ RadioWidget.prototype.execute = function() { this.radioClass = this.getAttribute("class",""); this.radioDefault = this.getAttribute("default"); this.isDisabled = this.getAttribute("disabled","no"); + this.tabIndex = this.getAttribute("tabindex"); this.radioActions = this.getAttribute("actions",""); // Make the child widgets this.makeChildWidgets(); diff --git a/core/modules/widgets/range.js b/core/modules/widgets/range.js index db2699cc4..efb935aac 100644 --- a/core/modules/widgets/range.js +++ b/core/modules/widgets/range.js @@ -46,6 +46,9 @@ RangeWidget.prototype.render = function(parent,nextSibling) { if(this.increment){ this.inputDomNode.setAttribute("step", this.increment); } + if(this.tabIndex) { + this.inputDomNode.setAttribute("tabindex", this.tabIndex); + } if(this.isDisabled === "yes") { this.inputDomNode.setAttribute("disabled",true); } @@ -164,6 +167,7 @@ RangeWidget.prototype.execute = function() { this.defaultValue = this.getAttribute("default",""); this.elementClass = this.getAttribute("class",""); this.isDisabled = this.getAttribute("disabled","no"); + this.tabIndex = this.getAttribute("tabindex"); // Actions since 5.1.23 // Next 2 only fire once! this.actionsMouseDown = this.getAttribute("actionsStart",""); diff --git a/core/modules/widgets/select.js b/core/modules/widgets/select.js index 2940e3be0..f58a11891 100644 --- a/core/modules/widgets/select.js +++ b/core/modules/widgets/select.js @@ -53,6 +53,9 @@ SelectWidget.prototype.render = function(parent,nextSibling) { if(this.selectMultiple) { domNode.setAttribute("multiple","multiple"); } + if(this.isDisabled === "yes") { + domNode.setAttribute("disabled", true); + } if(this.selectSize) { domNode.setAttribute("size",this.selectSize); } @@ -172,6 +175,7 @@ SelectWidget.prototype.execute = function() { this.selectTabindex = this.getAttribute("tabindex"); this.selectTooltip = this.getAttribute("tooltip"); this.selectFocus = this.getAttribute("focus"); + this.isDisabled = this.getAttribute("disabled","no"); // Make the child widgets this.makeChildWidgets(); }; @@ -182,7 +186,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of SelectWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); // If we're using a different tiddler/field/index then completely refresh ourselves - if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tooltip || changedAttributes.tabindex) { + if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedAttributes.tooltip || changedAttributes.tabindex || changedAttributes.disabled) { this.refreshSelf(); return true; } else { diff --git a/core/modules/widgets/testcase.js b/core/modules/widgets/testcase.js index 0fd55531c..ad1905279 100644 --- a/core/modules/widgets/testcase.js +++ b/core/modules/widgets/testcase.js @@ -33,6 +33,7 @@ TestCaseWidget.prototype.render = function(parent,nextSibling) { this.execute(); // Create container DOM node var domNode = this.document.createElement("div"); + domNode.setAttribute("class", "tc-test-case " + this.testcaseClass); this.domNodes.push(domNode); parent.insertBefore(domNode,nextSibling); // Render the children into a hidden DOM node @@ -145,6 +146,7 @@ TestCaseWidget.prototype.execute = function() { this.testcaseTestActions = this.getAttribute("testActions"); this.testcaseTestExpectedResult = this.getAttribute("testExpectedResult"); this.testcaseHideIfPass = this.getAttribute("testHideIfPass"); + this.testcaseClass = this.getAttribute("class",""); }; /* diff --git a/core/modules/widgets/transclude.js b/core/modules/widgets/transclude.js index 35b4941bd..16561eab6 100755 --- a/core/modules/widgets/transclude.js +++ b/core/modules/widgets/transclude.js @@ -101,6 +101,7 @@ TranscludeWidget.prototype.execute = function() { } this.sourceText = target.text; this.parserType = target.type; + this._canonical_uri = target._canonical_uri; // Set the legacy transclusion context variables only if we're not transcluding a variable if(!this.transcludeVariable) { var recursionMarker = this.makeRecursionMarker(); @@ -228,7 +229,8 @@ TranscludeWidget.prototype.getTransclusionTarget = function() { }); return { text: parserInfo.text, - type: parserInfo.type + type: parserInfo.type, + _canonical_uri: parserInfo._canonical_uri }; } }; @@ -455,8 +457,11 @@ TranscludeWidget.prototype.makeRecursionMarker = function() { TranscludeWidget.prototype.parserNeedsRefresh = function() { // Doesn't need to consider transcluded variables because a parent variable can't change once a widget has been created - var parserInfo = this.wiki.getTextReferenceParserInfo(this.transcludeTitle,this.transcludeField,this.transcludeIndex,{subTiddler:this.transcludeSubTiddler}); - return (this.sourceText === undefined || parserInfo.sourceText !== this.sourceText || parserInfo.parserType !== this.parserType) + var parserInfo = this.wiki.getTextReferenceParserInfo(this.transcludeTitle,this.transcludeField,this.transcludeIndex,{ + subTiddler: this.transcludeSubTiddler, + defaultType: this.transcludeType + }); + return (this.sourceText === undefined || parserInfo.sourceText !== this.sourceText || parserInfo.parserType !== this.parserType || parserInfo._canonical_uri !== this._canonical_uri); }; TranscludeWidget.prototype.functionNeedsRefresh = function() { diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index b73294654..14e90ba2d 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -428,6 +428,11 @@ Widget.prototype.assignAttributes = function(domNode,options) { destPrefix = options.destPrefix || "", EVENT_ATTRIBUTE_PREFIX = "on"; var assignAttribute = function(name,value) { + // Process any CSS custom properties + if(name.substr(0,2) === "--" && name.length > 2) { + domNode.style.setProperty(name,value); + return; + } // Process any style attributes before considering sourcePrefix and destPrefix if(name.substr(0,6) === "style." && name.length > 6) { domNode.style[$tw.utils.unHyphenateCss(name.substr(6))] = value; diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 29a839c7a..928a2e847 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -141,12 +141,15 @@ This method should be called after the changes it describes have been made to th title: Title of tiddler isDeleted: defaults to false (meaning the tiddler has been created or modified), true if the tiddler has been deleted + isShadow: defaults to false (meaning the change applies to the normal tiddler), + true if the tiddler being changed is a shadow tiddler */ -exports.enqueueTiddlerEvent = function(title,isDeleted) { +exports.enqueueTiddlerEvent = function(title,isDeleted,isShadow) { // Record the touch in the list of changed tiddlers this.changedTiddlers = this.changedTiddlers || Object.create(null); this.changedTiddlers[title] = this.changedTiddlers[title] || Object.create(null); this.changedTiddlers[title][isDeleted ? "deleted" : "modified"] = true; + this.changedTiddlers[title][isShadow ? "shadow" : "normal"] = true; // Increment the change count this.changeCount = this.changeCount || Object.create(null); if($tw.utils.hop(this.changeCount,title)) { @@ -1132,6 +1135,7 @@ exports.getTextReferenceParserInfo = function(title,field,index,options) { if(tiddler.fields.type) { parserInfo.parserType = tiddler.fields.type; } + parserInfo._canonical_uri = tiddler.fields._canonical_uri; } } else if(field) { if(field === "title") { diff --git a/core/palettes/FlexokiDark.tid b/core/palettes/FlexokiDark.tid new file mode 100644 index 000000000..05e53edf5 --- /dev/null +++ b/core/palettes/FlexokiDark.tid @@ -0,0 +1,212 @@ +color-scheme: dark +description: An inky color scheme for prose and code +name: FlexokiDark +tags: $:/tags/Palette +title: $:/palettes/FlexokiDark +type: application/x-tiddler-dictionary + +flexoki-paper: #FFFCF0 +flexoki-999: #100F0F +flexoki-950: #1C1B1A +flexoki-900: #282726 +flexoki-850: #343331 +flexoki-800: #403E3C +flexoki-700: #575653 +flexoki-600: #6c6b66 +flexoki-500: #878580 +flexoki-300: #B7B5AC +flexoki-200: #CECDC3 +flexoki-150: #DAD8CE +flexoki-100: #E6E4D9 +flexoki-050: #F2F0E5 +flexoki-red-600: #AF3029 +flexoki-red-400: #D14D41 +flexoki-orange-600: #BC5215 +flexoki-orange-400: #DA702C +flexoki-yellow-900: #4D3A0B +flexoki-yellow-600: #AD8301 +flexoki-yellow-400: #D0A215 +flexoki-yellow-100: #FCEEB8 +flexoki-green-600: #66800B +flexoki-green-400: #879A39 +flexoki-cyan-950: #142625 +flexoki-cyan-600: #227d77 +flexoki-cyan-400: #3AA99F +flexoki-cyan-050: #EBF2E7 +flexoki-blue-600: #205EA6 +flexoki-blue-400: #4385BE +flexoki-purple-600: #5E409D +flexoki-purple-400: #8B7EC8 +flexoki-magenta-600: #A02F6F +flexoki-magenta-400: #CE5D97 + +flexoki-bg: <> +flexoki-tx-2: <> +flexoki-tx-3: <> +flexoki-ui-3: <> +flexoki-ui-2: <> +flexoki-ui: <> +flexoki-bg-2: <> +flexoki-tx: <> +flexoki-re: <> +flexoki-or: <> +flexoki-ye: <> +flexoki-gr: <> +flexoki-cy: <> +flexoki-bl: <> +flexoki-pu: <> +flexoki-ma: <> +flexoki-re-2: <> +flexoki-or-2: <> +flexoki-ye-2: <> +flexoki-gr-2: <> +flexoki-cy-2: <> +flexoki-bl-2: <> +flexoki-pu-2: <> +flexoki-ma-2: <> + +alert-background: <> +alert-border: <> +alert-highlight: <> +alert-muted-foreground: <> +background: #100F0F +blockquote-bar: <> +button-background: <> +button-foreground: <> +button-border: <> +code-background: <> +code-border: <> +code-foreground: <> +diff-delete-background: <> +diff-delete-foreground: <> +diff-equal-background: +diff-equal-foreground: inherit +diff-insert-background: <> +diff-insert-foreground: <> +diff-invisible-background: <> +diff-invisible-foreground: <> +dirty-indicator: <> +download-background: <> +download-foreground: <> +dragger-background: <> +dragger-foreground: <> +dropdown-background: <> +dropdown-border: <> +dropdown-tab-background-selected: <> +dropdown-tab-background: <> +dropzone-background: <> +external-link-background-hover: inherit +external-link-background-visited: inherit +external-link-background: inherit +external-link-foreground-hover: inherit +external-link-foreground-visited: <> +external-link-foreground: <> +footnote-target-background: <> +foreground: #CECDC3 +highlight-background: <> +highlight-foreground: inherit +menubar-background: <> +menubar-foreground: <> +message-background: <> +message-border: <> +message-foreground: <> +modal-backdrop: <> +modal-background: <> +modal-border: <> +modal-footer-background: <> +modal-footer-border: <> +modal-header-border: <> +muted-foreground: <> +network-activity-foreground: <> +notification-background: <> +notification-border: <> +page-background: <> +pre-background: <> +pre-border: <> +primary: <> +selection-background: <> +selection-foreground: <> +select-tag-background: <> +select-tag-foreground: <> +sidebar-button-foreground: <> +sidebar-controls-foreground-hover: <> +sidebar-controls-foreground: <> +sidebar-foreground-shadow: transparent +sidebar-foreground: <> +sidebar-muted-foreground-hover: <> +sidebar-muted-foreground: <> +sidebar-tab-background-selected: <> +sidebar-tab-background: <> +sidebar-tab-border-selected: <> +sidebar-tab-border: <> +sidebar-tab-divider: <> +sidebar-tab-foreground-selected: +sidebar-tab-foreground: <> +sidebar-tiddler-link-foreground-hover: <> +sidebar-tiddler-link-foreground: <> +site-title-foreground: <> +stability-stable: <> +stability-experimental: <> +stability-deprecated: <> +stability-legacy: <> +static-alert-foreground: #aaaaaa +tab-background-selected: <> +tab-background: <> +tab-border-selected: <> +tab-border: <> +tab-divider: <> +tab-foreground-selected: <> +tab-foreground: <> +table-border: <> +table-footer-background: <> +table-header-background: <> +tag-background: #D0A215 +tag-foreground: #100F0F +testcase-accent-level-1: <> +testcase-accent-level-2: <> +testcase-accent-level-3: <> +tiddler-background: <> +tiddler-border: <> +tiddler-controls-foreground-hover: <> +tiddler-controls-foreground-selected: <> +tiddler-controls-foreground: <> +tiddler-editor-background: <> +tiddler-editor-border-image: #ffffff +tiddler-editor-border: <> +tiddler-editor-fields-even: <> +tiddler-editor-fields-odd: <> +tiddler-info-background: <> +tiddler-info-border: <> +tiddler-info-tab-background: <> +tiddler-link-background: <> +tiddler-link-foreground: <> +tiddler-subtitle-foreground: <> +tiddler-title-foreground: <> +toolbar-new-button: +toolbar-options-button: +toolbar-save-button: +toolbar-info-button: +toolbar-edit-button: +toolbar-close-button: +toolbar-delete-button: <> +toolbar-cancel-button: +toolbar-done-button: +untagged-background: <> +very-muted-foreground: <> +wikilist-background: <> +wikilist-item: <> +wikilist-info: <> +wikilist-title: <> +wikilist-title-svg: <> +wikilist-url: <> +wikilist-button-open: <> +wikilist-button-open-hover: <> +wikilist-button-reveal: <> +wikilist-button-reveal-hover: <> +wikilist-button-remove: <> +wikilist-button-remove-hover: <> +wikilist-toolbar-background: <> +wikilist-toolbar-foreground: <> +wikilist-droplink-dragover: <> +wikilist-button-background: <> +wikilist-button-foreground: <> \ No newline at end of file diff --git a/core/palettes/FlexokiLight.tid b/core/palettes/FlexokiLight.tid new file mode 100644 index 000000000..c3c4d2f25 --- /dev/null +++ b/core/palettes/FlexokiLight.tid @@ -0,0 +1,214 @@ +title: $:/palettes/FlexokiLight +name: FlexokiLight +description: An inky color scheme for prose and code +tags: $:/tags/Palette +type: application/x-tiddler-dictionary +color-scheme: light + +flexoki-black: #100F0F +flexoki-paper: #FFFCF0 +flexoki-950: #1C1B1A +flexoki-900: #282726 +flexoki-850: #343331 +flexoki-800: #403E3C +flexoki-700: #575653 +flexoki-600: #6F6E69 +flexoki-500: #878580 +flexoki-300: #B7B5AC +flexoki-200: #CECDC3 +flexoki-150: #DAD8CE +flexoki-100: #E6E4D9 +flexoki-050: #F2F0E5 +flexoki-red-600: #AF3029 +flexoki-red-400: #D14D41 +flexoki-orange-600: #BC5215 +flexoki-orange-400: #DA702C +flexoki-yellow-900: #4D3A0B +flexoki-yellow-600: #AD8301 +flexoki-yellow-400: #D0A215 +flexoki-yellow-100: #FCEEB8 +flexoki-green-600: #66800B +flexoki-green-400: #879A39 +flexoki-cyan-950: #142625 +flexoki-cyan-600: #24837B +flexoki-cyan-400: #3AA99F +flexoki-cyan-050: #EBF2E7 +flexoki-blue-600: #205EA6 +flexoki-blue-400: #4385BE +flexoki-purple-600: #5E409D +flexoki-purple-400: #8B7EC8 +flexoki-magenta-600: #A02F6F +flexoki-magenta-400: #CE5D97 + +flexoki-tx: <> +flexoki-tx-2: <> +flexoki-tx-3: <> +flexoki-ui-3: <> +flexoki-ui-2: <> +flexoki-ui: <> +flexoki-bg-2: <> +flexoki-bg: <> + +flexoki-re: <> +flexoki-or: <> +flexoki-ye: <> +flexoki-gr: <> +flexoki-cy: <> +flexoki-bl: <> +flexoki-pu: <> +flexoki-ma: <> + +flexoki-re-2: <> +flexoki-or-2: <> +flexoki-ye-2: <> +flexoki-gr-2: <> +flexoki-cy-2: <> +flexoki-bl-2: <> +flexoki-pu-2: <> +flexoki-ma-2: <> + +alert-background: <> +alert-border: <> +alert-highlight: <> +alert-muted-foreground: <> +background: #FFFCF0 +blockquote-bar: <> +button-background: <> +button-foreground: <> +button-border: <> +code-background: <> +code-border: <> +code-foreground: <> +diff-delete-background: <> +diff-delete-foreground: <> +diff-equal-background: +diff-equal-foreground: <> +diff-insert-background: <> +diff-insert-foreground: <> +diff-invisible-background: <> +diff-invisible-foreground: <> +dirty-indicator: <> +download-background: <> +download-foreground: <> +dragger-background: <> +dragger-foreground: <> +dropdown-background: <> +dropdown-border: <> +dropdown-tab-background-selected: <> +dropdown-tab-background: <> +dropzone-background: <> +external-link-background-hover: inherit +external-link-background-visited: inherit +external-link-background: inherit +external-link-foreground-hover: inherit +external-link-foreground-visited: <> +external-link-foreground: <> +footnote-target-background: <> +foreground: #100F0F +highlight-background: <> +highlight-foreground: inherit +menubar-background: <> +menubar-foreground: <> +message-background: <> +message-border: <> +message-foreground: <> +modal-backdrop: <> +modal-background: <> +modal-border: <> +modal-footer-background: <> +modal-footer-border: <> +modal-header-border: <> +muted-foreground: <> +network-activity-foreground: <> +notification-background: <> +notification-border: <> +page-background: <> +pre-background: <> +pre-border: <> +primary: <> +selection-background: <> +selection-foreground: <> +select-tag-background: <> +select-tag-foreground: <> +sidebar-button-foreground: <> +sidebar-controls-foreground-hover: <> +sidebar-controls-foreground: <> +sidebar-foreground-shadow: transparent +sidebar-foreground: <> +sidebar-muted-foreground-hover: <> +sidebar-muted-foreground: <> +sidebar-tab-background-selected: <> +sidebar-tab-background: <> +sidebar-tab-border-selected: <> +sidebar-tab-border: <> +sidebar-tab-divider: <> +sidebar-tab-foreground-selected: +sidebar-tab-foreground: <> +sidebar-tiddler-link-foreground-hover: <> +sidebar-tiddler-link-foreground: <> +site-title-foreground: <> +stability-stable: <> +stability-experimental: <> +stability-deprecated: <> +stability-legacy: <> +static-alert-foreground: <> +tab-background-selected: <> +tab-background: <> +tab-border-selected: <> +tab-border: <> +tab-divider: <> +tab-foreground-selected: <> +tab-foreground: <> +table-border: <> +table-footer-background: <> +table-header-background: <> +tag-background: #AD8301 +tag-foreground: #FFFCF0 +testcase-accent-level-1: <> +testcase-accent-level-2: <> +testcase-accent-level-3: <> +tiddler-background: <> +tiddler-border: <> +tiddler-controls-foreground-hover: <> +tiddler-controls-foreground-selected: <> +tiddler-controls-foreground: <> +tiddler-editor-background: <> +tiddler-editor-border-image: #ffffff +tiddler-editor-border: <> +tiddler-editor-fields-even: <> +tiddler-editor-fields-odd: <> +tiddler-info-background: <> +tiddler-info-border: <> +tiddler-info-tab-background: <> +tiddler-link-background: <> +tiddler-link-foreground: <> +tiddler-subtitle-foreground: <> +tiddler-title-foreground: <> +toolbar-new-button: +toolbar-options-button: +toolbar-save-button: +toolbar-info-button: +toolbar-edit-button: +toolbar-close-button: +toolbar-delete-button: <> +toolbar-cancel-button: +toolbar-done-button: +untagged-background: <> +very-muted-foreground: <> +wikilist-background: <> +wikilist-item: <> +wikilist-info: <> +wikilist-title: <> +wikilist-title-svg: <> +wikilist-url: <> +wikilist-button-open: <> +wikilist-button-open-hover: <> +wikilist-button-reveal: <> +wikilist-button-reveal-hover: <> +wikilist-button-remove: <> +wikilist-button-remove-hover: <> +wikilist-toolbar-background: <> +wikilist-toolbar-foreground: <> +wikilist-droplink-dragover: <> +wikilist-button-background: <> +wikilist-button-foreground: <> diff --git a/core/palettes/GruvBoxDark.tid b/core/palettes/GruvBoxDark.tid index e839fd7b4..16ac22d65 100644 --- a/core/palettes/GruvBoxDark.tid +++ b/core/palettes/GruvBoxDark.tid @@ -21,9 +21,9 @@ diff-delete-foreground: <> diff-equal-background: diff-equal-foreground: <> diff-insert-background: #b8bb26 -diff-insert-foreground: <> -diff-invisible-background: -diff-invisible-foreground: <> +diff-insert-foreground: <> +diff-invisible-background: #ffff97 +diff-invisible-foreground: #444347 dirty-indicator: #fb4934 download-background: #b8bb26 download-foreground: <> diff --git a/core/palettes/Nord.tid b/core/palettes/Nord.tid index 5f18dce3f..87e918927 100644 --- a/core/palettes/Nord.tid +++ b/core/palettes/Nord.tid @@ -21,8 +21,8 @@ diff-delete-foreground: <> diff-equal-background: diff-equal-foreground: <> diff-insert-background: #A3BE8C -diff-insert-foreground: <> -diff-invisible-background: +diff-insert-foreground: <> +diff-invisible-background: #f9f3b5 diff-invisible-foreground: <> dirty-indicator: #BF616A download-background: #A3BE8C diff --git a/core/palettes/SolarFlare.tid b/core/palettes/SolarFlare.tid index 9f394f10c..ff6ddcf1d 100644 --- a/core/palettes/SolarFlare.tid +++ b/core/palettes/SolarFlare.tid @@ -125,6 +125,14 @@ foreground: #657b83 tiddler-link-foreground: <> alert-border: #b99e2f +diff-delete-background: <> +diff-delete-foreground: <> +diff-equal-background: inherit +diff-equal-foreground: inherit +diff-insert-background: <> +diff-insert-foreground: <> +diff-invisible-background: <> +diff-invisible-foreground: <> dirty-indicator: #ff0000 dropzone-background: rgba(0,200,0,0.7) external-link-background-hover: inherit diff --git a/core/palettes/SolarizedDark.tid b/core/palettes/SolarizedDark.tid index 326f6a4fb..9338998e9 100644 --- a/core/palettes/SolarizedDark.tid +++ b/core/palettes/SolarizedDark.tid @@ -18,6 +18,14 @@ button-foreground: #93a1a1 code-background: #073642 code-border: #586e75 code-foreground: #93a1a1 +diff-delete-background: #dc322f +diff-delete-foreground: #eee8d5 +diff-equal-background: inherit +diff-equal-foreground: inherit +diff-insert-background: #859900 +diff-insert-foreground: #073642 +diff-invisible-background: #b58900 +diff-invisible-foreground: #eee8d5 dirty-indicator: #dc322f download-background: #859900 download-foreground: #073642 diff --git a/core/palettes/SolarizedLight.tid b/core/palettes/SolarizedLight.tid index 28ce1c7c2..c01ff8821 100644 --- a/core/palettes/SolarizedLight.tid +++ b/core/palettes/SolarizedLight.tid @@ -18,6 +18,14 @@ button-foreground: #586e75 code-background: #eee8d5 code-border: #93a1a1 code-foreground: #586e75 +diff-delete-background: #dc322f +diff-delete-foreground: #eee8d5 +diff-equal-background: inherit +diff-equal-foreground: inherit +diff-insert-background: #859900 +diff-insert-foreground: #eee8d5 +diff-invisible-background: #b58900 +diff-invisible-foreground: #eee8d5 dirty-indicator: #dc322f download-background: #859900 download-foreground: #eee8d5 diff --git a/core/palettes/Twilight.tid b/core/palettes/Twilight.tid index 1cd8efab1..d6b54673a 100644 --- a/core/palettes/Twilight.tid +++ b/core/palettes/Twilight.tid @@ -19,13 +19,13 @@ code-background: rgba(0,0,0,0.03) code-border: rgba(0,0,0,0.08) code-foreground: rgb(255, 94, 94) diff-delete-background: #ffc9c9 -diff-delete-foreground: <> +diff-delete-foreground: <> diff-equal-background: diff-equal-foreground: <> diff-insert-background: #aaefad -diff-insert-foreground: <> -diff-invisible-background: -diff-invisible-foreground: <> +diff-insert-foreground: <> +diff-invisible-background: #fdfcbd +diff-invisible-foreground: <> dirty-indicator: rgb(255, 94, 94) download-background: #19a974 download-foreground: rgb(38, 38, 38) diff --git a/core/templates/exporters/CsvFile.tid b/core/templates/exporters/CsvFile.tid index 23d3bbd73..724827d89 100644 --- a/core/templates/exporters/CsvFile.tid +++ b/core/templates/exporters/CsvFile.tid @@ -2,5 +2,6 @@ title: $:/core/templates/exporters/CsvFile tags: $:/tags/Exporter description: {{$:/language/Exporters/CsvFile}} extension: .csv +file-type: text/csv <$macrocall $name="csvtiddlers" filter=<> format="quoted-comma-sep" $output="text/raw"/> diff --git a/core/templates/exporters/JsonFile.tid b/core/templates/exporters/JsonFile.tid index 9008906cc..2ae5495c1 100644 --- a/core/templates/exporters/JsonFile.tid +++ b/core/templates/exporters/JsonFile.tid @@ -2,5 +2,6 @@ title: $:/core/templates/exporters/JsonFile tags: $:/tags/Exporter description: {{$:/language/Exporters/JsonFile}} extension: .json +file-type: application/json <$macrocall $name="jsontiddlers" filter=<> $output="text/raw"/> diff --git a/core/templates/exporters/TidFile.tid b/core/templates/exporters/TidFile.tid index 7b0bb2d78..94f9744a8 100644 --- a/core/templates/exporters/TidFile.tid +++ b/core/templates/exporters/TidFile.tid @@ -2,6 +2,7 @@ title: $:/core/templates/exporters/TidFile tags: $:/tags/Exporter description: {{$:/language/Exporters/TidFile}} extension: .tid +file-type: text/vnd.tiddlywiki condition: [compare:lte[1]] \define renderContent() diff --git a/core/ui/AdvancedSearch/Filter.tid b/core/ui/AdvancedSearch/Filter.tid index a8baf9d30..7369e4c40 100644 --- a/core/ui/AdvancedSearch/Filter.tid +++ b/core/ui/AdvancedSearch/Filter.tid @@ -2,18 +2,28 @@ title: $:/core/ui/AdvancedSearch/Filter tags: $:/tags/AdvancedSearch caption: {{$:/language/Search/Filter/Caption}} -\define lingo-base() $:/language/Search/ -\define set-next-input-tab(beforeafter:"after") -<$macrocall $name="change-input-tab" +\procedure lingo-base() $:/language/Search/ +\procedure set-next-input-tab() +<$transclude $variable="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" - beforeafter="$beforeafter$" + beforeafter="after" defaultState="$:/core/ui/AdvancedSearch/System" actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<>/>" /> \end -\define cancel-search-actions() +\procedure set-previous-input-tab() +<$transclude $variable="change-input-tab" + stateTitle="$:/state/tab--1498284803" + tag="$:/tags/AdvancedSearch" + beforeafter="before" + defaultState="$:/core/ui/AdvancedSearch/System" + actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<>/>" +/> +\end + +\procedure cancel-search-actions() \whitespace trim <$list filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]"> <$list-empty> @@ -24,30 +34,30 @@ caption: {{$:/language/Search/Filter/Caption}} \end -\define input-accept-actions() +\procedure input-accept-actions() \whitespace trim <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"> <$list-empty> - <$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"> - <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> + <$list filter="[get[text]!is[missing]] :else[get[text]is[shadow]]"> + <$action-navigate $to={{{ [get[text]] }}}/> <$/list-empty> - <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> + <$action-navigate $to={{{ [get[text]] }}}/> \end -\define input-accept-variant-actions() +\procedure input-accept-variant-actions() \whitespace trim <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"> <$list-empty> - <$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"> + <$list filter="[get[text]!is[missing]] :else[get[text]is[shadow]]"> <$list filter="[<__tiddler__>get[text]minlength[1]]"> - <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> + <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [get[text]] }}}/> - <$list filter="[<__tiddler__>get[text]minlength[1]]"> - <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> + <$list filter="[get[text]minlength[1]]"> + <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [get[text]] }}}/> \end @@ -58,8 +68,8 @@ caption: {{$:/language/Search/Filter/Caption}}