1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-01-22 19:04:38 +00:00

Compare commits

...

275 Commits

Author SHA1 Message Date
jeremy@jermolene.com
243e2980f0 Fix docs date 2022-09-24 14:07:14 +01:00
jeremy@jermolene.com
fb5786dcf0 Fix version number 2022-09-24 14:06:09 +01:00
jeremy@jermolene.com
227a5a0cd0 Initial Commit 2022-09-24 14:02:02 +01:00
jeremy@jermolene.com
dd66fcc759 Merge branch 'tiddlywiki-com' 2022-09-24 11:06:39 +01:00
jeremy@jermolene.com
8ebb9ef442 Typo from a981f8ccfe
Fixes #6955
2022-09-24 10:55:22 +01:00
jeremy@jermolene.com
81ac987484 Optimise variable prototype chain handling
With this improvement and 53d229592d I'm measuring a 10-15% performance improvement between v5.2.3 and master using https://github.com/Jermolene/tiddlywiki-performance-test-rig
2022-09-24 08:28:16 +01:00
jeremy@jermolene.com
0a00da6db9 Optimise fake dom
Object.setPrototypeOf() appears to be significantly faster
2022-09-23 18:09:45 +01:00
jeremy@jermolene.com
53d229592d Optimise wiki.getTiddler() 2022-09-23 18:09:16 +01:00
jeremy@jermolene.com
166a156584 Fix typo: Safe mode should prevent globally disabling parser rules 2022-09-23 18:08:28 +01:00
jeremy@jermolene.com
c5d3d4c26e Disable wiki indexers in safe mode 2022-09-23 18:07:46 +01:00
Robin Munn
51bdf60ee8 Fix bug when using built-in list field as listField parameter to checkbox widget (#6897)
* Fix bug with checkbox widget and `list` field

The `list` field is stored as a list and frozen against modifications,
and getFieldList() returns it directly without creating a copy. So
before we modify it, we need to make a copy so we're not modifying a
frozen list. This bug doesn't manifest with custom fields, which are
stored as strings, only with the built-in `list` field.

* Fix checkboxes referencing non-existent tiddlers

This fixes the "tiddler is undefined" error when a checkbox's listField
property references a tiddler that doesn't (yet) exist.

* Better logic for checkbox listField handling

If the field contains an array, then it's almost certainly referenced
elsewhere and needs a defensive copy made. If it contained a string,
then it's safe to modify without making a defensive copy.
2022-09-22 18:52:55 +01:00
jeremy@jermolene.com
50f54ba6ca Merge branch 'tiddlywiki-com' 2022-09-22 10:34:41 +01:00
jeremy@jermolene.com
1a0ab68dec Complete fix for a981f8ccfe 2022-09-22 10:34:27 +01:00
jeremy@jermolene.com
bb67f96562 Merge branch 'tiddlywiki-com' 2022-09-21 09:32:33 +01:00
jeremy@jermolene.com
a981f8ccfe Partial fix for wikitext example macros
They don't work when the src text contains variable substitution syntax.
2022-09-21 09:32:18 +01:00
白宦成
859d15a446 Signing the CLA (#6951) 2022-09-17 16:52:05 +01:00
Cameron Fischer
debfd42d51 Log message not to have spaces and <empty string> (#6947) 2022-09-15 12:10:33 +01:00
twMat
fe365354d0 [doc] Update WidgetMessage: tm-new-tiddler (#6945)
...
2022-09-13 17:20:28 +01:00
jeremy@jermolene.com
d825f1c875 Use view template body cascade for the default preview 2022-09-10 11:01:29 +01:00
jeremy@jermolene.com
fe74a776e9 Docs: Add note for retrieving system tiddlers via HTTP under Node.js
See #6866
2022-09-09 10:02:26 +01:00
Roma Hicks
93e1a632b8 Updated URL to new public site. (#6496) 2022-09-05 18:04:47 +01:00
jeremy@jermolene.com
9b7edfc1a7 Revert changes to parse tree preview
This implementation requires #6666
2022-09-03 10:55:15 +01:00
jeremy@jermolene.com
3b2c64a85b Update release note 2022-09-02 21:28:32 +01:00
Jeremy Ruston
35b9faaa89 JSON Filter Operators (Revised Attempt) (#6936)
* First commit

Cherry-picked from #6666

* Adjust release version number

Just in case we decide to make a release before we merge #6666
2022-09-02 18:15:45 +01:00
tw-FRed
11b258a14b Fix tag pills style (#6934) 2022-09-01 08:38:26 +01:00
Bram Chen
7652aa5fed Update chinese translations (#6935)
* Add Hint and Caption of the delete button in the AdvancedSearch filter results
* Add confirm messages for the above deleting action
2022-09-01 08:03:37 +01:00
jeremy@jermolene.com
d62a16ee46 iPhone/iPad: Prevent long presses on tiddlylinks from triggering a preview 2022-08-31 17:44:31 +01:00
Xavier Cazin
0b1fc8e574 Make dialogs over deleting AdvancedSearch filter results translatable (#6933)
* Add fr-FR strings over deleting AvancedSearch filter results

* Add default strings over deleting AvancedSearch filter results

* Make dialogs over deleting results from AdvancedSearch filters translatable
2022-08-31 17:32:55 +01:00
jeremy@jermolene.com
127f660c91 Edit widget: remove default text "Type the text for the tiddler 'foo'"
Fixes #6152
2022-08-28 15:12:51 +01:00
Jeremy Ruston
668f443fc2 Fix prerelease version string 2022-08-19 13:14:11 +00:00
Jeremy Ruston
c8ad385947 Docs: Update code of conduct 2022-08-19 11:15:57 +00:00
Marxsal
c1f6e02d14 Fix missing links in Getting Started. (#6900)
* Fix empty links in Getting Started.

* Remove standalone TH reference and combine lines.
2022-08-19 08:14:04 +01:00
jeremy@jermolene.com
f0423c20b9 Merge branch 'tiddlywiki-com' 2022-08-17 18:11:12 +01:00
Mario Pietsch
953b89fd6b CSS: Make input and button elements consistent for all browsers (#6910) 2022-08-17 14:54:15 +01:00
Bram Chen
f87ab06414 Update chinese language files (#6895)
* Change core GettingStarted tiddler table layout
* Revise wording
2022-08-10 10:06:57 +02:00
Mario Pietsch
2ff5bd5a0f Fix removing a field with empty name (#6888)
* allow us to remove a field with empty key

* fix typo in if clause
2022-08-09 18:44:45 +02:00
Mario Pietsch
d7b9e6fb02 Getting started new table layout (#6894)
* change core GettingStarted tiddler table layout

* rename tc-table-no-grid to tc-table-no-border
2022-08-09 18:42:01 +02:00
BALLOON | FU-SEN
8420f8430f Minor adjustments to Japanese language files (#6884)
Since there was a mixture of "Desumasu-style"(ですます調) and "Dearu-style"(である調), the unification (that is unique to Japanese)
2022-08-06 11:07:47 +02:00
Mario Pietsch
a572979cc4 Add global option to show default text below the edit textarea (#6882) 2022-08-05 17:16:39 +02:00
Guang Li
90d6a0f1a6 Update readme.tid (#6883) 2022-08-05 16:59:53 +02:00
twMat
406dbd0883 Update Releases.tid (#6880) 2022-08-04 19:18:06 +01:00
jeremy@jermolene.com
3fd2cfc339 Preparing for v5.2.4
Note that we currently only plan to release v5.2.4 if there's an issue with v5.2.3, and that the next release version will be v5.3.0
2022-08-02 17:31:20 +01:00
jeremy@jermolene.com
f690458792 Version number update for 5.2.3 2022-08-02 12:32:01 +01:00
jeremy@jermolene.com
6bc18570f2 Update readmes for v5.2.3 2022-08-02 12:31:33 +01:00
jeremy@jermolene.com
1f4b12cd0e Preparing for release of v5.2.3 2022-08-02 12:27:50 +01:00
jeremy@jermolene.com
608aa3378a Merge branch 'tiddlywiki-com' 2022-08-02 12:21:14 +01:00
jeremy@jermolene.com
bff7dc88e8 Update release note 2022-08-02 10:03:28 +01:00
jeremy@jermolene.com
667da96c97 Fix crash when closing plugin library
Fixes #6855
2022-07-31 15:35:14 +01:00
jeremy@jermolene.com
fb037de091 WIP 2022-07-31 15:34:31 +01:00
jeremy@jermolene.com
75865385a6 Docs: Fix typos
Thanks @amreus

Fixes #6860

Fixes #6859
2022-07-31 15:23:58 +01:00
Xavier Cazin
091a6a9dc1 Updates to various fr-FR translation strings (#6856)
* Update to the fr-FR translation of the render command

* Add a Caption entry to the fr-FR translation of EditTemplate strings

* updates to the fr-FR translation of the default command help

* Add a Caption to the fr-FR translation of SideBar-related strings

* Update to fr-FR translation strings for Control Panel

* Update to Misc fr-FR translations strings

* Updates to the Fields-related fr-FR translation strings
2022-07-31 14:06:19 +01:00
Mario Pietsch
38f0337207 Update german translation (#6857) 2022-07-31 13:58:03 +01:00
Bram Chen
a3b294470f Update chinese language files (#6853)
* Render command help: use single quotes for safety
2022-07-30 11:45:24 +01:00
jeremy@jermolene.com
53c5cc535e Put hide-body at the start of the view template body cascade 2022-07-29 14:20:26 +01:00
jeremy@jermolene.com
9e6713d3e0 Release note: Remove duplicated line 2022-07-29 14:18:07 +01:00
jeremy@jermolene.com
1acad41574 Docs: Clarify ordering of tagged tiddlers
Fixes #6850
2022-07-29 14:16:09 +01:00
jeremy@jermolene.com
9a5f6558fe Updated release banner (GitHub URL this time) 2022-07-29 14:11:09 +01:00
jeremy@jermolene.com
5d9b71771a Updated new release banner
See https://talk.tiddlywiki.org/t/banner-competition-voting-for-v5-2-3/4009/16
2022-07-29 14:09:55 +01:00
jeremy@jermolene.com
f891eacddc Ensure code-body field can override new stylesheet view
See https://github.com/Jermolene/TiddlyWiki5/issues/6813#issuecomment-1199108091
2022-07-29 11:16:20 +01:00
jeremy@jermolene.com
178e652a5d Update release note inc. banner credits 2022-07-29 10:48:57 +01:00
jeremy@jermolene.com
daf4eec702 Final new release banner for v5.2.3
See https://talk.tiddlywiki.org/t/banner-competition-voting-for-v5-2-3/4009
2022-07-29 10:20:45 +01:00
jeremy@jermolene.com
34b1b8128f Server: correctly print URL when running on IPv6
Since https://github.com/nodejs/node/issues/40537 users are more likely to encounter IPv6 connections.

IPv6 URLs require square brackets around raw addresses.

With this change VS Code correctly hyperlinks the message `Serving on http://[::1]:8080`
2022-07-29 10:07:59 +01:00
jeremy@jermolene.com
a453121e96 Render command help: use single quotes for safety
See https://github.com/Jermolene/TiddlyWiki5/issues/6827#issuecomment-1198540330
2022-07-29 09:48:49 +01:00
Bram Chen
e849aaab4d Update chinese language files (#6846)
* Additional example of render command
2022-07-29 08:53:35 +01:00
Saq Imtiaz
453d91caeb Fix invalid file path in tiddlywiki-com branch (#6844)
* Delete editions/tw5.com/tiddlers/$:/editions/tw5.com directory

* Create systemtag-template.tid
2022-07-28 21:31:14 +01:00
Mario Pietsch
0ad0001e29 Fix #6840 tab macro stat handling (#6841) 2022-07-28 21:26:09 +01:00
Mario Pietsch
2441819c70 Remove hardcoded spaces and replace with SPAN and proper class (#6825) 2022-07-28 17:02:14 +01:00
jeremy@jermolene.com
ca762ab7a6 Additional example of render command
Fixes #6827
2022-07-28 16:33:57 +01:00
jeremy@jermolene.com
28070f847c Ensure dirty indicator has higher CSS specificity than menu bar
Fixes #6832
2022-07-28 16:20:47 +01:00
jeremy@jermolene.com
8f85fbca33 Added some background on different types of brackets 2022-07-28 16:05:10 +01:00
Nathaniel Knight
655cf4729a Add tiddly-wiki-server to TiddlyWeb implementors (#6794) 2022-07-27 19:22:49 +01:00
Nathaniel Knight
55f3ee5eab Add Nathaniel Knight's signature to the CLA (#6830) 2022-07-27 19:21:42 +01:00
Robin Munn
63bba13758 Fix copy-and-paste mistake in insertafter docs (#6824) 2022-07-25 08:41:06 +01:00
BALLOON | FU-SEN
c22d52c046 Japanese translation: Fixed Title/Relink/Prompt (#6814) 2022-07-24 20:42:50 +01:00
BALLOON | FU-SEN
8c57cfdf26 Spell correction (#6815) 2022-07-24 20:42:27 +01:00
btheado
4f38903c7b Add description and examples comparing :map vs. :map:flat (#6821)
* Added description and examples comparing :map vs. :map:flat

* Make it clear :flat is just a suffix on the :map filter run

* Reword the description comparing :map and :map:flat

* Swap the :map and :map:flat columns in the examples table

* Removed mention of how to express ':map' in terms of ':map:flat'
2022-07-24 19:12:33 +01:00
Saq Imtiaz
ab1e85e01e Fixes invalid path in new docus view template (#6820)
* Delete editions/tw5.com/tiddlers/$:/editions/tw5.com directory

Delete invalid file path directory

* Create systemtag-template.tid

Restore deleted file
2022-07-23 13:53:39 +01:00
jeremy@jermolene.com
065911259b Add modified date to front page release note listing 2022-07-22 16:45:05 +01:00
jeremy@jermolene.com
6497633859 Update release note 2022-07-22 16:20:00 +01:00
jeremy@jermolene.com
9cc4c3ead7 Add first pass at Code of Conduct 2022-07-21 21:22:52 +01:00
Saq Imtiaz
613b3df367 Image lazy loading (#6809)
* Extend image widget with lazy loading support

* docs: added from-version to docs update
2022-07-21 15:30:56 +01:00
jeremy@jermolene.com
39996c7a2f Merge branch 'tiddlywiki-com' 2022-07-21 10:11:14 +01:00
Saq Imtiaz
0237d9ed94 feat(filters): extend :map filter run prefix to accept a suffix to enable mapflat (#6806) 2022-07-21 09:23:01 +01:00
jeremy@jermolene.com
7e9c2a1a10 Fix crash when viewing $:/core/ui/ViewTemplate/body/rendered-plain-text
Fixes #6805
2022-07-21 09:05:20 +01:00
Robin Munn
d4fc8f585e Small grammar fix in release notes (#6800) 2022-07-20 09:56:41 +01:00
Robin Munn
caa6b888e9 Make insertafter docs more similar to insertbefore (#6801)
Now both the insertafter and insertbefore filter operators have similar
wording in their documentation tiddlers, making it more clear that the
"start" and "end" suffixes are only available in the two-parameter form.
2022-07-20 09:56:06 +01:00
twMat
a1b240de2f [doc] Update TagMacro.tid (#6797) 2022-07-19 19:10:39 +01:00
twMat
7a98ab1677 [doc] SystemTag template (#6798) 2022-07-19 19:10:07 +01:00
twMat
c49d5a3b08 [tw.com] Improve the saver cards (#6799)
* [tw.com] Improve the saver cards

* [tw.com] Improve the saver cards _ take 2

* Update tw5.com-styles.tid
2022-07-19 19:05:23 +01:00
jeremy@jermolene.com
93717560dc Docs: Update advice about using counter attribute of list widget 2022-07-18 12:03:42 +01:00
BALLOON | FU-SEN
abc3af16c3 Significant improvement in Japanese (#6795)
- Add translations for untranslated items
- Unification of terms (translations differed by multiple translators)
- Add signature of `author` (Includes translation assistance for dajya-ranger. I also added his signature)

It's a lot of updates, but I've tested it on my TiddlyWiki.
Help etc. are still lacking.
2022-07-18 09:29:58 +01:00
Saq Imtiaz
97eaec88d1 Update Release 5.2.3.tid (#6790) 2022-07-15 18:45:27 +01:00
Mohammad Rahmani
2275255c2b Improve formatting of Contributors Section in Release Tiddler (#6788)
* improve contributors section in release tiddler

* comments implemented

Jeremy comments were implemented
2022-07-15 18:20:40 +01:00
Saq Imtiaz
fe1147c6fd Fix: restore drag and drop on mobile chrome (#6789) 2022-07-15 18:19:44 +01:00
jeremy@jermolene.com
eceacc23c8 Update release note 2022-07-15 17:43:19 +01:00
Jeremy Ruston
1ca6305acb Split the tiddler subtitle into individual segments tagged $:/tags/ViewTemplate/Subtitle (#6779) 2022-07-15 17:37:25 +01:00
Saq Imtiaz
19331cc6f9 Fix: brittle selector implementation for draggable widget (#6786)
* Fix: fixes #6595, brittle selector implementation for draggable widget

* Docs: updated for fix to selector implementation for draggable widget
2022-07-15 15:38:09 +01:00
Saq Imtiaz
f6e021d70f Feat: dynamically refresh class for draggable widget DOM node instead of re-rendering the widget (#6787) 2022-07-15 15:37:27 +01:00
jeremy@jermolene.com
2da117484c Docs: Update release note contributors to new format 2022-07-14 13:50:30 +01:00
jeremy@jermolene.com
1c1dd2a4cf Merge branch 'tiddlywiki-com' 2022-07-14 13:50:08 +01:00
jeremy@jermolene.com
f957874d18 Docs: Improve styling of GitHub contributors listing 2022-07-14 13:49:23 +01:00
jeremy@jermolene.com
aa4a284b88 Update release note 2022-07-14 09:03:04 +01:00
Jeremy Ruston
338dc11436 Show stylesheets as rendered plain text with highlighting (#6778)
* First commit

* Enable syntax highlighting when highlight plugin is installed

* Use highlighting for the control panel stylesheet listings
2022-07-14 09:00:56 +01:00
Mario Pietsch
22d8fdd259 Adjust position of server page control dropdown (#6767) 2022-07-13 17:28:32 +01:00
twMat
c270e3cd6b Update TiddlyWiki in the Sky for TiddlyWeb.tid (#6769)
For e.g the listing in 
https://tiddlywiki.com/prerelease/#Deprecated%20-%20What%20does%20it%20mean
2022-07-13 17:27:45 +01:00
Robin Munn
18d8173dcc New insertafter filter operator (#6771)
* Implement insertafter operator (like insertbefore)

Currently, the behavior of insertafter if the target is not found is to
append the inserted tiddler to the end of the list, like insertbefore
does. In the next commit, we'll add a suffix to customize what both
insertafter and insertbefore do when the target is not found.

* Add failing tests for insertafter suffixes

Also includes tests for insertbefore suffixes (start/end), since we'll
be implementing both of those at the same time.

* Add start/end suffixes for insertafter/before

The tests that exercise the start/end suffixes now pass.
2022-07-13 17:08:17 +01:00
Mohammad Rahmani
4cd3c065e7 Add emptyMessage to list-links-draggable and correct docs (#6776) 2022-07-13 15:58:27 +01:00
jeremy@jermolene.com
45895bd560 Update release note 2022-07-13 09:32:31 +01:00
jeremy@jermolene.com
af86080943 Docs for $:/info/browser/is/mobile 2022-07-13 09:32:22 +01:00
jeremy@jermolene.com
94b02ba3a0 Docs missed off #6675 2022-07-12 16:51:38 +01:00
lin onetwo
bbae2ab6da Feat: update katex to 0.16 stable (#6768) 2022-07-12 11:18:15 +01:00
jeremy@jermolene.com
3b778c156b Merge branch 'tiddlywiki-com' 2022-07-11 17:22:50 +01:00
lin onetwo
2f817e4293 Update katex to latest 0.15.3 (#6671)
* feat: update snippet fields

https://github.com/Jermolene/TiddlyWiki5/discussions/6670

* chore: upgrade files

* docs: update readme

* fix: usage of mhchem

* fix: add back katex.without-font-face.min.css

https://github.com/Jermolene/TiddlyWiki5/pull/6671#issuecomment-1116287404

* style: format json with 4 space

* style: format json with 1 space

* style: restore old format

* feat: update css by using new one and delete font face

* update developer info

* move implementation notes to plugin

* update TW style tiddler

* update katexdemo edition

* chore: delete unused files

* Update developer.tid

* Update developer.tid

Co-authored-by: pmario <pmariojo@gmail.com>
2022-07-09 08:37:47 +01:00
Mario Pietsch
0112d04033 Fix 6731 tag and field name trim (#6740)
* this commit should fix #6731. It trims field and tag whitespace

* this commit increases tag space visibility as mentioned in 002d47b4d9

* fix a missing HTML end tag

* fix $:/Manager select element max width
2022-07-09 08:35:38 +01:00
BALLOON | FU-SEN
56d8f47710 Japanese translation: Month correction (#6760)
The month notation is strange in the date in the default Japanese display.
2022-07-07 09:06:23 +01:00
BALLOON | FU-SEN
f818fd96cd Set the date and time in Japanese format (#6761)
The date and time format is incorrect in the current Japanese display of TiddleWiki. I fixed it.
2022-07-07 09:05:45 +01:00
BALLOON | FU-SEN
c5821326d0 Add signature (#6762)
https://github.com/Jermolene/TiddlyWiki5/pull/6761
2022-07-07 09:05:12 +01:00
Maurycy Zarzycki
add14ef65a add polish translation to a new string added in 92c4c820 (#6763)
Co-authored-by: Maurycy Zarzycki <maurycy@evidentlycube.com>
2022-07-07 08:59:31 +01:00
jeremy@jermolene.com
f93fe50044 Fix anchor links do not work with addressbar=permalink and animationduration=0
Fixes #6757
2022-07-05 18:39:14 +01:00
jeremy@jermolene.com
ceec7b5737 Style tweaks for #6755 2022-07-05 17:47:57 +01:00
Mario Pietsch
76bc2f7524 Fix svg foreignObject that contains DIVs (#6755)
* xmlns attribute defined in element takes precedence

* use predefined tagNamespaces variable as default value

* change code as suggested by Jeremy
2022-07-05 17:46:31 +01:00
jeremy@jermolene.com
a59ec3ebf7 Merge branch 'tiddlywiki-com' 2022-07-04 21:15:23 +01:00
jeremy@jermolene.com
20df381cf3 Docs: Improve deprecation documentation 2022-07-04 17:42:58 +01:00
jeremy@jermolene.com
4185d9a26c Docs: Make .from-version macro be a link to the release note
Fixes #6750
2022-07-04 17:35:03 +01:00
Bram Chen
bf6d5fa767 Update chinese language files (#6752)
* Add `Caption` to EditTemplate.multids
2022-07-04 15:19:03 +01:00
Nolan Darilek
92c4c82005 Add ARIA region for editor. (#6749) 2022-07-01 15:39:52 +01:00
Maurycy Zarzycki
1110fd50cf add Polish translation for the newly introduced English i18n string (#6747)
Co-authored-by: Maurycy Zarzycki <maurycy@evidentlycube.com>
2022-06-29 14:03:16 +01:00
FSpark
2c607ee8e6 Add storyTiddler to render command (#6746) 2022-06-29 08:58:40 +01:00
Bram Chen
dfebd69d8f Update chinese language files (#6745)
* Add `Caption/Sidebar` in SideBar.multids
* Update Help/default.tid
2022-06-29 08:20:29 +01:00
Mario Pietsch
926b7808b3 Fix a typo in the Plugin Ordering tiddler (#6744) 2022-06-28 17:59:33 +01:00
Nolan Darilek
7ac7d26f86 Add alert role to notifications so they're automatically spoken by screen readers. (#6743) 2022-06-28 17:48:03 +01:00
Nolan Darilek
f02bd2392f Various accessibility improvements (#6742)
* Add `main` and `article` roles to stories and story.

* Support `role` and \aria-checked` in buttons, and integrate with sidebar tabs.

* Add `region` role to sidebar, and set caption as `aria-label`.

* Add accessibility roles and labels to static templates.

* Update test fixtures with new ARIA tab attributes.
2022-06-28 14:05:52 +01:00
Nolan Darilek
2b45bbc4c4 Sign the CLA. (#6741) 2022-06-27 20:48:54 +01:00
Rizwan
bce3ec6e6f Update Installing TiddlyWiki on Node.js.tid (#6734) 2022-06-23 08:48:15 +01:00
jeremy@jermolene.com
5e35c8dda6 Revert "Allow global keyboard shortcuts to work in framed editor (#6705)"
This reverts commit 8e64e21039.

See https://github.com/Jermolene/TiddlyWiki5/pull/6705#issuecomment-1162738927
2022-06-22 08:18:13 +01:00
Mario Pietsch
8af7054efa Doc restructuring Plugin Install using core Libraries and with Node.js (#6722)
* Doc restructuring Plugin Install using core Libraries and with Node.js

* fixing typos and concerns raised by Jeremy
2022-06-20 13:55:12 +01:00
Mario Pietsch
10bc84ba6c Add Note formatting to an important paragraph in ScrollableWidget (#6729) 2022-06-20 13:51:44 +01:00
jeremy@jermolene.com
0391e1855c Fix new selection tracker to return relative coordinates 2022-06-17 16:40:29 +01:00
jeremy@jermolene.com
a29889a741 Fix layout bug introduced in d5030eb87b
Thanks @pmario
2022-06-17 14:03:36 +01:00
Marxsal
27609d2619 Add new instructions for saving with Koofr (#6726) 2022-06-17 08:01:11 +01:00
jeremy@jermolene.com
d5030eb87b Prevent Chrome from offering password autocomplete for search boxes
Fixes #6723
2022-06-14 09:45:49 +01:00
jeremy@jermolene.com
35b0833e0c Fix handling of {!!title} in a filter with no currentTiddler
Fixes #6721
2022-06-14 08:33:47 +01:00
Maurycy Zarzycki
45f5ba7d38 update Keyboard Shortcut documentation with information on how it interacts with navigate actions (#6703) 2022-06-11 09:53:06 +01:00
Maurycy Zarzycki
8e64e21039 Allow global keyboard shortcuts to work in framed editor (#6705)
Co-authored-by: Maurycy Zarzycki <maurycy@evidentlycube.com>
2022-06-11 08:57:08 +01:00
jeremy@jermolene.com
bb47cc97f5 Fix code_body typo 2022-05-29 10:51:49 +01:00
jeremy@jermolene.com
7e4722f07a Fix crash with missing palette tiddler 2022-05-25 18:08:08 +01:00
jeremy@jermolene.com
df7416d16b Dynannotate: Improve selection tracker
These improvements rely on the new JSON operators to be useful. Those improvements were originally in #6522 but now there's an updated version in #6666. Managing things is simpler if I merge these changes now
2022-05-25 15:23:11 +01:00
Robin Munn
a226975b3e Fix UTC format date string test properly this time (#6709)
Hours could also end up as a single-digit number, just like date, if
timezone offset is low enough that it wraps around midnight.
2022-05-24 10:02:45 +01:00
Robin Munn
2a62da1498 Fix unit test for formatDateString UTC format (#6708)
Now the test should run correctly in any timezone
2022-05-24 09:47:02 +01:00
Cameron Fischer
696c5c9c7a Compiled filters are cached (#6402)
* Compiled filters are cached

* Adjusting comments, and filtercache cap
2022-05-23 11:26:56 +01:00
jeremy@jermolene.com
c808764254 Merge branch 'tiddlywiki-com' 2022-05-23 09:14:54 +01:00
jeremy@jermolene.com
a9b0c5d7ff Cherry-pick JSON docs improvements from #6522 2022-05-23 09:14:02 +01:00
jeremy@jermolene.com
9e3c233686 Add some warnings about the dangers of title lists 2022-05-23 08:56:10 +01:00
jeremy@jermolene.com
8fabcabebb Browserstorage plugin: don't crash if local storage not available
Fix #6701
2022-05-21 15:36:23 +01:00
jeremy@jermolene.com
96cb66a27e New example for tm-new-tiddler
Fixes #6690
2022-05-21 14:38:05 +01:00
jeremy@jermolene.com
6eb4fbeead Fix double palette entries
Fixes #6700

Thanks to Eric Shulman
2022-05-20 17:13:12 +01:00
Max Schillinger
7cbe1e1d83 Fix toggling of the numbered list prefix in Markdown tiddlers (#6697)
* Fix toggling of the numbered list prefix in Markdown tiddlers

* Define startsWith in utils.js because it's not available in ECMAScript5.1
2022-05-17 22:31:50 +02:00
Max Schillinger
5ea315fb98 Allow toggling wrap-lines text operations (like mono block) (#6698) 2022-05-17 22:16:54 +02:00
Max Schillinger
855b6719d6 Markdown: Add separate link and linkify buttons (#6693)
* Markdown: Add separate link and linkify buttons

* Add Markdown linkify icon (created by Jeremy); cleanup
2022-05-15 18:47:21 +02:00
Max Schillinger
91cfb217d8 Markdown: Add shortcut for new Markdown tiddler (#6696)
ctrl-M on mac, alt-M on other platforms
2022-05-15 18:46:32 +02:00
jeremy@jermolene.com
1a377a485b Merge branch 'tiddlywiki-com' 2022-05-14 15:55:42 +01:00
lin onetwo
71ee271eac docs: mark out-of-box standalone apps (#6677)
docs: delete tiddlyie and ie tiddler

docs: delete  [[Internet Explorer]] tag

Revert "docs: delete  [[Internet Explorer]] tag"

This reverts commit a796fc1fff3748f73a1919c5f2fff6d50990ae38.

Revert "docs: delete tiddlyie and ie tiddler"

This reverts commit 38067c7369c92f1b22ffd98090bdabdd96fa1fb3.
2022-05-14 14:04:36 +01:00
lin onetwo
95e0fac655 Expose isMobile to browser info (#6675)
* feat: expose isMobile to info

* feat: allow access browser info from $tw.browser

* fix: adapt typo

* refactor: only export selected properties

 Jermolene 5 hours ago

The trouble is that the properties of bowser.browser are not under our direct control, and so subsequent updates to Bowser might overwrite important properties of our own. I'd rather explicitly import the properties that we choose to support.

* refactor: put things into `is`
2022-05-14 14:02:52 +01:00
Mario Pietsch
084a5cb0f0 Fix headings in wikitext example code (#6692) 2022-05-14 13:31:36 +01:00
FlashSystems
e9405ac810 Fix for Bug #6618 (#6628)
* Fix for Bug #6618

This Commit fixes Bug #6618. It is a little bit more complicated than
using one tiddler to store the new value for a field. Because the
following can happen:

* The user types "not-a-date" into the field value of a simple text field.
* The user now selects a field name that uses a HTML5 date editor. The
  Editor will show no date because the value cannot be parsed.
* The user saves the tiddler by clicking the checkmark.

Now the date-field contains the value "not-a-date" but the user was not
aware that this will be added. The edit control showed no date (because
the value was invalid) and the user assumed the field was empty and
won't be added to the tiddler.

To prevent this, every kind of field editor gets its own storage tiddler.
Its name is derived from the SHA256-hash of the name of the tiddler that
is returned by the Field Editor Cascade. That way every editor in the
cascade is only seeing its input. As long as the default setup (with one
default editor) is used, everything works like in 5.2.1.

This commit also fixes the bug that the after adding a field the
field-type input box was not focused again.

* Update Documentation for Field Editor Cascade

The fix for bug #6618 makes the handling of the tiddler backing the edit
operation much more complicated. See previous commit "Fix for Bug #6618"
for more details.
2022-05-14 13:30:04 +01:00
Max Schillinger
775c7f0074 Markdown: Add link(ify) button and enable shortcut (ctrl-L) (#6691) 2022-05-12 22:19:26 +01:00
Max Schillinger
34f9cd952c Markdown: Add code block button + enable shortcut (#6689)
* Markdown: Add code block button and enable shortcut (ctrl-shift-M)

* Support alternative type "text/markdown"
2022-05-12 09:44:02 +01:00
Max Schillinger
e37f36f387 Signing the CLA (#6688) 2022-05-12 09:42:38 +01:00
lin onetwo
7a7d3571cc Create issue template config.yml (#6685)
* Create config.yml

* chore: make bug report form

* Update bug_report.yml

* Update bug_report.yml

* Update bug_report.yml

* Update bug_report.yml

* Update bug_report.yml
2022-05-10 08:09:38 +01:00
Mario Pietsch
bc8c011eb3 Fix title indentation problem (#6679)
* fix-6678-title-indent

* optimize code as suggested by Saq
2022-05-09 15:49:42 +01:00
Simon Huber
b4deb7cc45 Add tv-widgetnode-width and tv-widgetnode-height (#6681)
* Add tv-widgetnode-width and tv-widgetnode-height to collectDOMVariables

* Add docs

* update docs

* Update modified field
2022-05-09 10:42:23 +01:00
Simon Huber
4b8594c4a8 Fix: eventcatcher widget - variables can be undefined (#6668)
* Fix: eventcatcher widget - variables can be undefined

* Fix: selectedNode can be an svg where offsetLeft ... are undefined

* Make check for offsetLeft short

* remove second collectDOMNodeVariables
2022-05-06 17:11:13 +01:00
lin onetwo
9b9e443c73 Fix lazy all template with user defined macro cause error (#6644)
* Fix lazy all template with user defined macro cause error

Fixes https://github.com/Jermolene/TiddlyWiki5/issues/6637

* fix: exclude the SJCL library when saving

@Jermolene said:

The construction -[type[application/javascript]library[yes]] is used in the core as a rather clumsy way to exclude the SJCL library when saving. The same construction is in the usual $:/core/save/all filter too.

It's possible that we should review unintended side effects of that behaviour, but here we should leave it alone.
2022-05-06 17:09:33 +01:00
jeremy@jermolene.com
f3bf5b6e85 Add support for $:/tags/Macro/View/Body macros 2022-05-05 08:30:05 +01:00
Simon Huber
5d55850c73 Update some palettes in the light of colorscheme: dark (#6661)
* Update CupertinoDark.tid

* Update GruvBoxDark.tid

* Update Nord.tid
2022-04-27 22:22:54 +01:00
Télumire
873ce4823f Added a reference to encrypted wiki in "Creating a splash screen" (#6664)
A user was wondering how to add a background image to the password screen of an encrypted wiki (https://talk.tiddlywiki.org/t/background-image-on-login-page/3145). It was not obvious that an encrypted wiki is considered as "loading", so I updated this tiddler to hint at this. 

I also added a hint to the other system tags $:/tags/RawMarkup.. since they can also be used for the same purpose.
2022-04-27 22:21:59 +01:00
Marxsal
03910fce66 Add tiddler 'How to update ...' (#6667)
Adding tiddler 'How to update TiddlyWiki to the latest version' which transcludes the existing tiddler 'Upgrading'. 
Some people search for term 'update' instead of 'upgrade' .
2022-04-27 17:24:06 +01:00
jeremy@jermolene.com
0bffae2108 Add utility method for getting ordered attributes 2022-04-26 14:02:31 +01:00
jeremy@jermolene.com
bdd99edfe8 Tests: Improve transclusion recursion test
Previously we were testing a tiddler transcluding itself, but it's clearer to make it an indirect recursion
2022-04-26 14:02:08 +01:00
Simon Huber
9bcbb9131e Add :root { color-sheme: ...; } to vanilla base (#6659) 2022-04-25 09:56:34 +01:00
Simon Huber
1410488a23 Fix my error in framed.js (#6658)
* Fix my error in framed.js

* ouch
2022-04-25 08:45:42 +01:00
Simon Huber
e2ef5c933b Update CupertinoDark.tid (#6655) 2022-04-24 21:46:33 +01:00
Simon Huber
3cf078faeb Write the right "color-scheme" meta tag to the iframe of the framed text-editor (#6656)
* Write the right "color-scheme" meta tag to the iframe of the framed text-editor

* Update framed.js
2022-04-24 21:45:56 +01:00
tw-FRed
9bad66f02e [fr-FR] New batch of Documentation translations (#6657)
This batch includes:
- Minor corrections of metadata from my previous translations
- Translation updates for tiddlers tagged WikiText
- New translations for Parser Modes documentation
- Update of outdated core tiddlers translations (ie Open sidebar tab)
2022-04-24 21:45:06 +01:00
jeremy@jermolene.com
ed4ccc4290 Sites menu: remove link underlining 2022-04-20 09:43:03 +01:00
jeremy@jermolene.com
6e3f4c8772 Sites menu: Fix standalone styling 2022-04-19 20:01:56 +01:00
jeremy@jermolene.com
400936920a Merge branch 'tiddlywiki-com' 2022-04-19 16:37:51 +01:00
jeremy@jermolene.com
c78bff5bb2 Fix sites menu 2022-04-19 16:24:48 +01:00
jeremy@jermolene.com
8b309ecb42 Make the sites menu exportable by dragging the TiddlyWikiSitesMenu tag pill 2022-04-19 16:08:11 +01:00
jeremy@jermolene.com
e2869e6ede tiddlywiki.org: Update fundraising 2022-04-19 11:17:34 +01:00
jeremy@jermolene.com
8e25f693c6 tiddlywiki.org: Add fundraising information 2022-04-19 10:57:28 +01:00
Joshua Fontany
42bf203758 Fix 6649 (#6650)
* use filesystem utils

* use filesystem utils

* don't touch syncer

* fix messaging
2022-04-19 08:18:44 +01:00
Guang Li
f0416964fa Add TiddlyMemo edition (#6647)
TiddlyMemo focuses on learning and memorization
2022-04-18 20:50:28 +01:00
Robin Munn
8dec674121 Allow checkboxes to be indeterminate (#6593)
* Documentation for indeterminate checkboxes

* Unit tests for indeterminate checkboxes

* Implement indeterminate checkboxes

* Simplify indeterminate checkbox example

* Slightly simplify refresh logic for indeterminate

That five-line if statement can be turned into a simple assignment.

* Use "yes" and "no" for checkbox indeterminate attr

This makes the "indeterminate" attribute of the checkbox widget work the
same way as other boolean attributes of other widgets.

* Fix bug with invertTag attribute

One place in the checkbox widget code was checking invertTag for
Javascript truthiness rather than the value "yes", which could have
produced incorrect results if anyone wrote invertTag="no". Fixed.
2022-04-18 20:50:03 +01:00
jeremy@jermolene.com
16f56af873 Sites menu: fix mobile view
See https://talk.tiddlywiki.org/t/new-sites-menu-for-tiddlywiki-com/3093/6
2022-04-18 19:16:20 +01:00
jeremy@jermolene.com
e9fa861418 Merge branch 'tiddlywiki-com' 2022-04-18 17:42:20 +01:00
jeremy@jermolene.com
5ab2148807 Sites menu: Add upgrader 2022-04-18 17:37:06 +01:00
jeremy@jermolene.com
396e7e6921 Fix github ribbon in /dev 2022-04-18 15:00:05 +01:00
jeremy@jermolene.com
3d2663c900 Restore github-fork-ribbon to /dev 2022-04-18 13:36:11 +01:00
jeremy@jermolene.com
d31839d1e8 Merge branch 'tiddlywiki-com' 2022-04-18 13:26:29 +01:00
jeremy@jermolene.com
7d404e4ec5 Sites menu: fix URLs 2022-04-18 13:26:09 +01:00
jeremy@jermolene.com
5356345f19 Sites menu: fix matching of current site 2022-04-18 11:37:17 +01:00
jeremy@jermolene.com
f3ee7f429c Site menu: Adjust spacing of current site 2022-04-18 11:28:22 +01:00
jeremy@jermolene.com
59417f0896 Merge branch 'tiddlywiki-com' 2022-04-18 11:23:29 +01:00
jeremy@jermolene.com
2ab0f762e0 Add shared "sites" menu to tiddlywiki.com, dev, org 2022-04-18 11:22:06 +01:00
jeremy@jermolene.com
deeef27cff Remove unneeded plugins from prerelease 2022-04-18 09:33:00 +01:00
jeremyredhead
7459ccfed5 Add static fallback content/links for tw.org (#6597)
Modified from the static.content template used in the tw5.com branch
2022-04-17 21:10:53 +01:00
es-kha
8d5c94e028 Update Mathematics Operators documentation (#6598) 2022-04-17 21:09:20 +01:00
jeremy@jermolene.com
6d2d3396ac Update release note 2022-04-17 19:47:12 +01:00
jeremy@jermolene.com
dc2c4635c1 Merge branch 'tiddlywiki-com' 2022-04-17 19:42:18 +01:00
Jeremy Ruston
fd0b985ac5 action-setfield shouldn't write to the current tiddler if the $tiddler attribute is present but has evaluated to a missing attribute
Fixes #5916
2022-04-16 18:02:27 +01:00
Cameron Fischer
eb0b2a8d8e Trim Saga: Advanced Search and actions (#6604)
* Trim Saga: Advanced Search and actions

* Split up AdvancedSearch macros to be readable
2022-04-16 17:40:27 +01:00
jeremy@jermolene.com
7d6923f3d6 Revert "Give plugin authors the chance to extend a palette (#6624)"
This reverts commit b3b3020d99.
2022-04-16 17:37:08 +01:00
Cameron Fischer
05375e093c Trim Saga: I think this is the last batch (#6611) 2022-04-16 17:19:05 +01:00
lin onetwo
cc25e1f5b4 fix: formatDateString with [UTC]xxx didn't use passed date (#6615)
* fix: formatDateString with [UTC]xxx didn't use passed date

* test: for formatDateString UTC

* fix: not possible to test internal date without hijack

Expected '20220410073037515' to be '20220410073037516'.

* fix: hour
2022-04-16 17:10:57 +01:00
Simon Huber
b3b3020d99 Give plugin authors the chance to extend a palette (#6624)
* Give plugin authors the chance to extend a palette

* Update CSS.tid

* Update ColourMacro.tid

* Update CSS.tid

* Update ColourMacro.tid

* Add whitespace trim to colour macro
2022-04-16 16:50:21 +01:00
Simon Huber
383c8b5e49 Add docs for "enable" attribute of draggable widget (#6634) 2022-04-16 16:30:50 +01:00
Simon Huber
2fd17e864c Fix: dragndrop missing variables (#6632) 2022-04-15 17:05:27 +01:00
Simon Huber
030155ec27 Add "enabled" attribute to draggable widget (#6581)
* Add "enabled" attribute to draggable widget

* Update draggable.js

* Update draggable.js

* Update draggable.js
2022-04-15 14:17:06 +01:00
Simon Huber
58dd47d128 Add "tv-selectednode-width" and "tv-selectednode-height" ... (#6582)
* Add "tv-selectednode-width" and "tv-selectednode-height" ...

... variables to dragstartactions

* Update dragndrop.js

* Update dragndrop.js

* Add docs

* Update dragndrop.js

* Update dragndrop.js

* Update DraggableWidget.tid

* Update modifier Variable.tid

* Update modifier Variable.tid

* Update eventcatcher.js

* Update dom.js

* Update dragndrop.js

* Update dragndrop.js

* Update DraggableWidget.tid

* add a space after //

* Update modifier Variable.tid
2022-04-15 13:46:09 +01:00
btheado
8a9d48e055 Allow browser storage plugin to delete existing tiddlers (#6625)
* Do not remove localstorage items while looping

While looping over all the browser storage items by index, the items
should not be removed because removing alters the index positions. The
item following the removed one will be skipped by the loop.

Instead, accumulate a list of keys to remove and remove them after the
loop.

* Implement full delete support for browser storage plugin

Before, deletes only worked for tiddlers which are only present in the
localstorage. Now deleted tiddlers are marked in localstorage using an
empty string value.

At startup, the localstorage tiddlers with empty strings will be deleted
from the wiki if they are still present. If they are already gone from
the wiki, then the blank localstorage entry will be deleted.

* Document drawbacks to using '[all[]]' and provide an alternative
2022-04-12 22:11:37 +01:00
Marxsal
6c505ebc49 Fix url (#6609) 2022-04-12 12:08:16 +01:00
Saq Imtiaz
ae9a183a53 Extend documentation for tm-close-window (#6613) 2022-04-12 12:08:02 +01:00
tw-FRed
b9fec0c669 [fr-FR] Translation of Saving and all saving methods (#6623)
* Remove old tiddlers already deleted from EN edition
* Start using EN edition paths for updated/new translations
2022-04-11 18:12:49 +01:00
jeremy@jermolene.com
73138b79aa Save command exit with error when encountering missing tiddlers
Fixes #6603
2022-04-06 17:18:13 +01:00
Cameron Fischer
6624ce3716 Fix for broken style block wikitext (#6599)
* Fix for broken style block wikitext

* Fixed it so styles are correct too
2022-04-06 08:33:38 +01:00
Cameron Fischer
c5ea6628f5 Trim Saga: Control panel and Editor Toolbar (#6600)
Shout out to the TiddlySpot tiddler macro for being completely broken, but also being completely unused, so no one noticed.
2022-04-06 08:27:05 +01:00
jeremy@jermolene.com
ad512be04e Don't code body for system tiddlers containing images
Fixes #6594
2022-04-05 17:29:47 +01:00
Simon Baird
39e4e69ae7 Show server response as error message in put saver (#6589)
* Show server response as error message in put saver

I'd like to use this on Tiddlyhost so users can get more informative
error messages if the put save fails for whatever reason.

This would make the put saver a viable replacement for the legacy
upload saver, which is what Tiddlyhost uses currently.

I'm not sure what standard WebDAV servers do, but I would guess they
don't provide any response body for put requests, and hence this
patch would have no impact for a standard WebDAV server. (That said,
it would be a good idea to test it to make sure there aren't any
unexpected regressions for WebDAV or other put saver compatible
services.)

* Access http response status directly in put saver

There's no need to extract it from the error string created inside
tw.utils.httpRequest if we can get it directly from the xhr object.

* Add 'Save starting' notification for put saver

There are two related changes here:

1. Add a 'Save starting' notification for the put saver, similar to
   the upload saver. Not sure if it was intentionally omitted for
   the put saver, but it seems reasonable to have the two be
   consistent.

2. Send the 'Save starting' notifications in both upload and put
   save right before the actual request is sent. While testing I
   noticed that the save might have failed before the "Save
   starting" notification appeared which doesn't seem useful.
2022-04-05 17:06:56 +01:00
Cameron Fischer
8990423374 Another batch of whitespace trims (#6587) 2022-04-05 16:48:07 +01:00
Robin Munn
e28af8d594 Checkbox widget: list and filter modes (#6561)
* Docs for CheckboxWidget list and filter modes

This documents the `listField` and `filter` attributes.

* Tests for checkbox widget list mode

* Implement checkbox list mode

* WIP on implementing filter attr for checkboxes

* Improve CheckboxWidget documentation

* Refactor checkbox tests: move function to top

The big findNodeOfType function belongs at the top of the describe
block, so that the checkbox tests are more compact and easy to read.

* Move checkbox widget tests to end of file

The checkbox widget tests are long and involved, so we'll move them to
the end of the file so they aren't a huge block of code you need to read
past to find the next test.

* Improve formatting of CheckboxWidget docs

The \define() calls that are short enough to fit on one line should be
put on one line, for readability. The ones that are quite long have been
kept on multiple lines, for readability.

* Added more passing tests for checkbox widget

* Add some failing tests for checkbox widget

The filter mode where neither checked nor unchecked is specified (in
which case an empty filter result means false and a non-empty result
means true) is not working yet.

* Make failing tests pass

* Uncomment (and improve) test for field mode

We're now ready to start working on making this test pass. (There was
also one small mistake in the test, which this commit corrects).

* All tests now passing

* No indeterminate checkboxes in simple modes

The simple checkbox modes (field and index) should not produce
indeterminate checkboxes. That should be reserved for the advanced modes
(list and filter).

* Minor improvement to unit tests

* Allow indeterminate checkboxes in list and filter modes

This change may require some tweaks to the unit tests to be able to test
it properly.

* Slightly easier to read tests

* Two more tests for list mode

* Greatly simplify unit test code

Turns out there's no need to jump through Object.getPrototypeOf hoops.

* Minor simplification of unit test

* Add tests for indeterminate in list & filter modes

With this, the set of tests is complete.

* More tests to specify list mode behavior

* Unfocus tests so all tests run

* Update docs to say "new in 5.2.3" insetad of 5.2.2

* Move checkbox widget tests into their own file

The test-widget.js file was getting too long with all the checkbox
tests added, so we'll move the checkbox tests into their own file.

* Add checkbox widget tests for index mode

This commit also adds tests for index list mode (with a listIndex
attribute that will parallel the listField attribute) but leaves them
commented out because they don't pass yet: the code that implements the
listIndex attribute hasn't been written yet).

* Add listIndex attribute to checkbox widget

* Remove code that lets checkboxes be indeterminate

This reverts commit 6afcb151be. We will
add this code back in a later PR.

* Remove indeterminate tests for checkbox widget

We're currently not allowing indeterminate checkboxes, so there's no
need for the tests that check for them.

* Document listIndex attribute of CheckboxWidget

* adds class tc-checkbox-checked when checked

* equivalent to #2182 (RadioWidget)
* also applies `tc-checkbox` to checkboxes by default, always

* Move macro definitions inside example text

Since the wikitext-example-without-html macro creates a new parsing
context, it's safe to have macro definitions inside it. That makes these
examples a lot easier to write, and to read.

* Remove all mention of indeterminate checkboxes

Also improve the documentation a little bit: mention what happens in
list mode if neither checked nor unchecked is specified.

* Move filter mode to bottom of checkbox docs

The `filter` attribute should be under both `listField` and `listIndex`
rather than being between them. The documentation for filter mode should
similarly be after the `listIndex` documentation.

* Improve docs for `class` attr of checkbox widget

This brings the wording of the `class` attribute more in line with how
it's worded in the RadioWidget docs.

* Fix bug with list tiddlers

If neither checked nor unchecked was specified, then the behavior should
be "empty = false, non-empty = true". But if *both* are specified yet
neither is found, then the checkbox should be unchecked (false). It had
been falling through to the "non-empty = true" behavior, which was wrong.

* Improve listIndex example of checkbox widgets

* Remove unused function from test-widget.js

Co-authored-by: Tobias Beer <beertobias@gmail.com>
2022-04-02 15:16:08 +01:00
jeremy@jermolene.com
2ab4e965b2 Merge branch 'tiddlywiki-com' 2022-04-02 09:32:46 +01:00
jeremy@jermolene.com
4b100503da Fix URL of TiddlyWiki links aggregator 2022-04-02 09:24:00 +01:00
jeremy@jermolene.com
1f14969ab8 Merge branch 'tiddlywiki-com' 2022-04-01 21:06:42 +01:00
jeremy@jermolene.com
0b6a345208 Revert "CI: Only commit if there are changes"
This reverts commit e4b2698380.
2022-04-01 21:01:33 +01:00
Marxsal
f97b25676e Make choice selections save to state tiddler (#6585)
* Make choice selections save to state tiddler

Currently choice selections save to current tiddler (Saving), which marks TW as needing to Save. This fixes that by saving the working list to a state tiddler.

* Change state tiddler to $:/state/gettingstarted
2022-04-01 18:07:38 +01:00
Maurycy Zarzycki
b5ad5c3421 Polish translation updates (#6584)
* Add new Polish translations

Introduced in commit 54cfda76ee

* add Polish translations for changes from commits d78ad756 to b9ae6607

Co-authored-by: Maurycy Zarzycki <maurycy@evidentlycube.com>
2022-04-01 17:58:07 +01:00
es-kha
2391675e9c Signing the CLA (Eskha) (#6507)
Co-authored-by: Jeremy Ruston <jeremy@jermolene.com>
2022-04-01 12:14:27 +01:00
Cameron Fischer
def8e6d354 Trim Saga: All snippets, language tiddlers, and typed (#6275)
* adding trim: link-dropdown, Fields, unfold

* adding trim: all remaining snippets

* Fix for reversion I accidentally applied
2022-04-01 12:10:29 +01:00
Cameron Fischer
6701683ddf Trim saga: The big macros (#6269)
* adding trim: large macros and languageswitcher

* adding trim: KeyboardShortcuts.tid

* Hidden space to force some macros to be inline

This'll be our little secret. This single byte will actually allow
the uglifier to trim over thirty bytes while condensing.

I know I'm not supposed to optimize TW for some 3rd party plugin,
but I'm the one doing the whitespace trim work, so I'll give myself
this.

* More consistent nested quoting
2022-04-01 12:09:59 +01:00
Cameron Fischer
4a9cf67a25 Trim Saga: whitespace trimming three big tiddlers (#6265)
* whitespace trimming three big tiddlers

* Forgot one macro

* This emptyMessage needed trimming too

* Switching to more consistent emptyMessage quotes
2022-04-01 12:09:30 +01:00
Cameron Fischer
5e38f1b0b8 Trim Saga: First batch of \whitespace trim (#6257)
* First batch of \whitespace trim

Along with some quotation improvements to compensate for the new bytes.

* Undid experimental, new-age, gen-Z formatting

* daring to whitespace trim a placeholder macro

* switching to more consistent nesting of quotes
2022-04-01 12:08:53 +01:00
FlashSystems
73a9625b81 Fix regressions cause by PR #6511 (#6567)
* Fix field edit bug

This fixes the field edit bug mentioned in
https://talk.tiddlywiki.org/t/possible-field-editing-bug-in-5-2-2/2884 .

* Revert "Fix visual regression in #6511"

This reverts commit c920960942.

* Add new class `tc-edit-fieldeditor`

This class must be added to input and select elements that are used as
field editors. This class reduces the line height of the input element
if it is displayed within the `tc-edit-fields` part of the edit
template.

This allows the same input and select elements to be used for editing
and adding fields.

* Add the new class `tc-edit-field` to the docs

The example in `Customizing EditTemplate Field Rendering` now uses the
new CSS classes.
2022-04-01 11:42:16 +01:00
jeremy@jermolene.com
bc242cf83a Fix bug introduced in #4122
Fixes #6579
2022-04-01 11:38:40 +01:00
jeremy@jermolene.com
051b29c5b3 Merge branch 'tiddlywiki-com' 2022-04-01 11:10:03 +01:00
jeremy@jermolene.com
e4b2698380 CI: Only commit if there are changes
Suggested by https://github.community/t/ignore-working-tree-clean/193304

We also get rid of `set -e` to simplify things
2022-04-01 11:04:18 +01:00
jeremy@jermolene.com
6e89ecd13a Revert "CI: Temporarily enable output for git push commands"
This reverts commit 55eb37222a.
2022-04-01 11:01:47 +01:00
jeremy@jermolene.com
55eb37222a CI: Temporarily enable output for git push commands
The call to ./bin/ci-push.sh is failing for both master and tiddlywiki-com:

https://github.com/Jermolene/TiddlyWiki5/actions/runs/2071743915
2022-04-01 10:37:06 +01:00
Mario Pietsch
ff42a9e4d4 Update core tabs-macro to make it easier to extend for plugin authors. (#6578)
* tabs activate v5.2.2 tests add whitespace trim

* tabs-macro -- add indentation and code preview

* tabs-macro -- replace substitutions with variables

* split tabs-macro macro into different elements

 - tabs-button
 - tabs-tab
 - tabs-tab-list
 - tabs-tab-body
 - tabs ... main macro

* tabs: add cascade to button and reaveal widgets

This will allow users to create "default tab" configurations similar to the tiddler info tab handling.

* tabs-macro -- add code_body: yes
2022-03-31 15:41:19 +01:00
jeremy@jermolene.com
778581b4ff Merge branch 'tiddlywiki-com' 2022-03-31 12:06:08 +01:00
jeremy@jermolene.com
dafb3f1c4f Update TiddlyDesktop repository URL 2022-03-31 12:05:56 +01:00
Arlen22
adcef4f803 Fix possible bug (#4122)
Check for outstanding tasks to execute before the task in question seems to have invalid checks.
2022-03-30 19:39:21 +01:00
damscal
321f417d58 Correct typos (#6571) 2022-03-30 18:25:03 +01:00
Saq Imtiaz
08d9c90dc5 Fixed typo in Contributing.tid (#6570)
Fixed typo in Contributing.tid
2022-03-29 10:00:21 +01:00
jeremy@jermolene.com
6dbb3ee36e Revert scrollable changes e49dda3b48
See https://talk.tiddlywiki.org/t/stroll-issue-with-5-2-2/2885/2
2022-03-29 09:49:31 +01:00
jeremy@jermolene.com
c920960942 Fix visual regression in #6511
See https://talk.tiddlywiki.org/t/extra-space-between-fields-row-in-5-2-2-versus-5-2-1/2879/3
2022-03-28 11:01:34 +01:00
jeremy@jermolene.com
ad490017f8 Update contributing notes and PR template
See https://github.com/Jermolene/TiddlyWiki5/pull/6511#issuecomment-1080430636
2022-03-28 10:54:51 +01:00
Simon Huber
e84acf97de ControlPanel Button: use tv-story-list variable (#6562)
This PR makes the ControlPanel Button show as selected when the `tv-story-list` contains `$:/ControlPanel` in its list field
2022-03-27 08:54:33 +01:00
jeremy@jermolene.com
6a5d73dae6 Add missing languages to Translators edition
Fixes #6557
2022-03-26 15:25:50 +00:00
Cameron Fischer
98a509dbf3 Trim Saga: Another batch of medium-sized files (#6270)
* adding trim: Last of the macros I think

* adding trim: EditTemplate and ItemSidebarIcon

* adding trim: control panel basics

* Another hidden space to guide the uglifier

* More consistent nested quoting

* Reconciling tests for \whitespace trim
2022-03-26 15:19:04 +00:00
Cameron Fischer
5d69fe7bef Trim Saga: Making existing trim tiddlers consistent (#6272)
* adding trim: AdvancedSearch Standard

* adding trim: tiddlers that had SOME trim already

* making all existing trim tiddlers consistent

* Forgot to properly indent this widget

* I don't THINK that space was important...

but I'm putting it back in

* Forgot one whitespace trim
2022-03-26 15:18:42 +00:00
Cameron Fischer
b9ae6607c0 Trim Saga: Edit and View templates (#6276)
* the text/vnd-tiddlywiki tiddler and language

* adding trim: edit and view templates
2022-03-26 14:16:01 +00:00
jeremy@jermolene.com
758d590837 Disable link rendering when rendering list-links-draggable captions 2022-03-26 12:49:17 +00:00
jeremy@jermolene.com
1c16f12d6f Disable link rendering when rendering list-links captions
Fixes #6558
2022-03-26 12:44:28 +00:00
jeremy@jermolene.com
9922701304 Prepare for v5.2.3-prerelease 2022-03-25 15:05:03 +00:00
jeremy@jermolene.com
76236f5ebe Version number update for 5.2.2 2022-03-25 13:59:52 +00:00
jeremy@jermolene.com
aec2ad2d12 Update readme 2022-03-25 13:58:31 +00:00
jeremy@jermolene.com
bd6ea2d6a9 Update release note for v5.2.2 2022-03-25 13:56:57 +00:00
jeremy@jermolene.com
74d63c7003 Fix another inadvertent div-nested-in-span 2022-03-25 13:35:25 +00:00
jeremy@jermolene.com
e26a4d8cb5 Merge branch 'tiddlywiki-com' 2022-03-25 13:03:35 +00:00
jeremy@jermolene.com
d1bc079138 Remove rounded corners from new release banner
The CSS for the splash screen expects the image to be rectangular (the rounded corners get a pointed shadow which looks wrong)
2022-03-25 13:02:49 +00:00
jeremy@jermolene.com
ffd3599369 New Release Banner for v5.2.2
Thanks to Elise Springer: https://groups.google.com/g/tiddlywiki/c/y6OMgyQx2-k/m/laL5MszxAQAJ
2022-03-25 13:00:14 +00:00
Mario Pietsch
bfa5882175 German translation adjustments (#6554) 2022-03-24 10:47:24 +00:00
damscal
258f4acb10 Docs typo (#6556)
At the end of file, filerrunprefix --> filterrunprefix
2022-03-24 07:03:19 +00:00
damscal
7e85ec35d3 Signing the CLA (#6555) 2022-03-24 07:02:33 +00:00
675 changed files with 8455 additions and 21663 deletions

View File

@@ -1,43 +0,0 @@
---
name: Bug report
about: Create a report to help us improve TiddlyWiki 5
title: "[BUG]"
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**TiddlyWiki Configuration (please complete the following information):**
- Version [e.g. v5.1.24]
- Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc]
- Plugins installed [e.g. Freelinks, TiddlyMap]
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

67
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,67 @@
name: Bug report
description: Create a report to help us improve TiddlyWiki 5
title: "[BUG] "
body:
- type: textarea
id: Describe
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: Expected
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: false
- type: textarea
id: Reproduce
attributes:
label: To Reproduce
description: "Steps to reproduce the behavior:"
value: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: false
- type: textarea
id: Screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
placeholder: Drag image here to upload screenshot!
validations:
required: false
- type: textarea
id: Configuration
attributes:
label: TiddlyWiki Configuration
description: please complete the following information
value: |
- Version [e.g. v5.1.24]
- Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc]
- Plugins installed [e.g. Freelinks, TiddlyMap]
### Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
### Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
validations:
required: true
- type: textarea
id: Context
attributes:
label: Additional context
description: Add any other context about the problem here.

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Discuss feature request
url: https://github.com/Jermolene/TiddlyWiki5/discussions
about: Open new discussion about new feature
- name: Talk.Tiddlywiki Forum
url: https://talk.tiddlywiki.org
about: Join the Forum

View File

@@ -20,3 +20,11 @@ A clear and concise description of any alternative solutions or features you've
Add any other context or screenshots about the feature request here.
If you link to discussions elsewhere then please copy and paste the important text, and don't expect readers to scan the entire discussion to find the relevant part.
## Checklist before requesting a review
- [ ] Illustrate any visual changes (however minor) with before/after screenshots
- [ ] Self-review of code
- [ ] Documentation updates (for user-visible changes)
- [ ] Tests (for core code changes)
- [ ] Complies with coding style guidelines (for JavaScript code)

View File

@@ -5,7 +5,7 @@
# Default to the current version number for building the plugin library
if [ -z "$TW5_BUILD_VERSION" ]; then
TW5_BUILD_VERSION=v5.2.2
TW5_BUILD_VERSION=v5.2.3
fi
echo "Using TW5_BUILD_VERSION as [$TW5_BUILD_VERSION]"

View File

@@ -1230,13 +1230,16 @@ $tw.Wiki = function(options) {
this.getTiddler = function(title) {
if(title) {
var t = tiddlers[title];
if(t instanceof $tw.Tiddler) {
if(t !== undefined) {
return t;
} else if(title !== undefined && shadowTiddlers[title]) {
return shadowTiddlers[title].tiddler;
} else {
var s = shadowTiddlers[title];
if(s !== undefined) {
return s.tiddler;
}
}
return undefined;
}
return undefined;
};
// Get an array of all tiddler titles
@@ -2416,7 +2419,7 @@ $tw.boot.initStartup = function(options) {
$tw.utils.registerFileType("application/epub+zip","base64",".epub");
$tw.utils.registerFileType("application/octet-stream","base64",".octet-stream");
// Create the wiki store for the app
$tw.wiki = new $tw.Wiki();
$tw.wiki = new $tw.Wiki($tw.safeMode && {enableIndexers: []});
// Install built in tiddler fields modules
$tw.Tiddler.fieldModules = $tw.modules.getModulesByTypeAsHashmap("tiddlerfield");
// Install the tiddler deserializer modules
@@ -2596,7 +2599,7 @@ $tw.boot.isStartupTaskEligible = function(taskModule) {
for(t=0; t<remaining.length; t++) {
var task = remaining[t];
if(task.before && task.before.indexOf(name) !== -1) {
if($tw.boot.doesTaskMatchPlatform(task) || (task.name && $tw.boot.disabledStartupModules.indexOf(name) !== -1)) {
if($tw.boot.doesTaskMatchPlatform(task) && (!task.name || $tw.boot.disabledStartupModules.indexOf(task.name) === -1)) {
return false;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -18,6 +18,8 @@ CopyToClipboard/Caption: copy to clipboard
CopyToClipboard/Hint: Copy this text to the clipboard
Delete/Caption: delete
Delete/Hint: Delete this tiddler
DeleteTiddlers/Caption: delete tiddlers
DeleteTiddlers/Hint: Delete tiddlers
Edit/Caption: edit
Edit/Hint: Edit this tiddler
Encryption/Caption: encryption

View File

@@ -1,5 +1,6 @@
title: $:/language/EditTemplate/
Caption: Editor
Body/External/Hint: This tiddler shows content stored outside of the main TiddlyWiki file. You can edit the tags and fields but cannot directly edit the content itself
Body/Placeholder: Type the text for this tiddler
Body/Preview/Type/Output: output

View File

@@ -9,9 +9,10 @@ Before you start storing important information in ~TiddlyWiki it is vital to mak
<div class="tc-control-panel">
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
|<$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|tc-table-no-border tc-first-col-min-width tc-first-link-nowrap|k
| <$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link>|<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
| <$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link>|<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|^ <$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link><br><<lingo DefaultTiddlers/TopHint>>|<$edit tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
</div>
See the [[control panel|$:/ControlPanel]] for more options.

View File

@@ -3,6 +3,7 @@ title: $:/language/Help/default
\define commandTitle()
$:/language/Help/$(command)$
\end
\whitespace trim
```
usage: tiddlywiki [<wikifolder>] [--<command> [<args>...]...]
```
@@ -11,7 +12,9 @@ Available commands:
<ul>
<$list filter="[commands[]sort[title]]" variable="command">
<li><$link to=<<commandTitle>>><$macrocall $name="command" $type="text/plain" $output="text/plain"/></$link>: <$transclude tiddler=<<commandTitle>> field="description"/></li>
<li><$link to=<<commandTitle>>><$macrocall $name="command" $type="text/plain" $output="text/plain"/></$link>:
&#32;
<$transclude tiddler=<<commandTitle>> field="description"/></li>
</$list>
</ul>

View File

@@ -31,5 +31,5 @@ Notes:
Examples:
* `--render "[!is[system]]" "[encodeuricomponent[]addprefix[tiddlers/]addsuffix[.html]]"` -- renders all non-system tiddlers as files in the subdirectory "tiddlers" with URL-encoded titles and the extension HTML
* `--render '[!is[system]]' '[encodeuricomponent[]addprefix[tiddlers/]addsuffix[.html]]'` -- renders all non-system tiddlers as files in the subdirectory "tiddlers" with URL-encoded titles and the extension HTML
* `--render '.' 'tiddlers.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[HelloThere]]'` -- renders the tiddlers tagged "HelloThere" to a JSON file named "tiddlers.json"

View File

@@ -8,6 +8,7 @@ CloseAll/Button: close all
ColourPicker/Recent: Recent:
ConfirmCancelTiddler: Do you wish to discard changes to the tiddler "<$text text=<<title>>/>"?
ConfirmDeleteTiddler: Do you wish to delete the tiddler "<$text text=<<title>>/>"?
ConfirmDeleteTiddlers: Are you sure you wish to delete <<resultCount>> tiddler(s)?
ConfirmOverwriteTiddler: Do you wish to overwrite the tiddler "<$text text=<<title>>/>"?
ConfirmEditShadowTiddler: You are about to edit a ShadowTiddler. Any changes will override the default system making future upgrades non-trivial. Are you sure you want to edit "<$text text=<<title>>/>"?
ConfirmAction: Do you wish to proceed?

View File

@@ -1,5 +1,6 @@
title: $:/language/SideBar/
Caption: Sidebar
All/Caption: All
Contents/Caption: Contents
Drafts/Caption: Drafts

View File

@@ -50,7 +50,7 @@ Render individual tiddlers and save the results to the specified files
console.log("Rendering \"" + title + "\" to \"" + filepath + "\"");
}
var parser = wiki.parseTiddler(template || title),
widgetNode = wiki.makeWidget(parser,{variables: $tw.utils.extend({},variables,{currentTiddler: title})}),
widgetNode = wiki.makeWidget(parser,{variables: $tw.utils.extend({},variables,{currentTiddler: title,storyTiddler: title})}),
container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null);
var text = type === "text/html" ? container.innerHTML : container.textContent;

View File

@@ -40,6 +40,7 @@ Command.prototype.execute = function() {
$tw.utils.createFileDirectories(filename);
if(template) {
variables.currentTiddler = title;
variables.storyTiddler = title;
title = template;
}
if(name && value) {

View File

@@ -46,7 +46,7 @@ Command.prototype.execute = function() {
}
$tw.utils.each(tiddlers,function(title) {
var parser = wiki.parseTiddler(template),
widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}}),
widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title, storyTiddler: title}}),
container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null);
var text = type === "text/html" ? container.innerHTML : container.textContent,

View File

@@ -8,46 +8,60 @@ Saves individual tiddlers in their raw text or binary format to the specified fi
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
name: "save",
synchronous: true
};
var Command = function(params,commander,callback) {
this.params = params;
this.commander = commander;
this.callback = callback;
};
Command.prototype.execute = function() {
if(this.params.length < 1) {
return "Missing filename filter";
}
var self = this,
fs = require("fs"),
path = require("path"),
wiki = this.commander.wiki,
tiddlerFilter = this.params[0],
filenameFilter = this.params[1] || "[is[tiddler]]",
tiddlers = wiki.filterTiddlers(tiddlerFilter);
$tw.utils.each(tiddlers,function(title) {
var tiddler = self.commander.wiki.getTiddler(title),
type = tiddler.fields.type || "text/vnd.tiddlywiki",
contentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: "utf8"},
filepath = path.resolve(self.commander.outputPath,wiki.filterTiddlers(filenameFilter,$tw.rootWidget,wiki.makeTiddlerIterator([title]))[0]);
if(self.commander.verbose) {
console.log("Saving \"" + title + "\" to \"" + filepath + "\"");
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
name: "save",
synchronous: true
};
var Command = function(params,commander,callback) {
this.params = params;
this.commander = commander;
this.callback = callback;
};
Command.prototype.execute = function() {
if(this.params.length < 1) {
return "Missing filename filter";
}
$tw.utils.createFileDirectories(filepath);
fs.writeFileSync(filepath,tiddler.fields.text,contentTypeInfo.encoding);
});
return null;
};
exports.Command = Command;
})();
var self = this,
fs = require("fs"),
path = require("path"),
result = null,
wiki = this.commander.wiki,
tiddlerFilter = this.params[0],
filenameFilter = this.params[1] || "[is[tiddler]]",
tiddlers = wiki.filterTiddlers(tiddlerFilter);
$tw.utils.each(tiddlers,function(title) {
if(!result) {
var tiddler = self.commander.wiki.getTiddler(title);
if(tiddler) {
var fileInfo = $tw.utils.generateTiddlerFileInfo(tiddler,{
directory: path.resolve(self.commander.outputPath),
pathFilters: [filenameFilter],
wiki: wiki,
fileInfo: {}
});
if(self.commander.verbose) {
console.log("Saving \"" + title + "\" to \"" + fileInfo.filepath + "\"");
}
try {
$tw.utils.saveTiddlerToFileSync(tiddler,fileInfo);
} catch (err) {
result = "Error saving tiddler \"" + title + "\", to file: \"" + fileInfo.filepath + "\"";
}
} else {
result = "Tiddler '" + title + "' not found";
}
}
});
return result;
};
exports.Command = Command;
})();

View File

@@ -34,8 +34,10 @@ function FramedEngine(options) {
this.parentNode.insertBefore(this.iframeNode,this.nextSibling);
this.iframeDoc = this.iframeNode.contentWindow.document;
// (Firefox requires us to put some empty content in the iframe)
var paletteTitle = this.widget.wiki.getTiddlerText("$:/palette");
var colorScheme = (this.widget.wiki.getTiddler(paletteTitle) || {fields: {}}).fields["color-scheme"] || "light";
this.iframeDoc.open();
this.iframeDoc.write("");
this.iframeDoc.write("<meta name='color-scheme' content='" + colorScheme + "'>");
this.iframeDoc.close();
// Style the iframe
this.iframeNode.className = this.dummyTextArea.className;

View File

@@ -115,7 +115,7 @@ function editTextWidgetFactory(toolbarEngine,nonToolbarEngine) {
// Otherwise, we need to construct a default value for the editor
switch(this.editField) {
case "text":
value = "Type the text for the tiddler '" + this.editTitle + "'";
value = "";
type = "text/vnd.tiddlywiki";
break;
case "title":

View File

@@ -25,8 +25,8 @@ exports["prefix-lines"] = function(event,operation) {
$tw.utils.each(lines,function(line,index) {
// Remove and count any existing prefix characters
var count = 0;
while(line.charAt(0) === event.paramObject.character) {
line = line.substring(1);
while($tw.utils.startsWith(line,event.paramObject.character)) {
line = line.substring(event.paramObject.character.length);
count++;
}
// Remove any whitespace

View File

@@ -15,16 +15,33 @@ Text editor operation to wrap the selected lines with a prefix and suffix
exports["wrap-lines"] = function(event,operation) {
var prefix = event.paramObject.prefix || "",
suffix = event.paramObject.suffix || "";
// Cut just past the preceding line break, or the start of the text
operation.cutStart = $tw.utils.findPrecedingLineBreak(operation.text,operation.selStart);
// Cut to just past the following line break, or to the end of the text
operation.cutEnd = $tw.utils.findFollowingLineBreak(operation.text,operation.selEnd);
// Add the prefix and suffix
operation.replacement = prefix + "\n" +
operation.text.substring(operation.cutStart,operation.cutEnd) + "\n" +
suffix + "\n";
operation.newSelStart = operation.cutStart + prefix.length + 1;
operation.newSelEnd = operation.newSelStart + (operation.cutEnd - operation.cutStart);
if($tw.utils.endsWith(operation.text.substring(0,operation.selStart), prefix + "\n") &&
$tw.utils.startsWith(operation.text.substring(operation.selEnd), "\n" + suffix)) {
// Selected text is already surrounded by prefix and suffix: Remove them
// Cut selected text plus prefix and suffix
operation.cutStart = operation.selStart - (prefix.length + 1);
operation.cutEnd = operation.selEnd + suffix.length + 1;
// Also cut the following newline (if there is any)
if (operation.text[operation.cutEnd] === "\n") {
operation.cutEnd++;
}
// Replace with selection
operation.replacement = operation.text.substring(operation.selStart,operation.selEnd);
// Select text that was in between prefix and suffix
operation.newSelStart = operation.cutStart;
operation.newSelEnd = operation.selEnd - (prefix.length + 1);
} else {
// Cut just past the preceding line break, or the start of the text
operation.cutStart = $tw.utils.findPrecedingLineBreak(operation.text,operation.selStart);
// Cut to just past the following line break, or to the end of the text
operation.cutEnd = $tw.utils.findFollowingLineBreak(operation.text,operation.selEnd);
// Add the prefix and suffix
operation.replacement = prefix + "\n" +
operation.text.substring(operation.cutStart,operation.cutEnd) + "\n" +
suffix + "\n";
operation.newSelStart = operation.cutStart + prefix.length + 1;
operation.newSelEnd = operation.newSelStart + (operation.cutEnd - operation.cutStart);
}
};
})();

View File

@@ -16,7 +16,9 @@ exports.map = function(operationSubFunction,options) {
return function(results,source,widget) {
if(results.length > 0) {
var inputTitles = results.toArray(),
index = 0;
index = 0,
suffixes = options.suffixes,
flatten = (suffixes[0] && suffixes[0][0] === "flat") ? true : false;
results.clear();
$tw.utils.each(inputTitles,function(title) {
var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([title]),{
@@ -36,7 +38,13 @@ exports.map = function(operationSubFunction,options) {
}
}
});
results.push(filtered[0] || "");
if(filtered.length && flatten) {
$tw.utils.each(filtered,function(value) {
results.push(value);
})
} else {
results.push(filtered[0]||"");
}
++index;
});
}

View File

@@ -220,10 +220,18 @@ source: an iterator function for the source tiddlers, called source(iterator), w
widget: an optional widget node for retrieving the current tiddler etc.
*/
exports.compileFilter = function(filterString) {
if(!this.filterCache) {
this.filterCache = Object.create(null);
this.filterCacheCount = 0;
}
if(this.filterCache[filterString] !== undefined) {
return this.filterCache[filterString];
}
var filterParseTree;
try {
filterParseTree = this.parseFilter(filterString);
} catch(e) {
// We do not cache this result, so it adjusts along with localization changes
return function(source,widget) {
return [$tw.language.getString("Error/Filter") + ": " + e];
};
@@ -320,7 +328,7 @@ exports.compileFilter = function(filterString) {
})());
});
// Return a function that applies the operations to a source iterator of tiddler titles
return $tw.perf.measure("filter: " + filterString,function filterFunction(source,widget) {
var compiled = $tw.perf.measure("filter: " + filterString,function filterFunction(source,widget) {
if(!source) {
source = self.each;
} else if(typeof source === "object") { // Array or hashmap
@@ -335,6 +343,16 @@ exports.compileFilter = function(filterString) {
});
return results.toArray();
});
if(this.filterCacheCount >= 2000) {
// To prevent memory leak, we maintain an upper limit for cache size.
// Reset if exceeded. This should give us 95% of the benefit
// that no cache limit would give us.
this.filterCache = Object.create(null);
this.filterCacheCount = 0;
}
this.filterCache[filterString] = compiled;
this.filterCacheCount++;
return compiled;
};
})();

View File

@@ -0,0 +1,35 @@
/*\
title: $:/core/modules/filters/format/json.js
type: application/javascript
module-type: formatfilteroperator
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.json = function(source,operand,options) {
var results = [],
spaces = null;
if(operand) {
spaces = /^\d+$/.test(operand) ? parseInt(operand,10) : operand;
}
source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title);
try {
data = JSON.parse(title);
} catch(e) {
data = undefined;
}
if(data !== undefined) {
results.push(JSON.stringify(data,null,spaces));
}
});
return results;
};
})();

View File

@@ -0,0 +1,46 @@
/*\
title: $:/core/modules/filters/insertafter.js
type: application/javascript
module-type: filteroperator
Insert an item after another item in a list
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Order a list
*/
exports.insertafter = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
results.push(title);
});
var target = operator.operands[1] || (options.widget && options.widget.getVariable(operator.suffix || "currentTiddler"));
if(target !== operator.operand) {
// Remove the entry from the list if it is present
var pos = results.indexOf(operator.operand);
if(pos !== -1) {
results.splice(pos,1);
}
// Insert the entry after the target marker
pos = results.indexOf(target);
if(pos !== -1) {
results.splice(pos+1,0,operator.operand);
} else {
var suffix = operator.operands.length > 1 ? operator.suffix : "";
if(suffix === "start") {
results.splice(0,0,operator.operand);
} else {
results.push(operator.operand);
}
}
}
return results;
};
})();

View File

@@ -32,7 +32,12 @@ exports.insertbefore = function(source,operator,options) {
if(pos !== -1) {
results.splice(pos,0,operator.operand);
} else {
results.push(operator.operand);
var suffix = operator.operands.length > 1 ? operator.suffix : "";
if(suffix == "start") {
results.splice(0,0,operator.operand);
} else {
results.push(operator.operand);
}
}
}
return results;

View File

@@ -0,0 +1,153 @@
/*\
title: $:/core/modules/filters/json-ops.js
type: application/javascript
module-type: filteroperator
Filter operators for JSON operations
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports["jsonget"] = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title,title);
if(data) {
var item = getDataItemValueAsString(data,operator.operands);
if(item !== undefined) {
results.push(item);
}
}
});
return results;
};
exports["jsonindexes"] = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title,title);
if(data) {
var item = getDataItemKeysAsStrings(data,operator.operands);
if(item !== undefined) {
results.push.apply(results,item);
}
}
});
return results;
};
exports["jsontype"] = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
var data = $tw.utils.parseJSONSafe(title,title);
if(data) {
var item = getDataItemType(data,operator.operands);
if(item !== undefined) {
results.push(item);
}
}
});
return results;
};
/*
Given a JSON data structure and an array of index strings, return an array of the string representation of the values at the end of the index chain, or "undefined" if any of the index strings are invalid
*/
function getDataItemValueAsString(data,indexes) {
// Get the item
var item = getDataItem(data,indexes);
// Return the item as a string
return convertDataItemValueToString(item);
}
/*
Given a JSON data structure and an array of index strings, return an array of the string representation of the keys of the item at the end of the index chain, or "undefined" if any of the index strings are invalid
*/
function getDataItemKeysAsStrings(data,indexes) {
// Get the item
var item = getDataItem(data,indexes);
// Return the item keys as a string
return convertDataItemKeysToStrings(item);
}
/*
Return an array of the string representation of the values of a data item, or "undefined" if the item is undefined
*/
function convertDataItemValueToString(item) {
// Return the item as a string
if(item === undefined) {
return item;
}
if(typeof item === "object") {
return JSON.stringify(item);
}
return item.toString();
}
/*
Return an array of the string representation of the keys of a data item, or "undefined" if the item is undefined
*/
function convertDataItemKeysToStrings(item) {
// Return the item as a string
if(item === undefined) {
return item;
} else if(typeof item === "object") {
if(item === null) {
return [];
}
var results = [];
if($tw.utils.isArray(item)) {
for(var i=0; i<item.length; i++) {
results.push(i.toString());
}
return results;
} else {
$tw.utils.each(Object.keys(item).sort(),function(key) {
results.push(key);
});
return results;
}
}
return [];
}
function getDataItemType(data,indexes) {
// Get the item
var item = getDataItem(data,indexes);
// Return the item type
if(item === undefined) {
return item;
} else if(item === null) {
return "null";
} else if($tw.utils.isArray(item)) {
return "array";
} else if(typeof item === "object") {
return "object";
} else {
return typeof item;
}
}
/*
Given a JSON data structure and an array of index strings, return the value at the end of the index chain, or "undefined" if any of the index strings are invalid
*/
function getDataItem(data,indexes) {
if(indexes.length === 0 || (indexes.length === 1 && indexes[0] === "")) {
return data;
}
// Get the item
var item = data;
for(var i=0; i<indexes.length; i++) {
if(item !== undefined) {
item = item[indexes[i]];
}
}
return item;
}
})();

View File

@@ -116,7 +116,7 @@ WikiParser.prototype.loadRemoteTiddler = function(url) {
*/
WikiParser.prototype.setupRules = function(proto,configPrefix) {
var self = this;
if(!$tw.safemode) {
if(!$tw.safeMode) {
$tw.utils.each(proto,function(object,name) {
if(self.wiki.getTiddlerText(configPrefix + name,"enable") !== "enable") {
delete proto[name];

View File

@@ -80,6 +80,7 @@ PutSaver.prototype.save = function(text,method,callback) {
if(this.etag) {
headers["If-Match"] = this.etag;
}
$tw.notifier.display("$:/language/Notifications/Save/Starting");
$tw.utils.httpRequest({
url: this.uri(),
type: "PUT",
@@ -87,17 +88,20 @@ PutSaver.prototype.save = function(text,method,callback) {
data: text,
callback: function(err,data,xhr) {
if(err) {
// response is textual: "XMLHttpRequest error code: 412"
var status = Number(err.substring(err.indexOf(':') + 2, err.length))
var status = xhr.status,
errorMsg = err;
if(status === 412) { // file changed on server
callback($tw.language.getString("Error/PutEditConflict"));
errorMsg = $tw.language.getString("Error/PutEditConflict");
} else if(status === 401) { // authentication required
callback($tw.language.getString("Error/PutUnauthorized"));
errorMsg = $tw.language.getString("Error/PutUnauthorized");
} else if(status === 403) { // permission denied
callback($tw.language.getString("Error/PutForbidden"));
} else {
callback(err); // fail
errorMsg = $tw.language.getString("Error/PutForbidden");
}
if (xhr.responseText) {
// treat any server response like a plain text error explanation
errorMsg = errorMsg + "\n\n" + xhr.responseText;
}
callback(errorMsg); // fail
} else {
self.etag = xhr.getResponseHeader("ETag");
if(self.etag == null) {

View File

@@ -64,6 +64,7 @@ UploadSaver.prototype.save = function(text,method,callback) {
var tail = "\r\n--" + boundary + "--\r\n",
data = head.join("\r\n") + text + tail;
// Do the HTTP post
$tw.notifier.display("$:/language/Notifications/Save/Starting");
var http = new XMLHttpRequest();
http.open("POST",url,true,username,password);
http.setRequestHeader("Content-Type","multipart/form-data; charset=UTF-8; boundary=" + boundary);
@@ -81,7 +82,6 @@ UploadSaver.prototype.save = function(text,method,callback) {
} catch(ex) {
return callback($tw.language.getString("Error/Caption") + ":" + ex);
}
$tw.notifier.display("$:/language/Notifications/Save/Starting");
return true;
};

View File

@@ -359,8 +359,9 @@ Server.prototype.listen = function(port,host,prefix) {
}
// Display the port number after we've started listening (the port number might have been specified as zero, in which case we will get an assigned port)
server.on("listening",function() {
var address = server.address();
$tw.utils.log("Serving on " + self.protocol + "://" + address.address + ":" + address.port + prefix,"brown/orange");
var address = server.address(),
url = self.protocol + "://" + (address.family === "IPv6" ? "[" + address.address + "]" : address.address) + ":" + address.port + prefix;
$tw.utils.log("Serving on " + url,"brown/orange");
$tw.utils.log("(press ctrl-C to exit)","red");
});
// Listen

View File

@@ -62,12 +62,14 @@ function loadIFrame(url,callback) {
Unload library iframe for given url
*/
function unloadIFrame(url){
$tw.utils.each(document.getElementsByTagName('iframe'), function(iframe) {
var iframes = document.getElementsByTagName('iframe');
for(var t=iframes.length-1; t--; t>=0) {
var iframe = iframes[t];
if(iframe.getAttribute("library") === "true" &&
iframe.getAttribute("src") === url) {
iframe.parentNode.removeChild(iframe);
}
});
}
}
function saveIFrameInfoTiddler(iframeInfo) {

View File

@@ -54,7 +54,9 @@ exports.startup = function() {
var hash = $tw.utils.getLocationHash();
if(hash !== $tw.locationHash) {
$tw.locationHash = hash;
openStartupTiddlers({defaultToCurrentStory: true});
if(hash !== "#") {
openStartupTiddlers({defaultToCurrentStory: true});
}
}
},false);
// Listen for the tm-browser-refresh message

View File

@@ -281,5 +281,56 @@ exports.getLocationPath = function() {
return window.location.toString().split("#")[0];
};
/*
Collect DOM variables
*/
exports.collectDOMVariables = function(selectedNode,domNode,event) {
var variables = {},
selectedNodeRect,
domNodeRect;
if(selectedNode) {
$tw.utils.each(selectedNode.attributes,function(attribute) {
variables["dom-" + attribute.name] = attribute.value.toString();
});
if(selectedNode.offsetLeft) {
// Add a variable with a popup coordinate string for the selected node
variables["tv-popup-coords"] = "(" + selectedNode.offsetLeft + "," + selectedNode.offsetTop +"," + selectedNode.offsetWidth + "," + selectedNode.offsetHeight + ")";
// Add variables for offset of selected node
variables["tv-selectednode-posx"] = selectedNode.offsetLeft.toString();
variables["tv-selectednode-posy"] = selectedNode.offsetTop.toString();
variables["tv-selectednode-width"] = selectedNode.offsetWidth.toString();
variables["tv-selectednode-height"] = selectedNode.offsetHeight.toString();
}
}
if(domNode && domNode.offsetWidth) {
variables["tv-widgetnode-width"] = domNode.offsetWidth.toString();
variables["tv-widgetnode-height"] = domNode.offsetHeight.toString();
}
if(event && event.clientX && event.clientY) {
if(selectedNode) {
// Add variables for event X and Y position relative to selected node
selectedNodeRect = selectedNode.getBoundingClientRect();
variables["event-fromselected-posx"] = (event.clientX - selectedNodeRect.left).toString();
variables["event-fromselected-posy"] = (event.clientY - selectedNodeRect.top).toString();
}
if(domNode) {
// Add variables for event X and Y position relative to event catcher node
domNodeRect = domNode.getBoundingClientRect();
variables["event-fromcatcher-posx"] = (event.clientX - domNodeRect.left).toString();
variables["event-fromcatcher-posy"] = (event.clientY - domNodeRect.top).toString();
}
// Add variables for event X and Y position relative to the viewport
variables["event-fromviewport-posx"] = event.clientX.toString();
variables["event-fromviewport-posy"] = event.clientY.toString();
}
return variables;
};
})();

View File

@@ -25,14 +25,13 @@ widget: widget to use as the context for the filter
exports.makeDraggable = function(options) {
var dragImageType = options.dragImageType || "dom",
dragImage,
domNode = options.domNode,
dragHandle = options.selector && domNode.querySelector(options.selector) || domNode;
domNode = options.domNode;
// Make the dom node draggable (not necessary for anchor tags)
if((domNode.tagName || "").toLowerCase() !== "a") {
dragHandle.setAttribute("draggable","true");
if(!options.selector && ((domNode.tagName || "").toLowerCase() !== "a")) {
domNode.setAttribute("draggable","true");
}
// Add event handlers
$tw.utils.addEventListeners(dragHandle,[
$tw.utils.addEventListeners(domNode,[
{name: "dragstart", handlerFunction: function(event) {
if(event.dataTransfer === undefined) {
return false;
@@ -41,20 +40,26 @@ exports.makeDraggable = function(options) {
var dragTiddler = options.dragTiddlerFn && options.dragTiddlerFn(),
dragFilter = options.dragFilterFn && options.dragFilterFn(),
titles = dragTiddler ? [dragTiddler] : [],
startActions = options.startActions;
startActions = options.startActions,
variables,
domNodeRect;
if(dragFilter) {
titles.push.apply(titles,options.widget.wiki.filterTiddlers(dragFilter,options.widget));
}
var titleString = $tw.utils.stringifyList(titles);
// Check that we've something to drag
if(titles.length > 0 && event.target === dragHandle) {
if(titles.length > 0 && (options.selector && $tw.utils.domMatchesSelector(event.target,options.selector) || event.target === domNode)) {
// Mark the drag in progress
$tw.dragInProgress = domNode;
// Set the dragging class on the element being dragged
$tw.utils.addClass(event.target,"tc-dragging");
$tw.utils.addClass(domNode,"tc-dragging");
// Invoke drag-start actions if given
if(startActions !== undefined) {
options.widget.invokeActionString(startActions,options.widget,event,{actionTiddler: titleString});
// Collect our variables
variables = $tw.utils.collectDOMVariables(domNode,null,event);
variables.modifier = $tw.keyboardManager.getEventModifierKeyDescriptor(event);
variables["actionTiddler"] = titleString;
options.widget.invokeActionString(startActions,options.widget,event,variables);
}
// Create the drag image elements
dragImage = options.widget.document.createElement("div");
@@ -101,20 +106,22 @@ exports.makeDraggable = function(options) {
dataTransfer.setData("text/vnd.tiddler",jsonData);
dataTransfer.setData("text/plain",titleString);
dataTransfer.setData("text/x-moz-url","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
} else {
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
}
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURIComponent(jsonData));
dataTransfer.setData("Text",titleString);
event.stopPropagation();
}
return false;
}},
{name: "dragend", handlerFunction: function(event) {
if(event.target === domNode) {
if((options.selector && $tw.utils.domMatchesSelector(event.target,options.selector)) || event.target === domNode) {
// Collect the tiddlers being dragged
var dragTiddler = options.dragTiddlerFn && options.dragTiddlerFn(),
dragFilter = options.dragFilterFn && options.dragFilterFn(),
titles = dragTiddler ? [dragTiddler] : [],
endActions = options.endActions;
endActions = options.endActions,
variables;
if(dragFilter) {
titles.push.apply(titles,options.widget.wiki.filterTiddlers(dragFilter,options.widget));
}
@@ -122,10 +129,13 @@ exports.makeDraggable = function(options) {
$tw.dragInProgress = null;
// Invoke drag-end actions if given
if(endActions !== undefined) {
options.widget.invokeActionString(endActions,options.widget,event,{actionTiddler: titleString});
variables = $tw.utils.collectDOMVariables(domNode,null,event);
variables.modifier = $tw.keyboardManager.getEventModifierKeyDescriptor(event);
variables["actionTiddler"] = titleString;
options.widget.invokeActionString(endActions,options.widget,event,variables);
}
// Remove the dragging class on the element being dragged
$tw.utils.removeClass(event.target,"tc-dragging");
$tw.utils.removeClass(domNode,"tc-dragging");
// Delete the drag image element
if(dragImage) {
dragImage.parentNode.removeChild(dragImage);

View File

@@ -36,8 +36,9 @@ Notifier.prototype.display = function(title,options) {
if(!tiddler) {
return;
}
// Add classes
// Add classes and roles
$tw.utils.addClass(notification,"tc-notification");
notification.setAttribute("role","alert");
// Create the variables
var variables = $tw.utils.extend({currentTiddler: title},options.variables);
// Render the body of the notification

View File

@@ -42,7 +42,7 @@ var TW_TextNode = function(text) {
this.textContent = text + "";
};
TW_TextNode.prototype = Object.create(TW_Node.prototype);
Object.setPrototypeOf(TW_TextNode,TW_Node.prototype);
Object.defineProperty(TW_TextNode.prototype, "nodeType", {
get: function() {
@@ -67,7 +67,7 @@ var TW_Element = function(tag,namespace) {
this.namespaceURI = namespace || "http://www.w3.org/1999/xhtml";
};
TW_Element.prototype = Object.create(TW_Node.prototype);
Object.setPrototypeOf(TW_Element,TW_Node.prototype);
Object.defineProperty(TW_Element.prototype, "style", {
get: function() {

View File

@@ -48,7 +48,9 @@ Logger.prototype.log = function(/* args */) {
this.saveBufferLogger.buffer = this.saveBufferLogger.buffer.slice(-this.saveBufferLogger.saveLimit);
}
if(console !== undefined && console.log !== undefined) {
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()));
var logMessage = [$tw.utils.terminalColour(this.colour) + this.componentName + ":"].concat(Array.prototype.slice.call(arguments,0));
logMessage[logMessage.length-1] += $tw.utils.terminalColour();
return Function.apply.call(console.log, console, logMessage);
}
}
};

View File

@@ -12,9 +12,41 @@ Parse tree utility functions.
/*global $tw: false */
"use strict";
/*
Add attribute to parse tree node
Can be invoked as (node,name,value) or (node,attr)
*/
exports.addAttributeToParseTreeNode = function(node,name,value) {
var attribute = typeof name === "object" ? name : {name: name, type: "string", value: value};
name = attribute.name;
node.attributes = node.attributes || {};
node.attributes[name] = {type: "string", value: value};
node.orderedAttributes = node.orderedAttributes || [];
node.attributes[name] = attribute;
var foundIndex = -1;
$tw.utils.each(node.orderedAttributes,function(attr,index) {
if(attr.name === name) {
foundIndex = index;
}
});
if(foundIndex === -1) {
node.orderedAttributes.push(attribute);
} else {
node.orderedAttributes[foundIndex] = attribute;
}
};
exports.getOrderedAttributesFromParseTreeNode = function(node) {
if(node.orderedAttributes) {
return node.orderedAttributes;
} else {
var attributes = [];
$tw.utils.each(node.attributes,function(attribute) {
attributes.push(attribute);
});
return attributes.sort(function(a,b) {
return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0);
});
}
};
exports.getAttributeValueFromParseTreeNode = function(node,name,defaultValue) {
@@ -25,26 +57,45 @@ exports.getAttributeValueFromParseTreeNode = function(node,name,defaultValue) {
};
exports.addClassToParseTreeNode = function(node,classString) {
var classes = [];
var classes = [],
attribute;
node.attributes = node.attributes || {};
node.attributes["class"] = node.attributes["class"] || {type: "string", value: ""};
if(node.attributes["class"].type === "string") {
if(node.attributes["class"].value !== "") {
classes = node.attributes["class"].value.split(" ");
attribute = node.attributes["class"];
if(!attribute) {
// If the class attribute does not exist, we must create it first.
attribute = {name: "class", type: "string", value: ""};
node.attributes["class"] = attribute;
if(node.orderedAttributes) {
// If there are orderedAttributes, we've got to add them there too.
node.orderedAttributes.push(attribute);
}
}
if(attribute.type === "string") {
if(attribute.value !== "") {
classes = attribute.value.split(" ");
}
if(classString !== "") {
$tw.utils.pushTop(classes,classString.split(" "));
}
node.attributes["class"].value = classes.join(" ");
attribute.value = classes.join(" ");
}
};
exports.addStyleToParseTreeNode = function(node,name,value) {
node.attributes = node.attributes || {};
node.attributes.style = node.attributes.style || {type: "string", value: ""};
if(node.attributes.style.type === "string") {
node.attributes.style.value += name + ":" + value + ";";
var attribute;
node.attributes = node.attributes || {};
attribute = node.attributes.style;
if(!attribute) {
attribute = {name: "style", type: "string", value: ""};
node.attributes.style = attribute;
if(node.orderedAttributes) {
// If there are orderedAttributes, we've got to add them there too.
node.orderedAttributes.push(attribute);
}
}
if(attribute.type === "string") {
attribute.value += name + ":" + value + ";";
}
};
exports.findParseTreeNode = function(nodeArray,search) {

View File

@@ -95,6 +95,20 @@ exports.repeat = function(str,count) {
return result;
};
/*
Check if a string starts with another string
*/
exports.startsWith = function(str,search) {
return str.substring(0, search.length) === search;
};
/*
Check if a string ends with another string
*/
exports.endsWith = function(str,search) {
return str.substring(str.length - search.length) === search;
};
/*
Trim whitespace from the start and end of a string
Thanks to Steven Levithan, http://blog.stevenlevithan.com/archives/faster-trim-javascript
@@ -448,7 +462,7 @@ exports.formatDateString = function(date,template) {
// 'return raw UTC (tiddlywiki style) date string.'
if(t.indexOf("[UTC]") == 0 ) {
if(t == "[UTC]YYYY0MM0DD0hh0mm0ssXXX")
return $tw.utils.stringifyDate(new Date());
return $tw.utils.stringifyDate(date || new Date());
var offset = date.getTimezoneOffset() ; // in minutes
date = new Date(date.getTime()+offset*60*1000) ;
t = t.substr(5) ;

View File

@@ -36,7 +36,7 @@ Compute the internal state of the widget
*/
DeleteFieldWidget.prototype.execute = function() {
this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
this.actionField = this.getAttribute("$field");
this.actionField = this.getAttribute("$field",null);
};
/*
@@ -59,7 +59,7 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
tiddler = this.wiki.getTiddler(self.actionTiddler),
removeFields = {},
hasChanged = false;
if(this.actionField && tiddler) {
if((this.actionField !== null) && tiddler) {
removeFields[this.actionField] = undefined;
if(this.actionField in tiddler.fields) {
hasChanged = true;

View File

@@ -35,7 +35,7 @@ SetFieldWidget.prototype.render = function(parent,nextSibling) {
Compute the internal state of the widget
*/
SetFieldWidget.prototype.execute = function() {
this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
this.actionTiddler = this.getAttribute("$tiddler") || (!this.hasParseTreeNodeAttribute("$tiddler") && this.getVariable("currentTiddler"));
this.actionField = this.getAttribute("$field");
this.actionIndex = this.getAttribute("$index");
this.actionValue = this.getAttribute("$value");
@@ -46,11 +46,7 @@ SetFieldWidget.prototype.execute = function() {
Refresh the widget by ensuring our attributes are up to date
*/
SetFieldWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes["$tiddler"] || changedAttributes["$field"] || changedAttributes["$index"] || changedAttributes["$value"]) {
this.refreshSelf();
return true;
}
// Nothing to refresh
return this.refreshChildren(changedTiddlers);
};
@@ -60,15 +56,17 @@ Invoke the action associated with this widget
SetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
var self = this,
options = {};
options.suppressTimestamp = !this.actionTimestamp;
if((typeof this.actionField == "string") || (typeof this.actionIndex == "string") || (typeof this.actionValue == "string")) {
this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options);
}
$tw.utils.each(this.attributes,function(attribute,name) {
if(name.charAt(0) !== "$") {
self.wiki.setText(self.actionTiddler,name,undefined,attribute,options);
if(this.actionTiddler) {
options.suppressTimestamp = !this.actionTimestamp;
if((typeof this.actionField == "string") || (typeof this.actionIndex == "string") || (typeof this.actionValue == "string")) {
this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options);
}
});
$tw.utils.each(this.attributes,function(attribute,name) {
if(name.charAt(0) !== "$") {
self.wiki.setText(self.actionTiddler,name,undefined,attribute,options);
}
});
}
return true; // Action was invoked
};

View File

@@ -46,7 +46,8 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
isPoppedUp = (this.popup || this.popupTitle) && this.isPoppedUp();
if(this.selectedClass) {
if((this.set || this.setTitle) && this.setTo && this.isSelected()) {
$tw.utils.pushTop(classes,this.selectedClass.split(" "));
$tw.utils.pushTop(classes, this.selectedClass.split(" "));
domNode.setAttribute("aria-checked", "true");
}
if(isPoppedUp) {
$tw.utils.pushTop(classes,this.selectedClass.split(" "));
@@ -66,6 +67,9 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
if(this["aria-label"]) {
domNode.setAttribute("aria-label",this["aria-label"]);
}
if (this.role) {
domNode.setAttribute("role", this.role);
}
if(this.popup || this.popupTitle) {
domNode.setAttribute("aria-expanded",isPoppedUp ? "true" : "false");
}
@@ -206,6 +210,7 @@ ButtonWidget.prototype.execute = function() {
this.popup = this.getAttribute("popup");
this.hover = this.getAttribute("hover");
this["aria-label"] = this.getAttribute("aria-label");
this.role = this.getAttribute("role");
this.tooltip = this.getAttribute("tooltip");
this.style = this.getAttribute("style");
this["class"] = this.getAttribute("class","");

View File

@@ -27,6 +27,7 @@ CheckboxWidget.prototype = new Widget();
Render this widget into the DOM
*/
CheckboxWidget.prototype.render = function(parent,nextSibling) {
var isChecked;
// Save the parent dom node
this.parentDomNode = parent;
// Compute our attributes
@@ -35,11 +36,16 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) {
this.execute();
// Create our elements
this.labelDomNode = this.document.createElement("label");
this.labelDomNode.setAttribute("class",this.checkboxClass);
this.labelDomNode.setAttribute("class","tc-checkbox " + this.checkboxClass);
this.inputDomNode = this.document.createElement("input");
this.inputDomNode.setAttribute("type","checkbox");
if(this.getValue()) {
isChecked = this.getValue();
if(isChecked) {
this.inputDomNode.setAttribute("checked","true");
$tw.utils.addClass(this.labelDomNode,"tc-checkbox-checked");
}
if(isChecked === undefined && this.checkboxIndeterminate === "yes") {
this.inputDomNode.indeterminate = true;
}
if(this.isDisabled === "yes") {
this.inputDomNode.setAttribute("disabled",true);
@@ -59,20 +65,25 @@ CheckboxWidget.prototype.render = function(parent,nextSibling) {
CheckboxWidget.prototype.getValue = function() {
var tiddler = this.wiki.getTiddler(this.checkboxTitle);
if(tiddler) {
if(this.checkboxTag) {
if(this.checkboxInvertTag) {
if(tiddler || this.checkboxFilter) {
if(tiddler && this.checkboxTag) {
if(this.checkboxInvertTag === "yes") {
return !tiddler.hasTag(this.checkboxTag);
} else {
return tiddler.hasTag(this.checkboxTag);
}
}
if(this.checkboxField) {
if(tiddler && (this.checkboxField || this.checkboxIndex)) {
// Same logic applies to fields and indexes
var value;
if($tw.utils.hop(tiddler.fields,this.checkboxField)) {
value = tiddler.fields[this.checkboxField] || "";
if(this.checkboxField) {
if($tw.utils.hop(tiddler.fields,this.checkboxField)) {
value = tiddler.fields[this.checkboxField] || "";
} else {
value = this.checkboxDefault || "";
}
} else {
value = this.checkboxDefault || "";
value = this.wiki.extractTiddlerDataItem(tiddler,this.checkboxIndex,this.checkboxDefault || "");
}
if(value === this.checkboxChecked) {
return true;
@@ -80,15 +91,59 @@ CheckboxWidget.prototype.getValue = function() {
if(value === this.checkboxUnchecked) {
return false;
}
// Neither value found: were both specified?
if(this.checkboxChecked && !this.checkboxUnchecked) {
return false; // Absence of checked value
}
if(this.checkboxUnchecked && !this.checkboxChecked) {
return true; // Absence of unchecked value
}
if(this.checkboxChecked && this.checkboxUnchecked) {
// Both specified but neither found: indeterminate or false, depending
if(this.checkboxIndeterminate === "yes") {
return undefined;
} else {
return false;
}
}
}
if(this.checkboxIndex) {
var value = this.wiki.extractTiddlerDataItem(tiddler,this.checkboxIndex,this.checkboxDefault || "");
if(value === this.checkboxChecked) {
if(this.checkboxListField || this.checkboxListIndex || this.checkboxFilter) {
// Same logic applies to lists and filters
var list;
if(this.checkboxListField) {
if($tw.utils.hop(tiddler.fields,this.checkboxListField)) {
list = tiddler.getFieldList(this.checkboxListField);
} else {
list = $tw.utils.parseStringArray(this.checkboxDefault || "") || [];
}
} else if (this.checkboxListIndex) {
list = $tw.utils.parseStringArray(this.wiki.extractTiddlerDataItem(tiddler,this.checkboxListIndex,this.checkboxDefault || "")) || [];
} else {
list = this.wiki.filterTiddlers(this.checkboxFilter,this) || [];
}
if(list.indexOf(this.checkboxChecked) !== -1) {
return true;
}
if(value === this.checkboxUnchecked) {
if(list.indexOf(this.checkboxUnchecked) !== -1) {
return false;
}
// Neither one present
if(this.checkboxChecked && !this.checkboxUnchecked) {
return false; // Absence of checked value
}
if(this.checkboxUnchecked && !this.checkboxChecked) {
return true; // Absence of unchecked value
}
if(this.checkboxChecked && this.checkboxUnchecked) {
// Both specified but neither found: indeterminate or false, depending
if(this.checkboxIndeterminate === "yes") {
return undefined;
} else {
return false;
}
}
// Neither specified, so empty list is false, non-empty is true
return !!list.length;
}
} else {
if(this.checkboxTag) {
@@ -114,7 +169,8 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
hasChanged = false,
tagCheck = false,
hasTag = tiddler && tiddler.hasTag(this.checkboxTag),
value = checked ? this.checkboxChecked : this.checkboxUnchecked;
value = checked ? this.checkboxChecked : this.checkboxUnchecked,
notValue = checked ? this.checkboxUnchecked : this.checkboxChecked;
if(this.checkboxTag && this.checkboxInvertTag === "yes") {
tagCheck = hasTag === checked;
} else {
@@ -148,9 +204,58 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
hasChanged = true;
}
}
// Set the list field (or index) if specified
if(this.checkboxListField || this.checkboxListIndex) {
var fieldContents, listContents, oldPos, newPos;
if(this.checkboxListField) {
fieldContents = tiddler ? tiddler.fields[this.checkboxListField] : undefined;
} else {
fieldContents = this.wiki.extractTiddlerDataItem(this.checkboxTitle,this.checkboxListIndex);
}
if($tw.utils.isArray(fieldContents)) {
// Make a copy so we can modify it without changing original that's refrenced elsewhere
listContents = fieldContents.slice(0);
} else {
listContents = $tw.utils.parseStringArray(fieldContents) || [];
// No need to copy since parseStringArray returns a fresh array, not refrenced elsewhere
}
oldPos = notValue ? listContents.indexOf(notValue) : -1;
newPos = value ? listContents.indexOf(value) : -1;
if(oldPos === -1 && newPos !== -1) {
// old value absent, new value present: no change needed
} else if(oldPos === -1) {
// neither one was present
if(value) {
listContents.push(value);
hasChanged = true;
} else {
// value unspecified? then leave list unchanged
}
} else if(newPos === -1) {
// old value present, new value absent
if(value) {
listContents[oldPos] = value;
hasChanged = true;
} else {
listContents.splice(oldPos, 1)
hasChanged = true;
}
} else {
// both were present: just remove the old one, leave new alone
listContents.splice(oldPos, 1)
hasChanged = true;
}
if(this.checkboxListField) {
newFields[this.checkboxListField] = $tw.utils.stringifyList(listContents);
}
// The listIndex case will be handled in the if(hasChanged) block below
}
if(hasChanged) {
if(this.checkboxIndex) {
this.wiki.setText(this.checkboxTitle,"",this.checkboxIndex,value);
} else if(this.checkboxListIndex) {
var listIndexValue = (listContents && listContents.length) ? $tw.utils.stringifyList(listContents) : undefined;
this.wiki.setText(this.checkboxTitle,"",this.checkboxListIndex,listIndexValue);
} else {
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),fallbackFields,tiddler,newFields,this.wiki.getModificationFields()));
}
@@ -179,9 +284,13 @@ CheckboxWidget.prototype.execute = function() {
this.checkboxTag = this.getAttribute("tag");
this.checkboxField = this.getAttribute("field");
this.checkboxIndex = this.getAttribute("index");
this.checkboxListField = this.getAttribute("listField");
this.checkboxListIndex = this.getAttribute("listIndex");
this.checkboxFilter = this.getAttribute("filter");
this.checkboxChecked = this.getAttribute("checked");
this.checkboxUnchecked = this.getAttribute("unchecked");
this.checkboxDefault = this.getAttribute("default");
this.checkboxIndeterminate = this.getAttribute("indeterminate","no");
this.checkboxClass = this.getAttribute("class","");
this.checkboxInvertTag = this.getAttribute("invertTag","");
this.isDisabled = this.getAttribute("disabled","no");
@@ -194,14 +303,21 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
CheckboxWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes["class"] || changedAttributes.disabled) {
if(changedAttributes.tiddler || changedAttributes.tag || changedAttributes.invertTag || changedAttributes.field || changedAttributes.index || changedAttributes.listField || changedAttributes.listIndex || changedAttributes.filter || changedAttributes.checked || changedAttributes.unchecked || changedAttributes["default"] || changedAttributes.indeterminate || changedAttributes["class"] || changedAttributes.disabled) {
this.refreshSelf();
return true;
} else {
var refreshed = false;
if(changedTiddlers[this.checkboxTitle]) {
this.inputDomNode.checked = this.getValue();
var isChecked = this.getValue();
this.inputDomNode.checked = !!isChecked;
this.inputDomNode.indeterminate = (isChecked === undefined);
refreshed = true;
if(isChecked) {
$tw.utils.addClass(this.labelDomNode,"tc-checkbox-checked");
} else {
$tw.utils.removeClass(this.labelDomNode,"tc-checkbox-checked");
}
}
return this.refreshChildren(changedTiddlers) || refreshed;
}

View File

@@ -48,7 +48,7 @@ DraggableWidget.prototype.render = function(parent,nextSibling) {
if(this.draggableClasses) {
classes.push(this.draggableClasses);
}
if(!this.dragHandleSelector) {
if(!this.dragHandleSelector && this.dragEnable) {
classes.push("tc-draggable");
}
domNode.setAttribute("class",classes.join(" "));
@@ -56,16 +56,18 @@ DraggableWidget.prototype.render = function(parent,nextSibling) {
parent.insertBefore(domNode,nextSibling);
this.renderChildren(domNode,null);
// Add event handlers
$tw.utils.makeDraggable({
domNode: domNode,
dragTiddlerFn: function() {return self.getAttribute("tiddler");},
dragFilterFn: function() {return self.getAttribute("filter");},
startActions: self.startActions,
endActions: self.endActions,
dragImageType: self.dragImageType,
widget: this,
selector: self.dragHandleSelector
});
if(this.dragEnable) {
$tw.utils.makeDraggable({
domNode: domNode,
dragTiddlerFn: function() {return self.getAttribute("tiddler");},
dragFilterFn: function() {return self.getAttribute("filter");},
startActions: self.startActions,
endActions: self.endActions,
dragImageType: self.dragImageType,
widget: this,
selector: self.dragHandleSelector
});
}
this.domNodes.push(domNode);
};
@@ -80,16 +82,37 @@ DraggableWidget.prototype.execute = function() {
this.endActions = this.getAttribute("endactions");
this.dragImageType = this.getAttribute("dragimagetype");
this.dragHandleSelector = this.getAttribute("selector");
this.dragEnable = this.getAttribute("enable","yes") === "yes";
// Make the child widgets
this.makeChildWidgets();
};
DraggableWidget.prototype.updateDomNodeClasses = function() {
var domNodeClasses = this.domNodes[0].className.split(" "),
oldClasses = this.draggableClasses.split(" ");
this.draggableClasses = this.getAttribute("class");
//Remove classes assigned from the old value of class attribute
$tw.utils.each(oldClasses,function(oldClass){
var i = domNodeClasses.indexOf(oldClass);
if(i !== -1) {
domNodeClasses.splice(i,1);
}
});
//Add new classes from updated class attribute.
$tw.utils.pushTop(domNodeClasses,this.draggableClasses);
this.domNodes[0].setAttribute("class",domNodeClasses.join(" "))
}
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
DraggableWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.tag || changedAttributes["class"]) {
var changedAttributes = this.computeAttributes(),
changedAttributesCount = $tw.utils.count(changedAttributes);
if(changedAttributesCount === 1 && changedAttributes["class"]) {
this.updateDomNodeClasses();
} else if(changedAttributesCount > 0) {
this.refreshSelf();
return true;
}
@@ -98,4 +121,4 @@ DraggableWidget.prototype.refresh = function(changedTiddlers) {
exports.draggable = DraggableWidget;
})();
})();

View File

@@ -42,16 +42,22 @@ ElementWidget.prototype.render = function(parent,nextSibling) {
this.tag = "h" + headingLevel;
}
// Select the namespace for the tag
var tagNamespaces = {
var XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml",
tagNamespaces = {
svg: "http://www.w3.org/2000/svg",
math: "http://www.w3.org/1998/Math/MathML",
body: "http://www.w3.org/1999/xhtml"
body: XHTML_NAMESPACE
};
this.namespace = tagNamespaces[this.tag];
if(this.namespace) {
this.setVariable("namespace",this.namespace);
} else {
this.namespace = this.getVariable("namespace",{defaultValue: "http://www.w3.org/1999/xhtml"});
if(this.hasAttribute("xmlns")) {
this.namespace = this.getAttribute("xmlns");
this.setVariable("namespace",this.namespace);
} else {
this.namespace = this.getVariable("namespace",{defaultValue: XHTML_NAMESPACE});
}
}
// Invoke the th-rendering-element hook
var parseTreeNodes = $tw.hooks.invokeHook("th-rendering-element",null,this);

View File

@@ -72,33 +72,7 @@ EventWidget.prototype.render = function(parent,nextSibling) {
}
// Only set up variables if we have actions to invoke
if(actions) {
$tw.utils.each(selectedNode.attributes,function(attribute) {
variables["dom-" + attribute.name] = attribute.value.toString();
});
//Add a variable with a popup coordinate string for the selected node
variables["tv-popup-coords"] = "(" + selectedNode.offsetLeft + "," + selectedNode.offsetTop +"," + selectedNode.offsetWidth + "," + selectedNode.offsetHeight + ")";
//Add variables for offset of selected node
variables["tv-selectednode-posx"] = selectedNode.offsetLeft.toString();
variables["tv-selectednode-posy"] = selectedNode.offsetTop.toString();
variables["tv-selectednode-width"] = selectedNode.offsetWidth.toString();
variables["tv-selectednode-height"] = selectedNode.offsetHeight.toString();
if(event.clientX && event.clientY) {
//Add variables for event X and Y position relative to selected node
selectedNodeRect = selectedNode.getBoundingClientRect();
variables["event-fromselected-posx"] = (event.clientX - selectedNodeRect.left).toString();
variables["event-fromselected-posy"] = (event.clientY - selectedNodeRect.top).toString();
//Add variables for event X and Y position relative to event catcher node
catcherNodeRect = self.domNode.getBoundingClientRect();
variables["event-fromcatcher-posx"] = (event.clientX - catcherNodeRect.left).toString();
variables["event-fromcatcher-posy"] = (event.clientY - catcherNodeRect.top).toString();
//Add variables for event X and Y position relative to the viewport
variables["event-fromviewport-posx"] = event.clientX.toString();
variables["event-fromviewport-posy"] = event.clientY.toString();
}
variables = $tw.utils.collectDOMVariables(selectedNode,self.domNode,event);
}
}
// Execute our actions with the variables

View File

@@ -0,0 +1,108 @@
/*\
title: $:/core/modules/widgets/genesis.js
type: application/javascript
module-type: widget
Genesis widget for dynamically creating widgets
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var GenesisWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
GenesisWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
GenesisWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes({filterFn: function(name) {
// Only compute our own attributes which start with a single dollar
return name.charAt(0) === "$" && name.charAt(1) !== "$";
}});
this.execute();
this.renderChildren(parent,nextSibling);
};
/*
Compute the internal state of the widget
*/
GenesisWidget.prototype.execute = function() {
var self = this;
// Collect attributes
this.genesisType = this.getAttribute("$type","element");
this.genesisRemappable = this.getAttribute("$remappable","yes") === "yes";
this.genesisNames = this.getAttribute("$names","");
this.genesisValues = this.getAttribute("$values","");
// Construct parse tree
var isElementWidget = this.genesisType.charAt(0) !== "$",
nodeType = isElementWidget ? "element" : this.genesisType.substr(1),
nodeTag = isElementWidget ? this.genesisType : undefined;
var parseTreeNodes = [{
type: nodeType,
tag: nodeTag,
attributes: {},
orderedAttributes: [],
children: this.parseTreeNode.children || [],
isNotRemappable: !this.genesisRemappable
}];
// Apply explicit attributes
$tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(this.parseTreeNode),function(attribute) {
var name = attribute.name;
if(name.charAt(0) === "$") {
if(name.charAt(1) === "$") {
// Double $$ is changed to a single $
name = name.substr(1);
} else {
// Single dollar is ignored
return;
}
}
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],$tw.utils.extend({},attribute,{name: name}));
});
// Apply attributes in $names/$values
this.attributeNames = [];
this.attributeValues = [];
if(this.genesisNames && this.genesisValues) {
this.attributeNames = this.wiki.filterTiddlers(self.genesisNames,this);
this.attributeValues = this.wiki.filterTiddlers(self.genesisValues,this);
$tw.utils.each(this.attributeNames,function(varname,index) {
$tw.utils.addAttributeToParseTreeNode(parseTreeNodes[0],varname,self.attributeValues[index] || "");
});
}
// Construct the child widgets
this.makeChildWidgets(parseTreeNodes);
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
GenesisWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes(),
filterNames = this.getAttribute("$names",""),
filterValues = this.getAttribute("$values",""),
attributeNames = this.wiki.filterTiddlers(filterNames,this),
attributeValues = this.wiki.filterTiddlers(filterValues,this);
if($tw.utils.count(changedAttributes) > 0 || !$tw.utils.isArrayEqual(this.attributeNames,attributeNames) || !$tw.utils.isArrayEqual(this.attributeValues,attributeValues)) {
this.refreshSelf();
return true;
} else {
return this.refreshChildren(changedTiddlers);
}
};
exports.genesis = GenesisWidget;
})();

View File

@@ -111,6 +111,9 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
if(this.imageAlt) {
domNode.setAttribute("alt",this.imageAlt);
}
if(this.lazyLoading && tag === "img") {
domNode.setAttribute("loading",this.lazyLoading);
}
// Add classes when the image loads or fails
$tw.utils.addClass(domNode,"tc-image-loading");
domNode.addEventListener("load",function() {
@@ -137,6 +140,7 @@ ImageWidget.prototype.execute = function() {
this.imageClass = this.getAttribute("class");
this.imageTooltip = this.getAttribute("tooltip");
this.imageAlt = this.getAttribute("alt");
this.lazyLoading = this.getAttribute("loading");
};
/*

View File

@@ -39,7 +39,10 @@ Compute the internal state of the widget
ImportVariablesWidget.prototype.execute = function(tiddlerList) {
var widgetPointer = this;
// Got to flush all the accumulated variables
this.variables = new this.variablesConstructor();
this.variables = Object.create(null);
if(this.parentWidget) {
Object.setPrototypeOf(this.variables,this.parentWidget.variables);
}
// Get our parameters
this.filter = this.getAttribute("filter");
// Compute the filter

View File

@@ -48,7 +48,7 @@ LetWidget.prototype.computeAttributes = function() {
var changedAttributes = {},
self = this;
this.currentValueFor = Object.create(null);
$tw.utils.each(this.parseTreeNode.orderedAttributes,function(attribute,index) {
$tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(this.parseTreeNode),function(attribute) {
var value = self.computeAttribute(attribute),
name = attribute.name;
if(name.charAt(0) !== "$") {

View File

@@ -159,6 +159,8 @@ ScrollableWidget.prototype.render = function(parent,nextSibling) {
// Create elements
this.outerDomNode = this.document.createElement("div");
$tw.utils.setStyle(this.outerDomNode,[
{overflowY: "auto"},
{overflowX: "auto"},
{webkitOverflowScrolling: "touch"}
]);
this.innerDomNode = this.document.createElement("div");

View File

@@ -38,9 +38,10 @@ Widget.prototype.initialise = function(parseTreeNode,options) {
this.parseTreeNode = parseTreeNode;
this.wiki = options.wiki;
this.parentWidget = options.parentWidget;
this.variablesConstructor = function() {};
this.variablesConstructor.prototype = this.parentWidget ? this.parentWidget.variables : {};
this.variables = new this.variablesConstructor();
this.variables = Object.create(null);
if(this.parentWidget) {
Object.setPrototypeOf(this.variables,this.parentWidget.variables);
}
this.document = options.document;
this.attributes = {};
this.children = [];
@@ -289,12 +290,19 @@ Widget.prototype.computeAttribute = function(attribute) {
};
/*
Check for the presence of an attribute
Check for the presence of an evaluated attribute on the widget. Note that attributes set to a missing variable (ie attr=<<missing>>) will be treated as missing
*/
Widget.prototype.hasAttribute = function(name) {
return $tw.utils.hop(this.attributes,name);
};
/*
Check for the presence of a raw attribute on the widget parse tree node. Note that attributes set to a missing variable (ie attr=<<missing>>) will NOT be treated as missing
*/
Widget.prototype.hasParseTreeNodeAttribute = function(name) {
return $tw.utils.hop(this.parseTreeNode.attributes,name);
};
/*
Get the value of an attribute
*/

View File

@@ -50,7 +50,7 @@ exports.getTextReference = function(textRef,defaultText,currTiddlerTitle) {
if(tr.field) {
var tiddler = this.getTiddler(title);
if(tr.field === "title") { // Special case so we can return the title of a non-existent tiddler
return title;
return title || defaultText;
} else if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {
return tiddler.getFieldString(tr.field);
} else {

View File

@@ -11,7 +11,7 @@ alert-highlight: #FFD60A
alert-muted-foreground: <<colour muted-foreground>>
background: #282828
blockquote-bar: <<colour page-background>>
button-foreground: <<colour background>>
button-foreground: <<colour foreground>>
code-background: <<colour pre-background>>
code-border: <<colour pre-border>>
code-foreground: rgba(255, 255, 255, 0.54)
@@ -52,7 +52,7 @@ pre-border: transparent
primary: #0A84FF
select-tag-background: <<colour background>>
select-tag-foreground: <<colour foreground>>
sidebar-button-foreground: <<colour background>>
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #FF9F0A
sidebar-controls-foreground: #8E8E93
sidebar-foreground-shadow: transparent
@@ -87,7 +87,7 @@ tiddler-border: transparent
tiddler-controls-foreground-hover: <<colour sidebar-controls-foreground-hover>>
tiddler-controls-foreground-selected: <<colour sidebar-controls-foreground-hover>>
tiddler-controls-foreground: #48484A
tiddler-editor-background: transparent
tiddler-editor-background: <<colour background>>
tiddler-editor-border-image:
tiddler-editor-border: rgba(255, 255, 255, 0.08)
tiddler-editor-fields-even: rgba(255, 255, 255, 0.1)

View File

@@ -12,7 +12,7 @@ alert-highlight: #d79921
alert-muted-foreground: #504945
background: #3c3836
blockquote-bar: <<colour muted-foreground>>
button-foreground: <<colour page-background>>
button-foreground: <<colour foreground>>
code-background: #504945
code-border: #504945
code-foreground: #fb4934
@@ -63,7 +63,7 @@ select-tag-background: #665c54
select-tag-foreground: <<colour foreground>>
selection-background: #458588
selection-foreground: <<colour foreground>>
sidebar-button-foreground: <<colour page-background>>
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #7c6f64
sidebar-controls-foreground: #504945
sidebar-foreground-shadow: transparent

View File

@@ -12,7 +12,7 @@ alert-highlight: #B48EAD
alert-muted-foreground: #4C566A
background: #3b4252
blockquote-bar: <<colour muted-foreground>>
button-foreground: <<colour page-background>>
button-foreground: <<colour foreground>>
code-background: #2E3440
code-border: #2E3440
code-foreground: #BF616A
@@ -63,7 +63,7 @@ select-tag-background: #3b4252
select-tag-foreground: <<colour foreground>>
selection-background: #5E81AC
selection-foreground: <<colour foreground>>
sidebar-button-foreground: <<colour page-background>>
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #D8DEE9
sidebar-controls-foreground: #4C566A
sidebar-foreground-shadow: transparent

View File

@@ -1,9 +1,9 @@
title: $:/core/save/lazy-all
\define saveTiddlerFilter()
[is[system]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
[is[system]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] [is[tiddler]type[application/javascript]] +[sort[title]]
\end
\define skinnySaveTiddlerFilter()
[!is[system]]
[!is[system]] -[type[application/javascript]]
\end
{{$:/core/templates/tiddlywiki5.html}}

View File

@@ -1,7 +1,7 @@
title: $:/core/templates/server/static.sidebar.wikitext
\whitespace trim
<div class="tc-sidebar-scrollable" style="overflow: auto;">
<div class="tc-sidebar-scrollable" style="overflow: auto;" role="region" aria-label={{$:/language/SideBar/Caption}}>
<div class="tc-sidebar-header">
<h1 class="tc-site-title">
<$transclude tiddler="$:/SiteTitle"/>

View File

@@ -19,8 +19,8 @@ title: $:/core/templates/server/static.tiddler.html
</head>
<body class="tc-body">
<$transclude tiddler="$:/core/templates/server/static.sidebar.wikitext" mode="inline"/>
<section class="tc-story-river">
<div class="tc-tiddler-frame">
<section class="tc-story-river" role="main">
<div class="tc-tiddler-frame" role="article">
<$transclude tiddler="$:/core/templates/server/static.tiddler.wikitext" mode="inline"/>
</div>
</section>

View File

@@ -6,6 +6,7 @@ description: create a new image tiddler
image/$(imageType)$
\end
\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$
\whitespace trim
<$vars imageType={{$:/config/NewImageType}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}}>
<$action-sendmessage $message="tm-new-tiddler" type=<<get-type>> tags=<<get-tags>>/>
</$vars>

View File

@@ -3,8 +3,9 @@ tags: $:/tags/Actions
description: create a new journal tiddler
\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$
\whitespace trim
<$vars journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}>
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
<$wikify name="journalTitle" text="<$macrocall $name='now' format=<<journalTitleTemplate>>/>">
<$reveal type="nomatch" state=<<journalTitle>> text="">
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text={{{ [<journalTitle>get[]] }}}/>
</$reveal>

View File

@@ -3,6 +3,7 @@ tags: $:/tags/Actions
description: create a new empty tiddler
\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$
\whitespace trim
<$vars textFieldTags={{$:/config/NewTiddler/Tags}} tagsFieldTags={{$:/config/NewTiddler/Tags!!tags}}>
<$action-sendmessage $message="tm-new-tiddler" tags=<<get-tags>>/>
</$vars>

View File

@@ -2,6 +2,7 @@ title: $:/AdvancedSearch
icon: $:/core/images/advanced-search-button
color: #bbb
\whitespace trim
<div class="tc-advanced-search">
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch]!has[draft.of]]" default="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<currentTab>>/>""" explicitState="$:/state/tab--1498284803"/>
</div>

View File

@@ -3,31 +3,71 @@ tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/Filter/Caption}}
\define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
\define set-next-input-tab(beforeafter:"after")
<$macrocall $name="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="$beforeafter$"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list>
\define cancel-search-actions()
\whitespace trim
<$list
filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]"
emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />">
<$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/>
<$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/>
</$list>
\end
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\define input-accept-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
</$list>
\end
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\define input-accept-variant-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>">
<$list filter="[<__tiddler__>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
</$list></$list>
\end
\whitespace trim
<<lingo Filter/Hint>>
<div class="tc-search tc-advanced-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search"
tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/temp/advancedsearch]]" firstSearchFilterField="text"
inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>>
inputCancelActions=<<cancel-search-actions>>/>
<$macrocall $name="keyboard-driven-input"
tiddler="$:/temp/advancedsearch/input"
storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh"
selectionStateTitle="$:/temp/advancedsearch/selected-item"
type="search"
tag="input"
focus={{$:/config/Search/AutoFocus}}
configTiddlerFilter="[[$:/temp/advancedsearch]]"
firstSearchFilterField="text"
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
inputCancelActions=<<cancel-search-actions>>/>
</$keyboard>
</$keyboard>
&#32;
<$list filter="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"><$transclude/></$list>
</div>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>""">
<$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>">
<div class="tc-search-results">
<<lingo Filter/Matches>>
<$list filter={{$:/temp/advancedsearch}}>

View File

@@ -1,6 +1,7 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/clear
tags: $:/tags/AdvancedSearch/FilterButton
\whitespace trim
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible">
<<cancel-search-actions>>

View File

@@ -1,8 +1,9 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/delete
tags: $:/tags/AdvancedSearch/FilterButton
\whitespace trim
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button popup=<<qualify "$:/state/filterDeleteDropdown">> class="tc-btn-invisible">
<$button tooltip={{$:/language/Buttons/DeleteTiddlers/Hint}} popup=<<qualify "$:/state/filterDeleteDropdown">> class="tc-btn-invisible">
{{$:/core/images/delete-button}}
</$button>
</$reveal>
@@ -12,13 +13,13 @@ tags: $:/tags/AdvancedSearch/FilterButton
<div class="tc-block-dropdown tc-edit-type-dropdown">
<div class="tc-dropdown-item-plain">
<$set name="resultCount" value="""<$count filter={{$:/temp/advancedsearch}}/>""">
Are you sure you wish to delete <<resultCount>> tiddler(s)?
{{$:/language/ConfirmDeleteTiddlers}}
</$set>
</div>
<div class="tc-dropdown-item-plain">
<$button class="tc-btn">
<$action-deletetiddler $filter={{$:/temp/advancedsearch}}/>
Delete these tiddlers
{{$:/language/Buttons/DeleteTiddlers/Hint}}
</$button>
</div>
</div>

View File

@@ -1,6 +1,8 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/dropdown
tags: $:/tags/AdvancedSearch/FilterButton
\whitespace trim
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/filterDropdown">> class="tc-btn-invisible">
{{$:/core/images/down-arrow}}
@@ -9,10 +11,11 @@ tags: $:/tags/AdvancedSearch/FilterButton
<$reveal state=<<qualify "$:/state/filterDropdown">> type="popup" position="belowleft" animate="yes">
<$set name="tv-show-missing-links" value="yes">
<$linkcatcher actions="""<$action-setfield $tiddler="$:/temp/advancedsearch" text=<<navigateTo>>/><$action-setfield $tiddler="$:/temp/advancedsearch/input" text=<<navigateTo>>/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/><$action-sendmessage $message="tm-focus-selector" $param='.tc-advanced-search input' />""">
<$linkcatcher actions="<$action-setfield $tiddler='$:/temp/advancedsearch' text=<<navigateTo>>/><$action-setfield $tiddler='$:/temp/advancedsearch/input' text=<<navigateTo>>/><$action-setfield $tiddler='$:/temp/advancedsearch/refresh' text='yes'/><$action-sendmessage $message='tm-focus-selector' $param='.tc-advanced-search input' />">
<div class="tc-block-dropdown-wrapper">
<div class="tc-block-dropdown tc-edit-type-dropdown">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]"><$link to={{!!filter}}><$transclude field="description"/></$link>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Filter]]">
<$link to={{!!filter}}><$transclude field="description"/></$link>
</$list>
</div>
</div>

View File

@@ -1,6 +1,7 @@
title: $:/core/ui/AdvancedSearch/Filter/FilterButtons/export
tags: $:/tags/AdvancedSearch/FilterButton
\whitespace trim
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$macrocall $name="exportButton" exportFilter={{$:/temp/advancedsearch}} lingoBase="$:/language/Buttons/ExportTiddlers/"/>
</$reveal>

View File

@@ -5,26 +5,68 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
\define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
\define set-next-input-tab(beforeafter:"after")
<$macrocall $name="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="$beforeafter$"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input"""/>
\define cancel-search-actions()
\whitespace trim
<$list
filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]"
emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />">
<$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/>
<$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/>
</$list>
<$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\end
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\define input-accept-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
</$list>
\end
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\define input-accept-variant-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>">
<$list filter="[<__tiddler__>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
</$list></$list>
\end
\whitespace trim
<<lingo Shadows/Hint>>
<div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search"
tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/core/ui/AdvancedSearch/Shadows]]"
inputCancelActions=<<cancel-search-actions>> inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>> filterMinLength={{$:/config/Search/MinLength}}/>
<$macrocall $name="keyboard-driven-input"
tiddler="$:/temp/advancedsearch/input"
storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh"
selectionStateTitle="$:/temp/advancedsearch/selected-item"
type="search"
tag="input"
focus={{$:/config/Search/AutoFocus}}
configTiddlerFilter="[[$:/core/ui/AdvancedSearch/Shadows]]"
inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard>
</$keyboard>
&#32;
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible">
<<cancel-search-actions>>
@@ -35,9 +77,9 @@ first-search-filter: [all[shadows]search<userInput>sort[title]limit[250]] -[[$:/
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
<$set name="resultCount" value="""<$count filter="[all[shadows]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]"/>""">
<$set name="resultCount" value="<$count filter='[all[shadows]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]'/>">
<div class="tc-search-results">

View File

@@ -3,15 +3,17 @@ tags: $:/tags/AdvancedSearch
caption: {{$:/language/Search/Standard/Caption}}
\define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\define next-search-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/advancedsearch/standard/currentTab" text=<<nextTab>>/>"""/>
\define next-search-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/advancedsearch" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<nextTab>>/>"/>
\define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input"""/>
\define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />"><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\whitespace trim
<<lingo Standard/Hint>>
@@ -20,12 +22,19 @@ caption: {{$:/language/Search/Standard/Caption}}
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$keyboard key="shift-alt-Right" actions=<<next-search-tab>>>
<$keyboard key="shift-alt-Left" actions=<<next-search-tab "before">>>
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item" type="search"
tag="input" focus={{$:/config/Search/AutoFocus}} inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>>
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"
filterMinLength={{$:/config/Search/MinLength}}/>
<$macrocall $name="keyboard-driven-input"
tiddler="$:/temp/advancedsearch/input"
storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh"
selectionStateTitle="$:/temp/advancedsearch/selected-item"
type="search"
tag="input"
focus={{$:/config/Search/AutoFocus}}
inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"
filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard>
</$keyboard>
</$keyboard>
@@ -39,14 +48,22 @@ caption: {{$:/language/Search/Standard/Caption}}
</div>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$vars userInput={{{ [[$:/temp/advancedsearch]get[text]] }}} configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} searchListState="$:/temp/advancedsearch/selected-item">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]" emptyMessage="""
<$list filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]">
<$transclude/>
</$list>
""">
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]" default={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/advancedsearch/standard/currentTab" text=<<currentTab>>/>""" explicitState="$:/state/tab/search-results/advancedsearch" />
<$list
filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]"
emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>"
variable="listItem">
<$vars
userInput={{{ [[$:/temp/advancedsearch]get[text]] }}}
configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}}
searchListState="$:/temp/advancedsearch/selected-item">
<$list
filter="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]butfirst[]limit[1]]"
emptyMessage="<$list filter='[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]'><$transclude/></$list>">
<$macrocall $name="tabs"
tabsList="[all[shadows+tiddlers]tag[$:/tags/SearchResults]!has[draft.of]]"
default={{$:/config/SearchResults/Default}}
actions="<$action-setfield $tiddler='$:/state/advancedsearch/standard/currentTab' text=<<currentTab>>/>"
explicitState="$:/state/tab/search-results/advancedsearch" />
</$list>
</$vars>
</$list>

View File

@@ -4,26 +4,68 @@ caption: {{$:/language/Search/System/Caption}}
first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]
\define lingo-base() $:/language/Search/
\define set-next-input-tab(beforeafter:"after",stateTitle,tag,defaultState,currentTabTiddler) <$macrocall $name="change-input-tab" stateTitle="$:/state/tab--1498284803" tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" actions="""<$action-setfield $tiddler="$:/state/advancedsearch/currentTab" text=<<nextTab>>/>"""/>
\define set-next-input-tab(beforeafter:"after",stateTitle,tag,defaultState,currentTabTiddler)
<$macrocall $name="change-input-tab"
stateTitle="$:/state/tab--1498284803"
tag="$:/tags/AdvancedSearch"
beforeafter="$beforeafter$"
defaultState="$:/core/ui/AdvancedSearch/System"
actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<<nextTab>>/>"/>
\end
\define cancel-search-actions() <$list filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]" emptyMessage="""<$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]" />"""><$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/><$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/></$list><$action-sendmessage $message="tm-focus-selector" $param=""".tc-advanced-search input"""/>
\define cancel-search-actions()
\whitespace trim
<$list
filter="[{$:/temp/advancedsearch}!match{$:/temp/advancedsearch/input}]"
emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />">
<$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/>
<$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/>
</$list>
<$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
\end
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
\define input-accept-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>">
<$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>
</$list>
\end
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
\define input-accept-variant-actions()
\whitespace trim
<$list
filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"
emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>">
<$list filter="[<__tiddler__>get[text]minlength[1]]">
<$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/>
</$list></$list>
\end
\whitespace trim
<<lingo System/Hint>>
<div class="tc-search">
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/advancedsearch/input" storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh" selectionStateTitle="$:/temp/advancedsearch/selected-item"
type="search" tag="input" focus={{$:/config/Search/AutoFocus}} configTiddlerFilter="[[$:/core/ui/AdvancedSearch/System]]"
inputCancelActions=<<cancel-search-actions>> inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>> filterMinLength={{$:/config/Search/MinLength}}/>
<$macrocall $name="keyboard-driven-input"
tiddler="$:/temp/advancedsearch/input"
storeTitle="$:/temp/advancedsearch"
refreshTitle="$:/temp/advancedsearch/refresh"
selectionStateTitle="$:/temp/advancedsearch/selected-item"
type="search"
tag="input"
focus={{$:/config/Search/AutoFocus}}
configTiddlerFilter="[[$:/core/ui/AdvancedSearch/System]]"
inputCancelActions=<<cancel-search-actions>>
inputAcceptActions=<<input-accept-actions>>
inputAcceptVariantActions=<<input-accept-variant-actions>>
filterMinLength={{$:/config/Search/MinLength}}/>
</$keyboard>
</$keyboard>
&#32;
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$button class="tc-btn-invisible">
<<cancel-search-actions>>
@@ -34,9 +76,9 @@ first-search-filter: [is[system]search<userInput>sort[title]limit[250]] -[[$:/te
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="<div class='tc-search-results'>{{$:/language/Search/Search/TooShort}}</div>" variable="listItem">
<$set name="resultCount" value="""<$count filter="[is[system]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]"/>""">
<$set name="resultCount" value="<$count filter='[is[system]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]'/>">
<div class="tc-search-results">

View File

@@ -1,12 +1,21 @@
title: $:/core/ui/AlertTemplate
\whitespace trim
<div class="tc-alert">
<div class="tc-alert-toolbar">
<$button class="tc-btn-invisible"><$action-deletetiddler $tiddler=<<currentTiddler>>/>{{$:/core/images/cancel-button}}</$button>
</div>
<div class="tc-alert-subtitle">
<$wikify name="format" text=<<lingo Tiddler/DateFormat>>>
<$view field="component"/> - <$view field="modified" format="date" template=<<format>>/> <$reveal type="nomatch" state="!!count" text=""><span class="tc-alert-highlight">({{$:/language/Count}}: <$view field="count"/>)</span></$reveal>
<$view field="component"/>
&#32;-&#32;
<$view field="modified" format="date" template=<<format>>/>
&#32;
<$reveal type="nomatch" state="!!count" text="">
<span class="tc-alert-highlight">
({{$:/language/Count}}:&#32;<$view field="count"/>)
</span>
</$reveal>
</$wikify>
</div>
<div class="tc-alert-body">

View File

@@ -1,5 +1,6 @@
title: $:/core/ui/Components/tag-link
\whitespace trim
<$link>
<$set name="backgroundColor" value={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}>
<span style=<<tag-styles>> class="tc-tag-label">

View File

@@ -2,6 +2,7 @@ title: $:/ControlPanel
icon: $:/core/images/options-button
color: #bbb
\whitespace trim
<div class="tc-control-panel">
<$macrocall $name="tabs" tabsList="[all[shadows+tiddlers]tag[$:/tags/ControlPanel]!has[draft.of]]" default="$:/core/ui/ControlPanel/Info" explicitState="$:/state/tab-1749438307"/>
</div>

View File

@@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Advanced
tags: $:/tags/ControlPanel/Info
caption: {{$:/language/ControlPanel/Advanced/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Advanced/Hint}}
<div class="tc-control-panel">

View File

@@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Appearance
tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Appearance/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Appearance/Hint}}
<div class="tc-control-panel">

View File

@@ -5,6 +5,7 @@ caption: {{$:/language/ControlPanel/Basics/Caption}}
\define lingo-base() $:/language/ControlPanel/Basics/
\define show-filter-count(filter)
\whitespace trim
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="$:/temp/advancedsearch" $value="""$filter$"""/>
<$action-setfield $tiddler="$:/temp/advancedsearch/input" $value="""$filter$"""/>
@@ -13,9 +14,11 @@ caption: {{$:/language/ControlPanel/Basics/Caption}}
<$action-navigate $to="$:/AdvancedSearch"/>
<$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/>
''<$count filter="""$filter$"""/>''
&#32;
{{$:/core/images/advanced-search-button}}
</$button>
\end
\whitespace trim
|<<lingo Version/Prompt>> |''<<version>>'' |
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |

View File

@@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Cascades
tags: $:/tags/ControlPanel/Advanced
caption: {{$:/language/ControlPanel/Cascades/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Cascades/Hint}}
<div class="tc-control-panel">

View File

@@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Advanced
caption: {{$:/language/ControlPanel/EditorTypes/Caption}}
\define lingo-base() $:/language/ControlPanel/EditorTypes/
\whitespace trim
<<lingo Hint>>

View File

@@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Info
tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Info/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Info/Hint}}
<div class="tc-control-panel">

View File

@@ -5,8 +5,11 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\define lingo-base() $:/language/ControlPanel/KeyboardShortcuts/
\define new-shortcut(title)
\whitespace trim
<div class="tc-dropdown-item-plain">
<$edit-shortcut tiddler="$title$" placeholder={{$:/language/ControlPanel/KeyboardShortcuts/Add/Prompt}} focus="true" style="width:auto;"/> <$button>
<$edit-shortcut tiddler="$title$" placeholder={{$:/language/ControlPanel/KeyboardShortcuts/Add/Prompt}} focus="true" style="width:auto;"/>
&#32;
<$button>
<<lingo Add/Caption>>
<$action-listops
$tiddler="$(shortcutTitle)$"
@@ -21,6 +24,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\end
\define shortcut-list-item(caption)
\whitespace trim
<td>
</td>
<td style="text-align:right;font-size:0.7em;">
@@ -31,16 +35,16 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
<$button popup=<<qualify "$:/state/dropdown/$(shortcutTitle)$">> class="tc-btn-invisible">
{{$:/core/images/edit-button}}
</$button>
&#32;
<$macrocall $name="displayshortcuts" $output="text/html" shortcuts={{$(shortcutTitle)$}} prefix="<kbd>" separator="</kbd> <kbd>" suffix="</kbd>"/>
<$reveal state=<<qualify "$:/state/dropdown/$(shortcutTitle)$">> type="popup" position="below" animate="yes">
<div class="tc-block-dropdown-wrapper">
<div class="tc-block-dropdown tc-edit-type-dropdown tc-popup-keep">
<$list filter="[list[$(shortcutTitle)$!!text]sort[title]]" variable="shortcut" emptyMessage="""
<div class="tc-dropdown-item-plain">
//<<lingo NoShortcuts/Caption>>//
</div>
""">
<$list
filter="[list[$(shortcutTitle)$!!text]sort[title]]"
variable="shortcut"
emptyMessage="<div class='tc-dropdown-item-plain'>//<<lingo NoShortcuts/Caption>>//</div>">
<div class="tc-dropdown-item-plain">
<$button class="tc-btn-invisible" tooltip={{$:/language/ControlPanel/KeyboardShortcuts/Remove/Hint}}>
<$action-listops
@@ -50,6 +54,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
/>
<small>{{$:/core/images/close-button}}</small>
</$button>
&#32;
<kbd>
<$macrocall $name="displayshortcuts" $output="text/html" shortcuts=<<shortcut>>/>
</kbd>
@@ -65,6 +70,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\end
\define shortcut-list(caption,prefix)
\whitespace trim
<tr>
<$list filter="[[$prefix$$(shortcutName)$]]" variable="shortcutTitle">
<<shortcut-list-item "$caption$">>
@@ -73,7 +79,8 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\end
\define shortcut-editor()
<<shortcut-list "All" "$:/config/shortcuts/">>
\whitespace trim
<<shortcut-list "All" "$:/config/shortcuts/">>
<<shortcut-list "Mac" "$:/config/shortcuts-mac/">>
<<shortcut-list "NonMac" "$:/config/shortcuts-not-mac/">>
<<shortcut-list "Linux" "$:/config/shortcuts-linux/">>
@@ -87,6 +94,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\end
\define shortcut-item-inner()
\whitespace trim
<tr>
<td>
<$reveal type="nomatch" state=<<dropdownStateTitle>> text="open">
@@ -107,6 +115,7 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
{{$:/core/images/down-arrow}}
</$button>
</$reveal>
&#32;
''<$text text=<<shortcutName>>/>''
</td>
<td>
@@ -126,10 +135,12 @@ caption: {{$:/language/ControlPanel/KeyboardShortcuts/Caption}}
\end
\define shortcut-item()
\whitespace trim
<$set name="dropdownStateTitle" value=<<qualify "$:/state/dropdown/keyboardshortcut/$(shortcutName)$">>>
<<shortcut-item-inner>>
</$set>
\end
\whitespace trim
<table>
<tbody>

View File

@@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Modals/AddPlugins
subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/Add/Caption}}
\define install-plugin-actions()
\whitespace trim
<$action-sendmessage $message="tm-load-plugin-from-library" url={{!!url}} title={{$(assetInfo)$!!original-title}}/>
<$set name="url" value={{!!url}}>
<$set name="currentTiddler" value=<<assetInfo>>>
@@ -13,18 +14,21 @@ subtitle: {{$:/core/images/download-button}} {{$:/language/ControlPanel/Plugins/
\end
\define install-plugin-button()
\whitespace trim
<div>
<$set name="libraryVersion" value={{{ [<assetInfo>get[version]] }}}>
<$set name="installedVersion" value={{{ [<assetInfo>get[original-title]get[version]] }}}>
<$set name="reinstall-type" value={{{ [<libraryVersion>compare:version:eq<installedVersion>then[tc-reinstall]] [<libraryVersion>compare:version:gt<installedVersion>then[tc-reinstall-upgrade]] [<libraryVersion>compare:version:lt<installedVersion>then[tc-reinstall-downgrade]] }}}>
<$button actions=<<install-plugin-actions>> class={{{ [<assetInfo>get[original-title]has[version]then<reinstall-type>] tc-btn-invisible tc-install-plugin +[join[ ]] }}}>
{{$:/core/images/download-button}}
&#32;
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="ignore" emptyMessage="{{$:/language/ControlPanel/Plugins/Install/Caption}}">
<$list filter="[<libraryVersion>compare:version:gt<installedVersion>]" variable="ignore" emptyMessage="""
<$list filter="[<libraryVersion>compare:version:lt<installedVersion>]" variable="ignore" emptyMessage="{{$:/language/ControlPanel/Plugins/Reinstall/Caption}}">
<$list filter="[<libraryVersion>compare:version:gt<installedVersion>]" variable="ignore" emptyMessage="
\whitespace trim
<$list filter='[<libraryVersion>compare:version:lt<installedVersion>]' variable='ignore' emptyMessage='{{$:/language/ControlPanel/Plugins/Reinstall/Caption}}'>
{{$:/language/ControlPanel/Plugins/Downgrade/Caption}}
</$list>
""">
">
{{$:/language/ControlPanel/Plugins/Update/Caption}}
</$list>
</$list>
@@ -43,6 +47,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end
\define display-plugin-info(type)
\whitespace trim
<$set name="popup-state" value=<<popup-state-macro>>>
<div class="tc-plugin-info">
<div class="tc-plugin-info-chunk tc-plugin-info-toggle">
@@ -63,7 +68,9 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
</$list>
</div>
<div class="tc-plugin-info-chunk tc-plugin-info-description">
<h1><strong><$text text={{{ [<assetInfo>get[name]] ~[<assetInfo>get[original-title]split[/]last[1]] }}}/></strong>: <$view tiddler=<<assetInfo>> field="description"/></h1>
<h1><strong><$text text={{{ [<assetInfo>get[name]] ~[<assetInfo>get[original-title]split[/]last[1]] }}}/></strong>:
&#32;
<$view tiddler=<<assetInfo>> field="description"/></h1>
<h2><$view tiddler=<<assetInfo>> field="original-title"/></h2>
<div><em><$view tiddler=<<assetInfo>> field="version"/></em></div>
<$list filter="[<assetInfo>get[original-title]get[version]]" variable="installedVersion"><div><em>{{$:/language/ControlPanel/Plugins/AlreadyInstalled/Hint}}</em></div></$list>
@@ -83,9 +90,9 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
<$set name="currentTiddler" value=<<assetInfo>>>
<$list filter="[enlist{!!dependents}] [<currentTiddler>get[parent-plugin]] +[limit[1]]" variable="ignore">
<div>
{{$:/language/ControlPanel/Plugins/AlsoRequires}}
{{$:/language/ControlPanel/Plugins/AlsoRequires}}&#32;
<$list filter="[enlist{!!dependents}] [{!!parent-plugin}] +[sort[name]]" variable="dependency">
<$text text=<<dependency>>/>
<$text text=<<dependency>>/>&#32;
</$list>
</div>
</$list>
@@ -118,16 +125,21 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end
\define load-plugin-library-button()
\whitespace trim
<$list filter="[<currentTiddler>get[enabled]else[yes]match[yes]]" variable="ignore">
<$button class="tc-btn-big-green">
<$action-sendmessage $message="tm-load-plugin-library" url={{!!url}} infoTitlePrefix="$:/temp/RemoteAssetInfo/"/>
{{$:/core/images/chevron-right}} {{$:/language/ControlPanel/Plugins/OpenPluginLibrary}}
{{$:/core/images/chevron-right}}&#32;{{$:/language/ControlPanel/Plugins/OpenPluginLibrary}}
</$button>
</$list>
\end
\define display-server-assets(type)
{{$:/language/Search/Search}}: <$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input"/>
\whitespace trim
{{$:/language/Search/Search}}:
&#32;
<$edit-text tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" default="" type="search" tag="input"/>
&#32;
<$reveal state="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" type="nomatch" text="">
<$button class="tc-btn-invisible">
<$action-setfield $tiddler="""$:/temp/RemoteAssetSearch/$(currentTiddler)$""" $field="text" $value=""/>
@@ -144,6 +156,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end
\define display-server-connection()
\whitespace trim
<$list filter="[all[tiddlers+shadows]tag[$:/tags/ServerConnection]suffix{!!url}]" variable="connectionTiddler" emptyMessage=<<load-plugin-library-button>>>
<$set name="transclusion" value=<<connectionTiddler>>>
@@ -156,16 +169,18 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end
\define close-library-button()
\whitespace trim
<$reveal type='nomatch' state='$:/temp/ServerConnection/$(PluginLibraryURL)$' text=''>
<$button class='tc-btn-big-green'>
<$action-sendmessage $message="tm-unload-plugin-library" url={{!!url}}/>
{{$:/core/images/chevron-left}} {{$:/language/ControlPanel/Plugins/ClosePluginLibrary}}
{{$:/core/images/chevron-left}}&#32;{{$:/language/ControlPanel/Plugins/ClosePluginLibrary}}
<$action-deletetiddler $filter="[prefix[$:/temp/ServerConnection/$(PluginLibraryURL)$]][prefix[$:/temp/RemoteAssetInfo/$(PluginLibraryURL)$]]"/>
</$button>
</$reveal>
\end
\define plugin-library-listing()
\whitespace trim
<div class="tc-tab-set">
<$set name="defaultTab" value={{{ [all[tiddlers+shadows]tag[$:/tags/PluginLibrary]] }}}>
<div class="tc-tab-buttons">
@@ -187,6 +202,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
<$set name=PluginLibraryURL value={{!!url}}>
<<close-library-button>>
</$set>
&#32;
<<display-server-connection>>
</$reveal>
</$list>
@@ -196,6 +212,7 @@ $:/state/add-plugin-info/$(connectionTiddler)$/$(assetInfo)$
\end
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
\whitespace trim
<div>
<<plugin-library-listing>>

View File

@@ -5,6 +5,7 @@ caption: {{$:/language/ControlPanel/Parsing/Caption}}
\define lingo-base() $:/language/ControlPanel/Parsing/
\define toggle(Type)
\whitespace trim
<$checkbox
tiddler="""$:/config/WikiParserRules/$Type$/$(rule)$"""
field="text"
@@ -16,10 +17,12 @@ default="enable">
\end
\define rules(type,Type)
\whitespace trim
<$list filter="[wikiparserrules[$type$]]" variable="rule">
<dd><<toggle $Type$>></dd>
</$list>
\end
\whitespace trim
<<lingo Hint>>

View File

@@ -5,6 +5,7 @@ caption: {{$:/language/ControlPanel/Plugins/Caption}}
\define lingo-base() $:/language/ControlPanel/Plugins/
\define plugin-table(type)
\whitespace trim
<$set name="plugin-type" value="""$type$""">
<$set name="qualified-state" value=<<qualify "$:/state/plugin-info">>>
<$list filter="[!has[draft.of]plugin-type[$type$]sort[name]]" emptyMessage=<<lingo "Empty/Hint">> template="$:/core/ui/Components/plugin-info"/>

View File

@@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Plugins/Add/Updates
caption: <$importvariables filter="$:/core/ui/ControlPanel/Plugins/Add/Updates">{{$:/language/ControlPanel/Plugins/Updates/Caption}} (<<update-count>>)</$importvariables>
\define each-updateable-plugin(body)
\whitespace trim
<$list filter="[all[tiddlers+shadows]tag[$:/tags/RemoteAssetInfo]server-url{!!url}sort[title]]" variable="assetInfo">
<$set name="libraryVersion" value={{{ [<assetInfo>get[version]] }}}>
<$list filter="[<assetInfo>get[original-title]has[version]!version<libraryVersion>]" variable="ignore">
@@ -25,8 +26,11 @@ $body$
<$wikify name="count-filter" text=<<each-updateable-plugin "&#91;&#91;<$text text=<<assetInfo>>/>]]">>><$count filter=<<count-filter>>/></$wikify>
\end
\whitespace trim
<$button actions=<<update-all-actions>> class="tc-btn-invisible tc-install-plugin tc-reinstall-upgrade">
{{$:/core/images/download-button}} {{||$:/language/ControlPanel/Plugins/Updates/UpdateAll/Caption}}
{{$:/core/images/download-button}}
&#32;
{{||$:/language/ControlPanel/Plugins/Updates/UpdateAll/Caption}}
</$button>
<div class="tc-plugin-library-listing">

View File

@@ -1,7 +1,10 @@
title: $:/core/ui/ControlPanel/Plugins/AddPlugins
\define lingo-base() $:/language/ControlPanel/Plugins/
\whitespace trim
<$button message="tm-modal" param="$:/core/ui/ControlPanel/Modals/AddPlugins" tooltip={{$:/language/ControlPanel/Plugins/Add/Hint}} class="tc-btn-big-green tc-primary-btn">
{{$:/core/images/download-button}} <<lingo Add/Caption>>
{{$:/core/images/download-button}}
&#32;
<<lingo Add/Caption>>
</$button>

View File

@@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Saving
tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Saving/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Saving/Hint}}
<div class="tc-control-panel">

View File

@@ -8,13 +8,14 @@ caption: {{$:/language/ControlPanel/Saving/TiddlySpot/Caption}}
http://$(userName)$.tiddlyspot.com/$path$/
\end
\define siteLink(path)
\whitespace trim
<$reveal type="nomatch" state="$:/UploadName" text="">
<$set name="userName" value={{$:/UploadName}}>
<$reveal type="match" state="$:/UploadURL" text="">
<<siteURL $path$>>
</$reveal>
<$reveal type="nomatch" state="$:/UploadURL" text="">
<$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}>>
<$macrocall $name=resolvePath source={{$:/UploadBackupDir}} root={{$:/UploadURL}}/>
</$reveal>
</$set>
</$reveal>

View File

@@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings
title: $:/core/ui/ControlPanel/Settings/DefaultMoreSidebarTab
\define lingo-base() $:/language/ControlPanel/Settings/DefaultMoreSidebarTab/
\whitespace trim
<$link to="$:/config/DefaultMoreSidebarTab"><<lingo Hint>></$link>

View File

@@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings
title: $:/core/ui/ControlPanel/Settings/DefaultSidebarTab
\define lingo-base() $:/language/ControlPanel/Settings/DefaultSidebarTab/
\whitespace trim
<$link to="$:/config/DefaultSidebarTab"><<lingo Hint>></$link>

View File

@@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/LinkToBehaviour/Caption}}
\define lingo-base() $:/language/ControlPanel/Settings/LinkToBehaviour/
\whitespace trim
<$link to="$:/config/Navigation/openLinkFromInsideRiver"><<lingo "InsideRiver/Hint">></$link>

View File

@@ -3,6 +3,7 @@ tags: $:/tags/ControlPanel/Settings
caption: {{$:/language/ControlPanel/Settings/ToolbarButtonStyle/Caption}}
\define lingo-base() $:/language/ControlPanel/Settings/ToolbarButtonStyle/
\whitespace trim
<$link to="$:/config/Toolbar/ButtonClass"><<lingo "Hint">></$link>
<$select tiddler="$:/config/Toolbar/ButtonClass">

View File

@@ -2,6 +2,7 @@ title: $:/core/ui/ControlPanel/Toolbars
tags: $:/tags/ControlPanel/Appearance
caption: {{$:/language/ControlPanel/Toolbars/Caption}}
\whitespace trim
{{$:/language/ControlPanel/Toolbars/Hint}}
<div class="tc-control-panel">

View File

@@ -3,7 +3,14 @@ title: $:/core/ui/ControlPanel/Toolbars/EditorItemTemplate
\define config-title()
$(config-base)$$(currentTiddler)$
\end
\whitespace trim
<$draggable tiddler=<<currentTiddler>>>
<$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/> <span class="tc-icon-wrapper"><$transclude tiddler={{!!icon}}/></span> <$transclude field="caption"/> -- <i class="tc-muted"><$transclude field="description"/></i>
<$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/>
&#32;
<span class="tc-icon-wrapper"><$transclude tiddler={{!!icon}}/></span>
&#32;
<$transclude field="caption"/>
&#32;--&#32;
<i class="tc-muted"><$transclude field="description"/></i>
</$draggable>

View File

@@ -3,7 +3,17 @@ title: $:/core/ui/ControlPanel/Toolbars/ItemTemplate
\define config-title()
$(config-base)$$(currentTiddler)$
\end
\whitespace trim
<$draggable tiddler=<<currentTiddler>>>
<$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/> <span class="tc-icon-wrapper"> <$transclude field="caption"/> <i class="tc-muted">-- <$transclude field="description"/></i></span>
<$checkbox tiddler=<<config-title>> field="text" checked="show" unchecked="hide" default="show"/>
&#32;
<span class="tc-icon-wrapper">
&#32;
<$transclude field="caption"/>
&#32;
<i class="tc-muted">
--&#32;
<$transclude field="description"/>
</i></span>
</$draggable>

View File

@@ -5,6 +5,7 @@ first-search-filter: [!is[system]search:title<userInput>sort[title]limit[250]]
second-search-filter: [!is[system]search<userInput>sort[title]limit[250]]
\define searchResultList()
\whitespace trim
//<small>{{$:/language/Search/Matches/Title}}</small>//
<$list filter="[<userInput>minlength[1]]" variable="ignore">

View File

@@ -1,19 +1,43 @@
title: $:/core/ui/EditTemplate
\define delete-edittemplate-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [<newFieldValueTiddler>] [<newFieldNameInputTiddler>] [<newFieldNameSelectionTiddler>] [<newTagNameTiddler>] [<newTagNameInputTiddler>] [<newTagNameSelectionTiddler>] [<typeInputTiddler>] [<typeSelectionTiddler>]"/>
\define delete-edittemplate-state-tiddlers() <$action-deletetiddler $filter="[<newFieldNameTiddler>] [prefix<newFieldValueTiddlerPrefix>] [<newFieldNameInputTiddler>] [<newFieldNameSelectionTiddler>] [<newTagNameTiddler>] [<newTagNameInputTiddler>] [<newTagNameSelectionTiddler>] [<typeInputTiddler>] [<typeSelectionTiddler>]"/>
\define get-field-value-tiddler-filter() [subfilter<get-field-editor-filter>sha256[16]addprefix[/]addprefix<newFieldValueTiddlerPrefix>]
\define get-field-editor-filter() [<newFieldNameTiddler>get[text]else[]] :cascade[all[shadows+tiddlers]tag[$:/tags/FieldEditorFilter]!is[draft]get[text]] :and[!is[blank]else{$:/core/ui/EditTemplate/fieldEditor/default}]
\define save-tiddler-actions()
\whitespace trim
<$action-sendmessage $message="tm-add-tag" $param={{{ [<newTagNameTiddler>get[text]] }}}/>
<$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldValueTiddler>get[text]] }}}/>
<$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldNameTiddler>get[text]] :map[subfilter<get-field-value-tiddler-filter>get[text]] }}}/>
<<delete-edittemplate-state-tiddlers>>
<$action-sendmessage $message="tm-save-tiddler"/>
\end
\define cancel-delete-tiddler-actions(message)
\whitespace trim
<<delete-edittemplate-state-tiddlers>>
<$action-sendmessage $message="tm-$message$-tiddler"/>
\end
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class={{{ tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}>
\whitespace trim
<div
data-tiddler-title=<<currentTiddler>>
data-tags={{!!tags}}
class={{{ tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}
role="region"
aria-label={{$:/language/EditTemplate/Caption}}>
<$fieldmangler>
<$vars storyTiddler=<<currentTiddler>> newTagNameTiddler=<<qualify "$:/temp/NewTagName">> newFieldNameTiddler=<<qualify "$:/temp/NewFieldName">> newFieldValueTiddler=<<qualify "$:/temp/NewFieldValue">> newFieldNameInputTiddler=<<qualify "$:/temp/NewFieldName/input">> newFieldNameSelectionTiddler=<<qualify "$:/temp/NewFieldName/selected-item">> newTagNameInputTiddler=<<qualify "$:/temp/NewTagName/input">> newTagNameSelectionTiddler=<<qualify "$:/temp/NewTagName/selected-item">> typeInputTiddler=<<qualify "$:/temp/Type/input">> typeSelectionTiddler=<<qualify "$:/temp/Type/selected-item">>>
<$vars
storyTiddler=<<currentTiddler>>
newTagNameTiddler=<<qualify "$:/temp/NewTagName">>
newFieldNameTiddler=<<qualify "$:/temp/NewFieldName">>
newFieldValueTiddlerPrefix=<<qualify "$:/temp/NewFieldValue">>
newFieldNameInputTiddler=<<qualify "$:/temp/NewFieldName/input">>
newFieldNameSelectionTiddler=<<qualify "$:/temp/NewFieldName/selected-item">>
newTagNameInputTiddler=<<qualify "$:/temp/NewTagName/input">>
newTagNameSelectionTiddler=<<qualify "$:/temp/NewTagName/selected-item">>
typeInputTiddler=<<qualify "$:/temp/Type/input">>
typeSelectionTiddler=<<qualify "$:/temp/Type/selected-item">>>
<$keyboard key="((cancel-edit-tiddler))" actions=<<cancel-delete-tiddler-actions "cancel">> tag="div">
<$keyboard key="((save-tiddler))" actions=<<save-tiddler-actions>> tag="div">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem">

View File

@@ -2,9 +2,9 @@ title: $:/core/ui/EditTemplate/body/preview/output
tags: $:/tags/EditPreview
caption: {{$:/language/EditTemplate/Body/Preview/Type/Output}}
\import [all[shadows+tiddlers]tag[$:/tags/Macro/View]!has[draft.of]]
\import [all[shadows+tiddlers]tag[$:/tags/Macro/View]!has[draft.of]] [all[shadows+tiddlers]tag[$:/tags/Macro/View/Body]!has[draft.of]]
<$set name="tv-tiddler-preview" value="yes">
<$transclude />
<$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateBodyFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/body/default]] }}} />
</$set>

Some files were not shown because too many files have changed in this diff Show More