diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 9e586b92e..000000000 --- a/.eslintignore +++ /dev/null @@ -1,8 +0,0 @@ -# Ignore "third party" code whose style we will not change. -/boot/sjcl.js -/core/modules/utils/base64-utf8/base64-utf8.module.js -/core/modules/utils/base64-utf8/base64-utf8.module.min.js -/core/modules/utils/diff-match-patch/diff_match_patch.js -/core/modules/utils/diff-match-patch/diff_match_patch_uncompressed.js -/core/modules/utils/dom/csscolorparser.js -/plugins/tiddlywiki/*/files/ diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 0316b8385..000000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,286 +0,0 @@ -env: - browser: true - commonjs: true - es2021: true - node: true -extends: 'eslint:recommended' -globals: - "$tw": "writable" # temporary -parserOptions: - ecmaVersion: 5 -rules: - array-bracket-newline: 'off' - array-bracket-spacing: 'off' - array-callback-return: 'off' - array-element-newline: 'off' - arrow-body-style: error - arrow-parens: - - error - - as-needed - arrow-spacing: - - error - - after: true - before: true - block-scoped-var: 'off' - block-spacing: 'off' - brace-style: 'off' - callback-return: 'off' - camelcase: 'off' - capitalized-comments: 'off' - class-methods-use-this: error - comma-dangle: 'off' - comma-spacing: 'off' - comma-style: 'off' - complexity: 'off' - computed-property-spacing: 'off' - consistent-return: 'off' - consistent-this: 'off' - curly: 'off' - default-case: 'off' - default-case-last: error - default-param-last: error - dot-location: 'off' - dot-notation: 'off' - eol-last: 'off' - eqeqeq: 'off' - func-call-spacing: 'off' - func-name-matching: 'off' - func-names: 'off' - func-style: 'off' - function-call-argument-newline: 'off' - function-paren-newline: 'off' - generator-star-spacing: error - global-require: 'off' - grouped-accessor-pairs: error - guard-for-in: 'off' - handle-callback-err: 'off' - id-blacklist: error - id-denylist: error - id-length: 'off' - id-match: error - implicit-arrow-linebreak: error - indent: 'off' - indent-legacy: 'off' - init-declarations: 'off' - jsx-quotes: error - key-spacing: 'off' - keyword-spacing: - - error - - before: true - after: false - overrides: - 'case': - after: true - 'do': - 'after': true - 'else': - after: true - 'return': - after: true - 'throw': - after: true - 'try': - after: true - line-comment-position: 'off' - linebreak-style: 'off' - lines-around-comment: 'off' - lines-around-directive: 'off' - lines-between-class-members: error - max-classes-per-file: error - max-depth: 'off' - max-len: 'off' - max-lines: 'off' - max-lines-per-function: 'off' - max-nested-callbacks: error - max-params: 'off' - max-statements: 'off' - max-statements-per-line: 'off' - multiline-comment-style: 'off' - multiline-ternary: 'off' - new-parens: 'off' - newline-after-var: 'off' - newline-before-return: 'off' - newline-per-chained-call: 'off' - no-alert: 'off' - no-array-constructor: 'off' - no-await-in-loop: error - no-bitwise: 'off' - no-buffer-constructor: 'off' - no-caller: error - no-catch-shadow: 'off' - no-confusing-arrow: error - no-console: 'off' - no-constant-condition: - - error - - checkLoops: false - no-constructor-return: error - no-continue: 'off' - no-div-regex: 'off' - no-duplicate-imports: error - no-else-return: 'off' - no-empty-function: 'off' - no-eq-null: 'off' - no-eval: 'off' - no-extend-native: 'off' - no-extra-bind: 'off' - no-extra-label: 'off' - no-extra-parens: 'off' - no-floating-decimal: 'off' - no-implicit-coercion: - - error - - boolean: false - number: false - string: false - no-implicit-globals: 'off' - no-implied-eval: error - no-inline-comments: 'off' - no-invalid-this: 'off' - no-iterator: error - no-label-var: 'off' - no-labels: 'off' - no-lone-blocks: 'off' - no-lonely-if: 'off' - no-loop-func: 'off' - no-loss-of-precision: error - no-magic-numbers: 'off' - no-mixed-operators: 'off' - no-mixed-requires: 'off' - no-multi-assign: 'off' - no-multi-spaces: 'off' - no-multi-str: error - no-multiple-empty-lines: 'off' - no-native-reassign: 'off' - no-negated-condition: 'off' - no-negated-in-lhs: error - no-nested-ternary: 'off' - no-new: 'off' - no-new-func: 'off' - no-new-object: 'off' - no-new-require: error - no-new-wrappers: error - no-octal-escape: error - no-param-reassign: 'off' - no-path-concat: error - no-plusplus: 'off' - no-process-env: 'off' - no-process-exit: 'off' - no-promise-executor-return: error - no-proto: 'off' - no-restricted-exports: error - no-restricted-globals: error - no-restricted-imports: error - no-restricted-modules: error - no-restricted-properties: error - no-restricted-syntax: error - no-return-assign: 'off' - no-return-await: error - no-script-url: 'off' - no-self-compare: 'off' - no-sequences: 'off' - no-shadow: 'off' - no-spaced-func: 'off' - no-sync: 'off' - no-tabs: 'off' - no-template-curly-in-string: error - no-ternary: 'off' - no-throw-literal: 'off' - no-trailing-spaces: 'off' - no-undef-init: 'off' - no-undefined: 'off' - no-underscore-dangle: 'off' - no-unmodified-loop-condition: 'off' - no-unneeded-ternary: 'off' - no-unreachable-loop: error - no-unused-expressions: 'off' - no-use-before-define: 'off' - no-useless-backreference: error - no-useless-call: 'off' - no-useless-computed-key: error - no-useless-concat: 'off' - no-useless-constructor: error - no-useless-rename: error - no-useless-return: 'off' - no-var: 'off' - no-void: 'off' - no-warning-comments: 'off' - no-whitespace-before-property: error - nonblock-statement-body-position: - - error - - any - object-curly-newline: 'off' - object-curly-spacing: 'off' - object-property-newline: 'off' - object-shorthand: 'off' - one-var: 'off' - one-var-declaration-per-line: 'off' - operator-assignment: 'off' - operator-linebreak: 'off' - padded-blocks: 'off' - padding-line-between-statements: error - prefer-arrow-callback: 'off' - prefer-const: 'off' - prefer-destructuring: 'off' - prefer-exponentiation-operator: 'off' - prefer-named-capture-group: 'off' - prefer-numeric-literals: error - prefer-object-spread: 'off' - prefer-promise-reject-errors: error - prefer-reflect: 'off' - prefer-regex-literals: 'off' - prefer-rest-params: 'off' - prefer-spread: 'off' - prefer-template: 'off' - quote-props: 'off' - quotes: - - error - - double - - avoidEscape: true - radix: 'off' - require-atomic-updates: error - require-await: error - require-jsdoc: 'off' - require-unicode-regexp: 'off' - rest-spread-spacing: error - semi: 'off' - semi-spacing: 'off' - semi-style: 'off' - sort-imports: error - sort-keys: 'off' - sort-vars: 'off' - space-before-blocks: 'off' - space-before-function-paren: 'off' - space-in-parens: 'off' - space-infix-ops: 'off' - space-unary-ops: 'off' - spaced-comment: 'off' - strict: 'off' - switch-colon-spacing: 'off' - symbol-description: error - template-curly-spacing: error - template-tag-spacing: error - unicode-bom: - - error - - never - valid-jsdoc: 'off' - valid-typeof: - - error - - requireStringLiterals: false - vars-on-top: 'off' - wrap-iife: 'off' - wrap-regex: 'off' - yield-star-spacing: error - yoda: 'off' - - # temporary rules - no-useless-escape: 'off' - no-unused-vars: 'off' - no-empty: 'off' - no-extra-semi: 'off' - no-redeclare: 'off' - no-control-regex: "off" - no-mixed-spaces-and-tabs: "off" - no-extra-boolean-cast: "off" - no-prototype-builtins: "off" - no-undef: "off" - no-unreachable: "off" - no-self-assign: "off" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 737d523ef..75c3bb8d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: - master - tiddlywiki-com env: - NODE_VERSION: "18" + NODE_VERSION: "22" jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/cla-check.yml b/.github/workflows/cla-check.yml index 72bba1c54..331727b71 100644 --- a/.github/workflows/cla-check.yml +++ b/.github/workflows/cla-check.yml @@ -14,7 +14,7 @@ jobs: if: ${{ (github.event.pull_request.user.login != github.repository_owner) }} steps: - run: | - if ! curl -s https://raw.githubusercontent.com/Jermolene/TiddlyWiki5/tiddlywiki-com/licenses/cla-individual.md | grep -o "@$USER,"; then + if ! curl -s https://raw.githubusercontent.com/Jermolene/TiddlyWiki5/tiddlywiki-com/licenses/cla-individual.md | grep -io "@$USER,"; then echo "CLA not signed" gh pr comment "$NUMBER" -b "@$USER It appears that this is your first contribution to the project, welcome. diff --git a/.github/workflows/cla-signed.yml b/.github/workflows/cla-signed.yml index 6783219d1..01d57d014 100644 --- a/.github/workflows/cla-signed.yml +++ b/.github/workflows/cla-signed.yml @@ -23,8 +23,8 @@ jobs: pull-requests: write steps: - run: | - if ! $BRANCH == "tiddlywiki-com"; then - echo "This CLA signature targets the wrong branch" + if [[ "$BRANCH" != "tiddlywiki-com" ]]; then + echo "This CLA signature targets the wrong branch: $BRANCH" gh pr comment "$NUMBER" -b "@$AUTHOR Signatures to the CLA must target the 'tiddlywiki-com' branch." fi env: diff --git a/bin/build-site.sh b/bin/build-site.sh index fbb34cc98..f1fe649e7 100755 --- a/bin/build-site.sh +++ b/bin/build-site.sh @@ -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 \ @@ -115,7 +114,6 @@ fi node $TW5_BUILD_TIDDLYWIKI \ $TW5_BUILD_MAIN_EDITION \ - --verbose \ --version \ --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ @@ -128,7 +126,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 +134,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 +146,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,29 +154,13 @@ 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 -# /dev/index.html Developer docs -# /dev/favicon.ico Favicon for dev site -# /dev/static.html Static rendering of default tiddlers -# /dev/alltiddlers.html Static rendering of all tiddlers -# /dev/static/* Static single tiddlers -# /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 \ - || exit 1 - # /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 \ @@ -190,7 +169,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 \ @@ -199,7 +177,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 \ @@ -215,7 +192,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 \ @@ -224,7 +200,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 \ @@ -233,7 +208,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 \ @@ -242,7 +216,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 \ @@ -251,7 +224,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 \ @@ -260,7 +232,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 \ @@ -269,7 +240,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 \ @@ -278,7 +248,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 \ @@ -294,7 +263,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 \ @@ -305,7 +273,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 \ @@ -320,7 +287,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 \ @@ -331,7 +297,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 \ @@ -342,7 +307,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 \ @@ -353,7 +317,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 \ @@ -364,7 +327,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 \ @@ -375,7 +337,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 \ @@ -386,7 +347,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 \ @@ -397,7 +357,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 \ @@ -425,7 +384,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 \ @@ -435,7 +393,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 \ @@ -445,7 +402,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 \ @@ -455,7 +411,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 \ @@ -465,7 +420,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 \ @@ -475,7 +429,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 \ @@ -485,7 +438,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 \ @@ -495,7 +447,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 \ @@ -509,7 +460,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/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index 30f89eec7..2fa732fd9 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -133,6 +133,7 @@ Excise/Caption/Replace/Link: link Excise/Caption/Replace/Transclusion: transclusion Excise/Caption/Tag: Tag new tiddler with the title of this tiddler Excise/Caption/TiddlerExists: Warning: tiddler already exists +Excise/DefaultTitle: New Excision Excise/Hint: Excise the selected text into a new tiddler Heading1/Caption: heading 1 Heading1/Hint: Apply heading level 1 formatting to lines containing selection diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index a1b164c5c..129dab0b4 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -96,6 +96,10 @@ Plugins/PluginWillRequireReload: (requires reload) Plugins/Plugins/Caption: Plugins Plugins/Plugins/Hint: Plugins Plugins/Reinstall/Caption: reinstall +Plugins/Stability/Deprecated: DEPRECATED +Plugins/Stability/Experimental: EXPERIMENTAL +Plugins/Stability/Legacy: LEGACY +Plugins/Stability/Stable: STABLE Plugins/Themes/Caption: Themes Plugins/Themes/Hint: Theme plugins Plugins/Update/Caption: update @@ -171,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 @@ -200,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/EditTemplate.multids b/core/language/en-GB/EditTemplate.multids index c4bfa5e56..8b2e6e17a 100644 --- a/core/language/en-GB/EditTemplate.multids +++ b/core/language/en-GB/EditTemplate.multids @@ -26,6 +26,8 @@ Tags/ClearInput/Caption: clear input Tags/ClearInput/Hint: Clear tag input Tags/Dropdown/Caption: tag list Tags/Dropdown/Hint: Show tag list +Tags/EmptyMessage: No tags found +Tags/EmptyMessage/System: No system tags found Title/BadCharacterWarning: Warning: avoid using any of the characters <> in tiddler titles Title/Exists/Prompt: Target tiddler already exists Title/Relink/Prompt: Update ''<$text text=<>/>'' to ''<$text text=<>/>'' in the //tags// and //list// fields of other tiddlers diff --git a/core/language/en-GB/Search.multids b/core/language/en-GB/Search.multids index 2a57a6416..f5aa478bf 100644 --- a/core/language/en-GB/Search.multids +++ b/core/language/en-GB/Search.multids @@ -6,6 +6,8 @@ Filter/Hint: Search via a [[filter expression|https://tiddlywiki.com/static/Filt Filter/Matches: //<> matches// Matches: //<> matches// Matches/All: All matches: +Matches/NoMatch: //No match// +Matches/NoResult: //No search result// Matches/Title: Title matches: Search: Search Search/TooShort: Search text too short 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/editor/operations/text/excise.js b/core/modules/editor/operations/text/excise.js index ced771719..0753705c5 100644 --- a/core/modules/editor/operations/text/excise.js +++ b/core/modules/editor/operations/text/excise.js @@ -12,20 +12,27 @@ Text editor operation to excise the selection to a new tiddler /*global $tw: false */ "use strict"; +function isMarkdown(mediaType) { + return mediaType === 'text/markdown' || mediaType === 'text/x-markdown'; +} + exports["excise"] = function(event,operation) { var editTiddler = this.wiki.getTiddler(this.editTitle), - editTiddlerTitle = this.editTitle; + editTiddlerTitle = this.editTitle, + wikiLinks = !isMarkdown(editTiddler.fields.type), + excisionBaseTitle = $tw.language.getString("Buttons/Excise/DefaultTitle"); if(editTiddler && editTiddler.fields["draft.of"]) { editTiddlerTitle = editTiddler.fields["draft.of"]; } - var excisionTitle = event.paramObject.title || this.wiki.generateNewTitle("New Excision"); + var excisionTitle = event.paramObject.title || this.wiki.generateNewTitle(excisionBaseTitle); this.wiki.addTiddler(new $tw.Tiddler( this.wiki.getCreationFields(), this.wiki.getModificationFields(), { title: excisionTitle, text: operation.selection, - tags: event.paramObject.tagnew === "yes" ? [editTiddlerTitle] : [] + tags: event.paramObject.tagnew === "yes" ? [editTiddlerTitle] : [], + type: editTiddler.fields.type } )); operation.replacement = excisionTitle; @@ -34,7 +41,8 @@ exports["excise"] = function(event,operation) { operation.replacement = "{{" + operation.replacement+ "}}"; break; case "link": - operation.replacement = "[[" + operation.replacement+ "]]"; + operation.replacement = wikiLinks ? "[[" + operation.replacement+ "]]" + : ("[" + operation.replacement + "](<#" + operation.replacement + ">)"); break; case "macro": operation.replacement = "<<" + (event.paramObject.macro || "translink") + " \"\"\"" + operation.replacement + "\"\"\">>"; diff --git a/core/modules/editor/operations/text/wrap-selection.js b/core/modules/editor/operations/text/wrap-selection.js index 6800cbe5b..665d72eb4 100644 --- a/core/modules/editor/operations/text/wrap-selection.js +++ b/core/modules/editor/operations/text/wrap-selection.js @@ -13,37 +13,125 @@ Text editor operation to wrap the selection with the specified prefix and suffix "use strict"; exports["wrap-selection"] = function(event,operation) { - if(operation.selStart === operation.selEnd) { - // No selection; check if we're within the prefix/suffix - if(operation.text.substring(operation.selStart - event.paramObject.prefix.length,operation.selStart + event.paramObject.suffix.length) === event.paramObject.prefix + event.paramObject.suffix) { + var o = operation, + prefix = event.paramObject.prefix, + suffix = event.paramObject.suffix, + trimSelection = event.paramObject.trimSelection || "no", + selLength = o.selEnd - o.selStart; + + // This function detects, if trailing spaces are part of the selection __and__ if the user wants to handle them + // Returns "yes", "start", "end", "no" (default) + // yes .. there are trailing spaces at both ends + // start .. there are trailing spaces at the start + // end .. there are trailing spaces at the end + // no .. no trailing spaces are taken into account + var trailingSpaceAt = function(sel) { + var _start, + _end, + result; + // trimSelection is a user parameter, which this evaluations takes into account + switch(trimSelection) { + case "end": + result = (sel.trimEnd().length !== selLength) ? "end" : "no"; + break; + case "yes": + _start = sel.trimStart().length !== selLength; + _end = sel.trimEnd().length !== selLength; + result = (_start && _end) ? "yes" : (_start) ? "start" : (_end) ? "end" : "no"; + break; + case "start": + result = (sel.trimStart().length !== selLength) ? "start" : "no"; + break; + default: + result = "no"; + break; + } + return result; + } + + function togglePrefixSuffix() { + if(o.text.substring(o.selStart - prefix.length, o.selStart + suffix.length) === prefix + suffix) { // Remove the prefix and suffix - operation.cutStart = operation.selStart - event.paramObject.prefix.length; - operation.cutEnd = operation.selEnd + event.paramObject.suffix.length; - operation.replacement = ""; - operation.newSelStart = operation.cutStart; - operation.newSelEnd = operation.newSelStart; + o.cutStart = o.selStart - prefix.length; + o.cutEnd = o.selEnd + suffix.length; + o.replacement = ""; + o.newSelStart = o.cutStart; + o.newSelEnd = o.newSelStart; } else { // Wrap the cursor instead - operation.cutStart = operation.selStart; - operation.cutEnd = operation.selEnd; - operation.replacement = event.paramObject.prefix + event.paramObject.suffix; - operation.newSelStart = operation.selStart + event.paramObject.prefix.length; - operation.newSelEnd = operation.newSelStart; + o.cutStart = o.selStart; + o.cutEnd = o.selEnd; + o.replacement = prefix + suffix; + o.newSelStart = o.selStart + prefix.length; + o.newSelEnd = o.newSelStart; } - } else if(operation.text.substring(operation.selStart,operation.selStart + event.paramObject.prefix.length) === event.paramObject.prefix && operation.text.substring(operation.selEnd - event.paramObject.suffix.length,operation.selEnd) === event.paramObject.suffix) { + } + + // options: lenPrefix, lenSuffix + function removePrefixSuffix(options) { + options = options || {}; + var _lenPrefix = options.lenPrefix || 0; + var _lenSuffix = options.lenSuffix || 0; + + o.cutStart = o.selStart - _lenPrefix; + o.cutEnd = o.selEnd + _lenSuffix; + o.replacement = (_lenPrefix || _lenSuffix) ? o.selection : o.selection.substring(prefix.length, o.selection.length - suffix.length); + o.newSelStart = o.cutStart; + o.newSelEnd = o.cutStart + o.replacement.length; + } + + function addPrefixSuffix() { + // remove trailing space if requested + switch(trailingSpaceAt(o.selection)) { + case "no": + // has no trailing spaces + o.cutStart = o.selStart; + o.cutEnd = o.selEnd; + o.replacement = prefix + o.selection + suffix; + o.newSelStart = o.selStart; + o.newSelEnd = o.selStart + o.replacement.length; + break; + case "yes": + // handle both ends + o.cutStart = o.selEnd - (o.selection.trimStart().length); + o.cutEnd = o.selection.trimEnd().length + o.selStart; + o.replacement = prefix + o.selection.trim() + suffix; + o.newSelStart = o.cutStart; + o.newSelEnd = o.cutStart + o.replacement.length; + break; + case "start": + // handle leading + o.cutStart = o.selEnd - (o.selection.trimStart().length); + o.cutEnd = o.selEnd; + o.replacement = prefix + o.selection.trimStart() + suffix; + o.newSelStart = o.cutStart; + o.newSelEnd = o.cutStart + o.replacement.length; + break; + case "end": + // handle trailing + o.cutStart = o.selStart; + o.cutEnd = o.selection.trimEnd().length + o.selStart; + o.replacement = prefix + o.selection.trimEnd() + suffix; + o.newSelStart = o.selStart; + o.newSelEnd = o.selStart + o.replacement.length; + break; + } + } + + if(o.selStart === o.selEnd) { + // No selection; Create prefix and suffix. Set cursor in between them: ""|"" + togglePrefixSuffix(); + } else if(o.text.substring(o.selStart, o.selStart + prefix.length) === prefix && + o.text.substring(o.selEnd - suffix.length,o.selEnd) === suffix) { // Prefix and suffix are already present, so remove them - operation.cutStart = operation.selStart; - operation.cutEnd = operation.selEnd; - operation.replacement = operation.selection.substring(event.paramObject.prefix.length,operation.selection.length - event.paramObject.suffix.length); - operation.newSelStart = operation.selStart; - operation.newSelEnd = operation.selStart + operation.replacement.length; + removePrefixSuffix(); + } else if(o.text.substring(o.selStart - prefix.length, o.selStart) === prefix && + o.text.substring(o.selEnd, o.selEnd + suffix.length) === suffix) { + // Prefix and suffix are present BUT not selected -> remove them + removePrefixSuffix({"lenPrefix": prefix.length, "lenSuffix": suffix.length}); } else { // Add the prefix and suffix - operation.cutStart = operation.selStart; - operation.cutEnd = operation.selEnd; - operation.replacement = event.paramObject.prefix + operation.selection + event.paramObject.suffix; - operation.newSelStart = operation.selStart; - operation.newSelEnd = operation.selStart + operation.replacement.length; + addPrefixSuffix(); } }; diff --git a/core/modules/filters/encodings.js b/core/modules/filters/encodings.js index a43a15f76..231e4d119 100644 --- a/core/modules/filters/encodings.js +++ b/core/modules/filters/encodings.js @@ -18,8 +18,8 @@ Export our filter functions exports.decodebase64 = function(source,operator,options) { var results = []; - var binary = operator.suffixes && operator.suffixes.indexOf("binary") !== -1; - var urlsafe = operator.suffixes && operator.suffixes.indexOf("urlsafe") !== -1; + var binary = operator.suffixes && operator.suffixes[0].indexOf("binary") !== -1; + var urlsafe = operator.suffixes && operator.suffixes[0].indexOf("urlsafe") !== -1; source(function(tiddler,title) { results.push($tw.utils.base64Decode(title,binary,urlsafe)); }); @@ -28,8 +28,8 @@ exports.decodebase64 = function(source,operator,options) { exports.encodebase64 = function(source,operator,options) { var results = []; - var binary = operator.suffixes && operator.suffixes.indexOf("binary") !== -1; - var urlsafe = operator.suffixes && operator.suffixes.indexOf("urlsafe") !== -1; + var binary = operator.suffixes && operator.suffixes[0].indexOf("binary") !== -1; + var urlsafe = operator.suffixes && operator.suffixes[0].indexOf("urlsafe") !== -1; source(function(tiddler,title) { results.push($tw.utils.base64Encode(title,binary,urlsafe)); }); diff --git a/core/modules/macros/unusedtitle.js b/core/modules/macros/unusedtitle.js index 952bd0264..8a61c425e 100644 --- a/core/modules/macros/unusedtitle.js +++ b/core/modules/macros/unusedtitle.js @@ -16,20 +16,22 @@ exports.name = "unusedtitle"; exports.params = [ {name: "baseName"}, {name: "separator"}, - {name: "template"} + {name: "template"}, + {name: "startCount"} ]; /* Run the macro */ -exports.run = function(baseName,separator,template) { +exports.run = function(baseName,separator,template,startCount) { separator = separator || " "; + startCount = startCount || 0; if(!baseName) { baseName = $tw.language.getString("DefaultNewTiddlerTitle"); } // $tw.wiki.generateNewTitle = function(baseTitle,options) - // options.prefix must be a string! - return this.wiki.generateNewTitle(baseName, {"prefix": separator, "template": template}); + // options.prefix must be a string! + return this.wiki.generateNewTitle(baseName, {"prefix": separator, "template": template, "startCount": startCount}); }; })(); diff --git a/core/modules/parsers/wikiparser/rules/conditional.js b/core/modules/parsers/wikiparser/rules/conditional.js index 23940fd88..c2d6a43b8 100644 --- a/core/modules/parsers/wikiparser/rules/conditional.js +++ b/core/modules/parsers/wikiparser/rules/conditional.js @@ -6,7 +6,7 @@ module-type: wikirule Conditional shortcut syntax ``` -This is a <% if [{something}] %>Elephant<% elseif [{else}] %>Pelican<% else %>Crocodile<% endif %> +This is a <%if [{something}] %>Elephant<%elseif [{else}] %>Pelican<%else%>Crocodile<%endif%> ``` \*/ @@ -27,7 +27,7 @@ exports.init = function(parser) { }; exports.findNextMatch = function(startPos) { - // Look for the next <% if shortcut + // Look for the next <%if shortcut this.matchRegExp.lastIndex = startPos; this.match = this.matchRegExp.exec(this.parser.source); // If not found then return no match diff --git a/core/modules/savers/put.js b/core/modules/savers/put.js index a1ebef4bb..69689e6db 100644 --- a/core/modules/savers/put.js +++ b/core/modules/savers/put.js @@ -20,7 +20,7 @@ Retrieve ETag if available */ var retrieveETag = function(self) { var headers = { - Accept: "*/*;charset=UTF-8" + Accept: "*/*" }; $tw.utils.httpRequest({ url: self.uri(), @@ -55,7 +55,7 @@ var PutSaver = function(wiki) { callback: function(err,data,xhr) { // Check DAV header http://www.webdav.org/specs/rfc2518.html#rfc.section.9.1 if(!err) { - self.serverAcceptsPuts = xhr.status === 200 && !!xhr.getResponseHeader("dav"); + self.serverAcceptsPuts = xhr.status >= 200 && xhr.status < 300 && !!xhr.getResponseHeader("dav"); } } }); diff --git a/core/modules/startup/rootwidget.js b/core/modules/startup/rootwidget.js index d81e07aee..d96d569c3 100644 --- a/core/modules/startup/rootwidget.js +++ b/core/modules/startup/rootwidget.js @@ -52,7 +52,9 @@ exports.startup = function() { basicAuthUsername: params["basic-auth-username"], basicAuthUsernameFromStore: params["basic-auth-username-from-store"], basicAuthPassword: params["basic-auth-password"], - basicAuthPasswordFromStore: params["basic-auth-password-from-store"] + basicAuthPasswordFromStore: params["basic-auth-password-from-store"], + bearerAuthToken: params["bearer-auth-token"], + bearerAuthTokenFromStore: params["bearer-auth-token-from-store"] }); }); $tw.rootWidget.addEventListener("tm-http-cancel-all-requests",function(event) { diff --git a/core/modules/utils/dom/http.js b/core/modules/utils/dom/http.js index 65bdfd1e5..f16f1c512 100644 --- a/core/modules/utils/dom/http.js +++ b/core/modules/utils/dom/http.js @@ -104,6 +104,8 @@ basicAuthUsername: plain username for basic authentication basicAuthUsernameFromStore: name of password store entry containing username basicAuthPassword: plain password for basic authentication basicAuthPasswordFromStore: name of password store entry containing password +bearerAuthToken: plain text token for bearer authentication +bearerAuthTokenFromStore: name of password store entry contain bear authorization token */ function HttpClientRequest(options) { var self = this; @@ -135,8 +137,11 @@ function HttpClientRequest(options) { }); this.basicAuthUsername = options.basicAuthUsername || (options.basicAuthUsernameFromStore && $tw.utils.getPassword(options.basicAuthUsernameFromStore)) || ""; this.basicAuthPassword = options.basicAuthPassword || (options.basicAuthPasswordFromStore && $tw.utils.getPassword(options.basicAuthPasswordFromStore)) || ""; + this.bearerAuthToken = options.bearerAuthToken || (options.bearerAuthTokenFromStore && $tw.utils.getPassword(options.bearerAuthTokenFromStore)) || ""; if(this.basicAuthUsername && this.basicAuthPassword) { this.requestHeaders.Authorization = "Basic " + $tw.utils.base64Encode(this.basicAuthUsername + ":" + this.basicAuthPassword); + } else if(this.bearerAuthToken) { + this.requestHeaders.Authorization = "Bearer " + this.bearerAuthToken; } } 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/utils/utils.js b/core/modules/utils/utils.js index 878f83fbb..234de0c75 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -330,16 +330,18 @@ exports.formatTitleString = function(template,options) { }] ]; while(t.length){ - var matchString = ""; + var matchString = "", + found = false; $tw.utils.each(matches, function(m) { var match = m[0].exec(t); if(match) { + found = true; matchString = m[1].call(null,match); t = t.substr(match[0].length); return false; } }); - if(matchString) { + if(found) { result += matchString; } else { result += t.charAt(0); 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/genesis.js b/core/modules/widgets/genesis.js index c8403a3d4..299be1e48 100644 --- a/core/modules/widgets/genesis.js +++ b/core/modules/widgets/genesis.js @@ -65,6 +65,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 +89,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/keyboard.js b/core/modules/widgets/keyboard.js index ce3162f51..9515f5a3b 100644 --- a/core/modules/widgets/keyboard.js +++ b/core/modules/widgets/keyboard.js @@ -96,13 +96,15 @@ KeyboardWidget.prototype.execute = function() { this.param = this.getAttribute("param",""); this.key = this.getAttribute("key",""); this.tag = this.getAttribute("tag",""); - this.keyInfoArray = $tw.keyboardManager.parseKeyDescriptors(this.key); - if(this.key.substr(0,2) === "((" && this.key.substr(-2,2) === "))") { - this.shortcutTiddlers = []; - var name = this.key.substring(2,this.key.length -2); - $tw.utils.each($tw.keyboardManager.lookupNames,function(platformDescriptor) { - self.shortcutTiddlers.push("$:/config/" + platformDescriptor + "/" + name); - }); + if($tw.keyboardManager) { + this.keyInfoArray = $tw.keyboardManager.parseKeyDescriptors(this.key); + if(this.key.substr(0,2) === "((" && this.key.substr(-2,2) === "))") { + this.shortcutTiddlers = []; + var name = this.key.substring(2,this.key.length -2); + $tw.utils.each($tw.keyboardManager.lookupNames,function(platformDescriptor) { + self.shortcutTiddlers.push("$:/config/" + platformDescriptor + "/" + name); + }); + } } // Make child widgets this.makeChildWidgets(); @@ -126,7 +128,7 @@ KeyboardWidget.prototype.refresh = function(changedTiddlers) { this.assignDomNodeClasses(); } // Update the keyInfoArray if one of its shortcut-config-tiddlers has changed - if(this.shortcutTiddlers && $tw.utils.hopArray(changedTiddlers,this.shortcutTiddlers)) { + if(this.shortcutTiddlers && $tw.utils.hopArray(changedTiddlers,this.shortcutTiddlers) && $tw.keyboardManager) { this.keyInfoArray = $tw.keyboardManager.parseKeyDescriptors(this.key); } return this.refreshChildren(changedTiddlers); diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index efdbba83f..e9bec7682 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -184,7 +184,7 @@ NavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) { // Place a tiddler in edit mode NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) { var editTiddler = $tw.hooks.invokeHook("th-editing-tiddler",event), - win = event.event && event.event.view ? event.event.view : window; + win = event.event && event.event.view ? event.event.view : window; if(!editTiddler) { return false; } @@ -306,7 +306,7 @@ NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) { var title = event.param || event.tiddlerTitle, tiddler = this.wiki.getTiddler(title), storyList = this.getStoryList(), - win = event.event && event.event.view ? event.event.view : window; + win = event.event && event.event.view ? event.event.view : window; // Replace the original tiddler with the draft if(tiddler) { var draftTitle = (tiddler.fields["draft.title"] || "").trim(), @@ -412,7 +412,8 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) { event = $tw.hooks.invokeHook("th-new-tiddler", event); // Get the story details var storyList = this.getStoryList(), - templateTiddler, additionalFields, title, draftTitle, existingTiddler; + templateTiddler, additionalFields, title, draftTitle, existingTiddler, + templateHasTags = false; // Get the template tiddler (if any) if(typeof event.param === "string") { // Get the template tiddler @@ -457,8 +458,10 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) { // Merge tags mergedTags = $tw.utils.pushTop(mergedTags,$tw.utils.parseStringArray(additionalFields.tags)); } + var additionalFieldsHasTags = !!(additionalFields && (additionalFields.tags === "")); if(templateTiddler && templateTiddler.fields.tags) { // Merge tags + templateHasTags = true; mergedTags = $tw.utils.pushTop(mergedTags,templateTiddler.fields.tags); } // Save the draft tiddler @@ -474,7 +477,8 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) { { title: draftTitle, "draft.of": title, - tags: mergedTags + // If template or additionalFields have "tags" even if empty a tags field will be created. + tags: ((mergedTags.length > 0) || templateHasTags || additionalFieldsHasTags) ? mergedTags : undefined },this.wiki.getModificationFields()); this.wiki.addTiddler(draftTiddler); // Update the story to insert the new draft at the top and remove any existing tiddler @@ -526,7 +530,7 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) { var systemMessage = $tw.language.getString("Import/Upgrader/Tiddler/Unselected"); $tw.utils.each(messages,function(message,title) { newFields["message-" + title] = message; - if (message.indexOf(systemMessage) !== -1) { + if(message.indexOf(systemMessage) !== -1) { newFields["selection-" + title] = "unchecked"; } }); diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index eb84fab4a..14e90ba2d 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -335,7 +335,7 @@ Widget.prototype.makeFakeWidgetWithVariables = function(variables) { }; } else { opts = opts || {}; - opts.variables = $tw.utils.extend(variables,opts.variables); + opts.variables = $tw.utils.extend({},variables,opts.variables); return self.getVariableInfo(name,opts); }; }, @@ -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 5673c9e3b..29a839c7a 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -194,18 +194,24 @@ options.prefix must be a string */ exports.generateNewTitle = function(baseTitle,options) { options = options || {}; - var c = 0, - title = baseTitle, - template = options.template, + var title = baseTitle, + template = options.template || "", + // test if .startCount is a positive integer. If not set to 0 + c = (parseInt(options.startCount,10) > 0) ? parseInt(options.startCount,10) : 0, prefix = (typeof(options.prefix) === "string") ? options.prefix : " "; + if (template) { // "count" is important to avoid an endless loop in while(...)!! template = (/\$count:?(\d+)?\$/i.test(template)) ? template : template + "$count$"; - title = $tw.utils.formatTitleString(template,{"base":baseTitle,"separator":prefix,"counter":c}); + // .formatTitleString() expects strings as input + title = $tw.utils.formatTitleString(template,{"base":baseTitle,"separator":prefix,"counter":c+""}); while(this.tiddlerExists(title) || this.isShadowTiddler(title) || this.findDraft(title)) { - title = $tw.utils.formatTitleString(template,{"base":baseTitle,"separator":prefix,"counter":(++c)}); + title = $tw.utils.formatTitleString(template,{"base":baseTitle,"separator":prefix,"counter":(++c)+""}); } } else { + if (c > 0) { + title = baseTitle + prefix + c; + } while(this.tiddlerExists(title) || this.isShadowTiddler(title) || this.findDraft(title)) { title = baseTitle + prefix + (++c); } diff --git a/core/palettes/FlexokiDark.tid b/core/palettes/FlexokiDark.tid new file mode 100644 index 000000000..73c695f40 --- /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: #ffff00 +highlight-foreground: #000000 +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: #2b7b73 +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: #e5e5e5 +wikilist-item: #fff +wikilist-info: #000 +wikilist-title: #666 +wikilist-title-svg: <> +wikilist-url: #aaa +wikilist-button-open: #4fb82b +wikilist-button-open-hover: green +wikilist-button-reveal: #5778d8 +wikilist-button-reveal-hover: blue +wikilist-button-remove: #d85778 +wikilist-button-remove-hover: red +wikilist-toolbar-background: #d3d3d3 +wikilist-toolbar-foreground: #888 +wikilist-droplink-dragover: rgba(255,192,192,0.5) +wikilist-button-background: #acacac +wikilist-button-foreground: #000 \ No newline at end of file diff --git a/core/palettes/FlexokiLight.tid b/core/palettes/FlexokiLight.tid new file mode 100644 index 000000000..200e6ecad --- /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: #fff +dropdown-tab-background: #ececec +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: #ffff00 +highlight-foreground: #000000 +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: #fff +wikilist-info: #000 +wikilist-title: #666 +wikilist-title-svg: <> +wikilist-url: #aaa +wikilist-button-open: #4fb82b +wikilist-button-open-hover: green +wikilist-button-reveal: #5778d8 +wikilist-button-reveal-hover: blue +wikilist-button-remove: #d85778 +wikilist-button-remove-hover: red +wikilist-toolbar-background: #d3d3d3 +wikilist-toolbar-foreground: #888 +wikilist-droplink-dragover: rgba(255,192,192,0.5) +wikilist-button-background: #acacac +wikilist-button-foreground: #000 diff --git a/core/palettes/Vanilla.tid b/core/palettes/Vanilla.tid index 76307acee..d981a485e 100644 --- a/core/palettes/Vanilla.tid +++ b/core/palettes/Vanilla.tid @@ -32,7 +32,7 @@ dragger-background: <> dragger-foreground: <> dropdown-background: <> dropdown-border: <> -dropdown-tab-background-selected: #fff +dropdown-tab-background-selected: #ffffff dropdown-tab-background: #ececec dropzone-background: rgba(0,200,0,0.7) external-link-background-hover: inherit @@ -54,7 +54,7 @@ modal-border: #999999 modal-footer-background: #f5f5f5 modal-footer-border: #dddddd modal-header-border: #eeeeee -muted-foreground: #bbb +muted-foreground: #bbbbbb network-activity-foreground: #448844 notification-background: #ffffdd notification-border: #999999 @@ -98,7 +98,7 @@ tab-foreground: #666666 table-border: #dddddd table-footer-background: #a8a8a8 table-header-background: #f0f0f0 -tag-background: #ec6 +tag-background: #eecc66 tag-foreground: #ffffff testcase-accent-level-1: #c1eaff testcase-accent-level-2: #E3B740 @@ -132,11 +132,11 @@ toolbar-done-button: untagged-background: #999999 very-muted-foreground: #888888 wikilist-background: #e5e5e5 -wikilist-item: #fff -wikilist-info: #000 -wikilist-title: #666 +wikilist-item: #ffffff +wikilist-info: #000000 +wikilist-title: #666666 wikilist-title-svg: <> -wikilist-url: #aaa +wikilist-url: #aaaaaa wikilist-button-open: #4fb82b wikilist-button-open-hover: green wikilist-button-reveal: #5778d8 @@ -144,7 +144,7 @@ wikilist-button-reveal-hover: blue wikilist-button-remove: #d85778 wikilist-button-remove-hover: red wikilist-toolbar-background: #d3d3d3 -wikilist-toolbar-foreground: #888 +wikilist-toolbar-foreground: #888888 wikilist-droplink-dragover: rgba(255,192,192,0.5) wikilist-button-background: #acacac -wikilist-button-foreground: #000 +wikilist-button-foreground: #000000 diff --git a/core/templates/server/static.tiddler.wikitext.tid b/core/templates/server/static.tiddler.wikitext.tid index 2d2bdaba6..1f2ee3cf4 100644 --- a/core/templates/server/static.tiddler.wikitext.tid +++ b/core/templates/server/static.tiddler.wikitext.tid @@ -1,23 +1,23 @@ title: $:/core/templates/server/static.tiddler.wikitext \whitespace trim -
+

