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
@@ -0,0 +1,22 @@
1
+ created: 20190201120100249
2
+ modified: 20190201222600576
3
+ tags:
4
+ title: Do nothing widget demo
5
+ type: text/vnd.tiddlywiki
6
+
7
+ <!-- The innerwiki doesn't refresh on its own when tiddlers on the outside change, so use the list widget to force a dependency -->
8
+ <$list name=refresh filter=[[donothing.js]get[text]]>
9
+ <$innerwiki width="600" height="400" style="width:100%;">
10
+ <$data title="$:/DefaultTiddlers" text="[[do nothing widget]]"/>
11
+ <$data $tiddler=donothing.js/>
12
+ <$data title="do nothing widget" text="""
13
+ ```
14
+ <$donothing/>
15
+ ```
16
+
17
+ Renders as:
18
+
19
+ <$donothing/>
20
+ """/>
21
+ </$innerwiki>
22
+ </$list>
@@ -0,0 +1,25 @@
1
+ created: 20190201232102417
2
+ modified: 20190202145547621
3
+ tags:
4
+ title: Do nothing widget tutorial
5
+ type: text/vnd.tiddlywiki
6
+
7
+ In order to define a widget in a tiddler, the tiddler must satisfy these requirements:
8
+
9
+ * type field is application/javascript
10
+ * module-type field is widget
11
+ * the text field contains the javascript code
12
+
13
+ The [[donothing.js]] tiddler fulfills the requirements and its code looks like this:
14
+ {{donothing.js}}
15
+ That code does 2 key things:
16
+
17
+ * Imports the core Widget class ([[$:/core/modules/widgets/widget.js]])
18
+ * exports the class in an attribute with the name we want our widget to have (`donothing`)
19
+
20
+ Here's what it looks like:
21
+ {{Do nothing widget demo}}
22
+ And it worked. No error message this time.
23
+
24
+ ''Exercise'': Modify [[donothing.js]] and [[Do nothing widget demo]] so the widget is named `noop` instead of `donothing`
25
+
@@ -0,0 +1,23 @@
1
+ created: 20190201114718313
2
+ modified: 20190201231556294
3
+ tags:
4
+ title: Hello World demo
5
+ type: text/vnd.tiddlywiki
6
+
7
+ <!-- The innerwiki doesn't refresh on its own when tiddlers on the outside change, so use the list widget to force a dependency -->
8
+ <$list name=refresh filter=[[hello.js]get[text]]>
9
+ <$innerwiki width="600" height="400" style="width:100%;">
10
+ <$data title="$:/DefaultTiddlers" text="[[hello world widget]]"/>
11
+ <$data $tiddler=hello.js/>
12
+ <$data title="hello world widget" text="""
13
+ ```
14
+ <$hello/>
15
+ ```
16
+
17
+ Renders as:
18
+
19
+ <$hello/>
20
+ """/>
21
+
22
+ </$innerwiki>
23
+ </$list>
@@ -0,0 +1,18 @@
1
+ created: 20190201232200698
2
+ modified: 20190216175629825
3
+ tags:
4
+ title: Hello World widget tutorial
5
+ type: text/vnd.tiddlywiki
6
+
7
+ Now let's create a widget which actually has output.
8
+
9
+ When tiddlywiki encounters a widget definition like `<$hello>` it will create an object which is an instance of the class which is exported by the widget code.
10
+
11
+ In addition to creating an instance of the class, tiddlywiki will call the render method of the resulting object. The render method is expected to create a dom node which will be display in place of the widget.
12
+
13
+ In the `donothing` example the core widget was exported. The core widget class doesn't have a render method which creates a dom node and that's why there is no output. Getting output requires writing a widget class which inherits from the core `Widget` class. Code in the render method of this class will display the hello world message.
14
+
15
+ The [[hello.js]] tiddler has code which accomplishes that:
16
+ {{hello.js}}
17
+ The code for importing the core widget class remains, but now we also have code to create our own class which inherits from it. In addition an implementation of the `render` method is included. Here is the result:
18
+ {{Hello World demo}}
@@ -0,0 +1,37 @@
1
+ created: 20190202035524804
2
+ modified: 20221029161501848
3
+ tags:
4
+ title: Javascript Widget Tutorial
5
+ type: text/vnd.tiddlywiki
6
+
7
+ ! Introduction
8
+ This tutorial provides step-by-step, interactive examples of how to write code for tiddlywiki widgets. The demo javascript code can be modified without having to reload the entire wiki.
9
+
10
+ Intended audience:
11
+
12
+ # Those who know tiddlywiki well and know programming and javascript and want to write their own widget. I don't make any effort to explain javascript here. For that you will need other resources.
13
+ # Those who know tiddlywiki well and don't know javascript, but want to understand more about how tiddlywiki works. You should be able to skim through and interact with the demos and learn something.
14
+
15
+ !The tutorial
16
+ *[[Undefined widget tutorial]]
17
+ *[[Do nothing widget tutorial]]
18
+ *[[Hello World widget tutorial]]
19
+ *[[Widget refresh tutorial part I]]
20
+ *[[Widget refresh tutorial part II]]
21
+ *[[Widget refresh tutorial part III]]
22
+ *[[Widget attributes tutorial part I]]
23
+ *[[Widget attributes tutorial part II]]
24
+ *[[Child widgets tutorial]]
25
+
26
+ ! Notes
27
+
28
+ tiddlywiki doesn't support dynamically reloading javascript. If you change a javascript tiddler, then you need to save and reload the wiki before the changes will take affect.
29
+
30
+ To avoid the need for such reloads, the excellent [[innerwiki plugin|https://tiddlywiki.com/prerelease/plugins/tiddlywiki/innerwiki/]] is used. This allows an inner wiki to be created from a subset of tiddlers in the outer wiki. Each time the inner wiki is refreshed, its entire wiki is reloaded and the javascript changes in the inner wiki will take affect.
31
+
32
+ Without the need for reloads, a tiddlywiki instance with the [[innerwiki plugin|https://tiddlywiki.com/prerelease/plugins/tiddlywiki/innerwiki/]] installed works great as a playground for interacting with tiddlywiki javascript.
33
+
34
+ ! Other documentation on writing TW widgets
35
+
36
+ *WidgetModules
37
+ *[[Widgets]]
@@ -0,0 +1,18 @@
1
+ created: 20190201212238781
2
+ modified: 20190201213112748
3
+ tags:
4
+ title: Undefined widget demo
5
+ type: text/vnd.tiddlywiki
6
+
7
+ <$innerwiki width="600" height="400" style="width:100%;">
8
+ <$data title="$:/DefaultTiddlers" text="[[Undefined widget]]"/>
9
+ <$data title="Undefined widget" text="""
10
+ ```
11
+ <$donothing/>
12
+ ```
13
+
14
+ Renders as:
15
+
16
+ <$donothing/>
17
+ """/>
18
+ </$innerwiki>
@@ -0,0 +1,11 @@
1
+ created: 20190201232001970
2
+ modified: 20190202145655413
3
+ tags:
4
+ title: Undefined widget tutorial
5
+ type: text/vnd.tiddlywiki
6
+
7
+ Let's start be defining a minimal widget which does nothing. It doesn't support any attributes, no child elements, and it doesn't output anything. The name of the widget will be `donothing`. If it does nothing, then how can we verify after writing the code that we accomplished anything? Well, let's see what happens when an undefined widget is referenced.
8
+
9
+ {{Undefined widget demo}}
10
+
11
+ Since we haven't written the code, the attempt to render the widget gives an undefined widget error. So we will know the donothing code accomplishes something if we don't get the undefined widget error when rendering.
@@ -0,0 +1,48 @@
1
+ created: 20190204020507195
2
+ modified: 20190204031520013
3
+ tags:
4
+ title: Widget attributes demo I
5
+ type: text/vnd.tiddlywiki
6
+
7
+ <!-- The innerwiki doesn't refresh on its own when tiddlers on the outside change, so use the list widget to force a dependency -->
8
+ <$list name=refresh filter=[[hello-attribute.js]get[text]]>
9
+ <$innerwiki width="600" height="400" style="width:100%;">
10
+ <$data title="$:/DefaultTiddlers" text="[[hello world widget]]"/>
11
+ <$data $tiddler=hello-attribute.js/>
12
+ <$data title="hello world widget" text="""
13
+ ```
14
+ <$hello/>
15
+ ```
16
+
17
+ Renders as:
18
+
19
+ <$hello/>
20
+
21
+ ---
22
+
23
+ ```
24
+ <$hello message="pale blue dot"/>
25
+ ```
26
+
27
+ Renders as:
28
+
29
+ <$hello message="pale blue dot"/>
30
+
31
+ ---
32
+
33
+ <$edit-text focus=yes tiddler=test tag=input/>
34
+
35
+ ```
36
+ <$hello message={{test!!text}}/>
37
+ ```
38
+
39
+ Renders as:
40
+
41
+ <$hello message={{test!!text}}/>
42
+
43
+ """/>
44
+
45
+ <$data title="test" text="Alice"/>
46
+
47
+ </$innerwiki>
48
+ </$list>
@@ -0,0 +1,48 @@
1
+ created: 20190205024953535
2
+ modified: 20190205025028737
3
+ tags:
4
+ title: Widget attributes demo II
5
+ type: text/vnd.tiddlywiki
6
+
7
+ <!-- The innerwiki doesn't refresh on its own when tiddlers on the outside change, so use the list widget to force a dependency -->
8
+ <$list name=refresh filter=[[hello-attribute-optimized.js]get[text]]>
9
+ <$innerwiki width="600" height="400" style="width:100%;">
10
+ <$data title="$:/DefaultTiddlers" text="[[hello world widget]]"/>
11
+ <$data $tiddler=hello-attribute-optimized.js/>
12
+ <$data title="hello world widget" text="""
13
+ ```
14
+ <$hello/>
15
+ ```
16
+
17
+ Renders as:
18
+
19
+ <$hello/>
20
+
21
+ ---
22
+
23
+ ```
24
+ <$hello message="pale blue dot"/>
25
+ ```
26
+
27
+ Renders as:
28
+
29
+ <$hello message="pale blue dot"/>
30
+
31
+ ---
32
+
33
+ <$edit-text focus=yes tiddler=test tag=input/>
34
+
35
+ ```
36
+ <$hello message={{test!!text}}/>
37
+ ```
38
+
39
+ Renders as:
40
+
41
+ <$hello message={{test!!text}}/>
42
+
43
+ """/>
44
+
45
+ <$data title="test" text="Alice"/>
46
+
47
+ </$innerwiki>
48
+ </$list>
@@ -0,0 +1,50 @@
1
+ created: 20190202035425715
2
+ modified: 20190205023518575
3
+ tags:
4
+ title: Widget attributes tutorial part I
5
+ type: text/vnd.tiddlywiki
6
+
7
+ So far none of the widgets we've implemented have had any code for handling widget attributes A vast majority of useful widgets will need to support attributes in order to make them useful.
8
+
9
+ As an example, let's change the Hello World widget so it can greet not just the world, but whoever/whatever the user wants. To do that we can add support for an attribute named `what` and call it like `<$hello what="pale blue dot"/>`.
10
+
11
+ The tiddlywiki widget class provides methods `computeAttributes` and `getAttribute` which can together be used by the widget code to discover what values are passed into the widget.
12
+
13
+ The `computeAttributes` and `getAttribute` methods can be called like this (the second parameter to `getAttribute` will be used as the default value if the user doesn't provide that attribute in the widget call):
14
+
15
+ ```javascript
16
+ this.computeAttributes();
17
+ var message = this.getAttribute("message", "World");
18
+ ```
19
+
20
+ Then the `message` variable can be used to construct the Hello XXX string:
21
+
22
+ ```javascript
23
+ var textNode = this.document.createTextNode("Hello, " + message + "!");
24
+ ```
25
+
26
+ The original [[hello.js]] code only implements a `render` method. The `refresh` method is not needed because the output from the widget can never be different...it will always be "Hello, World!".
27
+
28
+ Even with a `message` attribute, you might think the `render` by itself is enough. After all, the value of the input parameter `message` can only be changed by modifying the wiki text which means the tiddler will be redisplayed from scratch.
29
+
30
+ However, tiddlywiki has a syntax which allows parameter values to vary without modifying the wiki text. See https://tiddlywiki.com/#Widgets%20in%20WikiText for details. As one example, if the widget were called like `<$hello message={{MyTiddler!!field}}/>`, then every time the `field` field of `MyTiddler` were modified, only the `refresh` method would be called. Therefore, in order to get the widget display to update, the refresh method needs to be implemented.
31
+
32
+ If the `computeAttributes` and `getAttribute` calls are placed in the `render` method then we can implement a performance unoptimized version of refresh as was done in [[Widget refresh tutorial part II]]:
33
+
34
+ ```javascript
35
+ /*
36
+ A widget with optimized performance will selectively refresh, but here we refresh always
37
+ */
38
+ MyWidget.prototype.refresh = function(changedTiddlers) {
39
+ // Regenerate and rerender the widget and
40
+ // replace the existing DOM node
41
+ this.refreshSelf();
42
+ return true;
43
+ };
44
+ ```
45
+
46
+ The full code can be seen at [[hello-attribute.js]] and here is the result ([[Widget attributes demo I]]):
47
+
48
+ {{Widget attributes demo I}}
49
+
50
+ The third example above is the only one which requires the refresh method in order to behave properly.
@@ -0,0 +1,33 @@
1
+ created: 20190205023543910
2
+ modified: 20190217012121130
3
+ tags:
4
+ title: Widget attributes tutorial part II
5
+ type: text/vnd.tiddlywiki
6
+
7
+ This example will build on the previous one. The only modification will be to add a check to the `refresh` method. The `refreshSelf` will only be called if a change to the attributes is detected.
8
+
9
+ The `computeAttributes` method returns a Javascript object containing properties for each attribute which has changed. So a check like `if (changedAttributes.attr1 || changedAttributes.attr2 || changedAttributes.attr3)` etc. can be used to detect the change. See the refresh method in [[$:/core/modules/widgets/view.js]] for an example showing the check for multiple attributes.
10
+
11
+ For this example, `message` is the only attribute implemented.
12
+
13
+ ```javascript
14
+ /*
15
+ Refresh if the attribute value changed since render
16
+ */
17
+ MyWidget.prototype.refresh = function(changedTiddlers) {
18
+ // Find which attributes have changed
19
+ var changedAttributes = this.computeAttributes();
20
+ if (changedAttributes.message) {
21
+ this.refreshSelf();
22
+ return true;
23
+ } else {
24
+ return false;
25
+ }
26
+ };
27
+ ```
28
+
29
+ The full code can be seen at [[hello-attribute-optimized.js]] and here is the result ([[Widget attributes demo II]]):
30
+
31
+ {{Widget attributes demo II}}
32
+
33
+ The visible behavior here should be identical to the unoptimized behavior of the previous tutorial.
@@ -0,0 +1,44 @@
1
+ created: 20190201233806976
2
+ modified: 20221029194854112
3
+ tags:
4
+ title: Widget refresh demo I
5
+ type: text/vnd.tiddlywiki
6
+
7
+ <!-- The innerwiki doesn't refresh on its own when tiddlers on the outside change, so use the list widget to force a dependency -->
8
+ <$list name=refresh filter=[[tiddlerfield-norefresh.js]get[text]]>
9
+ <$innerwiki width="600" height="400" style="width:100%;">
10
+ <$data title="$:/DefaultTiddlers" text="[[tiddler field widget]]"/>
11
+ <$data title="test" text="type new text here"/>
12
+ <$data $tiddler=tiddlerfield-norefresh.js/>
13
+ <$data title="tiddler field widget" text="""
14
+ <$edit-text focus=yes tiddler=test tag=input/>
15
+ <$button set="!!refresh" setTo={{test}}>Force refresh</$button>
16
+ <$list filter="[{!!refresh}]">
17
+
18
+ <div>
19
+ <div style="display:inline-block;width: 49%;vertical-align: text-top;word-wrap: break-word;}">
20
+
21
+ ```
22
+ <$tiddlerfield/>
23
+ ```
24
+
25
+ Renders as:
26
+
27
+ <$tiddlerfield/>
28
+ </div>
29
+ <div style="display:inline-block;width: 49%;vertical-align: text-top;word-wrap: break-word;}">
30
+
31
+ ```
32
+ <$view tiddler="test"/>
33
+ ```
34
+
35
+ Renders as:
36
+
37
+ <$view tiddler="test"/>
38
+ </div>
39
+ </div>
40
+ </$list>
41
+ """/>
42
+
43
+ </$innerwiki>
44
+ </$list>
@@ -0,0 +1,40 @@
1
+ created: 20190202032354223
2
+ modified: 20190217005540498
3
+ tags:
4
+ title: Widget refresh demo II
5
+ type: text/vnd.tiddlywiki
6
+
7
+ <!-- The innerwiki doesn't refresh on its own when tiddlers on the outside change, so use the list widget to force a dependency -->
8
+ <$list name=refresh filter=[[tiddlerfield.js]get[text]]>
9
+ <$innerwiki width="600" height="400" style="width:100%;">
10
+ <$data title="$:/DefaultTiddlers" text="[[tiddler field widget]]"/>
11
+ <$data title="test" text="type new text here"/>
12
+ <$data $tiddler=tiddlerfield.js/>
13
+ <$data title="tiddler field widget" text="""
14
+ <$edit-text focus=yes tiddler=test tag=input/>
15
+
16
+ <div>
17
+ <div style="display:inline-block;width: 49%;vertical-align: text-top;word-wrap: break-word;}">
18
+
19
+ ```
20
+ <$tiddlerfield/>
21
+ ```
22
+
23
+ Renders as:
24
+
25
+ <$tiddlerfield/>
26
+ </div>
27
+ <div style="display:inline-block;width: 49%;vertical-align: text-top;word-wrap: break-word;}">
28
+
29
+ ```
30
+ <$view tiddler="test"/>
31
+ ```
32
+
33
+ Renders as:
34
+
35
+ <$view tiddler="test"/>
36
+ </div>
37
+ """/>
38
+
39
+ </$innerwiki>
40
+ </$list>
@@ -0,0 +1,50 @@
1
+ created: 20190202122928187
2
+ modified: 20190216191939585
3
+ tags:
4
+ title: Widget refresh demo III
5
+ type: text/vnd.tiddlywiki
6
+
7
+ <!-- The innerwiki doesn't refresh on its own when tiddlers on the outside change, so use the list widget to force a dependency -->
8
+ <$list name=refresh filter=[[refreshcount.js]get[text]]>
9
+ <$innerwiki width="600" height="400" style="width:100%;">
10
+ <$data title="$:/DefaultTiddlers" text="[[refresh count widget]]"/>
11
+ <$data title="test" text="Text field of tiddler='test'"/>
12
+ <$data $tiddler=refreshcount.js/>
13
+ <$data title="refresh count widget" text="""
14
+
15
+ *<$button set="test!!test" setTo="hello">Modify a different tiddler</$button>
16
+ *<$button set="!!test" setTo="hello">Modify this tiddler</$button>
17
+ *<$edit-text focus=yes tiddler=test tag=input/>
18
+
19
+ <div>
20
+ <div style="display:inline-block;width: 49%;vertical-align: text-top;word-wrap: break-word;}">
21
+
22
+ ```
23
+ <$refreshcount/>
24
+ ```
25
+
26
+ Renders as:
27
+
28
+ <$refreshcount/>
29
+ </div>
30
+
31
+ <div style="display:inline-block;width: 49%;vertical-align: text-top;word-wrap: break-word;}">
32
+
33
+ ```
34
+ <$list filter="[[test]get[text]]">
35
+ <<currentTiddler>><br>
36
+ <$refreshcount/>
37
+ </$list>
38
+ ```
39
+
40
+ Renders as:
41
+
42
+ <$list filter="[[test]get[text]]">
43
+ <<currentTiddler>><br>
44
+ <$refreshcount/>
45
+ </$list>
46
+ """/>
47
+ </div>
48
+ </div>
49
+ </$innerwiki>
50
+ </$list>
@@ -0,0 +1,47 @@
1
+ created: 20190201232847949
2
+ modified: 20221029203553291
3
+ tags:
4
+ title: Widget refresh tutorial part I
5
+ type: text/vnd.tiddlywiki
6
+
7
+ But what if we want to display dynamic content? How can we display information and keep it up to date as it changes? Let's display the content of a tiddler field.
8
+
9
+ The [[tiddlerfield-norefresh.js]] which defines the `tiddlerfield` widget is almost the same as [[hello.js]] except for this part:
10
+
11
+ ```javascript
12
+ MyWidget.prototype.render = function(parent,nextSibling) {
13
+ this.parentDomNode = parent;
14
+ var text = this.wiki.getTiddlerText("test", "<empty>")
15
+ var textNode = this.document.createTextNode(text);
16
+ parent.insertBefore(textNode,nextSibling);
17
+ this.domNodes.push(textNode);
18
+ };
19
+ ```
20
+
21
+ Instead of creating the text dom node from a static string, the text field of the `test` tiddler is used. This is similar to using the view widget like this: `<$view tiddler="test"/>`
22
+
23
+ Here's how it looks (see [[Widget refresh demo I]] to look at the code):
24
+
25
+ {{Widget refresh demo I}}
26
+
27
+ Notice if you change the text in the input box, the output from the `tiddlerfield` widget doesn't change, but the output of the `view` widget does. Only after the ''Force refresh'' button is clicked does the output of `tiddlerfield` update to match the input box contents.
28
+
29
+ What's going on here? The render method of the widget code is only called by tiddlywiki core when the widget is first created. After that, it isn't called again unless the widget is completely destroyed and then created again.
30
+
31
+ The tiddlywiki ~ViewWidget has a properly written `refresh` method so typing in the input box will cause its content to update. However, the `tiddlerfield` widget does not have a `refresh` method at all. It has no way of being notified that the `test` tiddler content has changed. Its output will not change until the ''Force refresh'' button is clicked.
32
+
33
+ See the next example for an implementation of the `refresh` method for the `tiddlerfield` widget.
34
+
35
+ The code for the refresh button looks like this:
36
+
37
+ ```
38
+ <$button set="!!refresh" setTo={{test}}>Force refresh</$button>
39
+ ```
40
+
41
+ and the widgets are enclosed in a list widget like this:
42
+
43
+ ```
44
+ <$list filter="[{!!refresh}]">...</$list>
45
+ ```
46
+
47
+ When the button is clicked the field `refresh` in the containing tiddler is modified and it causes the children of the list widget to be created from scratch. The render method is called and the output of the `tiddlerfield` widget updates.
@@ -0,0 +1,37 @@
1
+ created: 20190201232910076
2
+ modified: 20190217014335419
3
+ tags:
4
+ title: Widget refresh tutorial part II
5
+ type: text/vnd.tiddlywiki
6
+
7
+ This example is like [[Widget refresh tutorial part I]] except the widget output will be automatically refreshed when the tiddler field changes.
8
+
9
+ [[tiddlerfield.js]] is the same as [[tiddlerfield-norefresh.js]], except this `refresh` method is added:
10
+
11
+ ```javascript
12
+ /*
13
+ A widget with optimized performance will selectively refresh, but here we refresh always
14
+ */
15
+ MyWidget.prototype.refresh = function(changedTiddlers) {
16
+ // Regenerate and rerender the widget and
17
+ // replace the existing DOM node
18
+ this.refreshSelf();
19
+ return true;
20
+ };
21
+ ```
22
+
23
+ The `refreshSelf` method called above is implemented by the core widget class and it takes care of cleaning the old dom node and calling the render function.
24
+
25
+ Here is the result ([[Widget refresh demo II]]):
26
+
27
+ {{Widget refresh demo II}}
28
+
29
+ And now any typing into the input box will cause both the `tiddlerfield` and the `view` widget output to refresh immediately.
30
+
31
+ Note this is a naive version of `refresh`. It unconditionally refreshes itself. This is far from optimal since the `refresh` method for all visible widgets is called every time the tiddler store changes. But the way we've defined our widget, the output ONLY depends on the tiddler titled `text`.
32
+
33
+ In tiddlywiki the tiddler store is used for everything and almost any interaction will result in an update to the store. This means almost any interaction will cause the refresh method to be called. If you type into the search box, for example, the `tiddlerfield` widget will be refreshed with every keystroke.
34
+
35
+ Adding and removing dom elements is a relatively expensive operation, so if someone has used the list widget to create a few hundred instances of this widget, then such tiddlywiki interactions might gain a noticable lag. Therefore, it usually makes sense to avoid modifying the dom when possible by writing a smarter `refresh` method.
36
+
37
+ ''Exercise'' - change the refresh method above to only call `refreshSelf` when the `changedTiddlers` input array contains `test` as one of its entries (Hint: see the refresh method in $:/core/modules/widgets/view.js for an example).
@@ -0,0 +1,26 @@
1
+ created: 20190202034841184
2
+ modified: 20221029201023638
3
+ tags:
4
+ title: Widget refresh tutorial part III
5
+ type: text/vnd.tiddlywiki
6
+
7
+ This tutorial is intended to demonstrate a few examples of when calls to the `refresh` method happen vs. when a widget is recreated from scratch.
8
+
9
+ This is accomplished with a [[refreshcount.js]] widget which sets a counter to zero when the widget is created and increments the counter every time the `refresh` method is called. Here is the full code:
10
+
11
+ {{refreshcount.js}}
12
+
13
+ These are the key parts of the code from above:
14
+
15
+ ```javascript
16
+ this.refreshCount = 0;
17
+ this.document.createTextNode(this.refreshCount + " refreshes");
18
+ this.refreshCount++;
19
+ ```
20
+
21
+ In the following example (see [[Widget refresh demo III]] for the code), two instances of the `refreshcount` widget are created. One at the top level and the other inside a list widget whose filter results depend on the value in the `text` field of the `test` widget. The tiddler store can be modified in a few ways via two buttons and an input box:
22
+ {{Widget refresh demo III}}
23
+
24
+ * ''Modify a different tiddler'' - every time this button is clicked, both counters increment, indicating the `refresh` method is being called
25
+ * ''Modify this tiddler'' - clicking this button modifies the tiddler itself. In earlier ~TiddlyWiki versions that caused both widgets to be recreated from scratch and the counters are thereby reset to zero. Since [[version 5.2.0|https://tiddlywiki.com/#Release%205.2.0]] modifying another field in this tiddler does not cause the widgets to be recreated and the counters are not reset.
26
+ * ''Text field of tiddler='test''' - typing text into the input box causes the counter in the standalone `refreshcount` widget to be incremented. But the other instance of the widget is embedded inside a list widget whose filter output depends on the value of the tiddler field which is being modified. This causes it to recreate its children from scratch and the counter is reset every time. So with every keystroke, the counter on the left is incremented, but the counter on the right goes to/stays at zero.
@@ -0,0 +1,47 @@
1
+ /*\
2
+
3
+ Library function for creating widget using a dom creating function
4
+
5
+ \*/
6
+ (function() {
7
+
8
+ /*jslint node: true, browser: true */
9
+ /*global $tw: false */
10
+ "use strict";
11
+
12
+ var Widget = require("$:/core/modules/widgets/widget.js").widget;
13
+
14
+ function createDomWidget(domCreatorFunction) {
15
+
16
+ var MyWidget = function(parseTreeNode, options) {
17
+ this.initialise(parseTreeNode, options);
18
+ };
19
+
20
+ /*
21
+ Inherit from the base widget class
22
+ */
23
+ MyWidget.prototype = new Widget();
24
+
25
+ /*
26
+ Render this widget into the DOM
27
+ */
28
+ MyWidget.prototype.render = function(parent, nextSibling) {
29
+ this.parentDomNode = parent;
30
+ var domNode = domCreatorFunction(this.document);
31
+ parent.insertBefore(domNode, nextSibling);
32
+ this.domNodes.push(domNode);
33
+ };
34
+
35
+ /*
36
+ A widget with optimized performance will selectively refresh, but here we refresh always
37
+ */
38
+ MyWidget.prototype.refresh = function(changedTiddlers) {
39
+ // Regenerate and rerender the widget and replace the existing DOM node
40
+ this.refreshSelf();
41
+ return true;
42
+ };
43
+
44
+ return MyWidget;
45
+ }
46
+ module.exports = createDomWidget;
47
+ })();
@@ -0,0 +1,6 @@
1
+ created: 20190201025244440
2
+ modified: 20190201030708723
3
+ module-type: library
4
+ tags:
5
+ title: domwidget.js
6
+ type: application/javascript