tiddlywiki 5.2.3 → 5.2.5

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.
Files changed (412) hide show
  1. package/bin/build-site.sh +11 -2
  2. package/bin/test.sh +1 -0
  3. package/boot/boot.js +9 -6
  4. package/core/images/layout-button.tid +4 -0
  5. package/core/images/mastodon.tid +6 -0
  6. package/core/language/en-GB/Buttons.multids +4 -0
  7. package/core/language/en-GB/ControlPanel.multids +3 -3
  8. package/core/language/en-GB/Fields.multids +2 -2
  9. package/core/language/en-GB/GettingStarted.tid +4 -3
  10. package/core/language/en-GB/Help/commands.tid +18 -0
  11. package/core/language/en-GB/Misc.multids +1 -0
  12. package/core/modules/commands/commands.js +42 -0
  13. package/core/modules/editor/engines/framed.js +12 -1
  14. package/core/modules/editor/factory.js +2 -2
  15. package/core/modules/filters/format/json.js +35 -0
  16. package/core/modules/filters/is/variable.js +2 -2
  17. package/core/modules/filters/json-ops.js +186 -0
  18. package/core/modules/filters/variables.js +9 -3
  19. package/core/modules/filters.js +15 -6
  20. package/core/modules/keyboard.js +13 -1
  21. package/core/modules/parsers/csvparser.js +25 -17
  22. package/core/modules/parsers/wikiparser/rules/macrodef.js +1 -1
  23. package/core/modules/parsers/wikiparser/rules/parsermode.js +68 -0
  24. package/core/modules/parsers/wikiparser/rules/styleinline.js +3 -3
  25. package/core/modules/parsers/wikiparser/wikiparser.js +4 -2
  26. package/core/modules/server/routes/put-tiddler.js +10 -0
  27. package/core/modules/startup/startup.js +5 -1
  28. package/core/modules/utils/csv.js +101 -23
  29. package/core/modules/utils/dom/dom.js +17 -2
  30. package/core/modules/utils/dom/modal.js +6 -0
  31. package/core/modules/utils/dom/popup.js +69 -6
  32. package/core/modules/utils/fakedom.js +2 -2
  33. package/core/modules/utils/linked-list.js +79 -75
  34. package/core/modules/utils/logger.js +3 -1
  35. package/core/modules/utils/parsetree.js +20 -10
  36. package/core/modules/utils/utils.js +3 -0
  37. package/core/modules/widgets/action-deletefield.js +2 -2
  38. package/core/modules/widgets/action-popup.js +10 -8
  39. package/core/modules/widgets/button.js +7 -2
  40. package/core/modules/widgets/checkbox.js +12 -5
  41. package/core/modules/widgets/error.js +63 -0
  42. package/core/modules/widgets/genesis.js +108 -0
  43. package/core/modules/widgets/importvariables.js +4 -1
  44. package/core/modules/widgets/keyboard.js +4 -0
  45. package/core/modules/widgets/let.js +3 -5
  46. package/core/modules/widgets/reveal.js +11 -10
  47. package/core/modules/widgets/select.js +9 -0
  48. package/core/modules/widgets/transclude.js +3 -5
  49. package/core/modules/widgets/widget.js +44 -18
  50. package/core/palettes/Blanca.tid +2 -0
  51. package/core/palettes/Blue.tid +2 -0
  52. package/core/palettes/BrightMute.tid +2 -0
  53. package/core/palettes/ContrastDark.tid +2 -0
  54. package/core/palettes/ContrastLight.tid +2 -0
  55. package/core/palettes/CupertinoDark.tid +2 -0
  56. package/core/palettes/DarkPhotos.tid +2 -0
  57. package/core/palettes/DesertSand.tid +2 -0
  58. package/core/palettes/GruvBoxDark.tid +2 -0
  59. package/core/palettes/Nord.tid +2 -0
  60. package/core/palettes/Rocker.tid +2 -0
  61. package/core/palettes/SolarFlare.tid +2 -0
  62. package/core/palettes/SolarizedDark.tid +2 -0
  63. package/core/palettes/SolarizedLight.tid +2 -0
  64. package/core/palettes/SpartanDay.tid +2 -0
  65. package/core/palettes/SpartanNight.tid +2 -0
  66. package/core/palettes/Twilight.tid +2 -0
  67. package/core/palettes/Vanilla.tid +2 -0
  68. package/core/templates/external-js/save-all-external-js.tid +4 -2
  69. package/core/templates/external-js/save-offline-external-js.tid +4 -2
  70. package/core/templates/single.tiddler.window.tid +1 -1
  71. package/core/ui/Actions/new-image.tid +1 -7
  72. package/core/ui/AdvancedSearch/FilterButtons/delete.tid +3 -3
  73. package/core/ui/AdvancedSearch/FilterButtons/dropdown.tid +2 -2
  74. package/core/ui/ControlPanel/Basics/retain-story-ordering-button.tid +3 -0
  75. package/core/ui/ControlPanel/Basics.tid +3 -2
  76. package/core/ui/EditTemplate/Preview/output.tid +1 -1
  77. package/core/ui/EditTemplate/body/default.tid +1 -1
  78. package/core/ui/EditTemplate/fields.tid +12 -2
  79. package/core/ui/EditTemplate.tid +7 -2
  80. package/core/ui/ImportListing.tid +5 -5
  81. package/core/ui/KeyboardShortcuts/advanced-search.tid +1 -1
  82. package/core/ui/PageControls/layout.tid +15 -0
  83. package/core/ui/PageTemplate.tid +1 -4
  84. package/core/ui/SideBar/More.tid +2 -2
  85. package/core/ui/SwitcherModal.tid +1 -0
  86. package/core/ui/TagManager.tid +75 -63
  87. package/core/ui/ViewTemplate/unfold.tid +6 -2
  88. package/core/ui/ViewTemplate.tid +1 -1
  89. package/core/wiki/config/DefaultTiddlersRetainStory.tid +3 -0
  90. package/core/wiki/config/OfficialPluginLibrary.tid +1 -1
  91. package/core/wiki/config/PageControlButtons.multids +1 -0
  92. package/core/wiki/macros/list.tid +7 -7
  93. package/core/wiki/macros/timeline.tid +6 -9
  94. package/core/wiki/macros/toc.tid +12 -8
  95. package/core/wiki/tags/PageControls.tid +1 -1
  96. package/editions/de-AT/tiddlywiki.info +0 -1
  97. package/editions/de-AT-server/tiddlywiki.info +0 -1
  98. package/editions/de-DE/tiddlywiki.info +0 -1
  99. package/editions/dev/tiddlers/HelloThere.tid +2 -1
  100. package/editions/dev/tiddlers/How to run a local plugin library for testing.tid +42 -0
  101. package/editions/dev/tiddlers/javascript-widget-tutorial/Child widgets tutorial.tid +140 -0
  102. package/editions/dev/tiddlers/javascript-widget-tutorial/Do nothing widget demo.tid +22 -0
  103. package/editions/dev/tiddlers/javascript-widget-tutorial/Do nothing widget tutorial.tid +25 -0
  104. package/editions/dev/tiddlers/javascript-widget-tutorial/Hello World demo.tid +23 -0
  105. package/editions/dev/tiddlers/javascript-widget-tutorial/Hello World widget tutorial.tid +18 -0
  106. package/editions/dev/tiddlers/javascript-widget-tutorial/Javascript Widget Tutorial.tid +37 -0
  107. package/editions/dev/tiddlers/javascript-widget-tutorial/Undefined widget demo.tid +18 -0
  108. package/editions/dev/tiddlers/javascript-widget-tutorial/Undefined widget tutorial.tid +11 -0
  109. package/editions/dev/tiddlers/javascript-widget-tutorial/Widget attributes demo I.tid +48 -0
  110. package/editions/dev/tiddlers/javascript-widget-tutorial/Widget attributes demo II.tid +48 -0
  111. package/editions/dev/tiddlers/javascript-widget-tutorial/Widget attributes tutorial part I.tid +50 -0
  112. package/editions/dev/tiddlers/javascript-widget-tutorial/Widget attributes tutorial part II.tid +33 -0
  113. package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh demo I.tid +44 -0
  114. package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh demo II.tid +40 -0
  115. package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh demo III.tid +50 -0
  116. package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh tutorial part I.tid +47 -0
  117. package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh tutorial part II.tid +37 -0
  118. package/editions/dev/tiddlers/javascript-widget-tutorial/Widget refresh tutorial part III.tid +26 -0
  119. package/editions/dev/tiddlers/javascript-widget-tutorial/domwidget.js +47 -0
  120. package/editions/dev/tiddlers/javascript-widget-tutorial/domwidget.js.meta +6 -0
  121. package/editions/dev/tiddlers/javascript-widget-tutorial/donothing.js +16 -0
  122. package/editions/dev/tiddlers/javascript-widget-tutorial/donothing.js.meta +6 -0
  123. package/editions/dev/tiddlers/javascript-widget-tutorial/hello-attribute-optimized.js +51 -0
  124. package/editions/dev/tiddlers/javascript-widget-tutorial/hello-attribute-optimized.js.meta +6 -0
  125. package/editions/dev/tiddlers/javascript-widget-tutorial/hello-attribute.js +47 -0
  126. package/editions/dev/tiddlers/javascript-widget-tutorial/hello-attribute.js.meta +6 -0
  127. package/editions/dev/tiddlers/javascript-widget-tutorial/hello.js +35 -0
  128. package/editions/dev/tiddlers/javascript-widget-tutorial/hello.js.meta +6 -0
  129. package/editions/dev/tiddlers/javascript-widget-tutorial/refreshcount.js +43 -0
  130. package/editions/dev/tiddlers/javascript-widget-tutorial/refreshcount.js.meta +6 -0
  131. package/editions/dev/tiddlers/javascript-widget-tutorial/tiddlerfield-norefresh.js +36 -0
  132. package/editions/dev/tiddlers/javascript-widget-tutorial/tiddlerfield-norefresh.js.meta +6 -0
  133. package/editions/dev/tiddlers/javascript-widget-tutorial/tiddlerfield.js +46 -0
  134. package/editions/dev/tiddlers/javascript-widget-tutorial/tiddlerfield.js.meta +6 -0
  135. package/editions/dev/tiddlywiki.info +2 -1
  136. package/editions/es-ES/tiddlers/GettingStarted_-_Chrome.tid +1 -1
  137. package/editions/es-ES/tiddlers/Saving_with_the_HTML5_fallback_saver.tid +1 -27
  138. package/editions/es-ES/tiddlers/Saving_with_the_HTML5_saver.tid +35 -0
  139. package/editions/fr-FR/tiddlers/$__editions_tw5.com_doc-macros.tid +1 -1
  140. package/editions/fr-FR/tiddlers/GettingStarted - Chrome.tid +1 -1
  141. package/editions/fr-FR/tiddlers/Saving with the HTML5 saver.tid +23 -0
  142. package/editions/fr-FR/tiddlers/saving/Saving with the HTML5 fallback saver.tid +1 -22
  143. package/editions/fr-FR/tiddlers/system/$__core_macros_list.tid +113 -0
  144. package/editions/fr-FR/tiddlers/system/$__core_macros_tag.tid +39 -0
  145. package/editions/fr-FR/tiddlers/system/$__core_ui_TagPickerTagTemplate.tid +25 -0
  146. package/editions/full/tiddlywiki.info +0 -1
  147. package/editions/introduction/tiddlywiki.info +0 -1
  148. package/editions/pluginlibrary/tiddlers/GettingStarted.tid +45 -0
  149. package/editions/pluginlibrary/tiddlers/PrereleaseLocalPluginLibrary.tid +6 -0
  150. package/editions/pluginlibrary/tiddlers/meta/SiteSubtitle.tid +3 -0
  151. package/editions/pluginlibrary/tiddlers/meta/SiteTitle.tid +3 -0
  152. package/editions/pluginlibrary/tiddlers/system/$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid +3 -0
  153. package/editions/pluginlibrary/tiddlywiki.info +7 -0
  154. package/editions/prerelease/tiddlers/Release 5.2.6.tid +107 -0
  155. package/editions/prerelease/tiddlers/system/PrereleaseOfficialPluginLibrary.tid +1 -1
  156. package/editions/prerelease/tiddlers/system/TiddlyWiki Pre-release.tid +5 -1
  157. package/editions/test/tiddlers/tests/data/csv-cases.tid +282 -0
  158. package/editions/test/tiddlers/tests/data/filters/Recursion.tid +15 -0
  159. package/editions/test/tiddlers/tests/data/filters/fake-variables.tid +27 -0
  160. package/editions/test/tiddlers/tests/data/genesis-widget/DollarSigns.tid +14 -0
  161. package/editions/test/tiddlers/tests/data/genesis-widget/MultipleAttributes.tid +14 -0
  162. package/editions/test/tiddlers/tests/data/genesis-widget/Simple.tid +14 -0
  163. package/editions/test/tiddlers/tests/data/macros/NestedMacros.tid +36 -0
  164. package/editions/test/tiddlers/tests/data/pragmas/Parsermode.tid +36 -0
  165. package/editions/test/tiddlers/tests/data/transclude/Recursion.tid +13 -0
  166. package/editions/test/tiddlers/tests/modules/utils/test-csv.js +33 -0
  167. package/editions/test/tiddlers/tests/test-checkbox-widget.js +35 -1
  168. package/editions/test/tiddlers/tests/test-json-filters.js +112 -0
  169. package/editions/test/tiddlers/tests/test-linked-list.js +42 -2
  170. package/editions/test/tiddlers/tests/test-popup.js +63 -0
  171. package/editions/test/tiddlers/tests/test-utils.js +1 -0
  172. package/editions/test/tiddlers/tests/test-wikitext.js +16 -0
  173. package/editions/test/tiddlywiki.info +2 -1
  174. package/editions/translators/tiddlers/system/PageControlButtonsVisibility.multids +1 -0
  175. package/editions/translators/tiddlywiki.info +0 -1
  176. package/editions/tw.org/tiddlers/Code of Conduct.tid +4 -1
  177. package/editions/tw.org/tiddlers/Fundraising.tid +2 -2
  178. package/editions/tw5.com/tiddlers/Tables in WikiText CSS Utility Classes.tid +81 -0
  179. package/editions/tw5.com/tiddlers/_tw_shared/favicons/markplace.png +0 -0
  180. package/editions/tw5.com/tiddlers/_tw_shared/favicons/markplace.png.meta +3 -0
  181. package/editions/tw5.com/tiddlers/_tw_shared/sites/marketplace.tid +6 -0
  182. package/editions/tw5.com/tiddlers/_tw_shared/tags-TiddlyWikiSites.tid +1 -1
  183. package/editions/tw5.com/tiddlers/about/Funding TiddlyWiki.tid +19 -0
  184. package/editions/tw5.com/tiddlers/about/Open Collective.tid +14 -0
  185. package/editions/tw5.com/tiddlers/commands/CommandsCommand.tid +8 -0
  186. package/editions/tw5.com/tiddlers/commands/RenderTiddlerCommand.tid +2 -0
  187. package/editions/tw5.com/tiddlers/commands/RenderTiddlersCommand.tid +2 -0
  188. package/editions/tw5.com/tiddlers/commands/SaveTiddlerCommand.tid +2 -0
  189. package/editions/tw5.com/tiddlers/commands/SaveTiddlersCommand.tid +2 -0
  190. package/editions/tw5.com/tiddlers/community/plugins/GSD5.tid +2 -2
  191. package/editions/tw5.com/tiddlers/community/plugins/_JD Mobile Layout plugin_ by JD.tid +0 -1
  192. package/editions/tw5.com/tiddlers/community/resources/RegExp in Tiddlywiki by Mohammad.tid +1 -1
  193. package/editions/tw5.com/tiddlers/community/resources/_Dropboard_ by Reid Gould.tid +0 -1
  194. package/editions/tw5.com/tiddlers/community/resources/_Hacks_ by Thomas Elmiger.tid +0 -2
  195. package/editions/tw5.com/tiddlers/community/resources/_MathCell_ by Ste Wilson.tid +0 -1
  196. package/editions/tw5.com/tiddlers/community/resources/_TiddlyServer_ by Matt Lauber.tid +0 -1
  197. package/editions/tw5.com/tiddlers/community/resources/_X3DOM for TiddlyWiki 5_ by Jamal Wills.tid +0 -1
  198. package/editions/tw5.com/tiddlers/community/resources/_file-backups_ Extension Firefox by pmario.tid +1 -1
  199. package/editions/tw5.com/tiddlers/community/resources/_savetiddlers_ Extension for Chrome and Firefox by buggyj.tid +1 -1
  200. package/editions/tw5.com/tiddlers/concepts/CoordinateSystems.tid +42 -0
  201. package/editions/tw5.com/tiddlers/concepts/KeyboardShortcutTiddler.tid +2 -0
  202. package/editions/tw5.com/tiddlers/definitions/Federatial.tid +13 -1
  203. package/editions/tw5.com/tiddlers/definitions/HTML Block Elements.tid +9 -0
  204. package/editions/tw5.com/tiddlers/definitions/TiddlyWikiClassic.tid +3 -1
  205. package/editions/tw5.com/tiddlers/demonstrations/TableOfContentsMacro Selective Expandable Example custom icons.tid +16 -0
  206. package/editions/tw5.com/tiddlers/demonstrations/Tasks/TaskManagementExampleDraggable.tid +1 -1
  207. package/editions/tw5.com/tiddlers/features/DateFormat.tid +27 -3
  208. package/editions/tw5.com/tiddlers/features/JSON in TiddlyWiki.tid +1 -1
  209. package/editions/tw5.com/tiddlers/features/Modals.tid +3 -0
  210. package/editions/tw5.com/tiddlers/filters/examples/format Operator (Examples).tid +5 -2
  211. package/editions/tw5.com/tiddlers/filters/format.tid +5 -4
  212. package/editions/tw5.com/tiddlers/filters/jsonextract.tid +66 -0
  213. package/editions/tw5.com/tiddlers/filters/jsonget.tid +93 -0
  214. package/editions/tw5.com/tiddlers/filters/jsonindexes.tid +65 -0
  215. package/editions/tw5.com/tiddlers/filters/jsontype.tid +74 -0
  216. package/editions/tw5.com/tiddlers/gettingstarted/GettingStarted - Chrome.tid +2 -2
  217. package/editions/tw5.com/tiddlers/gettingstarted/GettingStarted.tid +3 -7
  218. package/editions/tw5.com/tiddlers/hellothere/HelloThere.tid +23 -22
  219. package/editions/tw5.com/tiddlers/hellothere/HelloThumbnail.tid +1 -1
  220. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Funding.tid +10 -0
  221. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Grok TiddlyWiki.tid +2 -0
  222. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Introduction Video.tid +2 -0
  223. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Latest Version.tid +9 -1
  224. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Marketplace.tid +10 -0
  225. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - TiddlyWikiLinks.tid +3 -1
  226. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail_-_Federatial.tid +11 -0
  227. package/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Default Story Ordering.tid +4 -0
  228. package/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Sync System Tiddlers From Server.tid +13 -0
  229. package/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting SyncLogging.tid +13 -0
  230. package/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting_ More Tabs Horizontal.tid +7 -0
  231. package/editions/tw5.com/tiddlers/howtos/How to create keyboard shortcuts.tid +2 -0
  232. package/editions/tw5.com/tiddlers/howtos/Reading data from JSON tiddlers.tid +10 -1
  233. package/editions/tw5.com/tiddlers/images/Federatial.png +0 -0
  234. package/editions/tw5.com/tiddlers/images/Federatial.png.meta +3 -0
  235. package/editions/tw5.com/tiddlers/images/Funding.png +0 -0
  236. package/editions/tw5.com/tiddlers/images/{TiddlyMap.png.meta → Funding.png.meta} +1 -1
  237. package/editions/tw5.com/tiddlers/images/Marketplace Banner.png +0 -0
  238. package/editions/tw5.com/tiddlers/images/Marketplace Banner.png.meta +3 -0
  239. package/editions/tw5.com/tiddlers/images/New Release Banner.png +0 -0
  240. package/editions/tw5.com/tiddlers/macros/ListMacro.tid +3 -1
  241. package/editions/tw5.com/tiddlers/macros/TableOfContentsMacro.tid +36 -2
  242. package/editions/tw5.com/tiddlers/marketplace/TiddlyWiki Marketplace.tid +18 -0
  243. package/editions/tw5.com/tiddlers/mechanisms/PopupMechanism.tid +1 -0
  244. package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-modal.tid +4 -2
  245. package/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-new-tiddler.tid +1 -1
  246. package/editions/tw5.com/tiddlers/nodejs/Installing TiddlyWiki on Node.js.tid +2 -2
  247. package/editions/tw5.com/tiddlers/pragmas/Pragma_ _parsermode.tid +17 -0
  248. package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.4.tid +144 -0
  249. package/editions/tw5.com/tiddlers/releasenotes/Release 5.2.5.tid +25 -0
  250. package/editions/tw5.com/tiddlers/releasenotes/Releases.tid +1 -1
  251. package/editions/tw5.com/tiddlers/saving/Emergency Tiddler Export.tid +1 -1
  252. package/editions/tw5.com/tiddlers/saving/Saving on TiddlyHost.tid +1 -1
  253. package/editions/tw5.com/tiddlers/saving/Saving on TiddlySpot.tid +0 -1
  254. package/editions/tw5.com/tiddlers/saving/Saving with Polly.tid +1 -0
  255. package/editions/tw5.com/tiddlers/saving/Saving with the HTML5 fallback saver.tid +3 -23
  256. package/editions/tw5.com/tiddlers/saving/Saving with the HTML5 saver.tid +27 -0
  257. package/editions/tw5.com/tiddlers/saving/Saving.tid +12 -5
  258. package/editions/tw5.com/tiddlers/saving/TiddlyBucket - Save to AWS or Google Storage.tid +15 -0
  259. package/editions/tw5.com/tiddlers/system/doc-macros.tid +1 -1
  260. package/editions/tw5.com/tiddlers/system/tw5.com-card-template.tid +1 -16
  261. package/editions/tw5.com/tiddlers/system/tw5.com-styles.tid +168 -40
  262. package/editions/tw5.com/tiddlers/system/version-macros.tid +3 -4
  263. package/editions/tw5.com/tiddlers/system/wikitext-macros.tid +43 -15
  264. package/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_ClassFilters_PageTemplate.tid +9 -0
  265. package/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_ClassFilters_TiddlerTemplate.tid +9 -0
  266. package/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_Filter.tid +2 -2
  267. package/editions/tw5.com/tiddlers/testimonials/Testimonials - Joe Armstrong.tid +8 -0
  268. package/editions/tw5.com/tiddlers/testimonials/Testimonials - Network World.tid +8 -0
  269. package/editions/tw5.com/tiddlers/testimonials/Testimonials - Product Hunt.tid +6 -0
  270. package/editions/tw5.com/tiddlers/webserver/Using the external JavaScript template.tid +10 -10
  271. package/editions/tw5.com/tiddlers/webserver/WebServer API_ Get All Tiddlers.tid +3 -1
  272. package/editions/tw5.com/tiddlers/widgets/ActionPopupWidget.tid +4 -3
  273. package/editions/tw5.com/tiddlers/widgets/ButtonWidget.tid +2 -1
  274. package/editions/tw5.com/tiddlers/widgets/DraggableWidget.tid +2 -1
  275. package/editions/tw5.com/tiddlers/widgets/ErrorWidget.tid +17 -0
  276. package/editions/tw5.com/tiddlers/widgets/EventCatcherWidget.tid +4 -3
  277. package/editions/tw5.com/tiddlers/widgets/GenesisWidget.tid +41 -0
  278. package/editions/tw5.com/tiddlers/widgets/LetWidget.tid +4 -1
  279. package/editions/tw5.com/tiddlers/widgets/ScrollableWidget.tid +1 -1
  280. package/editions/tw5.com/tiddlers/widgets/SelectWidget.tid +1 -0
  281. package/editions/tw5.com/tiddlers/wikitext/Macro Definitions in WikiText.tid +27 -4
  282. package/editions/tw5.com/tiddlers/wikitext/Styles and Classes in WikiText.tid +1 -1
  283. package/editions/tw5.com/tiddlers/wikitext/Table Classes Captions Headers and Footers.tid +20 -0
  284. package/editions/tw5.com/tiddlers/wikitext/Tables in WikiText.tid +3 -13
  285. package/editions/tw5.com/tiddlers/wikitext/Utility Classes.tid +20 -0
  286. package/editions/tw5.com/tiddlers/wikitext/parser/WikiText Parser Modes.tid +1 -1
  287. package/editions/twitter-archivist/tiddlers/DefaultTiddlers.tid +4 -0
  288. package/editions/twitter-archivist/tiddlers/HelloThere.tid +9 -0
  289. package/editions/twitter-archivist/tiddlers/SiteSubtitle.tid +3 -0
  290. package/editions/twitter-archivist/tiddlers/SiteTitle.tid +3 -0
  291. package/editions/twitter-archivist/tiddlywiki.info +16 -0
  292. package/languages/ar-PS/ControlPanel.multids +1 -1
  293. package/languages/ca-ES/ControlPanel.multids +1 -1
  294. package/languages/cs-CZ/ControlPanel.multids +1 -1
  295. package/languages/da-DK/ControlPanel.multids +1 -1
  296. package/languages/de-DE/Buttons.multids +5 -1
  297. package/languages/de-DE/ControlPanel.multids +1 -1
  298. package/languages/de-DE/Help/commands.tid +14 -0
  299. package/languages/de-DE/Misc.multids +1 -0
  300. package/languages/el-GR/ControlPanel.multids +1 -1
  301. package/languages/es-ES/Buttons.multids +91 -87
  302. package/languages/es-ES/ControlPanel.multids +19 -2
  303. package/languages/es-ES/Docs/PaletteColours.multids +2 -2
  304. package/languages/es-ES/EditTemplate.multids +3 -0
  305. package/languages/es-ES/Fields.multids +6 -5
  306. package/languages/es-ES/GettingStarted.tid +4 -3
  307. package/languages/es-ES/Help/commands.tid +18 -0
  308. package/languages/es-ES/Help/default.tid +4 -1
  309. package/languages/es-ES/Help/listen.tid +0 -1
  310. package/languages/es-ES/Help/render.tid +2 -2
  311. package/languages/es-ES/Import.multids +1 -1
  312. package/languages/es-ES/Misc.multids +2 -1
  313. package/languages/es-ES/SideBar.multids +1 -0
  314. package/languages/es-ES/Snippets/ListByTag.tid +1 -1
  315. package/languages/fa-IR/ControlPanel.multids +1 -1
  316. package/languages/fr-FR/Buttons.multids +2 -0
  317. package/languages/fr-FR/ControlPanel.multids +4 -4
  318. package/languages/fr-FR/Misc.multids +3 -2
  319. package/languages/hi-IN/ControlPanel.multids +1 -1
  320. package/languages/ia-IA/ControlPanel.multids +1 -1
  321. package/languages/it-IT/ControlPanel.multids +1 -1
  322. package/languages/ja-JP/ControlPanel.multids +9 -9
  323. package/languages/ko-KR/ControlPanel.multids +1 -1
  324. package/languages/nl-NL/ControlPanel.multids +1 -1
  325. package/languages/pl-PL/Buttons.multids +7 -3
  326. package/languages/pl-PL/ControlPanel.multids +26 -24
  327. package/languages/pl-PL/GettingStarted.tid +4 -3
  328. package/languages/pl-PL/Help/commands.tid +18 -0
  329. package/languages/pl-PL/Help/render.tid +2 -2
  330. package/languages/pl-PL/Misc.multids +1 -0
  331. package/languages/pl-PL/ThemeTweaks.multids +3 -3
  332. package/languages/pt-BR/ControlPanel.multids +1 -1
  333. package/languages/pt-PT/ControlPanel.multids +1 -1
  334. package/languages/ru-RU/ControlPanel.multids +1 -1
  335. package/languages/sk-SK/ControlPanel.multids +1 -1
  336. package/languages/sl-SI/ControlPanel.multids +1 -1
  337. package/languages/sv-SE/ControlPanel.multids +1 -1
  338. package/languages/zh-Hans/Buttons.multids +36 -32
  339. package/languages/zh-Hans/ControlPanel.multids +19 -19
  340. package/languages/zh-Hans/CoreReadMe.tid +1 -1
  341. package/languages/zh-Hans/Docs/ModuleTypes.multids +2 -2
  342. package/languages/zh-Hans/Docs/PaletteColours.multids +8 -8
  343. package/languages/zh-Hans/Fields.multids +7 -7
  344. package/languages/zh-Hans/Filters.multids +1 -1
  345. package/languages/zh-Hans/GettingStarted.tid +8 -6
  346. package/languages/zh-Hans/Help/commands.tid +18 -0
  347. package/languages/zh-Hans/Help/fetch.tid +6 -6
  348. package/languages/zh-Hans/Help/init.tid +1 -1
  349. package/languages/zh-Hans/Help/listen.tid +5 -5
  350. package/languages/zh-Hans/Help/makelibrary.tid +1 -1
  351. package/languages/zh-Hans/Help/savetiddlers.tid +1 -1
  352. package/languages/zh-Hans/Help/server.tid +6 -6
  353. package/languages/zh-Hans/Help/setfield.tid +3 -3
  354. package/languages/zh-Hans/Import.multids +1 -1
  355. package/languages/zh-Hans/Misc.multids +12 -11
  356. package/languages/zh-Hans/Search.multids +6 -6
  357. package/languages/zh-Hans/SiteSubtitle.tid +1 -1
  358. package/languages/zh-Hans/Snippets/ListByTag.tid +1 -1
  359. package/languages/zh-Hans/ThemeTweaks.multids +7 -7
  360. package/languages/zh-Hans/TiddlerInfo.multids +2 -2
  361. package/languages/zh-Hant/Buttons.multids +4 -0
  362. package/languages/zh-Hant/ControlPanel.multids +2 -2
  363. package/languages/zh-Hant/Fields.multids +2 -2
  364. package/languages/zh-Hant/GettingStarted.tid +4 -3
  365. package/languages/zh-Hant/Help/commands.tid +18 -0
  366. package/languages/zh-Hant/Misc.multids +1 -0
  367. package/licenses/cla-individual.md +6 -0
  368. package/package.json +1 -1
  369. package/plugins/tiddlywiki/bibtex/deserializer.js +2 -2
  370. package/plugins/tiddlywiki/codemirror/engine.js +4 -0
  371. package/plugins/tiddlywiki/dynannotate/docs/readme.tid +2 -2
  372. package/plugins/tiddlywiki/dynannotate/modules/dynannotate.js +4 -2
  373. package/plugins/tiddlywiki/help/tabs/Support.tid +6 -2
  374. package/plugins/tiddlywiki/jasmine/command.js +33 -0
  375. package/plugins/tiddlywiki/jasmine/help.tid +24 -0
  376. package/plugins/tiddlywiki/jasmine/jasmine-plugin.js +24 -18
  377. package/plugins/tiddlywiki/jasmine/readme.tid +31 -1
  378. package/plugins/tiddlywiki/jasmine/run-wiki-based-tests.js +93 -0
  379. package/plugins/tiddlywiki/jasmine/startup.js +37 -0
  380. package/plugins/tiddlywiki/translators/macros/translatableStringEditor.tid +6 -0
  381. package/plugins/tiddlywiki/translators/system/styles.tid +5 -0
  382. package/plugins/tiddlywiki/twitter-archivist/Twitter Archives.tid +5 -0
  383. package/plugins/tiddlywiki/twitter-archivist/archivist.js +319 -0
  384. package/plugins/tiddlywiki/twitter-archivist/configTiddlerInfoMode.tid +2 -0
  385. package/plugins/tiddlywiki/twitter-archivist/loadtwitterarchive.js +53 -0
  386. package/plugins/tiddlywiki/twitter-archivist/macros.tid +222 -0
  387. package/plugins/tiddlywiki/twitter-archivist/plugin.info +6 -0
  388. package/plugins/tiddlywiki/twitter-archivist/readme.tid +33 -0
  389. package/plugins/tiddlywiki/twitter-archivist/spec.tid +62 -0
  390. package/plugins/tiddlywiki/twitter-archivist/startup.js +38 -0
  391. package/plugins/tiddlywiki/twitter-archivist/styles.tid +47 -0
  392. package/plugins/tiddlywiki/twitter-archivist/template-archive.tid +3 -0
  393. package/plugins/tiddlywiki/twitter-archivist/template-hashtag.tid +3 -0
  394. package/plugins/tiddlywiki/twitter-archivist/template-tweet.tid +3 -0
  395. package/plugins/tiddlywiki/twitter-archivist/template-tweeter.tid +3 -0
  396. package/plugins/tiddlywiki/twitter-archivist/todo.tid +15 -0
  397. package/plugins/tiddlywiki/twitter-archivist/usage.tid +18 -0
  398. package/plugins/tiddlywiki/twitter-archivist/view-template-body-cascade.tid +8 -0
  399. package/plugins/tiddlywiki/upgrade/UpgradeWizard.tid +3 -3
  400. package/readme.md +1 -1
  401. package/themes/tiddlywiki/vanilla/base.tid +114 -9
  402. package/editions/fr-FR/tiddlers/$__core_ui_TagTemplate.tid +0 -33
  403. package/editions/prerelease/tiddlers/Release 5.2.4.tid +0 -59
  404. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Classic.tid +0 -6
  405. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Developers.tid +0 -7
  406. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - Gentle Guide.tid +0 -11
  407. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - HelpingTiddlyWiki.tid +0 -7
  408. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - TWEUM2017.tid +0 -8
  409. package/editions/tw5.com/tiddlers/hellothere/thumbnails/HelloThumbnail - TiddlyMap.tid +0 -6
  410. package/editions/tw5.com/tiddlers/images/Dev Thumbnail.jpg +0 -0
  411. package/editions/tw5.com/tiddlers/images/Dev Thumbnail.jpg.meta +0 -3
  412. 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 = text.split(/\r?\n/mg),
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 lineText = lines[line];
31
- if(lineText) {
32
- var row = {
33
- "type": "element", "tag": "tr", "children": []
34
- };
35
- var columns = lineText.split(",");
36
- for(var column=0; column<columns.length; column++) {
37
- row.children.push({
38
- "type": "element", "tag": tag, "children": [{
39
- "type": "text",
40
- "text": columns[column]
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 = /(\r?\n\\end[^\S\n\r]*(?:$|\r?\n))/mg;
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(options.parseAsInline) {
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.safemode) {
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({wiki: $tw.wiki, syncadaptor: $tw.syncadaptor});
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
- options = options || {};
20
- var separator = options.separator || ",",
21
- rows = text.split(/\r?\n/mg).map(function(row) {
22
- return $tw.utils.trim(row);
23
- }).filter(function(row) {
24
- return row !== "";
25
- });
26
- if(rows.length < 1) {
27
- return "Missing header row";
28
- }
29
- var headings = rows[0].split(separator),
30
- results = [];
31
- for(var row=1; row<rows.length; row++) {
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
- results.push(columnResult);
119
+ csv[i] = rowObject;
42
120
  }
43
- return results;
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 a variable with a popup coordinate string for the selected node
298
- variables["tv-popup-coords"] = "(" + selectedNode.offsetLeft + "," + selectedNode.offsetTop +"," + selectedNode.offsetWidth + "," + selectedNode.offsetHeight + ")";
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
- var popupRect = "(" + rect.left + "," + rect.top + "," +
140
- rect.width + "," + rect.height + ")";
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
- Popup.prototype.readPopupState = function(text) {
178
- var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/;
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
- TW_TextNode.prototype = Object.create(TW_Node.prototype);
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
- TW_Element.prototype = Object.create(TW_Node.prototype);
70
+ Object.setPrototypeOf(TW_Element,TW_Node.prototype);
71
71
 
72
72
  Object.defineProperty(TW_Element.prototype, "style", {
73
73
  get: function() {