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
@@ -15,10 +15,11 @@ function LinkedList() {
15
15
 
16
16
  LinkedList.prototype.clear = function() {
17
17
  // LinkedList performs the duty of both the head and tail node
18
- this.next = Object.create(null);
19
- this.prev = Object.create(null);
20
- this.first = undefined;
21
- this.last = undefined;
18
+ this.next = new LLMap();
19
+ this.prev = new LLMap();
20
+ // Linked list head initially points to itself
21
+ this.next.set(null, null);
22
+ this.prev.set(null, null);
22
23
  this.length = 0;
23
24
  };
24
25
 
@@ -41,28 +42,29 @@ Push behaves like array.push and accepts multiple string arguments. But it also
41
42
  accepts a single array argument too, to be consistent with its other methods.
42
43
  */
43
44
  LinkedList.prototype.push = function(/* values */) {
44
- var values = arguments;
45
+ var i, values = arguments;
45
46
  if($tw.utils.isArray(values[0])) {
46
47
  values = values[0];
47
48
  }
48
- for(var i = 0; i < values.length; i++) {
49
+ for(i = 0; i < values.length; i++) {
49
50
  _assertString(values[i]);
50
51
  }
51
- for(var i = 0; i < values.length; i++) {
52
+ for(i = 0; i < values.length; i++) {
52
53
  _linkToEnd(this,values[i]);
53
54
  }
54
55
  return this.length;
55
56
  };
56
57
 
57
58
  LinkedList.prototype.pushTop = function(value) {
59
+ var t;
58
60
  if($tw.utils.isArray(value)) {
59
- for (var t=0; t<value.length; t++) {
61
+ for (t=0; t<value.length; t++) {
60
62
  _assertString(value[t]);
61
63
  }
62
- for(var t=0; t<value.length; t++) {
64
+ for(t=0; t<value.length; t++) {
63
65
  _removeOne(this,value[t]);
64
66
  }
65
- for(var t=0; t<value.length; t++) {
67
+ for(t=0; t<value.length; t++) {
66
68
  _linkToEnd(this,value[t]);
67
69
  }
68
70
  } else {
@@ -74,11 +76,11 @@ LinkedList.prototype.pushTop = function(value) {
74
76
 
75
77
  LinkedList.prototype.each = function(callback) {
76
78
  var visits = Object.create(null),
77
- value = this.first;
78
- while(value !== undefined) {
79
+ value = this.next.get(null);
80
+ while(value !== null) {
79
81
  callback(value);
80
- var next = this.next[value];
81
- if(typeof next === "object") {
82
+ var next = this.next.get(value);
83
+ if(Array.isArray(next)) {
82
84
  var i = visits[value] || 0;
83
85
  visits[value] = i+1;
84
86
  value = next[i];
@@ -105,91 +107,79 @@ LinkedList.prototype.makeTiddlerIterator = function(wiki) {
105
107
  };
106
108
 
107
109
  function _removeOne(list,value) {
108
- var prevEntry = list.prev[value],
109
- nextEntry = list.next[value],
110
+ var nextEntry = list.next.get(value);
111
+ if(nextEntry === undefined) {
112
+ return;
113
+ }
114
+ var prevEntry = list.prev.get(value),
110
115
  prev = prevEntry,
111
- next = nextEntry;
112
- if(typeof nextEntry === "object") {
116
+ next = nextEntry,
117
+ ref;
118
+ if(Array.isArray(nextEntry)) {
113
119
  next = nextEntry[0];
114
120
  prev = prevEntry[0];
115
121
  }
116
122
  // Relink preceding element.
117
- if(list.first === value) {
118
- list.first = next
119
- } else if(prev !== undefined) {
120
- if(typeof list.next[prev] === "object") {
121
- if(next === undefined) {
122
- // Must have been last, and 'i' would be last element.
123
- list.next[prev].pop();
124
- } else {
125
- var i = list.next[prev].indexOf(value);
126
- list.next[prev][i] = next;
127
- }
128
- } else {
129
- list.next[prev] = next;
130
- }
123
+ ref = list.next.get(prev);
124
+ if(Array.isArray(ref)) {
125
+ var i = ref.indexOf(value);
126
+ ref[i] = next;
131
127
  } else {
132
- return;
128
+ list.next.set(prev,next);
133
129
  }
130
+
134
131
  // Now relink following element
135
- // Check "next !== undefined" rather than "list.last === value" because
136
- // we need to know if the FIRST value is the last in the list, not the last.
137
- if(next !== undefined) {
138
- if(typeof list.prev[next] === "object") {
139
- if(prev === undefined) {
140
- // Must have been first, and 'i' would be 0.
141
- list.prev[next].shift();
142
- } else {
143
- var i = list.prev[next].indexOf(value);
144
- list.prev[next][i] = prev;
145
- }
146
- } else {
147
- list.prev[next] = prev;
148
- }
132
+ ref = list.prev.get(next);
133
+ if(Array.isArray(ref)) {
134
+ var i = ref.indexOf(value);
135
+ ref[i] = prev;
149
136
  } else {
150
- list.last = prev;
137
+ list.prev.set(next,prev);
151
138
  }
139
+
152
140
  // Delink actual value. If it uses arrays, just remove first entries.
153
- if(typeof nextEntry === "object") {
141
+ if(Array.isArray(nextEntry) && nextEntry.length > 1) {
154
142
  nextEntry.shift();
155
143
  prevEntry.shift();
156
144
  } else {
157
- list.next[value] = undefined;
158
- list.prev[value] = undefined;
145
+ list.next.set(value,undefined);
146
+ list.prev.set(value,undefined);
159
147
  }
160
148
  list.length -= 1;
161
149
  };
162
150
 
163
151
  // Sticks the given node onto the end of the list.
164
152
  function _linkToEnd(list,value) {
165
- if(list.first === undefined) {
166
- list.first = value;
167
- } else {
168
- // Does it already exists?
169
- if(list.first === value || list.prev[value] !== undefined) {
170
- if(typeof list.next[value] === "string") {
171
- list.next[value] = [list.next[value]];
172
- list.prev[value] = [list.prev[value]];
173
- } else if(typeof list.next[value] === "undefined") {
174
- // list.next[value] must be undefined.
175
- // Special case. List already has 1 value. It's at the end.
176
- list.next[value] = [];
177
- list.prev[value] = [list.prev[value]];
178
- }
179
- list.prev[value].push(list.last);
180
- // We do NOT append a new value onto "next" list. Iteration will
181
- // figure out it must point to End-of-List on its own.
182
- } else {
183
- list.prev[value] = list.last;
153
+ var old = list.next.get(value);
154
+ var last = list.prev.get(null);
155
+ // Does it already exists?
156
+ if(old !== undefined) {
157
+ if(!Array.isArray(old)) {
158
+ old = [old];
159
+ list.next.set(value,old);
160
+ list.prev.set(value,[list.prev.get(value)]);
184
161
  }
185
- // Make the old last point to this new one.
186
- if(typeof list.next[list.last] === "object") {
187
- list.next[list.last].push(value);
162
+ old.push(null);
163
+ list.prev.get(value).push(last);
164
+ } else {
165
+ list.next.set(value,null);
166
+ list.prev.set(value,last);
167
+ }
168
+ // Make the old last point to this new one.
169
+ if(value !== last) {
170
+ var array = list.next.get(last);
171
+ if(Array.isArray(array)) {
172
+ array[array.length-1] = value;
188
173
  } else {
189
- list.next[list.last] = value;
174
+ list.next.set(last,value);
190
175
  }
176
+ list.prev.set(null,value);
177
+ } else {
178
+ // Edge case, the pushed value was already the last value.
179
+ // The second-to-last nextPtr for that value must point to itself now.
180
+ var array = list.next.get(last);
181
+ array[array.length-2] = value;
191
182
  }
192
- list.last = value;
193
183
  list.length += 1;
194
184
  };
195
185
 
@@ -199,6 +189,20 @@ function _assertString(value) {
199
189
  }
200
190
  };
201
191
 
192
+ var LLMap = function() {
193
+ this.map = Object.create(null);
194
+ };
195
+
196
+ // Just a wrapper so our object map can also accept null.
197
+ LLMap.prototype = {
198
+ set: function(key,val) {
199
+ (key === null) ? (this.null = val) : (this.map[key] = val);
200
+ },
201
+ get: function(key) {
202
+ return (key === null) ? this.null : this.map[key];
203
+ }
204
+ };
205
+
202
206
  exports.LinkedList = LinkedList;
203
207
 
204
208
  })();
@@ -48,7 +48,9 @@ Logger.prototype.log = function(/* args */) {
48
48
  this.saveBufferLogger.buffer = this.saveBufferLogger.buffer.slice(-this.saveBufferLogger.saveLimit);
49
49
  }
50
50
  if(console !== undefined && console.log !== undefined) {
51
- return Function.apply.call(console.log, console, [$tw.utils.terminalColour(this.colour),this.componentName + ":"].concat(Array.prototype.slice.call(arguments,0)).concat($tw.utils.terminalColour()));
51
+ var logMessage = [$tw.utils.terminalColour(this.colour) + this.componentName + ":"].concat(Array.prototype.slice.call(arguments,0));
52
+ logMessage[logMessage.length-1] += $tw.utils.terminalColour();
53
+ return Function.apply.call(console.log, console, logMessage);
52
54
  }
53
55
  }
54
56
  };
@@ -12,12 +12,26 @@ Parse tree utility functions.
12
12
  /*global $tw: false */
13
13
  "use strict";
14
14
 
15
+ /*
16
+ Add attribute to parse tree node
17
+ Can be invoked as (node,name,value) or (node,attr)
18
+ */
15
19
  exports.addAttributeToParseTreeNode = function(node,name,value) {
16
- var attribute = {name: name, type: "string", value: value};
20
+ var attribute = typeof name === "object" ? name : {name: name, type: "string", value: value};
21
+ name = attribute.name;
17
22
  node.attributes = node.attributes || {};
23
+ node.orderedAttributes = node.orderedAttributes || [];
18
24
  node.attributes[name] = attribute;
19
- if(node.orderedAttributes) {
25
+ var foundIndex = -1;
26
+ $tw.utils.each(node.orderedAttributes,function(attr,index) {
27
+ if(attr.name === name) {
28
+ foundIndex = index;
29
+ }
30
+ });
31
+ if(foundIndex === -1) {
20
32
  node.orderedAttributes.push(attribute);
33
+ } else {
34
+ node.orderedAttributes[foundIndex] = attribute;
21
35
  }
22
36
  };
23
37
 
@@ -51,10 +65,8 @@ exports.addClassToParseTreeNode = function(node,classString) {
51
65
  // If the class attribute does not exist, we must create it first.
52
66
  attribute = {name: "class", type: "string", value: ""};
53
67
  node.attributes["class"] = attribute;
54
- if(node.orderedAttributes) {
55
- // If there are orderedAttributes, we've got to add them there too.
56
- node.orderedAttributes.push(attribute);
57
- }
68
+ node.orderedAttributes = node.orderedAttributes || [];
69
+ node.orderedAttributes.push(attribute);
58
70
  }
59
71
  if(attribute.type === "string") {
60
72
  if(attribute.value !== "") {
@@ -74,10 +86,8 @@ exports.addStyleToParseTreeNode = function(node,name,value) {
74
86
  if(!attribute) {
75
87
  attribute = {name: "style", type: "string", value: ""};
76
88
  node.attributes.style = attribute;
77
- if(node.orderedAttributes) {
78
- // If there are orderedAttributes, we've got to add them there too.
79
- node.orderedAttributes.push(attribute);
80
- }
89
+ node.orderedAttributes = node.orderedAttributes || [];
90
+ node.orderedAttributes.push(attribute);
81
91
  }
82
92
  if(attribute.type === "string") {
83
93
  attribute.value += name + ":" + value + ";";
@@ -354,6 +354,9 @@ exports.formatDateString = function(date,template) {
354
354
  var result = "",
355
355
  t = template,
356
356
  matches = [
357
+ [/^TIMESTAMP/, function() {
358
+ return date.getTime();
359
+ }],
357
360
  [/^0hh12/, function() {
358
361
  return $tw.utils.pad($tw.utils.getHours12(date));
359
362
  }],
@@ -36,7 +36,7 @@ Compute the internal state of the widget
36
36
  */
37
37
  DeleteFieldWidget.prototype.execute = function() {
38
38
  this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
39
- this.actionField = this.getAttribute("$field");
39
+ this.actionField = this.getAttribute("$field",null);
40
40
  };
41
41
 
42
42
  /*
@@ -59,7 +59,7 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
59
59
  tiddler = this.wiki.getTiddler(self.actionTiddler),
60
60
  removeFields = {},
61
61
  hasChanged = false;
62
- if(this.actionField && tiddler) {
62
+ if((this.actionField !== null) && tiddler) {
63
63
  removeFields[this.actionField] = undefined;
64
64
  if(this.actionField in tiddler.fields) {
65
65
  hasChanged = true;
@@ -14,6 +14,8 @@ Action widget to trigger a popup.
14
14
 
15
15
  var Widget = require("$:/core/modules/widgets/widget.js").widget;
16
16
 
17
+ var Popup = require("$:/core/modules/utils/dom/popup.js");
18
+
17
19
  var ActionPopupWidget = function(parseTreeNode,options) {
18
20
  this.initialise(parseTreeNode,options);
19
21
  };
@@ -57,20 +59,20 @@ Invoke the action associated with this widget
57
59
  */
58
60
  ActionPopupWidget.prototype.invokeAction = function(triggeringWidget,event) {
59
61
  // Trigger the popup
60
- var popupLocationRegExp = /^\((-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+),(-?[0-9\.E]+)\)$/,
61
- match = popupLocationRegExp.exec(this.actionCoords || "");
62
- if(match) {
62
+ var coordinates = Popup.parseCoordinates(this.actionCoords || "");
63
+ if(coordinates) {
63
64
  $tw.popup.triggerPopup({
64
65
  domNode: null,
65
66
  domNodeRect: {
66
- left: parseFloat(match[1]),
67
- top: parseFloat(match[2]),
68
- width: parseFloat(match[3]),
69
- height: parseFloat(match[4])
67
+ left: coordinates.left,
68
+ top: coordinates.top,
69
+ width: coordinates.width,
70
+ height: coordinates.height
70
71
  },
71
72
  title: this.actionState,
72
73
  wiki: this.wiki,
73
- floating: this.floating
74
+ floating: this.floating,
75
+ absolute: coordinates.absolute
74
76
  });
75
77
  } else {
76
78
  $tw.popup.cancel(0);
@@ -14,6 +14,8 @@ Button widget
14
14
 
15
15
  var Widget = require("$:/core/modules/widgets/widget.js").widget;
16
16
 
17
+ var Popup = require("$:/core/modules/utils/dom/popup.js");
18
+
17
19
  var ButtonWidget = function(parseTreeNode,options) {
18
20
  this.initialise(parseTreeNode,options);
19
21
  };
@@ -147,7 +149,7 @@ ButtonWidget.prototype.isSelected = function() {
147
149
 
148
150
  ButtonWidget.prototype.isPoppedUp = function() {
149
151
  var tiddler = this.popupTitle ? this.wiki.getTiddler(this.popupTitle) : this.wiki.getTiddler(this.popup);
150
- var result = tiddler && tiddler.fields.text ? $tw.popup.readPopupState(tiddler.fields.text) : false;
152
+ var result = tiddler && tiddler.fields.text ? Popup.readPopupState(tiddler.fields.text) : false;
151
153
  return result;
152
154
  };
153
155
 
@@ -173,6 +175,7 @@ ButtonWidget.prototype.triggerPopup = function(event) {
173
175
  if(this.popupTitle) {
174
176
  $tw.popup.triggerPopup({
175
177
  domNode: this.domNodes[0],
178
+ absolute: (this.popupAbsCoords === "yes"),
176
179
  title: this.popupTitle,
177
180
  wiki: this.wiki,
178
181
  noStateReference: true
@@ -180,6 +183,7 @@ ButtonWidget.prototype.triggerPopup = function(event) {
180
183
  } else {
181
184
  $tw.popup.triggerPopup({
182
185
  domNode: this.domNodes[0],
186
+ absolute: (this.popupAbsCoords === "yes"),
183
187
  title: this.popup,
184
188
  wiki: this.wiki
185
189
  });
@@ -223,6 +227,7 @@ ButtonWidget.prototype.execute = function() {
223
227
  this.setField = this.getAttribute("setField");
224
228
  this.setIndex = this.getAttribute("setIndex");
225
229
  this.popupTitle = this.getAttribute("popupTitle");
230
+ this.popupAbsCoords = this.getAttribute("popupAbsCoords", "no");
226
231
  this.tabIndex = this.getAttribute("tabindex");
227
232
  this.isDisabled = this.getAttribute("disabled","no");
228
233
  // Make child widgets
@@ -252,7 +257,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
252
257
  */
253
258
  ButtonWidget.prototype.refresh = function(changedTiddlers) {
254
259
  var changedAttributes = this.computeAttributes();
255
- if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled || changedAttributes["default"]) {
260
+ if(changedAttributes.actions || changedAttributes.to || changedAttributes.message || changedAttributes.param || changedAttributes.set || changedAttributes.setTo || changedAttributes.popup || changedAttributes.hover || changedAttributes.selectedClass || changedAttributes.style || changedAttributes.dragFilter || changedAttributes.dragTiddler || (this.set && changedTiddlers[this.set]) || (this.popup && changedTiddlers[this.popup]) || (this.popupTitle && changedTiddlers[this.popupTitle]) || changedAttributes.popupAbsCoords || changedAttributes.setTitle || changedAttributes.setField || changedAttributes.setIndex || changedAttributes.popupTitle || changedAttributes.disabled || changedAttributes["default"]) {
256
261
  this.refreshSelf();
257
262
  return true;
258
263
  } else if(changedAttributes["class"]) {
@@ -66,14 +66,14 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) {
66
66
  CheckboxWidget.prototype.getValue = function() {
67
67
  var tiddler = this.wiki.getTiddler(this.checkboxTitle);
68
68
  if(tiddler || this.checkboxFilter) {
69
- if(this.checkboxTag) {
69
+ if(tiddler && this.checkboxTag) {
70
70
  if(this.checkboxInvertTag === "yes") {
71
71
  return !tiddler.hasTag(this.checkboxTag);
72
72
  } else {
73
73
  return tiddler.hasTag(this.checkboxTag);
74
74
  }
75
75
  }
76
- if(this.checkboxField || this.checkboxIndex) {
76
+ if(tiddler && (this.checkboxField || this.checkboxIndex)) {
77
77
  // Same logic applies to fields and indexes
78
78
  var value;
79
79
  if(this.checkboxField) {
@@ -206,11 +206,18 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
206
206
  }
207
207
  // Set the list field (or index) if specified
208
208
  if(this.checkboxListField || this.checkboxListIndex) {
209
- var listContents, oldPos, newPos;
209
+ var fieldContents, listContents, oldPos, newPos;
210
210
  if(this.checkboxListField) {
211
- listContents = tiddler.getFieldList(this.checkboxListField);
211
+ fieldContents = tiddler ? tiddler.fields[this.checkboxListField] : undefined;
212
+ } else {
213
+ fieldContents = this.wiki.extractTiddlerDataItem(this.checkboxTitle,this.checkboxListIndex);
214
+ }
215
+ if($tw.utils.isArray(fieldContents)) {
216
+ // Make a copy so we can modify it without changing original that's refrenced elsewhere
217
+ listContents = fieldContents.slice(0);
212
218
  } else {
213
- listContents = $tw.utils.parseStringArray(this.wiki.extractTiddlerDataItem(this.checkboxTitle,this.checkboxListIndex) || "") || [];
219
+ listContents = $tw.utils.parseStringArray(fieldContents) || [];
220
+ // No need to copy since parseStringArray returns a fresh array, not refrenced elsewhere
214
221
  }
215
222
  oldPos = notValue ? listContents.indexOf(notValue) : -1;
216
223
  newPos = value ? listContents.indexOf(value) : -1;
@@ -0,0 +1,63 @@
1
+ /*\
2
+ title: $:/core/modules/widgets/error.js
3
+ type: application/javascript
4
+ module-type: widget
5
+
6
+ Error widget
7
+
8
+ \*/
9
+ (function(){
10
+
11
+ /*jslint node: true, browser: true */
12
+ /*global $tw: false */
13
+ "use strict";
14
+
15
+ var Widget = require("$:/core/modules/widgets/widget.js").widget;
16
+
17
+ var ErrorWidget = function(parseTreeNode,options) {
18
+ this.initialise(parseTreeNode,options);
19
+ };
20
+
21
+ /*
22
+ Inherit from the base widget class
23
+ */
24
+ ErrorWidget.prototype = new Widget();
25
+
26
+ /*
27
+ Render this widget into the DOM
28
+ */
29
+ ErrorWidget.prototype.render = function(parent,nextSibling) {
30
+ this.parentDomNode = parent;
31
+ this.computeAttributes();
32
+ this.execute();
33
+ var message = this.getAttribute("$message","Unknown error"),
34
+ domNode = this.document.createElement("span");
35
+ domNode.appendChild(this.document.createTextNode(message));
36
+ domNode.className = "tc-error";
37
+ parent.insertBefore(domNode,nextSibling);
38
+ this.domNodes.push(domNode);
39
+ };
40
+
41
+ /*
42
+ Compute the internal state of the widget
43
+ */
44
+ ErrorWidget.prototype.execute = function() {
45
+ // Nothing to do for a text node
46
+ };
47
+
48
+ /*
49
+ Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
50
+ */
51
+ ErrorWidget.prototype.refresh = function(changedTiddlers) {
52
+ var changedAttributes = this.computeAttributes();
53
+ if(changedAttributes["$message"]) {
54
+ this.refreshSelf();
55
+ return true;
56
+ } else {
57
+ return false;
58
+ }
59
+ };
60
+
61
+ exports.error = ErrorWidget;
62
+
63
+ })();
@@ -0,0 +1,108 @@
1
+ /*\
2
+ title: $:/core/modules/widgets/genesis.js
3
+ type: application/javascript
4
+ module-type: widget
5
+
6
+ Genesis widget for dynamically creating widgets
7
+
8
+ \*/
9
+ (function(){
10
+
11
+ /*jslint node: true, browser: true */
12
+ /*global $tw: false */
13
+ "use strict";
14
+
15
+ var Widget = require("$:/core/modules/widgets/widget.js").widget;
16
+
17
+ var GenesisWidget = function(parseTreeNode,options) {
18
+ this.initialise(parseTreeNode,options);
19
+ };
20
+
21
+ /*
22
+ Inherit from the base widget class
23
+ */
24
+ GenesisWidget.prototype = new Widget();
25
+
26
+ /*
27
+ Render this widget into the DOM
28
+ */
29
+ GenesisWidget.prototype.render = function(parent,nextSibling) {
30
+ this.parentDomNode = parent;
31
+ this.computeAttributes({filterFn: function(name) {
32
+ // Only compute our own attributes which start with a single dollar
33
+ return name.charAt(0) === "$" && name.charAt(1) !== "$";
34
+ }});
35
+ this.execute();
36
+ this.renderChildren(parent,nextSibling);
37
+ };
38
+
39
+ /*
40
+ Compute the internal state of the widget
41
+ */
42
+ GenesisWidget.prototype.execute = function() {
43
+ var self = this;
44
+ // Collect attributes
45
+ this.genesisType = this.getAttribute("$type","element");
46
+ this.genesisRemappable = this.getAttribute("$remappable","yes") === "yes";
47
+ this.genesisNames = this.getAttribute("$names","");
48
+ this.genesisValues = this.getAttribute("$values","");
49
+ // Construct parse tree
50
+ var isElementWidget = this.genesisType.charAt(0) !== "$",
51
+ nodeType = isElementWidget ? "element" : this.genesisType.substr(1),
52
+ nodeTag = isElementWidget ? this.genesisType : undefined;
53
+ var parseTreeNodes = [{
54
+ type: nodeType,
55
+ tag: nodeTag,
56
+ attributes: {},
57
+ orderedAttributes: [],
58
+ children: this.parseTreeNode.children || [],
59
+ isNotRemappable: !this.genesisRemappable
60
+ }];
61
+ // Apply explicit attributes
62
+ $tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(this.parseTreeNode),function(attribute) {
63
+ var name = attribute.name;
64
+ if(name.charAt(0) === "$") {
65
+ if(name.charAt(1) === "$") {
66
+ // Double $$ is changed to a single $
67
+ name = name.substr(1);
68
+ } else {
69
+ // Single dollar is ignored
70
+ return;
71
+ }
72
+ }
73
+ $tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],$tw.utils.extend({},attribute,{name: name}));
74
+ });
75
+ // Apply attributes in $names/$values
76
+ this.attributeNames = [];
77
+ this.attributeValues = [];
78
+ if(this.genesisNames && this.genesisValues) {
79
+ this.attributeNames = this.wiki.filterTiddlers(self.genesisNames,this);
80
+ this.attributeValues = this.wiki.filterTiddlers(self.genesisValues,this);
81
+ $tw.utils.each(this.attributeNames,function(varname,index) {
82
+ $tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],varname,self.attributeValues[index] || "");
83
+ });
84
+ }
85
+ // Construct the child widgets
86
+ this.makeChildWidgets(parseTreeNodes);
87
+ };
88
+
89
+ /*
90
+ Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
91
+ */
92
+ GenesisWidget.prototype.refresh = function(changedTiddlers) {
93
+ var changedAttributes = this.computeAttributes(),
94
+ filterNames = this.getAttribute("$names",""),
95
+ filterValues = this.getAttribute("$values",""),
96
+ attributeNames = this.wiki.filterTiddlers(filterNames,this),
97
+ attributeValues = this.wiki.filterTiddlers(filterValues,this);
98
+ if($tw.utils.count(changedAttributes) > 0 || !$tw.utils.isArrayEqual(this.attributeNames,attributeNames) || !$tw.utils.isArrayEqual(this.attributeValues,attributeValues)) {
99
+ this.refreshSelf();
100
+ return true;
101
+ } else {
102
+ return this.refreshChildren(changedTiddlers);
103
+ }
104
+ };
105
+
106
+ exports.genesis = GenesisWidget;
107
+
108
+ })();
@@ -39,7 +39,10 @@ Compute the internal state of the widget
39
39
  ImportVariablesWidget.prototype.execute = function(tiddlerList) {
40
40
  var widgetPointer = this;
41
41
  // Got to flush all the accumulated variables
42
- this.variables = new this.variablesConstructor();
42
+ this.variables = Object.create(null);
43
+ if(this.parentWidget) {
44
+ Object.setPrototypeOf(this.variables,this.parentWidget.variables);
45
+ }
43
46
  // Get our parameters
44
47
  this.filter = this.getAttribute("filter");
45
48
  // Compute the filter
@@ -53,6 +53,10 @@ KeyboardWidget.prototype.render = function(parent,nextSibling) {
53
53
  };
54
54
 
55
55
  KeyboardWidget.prototype.handleChangeEvent = function(event) {
56
+ if ($tw.keyboardManager.handleKeydownEvent(event, {onlyPriority: true})) {
57
+ return true;
58
+ }
59
+
56
60
  var keyInfo = $tw.keyboardManager.getMatchingKeyDescriptor(event,this.keyInfoArray);
57
61
  if(keyInfo) {
58
62
  var handled = this.invokeActions(this,event);
@@ -51,11 +51,9 @@ LetWidget.prototype.computeAttributes = function() {
51
51
  $tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(this.parseTreeNode),function(attribute) {
52
52
  var value = self.computeAttribute(attribute),
53
53
  name = attribute.name;
54
- if(name.charAt(0) !== "$") {
55
- // Now that it's prepped, we're allowed to look this variable up
56
- // when defining later variables
57
- self.currentValueFor[name] = value;
58
- }
54
+ // Now that it's prepped, we're allowed to look this variable up
55
+ // when defining later variables
56
+ self.currentValueFor[name] = value;
59
57
  });
60
58
  // Run through again, setting variables and looking for differences
61
59
  $tw.utils.each(this.currentValueFor,function(value,name) {