tiddlywiki 5.3.1 → 5.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +9 -2
- package/bin/build-site.sh +25 -5
- package/bin/ci-test.sh +16 -0
- package/boot/boot.js +12 -0
- package/core/language/en-GB/Exporters.multids +1 -1
- package/core/language/en-GB/Help/commands.tid +1 -1
- package/core/language/en-GB/Help/savewikifolder.tid +2 -2
- package/core/language/en-GB/Help/server.tid +1 -1
- package/core/language/en-GB/Types/image_svg_xml.tid +1 -1
- package/core/language/en-GB/Types/image_x-icon.tid +1 -1
- package/core/modules/commands/savetiddlers.js +1 -1
- package/core/modules/editor/engines/framed.js +1 -1
- package/core/modules/editor/engines/simple.js +1 -1
- package/core/modules/filters/all.js +5 -5
- package/core/modules/filters/encodings.js +6 -2
- package/core/modules/filters/json-ops.js +95 -1
- package/core/modules/filters/listops.js +1 -0
- package/core/modules/parsers/textparser.js +5 -4
- package/core/modules/parsers/wikiparser/rules/conditional.js +120 -0
- package/core/modules/parsers/wikiparser/wikiparser.js +33 -8
- package/core/modules/savers/github.js +1 -1
- package/core/modules/startup/windows.js +2 -1
- package/core/modules/syncer.js +160 -122
- package/core/modules/utils/dom/dom.js +3 -3
- package/core/modules/utils/dom/http.js +1 -1
- package/core/modules/utils/fakedom.js +5 -1
- package/core/modules/utils/utils.js +27 -4
- package/core/modules/widgets/browse.js +10 -0
- package/core/modules/widgets/button.js +15 -3
- package/core/modules/widgets/checkbox.js +11 -0
- package/core/modules/widgets/draggable.js +16 -5
- package/core/modules/widgets/droppable.js +14 -2
- package/core/modules/widgets/image.js +19 -14
- package/core/modules/widgets/link.js +12 -2
- package/core/modules/widgets/list.js +179 -19
- package/core/modules/widgets/radio.js +4 -0
- package/core/modules/widgets/range.js +4 -0
- package/core/modules/widgets/scrollable.js +66 -1
- package/core/modules/widgets/select.js +34 -26
- package/core/modules/widgets/transclude.js +19 -6
- package/core/modules/widgets/widget.js +35 -19
- package/core/modules/wiki.js +2 -2
- package/core/templates/html-json-skinny-tiddler.tid +1 -2
- package/core/templates/html-json-tiddler.tid +1 -1
- package/core/templates/store.area.template.html.tid +6 -8
- package/core/ui/ControlPanel/Basics.tid +2 -2
- package/core/ui/EditTemplate/body/default.tid +9 -8
- package/core/ui/EditTemplate/fields.tid +2 -2
- package/core/ui/EditTemplate/type.tid +1 -1
- package/core/ui/EditorToolbar/preview.tid +5 -8
- package/core/ui/PageTemplate.tid +1 -1
- package/core/ui/ViewTemplate/subtitle.tid +2 -5
- package/core/wiki/config/OfficialPluginLibrary.tid +1 -1
- package/core/wiki/macros/colour-picker.tid +6 -6
- package/core/wiki/macros/image-picker.tid +5 -5
- package/core/wiki/macros/list.tid +95 -78
- package/core/wiki/macros/tabs.tid +9 -1
- package/core/wiki/macros/tag-picker.tid +2 -2
- package/core/wiki/macros/tag.tid +2 -1
- package/core/wiki/macros/toc.tid +2 -2
- package/editions/de-AT/tiddlers/HelloThere.tid +2 -2
- package/editions/de-AT/tiddlers/community/Fur_Entwickler.tid +1 -1
- package/editions/de-AT-server/tiddlers/system/favicon.png +0 -0
- package/editions/{es-ES-server/tiddlers/system/favicon.ico.meta → de-AT-server/tiddlers/system/favicon.png.meta} +1 -1
- package/editions/dev/tiddlers/images/favicon.png +0 -0
- package/editions/{de-AT-server/tiddlers/system/favicon.ico.meta → dev/tiddlers/images/favicon.png.meta} +1 -1
- package/editions/dev/tiddlers/new/HookMechanism.tid +28 -3
- package/editions/empty/tiddlywiki.info +5 -2
- package/editions/es-ES/tiddlers/Forums.tid +4 -5
- package/editions/es-ES/tiddlers/HelloThere.tid +2 -2
- package/editions/es-ES/tiddlers/Typography.tid +1 -1
- package/editions/es-ES/tiddlers/images/favicon.png +0 -0
- package/editions/{dev/tiddlers/images/favicon.ico.meta → es-ES/tiddlers/images/favicon.png.meta} +1 -1
- package/editions/es-ES/tiddlers/images/green_favicon.png +0 -0
- package/editions/es-ES/tiddlers/images/{green_favicon.ico.meta → green_favicon.png.meta} +1 -1
- package/editions/es-ES-server/tiddlers/system/favicon.png +0 -0
- package/editions/{es-ES/tiddlers/images/favicon.ico.meta → es-ES-server/tiddlers/system/favicon.png.meta} +1 -1
- package/editions/fr-FR/tiddlers/images/favicon.png +0 -0
- package/editions/fr-FR/tiddlers/images/favicon.png.meta +2 -0
- package/editions/fr-FR/tiddlers/images/green_favicon.png +0 -0
- package/editions/fr-FR/tiddlers/images/{green_favicon.ico.meta → green_favicon.png.meta} +1 -1
- package/editions/fr-FR-server/tiddlers/system/favicon.png +0 -0
- package/editions/fr-FR-server/tiddlers/system/favicon.png.meta +2 -0
- package/editions/highlightdemo/tiddlywiki.info +1 -1
- package/editions/ja-JP/tiddlers/images/favicon.png +0 -0
- package/editions/ja-JP/tiddlers/images/favicon.png.meta +2 -0
- package/editions/ja-JP/tiddlers/images/green_favicon.png +0 -0
- package/editions/ja-JP/tiddlers/images/{green_favicon.ico.meta → green_favicon.png.meta} +1 -1
- package/editions/katexdemo/tiddlywiki.info +1 -1
- package/editions/ko-KR/tiddlers/images/favicon.png +0 -0
- package/editions/ko-KR/tiddlers/images/favicon.png.meta +2 -0
- package/editions/ko-KR/tiddlers/images/green_favicon.png +0 -0
- package/editions/ko-KR/tiddlers/images/{green_favicon.ico.meta → green_favicon.png.meta} +1 -1
- package/editions/ko-KR-server/tiddlers/system/favicon.png +0 -0
- package/editions/ko-KR-server/tiddlers/system/favicon.png.meta +2 -0
- package/editions/pluginlibrary/tiddlywiki.info +2 -2
- package/editions/prerelease/tiddlers/{Release 5.3.2.tid → Release 5.3.4.tid } +26 -25
- package/editions/prerelease/tiddlers/system/PrereleaseLocalPluginLibrary.tid +1 -1
- package/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid +1 -1
- package/editions/prerelease/tiddlers/system/favicon.png +0 -0
- package/editions/prerelease/tiddlers/system/favicon.png.meta +2 -0
- package/editions/prerelease/tiddlers/system/temp-my-scroll-position.tid +3 -0
- package/editions/resumebuilder/tiddlywiki.info +1 -1
- package/editions/server/tiddlywiki.info +1 -1
- package/editions/server-external-js/tiddlywiki.info +1 -1
- package/editions/test/playwright.spec.js +25 -0
- package/editions/test/tiddlers/tests/data/conditionals/Basic.tid +26 -0
- package/editions/test/tiddlers/tests/data/conditionals/BlockMode.tid +37 -0
- package/editions/test/tiddlers/tests/data/conditionals/Else.tid +26 -0
- package/editions/test/tiddlers/tests/data/conditionals/Elseif.tid +32 -0
- package/editions/test/tiddlers/tests/data/conditionals/MissingEndIf.tid +26 -0
- package/editions/test/tiddlers/tests/data/conditionals/MultipleResults.tid +12 -0
- package/editions/test/tiddlers/tests/data/conditionals/Nested.tid +38 -0
- package/editions/test/tiddlers/tests/data/conditionals/NestedElseif.tid +60 -0
- package/editions/test/tiddlers/tests/data/list-widget/WithEmptyParagraphTemplate.tid +13 -0
- package/editions/test/tiddlers/tests/data/list-widget/WithExplicitTemplates.tid +29 -0
- package/editions/test/tiddlers/tests/data/list-widget/WithExplicitTemplatesInBlockMode.tid +32 -0
- package/editions/test/tiddlers/tests/data/list-widget/WithExplicitTemplatesOverriddenByAttributes.tid +33 -0
- package/editions/test/tiddlers/tests/data/list-widget/WithJoinTemplate.tid +30 -0
- package/editions/test/tiddlers/tests/data/list-widget/WithJoinTemplateInBlockMode.tid +32 -0
- package/editions/test/tiddlers/tests/data/list-widget/WithLimit.tid +25 -0
- package/editions/test/tiddlers/tests/data/list-widget/WithMissingTemplate.tid +26 -0
- package/editions/test/tiddlers/tests/data/pragmas/WhitespaceAfterPragma.tid +64 -0
- package/editions/test/tiddlers/tests/data/pragmas/WhitespaceNoPragma.tid +32 -0
- package/editions/test/tiddlers/tests/data/transclude/CustomWidget-CodeblockOverride-TextParser.tid +20 -0
- package/editions/test/tiddlers/tests/data/transclude/Variable-Refreshing.tid +27 -0
- package/editions/test/tiddlers/tests/data/transclude/Variable-Static.tid +15 -0
- package/editions/test/tiddlers/tests/data/widgets/DataAttributes/ButtonWidget-DataAttributes.tid +27 -0
- package/editions/test/tiddlers/tests/data/widgets/DataAttributes/CheckboxWidget-DataAttributes.tid +22 -0
- package/editions/test/tiddlers/tests/data/widgets/DataAttributes/DraggableWidget-DataAttributes.tid +27 -0
- package/editions/test/tiddlers/tests/data/widgets/DataAttributes/DroppableWidget-DataAttributes.tid +27 -0
- package/editions/test/tiddlers/tests/data/widgets/DataAttributes/LinkWidget-DataAttributes.tid +27 -0
- package/editions/test/tiddlers/tests/data/widgets/DataAttributes/OrderedStyleAttributes.tid +15 -0
- package/editions/test/tiddlers/tests/data/widgets/DataAttributes/SelectWidget-DataAttributes.tid +27 -0
- package/editions/test/tiddlers/tests/data/widgets/ElementWidgetEventAttributes.tid +15 -0
- package/editions/test/tiddlers/tests/data/widgets/ElementWidgetStyleAttributes.tid +15 -0
- package/editions/test/tiddlers/tests/test-filters.js +1 -0
- package/editions/test/tiddlers/tests/test-json-filters.js +40 -0
- package/editions/test/tiddlers/tests/test-utils.js +23 -0
- package/editions/test/tiddlers/tests/test-widget.js +62 -0
- package/editions/tw.org/tiddlers/$__favicon.ico.png +0 -0
- package/editions/tw.org/tiddlywiki.info +1 -1
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/classic.tiddlywiki.com.png +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/{classic.tiddlywiki.com.ico.meta → classic.tiddlywiki.com.png.meta} +1 -1
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/links.tiddlywiki.org.png +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/{links.tiddlywiki.org.ico.meta → links.tiddlywiki.org.png.meta} +1 -1
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/tiddlywiki.com.dev.png +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/{tiddlywiki.com.dev.ico.meta → tiddlywiki.com.dev.png.meta} +1 -1
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/tiddlywiki.com.png +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/{tiddlywiki.com.ico.meta → tiddlywiki.com.png.meta} +1 -1
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/tiddlywiki.com.prerelease.png +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/{tiddlywiki.com.prerelease.ico.meta → tiddlywiki.com.prerelease.png.meta} +1 -1
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/tiddlywiki.com.upgrade.png +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/{tiddlywiki.com.upgrade.ico.meta → tiddlywiki.com.upgrade.png.meta} +1 -1
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/tiddlywiki.org.png +0 -0
- package/editions/tw5.com/tiddlers/about/Archive.tid +82 -0
- package/editions/tw5.com/tiddlers/community/Chinese Community.tid +20 -0
- package/editions/tw5.com/tiddlers/community/editions/Tidme by oflg.tid +16 -0
- package/editions/tw5.com/tiddlers/community/plugins/FSRS4TW by oflg.tid +10 -0
- package/editions/tw5.com/tiddlers/community/resources/_Timimi_ Extension and executable by Riz.tid +3 -1
- package/editions/tw5.com/tiddlers/concepts/Macros.tid +7 -3
- package/editions/tw5.com/tiddlers/concepts/Title List.tid +5 -1
- package/editions/tw5.com/tiddlers/filters/decodebase64 Operator.tid +6 -1
- package/editions/tw5.com/tiddlers/filters/encodebase64 Operator.tid +6 -1
- package/editions/tw5.com/tiddlers/filters/examples/jsonset.tid +59 -0
- package/editions/tw5.com/tiddlers/filters/examples/jsonstringify Operator (Examples).tid +7 -5
- package/editions/tw5.com/tiddlers/filters/examples/stringify_Operator_(Examples).tid +5 -3
- package/editions/tw5.com/tiddlers/filters/jsonextract.tid +8 -0
- package/editions/tw5.com/tiddlers/filters/jsonget.tid +8 -0
- package/editions/tw5.com/tiddlers/filters/jsonset.tid +64 -0
- package/editions/tw5.com/tiddlers/filters/jsonstringify Operator.tid +14 -15
- package/editions/tw5.com/tiddlers/filters/jsontype.tid +8 -0
- package/editions/tw5.com/tiddlers/filters/stringify_Operator.tid +12 -15
- package/editions/tw5.com/tiddlers/filters/syntax/Filter Expression.tid +1 -1
- package/editions/tw5.com/tiddlers/hellothere/HelloThere.tid +6 -1
- package/editions/tw5.com/tiddlers/howtos/Constructing JSON tiddlers.tid +3 -3
- package/editions/tw5.com/tiddlers/images/Favicon template.svg +296 -0
- package/editions/tw5.com/tiddlers/images/Favicon template.svg.meta +3 -0
- package/editions/tw5.com/tiddlers/images/New Release Banner.png +0 -0
- package/editions/tw5.com/tiddlers/images/favicon.png +0 -0
- package/editions/tw5.com/tiddlers/images/favicon.png.meta +2 -0
- package/editions/tw5.com/tiddlers/images/green_favicon.png +0 -0
- package/editions/tw5.com/tiddlers/images/green_favicon.png.meta +2 -0
- package/editions/tw5.com/tiddlers/macros/CoreMacros.tid +1 -1
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-delete-tiddler.tid +3 -1
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-open-window.tid +12 -5
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-permalink.tid +1 -1
- package/editions/tw5.com/tiddlers/pragmas/Pragma_ _define.tid +3 -1
- package/editions/tw5.com/tiddlers/pragmas/Pragma_ _whitespace.tid +7 -3
- package/editions/tw5.com/tiddlers/procedures/Procedure Definitions.tid +3 -1
- package/editions/tw5.com/tiddlers/releasenotes/BetaReleases.tid +2 -2
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.0.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.1.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.10.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.11.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.12.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.13.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.14.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.15.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.16.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.17.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.18.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.19.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.2.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.20.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.21.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.22.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.23.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.3.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.4.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.5.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.6.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.7.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.8.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.9.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.0.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.1.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.2.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.3.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.4.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.5.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.6.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.7.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.3.0.tid +1 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.3.1.tid +8 -1
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.3.2.tid +184 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.3.3.tid +30 -0
- package/editions/tw5.com/tiddlers/releasenotes/Releases.tid +3 -1
- package/editions/tw5.com/tiddlers/releasenotes/alpha/AlphaReleases.tid +2 -2
- package/editions/tw5.com/tiddlers/system/tw5.com-styles.tid +5 -0
- package/editions/tw5.com/tiddlers/widgets/BrowseWidget.tid +3 -1
- package/editions/tw5.com/tiddlers/widgets/ButtonWidget.tid +3 -1
- package/editions/tw5.com/tiddlers/widgets/CheckboxWidget.tid +3 -1
- package/editions/tw5.com/tiddlers/widgets/Custom Widgets.tid +3 -1
- package/editions/tw5.com/tiddlers/widgets/DraggableWidget.tid +3 -2
- package/editions/tw5.com/tiddlers/widgets/DroppableWidget.tid +3 -1
- package/editions/tw5.com/tiddlers/widgets/GenesisWidget.tid +3 -2
- package/editions/tw5.com/tiddlers/widgets/ImageWidget.tid +2 -1
- package/editions/tw5.com/tiddlers/widgets/LinkWidget.tid +3 -1
- package/editions/tw5.com/tiddlers/widgets/ListWidget.tid +25 -2
- package/editions/tw5.com/tiddlers/widgets/RadioWidget.tid +3 -1
- package/editions/tw5.com/tiddlers/widgets/RangeWidget.tid +3 -1
- package/editions/tw5.com/tiddlers/widgets/ScrollableWidget.tid +27 -2
- package/editions/tw5.com/tiddlers/widgets/SelectWidget.tid +4 -1
- package/editions/tw5.com/tiddlers/widgets/SetWidget.tid +17 -1
- package/editions/tw5.com/tiddlers/widgets/TranscludeWidget.tid +2 -2
- package/editions/tw5.com/tiddlers/wikitext/Conditional Shortcut Syntax.tid +62 -0
- package/editions/tw5.com/tiddlers/wikitext/Transclusion and Substitution.tid +3 -3
- package/editions/tw5.com/tiddlywiki.info +9 -3
- package/editions/tw5.com-server/tiddlers/system/tiddlywiki.com.server.png +0 -0
- package/editions/tw5.com-server/tiddlers/system/tiddlywiki.com.server.png.meta +2 -0
- package/editions/zh-Hans/tiddlers/images/favicon.png +0 -0
- package/editions/zh-Hans/tiddlers/images/favicon.png.meta +2 -0
- package/editions/zh-Hans/tiddlers/images/green_favicon.png +0 -0
- package/editions/zh-Hans/tiddlers/images/green_favicon.png.meta +2 -0
- package/editions/zh-Hant/tiddlers/images/favicon.png +0 -0
- package/editions/zh-Hant/tiddlers/images/favicon.png.meta +2 -0
- package/editions/zh-Hant/tiddlers/images/green_favicon.png +0 -0
- package/editions/zh-Hant/tiddlers/images/green_favicon.png.meta +2 -0
- package/languages/de-DE/Exporters.multids +1 -1
- package/languages/de-DE/Help/commands.tid +2 -2
- package/languages/de-DE/Help/server.tid +1 -1
- package/languages/de-DE/Types/image_x-icon.tid +1 -1
- package/languages/es-ES/Buttons.multids +2 -0
- package/languages/es-ES/Fields.multids +4 -0
- package/languages/es-ES/Help/listen.tid +1 -1
- package/languages/es-ES/Help/savewikifolder.tid +16 -1
- package/languages/es-ES/Help/server.tid +1 -1
- package/languages/es-ES/Misc.multids +3 -0
- package/languages/es-ES/SiteTitle.tid +1 -1
- package/languages/pl-PL/Exporters.multids +1 -1
- package/languages/pl-PL/Help/commands.tid +1 -1
- package/languages/pl-PL/Help/savewikifolder.tid +3 -1
- package/languages/pl-PL/Help/server.tid +1 -1
- package/languages/zh-Hans/Exporters.multids +1 -1
- package/languages/zh-Hans/Help/commands.tid +1 -1
- package/languages/zh-Hans/Help/server.tid +1 -1
- package/languages/zh-Hans/Types/image_svg_xml.tid +1 -1
- package/languages/zh-Hans/Types/image_x-icon.tid +1 -1
- package/languages/zh-Hant/Exporters.multids +1 -1
- package/languages/zh-Hant/Help/commands.tid +1 -1
- package/languages/zh-Hant/Help/server.tid +1 -1
- package/languages/zh-Hant/Types/image_svg_xml.tid +1 -1
- package/languages/zh-Hant/Types/image_x-icon.tid +1 -1
- package/licenses/cla-individual.md +12 -0
- package/package.json +4 -1
- package/playwright.config.js +46 -0
- package/plugins/tiddlywiki/codemirror/styles.tid +5 -0
- package/plugins/tiddlywiki/comments/styles.tid +8 -8
- package/plugins/tiddlywiki/dynannotate/docs/readme.tid +1 -0
- package/plugins/tiddlywiki/dynannotate/modules/dynannotate.js +28 -27
- package/plugins/tiddlywiki/evernote/modules/enex-deserializer.js +82 -23
- package/plugins/tiddlywiki/evernote/readme.tid +1 -0
- package/plugins/tiddlywiki/evernote/samples/sample-enex-with-image.xml.enex +2 -2
- package/plugins/tiddlywiki/jasmine/run-wiki-based-tests.js +1 -1
- package/plugins/tiddlywiki/qrcode/barcodereader.js +90 -0
- package/plugins/tiddlywiki/qrcode/docs/barcodereader.tid +44 -0
- package/plugins/tiddlywiki/qrcode/{doc/usage.tid → docs/makeqr.tid} +4 -4
- package/plugins/tiddlywiki/qrcode/docs.tid +3 -0
- package/plugins/tiddlywiki/qrcode/{MakeContactQR.tid → examples/make/MakeContactQR.tid} +1 -1
- package/plugins/tiddlywiki/qrcode/{MakeGenericQR.tid → examples/make/MakeGenericQR.tid} +1 -1
- package/plugins/tiddlywiki/qrcode/{MakeWifiQR.tid → examples/make/MakeWifiQR.tid} +1 -1
- package/plugins/tiddlywiki/qrcode/examples/make/make.tid +5 -0
- package/plugins/tiddlywiki/qrcode/examples/read/BarCodeReader.tid +17 -0
- package/plugins/tiddlywiki/qrcode/examples/read/read.tid +5 -0
- package/plugins/tiddlywiki/qrcode/examples.tid +3 -0
- package/plugins/tiddlywiki/qrcode/files/html5-qrcode/LICENSE +201 -0
- package/plugins/tiddlywiki/qrcode/files/html5-qrcode/README.md +398 -0
- package/plugins/tiddlywiki/qrcode/files/html5-qrcode/html5-qrcode.min.js +1 -0
- package/plugins/tiddlywiki/qrcode/files/tiddlywiki.files +20 -4
- package/plugins/tiddlywiki/qrcode/makeqr.js +1 -1
- package/plugins/tiddlywiki/qrcode/plugin.info +1 -1
- package/plugins/tiddlywiki/qrcode/readme.tid +15 -0
- package/plugins/tiddlywiki/tiddlyweb/html-json-skinny-tiddler.tid +1 -2
- package/plugins/tiddlywiki/tiddlyweb/html-json-tiddler.tid +1 -2
- package/plugins/tiddlywiki/upgrade/UpgradeWizard.tid +2 -2
- package/plugins/tiddlywiki/upgrade/favicon.png +0 -0
- package/plugins/tiddlywiki/upgrade/favicon.png.meta +2 -0
- package/readme.md +1 -1
- package/themes/tiddlywiki/vanilla/base.tid +37 -7
- package/themes/tiddlywiki/vanilla/settings.multids +1 -1
- package/editions/de-AT-server/tiddlers/system/favicon.ico +0 -0
- package/editions/dev/tiddlers/images/favicon.ico +0 -0
- package/editions/es-ES/tiddlers/images/favicon.ico +0 -0
- package/editions/es-ES/tiddlers/images/green_favicon.ico +0 -0
- package/editions/es-ES-server/tiddlers/system/favicon.ico +0 -0
- package/editions/fr-FR/tiddlers/images/favicon.ico +0 -0
- package/editions/fr-FR/tiddlers/images/favicon.ico.meta +0 -2
- package/editions/fr-FR/tiddlers/images/green_favicon.ico +0 -0
- package/editions/fr-FR-server/tiddlers/system/favicon.ico +0 -0
- package/editions/fr-FR-server/tiddlers/system/favicon.ico.meta +0 -2
- package/editions/ja-JP/tiddlers/images/favicon.ico +0 -0
- package/editions/ja-JP/tiddlers/images/favicon.ico.meta +0 -2
- package/editions/ja-JP/tiddlers/images/green_favicon.ico +0 -0
- package/editions/ko-KR/tiddlers/images/favicon.ico +0 -0
- package/editions/ko-KR/tiddlers/images/favicon.ico.meta +0 -2
- package/editions/ko-KR/tiddlers/images/green_favicon.ico +0 -0
- package/editions/ko-KR-server/tiddlers/system/favicon.ico +0 -0
- package/editions/ko-KR-server/tiddlers/system/favicon.ico.meta +0 -2
- package/editions/prerelease/tiddlers/system/favicon.ico +0 -0
- package/editions/prerelease/tiddlers/system/favicon.ico.meta +0 -2
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/classic.tiddlywiki.com.ico +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/links.tiddlywiki.org.ico +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/tiddlywiki.com.dev.ico +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/tiddlywiki.com.ico +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/tiddlywiki.com.prerelease.ico +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/tiddlywiki.com.upgrade.ico +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/tiddlywiki.org.ico +0 -0
- package/editions/tw5.com/tiddlers/community/editions/TiddlyMemo by oflg.tid +0 -16
- package/editions/tw5.com/tiddlers/community/tutorials/Install and run TiddlyWiki on a CentOS 6 VPS using Nginx.tid +0 -16
- package/editions/tw5.com/tiddlers/images/favicon.ico +0 -0
- package/editions/tw5.com/tiddlers/images/favicon.ico.meta +0 -2
- package/editions/tw5.com/tiddlers/images/green_favicon.ico +0 -0
- package/editions/tw5.com/tiddlers/images/green_favicon.ico.meta +0 -2
- package/editions/tw5.com-server/tiddlers/system/favicon.ico +0 -0
- package/editions/tw5.com-server/tiddlers/system/favicon.ico.meta +0 -2
- package/editions/zh-Hans/tiddlers/images/favicon.ico +0 -0
- package/editions/zh-Hans/tiddlers/images/favicon.ico.meta +0 -2
- package/editions/zh-Hans/tiddlers/images/green_favicon.ico +0 -0
- package/editions/zh-Hans/tiddlers/images/green_favicon.ico.meta +0 -2
- package/editions/zh-Hant/tiddlers/images/favicon.ico +0 -0
- package/editions/zh-Hant/tiddlers/images/favicon.ico.meta +0 -2
- package/editions/zh-Hant/tiddlers/images/green_favicon.ico +0 -0
- package/editions/zh-Hant/tiddlers/images/green_favicon.ico.meta +0 -2
- package/plugins/tiddlywiki/qrcode/doc/examples.tid +0 -3
- package/plugins/tiddlywiki/qrcode/doc/readme.tid +0 -13
- package/plugins/tiddlywiki/upgrade/favicon.ico +0 -0
- package/plugins/tiddlywiki/upgrade/favicon.ico.meta +0 -2
- /package/editions/tw5.com/tiddlers/_tw_shared/favicons/{tiddlywiki.org.ico.meta → tiddlywiki.org.png.meta} +0 -0
- /package/plugins/tiddlywiki/qrcode/files/{LICENSE → qrcode/LICENSE} +0 -0
- /package/plugins/tiddlywiki/qrcode/files/{README.md → qrcode/README.md} +0 -0
- /package/plugins/tiddlywiki/qrcode/files/{qrcode.js → qrcode/qrcode.js} +0 -0
package/.github/workflows/ci.yml
CHANGED
@@ -5,7 +5,7 @@ on:
|
|
5
5
|
- master
|
6
6
|
- tiddlywiki-com
|
7
7
|
env:
|
8
|
-
NODE_VERSION: "
|
8
|
+
NODE_VERSION: "18"
|
9
9
|
jobs:
|
10
10
|
test:
|
11
11
|
runs-on: ubuntu-latest
|
@@ -14,7 +14,13 @@ jobs:
|
|
14
14
|
- uses: actions/setup-node@v1
|
15
15
|
with:
|
16
16
|
node-version: "${{ env.NODE_VERSION }}"
|
17
|
-
- run: "./bin/test.sh"
|
17
|
+
- run: "./bin/ci-test.sh"
|
18
|
+
- uses: actions/upload-artifact@v3
|
19
|
+
if: always()
|
20
|
+
with:
|
21
|
+
name: playwright-report
|
22
|
+
path: playwright-report/
|
23
|
+
retention-days: 30
|
18
24
|
build-prerelease:
|
19
25
|
runs-on: ubuntu-latest
|
20
26
|
if: github.ref == 'refs/heads/master'
|
@@ -54,6 +60,7 @@ jobs:
|
|
54
60
|
TW5_BUILD_TIDDLYWIKI: "./node_modules/tiddlywiki/tiddlywiki.js"
|
55
61
|
TW5_BUILD_MAIN_EDITION: "./editions/tw5.com"
|
56
62
|
TW5_BUILD_OUTPUT: "./output"
|
63
|
+
TW5_BUILD_ARCHIVE: "./output"
|
57
64
|
steps:
|
58
65
|
- uses: actions/checkout@v2
|
59
66
|
- uses: actions/setup-node@v1
|
package/bin/build-site.sh
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Default to the current version number for building the plugin library
|
6
6
|
|
7
7
|
if [ -z "$TW5_BUILD_VERSION" ]; then
|
8
|
-
TW5_BUILD_VERSION=v5.3.
|
8
|
+
TW5_BUILD_VERSION=v5.3.3
|
9
9
|
fi
|
10
10
|
|
11
11
|
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"
|
@@ -84,10 +84,27 @@ echo -e -n "title: $:/build\ncommit: $TW5_BUILD_COMMIT\n\n$TW5_BUILD_DETAILS\n"
|
|
84
84
|
|
85
85
|
######################################################
|
86
86
|
#
|
87
|
-
# Core
|
87
|
+
# Core distributions
|
88
88
|
#
|
89
89
|
######################################################
|
90
90
|
|
91
|
+
# Conditionally build archive if $TW5_BUILD_ARCHIVE variable is set, otherwise do nothing
|
92
|
+
#
|
93
|
+
# /archive/Empty-TiddlyWiki-<version>.html Empty archived version
|
94
|
+
# /archive/TiddlyWiki-<version>.html Full archived version
|
95
|
+
|
96
|
+
if [ -n "$TW5_BUILD_ARCHIVE" ]; then
|
97
|
+
|
98
|
+
node $TW5_BUILD_TIDDLYWIKI \
|
99
|
+
$TW5_BUILD_MAIN_EDITION \
|
100
|
+
--verbose \
|
101
|
+
--version \
|
102
|
+
--load $TW5_BUILD_OUTPUT/build.tid \
|
103
|
+
--output $TW5_BUILD_ARCHIVE \
|
104
|
+
--build archive \
|
105
|
+
|| exit 1
|
106
|
+
fi
|
107
|
+
|
91
108
|
# /index.html Main site
|
92
109
|
# /favicon.ico Favicon for main site
|
93
110
|
# /static.html Static rendering of default tiddlers
|
@@ -95,6 +112,7 @@ echo -e -n "title: $:/build\ncommit: $TW5_BUILD_COMMIT\n\n$TW5_BUILD_DETAILS\n"
|
|
95
112
|
# /static/* Static single tiddlers
|
96
113
|
# /static/static.css Static stylesheet
|
97
114
|
# /static/favicon.ico Favicon for static pages
|
115
|
+
|
98
116
|
node $TW5_BUILD_TIDDLYWIKI \
|
99
117
|
$TW5_BUILD_MAIN_EDITION \
|
100
118
|
--verbose \
|
@@ -104,13 +122,15 @@ node $TW5_BUILD_TIDDLYWIKI \
|
|
104
122
|
--build favicon static index \
|
105
123
|
|| exit 1
|
106
124
|
|
107
|
-
# /empty.html
|
108
|
-
# /empty.hta
|
125
|
+
# /empty.html Empty
|
126
|
+
# /empty.hta For Internet Explorer
|
127
|
+
# /empty-external-core.html External core empty
|
128
|
+
# /tiddlywikicore-<version>.js Core plugin javascript
|
109
129
|
node $TW5_BUILD_TIDDLYWIKI \
|
110
130
|
./editions/empty \
|
111
131
|
--verbose \
|
112
132
|
--output $TW5_BUILD_OUTPUT \
|
113
|
-
--build empty \
|
133
|
+
--build empty emptyexternalcore \
|
114
134
|
|| exit 1
|
115
135
|
|
116
136
|
|
package/bin/ci-test.sh
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# test TiddlyWiki5 for tiddlywiki.com
|
4
|
+
|
5
|
+
node ./tiddlywiki.js \
|
6
|
+
./editions/test \
|
7
|
+
--verbose \
|
8
|
+
--version \
|
9
|
+
--rendertiddler $:/core/save/all test.html text/plain \
|
10
|
+
--test \
|
11
|
+
|| exit 1
|
12
|
+
|
13
|
+
npm install playwright @playwright/test
|
14
|
+
npx playwright install chromium firefox --with-deps
|
15
|
+
|
16
|
+
npx playwright test
|
package/boot/boot.js
CHANGED
@@ -2674,6 +2674,18 @@ $tw.hooks.addHook = function(hookName,definition) {
|
|
2674
2674
|
}
|
2675
2675
|
};
|
2676
2676
|
|
2677
|
+
/*
|
2678
|
+
Delete hooks from the hashmap
|
2679
|
+
*/
|
2680
|
+
$tw.hooks.removeHook = function(hookName,definition) {
|
2681
|
+
if($tw.utils.hop($tw.hooks.names,hookName)) {
|
2682
|
+
var p = $tw.hooks.names[hookName].indexOf(definition);
|
2683
|
+
if(p !== -1) {
|
2684
|
+
$tw.hooks.names[hookName].splice(p, 1);
|
2685
|
+
}
|
2686
|
+
}
|
2687
|
+
};
|
2688
|
+
|
2677
2689
|
/*
|
2678
2690
|
Invoke the hook by key
|
2679
2691
|
*/
|
@@ -19,7 +19,7 @@ The following options are supported:
|
|
19
19
|
** ''yes'' will "explode" plugins into separate tiddler files and save them to the plugin directory within the wiki folder
|
20
20
|
** ''no'' will suppress exploding plugins into their constituent tiddler files. It will save the plugin as a single JSON tiddler in the tiddlers folder
|
21
21
|
|
22
|
-
Note that both ''explodePlugins'' options will produce wiki folders that build the
|
22
|
+
Note that both ''explodePlugins'' options will produce wiki folders that build the exact same original wiki. The difference lies in how plugins are represented in the wiki folder.
|
23
23
|
|
24
24
|
A common usage is to convert a TiddlyWiki HTML file into a wiki folder:
|
25
25
|
|
@@ -31,4 +31,4 @@ Save the plugin to the tiddlers directory of the target wiki folder:
|
|
31
31
|
|
32
32
|
```
|
33
33
|
tiddlywiki --load ./mywiki.html --savewikifolder ./mywikifolder explodePlugins=no
|
34
|
-
```
|
34
|
+
```
|
@@ -1,5 +1,5 @@
|
|
1
1
|
title: $:/language/Help/server
|
2
|
-
description: Provides an HTTP server interface to TiddlyWiki
|
2
|
+
description: (deprecated: see 'listen' command) Provides an HTTP server interface to TiddlyWiki
|
3
3
|
|
4
4
|
Legacy command to serve a wiki over HTTP.
|
5
5
|
|
@@ -46,7 +46,7 @@ Command.prototype.execute = function() {
|
|
46
46
|
type = tiddler.fields.type || "text/vnd.tiddlywiki",
|
47
47
|
contentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: "utf8"},
|
48
48
|
filename = path.resolve(pathname,$tw.utils.encodeURIComponentExtended(title));
|
49
|
-
fs.writeFileSync(filename,tiddler.fields.text,contentTypeInfo.encoding);
|
49
|
+
fs.writeFileSync(filename,tiddler.fields.text || "",contentTypeInfo.encoding);
|
50
50
|
});
|
51
51
|
return null;
|
52
52
|
};
|
@@ -60,7 +60,7 @@ function FramedEngine(options) {
|
|
60
60
|
this.domNode.value = this.value;
|
61
61
|
}
|
62
62
|
// Set the attributes
|
63
|
-
if(this.widget.editType) {
|
63
|
+
if(this.widget.editType && this.widget.editTag !== "textarea") {
|
64
64
|
this.domNode.setAttribute("type",this.widget.editType);
|
65
65
|
}
|
66
66
|
if(this.widget.editPlaceholder) {
|
@@ -34,7 +34,7 @@ function SimpleEngine(options) {
|
|
34
34
|
this.domNode.value = this.value;
|
35
35
|
}
|
36
36
|
// Set the attributes
|
37
|
-
if(this.widget.editType) {
|
37
|
+
if(this.widget.editType && this.widget.editTag !== "textarea") {
|
38
38
|
this.domNode.setAttribute("type",this.widget.editType);
|
39
39
|
}
|
40
40
|
if(this.widget.editPlaceholder) {
|
@@ -28,12 +28,8 @@ function getAllFilterOperators() {
|
|
28
28
|
Export our filter function
|
29
29
|
*/
|
30
30
|
exports.all = function(source,operator,options) {
|
31
|
-
// Get our suboperators
|
32
|
-
var allFilterOperators = getAllFilterOperators();
|
33
|
-
// Cycle through the suboperators accumulating their results
|
34
|
-
var results = new $tw.utils.LinkedList(),
|
35
|
-
subops = operator.operand.split("+");
|
36
31
|
// Check for common optimisations
|
32
|
+
var subops = operator.operand.split("+");
|
37
33
|
if(subops.length === 1 && subops[0] === "") {
|
38
34
|
return source;
|
39
35
|
} else if(subops.length === 1 && subops[0] === "tiddlers") {
|
@@ -46,6 +42,10 @@ exports.all = function(source,operator,options) {
|
|
46
42
|
return options.wiki.eachShadowPlusTiddlers;
|
47
43
|
}
|
48
44
|
// Do it the hard way
|
45
|
+
// Get our suboperators
|
46
|
+
var allFilterOperators = getAllFilterOperators();
|
47
|
+
// Cycle through the suboperators accumulating their results
|
48
|
+
var results = new $tw.utils.LinkedList();
|
49
49
|
for(var t=0; t<subops.length; t++) {
|
50
50
|
var subop = allFilterOperators[subops[t]];
|
51
51
|
if(subop) {
|
@@ -18,16 +18,20 @@ Export our filter functions
|
|
18
18
|
|
19
19
|
exports.decodebase64 = function(source,operator,options) {
|
20
20
|
var results = [];
|
21
|
+
var binary = operator.suffixes && operator.suffixes.indexOf("binary") !== -1;
|
22
|
+
var urlsafe = operator.suffixes && operator.suffixes.indexOf("urlsafe") !== -1;
|
21
23
|
source(function(tiddler,title) {
|
22
|
-
results.push($tw.utils.base64Decode(title));
|
24
|
+
results.push($tw.utils.base64Decode(title,binary,urlsafe));
|
23
25
|
});
|
24
26
|
return results;
|
25
27
|
};
|
26
28
|
|
27
29
|
exports.encodebase64 = function(source,operator,options) {
|
28
30
|
var results = [];
|
31
|
+
var binary = operator.suffixes && operator.suffixes.indexOf("binary") !== -1;
|
32
|
+
var urlsafe = operator.suffixes && operator.suffixes.indexOf("urlsafe") !== -1;
|
29
33
|
source(function(tiddler,title) {
|
30
|
-
results.push($tw.utils.base64Encode(title));
|
34
|
+
results.push($tw.utils.base64Encode(title,binary,urlsafe));
|
31
35
|
});
|
32
36
|
return results;
|
33
37
|
};
|
@@ -68,6 +68,54 @@ exports["jsontype"] = function(source,operator,options) {
|
|
68
68
|
return results;
|
69
69
|
};
|
70
70
|
|
71
|
+
exports["jsonset"] = function(source,operator,options) {
|
72
|
+
var suffixes = operator.suffixes || [],
|
73
|
+
type = suffixes[0] && suffixes[0][0],
|
74
|
+
indexes = operator.operands.slice(0,-1),
|
75
|
+
value = operator.operands[operator.operands.length - 1],
|
76
|
+
results = [];
|
77
|
+
if(operator.operands.length === 1 && operator.operands[0] === "") {
|
78
|
+
value = undefined; // Prevents the value from being assigned
|
79
|
+
}
|
80
|
+
switch(type) {
|
81
|
+
case "string":
|
82
|
+
// Use value unchanged
|
83
|
+
break;
|
84
|
+
case "boolean":
|
85
|
+
value = (value === "true" ? true : (value === "false" ? false : undefined));
|
86
|
+
break;
|
87
|
+
case "number":
|
88
|
+
value = $tw.utils.parseNumber(value);
|
89
|
+
break;
|
90
|
+
case "array":
|
91
|
+
indexes = operator.operands;
|
92
|
+
value = [];
|
93
|
+
break;
|
94
|
+
case "object":
|
95
|
+
indexes = operator.operands;
|
96
|
+
value = {};
|
97
|
+
break;
|
98
|
+
case "null":
|
99
|
+
indexes = operator.operands;
|
100
|
+
value = null;
|
101
|
+
break;
|
102
|
+
case "json":
|
103
|
+
value = $tw.utils.parseJSONSafe(value,function() {return undefined;});
|
104
|
+
break;
|
105
|
+
default:
|
106
|
+
// Use value unchanged
|
107
|
+
break;
|
108
|
+
}
|
109
|
+
source(function(tiddler,title) {
|
110
|
+
var data = $tw.utils.parseJSONSafe(title,title);
|
111
|
+
if(data) {
|
112
|
+
data = setDataItem(data,indexes,value);
|
113
|
+
results.push(JSON.stringify(data));
|
114
|
+
}
|
115
|
+
});
|
116
|
+
return results;
|
117
|
+
};
|
118
|
+
|
71
119
|
/*
|
72
120
|
Given a JSON data structure and an array of index strings, return an array of the string representation of the values at the end of the index chain, or "undefined" if any of the index strings are invalid
|
73
121
|
*/
|
@@ -165,6 +213,18 @@ function getDataItemType(data,indexes) {
|
|
165
213
|
}
|
166
214
|
}
|
167
215
|
|
216
|
+
function getItemAtIndex(item,index) {
|
217
|
+
if($tw.utils.hop(item,index)) {
|
218
|
+
return item[index];
|
219
|
+
} else if($tw.utils.isArray(item)) {
|
220
|
+
index = $tw.utils.parseInt(index);
|
221
|
+
if(index < 0) { index = index + item.length };
|
222
|
+
return item[index]; // Will be undefined if index was out-of-bounds
|
223
|
+
} else {
|
224
|
+
return undefined;
|
225
|
+
}
|
226
|
+
}
|
227
|
+
|
168
228
|
/*
|
169
229
|
Given a JSON data structure and an array of index strings, return the value at the end of the index chain, or "undefined" if any of the index strings are invalid
|
170
230
|
*/
|
@@ -177,7 +237,7 @@ function getDataItem(data,indexes) {
|
|
177
237
|
for(var i=0; i<indexes.length; i++) {
|
178
238
|
if(item !== undefined) {
|
179
239
|
if(item !== null && ["number","string","boolean"].indexOf(typeof item) === -1) {
|
180
|
-
item = item
|
240
|
+
item = getItemAtIndex(item,indexes[i]);
|
181
241
|
} else {
|
182
242
|
item = undefined;
|
183
243
|
}
|
@@ -186,5 +246,39 @@ function getDataItem(data,indexes) {
|
|
186
246
|
return item;
|
187
247
|
}
|
188
248
|
|
249
|
+
/*
|
250
|
+
Given a JSON data structure, an array of index strings and a value, return the data structure with the value added at the end of the index chain. If any of the index strings are invalid then the JSON data structure is returned unmodified. If the root item is targetted then a different data object will be returned
|
251
|
+
*/
|
252
|
+
function setDataItem(data,indexes,value) {
|
253
|
+
// Ignore attempts to assign undefined
|
254
|
+
if(value === undefined) {
|
255
|
+
return data;
|
256
|
+
}
|
257
|
+
// Check for the root item
|
258
|
+
if(indexes.length === 0 || (indexes.length === 1 && indexes[0] === "")) {
|
259
|
+
return value;
|
260
|
+
}
|
261
|
+
// Traverse the JSON data structure using the index chain
|
262
|
+
var current = data;
|
263
|
+
for(var i = 0; i < indexes.length - 1; i++) {
|
264
|
+
current = getItemAtIndex(current,indexes[i]);
|
265
|
+
if(current === undefined) {
|
266
|
+
// Return the original JSON data structure if any of the index strings are invalid
|
267
|
+
return data;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
// Add the value to the end of the index chain
|
271
|
+
var lastIndex = indexes[indexes.length - 1];
|
272
|
+
if($tw.utils.isArray(current)) {
|
273
|
+
lastIndex = $tw.utils.parseInt(lastIndex);
|
274
|
+
if(lastIndex < 0) { lastIndex = lastIndex + current.length };
|
275
|
+
}
|
276
|
+
// Only set indexes on objects and arrays
|
277
|
+
if(typeof current === "object") {
|
278
|
+
current[lastIndex] = value;
|
279
|
+
}
|
280
|
+
return data;
|
281
|
+
}
|
282
|
+
|
189
283
|
})();
|
190
284
|
|
@@ -14,10 +14,12 @@ The plain text parser processes blocks of source text into a degenerate parse tr
|
|
14
14
|
|
15
15
|
var TextParser = function(type,text,options) {
|
16
16
|
this.tree = [{
|
17
|
-
type: "
|
17
|
+
type: "genesis",
|
18
18
|
attributes: {
|
19
|
-
|
20
|
-
|
19
|
+
$type: {name: "$type", type: "string", value: "$codeblock"},
|
20
|
+
code: {name: "code", type: "string", value: text},
|
21
|
+
language: {name: "language", type: "string", value: type},
|
22
|
+
$remappable: {name: "$remappable", type:"string", value: "no"}
|
21
23
|
}
|
22
24
|
}];
|
23
25
|
this.source = text;
|
@@ -32,4 +34,3 @@ exports["text/css"] = TextParser;
|
|
32
34
|
exports["application/x-tiddler-dictionary"] = TextParser;
|
33
35
|
|
34
36
|
})();
|
35
|
-
|
@@ -0,0 +1,120 @@
|
|
1
|
+
/*\
|
2
|
+
title: $:/core/modules/parsers/wikiparser/rules/conditional.js
|
3
|
+
type: application/javascript
|
4
|
+
module-type: wikirule
|
5
|
+
|
6
|
+
Conditional shortcut syntax
|
7
|
+
|
8
|
+
```
|
9
|
+
This is a <% if [{something}] %>Elephant<% elseif [{else}] %>Pelican<% else %>Crocodile<% endif %>
|
10
|
+
```
|
11
|
+
|
12
|
+
\*/
|
13
|
+
(function(){
|
14
|
+
|
15
|
+
/*jslint node: true, browser: true */
|
16
|
+
/*global $tw: false */
|
17
|
+
"use strict";
|
18
|
+
|
19
|
+
exports.name = "conditional";
|
20
|
+
exports.types = {inline: true, block: true};
|
21
|
+
|
22
|
+
exports.init = function(parser) {
|
23
|
+
this.parser = parser;
|
24
|
+
// Regexp to match
|
25
|
+
this.matchRegExp = /\<\%\s*if\s+/mg;
|
26
|
+
this.terminateIfRegExp = /\%\>/mg;
|
27
|
+
};
|
28
|
+
|
29
|
+
exports.findNextMatch = function(startPos) {
|
30
|
+
// Look for the next <% if shortcut
|
31
|
+
this.matchRegExp.lastIndex = startPos;
|
32
|
+
this.match = this.matchRegExp.exec(this.parser.source);
|
33
|
+
// If not found then return no match
|
34
|
+
if(!this.match) {
|
35
|
+
return undefined;
|
36
|
+
}
|
37
|
+
// Check for the next %>
|
38
|
+
this.terminateIfRegExp.lastIndex = this.match.index;
|
39
|
+
this.terminateIfMatch = this.terminateIfRegExp.exec(this.parser.source);
|
40
|
+
// If not found then return no match
|
41
|
+
if(!this.terminateIfMatch) {
|
42
|
+
return undefined;
|
43
|
+
}
|
44
|
+
// Return the position at which the construction was found
|
45
|
+
return this.match.index;
|
46
|
+
};
|
47
|
+
|
48
|
+
/*
|
49
|
+
Parse the most recent match
|
50
|
+
*/
|
51
|
+
exports.parse = function() {
|
52
|
+
// Get the filter condition
|
53
|
+
var filterCondition = this.parser.source.substring(this.match.index + this.match[0].length,this.terminateIfMatch.index);
|
54
|
+
// Advance the parser position to past the %>
|
55
|
+
this.parser.pos = this.terminateIfMatch.index + this.terminateIfMatch[0].length;
|
56
|
+
// Parse the if clause
|
57
|
+
return this.parseIfClause(filterCondition);
|
58
|
+
};
|
59
|
+
|
60
|
+
exports.parseIfClause = function(filterCondition) {
|
61
|
+
// Create the list widget
|
62
|
+
var listWidget = {
|
63
|
+
type: "list",
|
64
|
+
tag: "$list",
|
65
|
+
isBlock: this.is.block,
|
66
|
+
children: [
|
67
|
+
{
|
68
|
+
type: "list-template",
|
69
|
+
tag: "$list-template"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
type: "list-empty",
|
73
|
+
tag: "$list-empty"
|
74
|
+
}
|
75
|
+
]
|
76
|
+
};
|
77
|
+
$tw.utils.addAttributeToParseTreeNode(listWidget,"filter",filterCondition);
|
78
|
+
$tw.utils.addAttributeToParseTreeNode(listWidget,"variable","condition");
|
79
|
+
$tw.utils.addAttributeToParseTreeNode(listWidget,"limit","1");
|
80
|
+
// Check for an immediately following double linebreak
|
81
|
+
var hasLineBreak = !!$tw.utils.parseTokenRegExp(this.parser.source,this.parser.pos,/([^\S\n\r]*\r?\n(?:[^\S\n\r]*\r?\n|$))/g);
|
82
|
+
// Parse the body looking for else or endif
|
83
|
+
var reEndString = "\\<\\%\\s*(endif)\\s*\\%\\>|\\<\\%\\s*(else)\\s*\\%\\>|\\<\\%\\s*(elseif)\\s+([\\s\\S]+?)\\%\\>",
|
84
|
+
ex;
|
85
|
+
if(hasLineBreak) {
|
86
|
+
ex = this.parser.parseBlocksTerminatedExtended(reEndString);
|
87
|
+
} else {
|
88
|
+
var reEnd = new RegExp(reEndString,"mg");
|
89
|
+
ex = this.parser.parseInlineRunTerminatedExtended(reEnd,{eatTerminator: true});
|
90
|
+
}
|
91
|
+
// Put the body into the list template
|
92
|
+
listWidget.children[0].children = ex.tree;
|
93
|
+
// Check for an else or elseif
|
94
|
+
if(ex.match) {
|
95
|
+
if(ex.match[1] === "endif") {
|
96
|
+
// Nothing to do if we just found an endif
|
97
|
+
} else if(ex.match[2] === "else") {
|
98
|
+
// Check for an immediately following double linebreak
|
99
|
+
hasLineBreak = !!$tw.utils.parseTokenRegExp(this.parser.source,this.parser.pos,/([^\S\n\r]*\r?\n(?:[^\S\n\r]*\r?\n|$))/g);
|
100
|
+
// If we found an else then we need to parse the body looking for the endif
|
101
|
+
var reEndString = "\\<\\%\\s*(endif)\\s*\\%\\>",
|
102
|
+
ex;
|
103
|
+
if(hasLineBreak) {
|
104
|
+
ex = this.parser.parseBlocksTerminatedExtended(reEndString);
|
105
|
+
} else {
|
106
|
+
var reEnd = new RegExp(reEndString,"mg");
|
107
|
+
ex = this.parser.parseInlineRunTerminatedExtended(reEnd,{eatTerminator: true});
|
108
|
+
}
|
109
|
+
// Put the parsed content inside the list empty template
|
110
|
+
listWidget.children[1].children = ex.tree;
|
111
|
+
} else if(ex.match[3] === "elseif") {
|
112
|
+
// Parse the elseif clause by reusing this parser, passing the new filter condition
|
113
|
+
listWidget.children[1].children = this.parseIfClause(ex.match[4]);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
// Return the parse tree node
|
117
|
+
return [listWidget];
|
118
|
+
};
|
119
|
+
|
120
|
+
})();
|
@@ -194,6 +194,7 @@ Parse any pragmas at the beginning of a block of parse text
|
|
194
194
|
WikiParser.prototype.parsePragmas = function() {
|
195
195
|
var currentTreeBranch = this.tree;
|
196
196
|
while(true) {
|
197
|
+
var savedPos = this.pos;
|
197
198
|
// Skip whitespace
|
198
199
|
this.skipWhitespace();
|
199
200
|
// Check for the end of the text
|
@@ -204,6 +205,7 @@ WikiParser.prototype.parsePragmas = function() {
|
|
204
205
|
var nextMatch = this.findNextMatch(this.pragmaRules,this.pos);
|
205
206
|
// If not, just exit
|
206
207
|
if(!nextMatch || nextMatch.matchIndex !== this.pos) {
|
208
|
+
this.pos = savedPos;
|
207
209
|
break;
|
208
210
|
}
|
209
211
|
// Process the pragma rule
|
@@ -214,6 +216,8 @@ WikiParser.prototype.parsePragmas = function() {
|
|
214
216
|
subTree[0].children = [];
|
215
217
|
currentTreeBranch = subTree[0].children;
|
216
218
|
}
|
219
|
+
// Skip whitespace after the pragma
|
220
|
+
this.skipWhitespace();
|
217
221
|
}
|
218
222
|
return currentTreeBranch;
|
219
223
|
};
|
@@ -223,7 +227,7 @@ Parse a block from the current position
|
|
223
227
|
terminatorRegExpString: optional regular expression string that identifies the end of plain paragraphs. Must not include capturing parenthesis
|
224
228
|
*/
|
225
229
|
WikiParser.prototype.parseBlock = function(terminatorRegExpString) {
|
226
|
-
var terminatorRegExp = terminatorRegExpString ? new RegExp(
|
230
|
+
var terminatorRegExp = terminatorRegExpString ? new RegExp(terminatorRegExpString + "|\\r?\\n\\r?\\n","mg") : /(\r?\n\r?\n)/mg;
|
227
231
|
this.skipWhitespace();
|
228
232
|
if(this.pos >= this.sourceLength) {
|
229
233
|
return [];
|
@@ -264,11 +268,21 @@ WikiParser.prototype.parseBlocksUnterminated = function() {
|
|
264
268
|
};
|
265
269
|
|
266
270
|
/*
|
267
|
-
Parse blocks of text until a terminating regexp is encountered
|
271
|
+
Parse blocks of text until a terminating regexp is encountered. Wrapper for parseBlocksTerminatedExtended that just returns the parse tree
|
268
272
|
*/
|
269
273
|
WikiParser.prototype.parseBlocksTerminated = function(terminatorRegExpString) {
|
270
|
-
var
|
271
|
-
|
274
|
+
var ex = this.parseBlocksTerminatedExtended(terminatorRegExpString);
|
275
|
+
return ex.tree;
|
276
|
+
};
|
277
|
+
|
278
|
+
/*
|
279
|
+
Parse blocks of text until a terminating regexp is encountered
|
280
|
+
*/
|
281
|
+
WikiParser.prototype.parseBlocksTerminatedExtended = function(terminatorRegExpString) {
|
282
|
+
var terminatorRegExp = new RegExp(terminatorRegExpString,"mg"),
|
283
|
+
result = {
|
284
|
+
tree: []
|
285
|
+
};
|
272
286
|
// Skip any whitespace
|
273
287
|
this.skipWhitespace();
|
274
288
|
// Check if we've got the end marker
|
@@ -277,7 +291,7 @@ WikiParser.prototype.parseBlocksTerminated = function(terminatorRegExpString) {
|
|
277
291
|
// Parse the text into blocks
|
278
292
|
while(this.pos < this.sourceLength && !(match && match.index === this.pos)) {
|
279
293
|
var blocks = this.parseBlock(terminatorRegExpString);
|
280
|
-
tree.push.apply(tree,blocks);
|
294
|
+
result.tree.push.apply(result.tree,blocks);
|
281
295
|
// Skip any whitespace
|
282
296
|
this.skipWhitespace();
|
283
297
|
// Check if we've got the end marker
|
@@ -286,8 +300,9 @@ WikiParser.prototype.parseBlocksTerminated = function(terminatorRegExpString) {
|
|
286
300
|
}
|
287
301
|
if(match && match.index === this.pos) {
|
288
302
|
this.pos = match.index + match[0].length;
|
303
|
+
result.match = match;
|
289
304
|
}
|
290
|
-
return
|
305
|
+
return result;
|
291
306
|
};
|
292
307
|
|
293
308
|
/*
|
@@ -330,6 +345,11 @@ WikiParser.prototype.parseInlineRunUnterminated = function(options) {
|
|
330
345
|
};
|
331
346
|
|
332
347
|
WikiParser.prototype.parseInlineRunTerminated = function(terminatorRegExp,options) {
|
348
|
+
var ex = this.parseInlineRunTerminatedExtended(terminatorRegExp,options);
|
349
|
+
return ex.tree;
|
350
|
+
};
|
351
|
+
|
352
|
+
WikiParser.prototype.parseInlineRunTerminatedExtended = function(terminatorRegExp,options) {
|
333
353
|
options = options || {};
|
334
354
|
var tree = [];
|
335
355
|
// Find the next occurrence of the terminator
|
@@ -349,7 +369,10 @@ WikiParser.prototype.parseInlineRunTerminated = function(terminatorRegExp,option
|
|
349
369
|
if(options.eatTerminator) {
|
350
370
|
this.pos += terminatorMatch[0].length;
|
351
371
|
}
|
352
|
-
return
|
372
|
+
return {
|
373
|
+
match: terminatorMatch,
|
374
|
+
tree: tree
|
375
|
+
};
|
353
376
|
}
|
354
377
|
}
|
355
378
|
// Process any inline rule, along with the text preceding it
|
@@ -373,7 +396,9 @@ WikiParser.prototype.parseInlineRunTerminated = function(terminatorRegExp,option
|
|
373
396
|
this.pushTextWidget(tree,this.source.substr(this.pos),this.pos,this.sourceLength);
|
374
397
|
}
|
375
398
|
this.pos = this.sourceLength;
|
376
|
-
return
|
399
|
+
return {
|
400
|
+
tree: tree
|
401
|
+
};
|
377
402
|
};
|
378
403
|
|
379
404
|
/*
|
@@ -31,7 +31,7 @@ GitHubSaver.prototype.save = function(text,method,callback) {
|
|
31
31
|
headers = {
|
32
32
|
"Accept": "application/vnd.github.v3+json",
|
33
33
|
"Content-Type": "application/json;charset=UTF-8",
|
34
|
-
"Authorization": "Basic " +
|
34
|
+
"Authorization": "Basic " + $tw.utils.base64Encode(username + ":" + password),
|
35
35
|
"If-None-Match": ""
|
36
36
|
};
|
37
37
|
// Bail if we don't have everything we need
|