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
@@ -16,19 +16,37 @@ Filter operator for checking if a title starts with a prefix
|
|
16
16
|
Export our filter function
|
17
17
|
*/
|
18
18
|
exports.prefix = function(source,operator,options) {
|
19
|
-
var results = []
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
var results = [],
|
20
|
+
suffixes = (operator.suffixes || [])[0] || [];
|
21
|
+
if(suffixes.indexOf("caseinsensitive") !== -1) {
|
22
|
+
var operand = operator.operand.toLowerCase();
|
23
|
+
if(operator.prefix === "!") {
|
24
|
+
source(function(tiddler,title) {
|
25
|
+
if(title.toLowerCase().substr(0,operand.length) !== operand) {
|
26
|
+
results.push(title);
|
27
|
+
}
|
28
|
+
});
|
29
|
+
} else {
|
30
|
+
source(function(tiddler,title) {
|
31
|
+
if(title.toLowerCase().substr(0,operand.length) === operand) {
|
32
|
+
results.push(title);
|
33
|
+
}
|
34
|
+
});
|
35
|
+
}
|
26
36
|
} else {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
37
|
+
if(operator.prefix === "!") {
|
38
|
+
source(function(tiddler,title) {
|
39
|
+
if(title.substr(0,operator.operand.length) !== operator.operand) {
|
40
|
+
results.push(title);
|
41
|
+
}
|
42
|
+
});
|
43
|
+
} else {
|
44
|
+
source(function(tiddler,title) {
|
45
|
+
if(title.substr(0,operator.operand.length) === operator.operand) {
|
46
|
+
results.push(title);
|
47
|
+
}
|
48
|
+
});
|
49
|
+
}
|
32
50
|
}
|
33
51
|
return results;
|
34
52
|
};
|
@@ -16,12 +16,22 @@ Filter operator for removing a prefix from each title in the list. Titles that d
|
|
16
16
|
Export our filter function
|
17
17
|
*/
|
18
18
|
exports.removeprefix = function(source,operator,options) {
|
19
|
-
var results = []
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
var results = [],
|
20
|
+
suffixes = (operator.suffixes || [])[0] || [];
|
21
|
+
if(suffixes.indexOf("caseinsensitive") !== -1) {
|
22
|
+
var operand = operator.operand.toLowerCase();
|
23
|
+
source(function(tiddler,title) {
|
24
|
+
if(title.toLowerCase().substr(0,operand.length) === operand) {
|
25
|
+
results.push(title.substr(operand.length));
|
26
|
+
}
|
27
|
+
});
|
28
|
+
} else {
|
29
|
+
source(function(tiddler,title) {
|
30
|
+
if(title.substr(0,operator.operand.length) === operator.operand) {
|
31
|
+
results.push(title.substr(operator.operand.length));
|
32
|
+
}
|
33
|
+
});
|
34
|
+
}
|
25
35
|
return results;
|
26
36
|
};
|
27
37
|
|
@@ -16,12 +16,26 @@ Filter operator for removing a suffix from each title in the list. Titles that d
|
|
16
16
|
Export our filter function
|
17
17
|
*/
|
18
18
|
exports.removesuffix = function(source,operator,options) {
|
19
|
-
var results = []
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
var results = [],
|
20
|
+
suffixes = (operator.suffixes || [])[0] || [];
|
21
|
+
if (!operator.operand) {
|
22
|
+
source(function(tiddler,title) {
|
23
|
+
results.push(title);
|
24
|
+
});
|
25
|
+
} else if(suffixes.indexOf("caseinsensitive") !== -1) {
|
26
|
+
var operand = operator.operand.toLowerCase();
|
27
|
+
source(function(tiddler,title) {
|
28
|
+
if(title && title.toLowerCase().substr(-operand.length) === operand) {
|
29
|
+
results.push(title.substr(0,title.length - operand.length));
|
30
|
+
}
|
31
|
+
});
|
32
|
+
} else {
|
33
|
+
source(function(tiddler,title) {
|
34
|
+
if(title && title.substr(-operator.operand.length) === operator.operand) {
|
35
|
+
results.push(title.substr(0,title.length - operator.operand.length));
|
36
|
+
}
|
37
|
+
});
|
38
|
+
}
|
25
39
|
return results;
|
26
40
|
};
|
27
41
|
|
@@ -16,19 +16,41 @@ Filter operator for checking if a title ends with a suffix
|
|
16
16
|
Export our filter function
|
17
17
|
*/
|
18
18
|
exports.suffix = function(source,operator,options) {
|
19
|
-
var results = []
|
20
|
-
|
19
|
+
var results = [],
|
20
|
+
suffixes = (operator.suffixes || [])[0] || [];
|
21
|
+
if (!operator.operand) {
|
21
22
|
source(function(tiddler,title) {
|
22
|
-
|
23
|
-
results.push(title);
|
24
|
-
}
|
23
|
+
results.push(title);
|
25
24
|
});
|
25
|
+
} else if(suffixes.indexOf("caseinsensitive") !== -1) {
|
26
|
+
var operand = operator.operand.toLowerCase();
|
27
|
+
if(operator.prefix === "!") {
|
28
|
+
source(function(tiddler,title) {
|
29
|
+
if(title.toLowerCase().substr(-operand.length) !== operand) {
|
30
|
+
results.push(title);
|
31
|
+
}
|
32
|
+
});
|
33
|
+
} else {
|
34
|
+
source(function(tiddler,title) {
|
35
|
+
if(title.toLowerCase().substr(-operand.length) === operand) {
|
36
|
+
results.push(title);
|
37
|
+
}
|
38
|
+
});
|
39
|
+
}
|
26
40
|
} else {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
41
|
+
if(operator.prefix === "!") {
|
42
|
+
source(function(tiddler,title) {
|
43
|
+
if(title.substr(-operator.operand.length) !== operator.operand) {
|
44
|
+
results.push(title);
|
45
|
+
}
|
46
|
+
});
|
47
|
+
} else {
|
48
|
+
source(function(tiddler,title) {
|
49
|
+
if(title.substr(-operator.operand.length) === operator.operand) {
|
50
|
+
results.push(title);
|
51
|
+
}
|
52
|
+
});
|
53
|
+
}
|
32
54
|
}
|
33
55
|
return results;
|
34
56
|
};
|
@@ -19,7 +19,7 @@ exports.untagged = function(source,operator,options) {
|
|
19
19
|
var results = [],
|
20
20
|
expected = (operator.prefix === "!");
|
21
21
|
source(function(tiddler,title) {
|
22
|
-
if((tiddler && $tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length > 0) === expected) {
|
22
|
+
if(((tiddler && $tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length > 0) === expected) || (!tiddler && !expected)) {
|
23
23
|
results.push(title);
|
24
24
|
}
|
25
25
|
});
|
package/core/modules/filters.js
CHANGED
@@ -95,10 +95,12 @@ function parseFilterOperation(operators,filterString,p) {
|
|
95
95
|
if(nextBracketPos === -1) {
|
96
96
|
throw "Missing closing bracket in filter expression";
|
97
97
|
}
|
98
|
-
if(
|
98
|
+
if(operator.regexp) {
|
99
|
+
operand.text = "";
|
100
|
+
} else {
|
99
101
|
operand.text = filterString.substring(p,nextBracketPos);
|
100
|
-
operator.operands.push(operand);
|
101
102
|
}
|
103
|
+
operator.operands.push(operand);
|
102
104
|
p = nextBracketPos + 1;
|
103
105
|
}
|
104
106
|
|
@@ -239,7 +239,7 @@ exports.parseFilterVariable = function(source) {
|
|
239
239
|
};
|
240
240
|
|
241
241
|
/*
|
242
|
-
Look for an HTML attribute definition. Returns null if not found, otherwise returns {type: "attribute", name:,
|
242
|
+
Look for an HTML attribute definition. Returns null if not found, otherwise returns {type: "attribute", name:, type: "filtered|string|indirect|macro", value|filter|textReference:, start:, end:,}
|
243
243
|
*/
|
244
244
|
exports.parseAttribute = function(source,pos) {
|
245
245
|
var node = {
|
@@ -248,7 +248,7 @@ exports.parseAttribute = function(source,pos) {
|
|
248
248
|
// Define our regexps
|
249
249
|
var reAttributeName = /([^\/\s>"'=]+)/g,
|
250
250
|
reUnquotedAttribute = /([^\/\s<>"'=]+)/g,
|
251
|
-
reFilteredValue = /\{\{\{(
|
251
|
+
reFilteredValue = /\{\{\{([\S\s]+?)\}\}\}/g,
|
252
252
|
reIndirectValue = /\{\{([^\}]+)\}\}/g;
|
253
253
|
// Skip whitespace
|
254
254
|
pos = $tw.utils.skipWhiteSpace(source,pos);
|
@@ -52,7 +52,7 @@ PluginSwitcher.prototype.switchPlugins = function() {
|
|
52
52
|
var tiddler = self.wiki.getTiddler(title);
|
53
53
|
if(tiddler && tiddler.isPlugin() && plugins.indexOf(title) === -1) {
|
54
54
|
plugins.push(title);
|
55
|
-
var pluginInfo =
|
55
|
+
var pluginInfo = $tw.utils.parseJSONSafe(self.wiki.getTiddlerText(title)),
|
56
56
|
dependents = $tw.utils.parseStringArray(tiddler.fields.dependents || "");
|
57
57
|
$tw.utils.each(dependents,function(title) {
|
58
58
|
accumulatePlugin(title);
|
@@ -61,7 +61,7 @@ GiteaSaver.prototype.save = function(text,method,callback) {
|
|
61
61
|
}
|
62
62
|
var use_put = true;
|
63
63
|
if(xhr.status !== 404) {
|
64
|
-
getResponseData =
|
64
|
+
getResponseData = $tw.utils.parseJSONSafe(getResponseDataJson);
|
65
65
|
$tw.utils.each(getResponseData,function(details) {
|
66
66
|
if(details.name === filename) {
|
67
67
|
sha = details.sha;
|
@@ -104,7 +104,7 @@ GiteaSaver.prototype.upload = function(uri,method,headers,data,callback) {
|
|
104
104
|
if(err) {
|
105
105
|
return callback(err);
|
106
106
|
}
|
107
|
-
var putResponseData =
|
107
|
+
var putResponseData = $tw.utils.parseJSONSafe(putResponseDataJson);
|
108
108
|
callback(null);
|
109
109
|
}
|
110
110
|
});
|
@@ -61,7 +61,7 @@ GitHubSaver.prototype.save = function(text,method,callback) {
|
|
61
61
|
return callback(err);
|
62
62
|
}
|
63
63
|
if(xhr.status !== 404) {
|
64
|
-
getResponseData =
|
64
|
+
getResponseData = $tw.utils.parseJSONSafe(getResponseDataJson);
|
65
65
|
$tw.utils.each(getResponseData,function(details) {
|
66
66
|
if(details.name === filename) {
|
67
67
|
sha = details.sha;
|
@@ -84,7 +84,7 @@ GitHubSaver.prototype.save = function(text,method,callback) {
|
|
84
84
|
if(err) {
|
85
85
|
return callback(err);
|
86
86
|
}
|
87
|
-
var putResponseData =
|
87
|
+
var putResponseData = $tw.utils.parseJSONSafe(putResponseDataJson);
|
88
88
|
callback(null);
|
89
89
|
}
|
90
90
|
});
|
@@ -58,7 +58,7 @@ GitLabSaver.prototype.save = function(text,method,callback) {
|
|
58
58
|
}
|
59
59
|
var requestType = "POST";
|
60
60
|
if(xhr.status !== 404) {
|
61
|
-
getResponseData =
|
61
|
+
getResponseData = $tw.utils.parseJSONSafe(getResponseDataJson);
|
62
62
|
$tw.utils.each(getResponseData,function(details) {
|
63
63
|
if(details.name === filename) {
|
64
64
|
requestType = "PUT";
|
@@ -82,7 +82,7 @@ GitLabSaver.prototype.save = function(text,method,callback) {
|
|
82
82
|
if(err) {
|
83
83
|
return callback(err);
|
84
84
|
}
|
85
|
-
var putResponseData =
|
85
|
+
var putResponseData = $tw.utils.parseJSONSafe(putResponseDataJson);
|
86
86
|
callback(null);
|
87
87
|
}
|
88
88
|
});
|
@@ -18,7 +18,7 @@ exports.path = /^\/recipes\/default\/tiddlers\/(.+)$/;
|
|
18
18
|
|
19
19
|
exports.handler = function(request,response,state) {
|
20
20
|
var title = $tw.utils.decodeURIComponentSafe(state.params[0]),
|
21
|
-
fields =
|
21
|
+
fields = $tw.utils.parseJSONSafe(state.data);
|
22
22
|
// Pull up any subfields in the `fields` object
|
23
23
|
if(fields.fields) {
|
24
24
|
$tw.utils.each(fields.fields,function(field,name) {
|
@@ -34,7 +34,6 @@ function Server(options) {
|
|
34
34
|
this.authenticators = options.authenticators || [];
|
35
35
|
this.wiki = options.wiki;
|
36
36
|
this.boot = options.boot || $tw.boot;
|
37
|
-
this.servername = $tw.utils.transliterateToSafeASCII(this.wiki.getTiddlerText("$:/SiteTitle") || "TiddlyWiki5");
|
38
37
|
// Initialise the variables
|
39
38
|
this.variables = $tw.utils.extend({},this.defaultVariables);
|
40
39
|
if(options.variables) {
|
@@ -44,7 +43,8 @@ function Server(options) {
|
|
44
43
|
}
|
45
44
|
}
|
46
45
|
}
|
47
|
-
|
46
|
+
// Setup the default required plugins
|
47
|
+
this.requiredPlugins = this.get("required-plugins").split(',');
|
48
48
|
// Initialise CSRF
|
49
49
|
this.csrfDisable = this.get("csrf-disable") === "yes";
|
50
50
|
// Initialize Gzip compression
|
@@ -52,14 +52,24 @@ function Server(options) {
|
|
52
52
|
// Initialize browser-caching
|
53
53
|
this.enableBrowserCache = this.get("use-browser-cache") === "yes";
|
54
54
|
// Initialise authorization
|
55
|
-
var authorizedUserName
|
55
|
+
var authorizedUserName;
|
56
|
+
if(this.get("username") && this.get("password")) {
|
57
|
+
authorizedUserName = this.get("username");
|
58
|
+
} else if(this.get("credentials")) {
|
59
|
+
authorizedUserName = "(authenticated)";
|
60
|
+
} else {
|
61
|
+
authorizedUserName = "(anon)";
|
62
|
+
}
|
56
63
|
this.authorizationPrincipals = {
|
57
64
|
readers: (this.get("readers") || authorizedUserName).split(",").map($tw.utils.trim),
|
58
65
|
writers: (this.get("writers") || authorizedUserName).split(",").map($tw.utils.trim)
|
59
66
|
}
|
67
|
+
if(this.get("admin") || authorizedUserName !== "(anon)") {
|
68
|
+
this.authorizationPrincipals["admin"] = (this.get("admin") || authorizedUserName).split(',').map($tw.utils.trim)
|
69
|
+
}
|
60
70
|
// Load and initialise authenticators
|
61
71
|
$tw.modules.forEachModuleOfType("authenticator", function(title,authenticatorDefinition) {
|
62
|
-
// console.log("Loading
|
72
|
+
// console.log("Loading authenticator " + title);
|
63
73
|
self.addAuthenticator(authenticatorDefinition.AuthenticatorClass);
|
64
74
|
});
|
65
75
|
// Load route handlers
|
@@ -71,15 +81,21 @@ function Server(options) {
|
|
71
81
|
this.listenOptions = null;
|
72
82
|
this.protocol = "http";
|
73
83
|
var tlsKeyFilepath = this.get("tls-key"),
|
74
|
-
tlsCertFilepath = this.get("tls-cert")
|
84
|
+
tlsCertFilepath = this.get("tls-cert"),
|
85
|
+
tlsPassphrase = this.get("tls-passphrase");
|
75
86
|
if(tlsCertFilepath && tlsKeyFilepath) {
|
76
87
|
this.listenOptions = {
|
77
88
|
key: fs.readFileSync(path.resolve(this.boot.wikiPath,tlsKeyFilepath),"utf8"),
|
78
|
-
cert: fs.readFileSync(path.resolve(this.boot.wikiPath,tlsCertFilepath),"utf8")
|
89
|
+
cert: fs.readFileSync(path.resolve(this.boot.wikiPath,tlsCertFilepath),"utf8"),
|
90
|
+
passphrase: tlsPassphrase || ''
|
79
91
|
};
|
80
92
|
this.protocol = "https";
|
81
93
|
}
|
82
94
|
this.transport = require(this.protocol);
|
95
|
+
// Name the server and init the boot state
|
96
|
+
this.servername = $tw.utils.transliterateToSafeASCII(this.get("server-name") || this.wiki.getTiddlerText("$:/SiteTitle") || "TiddlyWiki5");
|
97
|
+
this.boot.origin = this.get("origin")? this.get("origin"): this.protocol+"://"+this.get("host")+":"+this.get("port");
|
98
|
+
this.boot.pathPrefix = this.get("path-prefix") || "";
|
83
99
|
}
|
84
100
|
|
85
101
|
/*
|
@@ -150,6 +166,7 @@ function sendResponse(request,response,statusCode,headers,data,encoding) {
|
|
150
166
|
Server.prototype.defaultVariables = {
|
151
167
|
port: "8080",
|
152
168
|
host: "127.0.0.1",
|
169
|
+
"required-plugins": "$:/plugins/tiddlywiki/filesystem,$:/plugins/tiddlywiki/tiddlyweb",
|
153
170
|
"root-tiddler": "$:/core/save/all",
|
154
171
|
"root-render-type": "text/plain",
|
155
172
|
"root-serve-type": "text/html",
|
@@ -239,15 +256,15 @@ Server.prototype.requestHandler = function(request,response,options) {
|
|
239
256
|
state.pathPrefix = options.pathPrefix || this.get("path-prefix") || "";
|
240
257
|
state.sendResponse = sendResponse.bind(self,request,response);
|
241
258
|
// Get the principals authorized to access this resource
|
242
|
-
|
259
|
+
state.authorizationType = options.authorizationType || this.methodMappings[request.method] || "readers";
|
243
260
|
// Check for the CSRF header if this is a write
|
244
|
-
if(!this.csrfDisable && authorizationType === "writers" && request.headers["x-requested-with"] !== "TiddlyWiki") {
|
261
|
+
if(!this.csrfDisable && state.authorizationType === "writers" && request.headers["x-requested-with"] !== "TiddlyWiki") {
|
245
262
|
response.writeHead(403,"'X-Requested-With' header required to login to '" + this.servername + "'");
|
246
263
|
response.end();
|
247
264
|
return;
|
248
265
|
}
|
249
266
|
// Check whether anonymous access is granted
|
250
|
-
state.allowAnon = this.isAuthorized(authorizationType,null);
|
267
|
+
state.allowAnon = this.isAuthorized(state.authorizationType,null);
|
251
268
|
// Authenticate with the first active authenticator
|
252
269
|
if(this.authenticators.length > 0) {
|
253
270
|
if(!this.authenticators[0].authenticateRequest(request,response,state)) {
|
@@ -256,7 +273,7 @@ Server.prototype.requestHandler = function(request,response,options) {
|
|
256
273
|
}
|
257
274
|
}
|
258
275
|
// Authorize with the authenticated username
|
259
|
-
if(!this.isAuthorized(authorizationType,state.authenticatedUsername)) {
|
276
|
+
if(!this.isAuthorized(state.authorizationType,state.authenticatedUsername)) {
|
260
277
|
response.writeHead(401,"'" + state.authenticatedUsername + "' is not authorized to access '" + this.servername + "'");
|
261
278
|
response.end();
|
262
279
|
return;
|
@@ -322,8 +339,16 @@ Server.prototype.listen = function(port,host,prefix) {
|
|
322
339
|
port = process.env[port] || 8080;
|
323
340
|
}
|
324
341
|
// Warn if required plugins are missing
|
325
|
-
|
326
|
-
|
342
|
+
var missing = [];
|
343
|
+
for (var index=0; index<this.requiredPlugins.length; index++) {
|
344
|
+
if (!this.wiki.getTiddler(this.requiredPlugins[index])) {
|
345
|
+
missing.push(this.requiredPlugins[index]);
|
346
|
+
}
|
347
|
+
}
|
348
|
+
if(missing.length > 0) {
|
349
|
+
var error = "Warning: Plugin(s) required for client-server operation are missing.\n"+
|
350
|
+
"\""+ missing.join("\", \"")+"\"";
|
351
|
+
$tw.utils.warning(error);
|
327
352
|
}
|
328
353
|
// Create the server
|
329
354
|
var server;
|
@@ -152,7 +152,7 @@ exports.startup = function() {
|
|
152
152
|
if(event.data.status.charAt(0) === "2") {
|
153
153
|
if(event.data.cookies) {
|
154
154
|
if(event.data.cookies.type === "save-info") {
|
155
|
-
var tiddlers =
|
155
|
+
var tiddlers = $tw.utils.parseJSONSafe(event.data.body);
|
156
156
|
$tw.utils.each(tiddlers,function(tiddler) {
|
157
157
|
$tw.wiki.addTiddler(new $tw.Tiddler($tw.wiki.getCreationFields(),tiddler,{
|
158
158
|
title: event.data.cookies.infoTitlePrefix + event.data.cookies.url + "/" + tiddler.title,
|
@@ -170,7 +170,7 @@ exports.startup = function() {
|
|
170
170
|
},$tw.wiki.getModificationFields()));
|
171
171
|
});
|
172
172
|
} else if(event.data.cookies.type === "save-tiddler") {
|
173
|
-
var tiddler =
|
173
|
+
var tiddler = $tw.utils.parseJSONSafe(event.data.body);
|
174
174
|
$tw.wiki.addTiddler(new $tw.Tiddler(tiddler));
|
175
175
|
}
|
176
176
|
}
|
@@ -42,12 +42,17 @@ exports.startup = function() {
|
|
42
42
|
$tw.styleWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_STYLESHEET_TITLE,{document: $tw.fakeDocument});
|
43
43
|
$tw.styleContainer = $tw.fakeDocument.createElement("style");
|
44
44
|
$tw.styleWidgetNode.render($tw.styleContainer,null);
|
45
|
+
$tw.styleWidgetNode.assignedStyles = $tw.styleContainer.textContent;
|
45
46
|
$tw.styleElement = document.createElement("style");
|
46
|
-
$tw.styleElement.innerHTML = $tw.
|
47
|
+
$tw.styleElement.innerHTML = $tw.styleWidgetNode.assignedStyles;
|
47
48
|
document.head.insertBefore($tw.styleElement,document.head.firstChild);
|
48
49
|
$tw.wiki.addEventListener("change",$tw.perf.report("styleRefresh",function(changes) {
|
49
50
|
if($tw.styleWidgetNode.refresh(changes,$tw.styleContainer,null)) {
|
50
|
-
|
51
|
+
var newStyles = $tw.styleContainer.textContent;
|
52
|
+
if(newStyles !== $tw.styleWidgetNode.assignedStyles) {
|
53
|
+
$tw.styleWidgetNode.assignedStyles = newStyles;
|
54
|
+
$tw.styleElement.innerHTML = $tw.styleWidgetNode.assignedStyles;
|
55
|
+
}
|
51
56
|
}
|
52
57
|
}));
|
53
58
|
// Display the $:/core/ui/PageTemplate tiddler to kick off the display
|
@@ -51,6 +51,20 @@ exports.startup = function() {
|
|
51
51
|
element.focus(event.paramObject);
|
52
52
|
}
|
53
53
|
});
|
54
|
+
// Install the tm-rename-tiddler and tm-relink-tiddler messages
|
55
|
+
var makeRenameHandler = function(method) {
|
56
|
+
return function(event) {
|
57
|
+
var options = {},
|
58
|
+
paramObject = event.paramObject || {},
|
59
|
+
from = paramObject.from || event.tiddlerTitle,
|
60
|
+
to = paramObject.to;
|
61
|
+
options.dontRenameInTags = (paramObject.renameInTags === "false" || paramObject.renameInTags === "no") ? true : false;
|
62
|
+
options.dontRenameInLists = (paramObject.renameInLists === "false" || paramObject.renameInLists === "no") ? true : false;
|
63
|
+
$tw.wiki[method](from,to,options);
|
64
|
+
};
|
65
|
+
};
|
66
|
+
$tw.rootWidget.addEventListener("tm-rename-tiddler",makeRenameHandler("renameTiddler"));
|
67
|
+
$tw.rootWidget.addEventListener("tm-relink-tiddler",makeRenameHandler("relinkTiddler"));
|
54
68
|
// Install the scroller
|
55
69
|
$tw.pageScroller = new $tw.utils.PageScroller();
|
56
70
|
$tw.rootWidget.addEventListener("tm-scroll",function(event) {
|
@@ -20,6 +20,8 @@ exports.synchronous = true;
|
|
20
20
|
|
21
21
|
// Global to keep track of open windows (hashmap by title)
|
22
22
|
$tw.windows = {};
|
23
|
+
// Default template to use for new windows
|
24
|
+
var DEFAULT_WINDOW_TEMPLATE = "$:/core/templates/single.tiddler.window";
|
23
25
|
|
24
26
|
exports.startup = function() {
|
25
27
|
// Handle open window message
|
@@ -29,22 +31,25 @@ exports.startup = function() {
|
|
29
31
|
title = event.param || event.tiddlerTitle,
|
30
32
|
paramObject = event.paramObject || {},
|
31
33
|
windowTitle = paramObject.windowTitle || title,
|
32
|
-
|
34
|
+
windowID = paramObject.windowID || title,
|
35
|
+
template = paramObject.template || DEFAULT_WINDOW_TEMPLATE,
|
33
36
|
width = paramObject.width || "700",
|
34
37
|
height = paramObject.height || "600",
|
35
|
-
|
38
|
+
top = paramObject.top,
|
39
|
+
left = paramObject.left,
|
40
|
+
variables = $tw.utils.extend({},paramObject,{currentTiddler: title, "tv-window-id": windowID});
|
36
41
|
// Open the window
|
37
42
|
var srcWindow,
|
38
43
|
srcDocument;
|
39
44
|
// In case that popup blockers deny opening a new window
|
40
45
|
try {
|
41
|
-
srcWindow = window.open("","external-" +
|
46
|
+
srcWindow = window.open("","external-" + windowID,"scrollbars,width=" + width + ",height=" + height + (top ? ",top=" + top : "" ) + (left ? ",left=" + left : "" )),
|
42
47
|
srcDocument = srcWindow.document;
|
43
48
|
}
|
44
49
|
catch(e) {
|
45
50
|
return;
|
46
51
|
}
|
47
|
-
$tw.windows[
|
52
|
+
$tw.windows[windowID] = srcWindow;
|
48
53
|
// Check for reopening the same window
|
49
54
|
if(srcWindow.haveInitialisedWindow) {
|
50
55
|
return;
|
@@ -54,7 +59,7 @@ exports.startup = function() {
|
|
54
59
|
srcDocument.close();
|
55
60
|
srcDocument.title = windowTitle;
|
56
61
|
srcWindow.addEventListener("beforeunload",function(event) {
|
57
|
-
delete $tw.windows[
|
62
|
+
delete $tw.windows[windowID];
|
58
63
|
$tw.wiki.removeEventListener("change",refreshHandler);
|
59
64
|
},false);
|
60
65
|
// Set up the styles
|
@@ -88,13 +93,21 @@ exports.startup = function() {
|
|
88
93
|
srcWindow.document.documentElement.addEventListener("click",$tw.popup,true);
|
89
94
|
srcWindow.haveInitialisedWindow = true;
|
90
95
|
});
|
91
|
-
|
92
|
-
|
96
|
+
$tw.rootWidget.addEventListener("tm-close-window",function(event) {
|
97
|
+
var windowID = event.param,
|
98
|
+
win = $tw.windows[windowID];
|
99
|
+
if(win) {
|
100
|
+
win.close();
|
101
|
+
}
|
102
|
+
});
|
103
|
+
var closeAllWindows = function() {
|
93
104
|
$tw.utils.each($tw.windows,function(win) {
|
94
105
|
win.close();
|
95
106
|
});
|
96
|
-
}
|
97
|
-
|
107
|
+
}
|
108
|
+
$tw.rootWidget.addEventListener("tm-close-all-windows",closeAllWindows);
|
109
|
+
// Close open windows when unloading main window
|
110
|
+
$tw.addUnloadTask(closeAllWindows);
|
98
111
|
};
|
99
112
|
|
100
113
|
})();
|
package/core/modules/tiddler.js
CHANGED
@@ -24,13 +24,13 @@ exports.isDraft = function() {
|
|
24
24
|
return this.hasField("draft.of");
|
25
25
|
};
|
26
26
|
|
27
|
-
exports.getFieldString = function(field) {
|
27
|
+
exports.getFieldString = function(field,defaultValue) {
|
28
28
|
var value = this.fields[field];
|
29
29
|
// Check for a missing field
|
30
30
|
if(value === undefined || value === null) {
|
31
|
-
return "";
|
31
|
+
return defaultValue || "";
|
32
32
|
}
|
33
|
-
//
|
33
|
+
// Stringify the field with the associated tiddler field module (if any)
|
34
34
|
var fieldModule = $tw.Tiddler.fieldModules[field];
|
35
35
|
if(fieldModule && fieldModule.stringify) {
|
36
36
|
return fieldModule.stringify.call(this,value);
|
@@ -41,7 +41,7 @@ exports.upgrade = function(wiki,titles,tiddlers) {
|
|
41
41
|
// Check if we're dealing with a plugin
|
42
42
|
if(incomingTiddler && incomingTiddler["plugin-type"]) {
|
43
43
|
// Check whether the plugin contains JS modules
|
44
|
-
var requiresReload = wiki.doesPluginInfoRequireReload(
|
44
|
+
var requiresReload = wiki.doesPluginInfoRequireReload($tw.utils.parseJSONSafe(incomingTiddler.text)) ? (wiki.getTiddlerText("$:/language/ControlPanel/Plugins/PluginWillRequireReload") + " ") : "";
|
45
45
|
messages[title] = requiresReload;
|
46
46
|
if(incomingTiddler.version) {
|
47
47
|
// Upgrade the incoming plugin if it is in the upgrade library
|
@@ -21,7 +21,7 @@ exports.extractEncryptedStoreArea = function(text) {
|
|
21
21
|
if(encryptedStoreAreaStart !== -1) {
|
22
22
|
var encryptedStoreAreaEnd = text.indexOf("</pre>",encryptedStoreAreaStart);
|
23
23
|
if(encryptedStoreAreaEnd !== -1) {
|
24
|
-
return $tw.utils.htmlDecode(text.substring(encryptedStoreAreaStart + encryptedStoreAreaStartMarker.length,encryptedStoreAreaEnd
|
24
|
+
return $tw.utils.htmlDecode(text.substring(encryptedStoreAreaStart + encryptedStoreAreaStartMarker.length,encryptedStoreAreaEnd));
|
25
25
|
}
|
26
26
|
}
|
27
27
|
return null;
|
@@ -33,7 +33,7 @@ Attempt to extract the tiddlers from an encrypted store area using the current p
|
|
33
33
|
exports.decryptStoreArea = function(encryptedStoreArea,password) {
|
34
34
|
var decryptedText = $tw.crypto.decrypt(encryptedStoreArea,password);
|
35
35
|
if(decryptedText) {
|
36
|
-
var json =
|
36
|
+
var json = $tw.utils.parseJSONSafe(decryptedText),
|
37
37
|
tiddlers = [];
|
38
38
|
for(var title in json) {
|
39
39
|
if(title !== "$:/isEncrypted") {
|
@@ -16,21 +16,23 @@ Browser data transfer utilities, used with the clipboard and drag and drop
|
|
16
16
|
Options:
|
17
17
|
|
18
18
|
domNode: dom node to make draggable
|
19
|
+
selector: CSS selector to identify element within domNode to be used as drag handle (optional)
|
19
20
|
dragImageType: "pill", "blank" or "dom" (the default)
|
20
21
|
dragTiddlerFn: optional function to retrieve the title of tiddler to drag
|
21
22
|
dragFilterFn: optional function to retreive the filter defining a list of tiddlers to drag
|
22
|
-
widget: widget to use as the
|
23
|
+
widget: widget to use as the context for the filter
|
23
24
|
*/
|
24
25
|
exports.makeDraggable = function(options) {
|
25
26
|
var dragImageType = options.dragImageType || "dom",
|
26
27
|
dragImage,
|
27
|
-
domNode = options.domNode
|
28
|
+
domNode = options.domNode,
|
29
|
+
dragHandle = options.selector && domNode.querySelector(options.selector) || domNode;
|
28
30
|
// Make the dom node draggable (not necessary for anchor tags)
|
29
31
|
if((domNode.tagName || "").toLowerCase() !== "a") {
|
30
|
-
|
32
|
+
dragHandle.setAttribute("draggable","true");
|
31
33
|
}
|
32
34
|
// Add event handlers
|
33
|
-
$tw.utils.addEventListeners(
|
35
|
+
$tw.utils.addEventListeners(dragHandle,[
|
34
36
|
{name: "dragstart", handlerFunction: function(event) {
|
35
37
|
if(event.dataTransfer === undefined) {
|
36
38
|
return false;
|
@@ -45,7 +47,7 @@ exports.makeDraggable = function(options) {
|
|
45
47
|
}
|
46
48
|
var titleString = $tw.utils.stringifyList(titles);
|
47
49
|
// Check that we've something to drag
|
48
|
-
if(titles.length > 0 && event.target ===
|
50
|
+
if(titles.length > 0 && event.target === dragHandle) {
|
49
51
|
// Mark the drag in progress
|
50
52
|
$tw.dragInProgress = domNode;
|
51
53
|
// Set the dragging class on the element being dragged
|
@@ -198,7 +200,7 @@ var importDataTypes = [
|
|
198
200
|
];
|
199
201
|
|
200
202
|
function parseJSONTiddlers(json,fallbackTitle) {
|
201
|
-
var data =
|
203
|
+
var data = $tw.utils.parseJSONSafe(json);
|
202
204
|
if(!$tw.utils.isArray(data)) {
|
203
205
|
data = [data];
|
204
206
|
}
|