tiddlywiki 5.2.1 → 5.2.2
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/.eslintignore +5 -12
- package/.eslintrc.yml +17 -1
- package/.github/workflows/ci.yml +3 -0
- package/bin/build-site.sh +1 -1
- package/bin/build-tw-org.sh +97 -0
- package/boot/boot.js +44 -17
- package/boot/bootprefix.js +1 -0
- package/contributing.md +1 -1
- package/core/copyright.tid +1 -1
- package/core/language/en-GB/ControlPanel.multids +3 -1
- package/core/language/en-GB/Fields.multids +4 -3
- package/core/language/en-GB/Misc.multids +1 -1
- package/core/modules/commands/init.js +1 -1
- package/core/modules/commands/savelibrarytiddlers.js +1 -1
- package/core/modules/commands/savewikifolder.js +1 -1
- package/core/modules/deserializers.js +7 -10
- package/core/modules/editor/operations/text/wrap-lines.js +5 -3
- package/core/modules/filters/crypto.js +27 -0
- package/core/modules/filters/insertbefore.js +1 -1
- package/core/modules/filters/is/draft.js +2 -2
- package/core/modules/filters/listops.js +2 -1
- package/core/modules/filters/lookup.js +29 -6
- package/core/modules/filters/prefix.js +30 -12
- package/core/modules/filters/removeprefix.js +16 -6
- package/core/modules/filters/removesuffix.js +20 -6
- package/core/modules/filters/search.js +1 -0
- package/core/modules/filters/suffix.js +32 -10
- package/core/modules/filters/untagged.js +1 -1
- package/core/modules/filters.js +4 -2
- package/core/modules/parsers/parseutils.js +2 -2
- package/core/modules/pluginswitcher.js +1 -1
- package/core/modules/savers/gitea.js +2 -2
- package/core/modules/savers/github.js +2 -2
- package/core/modules/savers/gitlab.js +2 -2
- package/core/modules/server/routes/put-tiddler.js +1 -1
- package/core/modules/server/server.js +37 -12
- package/core/modules/startup/browser-messaging.js +2 -2
- package/core/modules/startup/render.js +7 -2
- package/core/modules/startup/rootwidget.js +14 -0
- package/core/modules/startup/windows.js +22 -9
- package/core/modules/tiddler.js +3 -3
- package/core/modules/upgraders/plugins.js +1 -1
- package/core/modules/utils/crypto.js +2 -2
- package/core/modules/utils/dom/dragndrop.js +8 -6
- package/core/modules/utils/dom/scroller.js +11 -7
- package/core/modules/utils/edition-info.js +1 -5
- package/core/modules/utils/pluginmaker.js +2 -4
- package/core/modules/widgets/action-listops.js +2 -2
- package/core/modules/widgets/button.js +1 -1
- package/core/modules/widgets/draggable.js +16 -9
- package/core/modules/widgets/eventcatcher.js +34 -30
- package/core/modules/widgets/image.js +10 -0
- package/core/modules/widgets/importvariables.js +1 -1
- package/core/modules/widgets/list.js +3 -0
- package/core/modules/widgets/navigator.js +2 -17
- package/core/modules/widgets/radio.js +2 -2
- package/core/modules/widgets/scrollable.js +11 -9
- package/core/modules/widgets/widget.js +30 -14
- package/core/modules/wiki-bulkops.js +20 -15
- package/core/modules/wiki.js +39 -17
- package/core/templates/tiddlywiki5.html.tid +1 -1
- package/core/ui/ControlPanel/Cascades/FieldEditor.tid +9 -0
- package/core/ui/EditTemplate/body/default.tid +2 -2
- package/core/ui/EditTemplate/fieldEditor-default.tid +3 -0
- package/core/ui/EditTemplate/fields.tid +6 -4
- package/core/ui/EditTemplate/type.tid +1 -1
- package/core/ui/EditTemplate.tid +2 -2
- package/core/ui/MoreSideBar/plugins/Languages.tid +1 -1
- package/core/ui/MoreSideBar/plugins/Plugins.tid +1 -1
- package/core/ui/MoreSideBar/plugins/Theme.tid +1 -1
- package/core/ui/SideBar/Open.tid +2 -2
- package/core/wiki/allfields.tid +1 -1
- package/core/wiki/config/FieldEditorFilters.multids +4 -0
- package/core/wiki/config/OfficialPluginLibrary.tid +1 -1
- package/core/wiki/config/ViewTemplateBodyFilters.multids +2 -1
- package/core/wiki/macros/list.tid +2 -2
- package/core/wiki/tags/ViewTemplateBodyFilter.tid +1 -1
- package/editions/dev/tiddlers/from Heigele and Jurke/Syncadaptor.tid +2 -2
- package/editions/dynaviewdemo/tiddlers/SideBar-Open.tid +1 -1
- package/editions/fr-FR/output/images/Blurry%20Lawn.jpg +0 -0
- package/editions/fr-FR/output/images/Newnham%20Horizon.jpg +0 -0
- package/editions/fr-FR/output/index.html +5051 -0
- package/editions/fr-FR/output/text/Alice%20in%20Wonderland.tid +3709 -0
- package/editions/fr-FR/tiddlers/$ _config_ViewTemplateTitleFilters_fr-default.tid +7 -0
- package/editions/fr-FR/tiddlers/$ _core_ui_ViewTemplate_title_fr-default.tid +8 -0
- package/editions/fr-FR/tiddlers/$__deprecated.tid +9 -0
- package/editions/fr-FR/tiddlers/$__editions_fr-FR_util-macros.tid +1 -0
- package/editions/fr-FR/tiddlers/$__editions_tw5.com_doc-macros.tid +69 -5
- package/editions/fr-FR/tiddlers/$__editions_tw5.com_version-macros.tid +15 -0
- package/editions/fr-FR/tiddlers/$__editions_tw5.com_wikitext-macros.tid +2 -2
- package/editions/fr-FR/tiddlers/Block_Quotes_in_WikiText.tid +15 -8
- package/editions/fr-FR/tiddlers/CamelCase.tid +6 -3
- package/editions/fr-FR/tiddlers/Code Blocks in WikiText.tid +27 -16
- package/editions/fr-FR/tiddlers/Community Links Aggregator.tid +11 -0
- package/editions/fr-FR/tiddlers/Community.tid +6 -4
- package/editions/fr-FR/tiddlers/Creating and editing tiddlers.tid +11 -11
- package/editions/fr-FR/tiddlers/Deprecated - What does it mean.tid +17 -0
- package/editions/fr-FR/tiddlers/Developers.tid +10 -5
- package/editions/fr-FR/tiddlers/Federatial.tid +11 -0
- package/editions/fr-FR/tiddlers/Formatting in WikiText.tid +12 -12
- package/editions/fr-FR/tiddlers/Forums.tid +27 -13
- package/editions/fr-FR/tiddlers/GettingStarted.tid +16 -14
- package/editions/fr-FR/tiddlers/Glossaire en-GB -_ fr-FR.tid +3 -1
- package/editions/fr-FR/tiddlers/HTML in WikiText.tid +77 -28
- package/editions/fr-FR/tiddlers/Headings in WikiText.tid +2 -2
- package/editions/fr-FR/tiddlers/HelloThere.tid +15 -12
- package/editions/fr-FR/tiddlers/How to export tiddlers.tid +31 -0
- package/editions/fr-FR/tiddlers/ImageWidget.tid +33 -0
- package/editions/fr-FR/tiddlers/Images in WikiText.tid +69 -0
- package/editions/fr-FR/tiddlers/Importing Tiddlers.tid +26 -0
- package/editions/fr-FR/tiddlers/JeremyRuston.tid +9 -9
- package/editions/fr-FR/tiddlers/Linking in WikiText.tid +108 -19
- package/editions/fr-FR/tiddlers/ListField.tid +6 -6
- package/editions/fr-FR/tiddlers/Macros in WikiText.tid +5 -5
- package/editions/fr-FR/tiddlers/Macros.tid +17 -8
- package/editions/fr-FR/tiddlers/PermaLinks.tid +19 -19
- package/editions/fr-FR/tiddlers/Philosophy of Tiddlers.tid +2 -2
- package/editions/fr-FR/tiddlers/Saving.tid +63 -4
- package/editions/fr-FR/tiddlers/Share Plugin.tid +15 -0
- package/editions/fr-FR/tiddlers/{Sharing_a_TiddlyWiki_on_Dropbox.tid → Sharing a TiddlyWiki on Dropbox.tid } +12 -4
- package/editions/fr-FR/tiddlers/Sharing your tiddlers with others.tid +18 -0
- package/editions/fr-FR/tiddlers/Structuring TiddlyWiki.tid +6 -6
- package/editions/fr-FR/tiddlers/Styles and Classes in WikiText.tid +11 -10
- package/editions/fr-FR/tiddlers/Tagging.tid +24 -18
- package/editions/fr-FR/tiddlers/TaskManagementExample.tid +3 -1
- package/editions/fr-FR/tiddlers/TiddlerLinks.tid +5 -5
- package/editions/fr-FR/tiddlers/TiddlyFox Apocalypse.tid +46 -0
- package/editions/fr-FR/tiddlers/TiddlyFox.tid +6 -3
- package/editions/fr-FR/tiddlers/TiddlyWiki.tid +6 -4
- package/editions/fr-FR/tiddlers/_TiddlyWiki for Scholars_ by Alberto Molina.tid +2 -2
- package/editions/prerelease/tiddlers/{Release 5.2.2.tid → Release 5.2.3.tid } +15 -11
- package/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid +1 -1
- package/editions/prerelease/tiddlers/system/download-empty.tid +1 -0
- package/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-horizontal-all.tid +33 -0
- package/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-horizontal.tid +43 -0
- package/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-vertical.tid +43 -0
- package/editions/test/tiddlers/tests/test-action-widgets.js +55 -0
- package/editions/test/tiddlers/tests/test-filters.js +225 -64
- package/editions/test/tiddlers/tests/test-html-parser.js +15 -0
- package/editions/test/tiddlers/tests/test-prefixes-filter.js +5 -5
- package/editions/test/tiddlers/tests/test-tags.js +19 -0
- package/editions/test/tiddlers/tests/test-utils.js +10 -0
- package/editions/test/tiddlers/tests/test-wikitext-parser.js +14 -1
- package/editions/test/tiddlers/tests/test-wikitext-tabs-macro.js +86 -0
- package/editions/tw.org/tiddlers/$__DefaultTiddlers.tid +6 -0
- package/editions/tw.org/tiddlers/$__SiteSubtitle.tid +6 -0
- package/editions/tw.org/tiddlers/$__SiteTitle.tid +6 -0
- package/editions/tw.org/tiddlers/$__StoryList.tid +3 -0
- package/editions/tw.org/tiddlers/$__favicon.ico.png +0 -0
- package/editions/tw.org/tiddlers/$__favicon.ico.png.meta +4 -0
- package/editions/tw.org/tiddlers/$__palette.tid +6 -0
- package/editions/tw.org/tiddlers/$__palettes_BlueFlavour +165 -0
- package/editions/tw.org/tiddlers/$__palettes_BlueFlavour.meta +8 -0
- package/editions/tw.org/tiddlers/$__palettes_FlowingSun +165 -0
- package/editions/tw.org/tiddlers/$__palettes_FlowingSun.meta +8 -0
- package/editions/tw.org/tiddlers/$__themes_tiddlywiki_vanilla_metrics_bodyfontsize.tid +6 -0
- package/editions/tw.org/tiddlers/$__themes_tiddlywiki_vanilla_metrics_bodylineheight.tid +6 -0
- package/editions/tw.org/tiddlers/$__themes_tiddlywiki_vanilla_metrics_sidebarwidth.tid +6 -0
- package/editions/tw.org/tiddlers/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid +6 -0
- package/editions/tw.org/tiddlers/HelloThere.tid +14 -0
- package/editions/tw.org/tiddlers/Table of Contents.tid +11 -0
- package/editions/tw.org/tiddlers/TiddlyWiki.tid +8 -0
- package/editions/tw.org/tiddlywiki.info +30 -0
- package/editions/tw5.com/tiddlers/community/Contributor License Agreement.tid +3 -3
- package/editions/tw5.com/tiddlers/community/Forums.tid +16 -13
- package/editions/tw5.com/tiddlers/community/Signing the Contributor License Agreement.tid +2 -2
- package/editions/tw5.com/tiddlers/community/plugins/TiddlyClip by buggyjay.tid +3 -3
- package/editions/tw5.com/tiddlers/concepts/Cascades.tid +1 -0
- package/editions/tw5.com/tiddlers/concepts/Customizing EditTemplate Field Rendering.tid +31 -0
- package/editions/tw5.com/tiddlers/concepts/Field Editor Cascade.tid +17 -0
- package/editions/tw5.com/tiddlers/concepts/Filters.tid +15 -10
- package/editions/tw5.com/tiddlers/concepts/Macros.tid +1 -3
- package/editions/tw5.com/tiddlers/concepts/Pragma.tid +2 -2
- package/editions/tw5.com/tiddlers/concepts/TiddlerFields.tid +2 -1
- package/editions/tw5.com/tiddlers/demonstrations/Alice in Wonderland.tid +3707 -4
- package/editions/tw5.com/tiddlers/demonstrations/Apple.tid +6 -1
- package/editions/tw5.com/tiddlers/demonstrations/CustomStoryTiddlerTemplateDemo.tid/Styles.tid +1 -0
- package/editions/tw5.com/tiddlers/demonstrations/CustomStoryTiddlerTemplateDemo.tid/Template.tid +1 -0
- package/editions/tw5.com/tiddlers/demonstrations/CustomStoryTiddlerTemplateDemo.tid/TiddlerTemplateFilter.tid +1 -0
- package/editions/tw5.com/tiddlers/features/Importing Tiddlers.tid +1 -1
- package/editions/tw5.com/tiddlers/features/Modals.tid +2 -1
- package/editions/tw5.com/tiddlers/filters/Filter Operators.tid +9 -5
- package/editions/tw5.com/tiddlers/filters/all.tid +2 -2
- package/editions/tw5.com/tiddlers/filters/butlast.tid +3 -1
- package/editions/tw5.com/tiddlers/filters/examples/butlast.tid +4 -3
- package/editions/tw5.com/tiddlers/filters/examples/insertbefore Operator (Examples).tid +28 -0
- package/editions/tw5.com/tiddlers/filters/examples/lookup Operator (Examples).tid +5 -0
- package/editions/tw5.com/tiddlers/filters/examples/prefix.tid +4 -3
- package/editions/tw5.com/tiddlers/filters/examples/removeprefix.tid +2 -1
- package/editions/tw5.com/tiddlers/filters/examples/removesuffix.tid +2 -3
- package/editions/tw5.com/tiddlers/filters/examples/rest.tid +4 -3
- package/editions/tw5.com/tiddlers/filters/examples/search.tid +6 -1
- package/editions/tw5.com/tiddlers/filters/examples/sortan.tid +5 -1
- package/editions/tw5.com/tiddlers/filters/examples/suffix.tid +3 -2
- package/editions/tw5.com/tiddlers/filters/insertbefore Operator.tid +21 -5
- package/editions/tw5.com/tiddlers/filters/lookup Operator.tid +28 -10
- package/editions/tw5.com/tiddlers/filters/prefix.tid +17 -2
- package/editions/tw5.com/tiddlers/filters/removeprefix.tid +18 -3
- package/editions/tw5.com/tiddlers/filters/removesuffix.tid +18 -3
- package/editions/tw5.com/tiddlers/filters/search.tid +10 -9
- package/editions/tw5.com/tiddlers/filters/sha256 Operator.tid +18 -0
- package/editions/tw5.com/tiddlers/filters/subfilter Operator.tid +2 -2
- package/editions/tw5.com/tiddlers/filters/suffix.tid +17 -2
- package/editions/tw5.com/tiddlers/filters/syntax/Cascade Filter Run Prefix.tid +2 -2
- package/editions/tw5.com/tiddlers/filters/syntax/Named Filter Run Prefix.tid +1 -1
- package/editions/tw5.com/tiddlers/hellothere/HelloThere.tid +3 -3
- package/editions/tw5.com/tiddlers/howtos/Concatenating text and variables using macro substitution.tid +4 -14
- package/editions/tw5.com/tiddlers/images/New Release Banner.png +0 -0
- package/editions/tw5.com/tiddlers/macros/list-links-draggable Macro.tid +1 -1
- package/editions/tw5.com/tiddlers/messages/SampleWindowTemplate.tid +2 -2
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-close-all-windows.tid +20 -0
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-close-window.tid +39 -0
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-download-file.tid +6 -1
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-open-window.tid +16 -12
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-relink-tiddler.tid +26 -0
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-rename-tiddler.tid +4 -2
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-scroll.tid +3 -0
- package/editions/tw5.com/tiddlers/plugins/Highlight Plugin.tid +3 -1
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.21.tid +6 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.22.tid +6 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.1.23.tid +6 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.0.tid +6 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.1.tid +6 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.2.tid +162 -0
- package/editions/tw5.com/tiddlers/releasenotes/Releases.tid +4 -2
- package/editions/tw5.com/tiddlers/saving/Saving on Browser with the File System Access API.tid +21 -0
- package/editions/tw5.com/tiddlers/saving/Saving on TidGi.tid +26 -0
- package/editions/tw5.com/tiddlers/saving/Saving via WebDAV.tid +3 -1
- package/editions/tw5.com/tiddlers/saving/Saving with Polly.tid +29 -0
- package/editions/tw5.com/tiddlers/system/doc-macros.tid +25 -1
- package/editions/tw5.com/tiddlers/system/doc-styles.tid +5 -1
- package/editions/tw5.com/tiddlers/system/download-empty.tid +1 -0
- package/editions/tw5.com/tiddlers/system/operator-macros.tid +4 -2
- package/editions/tw5.com/tiddlers/system/operator-template.tid +6 -3
- package/editions/tw5.com/tiddlers/system/style-guide-macros.tid +5 -1
- package/editions/tw5.com/tiddlers/system/variable-macros.tid +4 -2
- package/editions/tw5.com/tiddlers/system/wikitext-macros.tid +17 -3
- package/editions/tw5.com/tiddlers/webserver/Using HTTPS.tid +17 -2
- package/editions/tw5.com/tiddlers/webserver/WebServer API_ Get All Tiddlers.tid +1 -1
- package/editions/tw5.com/tiddlers/webserver/WebServer Authorization.tid +15 -3
- package/editions/tw5.com/tiddlers/webserver/WebServer Parameter_ admin.tid +8 -0
- package/editions/tw5.com/tiddlers/webserver/WebServer Parameter_ required-plugins.tid +8 -0
- package/editions/tw5.com/tiddlers/webserver/WebServer Parameter_ tls-passphrase.tid +10 -0
- package/editions/tw5.com/tiddlers/widgets/$__editions_tw5.com_widget-examples_qualify-transcluded.tid +14 -0
- package/editions/tw5.com/tiddlers/widgets/DraggableWidget.tid +7 -3
- package/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid +1 -1
- package/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid +7 -6
- package/editions/tw5.com/tiddlers/widgets/ImageWidget.tid +9 -1
- package/editions/tw5.com/tiddlers/widgets/LinkCatcherWidget.tid +2 -1
- package/editions/tw5.com/tiddlers/widgets/MacroCallWidget.tid +3 -1
- package/editions/tw5.com/tiddlers/widgets/MessageCatcherWidget.tid +2 -2
- package/editions/tw5.com/tiddlers/widgets/QualifyWidget.tid +39 -0
- package/editions/tw5.com/tiddlers/widgets/TranscludeWidget.tid +7 -6
- package/editions/tw5.com/tiddlers/widgets/ViewWidget.tid +26 -8
- package/editions/tw5.com/tiddlers/widgets/WikifyWidget.tid +2 -2
- package/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid +30 -4
- package/editions/tw5.com/tiddlers/wikitext/Images in WikiText.tid +3 -3
- package/editions/tw5.com/tiddlers/wikitext/Linking in WikiText.tid +44 -1
- package/editions/tw5.com/tiddlers/wikitext/Macro Calls in WikiText.tid +3 -3
- package/editions/tw5.com/tiddlers/wikitext/Transclusion in WikiText.tid +2 -1
- package/editions/tw5.com/tiddlers/wikitext/Widgets in WikiText.tid +3 -3
- package/editions/tw5.com/tiddlers/wikitext/parser/Block Mode WikiText (Examples).tid +51 -0
- package/editions/tw5.com/tiddlers/wikitext/parser/Block Mode WikiText.tid +35 -0
- package/editions/tw5.com/tiddlers/wikitext/parser/Inline Mode WikiText.tid +26 -0
- package/editions/tw5.com/tiddlers/wikitext/parser/Places where the parser ignores WikiText.tid +14 -0
- package/editions/tw5.com/tiddlers/wikitext/parser/WikiText Parser Modes.tid +16 -0
- package/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode transitions.tid +59 -0
- package/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ HTML examples.tid +72 -0
- package/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ macro examples.tid +55 -0
- package/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ transclusion examples.tid +56 -0
- package/editions/tw5.com/tiddlers/wikitext/parser/table-example.tid +8 -0
- package/languages/de-DE/ControlPanel.multids +17 -0
- package/languages/de-DE/Fields.multids +6 -5
- package/languages/de-DE/SideBar.multids +1 -0
- package/languages/pl-PL/ControlPanel.multids +15 -2
- package/languages/zh-Hans/ControlPanel.multids +2 -0
- package/languages/zh-Hans/Fields.multids +4 -2
- package/languages/zh-Hans/Misc.multids +1 -1
- package/languages/zh-Hant/ControlPanel.multids +2 -0
- package/languages/zh-Hant/Fields.multids +4 -2
- package/languages/zh-Hant/Misc.multids +1 -1
- package/license +1 -1
- package/licenses/cla-individual.md +13 -1
- package/package.json +5 -3
- package/plugins/tiddlywiki/dynannotate/examples/viewtemplate.tid +3 -4
- package/plugins/tiddlywiki/highlight/files/default.min.css +9 -0
- package/plugins/tiddlywiki/highlight/files/highlight.min.js +1401 -0
- package/plugins/tiddlywiki/highlight/files/tiddlywiki.files +2 -2
- package/plugins/tiddlywiki/highlight/highlightblock.js +27 -21
- package/plugins/tiddlywiki/highlight/plugin.info +1 -1
- package/plugins/tiddlywiki/highlight/readme.tid +18 -47
- package/plugins/tiddlywiki/highlight/styles.tid +10 -5
- package/plugins/tiddlywiki/highlight/usage.tid +48 -1
- package/plugins/tiddlywiki/highlight-legacy/TypeMappings.multids +8 -0
- package/plugins/tiddlywiki/{highlight → highlight-legacy}/files/default.css +0 -0
- package/plugins/tiddlywiki/{highlight → highlight-legacy}/files/highlight.pack.js +0 -0
- package/plugins/tiddlywiki/highlight-legacy/files/tiddlywiki.files +22 -0
- package/plugins/tiddlywiki/highlight-legacy/highlightblock.js +44 -0
- package/plugins/tiddlywiki/highlight-legacy/license.tid +27 -0
- package/plugins/tiddlywiki/highlight-legacy/plugin.info +7 -0
- package/plugins/tiddlywiki/highlight-legacy/readme.tid +65 -0
- package/plugins/tiddlywiki/highlight-legacy/styles.tid +82 -0
- package/plugins/tiddlywiki/highlight-legacy/usage.tid +28 -0
- package/plugins/tiddlywiki/internals/editpreviews/raw.tid +1 -0
- package/plugins/tiddlywiki/markdown/config_renderWikiTextPragma.tid +1 -1
- package/plugins/tiddlywiki/markdown/wrapper.js +33 -22
- package/plugins/tiddlywiki/menubar/menu.tid +1 -1
- package/readme.md +2 -2
- package/themes/tiddlywiki/snowwhite/base.tid +2 -1
- package/themes/tiddlywiki/vanilla/base.tid +13 -3
- package/themes/tiddlywiki/vanilla/sticky.tid +1 -0
- package/editions/fr-FR/tiddlers/$__core_ui_ViewTemplate_title.tid +0 -46
- package/editions/fr-FR/tiddlers/Images_in_WikiText.tid +0 -48
- package/editions/fr-FR/tiddlers/ImportTiddlers.tid +0 -14
- package/editions/fr-FR/tiddlers/Sharing_your_tiddlers_with_others.tid +0 -16
- package/plugins/tiddlywiki/highlight/howto.tid +0 -10
@@ -49,10 +49,14 @@ Handle an event
|
|
49
49
|
*/
|
50
50
|
PageScroller.prototype.handleEvent = function(event) {
|
51
51
|
if(event.type === "tm-scroll") {
|
52
|
+
var options = {};
|
53
|
+
if($tw.utils.hop(event.paramObject,"animationDuration")) {
|
54
|
+
options.animationDuration = event.paramObject.animationDuration;
|
55
|
+
}
|
52
56
|
if(event.paramObject && event.paramObject.selector) {
|
53
|
-
this.scrollSelectorIntoView(null,event.paramObject.selector);
|
57
|
+
this.scrollSelectorIntoView(null,event.paramObject.selector,null,options);
|
54
58
|
} else {
|
55
|
-
this.scrollIntoView(event.target);
|
59
|
+
this.scrollIntoView(event.target,null,options);
|
56
60
|
}
|
57
61
|
return false; // Event was handled
|
58
62
|
}
|
@@ -62,10 +66,10 @@ PageScroller.prototype.handleEvent = function(event) {
|
|
62
66
|
/*
|
63
67
|
Handle a scroll event hitting the page document
|
64
68
|
*/
|
65
|
-
PageScroller.prototype.scrollIntoView = function(element,callback) {
|
69
|
+
PageScroller.prototype.scrollIntoView = function(element,callback,options) {
|
66
70
|
var self = this,
|
67
|
-
duration = $tw.utils.getAnimationDuration(),
|
68
|
-
|
71
|
+
duration = $tw.utils.hop(options,"animationDuration") ? parseInt(options.animationDuration) : $tw.utils.getAnimationDuration(),
|
72
|
+
srcWindow = element ? element.ownerDocument.defaultView : window;
|
69
73
|
// Now get ready to scroll the body
|
70
74
|
this.cancelScroll(srcWindow);
|
71
75
|
this.startTime = Date.now();
|
@@ -122,11 +126,11 @@ PageScroller.prototype.scrollIntoView = function(element,callback) {
|
|
122
126
|
drawFrame();
|
123
127
|
};
|
124
128
|
|
125
|
-
PageScroller.prototype.scrollSelectorIntoView = function(baseElement,selector,callback) {
|
129
|
+
PageScroller.prototype.scrollSelectorIntoView = function(baseElement,selector,callback,options) {
|
126
130
|
baseElement = baseElement || document.body;
|
127
131
|
var element = baseElement.querySelector(selector);
|
128
132
|
if(element) {
|
129
|
-
this.scrollIntoView(element,callback);
|
133
|
+
this.scrollIntoView(element,callback,options);
|
130
134
|
}
|
131
135
|
};
|
132
136
|
|
@@ -30,11 +30,7 @@ exports.getEditionInfo = function() {
|
|
30
30
|
var entry = entries[entryIndex];
|
31
31
|
// Check if directories have a valid tiddlywiki.info
|
32
32
|
if(!editionInfo[entry] && $tw.utils.isDirectory(path.resolve(editionPath,entry))) {
|
33
|
-
var info;
|
34
|
-
try {
|
35
|
-
info = JSON.parse(fs.readFileSync(path.resolve(editionPath,entry,"tiddlywiki.info"),"utf8"));
|
36
|
-
} catch(ex) {
|
37
|
-
}
|
33
|
+
var info = $tw.utils.parseJSONSafe(fs.readFileSync(path.resolve(editionPath,entry,"tiddlywiki.info"),"utf8"),null);
|
38
34
|
if(info) {
|
39
35
|
editionInfo[entry] = info;
|
40
36
|
}
|
@@ -24,10 +24,8 @@ exports.repackPlugin = function(title,additionalTiddlers,excludeTiddlers) {
|
|
24
24
|
throw "No such tiddler as " + title;
|
25
25
|
}
|
26
26
|
// Extract the JSON
|
27
|
-
var jsonPluginTiddler;
|
28
|
-
|
29
|
-
jsonPluginTiddler = JSON.parse(pluginTiddler.fields.text);
|
30
|
-
} catch(e) {
|
27
|
+
var jsonPluginTiddler = $tw.utils.parseJSONSafe(pluginTiddler.fields.text,null);
|
28
|
+
if(!jsonPluginTiddler) {
|
31
29
|
throw "Cannot parse plugin tiddler " + title + "\n" + $tw.language.getString("Error/Caption") + ": " + e;
|
32
30
|
}
|
33
31
|
// Get the list of tiddlers
|
@@ -71,8 +71,8 @@ ActionListopsWidget.prototype.invokeAction = function(triggeringWidget,
|
|
71
71
|
}
|
72
72
|
if(this.subfilter) {
|
73
73
|
var inputList = this.wiki.getTiddlerList(this.target,field,index),
|
74
|
-
subfilter =
|
75
|
-
this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(this.wiki.filterTiddlers(subfilter,this)));
|
74
|
+
subfilter = "[all[]] " + this.subfilter;
|
75
|
+
this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(this.wiki.filterTiddlers(subfilter,this,this.wiki.makeTiddlerIterator(inputList))));
|
76
76
|
}
|
77
77
|
if(this.filtertags) {
|
78
78
|
var tiddler = this.wiki.getTiddler(this.target),
|
@@ -247,7 +247,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
|
|
247
247
|
*/
|
248
248
|
ButtonWidget.prototype.refresh = function(changedTiddlers) {
|
249
249
|
var changedAttributes = this.computeAttributes();
|
250
|
-
if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled) {
|
250
|
+
if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled || changedAttributes["default"]) {
|
251
251
|
this.refreshSelf();
|
252
252
|
return true;
|
253
253
|
} else if(changedAttributes["class"]) {
|
@@ -27,7 +27,10 @@ DraggableWidget.prototype = new Widget();
|
|
27
27
|
Render this widget into the DOM
|
28
28
|
*/
|
29
29
|
DraggableWidget.prototype.render = function(parent,nextSibling) {
|
30
|
-
var self = this
|
30
|
+
var self = this,
|
31
|
+
tag,
|
32
|
+
domNode,
|
33
|
+
classes = [];
|
31
34
|
// Save the parent dom node
|
32
35
|
this.parentDomNode = parent;
|
33
36
|
// Compute our attributes
|
@@ -35,18 +38,23 @@ DraggableWidget.prototype.render = function(parent,nextSibling) {
|
|
35
38
|
// Execute our logic
|
36
39
|
this.execute();
|
37
40
|
// Sanitise the specified tag
|
38
|
-
|
41
|
+
tag = this.draggableTag;
|
39
42
|
if($tw.config.htmlUnsafeElements.indexOf(tag) !== -1) {
|
40
43
|
tag = "div";
|
41
44
|
}
|
42
45
|
// Create our element
|
43
|
-
|
46
|
+
domNode = this.document.createElement(tag);
|
44
47
|
// Assign classes
|
45
|
-
var classes = ["tc-draggable"];
|
46
48
|
if(this.draggableClasses) {
|
47
49
|
classes.push(this.draggableClasses);
|
48
50
|
}
|
51
|
+
if(!this.dragHandleSelector) {
|
52
|
+
classes.push("tc-draggable");
|
53
|
+
}
|
49
54
|
domNode.setAttribute("class",classes.join(" "));
|
55
|
+
// Insert the node into the DOM and render any children
|
56
|
+
parent.insertBefore(domNode,nextSibling);
|
57
|
+
this.renderChildren(domNode,null);
|
50
58
|
// Add event handlers
|
51
59
|
$tw.utils.makeDraggable({
|
52
60
|
domNode: domNode,
|
@@ -55,11 +63,9 @@ DraggableWidget.prototype.render = function(parent,nextSibling) {
|
|
55
63
|
startActions: self.startActions,
|
56
64
|
endActions: self.endActions,
|
57
65
|
dragImageType: self.dragImageType,
|
58
|
-
widget: this
|
66
|
+
widget: this,
|
67
|
+
selector: self.dragHandleSelector
|
59
68
|
});
|
60
|
-
// Insert the link into the DOM and render any children
|
61
|
-
parent.insertBefore(domNode,nextSibling);
|
62
|
-
this.renderChildren(domNode,null);
|
63
69
|
this.domNodes.push(domNode);
|
64
70
|
};
|
65
71
|
|
@@ -72,7 +78,8 @@ DraggableWidget.prototype.execute = function() {
|
|
72
78
|
this.draggableClasses = this.getAttribute("class");
|
73
79
|
this.startActions = this.getAttribute("startactions");
|
74
80
|
this.endActions = this.getAttribute("endactions");
|
75
|
-
this.dragImageType = this.getAttribute("dragimagetype");
|
81
|
+
this.dragImageType = this.getAttribute("dragimagetype");
|
82
|
+
this.dragHandleSelector = this.getAttribute("selector");
|
76
83
|
// Make the child widgets
|
77
84
|
this.makeChildWidgets();
|
78
85
|
};
|
@@ -46,6 +46,7 @@ EventWidget.prototype.render = function(parent,nextSibling) {
|
|
46
46
|
$tw.utils.each(this.types,function(type) {
|
47
47
|
domNode.addEventListener(type,function(event) {
|
48
48
|
var selector = self.getAttribute("selector"),
|
49
|
+
matchSelector = self.getAttribute("matchSelector"),
|
49
50
|
actions = self.getAttribute("$"+type) || self.getAttribute("actions-"+type),
|
50
51
|
stopPropagation = self.getAttribute("stopPropagation","onaction"),
|
51
52
|
selectedNode = event.target,
|
@@ -56,45 +57,48 @@ EventWidget.prototype.render = function(parent,nextSibling) {
|
|
56
57
|
if(selectedNode.nodeType === 3) {
|
57
58
|
selectedNode = selectedNode.parentNode;
|
58
59
|
}
|
60
|
+
// Check that the selected node matches any matchSelector
|
61
|
+
if(matchSelector && !$tw.utils.domMatchesSelector(selectedNode,matchSelector)) {
|
62
|
+
return false;
|
63
|
+
}
|
59
64
|
if(selector) {
|
60
65
|
// Search ancestors for a node that matches the selector
|
61
66
|
while(!$tw.utils.domMatchesSelector(selectedNode,selector) && selectedNode !== domNode) {
|
62
67
|
selectedNode = selectedNode.parentNode;
|
63
68
|
}
|
64
|
-
//
|
65
|
-
if(
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
// Exit if we didn't find one
|
70
|
+
if(selectedNode === domNode) {
|
71
|
+
return false;
|
72
|
+
}
|
73
|
+
// Only set up variables if we have actions to invoke
|
74
|
+
if(actions) {
|
75
|
+
$tw.utils.each(selectedNode.attributes,function(attribute) {
|
76
|
+
variables["dom-" + attribute.name] = attribute.value.toString();
|
77
|
+
});
|
78
|
+
//Add a variable with a popup coordinate string for the selected node
|
79
|
+
variables["tv-popup-coords"] = "(" + selectedNode.offsetLeft + "," + selectedNode.offsetTop +"," + selectedNode.offsetWidth + "," + selectedNode.offsetHeight + ")";
|
73
80
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
81
|
+
//Add variables for offset of selected node
|
82
|
+
variables["tv-selectednode-posx"] = selectedNode.offsetLeft.toString();
|
83
|
+
variables["tv-selectednode-posy"] = selectedNode.offsetTop.toString();
|
84
|
+
variables["tv-selectednode-width"] = selectedNode.offsetWidth.toString();
|
85
|
+
variables["tv-selectednode-height"] = selectedNode.offsetHeight.toString();
|
86
|
+
|
87
|
+
if(event.clientX && event.clientY) {
|
88
|
+
//Add variables for event X and Y position relative to selected node
|
89
|
+
selectedNodeRect = selectedNode.getBoundingClientRect();
|
90
|
+
variables["event-fromselected-posx"] = (event.clientX - selectedNodeRect.left).toString();
|
91
|
+
variables["event-fromselected-posy"] = (event.clientY - selectedNodeRect.top).toString();
|
85
92
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
93
|
+
//Add variables for event X and Y position relative to event catcher node
|
94
|
+
catcherNodeRect = self.domNode.getBoundingClientRect();
|
95
|
+
variables["event-fromcatcher-posx"] = (event.clientX - catcherNodeRect.left).toString();
|
96
|
+
variables["event-fromcatcher-posy"] = (event.clientY - catcherNodeRect.top).toString();
|
90
97
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
}
|
98
|
+
//Add variables for event X and Y position relative to the viewport
|
99
|
+
variables["event-fromviewport-posx"] = event.clientX.toString();
|
100
|
+
variables["event-fromviewport-posy"] = event.clientY.toString();
|
95
101
|
}
|
96
|
-
} else {
|
97
|
-
return false;
|
98
102
|
}
|
99
103
|
}
|
100
104
|
// Execute our actions with the variables
|
@@ -111,6 +111,16 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
|
|
111
111
|
if(this.imageAlt) {
|
112
112
|
domNode.setAttribute("alt",this.imageAlt);
|
113
113
|
}
|
114
|
+
// Add classes when the image loads or fails
|
115
|
+
$tw.utils.addClass(domNode,"tc-image-loading");
|
116
|
+
domNode.addEventListener("load",function() {
|
117
|
+
$tw.utils.removeClass(domNode,"tc-image-loading");
|
118
|
+
$tw.utils.addClass(domNode,"tc-image-loaded");
|
119
|
+
},false);
|
120
|
+
domNode.addEventListener("error",function() {
|
121
|
+
$tw.utils.removeClass(domNode,"tc-image-loading");
|
122
|
+
$tw.utils.addClass(domNode,"tc-image-error");
|
123
|
+
},false);
|
114
124
|
// Insert element
|
115
125
|
parent.insertBefore(domNode,nextSibling);
|
116
126
|
this.domNodes.push(domNode);
|
@@ -46,7 +46,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) {
|
|
46
46
|
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
|
47
47
|
// Accumulate the <$set> widgets from each tiddler
|
48
48
|
$tw.utils.each(this.tiddlerList,function(title) {
|
49
|
-
var parser = widgetPointer.wiki.parseTiddler(title);
|
49
|
+
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true});
|
50
50
|
if(parser) {
|
51
51
|
var parseTreeNode = parser.tree[0];
|
52
52
|
while(parseTreeNode && parseTreeNode.type === "set") {
|
@@ -44,8 +44,7 @@ NavigatorWidget.prototype.render = function(parent,nextSibling) {
|
|
44
44
|
{type: "tm-fold-tiddler", handler: "handleFoldTiddlerEvent"},
|
45
45
|
{type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"},
|
46
46
|
{type: "tm-fold-all-tiddlers", handler: "handleFoldAllTiddlersEvent"},
|
47
|
-
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"}
|
48
|
-
{type: "tm-rename-tiddler", handler: "handleRenameTiddlerEvent"}
|
47
|
+
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"}
|
49
48
|
]);
|
50
49
|
this.parentDomNode = parent;
|
51
50
|
this.computeAttributes();
|
@@ -499,11 +498,7 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
|
|
499
498
|
// Import JSON tiddlers into a pending import tiddler
|
500
499
|
NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
501
500
|
// Get the tiddlers
|
502
|
-
var tiddlers = [];
|
503
|
-
try {
|
504
|
-
tiddlers = JSON.parse(event.param);
|
505
|
-
} catch(e) {
|
506
|
-
}
|
501
|
+
var tiddlers = $tw.utils.parseJSONSafe(event.param,[]);
|
507
502
|
// Get the current $:/Import tiddler
|
508
503
|
var importTitle = event.importTitle ? event.importTitle : IMPORT_TITLE,
|
509
504
|
importTiddler = this.wiki.getTiddler(importTitle),
|
@@ -636,16 +631,6 @@ NavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) {
|
|
636
631
|
});
|
637
632
|
};
|
638
633
|
|
639
|
-
NavigatorWidget.prototype.handleRenameTiddlerEvent = function(event) {
|
640
|
-
var options = {},
|
641
|
-
paramObject = event.paramObject || {},
|
642
|
-
from = paramObject.from || event.tiddlerTitle,
|
643
|
-
to = paramObject.to;
|
644
|
-
options.dontRenameInTags = (paramObject.renameInTags === "false" || paramObject.renameInTags === "no") ? true : false;
|
645
|
-
options.dontRenameInLists = (paramObject.renameInLists === "false" || paramObject.renameInLists === "no") ? true : false;
|
646
|
-
this.wiki.renameTiddler(from,to,options);
|
647
|
-
};
|
648
|
-
|
649
634
|
exports.navigator = NavigatorWidget;
|
650
635
|
|
651
636
|
})();
|
@@ -64,9 +64,9 @@ RadioWidget.prototype.getValue = function() {
|
|
64
64
|
tiddler = this.wiki.getTiddler(this.radioTitle);
|
65
65
|
if(tiddler) {
|
66
66
|
if(this.radioIndex) {
|
67
|
-
value = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex);
|
67
|
+
value = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex,this.radioDefault);
|
68
68
|
} else {
|
69
|
-
value = tiddler.getFieldString(this.radioField);
|
69
|
+
value = tiddler.getFieldString(this.radioField,this.radioDefault);
|
70
70
|
}
|
71
71
|
} else {
|
72
72
|
value = this.radioDefault;
|
@@ -38,10 +38,14 @@ ScrollableWidget.prototype.handleScrollEvent = function(event) {
|
|
38
38
|
if(this.outerDomNode.scrollWidth <= this.outerDomNode.offsetWidth && this.outerDomNode.scrollHeight <= this.outerDomNode.offsetHeight && this.fallthrough === "yes") {
|
39
39
|
return true;
|
40
40
|
}
|
41
|
+
var options = {};
|
42
|
+
if($tw.utils.hop(event.paramObject,"animationDuration")) {
|
43
|
+
options.animationDuration = event.paramObject.animationDuration;
|
44
|
+
}
|
41
45
|
if(event.paramObject && event.paramObject.selector) {
|
42
|
-
this.scrollSelectorIntoView(null,event.paramObject.selector);
|
46
|
+
this.scrollSelectorIntoView(null,event.paramObject.selector,null,options);
|
43
47
|
} else {
|
44
|
-
this.scrollIntoView(event.target);
|
48
|
+
this.scrollIntoView(event.target,null,options);
|
45
49
|
}
|
46
50
|
return false; // Handled event
|
47
51
|
};
|
@@ -49,9 +53,9 @@ ScrollableWidget.prototype.handleScrollEvent = function(event) {
|
|
49
53
|
/*
|
50
54
|
Scroll an element into view
|
51
55
|
*/
|
52
|
-
ScrollableWidget.prototype.scrollIntoView = function(element) {
|
53
|
-
var duration = $tw.utils.getAnimationDuration(),
|
54
|
-
|
56
|
+
ScrollableWidget.prototype.scrollIntoView = function(element,callback,options) {
|
57
|
+
var duration = $tw.utils.hop(options,"animationDuration") ? parseInt(options.animationDuration) : $tw.utils.getAnimationDuration(),
|
58
|
+
srcWindow = element ? element.ownerDocument.defaultView : window;
|
55
59
|
this.cancelScroll();
|
56
60
|
this.startTime = Date.now();
|
57
61
|
var scrollPosition = {
|
@@ -114,11 +118,11 @@ ScrollableWidget.prototype.scrollIntoView = function(element) {
|
|
114
118
|
}
|
115
119
|
};
|
116
120
|
|
117
|
-
ScrollableWidget.prototype.scrollSelectorIntoView = function(baseElement,selector,callback) {
|
121
|
+
ScrollableWidget.prototype.scrollSelectorIntoView = function(baseElement,selector,callback,options) {
|
118
122
|
baseElement = baseElement || document.body;
|
119
123
|
var element = baseElement.querySelector(selector);
|
120
124
|
if(element) {
|
121
|
-
this.scrollIntoView(element,callback);
|
125
|
+
this.scrollIntoView(element,callback,options);
|
122
126
|
}
|
123
127
|
};
|
124
128
|
|
@@ -155,8 +159,6 @@ ScrollableWidget.prototype.render = function(parent,nextSibling) {
|
|
155
159
|
// Create elements
|
156
160
|
this.outerDomNode = this.document.createElement("div");
|
157
161
|
$tw.utils.setStyle(this.outerDomNode,[
|
158
|
-
{overflowY: "auto"},
|
159
|
-
{overflowX: "auto"},
|
160
162
|
{webkitOverflowScrolling: "touch"}
|
161
163
|
]);
|
162
164
|
this.innerDomNode = this.document.createElement("div");
|
@@ -314,24 +314,40 @@ excludeEventAttributes: ignores attributes whose name begins with "on"
|
|
314
314
|
Widget.prototype.assignAttributes = function(domNode,options) {
|
315
315
|
options = options || {};
|
316
316
|
var self = this;
|
317
|
-
|
318
|
-
// Check
|
319
|
-
if(options.excludeEventAttributes &&
|
320
|
-
|
317
|
+
var assignAttribute = function(name,value) {
|
318
|
+
// Check for excluded attribute names
|
319
|
+
if(options.excludeEventAttributes && name.substr(0,2) === "on") {
|
320
|
+
value = undefined;
|
321
321
|
}
|
322
|
-
if(
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
322
|
+
if(value !== undefined) {
|
323
|
+
// Handle the xlink: namespace
|
324
|
+
var namespace = null;
|
325
|
+
if(name.substr(0,6) === "xlink:" && name.length > 6) {
|
326
|
+
namespace = "http://www.w3.org/1999/xlink";
|
327
|
+
name = name.substr(6);
|
328
|
+
}
|
329
|
+
// Handle styles
|
330
|
+
if(name.substr(0,6) === "style." && name.length > 6) {
|
331
|
+
domNode.style[$tw.utils.unHyphenateCss(name.substr(6))] = value;
|
332
|
+
} else {
|
333
|
+
// Setting certain attributes can cause a DOM error (eg xmlns on the svg element)
|
334
|
+
try {
|
335
|
+
domNode.setAttributeNS(namespace,name,value);
|
336
|
+
} catch(e) {
|
330
337
|
}
|
331
|
-
} catch(e) {
|
332
338
|
}
|
333
339
|
}
|
334
|
-
}
|
340
|
+
}
|
341
|
+
// Not all parse tree nodes have the orderedAttributes property
|
342
|
+
if(this.parseTreeNode.orderedAttributes) {
|
343
|
+
$tw.utils.each(this.parseTreeNode.orderedAttributes,function(attribute,index) {
|
344
|
+
assignAttribute(attribute.name,self.attributes[attribute.name]);
|
345
|
+
});
|
346
|
+
} else {
|
347
|
+
$tw.utils.each(Object.keys(self.attributes).sort(),function(name) {
|
348
|
+
assignAttribute(name,self.attributes[name]);
|
349
|
+
});
|
350
|
+
}
|
335
351
|
};
|
336
352
|
|
337
353
|
/*
|
@@ -46,26 +46,31 @@ function relinkTiddler(fromTitle,toTitle,options) {
|
|
46
46
|
if(!tiddler.fields["plugin-type"] && type !== "application/javascript") {
|
47
47
|
var tags = tiddler.fields.tags ? tiddler.fields.tags.slice(0) : undefined,
|
48
48
|
list = tiddler.fields.list ? tiddler.fields.list.slice(0) : undefined,
|
49
|
-
isModified = false
|
49
|
+
isModified = false,
|
50
|
+
processList = function(listField) {
|
51
|
+
if(listField && listField.indexOf(fromTitle) !== -1) {
|
52
|
+
// Remove any existing instances of the toTitle
|
53
|
+
var p = listField.indexOf(toTitle);
|
54
|
+
while(p !== -1) {
|
55
|
+
listField.splice(p,1);
|
56
|
+
p = listField.indexOf(toTitle);
|
57
|
+
}
|
58
|
+
// Replace the fromTitle with toTitle
|
59
|
+
$tw.utils.each(listField,function (title,index) {
|
60
|
+
if(title === fromTitle) {
|
61
|
+
listField[index] = toTitle;
|
62
|
+
isModified = true;
|
63
|
+
}
|
64
|
+
});
|
65
|
+
}
|
66
|
+
};
|
50
67
|
if(!options.dontRenameInTags) {
|
51
68
|
// Rename tags
|
52
|
-
|
53
|
-
if(title === fromTitle) {
|
54
|
-
console.log("Renaming tag '" + tags[index] + "' to '" + toTitle + "' of tiddler '" + tiddler.fields.title + "'");
|
55
|
-
tags[index] = toTitle;
|
56
|
-
isModified = true;
|
57
|
-
}
|
58
|
-
});
|
69
|
+
processList(tags);
|
59
70
|
}
|
60
71
|
if(!options.dontRenameInLists) {
|
61
72
|
// Rename lists
|
62
|
-
|
63
|
-
if(title === fromTitle) {
|
64
|
-
console.log("Renaming list item '" + list[index] + "' to '" + toTitle + "' of tiddler '" + tiddler.fields.title + "'");
|
65
|
-
list[index] = toTitle;
|
66
|
-
isModified = true;
|
67
|
-
}
|
68
|
-
});
|
73
|
+
processList(list);
|
69
74
|
}
|
70
75
|
if(isModified) {
|
71
76
|
var newTiddler = new $tw.Tiddler(tiddler,{tags: tags, list: list},self.getModificationFields())
|
package/core/modules/wiki.js
CHANGED
@@ -639,14 +639,25 @@ Lookup a given tiddler and return a list of all the tiddlers that include it in
|
|
639
639
|
*/
|
640
640
|
exports.findListingsOfTiddler = function(targetTitle,fieldName) {
|
641
641
|
fieldName = fieldName || "list";
|
642
|
-
var
|
643
|
-
this.
|
644
|
-
var
|
645
|
-
|
646
|
-
|
647
|
-
|
642
|
+
var wiki = this;
|
643
|
+
var listings = this.getGlobalCache("listings-" + fieldName,function() {
|
644
|
+
var listings = Object.create(null);
|
645
|
+
wiki.each(function(tiddler,title) {
|
646
|
+
var list = $tw.utils.parseStringArray(tiddler.fields[fieldName]);
|
647
|
+
if(list) {
|
648
|
+
for(var i = 0; i < list.length; i++) {
|
649
|
+
var listItem = list[i],
|
650
|
+
listing = listings[listItem] || [];
|
651
|
+
if (listing.indexOf(title) === -1) {
|
652
|
+
listing.push(title);
|
653
|
+
}
|
654
|
+
listings[listItem] = listing;
|
655
|
+
}
|
656
|
+
}
|
657
|
+
});
|
658
|
+
return listings;
|
648
659
|
});
|
649
|
-
return
|
660
|
+
return listings[targetTitle] || [];
|
650
661
|
};
|
651
662
|
|
652
663
|
/*
|
@@ -822,12 +833,7 @@ exports.getTiddlerData = function(titleOrTiddler,defaultData) {
|
|
822
833
|
switch(tiddler.fields.type) {
|
823
834
|
case "application/json":
|
824
835
|
// JSON tiddler
|
825
|
-
|
826
|
-
data = JSON.parse(tiddler.fields.text);
|
827
|
-
} catch(ex) {
|
828
|
-
return defaultData;
|
829
|
-
}
|
830
|
-
return data;
|
836
|
+
return $tw.utils.parseJSONSafe(tiddler.fields.text,defaultData);
|
831
837
|
case "application/x-tiddler-dictionary":
|
832
838
|
return $tw.utils.parseFields(tiddler.fields.text);
|
833
839
|
}
|
@@ -1201,23 +1207,28 @@ Return an array of tiddler titles that match a search string
|
|
1201
1207
|
text: The text string to search for
|
1202
1208
|
options: see below
|
1203
1209
|
Options available:
|
1204
|
-
source: an iterator function for the source tiddlers, called source(iterator),
|
1210
|
+
source: an iterator function for the source tiddlers, called source(iterator),
|
1211
|
+
where iterator is called as iterator(tiddler,title)
|
1205
1212
|
exclude: An array of tiddler titles to exclude from the search
|
1206
1213
|
invert: If true returns tiddlers that do not contain the specified string
|
1207
1214
|
caseSensitive: If true forces a case sensitive search
|
1208
1215
|
field: If specified, restricts the search to the specified field, or an array of field names
|
1209
1216
|
anchored: If true, forces all but regexp searches to be anchored to the start of text
|
1210
1217
|
excludeField: If true, the field options are inverted to specify the fields that are not to be searched
|
1218
|
+
|
1211
1219
|
The search mode is determined by the first of these boolean flags to be true
|
1212
1220
|
literal: searches for literal string
|
1213
1221
|
whitespace: same as literal except runs of whitespace are treated as a single space
|
1214
1222
|
regexp: treats the search term as a regular expression
|
1215
|
-
words: (default) treats search string as a list of tokens, and matches if all tokens are found,
|
1223
|
+
words: (default) treats search string as a list of tokens, and matches if all tokens are found,
|
1224
|
+
regardless of adjacency or ordering
|
1225
|
+
some: treats search string as a list of tokens, and matches if at least ONE token is found
|
1216
1226
|
*/
|
1217
1227
|
exports.search = function(text,options) {
|
1218
1228
|
options = options || {};
|
1219
1229
|
var self = this,
|
1220
1230
|
t,
|
1231
|
+
regExpStr="",
|
1221
1232
|
invert = !!options.invert;
|
1222
1233
|
// Convert the search string into a regexp for each term
|
1223
1234
|
var terms, searchTermsRegExps,
|
@@ -1244,7 +1255,18 @@ exports.search = function(text,options) {
|
|
1244
1255
|
searchTermsRegExps = null;
|
1245
1256
|
console.log("Regexp error parsing /(" + text + ")/" + flags + ": ",e);
|
1246
1257
|
}
|
1247
|
-
} else {
|
1258
|
+
} else if(options.some) {
|
1259
|
+
terms = text.trim().split(/ +/);
|
1260
|
+
if(terms.length === 1 && terms[0] === "") {
|
1261
|
+
searchTermsRegExps = null;
|
1262
|
+
} else {
|
1263
|
+
searchTermsRegExps = [];
|
1264
|
+
for(t=0; t<terms.length; t++) {
|
1265
|
+
regExpStr += (t===0) ? anchor + $tw.utils.escapeRegExp(terms[t]) : "|" + anchor + $tw.utils.escapeRegExp(terms[t]);
|
1266
|
+
}
|
1267
|
+
searchTermsRegExps.push(new RegExp("(" + regExpStr + ")",flags));
|
1268
|
+
}
|
1269
|
+
} else { // default: words
|
1248
1270
|
terms = text.split(/ +/);
|
1249
1271
|
if(terms.length === 1 && terms[0] === "") {
|
1250
1272
|
searchTermsRegExps = null;
|
@@ -1255,7 +1277,7 @@ exports.search = function(text,options) {
|
|
1255
1277
|
}
|
1256
1278
|
}
|
1257
1279
|
}
|
1258
|
-
|
1280
|
+
// Accumulate the array of fields to be searched or excluded from the search
|
1259
1281
|
var fields = [];
|
1260
1282
|
if(options.field) {
|
1261
1283
|
if($tw.utils.isArray(options.field)) {
|
@@ -6,7 +6,7 @@ title: $:/core/templates/tiddlywiki5.html
|
|
6
6
|
<head>
|
7
7
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
8
8
|
<!--~~ Raw markup for the top of the head section ~~-->
|
9
|
-
`{{{ [<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified/TopHead]] ||$:/core/templates/raw-static-tiddler}}}`
|
9
|
+
`{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified/TopHead]] ||$:/core/templates/raw-static-tiddler}}}`
|
10
10
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
|
11
11
|
<meta name="application-name" content="TiddlyWiki" />
|
12
12
|
<meta name="generator" content="TiddlyWiki" />
|
@@ -0,0 +1,9 @@
|
|
1
|
+
title: $:/core/ui/ControlPanel/FieldEditor
|
2
|
+
tags: $:/tags/ControlPanel/Cascades
|
3
|
+
caption: {{$:/language/ControlPanel/FieldEditor/Caption}}
|
4
|
+
|
5
|
+
\define lingo-base() $:/language/ControlPanel/FieldEditor/
|
6
|
+
|
7
|
+
<<lingo Hint>>
|
8
|
+
|
9
|
+
{{$:/tags/FieldEditorFilter||$:/snippets/ListTaggedCascade}}
|
@@ -10,7 +10,7 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
|
10
10
|
|
11
11
|
<$set name="edit-preview-state" value={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualify "$:/state/showeditpreview">] }}}>
|
12
12
|
<$vars importTitle=<<qualify $:/ImportImage>> importState=<<qualify $:/state/ImportImage>> >
|
13
|
-
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> ><$reveal stateTitle=<<edit-preview-state>> type="match" text="yes">
|
13
|
+
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> ><$reveal stateTitle=<<edit-preview-state>> type="match" text="yes" tag="div">
|
14
14
|
<div class="tc-tiddler-preview">
|
15
15
|
|
16
16
|
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
@@ -28,7 +28,7 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
|
|
28
28
|
</div>
|
29
29
|
</$reveal>
|
30
30
|
|
31
|
-
<$reveal stateTitle=<<edit-preview-state>> type="nomatch" text="yes">
|
31
|
+
<$reveal stateTitle=<<edit-preview-state>> type="nomatch" text="yes" tag="div">
|
32
32
|
|
33
33
|
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
|
34
34
|
|
@@ -0,0 +1,3 @@
|
|
1
|
+
title: $:/core/ui/EditTemplate/fieldEditor/default
|
2
|
+
|
3
|
+
<$edit-text tiddler=<<currentTiddler>> field=<<currentField>> default="" class="tc-edit-texteditor" placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} tabindex={{$:/config/EditTabIndex}} cancelPopups="yes"/>
|