tiddlywiki 5.2.3 → 5.2.4
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/bin/build-site.sh +11 -2
- package/bin/test.sh +1 -0
- package/boot/boot.js +9 -6
- package/core/images/layout-button.tid +4 -0
- package/core/images/mastodon.tid +6 -0
- package/core/language/en-GB/Buttons.multids +4 -0
- package/core/language/en-GB/ControlPanel.multids +3 -3
- package/core/language/en-GB/Fields.multids +2 -2
- package/core/language/en-GB/GettingStarted.tid +4 -3
- package/core/language/en-GB/Help/commands.tid +18 -0
- package/core/language/en-GB/Misc.multids +1 -0
- package/core/modules/commands/commands.js +42 -0
- package/core/modules/editor/engines/framed.js +12 -1
- package/core/modules/editor/factory.js +2 -2
- package/core/modules/filters/format/json.js +35 -0
- package/core/modules/filters/is/variable.js +2 -2
- package/core/modules/filters/json-ops.js +186 -0
- package/core/modules/filters/variables.js +9 -3
- package/core/modules/filters.js +15 -6
- package/core/modules/keyboard.js +13 -1
- package/core/modules/parsers/csvparser.js +25 -17
- package/core/modules/parsers/wikiparser/rules/macrodef.js +1 -1
- package/core/modules/parsers/wikiparser/rules/parsermode.js +68 -0
- package/core/modules/parsers/wikiparser/rules/styleinline.js +3 -3
- package/core/modules/parsers/wikiparser/wikiparser.js +4 -2
- package/core/modules/server/routes/put-tiddler.js +10 -0
- package/core/modules/startup/startup.js +5 -1
- package/core/modules/utils/csv.js +101 -23
- package/core/modules/utils/dom/dom.js +17 -2
- package/core/modules/utils/dom/modal.js +6 -0
- package/core/modules/utils/dom/popup.js +69 -6
- package/core/modules/utils/fakedom.js +2 -2
- package/core/modules/utils/linked-list.js +79 -75
- package/core/modules/utils/logger.js +3 -1
- package/core/modules/utils/parsetree.js +20 -10
- package/core/modules/utils/utils.js +3 -0
- package/core/modules/widgets/action-deletefield.js +2 -2
- package/core/modules/widgets/action-popup.js +10 -8
- package/core/modules/widgets/button.js +7 -2
- package/core/modules/widgets/checkbox.js +12 -5
- package/core/modules/widgets/error.js +63 -0
- package/core/modules/widgets/genesis.js +108 -0
- package/core/modules/widgets/importvariables.js +4 -1
- package/core/modules/widgets/keyboard.js +4 -0
- package/core/modules/widgets/let.js +3 -5
- package/core/modules/widgets/reveal.js +11 -10
- package/core/modules/widgets/select.js +9 -0
- package/core/modules/widgets/transclude.js +3 -5
- package/core/modules/widgets/widget.js +44 -18
- package/core/palettes/Blanca.tid +2 -0
- package/core/palettes/Blue.tid +2 -0
- package/core/palettes/BrightMute.tid +2 -0
- package/core/palettes/ContrastDark.tid +2 -0
- package/core/palettes/ContrastLight.tid +2 -0
- package/core/palettes/CupertinoDark.tid +2 -0
- package/core/palettes/DarkPhotos.tid +2 -0
- package/core/palettes/DesertSand.tid +2 -0
- package/core/palettes/GruvBoxDark.tid +2 -0
- package/core/palettes/Nord.tid +2 -0
- package/core/palettes/Rocker.tid +2 -0
- package/core/palettes/SolarFlare.tid +2 -0
- package/core/palettes/SolarizedDark.tid +2 -0
- package/core/palettes/SolarizedLight.tid +2 -0
- package/core/palettes/SpartanDay.tid +2 -0
- package/core/palettes/SpartanNight.tid +2 -0
- package/core/palettes/Twilight.tid +2 -0
- package/core/palettes/Vanilla.tid +2 -0
- package/core/templates/external-js/save-all-external-js.tid +4 -2
- package/core/templates/external-js/save-offline-external-js.tid +4 -2
- package/core/templates/single.tiddler.window.tid +1 -1
- package/core/ui/Actions/new-image.tid +1 -7
- package/core/ui/AdvancedSearch/FilterButtons/delete.tid +3 -3
- package/core/ui/AdvancedSearch/FilterButtons/dropdown.tid +2 -2
- package/core/ui/ControlPanel/Basics/retain-story-ordering-button.tid +3 -0
- package/core/ui/ControlPanel/Basics.tid +3 -2
- package/core/ui/EditTemplate/Preview/output.tid +1 -1
- package/core/ui/EditTemplate/body/default.tid +1 -1
- package/core/ui/EditTemplate/fields.tid +12 -2
- package/core/ui/EditTemplate.tid +7 -2
- package/core/ui/ImportListing.tid +5 -5
- package/core/ui/KeyboardShortcuts/advanced-search.tid +1 -1
- package/core/ui/PageControls/layout.tid +15 -0
- package/core/ui/PageTemplate.tid +1 -4
- package/core/ui/SideBar/More.tid +2 -2
- package/core/ui/SwitcherModal.tid +1 -0
- package/core/ui/TagManager.tid +75 -63
- package/core/ui/ViewTemplate/unfold.tid +6 -2
- package/core/ui/ViewTemplate.tid +1 -1
- package/core/wiki/config/DefaultTiddlersRetainStory.tid +3 -0
- package/core/wiki/config/OfficialPluginLibrary.tid +1 -1
- package/core/wiki/config/PageControlButtons.multids +1 -0
- package/core/wiki/macros/list.tid +7 -7
- package/core/wiki/macros/timeline.tid +6 -9
- package/core/wiki/macros/toc.tid +12 -8
- package/core/wiki/tags/PageControls.tid +1 -1
- package/editions/de-AT/tiddlywiki.info +0 -1
- package/editions/de-AT-server/tiddlywiki.info +0 -1
- package/editions/de-DE/tiddlywiki.info +0 -1
- package/editions/dev/tiddlers/HelloThere.tid +2 -1
- package/editions/dev/tiddlers/How to run a local plugin library for testing.tid +42 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Child widgets tutorial.tid +140 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Do nothing widget demo.tid +22 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Do nothing widget tutorial.tid +25 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Hello World demo.tid +23 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Hello World widget tutorial.tid +18 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Javascript Widget Tutorial.tid +37 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Undefined widget demo.tid +18 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Undefined widget tutorial.tid +11 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Widget attributes demo I.tid +48 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Widget attributes demo II.tid +48 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Widget attributes tutorial part I.tid +50 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Widget attributes tutorial part II.tid +33 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh demo I.tid +44 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh demo II.tid +40 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh demo III.tid +50 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh tutorial part I.tid +47 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh tutorial part II.tid +37 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh tutorial part III.tid +26 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/domwidget.js +47 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/domwidget.js.meta +6 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/donothing.js +16 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/donothing.js.meta +6 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/hello-attribute-optimized.js +51 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/hello-attribute-optimized.js.meta +6 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/hello-attribute.js +47 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/hello-attribute.js.meta +6 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/hello.js +35 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/hello.js.meta +6 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/refreshcount.js +43 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/refreshcount.js.meta +6 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/tiddlerfield-norefresh.js +36 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/tiddlerfield-norefresh.js.meta +6 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/tiddlerfield.js +46 -0
- package/editions/dev/tiddlers/javascript-widget-tutorial/tiddlerfield.js.meta +6 -0
- package/editions/dev/tiddlywiki.info +2 -1
- package/editions/fr-FR/tiddlers/$__editions_tw5.com_doc-macros.tid +1 -1
- package/editions/fr-FR/tiddlers/system/$__core_macros_list.tid +113 -0
- package/editions/fr-FR/tiddlers/system/$__core_macros_tag.tid +39 -0
- package/editions/fr-FR/tiddlers/system/$__core_ui_TagPickerTagTemplate.tid +25 -0
- package/editions/full/tiddlywiki.info +0 -1
- package/editions/introduction/tiddlywiki.info +0 -1
- package/editions/pluginlibrary/tiddlers/GettingStarted.tid +45 -0
- package/editions/pluginlibrary/tiddlers/PrereleaseLocalPluginLibrary.tid +6 -0
- package/editions/pluginlibrary/tiddlers/meta/SiteSubtitle.tid +3 -0
- package/editions/pluginlibrary/tiddlers/meta/SiteTitle.tid +3 -0
- package/editions/pluginlibrary/tiddlers/system/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid +3 -0
- package/editions/pluginlibrary/tiddlywiki.info +7 -0
- package/editions/prerelease/tiddlers/{Release 5.2.4.tid → Release 5.2.5.tid } +8 -17
- package/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid +1 -1
- package/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid +5 -1
- package/editions/test/tiddlers/tests/data/csv-cases.tid +282 -0
- package/editions/test/tiddlers/tests/data/filters/Recursion.tid +15 -0
- package/editions/test/tiddlers/tests/data/filters/fake-variables.tid +27 -0
- package/editions/test/tiddlers/tests/data/genesis-widget/DollarSigns.tid +14 -0
- package/editions/test/tiddlers/tests/data/genesis-widget/MultipleAttributes.tid +14 -0
- package/editions/test/tiddlers/tests/data/genesis-widget/Simple.tid +14 -0
- package/editions/test/tiddlers/tests/data/macros/NestedMacros.tid +36 -0
- package/editions/test/tiddlers/tests/data/pragmas/Parsermode.tid +36 -0
- package/editions/test/tiddlers/tests/data/transclude/Recursion.tid +13 -0
- package/editions/test/tiddlers/tests/modules/utils/test-csv.js +33 -0
- package/editions/test/tiddlers/tests/test-checkbox-widget.js +35 -1
- package/editions/test/tiddlers/tests/test-json-filters.js +112 -0
- package/editions/test/tiddlers/tests/test-linked-list.js +42 -2
- package/editions/test/tiddlers/tests/test-popup.js +63 -0
- package/editions/test/tiddlers/tests/test-utils.js +1 -0
- package/editions/test/tiddlers/tests/test-wikitext.js +16 -0
- package/editions/test/tiddlywiki.info +2 -1
- package/editions/translators/tiddlers/system/PageControlButtonsVisibility.multids +1 -0
- package/editions/translators/tiddlywiki.info +0 -1
- package/editions/tw.org/tiddlers/Code of Conduct.tid +4 -1
- package/editions/tw.org/tiddlers/Fundraising.tid +2 -2
- package/editions/tw5.com/tiddlers/Tables in WikiText CSS Utility Classes.tid +81 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/markplace.png +0 -0
- package/editions/tw5.com/tiddlers/_tw_shared/favicons/markplace.png.meta +3 -0
- package/editions/tw5.com/tiddlers/_tw_shared/sites/marketplace.tid +6 -0
- package/editions/tw5.com/tiddlers/_tw_shared/tags-TiddlyWikiSites.tid +1 -1
- package/editions/tw5.com/tiddlers/about/Funding TiddlyWiki.tid +19 -0
- package/editions/tw5.com/tiddlers/about/Open Collective.tid +14 -0
- package/editions/tw5.com/tiddlers/commands/CommandsCommand.tid +8 -0
- package/editions/tw5.com/tiddlers/commands/RenderTiddlerCommand.tid +2 -0
- package/editions/tw5.com/tiddlers/commands/RenderTiddlersCommand.tid +2 -0
- package/editions/tw5.com/tiddlers/commands/SaveTiddlerCommand.tid +2 -0
- package/editions/tw5.com/tiddlers/commands/SaveTiddlersCommand.tid +2 -0
- package/editions/tw5.com/tiddlers/community/plugins/GSD5.tid +2 -2
- package/editions/tw5.com/tiddlers/community/plugins/_JD Mobile Layout plugin_ by JD.tid +0 -1
- package/editions/tw5.com/tiddlers/community/resources/_Dropboard_ by Reid Gould.tid +0 -1
- package/editions/tw5.com/tiddlers/community/resources/_Hacks_ by Thomas Elmiger.tid +0 -2
- package/editions/tw5.com/tiddlers/community/resources/_MathCell_ by Ste Wilson.tid +0 -1
- package/editions/tw5.com/tiddlers/community/resources/_TiddlyServer_ by Matt Lauber.tid +0 -1
- package/editions/tw5.com/tiddlers/community/resources/_X3DOM for TiddlyWiki 5_ by Jamal Wills.tid +0 -1
- package/editions/tw5.com/tiddlers/concepts/CoordinateSystems.tid +42 -0
- package/editions/tw5.com/tiddlers/concepts/KeyboardShortcutTiddler.tid +2 -0
- package/editions/tw5.com/tiddlers/definitions/Federatial.tid +13 -1
- package/editions/tw5.com/tiddlers/definitions/HTML Block Elements.tid +9 -0
- package/editions/tw5.com/tiddlers/definitions/TiddlyWikiClassic.tid +3 -1
- package/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Selective Expandable Example custom icons.tid +16 -0
- package/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggable.tid +1 -1
- package/editions/tw5.com/tiddlers/features/DateFormat.tid +27 -3
- package/editions/tw5.com/tiddlers/features/JSON in TiddlyWiki.tid +1 -1
- package/editions/tw5.com/tiddlers/features/Modals.tid +3 -0
- package/editions/tw5.com/tiddlers/filters/examples/format Operator (Examples).tid +5 -2
- package/editions/tw5.com/tiddlers/filters/format.tid +5 -4
- package/editions/tw5.com/tiddlers/filters/jsonextract.tid +66 -0
- package/editions/tw5.com/tiddlers/filters/jsonget.tid +93 -0
- package/editions/tw5.com/tiddlers/filters/jsonindexes.tid +65 -0
- package/editions/tw5.com/tiddlers/filters/jsontype.tid +74 -0
- package/editions/tw5.com/tiddlers/gettingstarted/GettingStarted.tid +3 -7
- package/editions/tw5.com/tiddlers/hellothere/HelloThere.tid +23 -22
- package/editions/tw5.com/tiddlers/hellothere/HelloThumbnail.tid +1 -1
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Funding.tid +10 -0
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Grok TiddlyWiki.tid +2 -0
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Introduction Video.tid +2 -0
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Latest Version.tid +9 -1
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Marketplace.tid +10 -0
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - TiddlyWikiLinks.tid +3 -1
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail_-_Federatial.tid +11 -0
- package/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Default Story Ordering.tid +4 -0
- package/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Sync System Tiddlers From Server.tid +13 -0
- package/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting SyncLogging.tid +13 -0
- package/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting_ More Tabs Horizontal.tid +7 -0
- package/editions/tw5.com/tiddlers/howtos/How to create keyboard shortcuts.tid +2 -0
- package/editions/tw5.com/tiddlers/howtos/Reading data from JSON tiddlers.tid +10 -1
- package/editions/tw5.com/tiddlers/images/Federatial.png +0 -0
- package/editions/tw5.com/tiddlers/images/Federatial.png.meta +3 -0
- package/editions/tw5.com/tiddlers/images/Funding.png +0 -0
- package/editions/tw5.com/tiddlers/images/{TiddlyMap.png.meta → Funding.png.meta} +1 -1
- package/editions/tw5.com/tiddlers/images/Marketplace Banner.png +0 -0
- package/editions/tw5.com/tiddlers/images/Marketplace Banner.png.meta +3 -0
- package/editions/tw5.com/tiddlers/images/New Release Banner.png +0 -0
- package/editions/tw5.com/tiddlers/macros/ListMacro.tid +3 -1
- package/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid +36 -2
- package/editions/tw5.com/tiddlers/marketplace/TiddlyWiki Marketplace.tid +18 -0
- package/editions/tw5.com/tiddlers/mechanisms/PopupMechanism.tid +1 -0
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-modal.tid +4 -2
- package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-new-tiddler.tid +1 -1
- package/editions/tw5.com/tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid +2 -2
- package/editions/tw5.com/tiddlers/pragmas/Pragma_ _parsermode.tid +17 -0
- package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.4.tid +140 -0
- package/editions/tw5.com/tiddlers/releasenotes/Releases.tid +1 -1
- package/editions/tw5.com/tiddlers/saving/Emergency Tiddler Export.tid +1 -1
- package/editions/tw5.com/tiddlers/saving/Saving on TiddlyHost.tid +1 -1
- package/editions/tw5.com/tiddlers/saving/Saving on TiddlySpot.tid +0 -1
- package/editions/tw5.com/tiddlers/saving/Saving with Polly.tid +1 -0
- package/editions/tw5.com/tiddlers/saving/Saving.tid +12 -5
- package/editions/tw5.com/tiddlers/saving/TiddlyBucket - Save to AWS or Google Storage.tid +15 -0
- package/editions/tw5.com/tiddlers/system/doc-macros.tid +1 -1
- package/editions/tw5.com/tiddlers/system/tw5.com-card-template.tid +1 -16
- package/editions/tw5.com/tiddlers/system/tw5.com-styles.tid +168 -40
- package/editions/tw5.com/tiddlers/system/version-macros.tid +3 -4
- package/editions/tw5.com/tiddlers/system/wikitext-macros.tid +43 -15
- package/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_ClassFilters_PageTemplate.tid +9 -0
- package/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_ClassFilters_TiddlerTemplate.tid +9 -0
- package/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_Filter.tid +2 -2
- package/editions/tw5.com/tiddlers/testimonials/Testimonials - Joe Armstrong.tid +8 -0
- package/editions/tw5.com/tiddlers/testimonials/Testimonials - Network World.tid +8 -0
- package/editions/tw5.com/tiddlers/testimonials/Testimonials - Product Hunt.tid +6 -0
- package/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid +10 -10
- package/editions/tw5.com/tiddlers/webserver/WebServer API_ Get All Tiddlers.tid +3 -1
- package/editions/tw5.com/tiddlers/widgets/ActionPopupWidget.tid +4 -3
- package/editions/tw5.com/tiddlers/widgets/ButtonWidget.tid +2 -1
- package/editions/tw5.com/tiddlers/widgets/DraggableWidget.tid +2 -1
- package/editions/tw5.com/tiddlers/widgets/ErrorWidget.tid +17 -0
- package/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid +4 -3
- package/editions/tw5.com/tiddlers/widgets/GenesisWidget.tid +41 -0
- package/editions/tw5.com/tiddlers/widgets/LetWidget.tid +4 -1
- package/editions/tw5.com/tiddlers/widgets/ScrollableWidget.tid +1 -1
- package/editions/tw5.com/tiddlers/widgets/SelectWidget.tid +1 -0
- package/editions/tw5.com/tiddlers/wikitext/Macro Definitions in WikiText.tid +27 -4
- package/editions/tw5.com/tiddlers/wikitext/Styles and Classes in WikiText.tid +1 -1
- package/editions/tw5.com/tiddlers/wikitext/Table Classes Captions Headers and Footers.tid +20 -0
- package/editions/tw5.com/tiddlers/wikitext/Tables in WikiText.tid +3 -13
- package/editions/tw5.com/tiddlers/wikitext/Utility Classes.tid +20 -0
- package/editions/tw5.com/tiddlers/wikitext/parser/WikiText Parser Modes.tid +1 -1
- package/editions/twitter-archivist/tiddlers/DefaultTiddlers.tid +4 -0
- package/editions/twitter-archivist/tiddlers/HelloThere.tid +9 -0
- package/editions/twitter-archivist/tiddlers/SiteSubtitle.tid +3 -0
- package/editions/twitter-archivist/tiddlers/SiteTitle.tid +3 -0
- package/editions/twitter-archivist/tiddlywiki.info +16 -0
- package/languages/ar-PS/ControlPanel.multids +1 -1
- package/languages/ca-ES/ControlPanel.multids +1 -1
- package/languages/cs-CZ/ControlPanel.multids +1 -1
- package/languages/da-DK/ControlPanel.multids +1 -1
- package/languages/de-DE/Buttons.multids +5 -1
- package/languages/de-DE/ControlPanel.multids +1 -1
- package/languages/de-DE/Help/commands.tid +14 -0
- package/languages/de-DE/Misc.multids +1 -0
- package/languages/el-GR/ControlPanel.multids +1 -1
- package/languages/es-ES/Buttons.multids +89 -87
- package/languages/es-ES/ControlPanel.multids +18 -1
- package/languages/es-ES/Docs/PaletteColours.multids +2 -2
- package/languages/es-ES/EditTemplate.multids +3 -0
- package/languages/es-ES/Fields.multids +4 -3
- package/languages/es-ES/GettingStarted.tid +4 -3
- package/languages/es-ES/Help/default.tid +4 -1
- package/languages/es-ES/Help/listen.tid +0 -1
- package/languages/es-ES/Help/render.tid +2 -2
- package/languages/es-ES/Import.multids +1 -1
- package/languages/es-ES/Misc.multids +2 -1
- package/languages/es-ES/SideBar.multids +1 -0
- package/languages/es-ES/Snippets/ListByTag.tid +1 -1
- package/languages/fa-IR/ControlPanel.multids +1 -1
- package/languages/fr-FR/Buttons.multids +2 -0
- package/languages/fr-FR/ControlPanel.multids +4 -4
- package/languages/fr-FR/Misc.multids +3 -2
- package/languages/hi-IN/ControlPanel.multids +1 -1
- package/languages/ia-IA/ControlPanel.multids +1 -1
- package/languages/it-IT/ControlPanel.multids +1 -1
- package/languages/ja-JP/ControlPanel.multids +9 -9
- package/languages/ko-KR/ControlPanel.multids +1 -1
- package/languages/nl-NL/ControlPanel.multids +1 -1
- package/languages/pl-PL/Buttons.multids +7 -3
- package/languages/pl-PL/ControlPanel.multids +26 -24
- package/languages/pl-PL/GettingStarted.tid +4 -3
- package/languages/pl-PL/Help/commands.tid +18 -0
- package/languages/pl-PL/Help/render.tid +2 -2
- package/languages/pl-PL/Misc.multids +1 -0
- package/languages/pl-PL/ThemeTweaks.multids +3 -3
- package/languages/pt-BR/ControlPanel.multids +1 -1
- package/languages/pt-PT/ControlPanel.multids +1 -1
- package/languages/ru-RU/ControlPanel.multids +1 -1
- package/languages/sk-SK/ControlPanel.multids +1 -1
- package/languages/sl-SI/ControlPanel.multids +1 -1
- package/languages/sv-SE/ControlPanel.multids +1 -1
- package/languages/zh-Hans/Buttons.multids +36 -32
- package/languages/zh-Hans/ControlPanel.multids +19 -19
- package/languages/zh-Hans/CoreReadMe.tid +1 -1
- package/languages/zh-Hans/Docs/ModuleTypes.multids +2 -2
- package/languages/zh-Hans/Docs/PaletteColours.multids +8 -8
- package/languages/zh-Hans/Fields.multids +7 -7
- package/languages/zh-Hans/Filters.multids +1 -1
- package/languages/zh-Hans/GettingStarted.tid +8 -6
- package/languages/zh-Hans/Help/commands.tid +18 -0
- package/languages/zh-Hans/Help/fetch.tid +6 -6
- package/languages/zh-Hans/Help/init.tid +1 -1
- package/languages/zh-Hans/Help/listen.tid +5 -5
- package/languages/zh-Hans/Help/makelibrary.tid +1 -1
- package/languages/zh-Hans/Help/savetiddlers.tid +1 -1
- package/languages/zh-Hans/Help/server.tid +6 -6
- package/languages/zh-Hans/Help/setfield.tid +3 -3
- package/languages/zh-Hans/Import.multids +1 -1
- package/languages/zh-Hans/Misc.multids +12 -11
- package/languages/zh-Hans/Search.multids +6 -6
- package/languages/zh-Hans/SiteSubtitle.tid +1 -1
- package/languages/zh-Hans/Snippets/ListByTag.tid +1 -1
- package/languages/zh-Hans/ThemeTweaks.multids +7 -7
- package/languages/zh-Hans/TiddlerInfo.multids +2 -2
- package/languages/zh-Hant/Buttons.multids +4 -0
- package/languages/zh-Hant/ControlPanel.multids +2 -2
- package/languages/zh-Hant/Fields.multids +2 -2
- package/languages/zh-Hant/GettingStarted.tid +4 -3
- package/languages/zh-Hant/Help/commands.tid +18 -0
- package/languages/zh-Hant/Misc.multids +1 -0
- package/licenses/cla-individual.md +4 -0
- package/package.json +1 -1
- package/plugins/tiddlywiki/codemirror/engine.js +4 -0
- package/plugins/tiddlywiki/dynannotate/docs/readme.tid +2 -2
- package/plugins/tiddlywiki/dynannotate/modules/dynannotate.js +4 -2
- package/plugins/tiddlywiki/help/tabs/Support.tid +6 -2
- package/plugins/tiddlywiki/jasmine/command.js +33 -0
- package/plugins/tiddlywiki/jasmine/help.tid +24 -0
- package/plugins/tiddlywiki/jasmine/jasmine-plugin.js +24 -18
- package/plugins/tiddlywiki/jasmine/readme.tid +31 -1
- package/plugins/tiddlywiki/jasmine/run-wiki-based-tests.js +93 -0
- package/plugins/tiddlywiki/jasmine/startup.js +37 -0
- package/plugins/tiddlywiki/translators/macros/translatableStringEditor.tid +6 -0
- package/plugins/tiddlywiki/translators/system/styles.tid +5 -0
- package/plugins/tiddlywiki/twitter-archivist/Twitter Archives.tid +5 -0
- package/plugins/tiddlywiki/twitter-archivist/archivist.js +319 -0
- package/plugins/tiddlywiki/twitter-archivist/configTiddlerInfoMode.tid +2 -0
- package/plugins/tiddlywiki/twitter-archivist/loadtwitterarchive.js +53 -0
- package/plugins/tiddlywiki/twitter-archivist/macros.tid +222 -0
- package/plugins/tiddlywiki/twitter-archivist/plugin.info +6 -0
- package/plugins/tiddlywiki/twitter-archivist/readme.tid +33 -0
- package/plugins/tiddlywiki/twitter-archivist/spec.tid +62 -0
- package/plugins/tiddlywiki/twitter-archivist/startup.js +38 -0
- package/plugins/tiddlywiki/twitter-archivist/styles.tid +47 -0
- package/plugins/tiddlywiki/twitter-archivist/template-archive.tid +3 -0
- package/plugins/tiddlywiki/twitter-archivist/template-hashtag.tid +3 -0
- package/plugins/tiddlywiki/twitter-archivist/template-tweet.tid +3 -0
- package/plugins/tiddlywiki/twitter-archivist/template-tweeter.tid +3 -0
- package/plugins/tiddlywiki/twitter-archivist/todo.tid +15 -0
- package/plugins/tiddlywiki/twitter-archivist/usage.tid +18 -0
- package/plugins/tiddlywiki/twitter-archivist/view-template-body-cascade.tid +8 -0
- package/plugins/tiddlywiki/upgrade/UpgradeWizard.tid +3 -3
- package/readme.md +1 -1
- package/themes/tiddlywiki/vanilla/base.tid +131 -10
- package/editions/fr-FR/tiddlers/$__core_ui_TagTemplate.tid +0 -33
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Classic.tid +0 -6
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Developers.tid +0 -7
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Gentle Guide.tid +0 -11
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - HelpingTiddlyWiki.tid +0 -7
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - TWEUM2017.tid +0 -8
- package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - TiddlyMap.tid +0 -6
- package/editions/tw5.com/tiddlers/images/Dev Thumbnail.jpg +0 -0
- package/editions/tw5.com/tiddlers/images/Dev Thumbnail.jpg.meta +0 -3
- package/editions/tw5.com/tiddlers/images/TiddlyMap.png +0 -0
@@ -13,6 +13,11 @@ The CSV text parser processes CSV files into a table wrapped in a scrollable wid
|
|
13
13
|
"use strict";
|
14
14
|
|
15
15
|
var CsvParser = function(type,text,options) {
|
16
|
+
// Special handler for tab-delimited files
|
17
|
+
if (type === 'text/tab-delimited-values' && !options.separator) {
|
18
|
+
options.separator = "\t";
|
19
|
+
}
|
20
|
+
|
16
21
|
// Table framework
|
17
22
|
this.tree = [{
|
18
23
|
"type": "scrollable", "children": [{
|
@@ -24,30 +29,33 @@ var CsvParser = function(type,text,options) {
|
|
24
29
|
}]
|
25
30
|
}];
|
26
31
|
// Split the text into lines
|
27
|
-
var lines =
|
32
|
+
var lines = $tw.utils.parseCsvString(text, options),
|
28
33
|
tag = "th";
|
34
|
+
var maxColumns = 0;
|
35
|
+
$tw.utils.each(lines, function(columns) {
|
36
|
+
maxColumns = Math.max(columns.length, maxColumns);
|
37
|
+
});
|
38
|
+
|
29
39
|
for(var line=0; line<lines.length; line++) {
|
30
|
-
var
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}]
|
42
|
-
});
|
43
|
-
}
|
44
|
-
tag = "td";
|
45
|
-
this.tree[0].children[0].children[0].children.push(row);
|
40
|
+
var columns = lines[line];
|
41
|
+
var row = {
|
42
|
+
"type": "element", "tag": "tr", "children": []
|
43
|
+
};
|
44
|
+
for(var column=0; column<maxColumns; column++) {
|
45
|
+
row.children.push({
|
46
|
+
"type": "element", "tag": tag, "children": [{
|
47
|
+
"type": "text",
|
48
|
+
"text": columns[column] || ''
|
49
|
+
}]
|
50
|
+
});
|
46
51
|
}
|
52
|
+
tag = "td";
|
53
|
+
this.tree[0].children[0].children[0].children.push(row);
|
47
54
|
}
|
48
55
|
};
|
49
56
|
|
50
57
|
exports["text/csv"] = CsvParser;
|
58
|
+
exports["text/tab-delimited-values"] = CsvParser;
|
51
59
|
|
52
60
|
})();
|
53
61
|
|
@@ -58,7 +58,7 @@ exports.parse = function() {
|
|
58
58
|
var reEnd;
|
59
59
|
if(this.match[3]) {
|
60
60
|
// If so, the end of the body is marked with \end
|
61
|
-
reEnd =
|
61
|
+
reEnd = new RegExp("(\\r?\\n\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[1]) + ")?(?:$|\\r?\\n))","mg");
|
62
62
|
} else {
|
63
63
|
// Otherwise, the end of the definition is marked by the end of the line
|
64
64
|
reEnd = /($|\r?\n)/mg;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/*\
|
2
|
+
title: $:/core/modules/parsers/wikiparser/rules/parsermode.js
|
3
|
+
type: application/javascript
|
4
|
+
module-type: wikirule
|
5
|
+
|
6
|
+
Wiki pragma rule for parser mode specifications
|
7
|
+
|
8
|
+
```
|
9
|
+
\parsermode block
|
10
|
+
\parsermode inline
|
11
|
+
```
|
12
|
+
|
13
|
+
\*/
|
14
|
+
(function(){
|
15
|
+
|
16
|
+
/*jslint node: true, browser: true */
|
17
|
+
/*global $tw: false */
|
18
|
+
"use strict";
|
19
|
+
|
20
|
+
exports.name = "parsermode";
|
21
|
+
exports.types = {pragma: true};
|
22
|
+
|
23
|
+
/*
|
24
|
+
Instantiate parse rule
|
25
|
+
*/
|
26
|
+
exports.init = function(parser) {
|
27
|
+
this.parser = parser;
|
28
|
+
// Regexp to match
|
29
|
+
this.matchRegExp = /^\\parsermode[^\S\n]/mg;
|
30
|
+
};
|
31
|
+
|
32
|
+
/*
|
33
|
+
Parse the most recent match
|
34
|
+
*/
|
35
|
+
exports.parse = function() {
|
36
|
+
// Move past the pragma invocation
|
37
|
+
this.parser.pos = this.matchRegExp.lastIndex;
|
38
|
+
// Parse whitespace delimited tokens terminated by a line break
|
39
|
+
var reMatch = /[^\S\n]*(\S+)|(\r?\n)/mg,
|
40
|
+
parserMode = undefined;
|
41
|
+
reMatch.lastIndex = this.parser.pos;
|
42
|
+
var match = reMatch.exec(this.parser.source);
|
43
|
+
while(match && match.index === this.parser.pos) {
|
44
|
+
this.parser.pos = reMatch.lastIndex;
|
45
|
+
// Exit if we've got the line break
|
46
|
+
if(match[2]) {
|
47
|
+
break;
|
48
|
+
}
|
49
|
+
// Process the token
|
50
|
+
if(match[1]) {
|
51
|
+
parserMode = match[1];
|
52
|
+
}
|
53
|
+
// Match the next token
|
54
|
+
match = reMatch.exec(this.parser.source);
|
55
|
+
}
|
56
|
+
// Process the tokens
|
57
|
+
if(parserMode !== undefined) {
|
58
|
+
if(parserMode === "block") {
|
59
|
+
this.parser.parseAsInline = false;
|
60
|
+
} else if(parserMode === "inline") {
|
61
|
+
this.parser.parseAsInline = true;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
// No parse tree nodes to return
|
65
|
+
return [];
|
66
|
+
};
|
67
|
+
|
68
|
+
})();
|
@@ -41,9 +41,6 @@ exports.parse = function() {
|
|
41
41
|
var node = {
|
42
42
|
type: "element",
|
43
43
|
tag: "span",
|
44
|
-
attributes: {
|
45
|
-
"class": {type: "string", value: "tc-inline-style"}
|
46
|
-
},
|
47
44
|
children: tree
|
48
45
|
};
|
49
46
|
if(classString) {
|
@@ -52,6 +49,9 @@ exports.parse = function() {
|
|
52
49
|
if(stylesString) {
|
53
50
|
$tw.utils.addAttributeToParseTreeNode(node,"style",stylesString);
|
54
51
|
}
|
52
|
+
if(!classString && !stylesString) {
|
53
|
+
$tw.utils.addClassToParseTreeNode(node,"tc-inline-style");
|
54
|
+
}
|
55
55
|
return [node];
|
56
56
|
};
|
57
57
|
|
@@ -47,6 +47,8 @@ var WikiParser = function(type,text,options) {
|
|
47
47
|
this.sourceLength = this.source.length;
|
48
48
|
// Flag for ignoring whitespace
|
49
49
|
this.configTrimWhiteSpace = false;
|
50
|
+
// Parser mode
|
51
|
+
this.parseAsInline = options.parseAsInline;
|
50
52
|
// Set current parse position
|
51
53
|
this.pos = 0;
|
52
54
|
// Start with empty output
|
@@ -83,7 +85,7 @@ var WikiParser = function(type,text,options) {
|
|
83
85
|
// Parse any pragmas
|
84
86
|
var topBranch = this.parsePragmas();
|
85
87
|
// Parse the text into inline runs or blocks
|
86
|
-
if(
|
88
|
+
if(this.parseAsInline) {
|
87
89
|
topBranch.push.apply(topBranch,this.parseInlineRun());
|
88
90
|
} else {
|
89
91
|
topBranch.push.apply(topBranch,this.parseBlocks());
|
@@ -116,7 +118,7 @@ WikiParser.prototype.loadRemoteTiddler = function(url) {
|
|
116
118
|
*/
|
117
119
|
WikiParser.prototype.setupRules = function(proto,configPrefix) {
|
118
120
|
var self = this;
|
119
|
-
if(!$tw.
|
121
|
+
if(!$tw.safeMode) {
|
120
122
|
$tw.utils.each(proto,function(object,name) {
|
121
123
|
if(self.wiki.getTiddlerText(configPrefix + name,"enable") !== "enable") {
|
122
124
|
delete proto[name];
|
@@ -30,6 +30,16 @@ exports.handler = function(request,response,state) {
|
|
30
30
|
if(fields.revision) {
|
31
31
|
delete fields.revision;
|
32
32
|
}
|
33
|
+
// If this is a skinny tiddler, it means the client never got the full
|
34
|
+
// version of the tiddler to edit. So we must preserve whatever text
|
35
|
+
// already exists on the server, or else we'll inadvertently delete it.
|
36
|
+
if(fields._is_skinny !== undefined) {
|
37
|
+
var tiddler = state.wiki.getTiddler(title);
|
38
|
+
if(tiddler) {
|
39
|
+
fields.text = tiddler.fields.text;
|
40
|
+
}
|
41
|
+
delete fields._is_skinny;
|
42
|
+
}
|
33
43
|
state.wiki.addTiddler(new $tw.Tiddler(fields,{title: title}));
|
34
44
|
var changeCount = state.wiki.getChangeCount(title).toString();
|
35
45
|
response.writeHead(204, "OK",{
|
@@ -121,7 +121,11 @@ exports.startup = function() {
|
|
121
121
|
});
|
122
122
|
// Set up the syncer object if we've got a syncadaptor
|
123
123
|
if($tw.syncadaptor) {
|
124
|
-
$tw.syncer = new $tw.Syncer({
|
124
|
+
$tw.syncer = new $tw.Syncer({
|
125
|
+
wiki: $tw.wiki,
|
126
|
+
syncadaptor: $tw.syncadaptor,
|
127
|
+
logging: $tw.wiki.getTiddlerText('$:/config/SyncLogging', "yes") === "yes"
|
128
|
+
});
|
125
129
|
}
|
126
130
|
// Setup the saver handler
|
127
131
|
$tw.saverHandler = new $tw.SaverHandler({
|
@@ -12,35 +12,113 @@ A barebones CSV parser
|
|
12
12
|
/*global $tw: false */
|
13
13
|
"use strict";
|
14
14
|
|
15
|
+
var QUOTE = '"';
|
16
|
+
|
17
|
+
var getCellInfo = function(text, start, length, SEPARATOR) {
|
18
|
+
var isCellQuoted = text.charAt(start) === QUOTE;
|
19
|
+
var cellStart = isCellQuoted ? start + 1 : start;
|
20
|
+
|
21
|
+
if (text.charAt(i) === SEPARATOR) {
|
22
|
+
return [cellStart, cellStart, false];
|
23
|
+
}
|
24
|
+
|
25
|
+
for (var i = cellStart; i < length; i++) {
|
26
|
+
var cellCharacter = text.charAt(i);
|
27
|
+
var isEOL = cellCharacter === "\n" || cellCharacter === "\r";
|
28
|
+
|
29
|
+
if (isEOL && !isCellQuoted) {
|
30
|
+
return [cellStart, i, false];
|
31
|
+
|
32
|
+
} else if (cellCharacter === SEPARATOR && !isCellQuoted) {
|
33
|
+
return [cellStart, i, false];
|
34
|
+
|
35
|
+
} else if (cellCharacter === QUOTE && isCellQuoted) {
|
36
|
+
var nextCharacter = i + 1 < length ? text.charAt(i + 1) : '';
|
37
|
+
if (nextCharacter !== QUOTE) {
|
38
|
+
return [cellStart, i, true];
|
39
|
+
} else {
|
40
|
+
i++;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
return [cellStart, i, isCellQuoted];
|
46
|
+
}
|
47
|
+
|
48
|
+
exports.parseCsvString = function(text, options) {
|
49
|
+
if (!text) {
|
50
|
+
return [];
|
51
|
+
}
|
52
|
+
|
53
|
+
options = options || {};
|
54
|
+
var SEPARATOR = options.separator || ",",
|
55
|
+
length = text.length,
|
56
|
+
rows = [],
|
57
|
+
nextRow = [];
|
58
|
+
|
59
|
+
for (var i = 0; i < length; i++) {
|
60
|
+
var cellInfo = getCellInfo(text, i, length, SEPARATOR);
|
61
|
+
var cellText = text.substring(cellInfo[0], cellInfo[1]);
|
62
|
+
if (cellInfo[2]) {
|
63
|
+
cellText = cellText.replace(/""/g, '"');
|
64
|
+
cellInfo[1]++;
|
65
|
+
}
|
66
|
+
nextRow.push(cellText);
|
67
|
+
|
68
|
+
i = cellInfo[1];
|
69
|
+
|
70
|
+
var character = text.charAt(i);
|
71
|
+
var nextCharacter = i + 1 < length ? text.charAt(i + 1) : '';
|
72
|
+
|
73
|
+
if (character === "\r" || character === "\n") {
|
74
|
+
// Edge case for empty rows
|
75
|
+
if (nextRow.length === 1 && nextRow[0] === '') {
|
76
|
+
nextRow.length = 0;
|
77
|
+
}
|
78
|
+
rows.push(nextRow);
|
79
|
+
nextRow = [];
|
80
|
+
|
81
|
+
if (character === "\r") {
|
82
|
+
var nextCharacter = i + 1 < length ? text.charAt(i + 1) : '';
|
83
|
+
|
84
|
+
if (nextCharacter === "\n") {
|
85
|
+
i++;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
// Special case if last cell in last row is an empty cell
|
92
|
+
if (text.charAt(length - 1) === SEPARATOR) {
|
93
|
+
nextRow.push("");
|
94
|
+
}
|
95
|
+
|
96
|
+
rows.push(nextRow);
|
97
|
+
|
98
|
+
return rows;
|
99
|
+
}
|
100
|
+
|
15
101
|
/*
|
16
102
|
Parse a CSV string with a header row and return an array of hashmaps.
|
17
103
|
*/
|
18
104
|
exports.parseCsvStringWithHeader = function(text,options) {
|
19
|
-
|
20
|
-
var
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
var columns = rows[row].split(separator),
|
33
|
-
columnResult = Object.create(null);
|
34
|
-
if(columns.length !== headings.length) {
|
35
|
-
return "Malformed CSV row '" + rows[row] + "'";
|
36
|
-
}
|
37
|
-
for(var column=0; column<columns.length; column++) {
|
38
|
-
var columnName = headings[column];
|
39
|
-
columnResult[columnName] = $tw.utils.trim(columns[column] || "");
|
105
|
+
var csv = $tw.utils.parseCsvString(text, options);
|
106
|
+
var headers = csv[0];
|
107
|
+
|
108
|
+
csv = csv.slice(1);
|
109
|
+
for (var i = 0; i < csv.length; i++) {
|
110
|
+
var row = csv[i];
|
111
|
+
var rowObject = Object.create(null);
|
112
|
+
|
113
|
+
for(var columnIndex=0; columnIndex<headers.length; columnIndex++) {
|
114
|
+
var columnName = headers[columnIndex];
|
115
|
+
if (columnName) {
|
116
|
+
rowObject[columnName] = $tw.utils.trim(row[columnIndex] || "");
|
117
|
+
}
|
40
118
|
}
|
41
|
-
|
119
|
+
csv[i] = rowObject;
|
42
120
|
}
|
43
|
-
return
|
121
|
+
return csv;
|
44
122
|
}
|
45
123
|
|
46
124
|
})();
|
@@ -12,6 +12,8 @@ Various static DOM-related utility functions.
|
|
12
12
|
/*global $tw: false */
|
13
13
|
"use strict";
|
14
14
|
|
15
|
+
var Popup = require("$:/core/modules/utils/dom/popup.js");
|
16
|
+
|
15
17
|
/*
|
16
18
|
Determines whether element 'a' contains element 'b'
|
17
19
|
Code thanks to John Resig, http://ejohn.org/blog/comparing-document-position/
|
@@ -294,8 +296,21 @@ exports.collectDOMVariables = function(selectedNode,domNode,event) {
|
|
294
296
|
});
|
295
297
|
|
296
298
|
if(selectedNode.offsetLeft) {
|
297
|
-
// Add
|
298
|
-
|
299
|
+
// Add variables with a (relative and absolute) popup coordinate string for the selected node
|
300
|
+
var nodeRect = {
|
301
|
+
left: selectedNode.offsetLeft,
|
302
|
+
top: selectedNode.offsetTop,
|
303
|
+
width: selectedNode.offsetWidth,
|
304
|
+
height: selectedNode.offsetHeight
|
305
|
+
};
|
306
|
+
variables["tv-popup-coords"] = Popup.buildCoordinates(Popup.coordinatePrefix.csOffsetParent,nodeRect);
|
307
|
+
|
308
|
+
var absRect = $tw.utils.extend({}, nodeRect);
|
309
|
+
for (var currentNode = selectedNode.offsetParent; currentNode; currentNode = currentNode.offsetParent) {
|
310
|
+
absRect.left += currentNode.offsetLeft;
|
311
|
+
absRect.top += currentNode.offsetTop;
|
312
|
+
}
|
313
|
+
variables["tv-popup-abs-coords"] = Popup.buildCoordinates(Popup.coordinatePrefix.csAbsolute,absRect);
|
299
314
|
|
300
315
|
// Add variables for offset of selected node
|
301
316
|
variables["tv-selectednode-posx"] = selectedNode.offsetLeft.toString();
|
@@ -26,6 +26,8 @@ Display a modal dialogue
|
|
26
26
|
options: see below
|
27
27
|
Options include:
|
28
28
|
downloadLink: Text of a big download link to include
|
29
|
+
event: widget event
|
30
|
+
variables: from event.paramObject
|
29
31
|
*/
|
30
32
|
Modal.prototype.display = function(title,options) {
|
31
33
|
options = options || {};
|
@@ -209,6 +211,10 @@ Modal.prototype.display = function(title,options) {
|
|
209
211
|
headerWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false);
|
210
212
|
bodyWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false);
|
211
213
|
footerWidgetNode.addEventListener("tm-close-tiddler",closeHandler,false);
|
214
|
+
// Whether to close the modal dialog when the mask (area outside the modal) is clicked
|
215
|
+
if(tiddler.fields && (tiddler.fields["mask-closable"] === "yes" || tiddler.fields["mask-closable"] === "true")) {
|
216
|
+
modalBackdrop.addEventListener("click",closeHandler,false);
|
217
|
+
}
|
212
218
|
// Set the initial styles for the message
|
213
219
|
$tw.utils.setStyle(modalBackdrop,[
|
214
220
|
{opacity: "0"}
|
@@ -22,6 +22,19 @@ var Popup = function(options) {
|
|
22
22
|
this.popups = []; // Array of {title:,wiki:,domNode:} objects
|
23
23
|
};
|
24
24
|
|
25
|
+
/*
|
26
|
+
Global regular expression for parsing the location of a popup.
|
27
|
+
This is also used by the Reveal widget.
|
28
|
+
*/
|
29
|
+
exports.popupLocationRegExp = /^(@?)\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/
|
30
|
+
|
31
|
+
/*
|
32
|
+
Objekt containing the available prefixes for coordinates build with the `buildCoordinates` function:
|
33
|
+
- csOffsetParent: Uses a coordinate system based on the offset parent (no prefix).
|
34
|
+
- csAbsolute: Use an absolute coordinate system (prefix "@").
|
35
|
+
*/
|
36
|
+
exports.coordinatePrefix = { csOffsetParent: "", csAbsolute: "@" }
|
37
|
+
|
25
38
|
/*
|
26
39
|
Trigger a popup open or closed. Parameters are in a hashmap:
|
27
40
|
title: title of the tiddler where the popup details are stored
|
@@ -136,8 +149,17 @@ Popup.prototype.show = function(options) {
|
|
136
149
|
height: options.domNode.offsetHeight
|
137
150
|
};
|
138
151
|
}
|
139
|
-
|
140
|
-
|
152
|
+
if(options.absolute && options.domNode) {
|
153
|
+
// Walk the offsetParent chain and add the position of the offsetParents to make
|
154
|
+
// the position absolute to the root node of the page.
|
155
|
+
var currentNode = options.domNode.offsetParent;
|
156
|
+
while(currentNode) {
|
157
|
+
rect.left += currentNode.offsetLeft;
|
158
|
+
rect.top += currentNode.offsetTop;
|
159
|
+
currentNode = currentNode.offsetParent;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
var popupRect = exports.buildCoordinates(options.absolute?exports.coordinatePrefix.csAbsolute:exports.coordinatePrefix.csOffsetParent,rect);
|
141
163
|
if(options.noStateReference) {
|
142
164
|
options.wiki.setText(options.title,"text",undefined,popupRect);
|
143
165
|
} else {
|
@@ -172,13 +194,54 @@ Popup.prototype.cancel = function(level) {
|
|
172
194
|
};
|
173
195
|
|
174
196
|
/*
|
175
|
-
Returns true if the specified title and text identifies an active popup
|
197
|
+
Returns true if the specified title and text identifies an active popup.
|
198
|
+
This function is safe to call, even if the popup class was not initialized.
|
176
199
|
*/
|
177
|
-
|
178
|
-
|
179
|
-
return popupLocationRegExp.test(text);
|
200
|
+
exports.readPopupState = function(text) {
|
201
|
+
return exports.popupLocationRegExp.test(text);
|
180
202
|
};
|
181
203
|
|
204
|
+
/*
|
205
|
+
Parses a coordinate string in the format `(x,y,w,h)` or `@(x,y,z,h)` and returns
|
206
|
+
an object containing the position, width and height. The absolute-Mark is boolean
|
207
|
+
value that indicates the coordinate system of the coordinates. If they start with
|
208
|
+
an `@`, `absolute` is set to true and the coordinates are relative to the root
|
209
|
+
element. If the initial `@` is missing, they are relative to the offset parent
|
210
|
+
element and `absoute` is false.
|
211
|
+
This function is safe to call, even if the popup class was not initialized.
|
212
|
+
*/
|
213
|
+
exports.parseCoordinates = function(coordinates) {
|
214
|
+
var match = exports.popupLocationRegExp.exec(coordinates);
|
215
|
+
if(match) {
|
216
|
+
return {
|
217
|
+
absolute: (match[1] === "@"),
|
218
|
+
left: parseFloat(match[2]),
|
219
|
+
top: parseFloat(match[3]),
|
220
|
+
width: parseFloat(match[4]),
|
221
|
+
height: parseFloat(match[5])
|
222
|
+
};
|
223
|
+
} else {
|
224
|
+
return false;
|
225
|
+
}
|
226
|
+
}
|
227
|
+
|
228
|
+
/*
|
229
|
+
Builds a coordinate string from a coordinate system identifier and an object
|
230
|
+
containing the left, top, width and height values.
|
231
|
+
Use constants defined in coordinatePrefix to specify a coordinate system.
|
232
|
+
If one of the parameters is invalid for building a coordinate string `(0,0,0,0)`
|
233
|
+
will be returned.
|
234
|
+
This function is safe to call, even if the popup class was not initialized.
|
235
|
+
*/
|
236
|
+
exports.buildCoordinates = function(prefix,position) {
|
237
|
+
var coord = prefix + "(" + position.left + "," + position.top + "," + position.width + "," + position.height + ")";
|
238
|
+
if (exports.popupLocationRegExp.test(coord)) {
|
239
|
+
return coord;
|
240
|
+
} else {
|
241
|
+
return "(0,0,0,0)";
|
242
|
+
}
|
243
|
+
}
|
244
|
+
|
182
245
|
exports.Popup = Popup;
|
183
246
|
|
184
247
|
})();
|
@@ -42,7 +42,7 @@ var TW_TextNode = function(text) {
|
|
42
42
|
this.textContent = text + "";
|
43
43
|
};
|
44
44
|
|
45
|
-
|
45
|
+
Object.setPrototypeOf(TW_TextNode,TW_Node.prototype);
|
46
46
|
|
47
47
|
Object.defineProperty(TW_TextNode.prototype, "nodeType", {
|
48
48
|
get: function() {
|
@@ -67,7 +67,7 @@ var TW_Element = function(tag,namespace) {
|
|
67
67
|
this.namespaceURI = namespace || "http://www.w3.org/1999/xhtml";
|
68
68
|
};
|
69
69
|
|
70
|
-
|
70
|
+
Object.setPrototypeOf(TW_Element,TW_Node.prototype);
|
71
71
|
|
72
72
|
Object.defineProperty(TW_Element.prototype, "style", {
|
73
73
|
get: function() {
|