<$text text=<>/>

-
+
<$link to={{!!modifier}}> <$view field="modifier"/> <$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/>
-
+
<$list filter="[all[current]tags[]sort[title]]"> encodeuricomponent[]] }}}> <$macrocall $name="tag-pill" tag=<>/>
-
+
<$transclude mode="block"/>
diff --git a/core/templates/social-metadata.tid b/core/templates/social-metadata.tid index f742621e8..eb89418bb 100644 --- a/core/templates/social-metadata.tid +++ b/core/templates/social-metadata.tid @@ -4,7 +4,7 @@ tags: $:/tags/RawMarkupWikified \procedure meta-plain(name,source,name-attribute:"name") \whitespace trim <%if [has[text]] %> - <meta <$text text=<>/>="<$text text=<>/>" content="<$text text={{{ [get[text]encodehtml[]] }}}/>"> + <meta <$text text=<>/>="<$text text=<>/>" content="<$text text={{{ [get[text]encodehtml[]] }}}/>"> <$text text={{{ [charcode[10]] }}}/> <%endif%> \end meta-plain @@ -13,7 +13,7 @@ tags: $:/tags/RawMarkupWikified \whitespace trim <%if [has[text]] %> <$wikify name="html" text={{{ [get[text]] }}} output="text"> - <meta <$text text=<>/>="<$text text=<>/>" content="<$text text={{{ [encodehtml[]] }}}/>"> + <meta <$text text=<>/>="<$text text=<>/>" content="<$text text={{{ [encodehtml[]] }}}/>"> <$text text={{{ [charcode[10]] }}}/> <%endif%> diff --git a/core/templates/tiddlywiki5.html.tid b/core/templates/tiddlywiki5.html.tid index a94ae2693..721b3d9ce 100644 --- a/core/templates/tiddlywiki5.html.tid +++ b/core/templates/tiddlywiki5.html.tid @@ -57,3 +57,4 @@ title: $:/core/templates/tiddlywiki5.html `{{{ [enlisttag[$:/tags/RawMarkupWikified/BottomBody]] ||$:/core/templates/raw-static-tiddler}}}` ` + diff --git a/core/ui/Actions/new-journal.tid b/core/ui/Actions/new-journal.tid index 9df31cb97..9d663e537 100644 --- a/core/ui/Actions/new-journal.tid +++ b/core/ui/Actions/new-journal.tid @@ -2,10 +2,10 @@ title: $:/core/ui/Actions/new-journal tags: $:/tags/Actions description: create a new journal tiddler -\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$ \whitespace trim -<$vars journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}> -<$wikify name="journalTitle" text="<$macrocall $name='now' format=<>/>"> +\function get-tags() [] [] +[join[ ]] +<$let journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}> +<$wikify name="journalTitle" text="<$transclude $variable='now' format=<>/>"> <$reveal type="nomatch" state=<> text=""> <$action-sendmessage $message="tm-new-tiddler" title=<> tags=<> text={{{ [get[]] }}}/> @@ -13,4 +13,4 @@ description: create a new journal tiddler <$action-sendmessage $message="tm-new-tiddler" title=<> tags=<> text=<>/> - + diff --git a/core/ui/Actions/new-tiddler.tid b/core/ui/Actions/new-tiddler.tid index f71331327..847130800 100644 --- a/core/ui/Actions/new-tiddler.tid +++ b/core/ui/Actions/new-tiddler.tid @@ -2,8 +2,8 @@ title: $:/core/ui/Actions/new-tiddler tags: $:/tags/Actions description: create a new empty tiddler -\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$ \whitespace trim -<$vars textFieldTags={{$:/config/NewTiddler/Tags}} tagsFieldTags={{$:/config/NewTiddler/Tags!!tags}}> +\function get-tags() [] [] +[join[ ]] +<$let textFieldTags={{$:/config/NewTiddler/Tags}} tagsFieldTags={{$:/config/NewTiddler/Tags!!tags}}> <$action-sendmessage $message="tm-new-tiddler" tags=<>/> - + diff --git a/core/ui/AdvancedSearch/Filter.tid b/core/ui/AdvancedSearch/Filter.tid index 5b82f9b32..7369e4c40 100644 --- a/core/ui/AdvancedSearch/Filter.tid +++ b/core/ui/AdvancedSearch/Filter.tid @@ -2,76 +2,101 @@ 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=<>/>"/> + 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}]" - emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />"> +<$list filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]"> + <$list-empty> + <$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]"/> + <$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/> <$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/> \end -\define input-accept-actions() +\procedure input-accept-actions() \whitespace trim -<$list - filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" - emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>"> - <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> +<$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"> + <$list-empty> + <$list filter="[get[text]!is[missing]] :else[get[text]is[shadow]]"> + <$action-navigate $to={{{ [get[text]] }}}/> + + <$/list-empty> + <$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]]" - emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/>"> - <$list filter="[<__tiddler__>get[text]minlength[1]]"> - <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> - -\end -\whitespace trim -<> - -<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> -<$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>"> -
-

<>

-<$list filter={{$:/temp/advancedsearch}}> -addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}> -<$transclude tiddler="$:/core/ui/ListItemTemplate"/> - +<$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"> + <$list-empty> + <$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={{{ [get[text]] }}}/> + + + + <$list filter="[get[text]minlength[1]]"> + <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [get[text]] }}}/> + +\end + +\whitespace trim + +<> + + - + +<$reveal state="$:/temp/advancedsearch" type="nomatch" text="" tag="div" class="tc-search-results"> + <$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>"> +

<>

+ <$list filter={{$:/temp/advancedsearch}}> + addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] :and[then[]else[tc-list-item-selected]] }}}> + <$transclude tiddler="$:/core/ui/ListItemTemplate"/> + + + diff --git a/core/ui/AdvancedSearch/Shadows.tid b/core/ui/AdvancedSearch/Shadows.tid index e2ffa305f..1c7f15087 100644 --- a/core/ui/AdvancedSearch/Shadows.tid +++ b/core/ui/AdvancedSearch/Shadows.tid @@ -3,18 +3,27 @@ tags: $:/tags/AdvancedSearch caption: {{$:/language/Search/Shadows/Caption}} first-search-filter: [all[shadows]searchsort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -\define lingo-base() $:/language/Search/ +\procedure lingo-base() $:/language/Search/ -\define set-next-input-tab(beforeafter:"after") -<$macrocall $name="change-input-tab" +\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}!match{$:/temp/advancedsearch/input}]" @@ -25,22 +34,22 @@ first-search-filter: [all[shadows]searchsort[title]limit[250]] -[[$:/ <$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/> \end -\define input-accept-actions() +\procedure input-accept-actions() \whitespace trim <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" - emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>"> - <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> + emptyMessage="<$list filter='[get[text]!is[missing]] :else[get[text]is[shadow]]'><$action-navigate $to={{{ [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]]" - emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/>"> - <$list filter="[<__tiddler__>get[text]minlength[1]]"> - <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> + emptyMessage="<$list filter='[get[text]!is[missing]] :else[get[text]is[shadow]]'><$list filter='[get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [get[text]] }}}/>"> + <$list filter="[get[text]minlength[1]]"> + <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [get[text]] }}}/> \end @@ -50,8 +59,8 @@ first-search-filter: [all[shadows]searchsort[title]limit[250]] -[[$:/