1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-01-24 20:04:40 +00:00

Compare commits

..

157 Commits

Author SHA1 Message Date
Jermolene
0cca9092ef Version number update for 5.0.13-beta 2014-06-24 10:44:51 +01:00
Jermolene
b594eb5b36 Update release dates 2014-06-24 10:42:46 +01:00
Jermolene
917c4404e5 Update batch files to use build system 2014-06-24 10:39:45 +01:00
Jermolene
6f3e31abe5 Fixed problems with detecting changes to draft tiddlers 2014-06-23 23:28:22 +01:00
Jermolene
5962600cb6 Update release note 2014-06-23 18:13:50 +01:00
Jeremy Ruston
cf3f11a4c0 Merge pull request #669 from jayfresh/patch-1
Typo fix
2014-06-23 18:12:34 +01:00
Jeremy Ruston
bcf37c765f Merge pull request #670 from jayfresh/patch-2
Adding Jonathan Lister to individuals list
2014-06-23 18:12:02 +01:00
Jonathan Lister
248029b53a Adding Jonathan Lister to individuals list 2014-06-23 12:51:08 +01:00
Jonathan Lister
57c534b97d Typo fix 2014-06-23 12:34:05 +01:00
Jermolene
6d1eaeb0fc Fix detection of draft changes
We were getting a lot of problems where changes to a tiddler were not
being recognised
2014-06-23 08:10:32 +01:00
Jermolene
680fe41ed7 Add isEqual() method to tiddlers 2014-06-23 08:09:59 +01:00
Jermolene
32a1da7673 Fixed problem with pasted items lacking a type 2014-06-22 11:58:00 +01:00
Jermolene
8d78336e9b Docs update 2014-06-22 11:45:07 +01:00
Jermolene
9987e6de22 Fix problem with overwriting existing tiddlers 2014-06-22 11:45:00 +01:00
Jermolene
38530f14f2 Docs updates 2014-06-22 11:14:24 +01:00
Jermolene
0fae9ee992 Improve handling of popup state
An improvement to 6fb992690d

By making sure that all the popup state tiddlers have the prefix
$:/state/popup/ we can be more selective and just exclude popup state
tiddlers when we save. The end result is that once again other kinds of
state are persisted as expected (eg tabs, and sidebar visibility).
2014-06-22 11:14:11 +01:00
Jermolene
12b5ebb946 A new colour palette 2014-06-22 11:11:09 +01:00
Jeremy Ruston
5120a1b32b Merge pull request #664 from BramChen/master
Add chinese translations of the TOC tab caption
2014-06-21 20:44:14 +01:00
Jeremy Ruston
9a2d650868 Merge pull request #665 from xcazin/fr-FR
fr-FR missing captions for Sidebar
2014-06-21 20:34:15 +01:00
Jeremy Ruston
ad74877dad Merge pull request #666 from pmario/de-DE
german translations
2014-06-21 20:33:47 +01:00
Mario Pietsch
b77ad3061d german translations 2014-06-21 17:35:02 +02:00
Xavier Cazin
31b1e073a6 Missing Sidebar fr-FR caption, plus better translation for Contents 2014-06-21 17:20:01 +02:00
Xavier Cazin
5d88f19ec6 fr-FR translation for TableOfContents caption 2014-06-21 17:09:44 +02:00
Bram Chen
133c24e9c7 Add chinese translations of the TOC tab caption 2014-06-21 22:04:43 +08:00
Jermolene
f15eba66fe Use SVG icons for expand/collapse 2014-06-21 11:49:42 +01:00
Jermolene
911a64221a Docs update 2014-06-21 11:49:30 +01:00
Jermolene
424c0737a2 Update release note 2014-06-21 11:21:27 +01:00
Jermolene
0b38cd640c Reverse accidentally making Contents the default tab 2014-06-21 11:18:59 +01:00
Jermolene
32099b85d3 Add table of contents to tw5.com 2014-06-21 11:17:04 +01:00
Jermolene
71aa2bbe5f Docs update 2014-06-21 11:16:48 +01:00
Jermolene
fb5c44a875 Remove indenting
It didn’t work very well, and was giving us spans where there should be
divs in the tab control.
2014-06-21 11:16:35 +01:00
Jermolene
f12d7bb6c0 Update to version 8.0 of highlight.js 2014-06-21 10:11:04 +01:00
Jeremy Ruston
665e490d33 Merge pull request #662 from xcazin/fr-FR
fr-FR translation of new Buttons-related strings plus type editors and c...
2014-06-20 18:52:15 +01:00
Jeremy Ruston
76f637d57a Merge pull request #661 from buggyj/jsonparams2
added missing regex update for triple double-quotes macro params
2014-06-20 18:51:51 +01:00
Xavier Cazin
2ccc13b936 fr-FR translation of new Buttons-related strings plus type editors and canonical_uri related strings 2014-06-20 17:14:16 +02:00
buggyj
0206358a1c added missing regex update for triple double-quotes macro params 2014-06-19 19:17:26 +02:00
Jermolene
f3a466ee86 Docs update 2014-06-19 12:37:54 +01:00
Jeremy Ruston
0c48502e8e Merge pull request #660 from buggyj/jsonparams
added triple double-quotes delimiters for marco/widget parameters (to su...
2014-06-19 12:06:00 +01:00
Jermolene
19061650de Refactoring for hygeine 2014-06-19 12:05:41 +01:00
Jermolene
c2b08b43b5 Docs updates 2014-06-19 08:53:24 +01:00
buggyj
a2ec4c55e3 added triple double-quotes delimiters for marco/widget parameters (to support json strings) 2014-06-19 07:29:14 +02:00
Jeremy Ruston
5eae2f0fb6 Merge pull request #659 from BramChen/master
Update chinese translations
2014-06-18 14:57:30 +01:00
Jermolene
b8aedf2ca3 Fixed problem with Markdown image handling 2014-06-18 14:56:32 +01:00
Bram Chen
2d24d05f61 Update chinese translations
* for adding editor type mappings to control panel
2014-06-18 21:47:45 +08:00
Jeremy Ruston
44cb3bc100 Merge pull request #658 from csugden/patch-1
Fixes undefined loop variables (fixes #657)
2014-06-18 13:57:54 +01:00
Jermolene
0cf4e5514c Docs tweak 2014-06-18 13:54:24 +01:00
Jermolene
1717c93d00 Refactor codemirror plugin
It no longer overrides the edit-text widget. Instead we use the editor
type mappings to select which content types should be handled by which
editor.
2014-06-18 13:54:19 +01:00
Jermolene
0bdc5b5c70 Add editor type mappings to control panel 2014-06-18 13:52:22 +01:00
csugden
1945af0b2d Fixes undefined loop variables (fixes #657) 2014-06-18 11:56:27 +01:00
Jermolene
e6b783154f Allow arbitrary fields in plugin.info files
Fixes #642
2014-06-18 08:52:31 +01:00
Jermolene
d2d0b09235 Refactoring plugin loading on Node.js 2014-06-18 08:34:49 +01:00
Jermolene
e28c2e8b06 Remove extraneous tag
Tiddlers tagged “resources” show up in the Community tiddler, which we
don’t want here.
2014-06-17 22:26:55 +01:00
Jermolene
2e2d30bae9 Docs for environment variable support
Fixes #531
2014-06-17 22:26:27 +01:00
Jermolene
a9b7df96c2 Add support for TIDDLYWIKI_EDITION_PATH 2014-06-17 21:59:20 +01:00
Jermolene
b2e48d00e9 Add environment variables for locating plugins
Start of fixing #531 (we still need to deal with
TIDDLYWIKI_EDITION_PATH)
2014-06-17 21:33:44 +01:00
Jermolene
9147cadd3c Remove the cat from the server architecture diagram 2014-06-17 16:14:00 +01:00
Jeremy Ruston
4951a53063 Merge pull request #656 from BramChen/master
Update chinese translations
2014-06-17 15:47:45 +01:00
Bram Chen
36556b817f Update chinese translations
* add Buttons.multids
* add description of _canonical_uri to filds.multids
2014-06-17 21:22:29 +08:00
Jermolene
8bd19c4e6a Merge branch 'accessibility' 2014-06-17 11:49:06 +01:00
Jermolene
34e4166dc5 Add label and title for show/hide sidebar buttons
More fixes for #650
2014-06-17 11:39:18 +01:00
Jermolene
617963bd88 Update button widget docs 2014-06-17 10:49:13 +01:00
Jermolene
346b2f8611 Add label for advanced search link 2014-06-17 07:56:36 +01:00
Jermolene
6f859c8d44 Add label for close button in open sidebar tab 2014-06-17 07:56:27 +01:00
Jermolene
325a93f3c3 Move button language to $:/language/Buttons 2014-06-17 07:56:13 +01:00
Jermolene
06b0f9adb7 Added aria-label attribute to link widget
And document it for the button widget
2014-06-17 07:54:10 +01:00
Jermolene
401349a1d6 Improve a11y of close buttons in open tab
a11y === accessibility
2014-06-16 17:40:38 +01:00
Jermolene
bc9b67cbc3 Use H1 for page title and H2 for tiddler titles
Ideally, we’d also rebase the headings within tiddlers so that `!
Heading` would be an H3. Hopefully we’ll do that later.
2014-06-16 17:34:20 +01:00
Jermolene
6fb992690d Exclude state tiddlers when saving changes
This might be a controversial change as it also means that it is no
longer possible to include `$:/state/…` tiddlers in a wiki to set up
the initial configuration.
2014-06-16 17:21:41 +01:00
Jeremy Ruston
57f3eb0b2c Merge pull request #653 from BramChen/master
Correct chinese translations of Help text for savetiddlers
2014-06-15 08:40:01 +01:00
Jermolene
bf2f88ba8b Use H1 for tiddler titles
Part of #650
2014-06-15 08:37:58 +01:00
Bram Chen
00d041b778 Correct chinese translations of Help text for savetiddlers 2014-06-15 08:17:12 +08:00
Jermolene
eeedcb6d94 First pass at accessibility improvements for #650 2014-06-14 18:06:56 +01:00
Jermolene
b4ddaccd1d Docs and image updates
These two architecture diagrams are a few hundred kilobytes, so we
don’t want them baked into the HTML file
2014-06-14 13:41:09 +01:00
Jermolene
d83c26fe3b Add external image support to tiddlywiki.com 2014-06-14 13:24:48 +01:00
Jermolene
1c484f59bd Add external image build target for empty edition 2014-06-14 13:24:27 +01:00
Jeremy Ruston
149ca0fc63 Merge pull request #651 from BramChen/master
Update chinese translations of Help text for server command
2014-06-14 08:20:09 +01:00
Jeremy Ruston
f467ae288b Merge pull request #652 from xcazin/fr-FR
fr-FR translations of recently added commands and type, plus suggestion for en-GB/Help/savetiddlers.tid
2014-06-14 08:20:02 +01:00
Jermolene
457764077b Recommitting the old tw2parser plugin 2014-06-14 08:17:16 +01:00
Xavier Cazin
892900c9c5 fr-FR translation of setfield and savetiddlers docs, plus javascript type 2014-06-14 07:40:12 +02:00
Xavier Cazin
d880cb135a Update what was left from a copy/paste of savetiddler.tid :-) 2014-06-14 07:35:53 +02:00
Bram Chen
a858329742 Update chinese translations of Help text for server command
...
2014-06-14 09:19:00 +08:00
Jermolene
e44450edc4 Correct typo 2014-06-13 17:02:39 +01:00
Jermolene
f09d69d1b7 Remove debugging code 2014-06-13 14:44:43 +01:00
Jermolene
eee3a0cf8e Extend server command to allow a path prefix
Thereby making the number of parameters to the command ludicrous
2014-06-13 14:44:34 +01:00
Jermolene
4238af2a40 Extend listed filter operator to use any field 2014-06-13 10:58:19 +01:00
Jeremy Ruston
f54f0d1c3e Merge pull request #649 from BramChen/master
Update translated group of application Javascript in type dropdown
2014-06-13 10:08:10 +01:00
Jermolene
ca34cc437c Rename $:/core/templates/canonical-uri-external-image
As per @pmario’s suggestion.
2014-06-13 10:04:31 +01:00
Bram Chen
71c886e3a1 Update translated group of application Javascript in type dropdown 2014-06-13 16:36:23 +08:00
Jeremy Ruston
db147e3673 Merge pull request #648 from BramChen/master
Update chinese translations
2014-06-13 08:51:42 +01:00
Bram Chen
525613750b Update chinese translations 2014-06-13 09:42:27 +08:00
Jermolene
f751e2ecb4 Added application JavaScript to type dropdown
Fixes #646
2014-06-12 19:12:58 +01:00
Jeremy Ruston
ea5989048c Merge pull request #640 from danielo515/patch-2
Update instructions.tid to use one of the included addons
2014-06-12 19:10:12 +01:00
Jeremy Ruston
eec849c69e Merge pull request #647 from BramChen/master
Update chinese translations for Help tiddlers
2014-06-12 19:09:36 +01:00
Jermolene
666f243a82 Release note and doc updates for 5.0.13 2014-06-12 19:03:12 +01:00
Jermolene
4e5fa2c6e6 Docs update 2014-06-12 18:01:39 +01:00
Jermolene
9ab0c84140 Support global macros via the importvariables widget
The new importvariables widget imports macro/variable definitions from
the specified tiddlers and makes them available to its children.

Allows us to split PageMacros up into separate tiddlers.

We still support loading macros from $:/core/ui/PageMacros to help
people upgrading.

Fixes #644 and #559
2014-06-12 18:01:33 +01:00
Bram Chen
9261bdaa43 Merge remote-tracking branch 'upstream/master' 2014-06-12 20:19:05 +08:00
Jermolene
0e09fbf46a Start using the build command in batch files 2014-06-12 08:36:53 +01:00
Jermolene
9547a1f01c First pass at external image support
A bunch of little changes that together enable external image support.
Try:

```
tiddlywiki editions/tw5.com --verbose --build externalimages
```

Then open `externalimages.html`, look for the images in the more/types
tab of the sidebar, open them and verify that they are set with an
external SRC attribute, not a data URI.
2014-06-12 08:36:30 +01:00
Bram Chen
0e4afc3986 Update chinese translations for Help tiddlers 2014-06-12 10:59:19 +08:00
Bram Chen
10fa72d15e Update chinese translations for Help tiddlers 2014-06-12 10:56:04 +08:00
Jermolene
f131c37893 Update HTML parser to use an IFRAME
Gives us better sandboxing of unsafe HTML content
2014-06-11 23:04:58 +01:00
Jermolene
d2796d0c9c Introduce setfield command
This new command will let us do the manipulations needed to set up
external image tiddlers
2014-06-11 10:05:35 +01:00
Jermolene
460f476aef Docs update 2014-06-10 23:15:42 +01:00
Jermolene
2989c9b133 Typo in 305617b632
Tsk
2014-06-10 23:05:08 +01:00
Jermolene
3105afe6e8 Add demo PDF image
That cat again
2014-06-10 23:03:41 +01:00
Jermolene
a03a15e7de Allow the text widget to refresh if needed 2014-06-10 19:32:55 +01:00
Jermolene
305617b632 Introduce savetiddlers command
Allows us to save tiddlers in their raw format.
2014-06-09 14:45:41 +01:00
Jermolene
b446ef5d4e Docs updates on Reporting Bugs 2014-06-09 14:16:21 +01:00
danielo515
8dd30e97ac Update instructions.tid to use one of the included addons
This addon is already included into the plugin, but is not used, neither mentioned how to use it. It is a very useful but lightweight addon. I consider it is better to include the full functionality of the current configuration in the config example.
2014-06-07 17:04:43 +02:00
Jermolene
fc6d96672d Another select widget demo 2014-06-06 09:33:24 +01:00
Jermolene
78791192c3 Style updates missed off the last commit 2014-06-06 09:32:45 +01:00
Jermolene
9b576f2a8d Add group headings to type dropdown
We’re also reverting to the old custom dropdown. Using the select
widget didn’t work out because it couldn’t cleanly work with a text box
allowing custom types to be specified.
2014-06-06 09:32:14 +01:00
Jeremy Ruston
08ed0017af Merge pull request #637 from mwfogleman/emacs-helper-functions
Add docs for open- and browse-wiki Emacs functions.
2014-06-03 23:14:11 +01:00
Michael Fogleman
450c646c31 Add docs for open- and browse-wiki Emacs functions.
These helper functions supplement tid-mode.
2014-06-03 23:04:29 +08:00
Jeremy Ruston
0c6c5002c1 Merge pull request #635 from danielo515/patch-1
Added Daniel Rodríguez to contributors list
2014-06-02 20:38:03 +01:00
danielo515
9b3b08a176 Added Daniel Rodríguez to contributors list
The date is the original when I tried to add myself at first instance.
2014-06-02 17:05:22 +02:00
Jeremy Ruston
6386bf84a5 Merge pull request #630 from xcazin/fr-FR
Add fr-FR translated groups to Tiddler types
2014-06-02 12:17:28 +01:00
Jeremy Ruston
c3dfa3f27e Merge pull request #631 from BramChen/master
Add chinese translations of 'group' field to tiddler types
2014-06-02 12:17:09 +01:00
Bram Chen
50223562ea Add chinese translations of 'group' field to tiddler types 2014-06-01 12:31:25 +08:00
Xavier Cazin
85c7da95bb Add fr-FR translated groups to Tiddler types 2014-06-01 00:38:58 +02:00
Jermolene
c8e98c1567 Use the select widget tiddler content types 2014-05-31 22:39:32 +01:00
Jermolene
13463a47c5 Attention Translators! Add "group" field to tiddler types
Apologies to the translators for the extra work. Each translated
tiddler type needs a new “group” field that contains a locale-specific
group name that in English are “Image”, “Developer” and “Text”.
2014-05-31 22:38:50 +01:00
Jermolene
ffd9df670d Fix problem with tabs switching on language change
In 5.0.12-beta, if you change the current language setting then the
current sidebar tab setting is lost. This was because the qualified
title generated for the tabs was incorporating the current language
title, by virtue of a trick used in the PageTemplate to set the
“languageTitle” variable to a field of the current language plugin.
This trick left the current tiddler set to the current language, and
this current tiddler was still in force for the transclusion of the
page template segments.
2014-05-31 19:20:51 +01:00
Jermolene
d2edd9291e Standardise whitespace 2014-05-31 19:18:46 +01:00
Jermolene
247eb04b11 Extraneous semi-colon 2014-05-31 19:18:01 +01:00
Jermolene
954946352a Docs update 2014-05-31 18:38:25 +01:00
Jermolene
0ccaedd7d2 Use the select widget in the various switchers 2014-05-31 18:38:17 +01:00
Jermolene
3182a2d599 Add first pass at select widget 2014-05-31 18:37:43 +01:00
Jermolene
f999b2e931 Add wiki.setText() method 2014-05-31 18:37:27 +01:00
Jermolene
4d70d5780e Use radio buttons in navigation settings
Radio buttons are much clearer
2014-05-31 18:36:59 +01:00
Jermolene
a330cb543e Better defaults for radio widget
Now the “field” attribute defaults to “text”.
2014-05-31 18:35:41 +01:00
Jermolene
64a6544b02 Update the first rule of TiddlyWiki 2014-05-30 11:38:42 +01:00
Jermolene
3f25db0abe More permalink tweaks
And more documentation this time!
2014-05-29 23:17:21 +01:00
Jermolene
412cde6f53 Move "storyviews" filter operator to correct folder 2014-05-28 17:17:47 +01:00
Jermolene
f7b8813a27 Change permalink behaviour
Now a link to a single tiddler like http://tiddlywiki.com/#HelloThere
will just open that single tiddler (the old behaviour was to also open
the default tiddlers)
2014-05-28 17:07:41 +01:00
Jermolene
62c602e9d2 Fix for running under node-webkit 2014-05-28 08:57:29 +01:00
Jermolene
d8a142fed5 Fix vertical tabs in Safari
Current versions of Safari on OS X and iOS are still prefixed.
2014-05-27 19:06:27 +01:00
Jermolene
1b37d660ea Restore "escape" as shortcut to abandon edits
Thus reverting a defensive change back in January:
d72d245523
2014-05-27 15:42:33 +01:00
Jermolene
da273be054 Workaround Firefox "no element found" bug
See https://bugzilla.mozilla.org/show_bug.cgi?id=884693

Fixes #468
2014-05-27 09:49:48 +01:00
Jermolene
a463859a28 Retract inadvertant change from previous commit 2014-05-26 22:56:58 +01:00
Jermolene
9aaa000d3f Fixed default tiddler not appearing in zoomin view
See https://groups.google.com/d/topic/tiddlywiki/c-z7f-h1CAo/discussion
2014-05-26 22:56:28 +01:00
Jermolene
f14ecf4eb8 Add support for $:/tags/RawMarkup 2014-05-26 22:50:54 +01:00
Jermolene
128ad01866 Fix for inability to scroll modal wizards 2014-05-26 22:33:42 +01:00
Jermolene
ecbda326cb Add keyboard shortcut documentation 2014-05-26 21:50:04 +01:00
Jeremy Ruston
e24600f9bb Merge pull request #617 from IreneKnapp/Irene-contributor
Sign the contributor agreement.
2014-05-26 19:19:01 +01:00
Jermolene
6436dc22a7 Fix obsolete transclude widget docs 2014-05-26 18:01:53 +01:00
Jermolene
f44f2b33ed Fixed missing class on external pretty links 2014-05-26 17:57:35 +01:00
Jermolene
86d182fd51 Fix importing blank fields from TiddlyWiki files 2014-05-26 17:47:07 +01:00
Jermolene
3fa4b00ede Docs update 2014-05-26 17:38:36 +01:00
Jermolene
d30cb0f11d New ribbon colour for 5.0.13 2014-05-18 20:02:21 +01:00
Jermolene
906d2db57e Preparing for 5.0.13 2014-05-18 19:58:23 +01:00
Irene Knapp
3e6de03f15 Sign the contributor agreement. 2014-05-17 11:04:46 -07:00
Jermolene
aaec1b2854 Version number update for 5.0.12-beta 2014-05-17 01:17:04 +01:00
Jermolene
9edebc78e7 Tweak ribbon colour for 5.0.12 2014-05-17 01:14:20 +01:00
Jermolene
e228ac42db Fix problem with shadow tiddler iteration
See https://groups.google.com/d/topic/tiddlywiki/pNxZsSCVp7c/discussion
for more details of the bug.
2014-05-17 01:12:08 +01:00
Jermolene
be0bc04929 Fix typo 2014-05-17 01:11:41 +01:00
229 changed files with 4119 additions and 753 deletions

17
bld.cmd
View File

@@ -35,19 +35,9 @@ node .\tiddlywiki.js ^
.\editions\tw5.com ^
--verbose ^
--output . ^
--rendertiddler ReadMe .\readme.md text/html ^
--rendertiddler ContributingTemplate .\contributing.md text/html ^
--rendertiddler $:/core/copyright.txt .\licenses\copyright.md text/plain ^
--build readmes ^
--output %TW5_BUILD_OUTPUT% ^
--rendertiddler $:/core/save/all index.html text/plain ^
--savetiddler $:/favicon.ico favicon.ico ^
--rendertiddler $:/editions/tw5.com/download-empty empty.html text/plain ^
--rendertiddler $:/editions/tw5.com/download-empty empty.hta text/plain ^
--savetiddler $:/green_favicon.ico %TW5_BUILD_OUTPUT%/static/favicon.ico ^
--rendertiddler $:/core/templates/static.template.html static.html text/plain ^
--rendertiddler $:/core/templates/alltiddlers.template.html alltiddlers.html text/plain ^
--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html static text/plain ^
--rendertiddler $:/core/templates/static.template.css static\static.css text/plain ^
--build favicon empty static index ^
|| exit 1
rem encrypted.html: a version of the main file encrypted with the password "password"
@@ -56,8 +46,7 @@ node .\tiddlywiki.js ^
.\editions\tw5.com ^
--verbose ^
--output %TW5_BUILD_OUTPUT% ^
--password password ^
--rendertiddler $:/core/save/all encrypted.html text/plain ^
--build encrypted ^
|| exit 1
rem tahoelafs.html: empty wiki with plugin for Tahoe-LAFS

17
bld.sh
View File

@@ -36,19 +36,9 @@ node ./tiddlywiki.js \
./editions/tw5.com \
--verbose \
--output . \
--rendertiddler ReadMe ./readme.md text/html \
--rendertiddler ContributingTemplate ./contributing.md text/html \
--rendertiddler $:/core/copyright.txt ./licenses/copyright.md text/plain \
--build readmes \
--output $TW5_BUILD_OUTPUT \
--rendertiddler $:/core/save/all index.html text/plain \
--savetiddler $:/favicon.ico favicon.ico \
--rendertiddler $:/editions/tw5.com/download-empty empty.html text/plain \
--rendertiddler $:/editions/tw5.com/download-empty empty.hta text/plain \
--savetiddler $:/green_favicon.ico static/favicon.ico \
--rendertiddler $:/core/templates/static.template.html static.html text/plain \
--rendertiddler $:/core/templates/alltiddlers.template.html alltiddlers.html text/plain \
--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html static text/plain \
--rendertiddler $:/core/templates/static.template.css static/static.css text/plain \
--build favicon empty static index \
|| exit 1
# encrypted.html: a version of the main file encrypted with the password "password"
@@ -57,8 +47,7 @@ node ./tiddlywiki.js \
./editions/tw5.com \
--verbose \
--output $TW5_BUILD_OUTPUT \
--password password \
--rendertiddler $:/core/save/all encrypted.html text/plain \
--build encrypted \
|| exit 1
# tahoelafs.html: empty wiki with plugin for Tahoe-LAFS

View File

@@ -187,7 +187,7 @@ $tw.utils.deepDefaults = function(object /*, sourceObjectList */) {
$tw.utils.each(Array.prototype.slice.call(arguments,1),function(source) {
if(source) {
for (var p in source) {
if(object[p] == null) {
if(object[p] === null || object[p] === undefined) {
object[p] = source[p];
}
if(typeof object[p] === "object" && typeof source[p] === "object") {
@@ -565,7 +565,7 @@ Crypto helper object for encrypted content. It maintains the password text in a
the password, and to encrypt/decrypt a block of text
*/
$tw.utils.Crypto = function() {
var sjcl = $tw.browser ? window.sjcl : require("./sjcl.js"),
var sjcl = $tw.node ? require("./sjcl.js") : window.sjcl,
currentPassword = null,
callSjcl = function(method,inputText,password) {
password = password || currentPassword;
@@ -915,8 +915,12 @@ $tw.Wiki = function(options) {
// Iterate through all the shadows and then the tiddlers
this.eachShadowPlusTiddlers = function(callback) {
for(var title in shadowTiddlers) {
var shadowInfo = shadowTiddlers[title];
callback(shadowInfo.tiddler,title);
if(Object.prototype.hasOwnProperty.call(tiddlers,title)) {
callback(tiddlers[title],title);
} else {
var shadowInfo = shadowTiddlers[title];
callback(shadowInfo.tiddler,title);
}
}
for(var title in tiddlers) {
if(!Object.prototype.hasOwnProperty.call(shadowTiddlers,title)) {
@@ -1421,7 +1425,7 @@ $tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
} else {
// If not, read all the files in the directory
$tw.utils.each(files,function(file) {
if(!excludeRegExp.test(file)) {
if(!excludeRegExp.test(file) && file !== "plugin.info") {
tiddlers.push.apply(tiddlers,$tw.loadTiddlersFromPath(filepath + path.sep + file,excludeRegExp));
}
});
@@ -1438,53 +1442,102 @@ Load the tiddlers from a plugin folder, and package them up into a proper JSON p
*/
$tw.loadPluginFolder = function(filepath,excludeRegExp) {
excludeRegExp = excludeRegExp || $tw.boot.excludeRegExp;
var stat, files, pluginInfo, pluginTiddlers = [], f, file, titlePrefix, t;
if(fs.existsSync(filepath)) {
stat = fs.statSync(filepath);
if(stat.isDirectory()) {
// Read the plugin information
pluginInfo = JSON.parse(fs.readFileSync(filepath + path.sep + "plugin.info","utf8"));
// Read the plugin files
files = fs.readdirSync(filepath);
for(f=0; f<files.length; f++) {
file = files[f];
if(!excludeRegExp.test(file) && file !== "plugin.info" && file !== "tiddlywiki.files") {
var tiddlerFiles = $tw.loadTiddlersFromPath(filepath + path.sep + file,excludeRegExp);
$tw.utils.each(tiddlerFiles,function(tiddlerFile) {
pluginTiddlers.push.apply(pluginTiddlers,tiddlerFile.tiddlers);
});
}
}
// Save the plugin tiddlers into the plugin info
pluginInfo.tiddlers = pluginInfo.tiddlers || Object.create(null);
for(t=0; t<pluginTiddlers.length; t++) {
if(pluginTiddlers[t].title) {
pluginInfo.tiddlers[pluginTiddlers[t].title] = pluginTiddlers[t];
if(fs.existsSync(filepath) && fs.statSync(filepath).isDirectory()) {
// Read the plugin information
var pluginInfo = JSON.parse(fs.readFileSync(filepath + path.sep + "plugin.info","utf8"));
// Read the plugin files
var pluginFiles = $tw.loadTiddlersFromPath(filepath,excludeRegExp);
// Save the plugin tiddlers into the plugin info
pluginInfo.tiddlers = pluginInfo.tiddlers || Object.create(null);
for(var f=0; f<pluginFiles.length; f++) {
var tiddlers = pluginFiles[f].tiddlers;
for(var t=0; t<tiddlers.length; t++) {
var tiddler= tiddlers[t];
if(tiddler.title) {
pluginInfo.tiddlers[tiddler.title] = tiddler;
}
}
}
}
// Give the plugin the same version number as the core if it doesn't have one
if(pluginInfo && !("version" in pluginInfo)) {
pluginInfo.version = $tw.packageInfo.version;
}
// Save the plugin tiddler
if(pluginInfo) {
var fields = {
title: pluginInfo.title,
type: "application/json",
text: JSON.stringify({tiddlers: pluginInfo.tiddlers},null,4),
"plugin-priority": pluginInfo["plugin-priority"],
"name": pluginInfo["name"],
"version": pluginInfo["version"],
"thumbnail": pluginInfo["thumbnail"],
"description": pluginInfo["description"],
"plugin-type": pluginInfo["plugin-type"] || "plugin",
"dependents": $tw.utils.stringifyList(pluginInfo["dependents"] || [])
// Give the plugin the same version number as the core if it doesn't have one
if(!("version" in pluginInfo)) {
pluginInfo.version = $tw.packageInfo.version;
}
return fields;
// Use "plugin" as the plugin-type if we don't have one
if(!("plugin-type" in pluginInfo)) {
pluginInfo["plugin-type"] = "plugin";
}
pluginInfo.dependents = pluginInfo.dependents || [];
pluginInfo.type = "application/json";
// Set plugin text
pluginInfo.text = JSON.stringify({tiddlers: pluginInfo.tiddlers},null,4);
delete pluginInfo.tiddlers;
// Deserialise array fields (currently required for the dependents field)
for(var field in pluginInfo) {
if($tw.utils.isArray(pluginInfo[field])) {
pluginInfo[field] = $tw.utils.stringifyList(pluginInfo[field]);
}
}
return pluginInfo;
} else {
return null;
return null;
}
};
/*
name: Name of the plugin to find
paths: array of file paths to search for it
Returns the path of the plugin folder
*/
$tw.findLibraryItem = function(name,paths) {
var pathIndex = 0;
do {
var pluginPath = path.resolve(paths[pathIndex],"./" + name)
if(fs.existsSync(pluginPath) && fs.statSync(pluginPath).isDirectory()) {
return pluginPath;
}
} while(++pathIndex < paths.length);
return null;
};
/*
name: Name of the plugin to load
paths: array of file paths to search for it
*/
$tw.loadPlugin = function(name,paths) {
var pluginPath = $tw.findLibraryItem(name,paths);
if(pluginPath) {
var pluginFields = $tw.loadPluginFolder(pluginPath);
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
};
/*
libraryPath: Path of library folder for these plugins (relative to core path)
envVar: Environment variable name for these plugins
Returns an array of search paths
*/
$tw.getLibraryItemSearchPaths = function(libraryPath,envVar) {
var pluginPaths = [path.resolve($tw.boot.corePath,libraryPath)],
env = process.env[envVar];
if(env) {
Array.prototype.push.apply(pluginPaths,env.split(":"));
}
return pluginPaths;
};
/*
plugins: Array of names of plugins (eg, "tiddlywiki/filesystemadaptor")
libraryPath: Path of library folder for these plugins (relative to core path)
envVar: Environment variable name for these plugins
*/
$tw.loadPlugins = function(plugins,libraryPath,envVar) {
if(plugins) {
var pluginPaths = $tw.getLibraryItemSearchPaths(libraryPath,envVar);
for(var t=0; t<plugins.length; t++) {
$tw.loadPlugin(plugins[t],pluginPaths);
}
}
};
@@ -1516,36 +1569,10 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
}
});
}
// Load any plugins listed in the wiki info file
if(wikiInfo.plugins) {
var pluginBasePath = path.resolve($tw.boot.corePath,$tw.config.pluginsPath);
for(var t=0; t<wikiInfo.plugins.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(pluginBasePath,"./" + wikiInfo.plugins[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
}
// Load any themes listed in the wiki info file
if(wikiInfo.themes) {
var themesBasePath = path.resolve($tw.boot.corePath,$tw.config.themesPath);
for(var t=0; t<wikiInfo.themes.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(themesBasePath,"./" + wikiInfo.themes[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
}
// Load any languages listed in the wiki info file
if(wikiInfo.languages) {
var languagesBasePath = path.resolve($tw.boot.corePath,$tw.config.languagesPath);
for(var t=0; t<wikiInfo.languages.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(languagesBasePath,"./" + wikiInfo.languages[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
}
// Load any plugins, themes and languages listed in the wiki info file
$tw.loadPlugins(wikiInfo.plugins,$tw.config.pluginsPath,$tw.config.pluginsEnvVar);
$tw.loadPlugins(wikiInfo.themes,$tw.config.themesPath,$tw.config.themesEnvVar);
$tw.loadPlugins(wikiInfo.languages,$tw.config.languagesPath,$tw.config.languagesEnvVar);
// Load the wiki files, registering them as writable
var resolvedWikiPath = path.resolve(wikiPath,$tw.config.wikiTiddlersSubDir);
$tw.utils.each($tw.loadTiddlersFromPath(resolvedWikiPath),function(tiddlerFile) {
@@ -1574,7 +1601,7 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
var wikiPluginsPath = path.resolve(wikiPath,$tw.config.wikiPluginsSubDir);
if(fs.existsSync(wikiPluginsPath)) {
var pluginFolders = fs.readdirSync(wikiPluginsPath);
for(t=0; t<pluginFolders.length; t++) {
for(var t=0; t<pluginFolders.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(wikiPluginsPath,"./" + pluginFolders[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
@@ -1585,7 +1612,7 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
var wikiThemesPath = path.resolve(wikiPath,$tw.config.wikiThemesSubDir);
if(fs.existsSync(wikiThemesPath)) {
var themeFolders = fs.readdirSync(wikiThemesPath);
for(t=0; t<themeFolders.length; t++) {
for(var t=0; t<themeFolders.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(wikiThemesPath,"./" + themeFolders[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
@@ -1596,7 +1623,7 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
var wikiLanguagesPath = path.resolve(wikiPath,$tw.config.wikiLanguagesSubDir);
if(fs.existsSync(wikiLanguagesPath)) {
var languageFolders = fs.readdirSync(wikiLanguagesPath);
for(t=0; t<languageFolders.length; t++) {
for(var t=0; t<languageFolders.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(wikiLanguagesPath,"./" + languageFolders[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
@@ -1657,7 +1684,11 @@ $tw.boot.startup = function(options) {
wikiOutputSubDir: "./output",
jsModuleHeaderRegExpString: "^\\/\\*\\\\(?:\\r?\\n)((?:^[^\\r\\n]*(?:\\r?\\n))+?)(^\\\\\\*\\/$(?:\\r?\\n)?)",
fileExtensionInfo: Object.create(null), // Map file extension to {type:}
contentTypeInfo: Object.create(null) // Map type to {encoding:,extension:}
contentTypeInfo: Object.create(null), // Map type to {encoding:,extension:}
pluginsEnvVar: "TIDDLYWIKI_PLUGIN_PATH",
themesEnvVar: "TIDDLYWIKI_THEME_PATH",
languagesEnvVar: "TIDDLYWIKI_LANGUAGE_PATH",
editionsEnvVar: "TIDDLYWIKI_EDITION_PATH"
}
});
if(!$tw.boot.tasks.readBrowserTiddlers) {
@@ -1753,9 +1784,15 @@ Execute the remaining eligible startup tasks
*/
$tw.boot.executeNextStartupTask = function() {
// Find the next eligible task
var taskIndex = 0;
var taskIndex = 0, task,
asyncTaskCallback = function() {
if(task.name) {
$tw.boot.executedStartupModules[task.name] = true;
}
return $tw.boot.executeNextStartupTask();
};
while(taskIndex < $tw.boot.remainingStartupModules.length) {
var task = $tw.boot.remainingStartupModules[taskIndex];
task = $tw.boot.remainingStartupModules[taskIndex];
if($tw.boot.isStartupTaskEligible(task)) {
// Remove this task from the list
$tw.boot.remainingStartupModules.splice(taskIndex,1);
@@ -1779,12 +1816,7 @@ $tw.boot.executeNextStartupTask = function() {
}
return $tw.boot.executeNextStartupTask();
} else {
task.startup(function() {
if(task.name) {
$tw.boot.executedStartupModules[task.name] = true;
}
return $tw.boot.executeNextStartupTask();
});
task.startup(asyncTaskCallback);
return true;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
title: $:/core/images/right-arrow
tags: $:/tags/Image
<svg class="tw-image-right-arrow tw-image-button" width="22pt" height="22pt" viewBox="0 0 128 128"><path d="M72.7982405,98.6541105 L127.184015,43.9832042 C130.938662,40.2089635 130.938662,34.0896964 127.184015,30.3154557 C123.429583,26.5412364 117.342116,26.5412364 113.587684,30.3154557 L66.0000107,78.152522 L18.4123803,30.3154557 C14.6578195,26.5412364 8.57048132,26.5412364 4.81592057,30.3154557 C1.06135981,34.0896964 1.06135981,40.2089635 4.81592057,43.9832042 L59.2017595,98.6541105 C62.9563202,102.428351 69.0436798,102.428351 72.7982405,98.6541126 L72.7982405,98.6541105 Z" transform="translate(66.000000, 64.484791) rotate(-90.000000) translate(-66.000000, -64.484791) "/></svg>

View File

@@ -0,0 +1,26 @@
title: $:/language/Buttons/
AdvancedSearch/Caption: advanced search
AdvancedSearch/Hint: Advanced search
Cancel/Caption: cancel
Cancel/Hint: Cancel editing this tiddler
Close/Caption: close
Close/Hint: Close this tiddler
ControlPanel/Caption: control panel
ControlPanel/Hint: Open control panel
Delete/Caption: delete
Delete/Hint: Delete this tiddler
Edit/Caption: edit
Edit/Hint: Edit this tiddler
Info/Caption: info
Info/Hint: Show information for this tiddler
NewTiddler/Caption: new tiddler
NewTiddler/Hint: Create a new tiddler
Save/Caption: save
Save/Hint: Save this tiddler
SaveWiki/Caption: save changes
SaveWiki/Hint: Save changes
HideSideBar/Caption: hide sidebar
HideSideBar/Hint: Hide sidebar
ShowSideBar/Caption: show sidebar
ShowSideBar/Hint: Show sidebar

View File

@@ -1,6 +1,10 @@
title: $:/language/ControlPanel/
Advanced/Caption: Advanced
Advanced/EditorTypes/Caption: Editor Types
Advanced/EditorTypes/Editor/Caption: Editor
Advanced/EditorTypes/Hint: These tiddlers determine which editor is used to edit specific tiddler types.
Advanced/EditorTypes/Type/Caption: Type
Advanced/Hint: Internal information about this TiddlyWiki
Advanced/LoadedModules/Caption: Loaded Modules
Advanced/LoadedModules/Hint: These are the currently loaded tiddler modules linked to their source tiddlers. Any italicised modules lack a source tiddler, typically because they were setup during the boot process.

View File

@@ -1,5 +1,6 @@
title: $:/language/EditTemplate/
Body/External/Hint: This is an external tiddler stored outside of the main TiddlyWiki file. You can edit the tags and fields but cannot directly edit the content itself
Body/Hint: Use [[wiki text|http://tiddlywiki.com/static/WikiText.html]] to add formatting, images, and dynamic features
Body/Placeholder: Type the text for this tiddler
Body/Preview/Button/Hide: hide preview

View File

@@ -1,5 +1,6 @@
title: $:/language/Docs/Fields/
_canonical_uri: The full URI of an external image tiddler
bag: The name of the bag from which a tiddler came
caption: The text to be displayed on a tab or button
color: The CSS color value associated with a tiddler

View File

@@ -0,0 +1,12 @@
title: $:/language/Help/savetiddlers
description: Saves a group of raw tiddlers to a directory
Saves a group of tiddlers in their raw text or binary format to the specified directory.
```
--savetiddlers <filter> <pathname>
```
By default, the pathname is resolved relative to the `output` subdirectory of the edition directory. The `--output` command can be used to direct output to a different directory.
Any missing directories in the pathname are automatically created.

View File

@@ -6,7 +6,7 @@ The server built in to TiddlyWiki5 is very simple. Although compatible with Tidd
At the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for `GET`, `PUT` and `DELETE`.
```
--server <port> <roottiddler> <rendertype> <servetype> <username> <password> <host>
--server <port> <roottiddler> <rendertype> <servetype> <username> <password> <host> <pathprefix>
```
The parameters are:
@@ -18,6 +18,7 @@ The parameters are:
* ''username'' - the default username for signing edits
* ''password'' - optional password for basic authentication
* ''host'' - optional hostname to serve from (defaults to "127.0.0.1" aka "localhost")
* ''pathprefix'' - optional prefix for paths
If the password parameter is specified then the browser will prompt the user for the username and password. Note that the password is transmitted in plain text so this implementation isn't suitable for general use.

View File

@@ -0,0 +1,18 @@
title: $:/language/Help/setfield
description: Prepares external tiddlers for use
//Note that this command is experimental and may change or be replaced during the TiddlyWiki version 5 beta//
Sets the specified field of a group of tiddlers to the result of wikifying a template tiddler with the `currentTiddler` variable set to the tiddler.
```
--setfield <filter> <fieldname> <templatetitle> <rendertype>
```
The parameters are:
* ''filter'' - filter identifying the tiddlers to be affected
* ''fieldname'' - the field to modify (defaults to "text")
* ''templatetitle'' - the tiddler to wikify into the specified field. If blank or missing then the specified field is deleted
* ''type'' - the text type to render (defaults to "text/plain"; "text/html" can be used to include HTML tags)

View File

@@ -1,6 +1,7 @@
title: $:/language/SideBar/
All/Caption: All
Contents/Caption: Contents
Drafts/Caption: Drafts
Missing/Caption: Missing
More/Caption: More

View File

@@ -0,0 +1,4 @@
title: $:/language/Docs/Types/application/javascript
description: JavaScript code
name: application/javascript
group: Developer

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/application/json
description: JSON data
name: application/json
group: Developer

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/application/x-tiddler-dictionary
description: Data dictionary
name: application/x-tiddler-dictionary
group: Developer

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/image/gif
description: GIF image
name: image/gif
group: Image

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/image/jpeg
description: JPEG image
name: image/jpeg
group: Image

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/image/png
description: PNG image
name: image/png
group: Image

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/image/svg+xml
description: Structured Vector Graphics image
name: image/svg+xml
group: Image

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/image/x-icon
description: ICO format icon file
name: image/x-icon
group: Image

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/text/css
description: Static stylesheet
name: text/css
group: Developer

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/text/html
description: HTML markup
name: text/html
group: Text

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/text/plain
description: Plain text
name: text/plain
group: Text

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/text/vnd.tiddlywiki
description: TiddlyWiki version 5 wikitext
description: TiddlyWiki 5
name: text/vnd.tiddlywiki
group: Text

View File

@@ -1,3 +1,4 @@
title: $:/language/Docs/Types/text/x-tiddlywiki
description: TiddlyWiki Classic wikitext
description: TiddlyWiki Classic
name: text/x-tiddlywiki
group: Text

View File

@@ -34,7 +34,7 @@ Command.prototype.execute = function() {
for(var editionIndex=0; editionIndex<editions.length; editionIndex++) {
var editionName = editions[editionIndex];
// Check the edition exists
var editionPath = path.resolve($tw.boot.corePath,$tw.config.editionsPath) + path.sep + editionName;
var editionPath = $tw.findLibraryItem(editionName,$tw.getLibraryItemSearchPaths($tw.config.editionsPath,$tw.config.editionsEnvVar));
if(!$tw.utils.isDirectory(editionPath)) {
return "Edition '" + editionName + "' not found";
}

View File

@@ -0,0 +1,53 @@
/*\
title: $:/core/modules/commands/savetiddlers.js
type: application/javascript
module-type: command
Command to save several tiddlers to a folder of files
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var widget = require("$:/core/modules/widgets/widget.js");
exports.info = {
name: "savetiddlers",
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";
}
var self = this,
fs = require("fs"),
path = require("path"),
wiki = this.commander.wiki,
filter = this.params[0],
pathname = path.resolve(this.commander.outputPath,this.params[1]),
tiddlers = wiki.filterTiddlers(filter);
$tw.utils.deleteDirectory(pathname);
$tw.utils.createDirectory(pathname);
$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"},
filename = path.resolve(pathname,encodeURIComponent(title));
fs.writeFileSync(filename,tiddler.fields.text,contentTypeInfo.encoding);
});
return null;
};
exports.Command = Command;
})();

View File

@@ -50,10 +50,22 @@ SimpleServer.prototype.addRoute = function(route) {
};
SimpleServer.prototype.findMatchingRoute = function(request,state) {
var pathprefix = this.get("pathprefix") || "";
for(var t=0; t<this.routes.length; t++) {
var potentialRoute = this.routes[t],
pathRegExp = potentialRoute.path,
match = potentialRoute.path.exec(state.urlInfo.pathname);
pathname = state.urlInfo.pathname,
match;
if(pathprefix) {
if(pathname.substr(0,pathprefix.length) === pathprefix) {
pathname = pathname.substr(pathprefix.length);
match = potentialRoute.path.exec(pathname);
} else {
match = false;
}
} else {
match = potentialRoute.path.exec(pathname);
}
if(match && request.method === potentialRoute.method) {
state.params = [];
for(var p=1; p<match.length; p++) {
@@ -161,7 +173,8 @@ var Command = function(params,commander,callback) {
state.wiki.addTiddler(new $tw.Tiddler(state.wiki.getCreationFields(),fields,{title: title}));
var changeCount = state.wiki.getChangeCount(title).toString();
response.writeHead(204, "OK",{
Etag: "\"default/" + encodeURIComponent(title) + "/" + changeCount + ":\""
Etag: "\"default/" + encodeURIComponent(title) + "/" + changeCount + ":\"",
"Content-Type": "text/plain"
});
response.end();
}
@@ -172,7 +185,9 @@ var Command = function(params,commander,callback) {
handler: function(request,response,state) {
var title = decodeURIComponent(state.params[0]);
state.wiki.deleteTiddler(title);
response.writeHead(204, "OK");
response.writeHead(204, "OK", {
"Content-Type": "text/plain"
});
response.end();
}
});
@@ -269,13 +284,15 @@ Command.prototype.execute = function() {
serveType = this.params[3] || "text/html",
username = this.params[4],
password = this.params[5],
host = this.params[6] || "127.0.0.1";
host = this.params[6] || "127.0.0.1",
pathprefix = this.params[7];
this.server.set({
rootTiddler: rootTiddler,
renderType: renderType,
serveType: serveType,
username: username,
password: password
password: password,
pathprefix: pathprefix
});
this.server.listen(port,host);
console.log("Serving on " + host + ":" + port);

View File

@@ -0,0 +1,58 @@
/*\
title: $:/core/modules/commands/setfield.js
type: application/javascript
module-type: command
Command to modify selected tiddlers to set a field to the text of a template tiddler that has been wikified with the selected tiddler as the current tiddler.
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var widget = require("$:/core/modules/widgets/widget.js");
exports.info = {
name: "setfield",
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 < 4) {
return "Missing parameters";
}
var self = this,
wiki = this.commander.wiki,
filter = this.params[0],
fieldname = this.params[1] || "text",
templatetitle = this.params[2],
rendertype = this.params[3] || "text/plain",
tiddlers = wiki.filterTiddlers(filter);
$tw.utils.each(tiddlers,function(title) {
var parser = wiki.parseTiddler(templatetitle),
newFields = {},
tiddler = wiki.getTiddler(title);
if(parser) {
var widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}});
var container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null);
newFields[fieldname] = rendertype === "text/html" ? container.innerHTML : container.textContent;
} else {
newFields[fieldname] = undefined;
}
wiki.addTiddler(new $tw.Tiddler(tiddler,newFields));
});
return null;
};
exports.Command = Command;
})();

View File

@@ -57,7 +57,7 @@ var parseTiddlerDiv = function(text /* [,fields] */) {
attrMatch = attrRegExp.exec(match[1]);
if(attrMatch) {
var name = attrMatch[1];
var value = attrMatch[2] || attrMatch[3];
var value = attrMatch[2] !== undefined ? attrMatch[2] : attrMatch[3];
result[name] = value;
}
} while(attrMatch);

View File

@@ -16,9 +16,10 @@ Filter operator returning all tiddlers that have the selected tiddlers in a list
Export our filter function
*/
exports.listed = function(source,operator,options) {
var results = [];
var field = operator.operand || "list",
results = [];
source(function(tiddler,title) {
$tw.utils.pushTop(results,options.wiki.findListingsOfTiddler(title));
$tw.utils.pushTop(results,options.wiki.findListingsOfTiddler(title,field));
});
return results;
};

View File

@@ -13,9 +13,18 @@ The HTML parser displays text as raw HTML
"use strict";
var HtmlParser = function(type,text,options) {
var src;
if(options._canonical_uri) {
src = options._canonical_uri;
} else if(text) {
src = "data:text/html," + encodeURIComponent(text);
}
this.tree = [{
type: "raw",
html: text
type: "element",
tag: "iframe",
attributes: {
src: {type: "string", value: src}
}
}];
};

View File

@@ -19,7 +19,12 @@ var ImageParser = function(type,text,options) {
attributes: {}
},
src;
if(text) {
if(options._canonical_uri) {
element.attributes.src = {type: "string", value: options._canonical_uri};
if(type === "application/pdf" || type === ".pdf") {
element.tag = "embed";
}
} else if(text) {
if(type === "application/pdf" || type === ".pdf") {
element.attributes.src = {type: "string", value: "data:application/pdf;base64," + text};
element.tag = "embed";

View File

@@ -99,11 +99,13 @@ exports.parseStringLiteral = function(source,pos) {
type: "string",
start: pos
};
var reString = /(?:"([^"]*)")|(?:'([^']*)')/g;
var reString = /(?:"""([\s\S]*?)"""|"([^"]*)")|(?:'([^']*)')/g;
reString.lastIndex = pos;
var match = reString.exec(source);
if(match && match.index === pos) {
node.value = match[1] === undefined ? match[2] : match[1];
node.value = match[1] !== undefined ? match[1] :(
match[2] !== undefined ? match[2] : match[3]
);
node.end = pos + match[0].length;
return node;
} else {
@@ -120,7 +122,7 @@ exports.parseMacroParameter = function(source,pos) {
start: pos
};
// Define our regexp
var reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^\s>"'=]+)))/g;
var reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^\s>"'=]+)))/g;
// Skip whitespace
pos = $tw.utils.skipWhiteSpace(source,pos);
// Look for the parameter
@@ -134,7 +136,9 @@ exports.parseMacroParameter = function(source,pos) {
token.match[3] !== undefined ? token.match[3] : (
token.match[4] !== undefined ? token.match[4] : (
token.match[5] !== undefined ? token.match[5] : (
""
token.match[6] !== undefined ? token.match[6] : (
""
)
)
)
)

View File

@@ -35,12 +35,12 @@ exports.parse = function() {
// Move past the macro call
this.parser.pos = this.matchRegExp.lastIndex;
var params = [],
reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg,
reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg,
paramMatch = reParam.exec(paramString);
while(paramMatch) {
// Process this parameter
var paramInfo = {
value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]
value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] || paramMatch[6]
};
if(paramMatch[1]) {
paramInfo.name = paramMatch[1];

View File

@@ -35,12 +35,12 @@ exports.parse = function() {
// Move past the macro call
this.parser.pos = this.matchRegExp.lastIndex;
var params = [],
reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg,
reParam = /\s*(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))/mg,
paramMatch = reParam.exec(paramString);
while(paramMatch) {
// Process this parameter
var paramInfo = {
value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]
value: paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5]|| paramMatch[6]
};
if(paramMatch[1]) {
paramInfo.name = paramMatch[1];

View File

@@ -40,12 +40,12 @@ exports.parse = function() {
var paramString = this.match[2],
params = [];
if(paramString !== "") {
var reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))?/mg,
var reParam = /\s*([A-Za-z0-9\-_]+)(?:\s*:\s*(?:"""([\s\S]*?)"""|"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^"'\s]+)))?/mg,
paramMatch = reParam.exec(paramString);
while(paramMatch) {
// Save the parameter details
var paramInfo = {name: paramMatch[1]},
defaultValue = paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5];
defaultValue = paramMatch[2] || paramMatch[3] || paramMatch[4] || paramMatch[5] || paramMatch[6];
if(defaultValue) {
paramInfo["default"] = defaultValue;
}

View File

@@ -72,7 +72,9 @@ exports.parseLink = function(source,pos) {
type: "element",
tag: "a",
start: pos,
attributes: {},
attributes: {
"class": {type: "string", value: "tw-tiddlylink-external"},
},
children: [textNode]
};
// Skip whitespace

View File

@@ -21,7 +21,7 @@ exports.synchronous = true;
// Default story and history lists
var PAGE_TITLE_TITLE = "$:/core/wiki/title"
var PAGE_STYLESHEET_TITLE = "$:/core/ui/PageStylesheet";
var PAGE_TEMPLATE_TITLE = "$:/core/ui/PageMacros";
var PAGE_TEMPLATE_TITLE = "$:/core/ui/PageTemplate";
// Time (in ms) that we defer refreshing changes to draft tiddlers
var DRAFT_TIDDLER_TIMEOUT = 400;
@@ -49,7 +49,7 @@ exports.startup = function() {
$tw.styleElement.innerHTML = $tw.styleContainer.textContent;
}
}));
// Display the $:/core/ui/PageMacros tiddler to kick off the display
// Display the $:/core/ui/PageTemplate tiddler to kick off the display
$tw.perf.report("mainRender",function() {
$tw.pageWidgetNode = $tw.wiki.makeTranscludeWidget(PAGE_TEMPLATE_TITLE,{document: document, parentWidget: $tw.rootWidget});
$tw.pageContainer = document.createElement("div");

View File

@@ -61,9 +61,9 @@ defaultToCurrentStory: If true, the current story is retained as the default, in
*/
function openStartupTiddlers(options) {
options = options || {};
// Decode the hash portion of our URL
var target,
storyFilter;
// Work out the target tiddler and the story filter. "null" means "unspecified"
var target = null,
storyFilter = null;
if($tw.locationHash.length > 1) {
var hash = $tw.locationHash.substr(1),
split = hash.indexOf(":");
@@ -74,23 +74,20 @@ function openStartupTiddlers(options) {
storyFilter = decodeURIComponent(hash.substr(split + 1).trim());
}
}
// If a target tiddler was specified add it to the history stack
if(target && target !== "") {
// The target tiddler doesn't need double square brackets, but we'll silently remove them if they're present
if(target.indexOf("[[") === 0 && target.substr(-2) === "]]") {
target = target.substr(2,target.length - 4);
}
$tw.wiki.addToHistory(target);
}
// Use the story filter specified in the hash, or the default tiddlers
if(!storyFilter || storyFilter === "") {
// If the story wasn't specified use the current tiddlers or a blank story
if(storyFilter === null) {
if(options.defaultToCurrentStory) {
var currStoryList = $tw.wiki.getTiddlerList(DEFAULT_STORY_TITLE);
storyFilter = $tw.utils.stringifyList(currStoryList);
} else {
storyFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE);
if(target && target !== "") {
storyFilter = "";
} else {
storyFilter = $tw.wiki.getTiddlerText(DEFAULT_TIDDLERS_TITLE);
}
}
}
// Process the story filter to get the story list
var storyList = $tw.wiki.filterTiddlers(storyFilter);
// If the target tiddler isn't included then splice it in at the top
if(target && storyList.indexOf(target) === -1) {
@@ -98,6 +95,16 @@ function openStartupTiddlers(options) {
}
// Save the story list
$tw.wiki.addTiddler({title: DEFAULT_STORY_TITLE, text: "", list: storyList},$tw.wiki.getModificationFields());
// If a target tiddler was specified add it to the history stack
if(target && target !== "") {
// The target tiddler doesn't need double square brackets, but we'll silently remove them if they're present
if(target.indexOf("[[") === 0 && target.substr(-2) === "]]") {
target = target.substr(2,target.length - 4);
}
$tw.wiki.addToHistory(target);
} else if(storyList.length > 0) {
$tw.wiki.addToHistory(storyList[0]);
}
}
function updateLocationHash() {

View File

@@ -18,7 +18,7 @@ exports.hasTag = function(tag) {
exports.isPlugin = function() {
return this.fields.type === "application/json" && this.hasField("plugin-type");
}
};
exports.isDraft = function() {
return this.hasField("draft.of");
@@ -57,4 +57,52 @@ exports.getFieldStringBlock = function(options) {
return fields.join("\n");
};
/*
Compare two tiddlers for equality
tiddler: the tiddler to compare
excludeFields: array of field names to exclude from the comparison
*/
exports.isEqual = function(tiddler,excludeFields) {
excludeFields = excludeFields || [];
var self = this,
differences = []; // Fields that have differences
// Add to the differences array
function addDifference(fieldName) {
// Check for this field being excluded
if(excludeFields.indexOf(fieldName) === -1) {
// Save the field as a difference
$tw.utils.pushTop(differences,fieldName);
}
}
// Returns true if the two values of this field are equal
function isFieldValueEqual(fieldName) {
var valueA = self.fields[fieldName],
valueB = tiddler.fields[fieldName];
// Check for identical string values
if(typeof(valueA) === "string" && typeof(valueB) === "string" && valueA === valueB) {
return true;
}
// Check for identical array values
if($tw.utils.isArray(valueA) && $tw.utils.isArray(valueB) && $tw.utils.isArrayEqual(valueA,valueB)) {
return true;
}
// Otherwise the fields must be different
return false;
}
// Compare our fields
for(var fieldName in this.fields) {
if(!isFieldValueEqual(fieldName)) {
addDifference(fieldName);
}
}
// There's a difference for every field in the other tiddler that we don't have
for(fieldName in tiddler.fields) {
if(!(fieldName in this.fields)) {
addDifference(fieldName);
}
}
// Return whether there were any differences
return differences.length === 0;
};
})();

View File

@@ -46,10 +46,16 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
}
}
domNode.className = classes.join(" ");
// Assign classes
// Assign other attributes
if(this.style) {
domNode.setAttribute("style",this.style);
}
if(this.title) {
domNode.setAttribute("title",this.title);
}
if(this["aria-label"]) {
domNode.setAttribute("aria-label",this["aria-label"]);
}
// Add a click event handler
domNode.addEventListener("click",function (event) {
var handled = false;
@@ -134,6 +140,8 @@ ButtonWidget.prototype.execute = function() {
this.popup = this.getAttribute("popup");
this.hover = this.getAttribute("hover");
this["class"] = this.getAttribute("class","");
this["aria-label"] = this.getAttribute("aria-label");
this.title = this.getAttribute("title");
this.style = this.getAttribute("style");
this.selectedClass = this.getAttribute("selectedClass");
this.defaultSetValue = this.getAttribute("default");

View File

@@ -192,10 +192,12 @@ DropZoneWidget.prototype.handlePasteEvent = function(event) {
});
} else if(item.kind === "string") {
// Create tiddlers from string items
var type = item.type;
item.getAsString(function(str) {
var tiddlerFields = {
title: self.wiki.generateNewTitle("Untitled"),
text: str
text: str,
type: type
};
self.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify([tiddlerFields])});
});

View File

@@ -56,20 +56,37 @@ ImageWidget.prototype.render = function(parent,nextSibling) {
} else {
// Check if it is an image tiddler
if(this.wiki.isImageTiddler(this.imageSource)) {
// Render the appropriate element for the image type
var type = tiddler.fields.type,
text = tiddler.fields.text;
switch(type) {
case "application/pdf":
tag = "embed";
src = "data:application/pdf;base64," + text;
break;
case "image/svg+xml":
src = "data:image/svg+xml," + encodeURIComponent(text);
break;
default:
src = "data:" + type + ";base64," + text;
break;
text = tiddler.fields.text,
_canonical_uri = tiddler.fields._canonical_uri;
// If the tiddler has body text then it doesn't need to be lazily loaded
if(text) {
// Render the appropriate element for the image type
switch(type) {
case "application/pdf":
tag = "embed";
src = "data:application/pdf;base64," + text;
break;
case "image/svg+xml":
src = "data:image/svg+xml," + encodeURIComponent(text);
break;
default:
src = "data:" + type + ";base64," + text;
break;
}
} else if(_canonical_uri) {
switch(type) {
case "application/pdf":
tag = "embed";
src = _canonical_uri;
break;
case "image/svg+xml":
src = _canonical_uri;
break;
default:
src = _canonical_uri;
break;
}
}
}
}

View File

@@ -0,0 +1,114 @@
/*\
title: $:/core/modules/widgets/importvariables.js
type: application/javascript
module-type: widget
Import variable definitions from other tiddlers
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var ImportVariablesWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
ImportVariablesWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
ImportVariablesWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
this.renderChildren(parent,nextSibling);
};
/*
Compute the internal state of the widget
*/
ImportVariablesWidget.prototype.execute = function(tiddlerList) {
var self = this;
// Get our parameters
this.filter = this.getAttribute("filter");
// Compute the filter
this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this);
// Accumulate the <$set> widgets from each tiddler
var widgetStackStart,widgetStackEnd;
function addWidgetNode(widgetNode) {
if(widgetNode) {
if(!widgetStackStart && !widgetStackEnd) {
widgetStackStart = widgetNode;
widgetStackEnd = widgetNode;
} else {
widgetStackEnd.children = [widgetNode];
widgetStackEnd = widgetNode;
}
}
}
$tw.utils.each(this.tiddlerList,function(title) {
var parser = self.wiki.parseTiddler(title);
if(parser) {
var parseTreeNode = parser.tree[0];
while(parseTreeNode && parseTreeNode.type === "set") {
addWidgetNode({
type: "set",
attributes: parseTreeNode.attributes,
params: parseTreeNode.params
});
parseTreeNode = parseTreeNode.children[0];
}
}
});
// Add our own children to the end of the pile
var parseTreeNodes;
if(widgetStackStart && widgetStackEnd) {
parseTreeNodes = [widgetStackStart];
widgetStackEnd.children = this.parseTreeNode.children;
} else {
parseTreeNodes = this.parseTreeNode.children;
}
// 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
*/
ImportVariablesWidget.prototype.refresh = function(changedTiddlers) {
// Recompute our attributes and the filter list
var changedAttributes = this.computeAttributes(),
tiddlerList = this.wiki.filterTiddlers(this.getAttribute("filter"),this);
// Refresh if the filter has changed, or the list of tiddlers has changed, or any of the tiddlers in the list has changed
function haveListedTiddlersChanged() {
var changed = false;
tiddlerList.forEach(function(title) {
if(changedTiddlers[title]) {
changed = true;
}
});
return changed;
}
if(changedAttributes.filter || !$tw.utils.isArrayEqual(this.tiddlerList,tiddlerList) || haveListedTiddlersChanged()) {
// Compute the filter
this.removeChildDomNodes();
this.execute(tiddlerList);
this.renderChildren(this.parentDomNode,this.findNextSiblingDomNode());
return true;
} else {
return this.refreshChildren(changedTiddlers);
}
};
exports.importvariables = ImportVariablesWidget;
})();

View File

@@ -87,6 +87,9 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) {
});
domNode.setAttribute("title",tooltipText);
}
if(this["aria-label"]) {
domNode.setAttribute("aria-label",this["aria-label"]);
}
// Add a click event handler
$tw.utils.addEventListeners(domNode,[
{name: "click", handlerObject: this, handlerMethod: "handleClickEvent"},
@@ -176,8 +179,9 @@ Compute the internal state of the widget
LinkWidget.prototype.execute = function() {
// Get the target tiddler title
this.to = this.getAttribute("to",this.getVariable("currentTiddler"));
// Get the link title
// Get the link title and aria label
this.tooltip = this.getAttribute("tooltip");
this["aria-label"] = this.getAttribute("aria-label");
// Determine the link characteristics
this.isMissing = !this.wiki.tiddlerExists(this.to);
this.isShadow = this.wiki.isShadowTiddler(this.to);
@@ -190,7 +194,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
LinkWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.to || changedTiddlers[this.to] || changedAttributes.tooltip) {
if(changedAttributes.to || changedTiddlers[this.to] || changedAttributes["aria-label"] || changedAttributes.tooltip) {
this.refreshSelf();
return true;
}

View File

@@ -307,7 +307,8 @@ NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {
{title: draftTitle}
}
));
} else if(!this.wiki.isDraftModified(title)) {
}
if(!isRename && !this.wiki.isDraftModified(title)) {
event.type = "tw-cancel-tiddler";
this.dispatchEvent(event);
} else if(isConfirmed) {

View File

@@ -95,7 +95,7 @@ Compute the internal state of the widget
RadioWidget.prototype.execute = function() {
// Get the parameters from the attributes
this.radioTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
this.radioField = this.getAttribute("field");
this.radioField = this.getAttribute("field","text");
this.radioValue = this.getAttribute("value");
this.radioClass = this.getAttribute("class","");
if(this.radioClass !== "") {

View File

@@ -0,0 +1,139 @@
/*\
title: $:/core/modules/widgets/select.js
type: application/javascript
module-type: widget
Select widget:
```
<$select tiddler="MyTiddler" field="text">
<$list filter="[tag[chapter]]">
<option value=<<currentTiddler>>>
<$view field="description"/>
</option>
</$list>
</$select>
```
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var SelectWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
SelectWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
SelectWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.computeAttributes();
this.execute();
this.renderChildren(parent,nextSibling);
this.setSelectValue();
$tw.utils.addEventListeners(this.getSelectDomNode(),[
{name: "change", handlerObject: this, handlerMethod: "handleChangeEvent"}
]);
};
/*
Handle a change event
*/
SelectWidget.prototype.handleChangeEvent = function(event) {
var value = this.getSelectDomNode().value;
this.wiki.setText(this.selectTitle,this.selectField,this.selectIndex,value);
};
/*
If necessary, set the value of the select element to the current value
*/
SelectWidget.prototype.setSelectValue = function() {
var value = this.selectDefault;
// Get the value
if(this.selectIndex) {
value = this.wiki.extractTiddlerDataItem(this.selectTitle,this.selectIndex);
} else {
var tiddler = this.wiki.getTiddler(this.selectTitle);
if(tiddler) {
if(this.selectField === "text") {
// Calling getTiddlerText() triggers lazy loading of skinny tiddlers
value = this.wiki.getTiddlerText(this.selectTitle);
} else {
if($tw.utils.hop(tiddler.fields,this.selectField)) {
value = tiddler.getFieldString(this.selectField);
}
}
} else {
if(this.selectField === "title") {
value = this.selectTitle;
}
}
}
// Assign it to the select element if it's different than the current value
var domNode = this.getSelectDomNode();
if(domNode.value !== value) {
domNode.value = value;
}
};
/*
Get the DOM node of the select element
*/
SelectWidget.prototype.getSelectDomNode = function() {
return this.children[0].domNodes[0];
};
/*
Compute the internal state of the widget
*/
SelectWidget.prototype.execute = function() {
// Get our parameters
this.selectTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
this.selectField = this.getAttribute("field","text");
this.selectIndex = this.getAttribute("index");
this.selectClass = this.getAttribute("class");
this.selectDefault = this.getAttribute("default");
// Make the child widgets
var selectNode = {
type: "element",
tag: "select",
children: this.parseTreeNode.children
};
if(this.selectClass) {
$tw.utils.addAttributeToParseTreeNode(selectNode,"class",this.selectClass);
}
this.makeChildWidgets([selectNode]);
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
SelectWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
// If we're using a different tiddler/field/index then completely refresh ourselves
if(changedAttributes.selectTitle || changedAttributes.selectField || changedAttributes.selectIndex) {
this.refreshSelf();
return true;
// If the target tiddler value has changed, just update setting and refresh the children
} else {
if(changedTiddlers[this.selectTitle]) {
this.setSelectValue();
}
return this.refreshChildren(changedTiddlers);
}
};
exports.select = SelectWidget;
})();

View File

@@ -47,7 +47,13 @@ TextNodeWidget.prototype.execute = function() {
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
TextNodeWidget.prototype.refresh = function(changedTiddlers) {
return false;
var changedAttributes = this.computeAttributes();
if(changedAttributes.text) {
this.refreshSelf();
return true;
} else {
return false;
}
};
exports.text = TextNodeWidget;

View File

@@ -43,7 +43,7 @@ TranscludeWidget.prototype.execute = function() {
this.transcludeIndex = this.getAttribute("index");
this.transcludeMode = this.getAttribute("mode");
// Check for recursion
var recursionMarker = this.makeRecursionMarker();;
var recursionMarker = this.makeRecursionMarker();
if(this.parentWidget && this.parentWidget.hasVariable("transclusion",recursionMarker)) {
this.makeChildWidgets([{type: "text", text: "Recursive transclusion error in transclude widget"}]);
return;

View File

@@ -55,15 +55,19 @@ exports.getTextReference = function(textRef,defaultText,currTiddlerTitle) {
exports.setTextReference = function(textRef,value,currTiddlerTitle) {
var tr = $tw.utils.parseTextReference(textRef),
title = tr.title || currTiddlerTitle;
this.setText(title,tr.field,tr.index,value);
};
exports.setText = function(title,field,index,value) {
// Check if it is a reference to a tiddler field
if(tr.index) {
if(index) {
var data = this.getTiddlerData(title,Object.create(null));
data[tr.index] = value;
data[index] = value;
this.setTiddlerData(title,data,this.getModificationFields());
} else {
var tiddler = this.getTiddler(title),
fields = {title: title};
fields[tr.field || "text"] = value;
fields[field || "text"] = value;
this.addTiddler(new $tw.Tiddler(tiddler,fields,this.getModificationFields()));
}
};
@@ -476,13 +480,14 @@ exports.getTagMap = function() {
};
/*
Lookup a given tiddler and return a list of all the tiddlers that include it in their list
Lookup a given tiddler and return a list of all the tiddlers that include it in the specified list field
*/
exports.findListingsOfTiddler = function(targetTitle) {
// Get the list associated with the tag
exports.findListingsOfTiddler = function(targetTitle,fieldName) {
fieldName = fieldName || "list";
var titles = [];
this.each(function(tiddler,title) {
if($tw.utils.isArray(tiddler.fields.list) && tiddler.fields.list.indexOf(targetTitle) !== -1) {
var list = $tw.utils.parseStringArray(tiddler.fields[fieldName]);
if(list && list.indexOf(targetTitle) !== -1) {
titles.push(title);
}
});
@@ -707,6 +712,7 @@ Parse a block of text of a specified MIME type
options: see below
Options include:
parseAsInline: if true, the text of the tiddler will be parsed as an inline run
_canonical_uri: optional string of the canonical URI of this content
*/
exports.old_parseText = function(type,text,options) {
options = options || {};
@@ -724,7 +730,8 @@ exports.old_parseText = function(type,text,options) {
// Return the parser instance
return new Parser(type,text,{
parseAsInline: options.parseAsInline,
wiki: this
wiki: this,
_canonical_uri: options._canonical_uri
});
};
@@ -732,11 +739,14 @@ exports.old_parseText = function(type,text,options) {
Parse a tiddler according to its MIME type
*/
exports.old_parseTiddler = function(title,options) {
options = options || {};
options = $tw.utils.extend({},options);
var cacheType = options.parseAsInline ? "newInlineParseTree" : "newBlockParseTree",
tiddler = this.getTiddler(title),
self = this;
return tiddler ? this.getCacheForTiddler(title,cacheType,function() {
if(tiddler.hasField("_canonical_uri")) {
options._canonical_uri = tiddler.fields._canonical_uri;
}
return self.old_parseText(tiddler.fields.type,tiddler.fields.text,options);
}) : null;
};
@@ -1075,27 +1085,16 @@ exports.readFile = function(file,callback) {
Check whether the specified draft tiddler has been modified
*/
exports.isDraftModified = function(title) {
var tiddler = this.getTiddler(title);
var tiddler = this.getTiddler(title);
if(!tiddler.isDraft()) {
return false;
}
var ignoredFields = ["created", "modified", "title", "draft.title", "draft.of", "tags"],
var ignoredFields = ["created", "modified", "title", "draft.title", "draft.of"],
origTiddler = this.getTiddler(tiddler.fields["draft.of"]);
if(!origTiddler) {
return true;
}
if(tiddler.fields["draft.title"] !== tiddler.fields["draft.of"]) {
return true;
}
if(!$tw.utils.isArrayEqual(tiddler.fields.tags,origTiddler.fields.tags)) {
return true;
}
return !Object.keys(tiddler.fields).every(function(field) {
if(ignoredFields.indexOf(field) >= 0) {
return true;
}
return tiddler.fields[field] === origTiddler.fields[field];
});
return !tiddler.isEqual(origTiddler,ignoredFields);
};
/*

View File

@@ -0,0 +1,104 @@
title: $:/palettes/Muted
name: Muted
description: Bright tiddlers on a muted background
tags: $:/tags/Palette
type: application/x-tiddler-dictionary
alert-background: #ffe476
alert-border: #b99e2f
alert-highlight: #881122
alert-muted-foreground: #b99e2f
background: #ffffff
blockquote-bar: <<colour muted-foreground>>
code-background: #f7f7f9
code-border: #e1e1e8
code-foreground: #dd1144
download-background: #34c734
download-foreground: <<colour background>>
dragger-background: <<colour foreground>>
dragger-foreground: <<colour background>>
dropdown-background: <<colour background>>
dropdown-border: <<colour muted-foreground>>
dropdown-tab-background-selected: #fff
dropdown-tab-background: #ececec
dropzone-background: rgba(0,200,0,0.7)
external-link-background-hover:
external-link-background-visited:
external-link-background:
external-link-foreground-hover:
external-link-foreground-visited: #0000aa
external-link-foreground: #0000ee
foreground: #333333
message-background: #ecf2ff
message-border: #cfd6e6
message-foreground: #547599
modal-backdrop: <<colour foreground>>
modal-background: <<colour background>>
modal-border: #999999
modal-footer-background: #f5f5f5
modal-footer-border: #dddddd
modal-header-border: #eeeeee
muted-foreground: #bbb
notification-background: #ffffdd
notification-border: #999999
page-background: #6f6f70
pre-background: #f5f5f5
pre-border: #cccccc
primary: #29a6ee
sidebar-button-foreground: <<colour foreground>>
sidebar-controls-foreground-hover: #000000
sidebar-controls-foreground: #c2c1c2
sidebar-foreground-shadow: rgba(255,255,255,0)
sidebar-foreground: #d3d2d4
sidebar-muted-foreground-hover: #444444
sidebar-muted-foreground: #c0c0c0
sidebar-tab-background-selected: #6f6f70
sidebar-tab-background: #666667
sidebar-tab-border-selected: #999
sidebar-tab-border: #515151
sidebar-tab-divider: #999
sidebar-tab-foreground-selected:
sidebar-tab-foreground: #999
sidebar-tiddler-link-foreground-hover: #444444
sidebar-tiddler-link-foreground: #d1d0d2
static-alert-foreground: #aaaaaa
tab-background-selected: #ffffff
tab-background: #d8d8d8
tab-border-selected: #d8d8d8
tab-border: #cccccc
tab-divider: #d8d8d8
tab-foreground-selected: <<colour tab-foreground>>
tab-foreground: #666666
table-border: #dddddd
table-footer-background: #a8a8a8
table-header-background: #f0f0f0
tag-background: #d5ad34
tag-foreground: #ffffff
tiddler-background: <<colour background>>
tiddler-border: <<colour background>>
tiddler-controls-foreground-hover: #888888
tiddler-controls-foreground-selected: #444444
tiddler-controls-foreground: #cccccc
tiddler-editor-background: #f8f8f8
tiddler-editor-border-image: #ffffff
tiddler-editor-border: #cccccc
tiddler-editor-fields-even: #e0e8e0
tiddler-editor-fields-odd: #f0f4f0
tiddler-info-background: #f8f8f8
tiddler-info-border: #dddddd
tiddler-info-tab-background: #f8f8f8
tiddler-link-background: <<colour background>>
tiddler-link-foreground: <<colour primary>>
tiddler-subtitle-foreground: #c0c0c0
tiddler-title-foreground: #182955
toolbar-new-button:
toolbar-options-button:
toolbar-save-button:
toolbar-info-button:
toolbar-edit-button:
toolbar-close-button:
toolbar-delete-button:
toolbar-cancel-button:
toolbar-done-button:
untagged-background: #999999
very-muted-foreground: #888888

View File

@@ -0,0 +1,10 @@
title: $:/core/templates/canonical-uri-external-image
<!--
This template is used to assign the ''_canonical_uri'' field to external images.
Change the `./images/` part to a different base URI. The URI can be relative or absolute.
-->
./images/<$view field="title" format="doubleurlencoded"/>

View File

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

View File

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

View File

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

View File

@@ -21,6 +21,6 @@ type: text/vnd.tiddlywiki-html
</head>
<body class="tw-body">
{{$:/StaticBanner||$:/core/templates/html-tiddler}}
{{$:/core/ui/PageMacros||$:/core/templates/html-tiddler}}
{{$:/core/ui/PageTemplate||$:/core/templates/html-tiddler}}
</body>
</html>

View File

@@ -15,7 +15,9 @@ title: $:/core/templates/static.tiddler.html
<body class="tw-body">
`{{$:/StaticBanner||$:/core/templates/html-tiddler}}`
<section class="story-river">
`<$view tiddler="$:/core/ui/ViewTemplate" format="htmlwikified"/>`
`<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
<$view tiddler="$:/core/ui/ViewTemplate" format="htmlwikified"/>
</$importvariables>`
</section>
</body>
</html>

View File

@@ -19,7 +19,7 @@ title: $:/core/templates/tiddlywiki5.html
<!--~~ This is a Tiddlywiki file. The points of interest in the file are marked with this pattern ~~-->
<!--~~ Raw markup ~~-->
{{{ [tag[$:/core/wiki/rawmarkup]] ||$:/core/templates/plain-text-tiddler}}}
{{{ [all[shadows+tiddlers]tag[$:/core/wiki/rawmarkup]] [all[shadows+tiddlers]tag[$:/tags/RawMarkup]] ||$:/core/templates/plain-text-tiddler}}}
</head>
<body class="tw-body">
<!--~~ Static styles ~~-->

View File

@@ -0,0 +1,30 @@
title: $:/core/ui/ControlPanel/Advanced/EditorTypes
tags: $:/tags/ControlPanel/Advanced
caption: {{$:/language/ControlPanel/Advanced/EditorTypes/Caption}}
\define lingo-base() $:/language/ControlPanel/Advanced/EditorTypes/
<<lingo Hint>>
<table>
<tbody>
<tr>
<th><<lingo Type/Caption>></th>
<th><<lingo Editor/Caption>></th>
</tr>
<$list filter="[all[shadows+tiddlers]prefix[$:/config/EditorTypeMappings/]sort[title]]">
<tr>
<td>
<$link>
<$list filter="[all[current]removeprefix[$:/config/EditorTypeMappings/]]">
<$text text={{!!title}}/>
</$list>
</$link>
</td>
<td>
<$view field="text"/>
</td>
</tr>
</$list>
</tbody>
</table>

View File

@@ -3,28 +3,11 @@ tags: $:/tags/ControlPanel/Advanced/Settings
caption: {{$:/language/ControlPanel/Advanced/Settings/NavigationAddressBar/Caption}}
\define lingo-base() $:/language/ControlPanel/Advanced/Settings/NavigationAddressBar/
<<lingo Hint>>
<$button popup=<<qualify "$:/state/navaddressbarpopup">> class="btn-invisible btn-dropdown">
<$view tiddler="$:/config/Navigation/UpdateAddressBar" field="text"/>:
<$reveal state="$:/config/Navigation/UpdateAddressBar" type="match" text="no">
''<<lingo No/Description>>''
</$reveal>
<$reveal state="$:/config/Navigation/UpdateAddressBar" type="match" text="permalink">
''<<lingo Permalink/Description>>''
</$reveal>
<$reveal state="$:/config/Navigation/UpdateAddressBar" type="match" text="permaview">
''<<lingo Permaview/Description>>''
</$reveal>
{{$:/core/images/down-arrow}}
</$button>
<$reveal state=<<qualify "$:/state/navaddressbarpopup">> type="popup" position="below" animate="yes" default="">
<$linkcatcher to="$:/config/Navigation/UpdateAddressBar">
<div class="tw-drop-down tw-edit-type-dropdown">
<$list filter="no permalink permaview">
<$link to={{!!title}}>
<$view field="title"/>
</$link>
</$list>
</div>
</$linkcatcher>
</$reveal>
<$link to="$:/config/Navigation/UpdateAddressBar"><<lingo Hint>></$link>
<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="permaview"> <<lingo Permaview/Description>> </$radio>
<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="permalink"> <<lingo Permalink/Description>> </$radio>
<$radio tiddler="$:/config/Navigation/UpdateAddressBar" value="no"> <<lingo No/Description>> </$radio>

View File

@@ -3,25 +3,8 @@ tags: $:/tags/ControlPanel/Advanced/Settings
caption: {{$:/language/ControlPanel/Advanced/Settings/NavigationHistory/Caption}}
\define lingo-base() $:/language/ControlPanel/Advanced/Settings/NavigationHistory/
<<lingo Hint>>
<$button popup=<<qualify "$:/state/navhistorypopup">> class="btn-invisible btn-dropdown">
<$view tiddler="$:/config/Navigation/UpdateHistory" field="text"/>:
<$reveal state="$:/config/Navigation/UpdateHistory" type="match" text="no">
''<<lingo No/Description>>''
</$reveal>
<$reveal state="$:/config/Navigation/UpdateHistory" type="match" text="yes">
''<<lingo Yes/Description>>''
</$reveal>
{{$:/core/images/down-arrow}}
</$button>
<$reveal state=<<qualify "$:/state/navhistorypopup">> type="popup" position="below" animate="yes" default="">
<$linkcatcher to="$:/config/Navigation/UpdateHistory">
<div class="tw-drop-down tw-edit-type-dropdown">
<$list filter="no yes">
<$link to={{!!title}}>
<$view field="title"/>
</$link>
</$list>
</div>
</$linkcatcher>
</$reveal>
<$link to="$:/config/Navigation/UpdateHistory"><<lingo Hint>></$link>
<$radio tiddler="$:/config/Navigation/UpdateHistory" value="yes"> <<lingo Yes/Description>> </$radio>
<$radio tiddler="$:/config/Navigation/UpdateHistory" value="no"> <<lingo No/Description>> </$radio>

View File

@@ -5,10 +5,12 @@ tw-tiddler-frame tw-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerCl
\end
<div class=<<frame-classes>>>
<$set name="storyTiddler" value=<<currentTiddler>>>
<$keyboard key="escape" message="tw-cancel-tiddler">
<$keyboard key="ctrl+enter" message="tw-save-tiddler">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem">
<$transclude tiddler=<<listItem>>/>
</$list>
</$keyboard>
</$keyboard>
</$set>
</div>

View File

@@ -1,10 +1,26 @@
title: $:/core/ui/EditTemplate/body
tags: $:/tags/EditTemplate
\define lingo-base() $:/language/EditTemplate/
\define lingo-base() $:/language/EditTemplate/Body/
<$list filter="[is[current]has[_canonical_uri]]">
<div class="tw-message-box">
<<lingo External/Hint>>
<a href={{!!_canonical_uri}}><$text text={{!!_canonical_uri}}/></a>
<$edit-text field="_canonical_uri" class="tw-edit-fields"></$edit-text>
</div>
</$list>
<$list filter="[is[current]!has[_canonical_uri]]">
<$reveal state="$:/state/showeditpreview" type="match" text="yes">
<em class="tw-edit"><<lingo Body/Hint>></em> <$button type="set" set="$:/state/showeditpreview" setTo="no"><<lingo Body/Preview/Button/Hide>></$button>
<em class="tw-edit"><<lingo Hint>></em> <$button type="set" set="$:/state/showeditpreview" setTo="no"><<lingo Preview/Button/Hide>></$button>
<div class="tw-tiddler-preview">
<div class="tw-tiddler-preview-preview">
@@ -24,7 +40,9 @@ tags: $:/tags/EditTemplate
<$reveal state="$:/state/showeditpreview" type="nomatch" text="yes">
<em class="tw-edit"><<lingo Body/Hint>></em> <$button type="set" set="$:/state/showeditpreview" setTo="yes"><<lingo Body/Preview/Button/Show>></$button>
<em class="tw-edit"><<lingo Hint>></em> <$button type="set" set="$:/state/showeditpreview" setTo="yes"><<lingo Preview/Button/Show>></$button>
<$edit field="text" class="tw-edit-texteditor" placeholder={{$:/language/EditTemplate/Body/Placeholder}}/>
</$reveal>
</$list>

View File

@@ -15,8 +15,8 @@ background-color:$(backgroundColor)$;
<div class="tw-edit-add-tag">
<span class="tw-add-tag-name">
<$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<<qualify "$:/state/tagsAutoComplete">> class="tw-edit-texteditor"/>
</span> <$button popup=<<qualify "$:/state/tagsAutoComplete">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <span class="tw-add-tag-button">
<$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<<qualify "$:/state/popup/tags-auto-complete">> class="tw-edit-texteditor"/>
</span> <$button popup=<<qualify "$:/state/popup/tags-auto-complete">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <span class="tw-add-tag-button">
<$button message="tw-add-tag" param={{$:/temp/NewTagName}} set="$:/temp/NewTagName" setTo="" class="">
<<lingo Tags/Add/Button>>
</$button>
@@ -25,7 +25,7 @@ background-color:$(backgroundColor)$;
<div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/tagsAutoComplete">> type="nomatch" text="" default="">
<$reveal state=<<qualify "$:/state/popup/tags-auto-complete">> type="nomatch" text="" default="">
<div class="tw-block-dropdown">

View File

@@ -2,13 +2,18 @@ title: $:/core/ui/EditTemplate/type
tags: $:/tags/EditTemplate
\define lingo-base() $:/language/EditTemplate/
<p><$fieldmangler><em class="tw-edit"><<lingo Type/Prompt>></em> <$edit-text field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/typeDropdown">> class="tw-edit-typeeditor"/> <$button popup=<<qualify "$:/state/typeDropdown">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <$button message="tw-remove-field" param="type" class="btn-invisible btn-icon">{{$:/core/images/delete-button}}</$button></$fieldmangler></p>
<p><$fieldmangler><em class="tw-edit"><<lingo Type/Prompt>></em> <$edit-text field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/popup/type-dropdown">> class="tw-edit-typeeditor"/> <$button popup=<<qualify "$:/state/popup/type-dropdown">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <$button message="tw-remove-field" param="type" class="btn-invisible btn-icon">{{$:/core/images/delete-button}}</$button></$fieldmangler></p>
<div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/typeDropdown">> type="nomatch" text="" default="">
<$reveal state=<<qualify "$:/state/popup/type-dropdown">> type="nomatch" text="" default="">
<div class="tw-block-dropdown tw-edit-type-dropdown">
<$linkcatcher to="!!type">
<$list filter="[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]] +[sort[description]]"><$link to={{!!name}}><$view field="description"/> (<$view field="name"/>)</$link>
<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group]]'>
<div class="tw-dropdown-item">
<$text text={{!!group}}/>
</div>
<$list filter="[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]]"><$link to={{!!name}}><$view field="description"/> (<$view field="name"/>)</$link>
</$list>
</$list>
</$linkcatcher>
</div>

View File

@@ -1,4 +1,4 @@
title: $:/core/ui/EditToolbar/cancel
tags: $:/tags/EditToolbar
<$button message="tw-cancel-tiddler" class="btn-invisible">{{$:/core/images/cancel-button}}</$button>
<$button message="tw-cancel-tiddler" title={{$:/language/Buttons/Cancel/Hint}} aria-label={{$:/language/Buttons/Cancel/Caption}} class="btn-invisible">{{$:/core/images/cancel-button}}</$button>

View File

@@ -1,4 +1,4 @@
title: $:/core/ui/EditToolbar/delete
tags: $:/tags/EditToolbar
<$button message="tw-delete-tiddler" class="btn-invisible">{{$:/core/images/delete-button}}</$button>
<$button message="tw-delete-tiddler" title={{$:/language/Buttons/Delete/Hint}} aria-label={{$:/language/Buttons/Delete/Caption}} class="btn-invisible">{{$:/core/images/delete-button}}</$button>

View File

@@ -1,4 +1,4 @@
title: $:/core/ui/EditToolbar/save
tags: $:/tags/EditToolbar
<$button message="tw-save-tiddler" class="btn-invisible">{{$:/core/images/done-button}}</$button>
<$button message="tw-save-tiddler" title={{$:/language/Buttons/Save/Hint}} aria-label={{$:/language/Buttons/Save/Caption}} class="btn-invisible">{{$:/core/images/done-button}}</$button>

View File

@@ -1,10 +1,10 @@
title: $:/core/ui/MissingTemplate
<div class="tw-tiddler-missing">
<$button popup=<<qualify "$:/state/missingpopup">> class="btn-invisible tw-missing-tiddler-label">
<$button popup=<<qualify "$:/state/popup/missing">> class="btn-invisible tw-missing-tiddler-label">
<$view field="title" format="text" />
</$button>
<$reveal state=<<qualify "$:/state/missingpopup">> type="popup" position="below" animate="yes">
<$reveal state=<<qualify "$:/state/popup/missing">> type="popup" position="below" animate="yes">
<div class="tw-drop-down">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<hr>

View File

@@ -1,4 +1,4 @@
title: $:/core/ui/PageControls/control-panel
tags: $:/tags/PageControls
<$button to="$:/ControlPanel" class="btn-invisible">{{$:/core/images/options-button}}</$button>
<$button to="$:/ControlPanel" title={{$:/language/Buttons/ControlPanel/Hint}} aria-label={{$:/language/Buttons/ControlPanel/Caption}} class="btn-invisible">{{$:/core/images/options-button}}</$button>

View File

@@ -1,4 +1,4 @@
title: $:/core/ui/PageControls/new-tiddler
tags: $:/tags/PageControls
<$button message="tw-new-tiddler" class="btn-invisible">{{$:/core/images/new-button}}</$button>
<$button message="tw-new-tiddler" title={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class="btn-invisible">{{$:/core/images/new-button}}</$button>

View File

@@ -1,4 +1,4 @@
title: $:/core/ui/PageControls/save-wiki
tags: $:/tags/PageControls
<$button message="tw-save-wiki" class="btn-invisible">{{$:/core/images/save-button}}</$button>
<$button message="tw-save-wiki" title={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class="btn-invisible">{{$:/core/images/save-button}}</$button>

View File

@@ -1,66 +0,0 @@
title: $:/core/ui/PageMacros
\define colour(name)
<$transclude tiddler={{$:/palette}} index="$name$"/>
\end
\define color(name)
<<colour $name$>>
\end
\define tabs(tabsList,default,state:"$:/state/tab",class)
<div class="tw-tab-set $class$">
<div class="tw-tab-buttons $class$">
<$list filter="$tabsList$" variable="currentTab">
<$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tw-tab-selected">
<$transclude tiddler=<<currentTab>> field="caption">
<$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/>
</$transclude>
</$button>
</$list>
</div><div class="tw-tab-divider $class$"/><div class="tw-tab-content $class$">
<$list filter="$tabsList$" variable="currentTab">
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
<$transclude tiddler=<<currentTab>> mode="block"/>
</$reveal>
</$list>
</div>
</div>
\end
\define wikitext-example(src)
```
$src$
```
Renders as:
$src$
In HTML:
$$$text/vnd.tiddlywiki>text/html
$src$
$$$
\end
\define wikitext-example-without-html(src)
```
$src$
```
Renders as:
$src$
\end
\define lingo-base()
$:/lingo/
\end
\define lingo(title)
{{$(lingo-base)$$title$}}
\end
{{$:/core/ui/PageTemplate}}

View File

@@ -4,12 +4,16 @@ title: $:/core/ui/PageTemplate
tw-page-container tw-page-view-$(themeTitle)$ tw-language-$(languageTitle)$
\end
<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
<$set name="themeTitle" value={{$:/view}}>
<$set name="currentTiddler" value={{$:/language}}>
<$set name="languageTitle" value={{!!name}}>
<$set name="currentTiddler" value="">
<div class=<<containerClasses>>>
<$navigator story="$:/StoryList" history="$:/HistoryList">
@@ -33,3 +37,7 @@ tw-page-container tw-page-view-$(themeTitle)$ tw-language-$(languageTitle)$
</$set>
</$set>
</$set>
</$importvariables>

View File

@@ -7,11 +7,11 @@ tags: $:/tags/PageTemplate
<$reveal state="$:/state/sidebar" type="match" text="yes" default="yes" retain="yes">
<div class="tw-site-title">
<h1 class="tw-site-title">
<$transclude tiddler="$:/SiteTitle" mode="inline"/>
</div>
</h1>
<div class="tw-site-subtitle">

View File

@@ -5,7 +5,7 @@ caption: {{$:/language/SideBar/Open/Caption}}
\define lingo-base() $:/language/CloseAll/
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" storyview="pop">
<$button message="tw-close-tiddler" class="btn-invisible btn-mini">&times;</$button> <$link to={{!!title}}><$view field="title"/></$link>
<$button message="tw-close-tiddler" title={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class="btn-invisible btn-mini">&times;</$button> <$link to={{!!title}}><$view field="title"/></$link>
</$list>

View File

@@ -1,23 +1,34 @@
title: $:/core/ui/SideBarLists
<div class="tw-sidebar-lists">
<div class="tw-search">
<$edit-text tiddler="$:/temp/search" type="search" tag="input"/>
<$reveal state="$:/temp/search" type="nomatch" text="">
<$linkcatcher to="$:/temp/search">
<$link to="" class="btn-invisible">{{$:/core/images/close-button}}</$link>
</$linkcatcher>
</$reveal>
<$reveal state="$:/temp/search" type="match" text="">&nbsp;<$link to="$:/AdvancedSearch" class="btn-invisible">&hellip;</$link>
</$reveal>
</div>
<$reveal state="$:/temp/search" type="nomatch" text="">
<div class="tw-search-results">
{{$:/language/Search/Matches}}
<$list filter="[!is[system]search{$:/temp/search}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
</div>
</$reveal>
<$reveal state="$:/temp/search" type="match" text="">
<<tabs "[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]" "$:/core/ui/SideBar/Open" "$:/state/tab/sidebar">>
</$reveal>
<div class="tw-search">
<$edit-text tiddler="$:/temp/search" type="search" tag="input"/>
<$reveal state="$:/temp/search" type="nomatch" text="">
<$linkcatcher to="$:/temp/search">
<$link to="" class="btn-invisible">{{$:/core/images/close-button}}</$link>
</$linkcatcher>
</$reveal>
<$reveal state="$:/temp/search" type="match" text="">&nbsp;<$link to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="btn-invisible">&hellip;</$link>
</$reveal>
</div>
<$reveal state="$:/temp/search" type="nomatch" text="">
<div class="tw-search-results">
{{$:/language/Search/Matches}}
<$list filter="[!is[system]search{$:/temp/search}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
</div>
</$reveal>
<$reveal state="$:/temp/search" type="match" text="">
<<tabs "[all[shadows+tiddlers]tag[$:/tags/SideBar]!has[draft.of]]" "$:/core/ui/SideBar/Open" "$:/state/tab/sidebar">>
</$reveal>
</div>

View File

@@ -2,9 +2,9 @@ title: $:/TagManager
\define lingo-base() $:/language/TagManager/
\define iconEditor(title)
<$edit-text field="icon" tag="input" size="20"/> <$button popup=<<qualify "$:/state/iconDropdown/$title$">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button>
<$edit-text field="icon" tag="input" size="20"/> <$button popup=<<qualify "$:/state/popup/icon/$title$">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button>
<div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/iconDropdown/$title$">> type="nomatch" text="" default="">
<$reveal state=<<qualify "$:/state/popup/icon/$title$">> type="nomatch" text="" default="">
<$linkcatcher to="$title$!!icon">
<div class="tw-block-dropdown tw-edit-type-dropdown">
<$list filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] +[sort[title]]">

View File

@@ -5,11 +5,11 @@ background-color:$(backgroundColor)$;
\end
<span class="tw-tag-list-item">
<$set name="backgroundColor" value={{!!color}}>
<$button popup=<<qualify "$:/state/tagpopup">> class="btn-invisible tw-tag-label" style=<<tag-styles>>>
<$button popup=<<qualify "$:/state/popup/tag">> class="btn-invisible tw-tag-label" style=<<tag-styles>>>
<$transclude tiddler={{!!icon}}/> <$view field="title" format="text" />
</$button>
</$set>
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<hr>
<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
</div>

View File

@@ -2,8 +2,8 @@ title: $:/core/ui/TopBar/menu
tags: $:/tags/TopRightBar
<$reveal state="$:/state/sidebar" type="nomatch" text="no">
<$button set="$:/state/sidebar" setTo="no" class="btn-invisible">{{$:/core/images/chevron-right}}</$button>
<$button set="$:/state/sidebar" setTo="no" title={{$:/language/Buttons/HideSideBar/Hint}} aria-label={{$:/language/Buttons/HideSideBar/Caption}} class="btn-invisible">{{$:/core/images/chevron-right}}</$button>
</$reveal>
<$reveal state="$:/state/sidebar" type="match" text="no">
<$button set="$:/state/sidebar" setTo="yes" class="btn-invisible">{{$:/core/images/chevron-left}}</$button>
<$button set="$:/state/sidebar" setTo="yes" title={{$:/language/Buttons/ShowSideBar/Hint}} aria-label={{$:/language/Buttons/ShowSideBar/Caption}} class="btn-invisible">{{$:/core/images/chevron-left}}</$button>
</$reveal>

View File

@@ -1,10 +1,10 @@
title: $:/core/ui/UntaggedTemplate
\define lingo-base() $:/language/SideBar/
<$button popup=<<qualify "$:/state/tagpopup">> class="btn-invisible tw-untagged-label tw-tag-label">
<$button popup=<<qualify "$:/state/popup/tag">> class="btn-invisible tw-untagged-label tw-tag-label">
<<lingo Tags/Untagged/Caption>>
</$button>
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below">
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below">
<div class="tw-drop-down">
<$list filter="[untagged[]!is[system]] -[tags[]] +[sort[title]]" template="$:/core/ui/ListItemTemplate"/>
</div>

View File

@@ -3,6 +3,6 @@ title: $:/core/ui/ViewTemplate
\define frame-classes()
tw-tiddler-frame tw-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
\end
<$set name="storyTiddler" value=<<currentTiddler>>><$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
<$set name="storyTiddler" value=<<currentTiddler>>><$set name="tiddlerInfoState" value=<<qualify "$:/state/popup/tiddler-info">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</div>
</$tiddler></$set></$set>

View File

@@ -5,7 +5,7 @@ tags: $:/tags/ViewTemplate
fill:$(foregroundColor)$;
\end
<div class="tw-tiddler-title">
<div class="titlebar">
<h2 class="titlebar">
<span class="tw-tiddler-controls">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</span>
@@ -24,7 +24,7 @@ fill:$(foregroundColor)$;
<$view field="title"/>
</span>
</$list>
</div>
</h2>
<$reveal type="nomatch" text="" default="" state=<<tiddlerInfoState>> class="tw-tiddler-info tw-popup" animate="yes" retain="yes">

View File

@@ -1,4 +1,4 @@
title: $:/core/ui/ViewToolbar/close
tags: $:/tags/ViewToolbar
<$button message="tw-close-tiddler" class="btn-invisible">{{$:/core/images/close-button}}</$button>
<$button message="tw-close-tiddler" title={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class="btn-invisible">{{$:/core/images/close-button}}</$button>

View File

@@ -1,4 +1,4 @@
title: $:/core/ui/ViewToolbar/edit
tags: $:/tags/ViewToolbar
<$button message="tw-edit-tiddler" class="btn-invisible">{{$:/core/images/edit-button}}</$button>
<$button message="tw-edit-tiddler" title={{$:/language/Buttons/Edit/Hint}} aria-label={{$:/language/Buttons/Edit/Caption}} class="btn-invisible">{{$:/core/images/edit-button}}</$button>

View File

@@ -1,4 +1,4 @@
title: $:/core/ui/ViewToolbar/info
tags: $:/tags/ViewToolbar
<$button popup=<<tiddlerInfoState>> class="btn-invisible" selectedClass="tw-selected">{{$:/core/images/info-button}}</$button>
<$button popup=<<tiddlerInfoState>> title={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class="btn-invisible" selectedClass="tw-selected">{{$:/core/images/info-button}}</$button>

View File

@@ -1,8 +1,7 @@
title: $:/snippets/languageswitcher
{{$:/language/ControlPanel/Basics/Language/Prompt}} <$view tiddler={{$:/language}} field="description" format="text"><$view tiddler={{$:/language}} field="name" format="text"><$view tiddler={{$:/language}} field="title" format="text"/></$view></$view>
<$linkcatcher to="$:/language">
<$list filter="[[$:/languages/en-GB]] [plugin-type[language]sort[title]]"><div><$reveal state="$:/language" type="match" text={{!!title}}>&bull;</$reveal><$reveal state="$:/language" type="nomatch" text={{!!title}}>&nbsp;</$reveal> <$link to={{!!title}}><$view field="description" format="text"><$view field="name" format="text"><$view field="title" format="text"/></$view></$view></$link></div>
{{$:/language/ControlPanel/Basics/Language/Prompt}} <$select tiddler="$:/language">
<$list filter="[[$:/languages/en-GB]] [plugin-type[language]sort[title]]">
<option value=<<currentTiddler>>><$view field="description"><$view field="name"><$view field="title"/></$view></$view></option>
</$list>
</$linkcatcher>
</$select>

10
core/wiki/macros/CSS.tid Normal file
View File

@@ -0,0 +1,10 @@
title: $:/core/macros/CSS
tags: $:/tags/Macro
\define colour(name)
<$transclude tiddler={{$:/palette}} index="$name$"/>
\end
\define color(name)
<<colour $name$>>
\end

View File

@@ -0,0 +1,10 @@
title: $:/core/macros/lingo
tags: $:/tags/Macro
\define lingo-base()
$:/language/
\end
\define lingo(title)
{{$(lingo-base)$$title$}}
\end

26
core/wiki/macros/tabs.tid Normal file
View File

@@ -0,0 +1,26 @@
title: $:/core/macros/tabs
tags: $:/tags/Macro
\define tabs(tabsList,default,state:"$:/state/tab",class)
<div class="tw-tab-set $class$">
<div class="tw-tab-buttons $class$">
<$list filter="$tabsList$" variable="currentTab">
<$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tw-tab-selected">
<$transclude tiddler=<<currentTab>> field="caption">
<$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/>
</$transclude>
</$button>
</$list>
</div><div class="tw-tab-divider $class$"/><div class="tw-tab-content $class$">
<$list filter="$tabsList$" variable="currentTab">
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
<$transclude tiddler=<<currentTab>> mode="block"/>
</$reveal>
</$list>
</div>
</div>
\end

View File

@@ -1,6 +1,7 @@
title: $:/snippets/minilanguageswitcher
<$linkcatcher to="$:/language">
<$list filter="[[$:/languages/en-GB]] [plugin-type[language]sort[title]]"><div><$reveal state="$:/language" type="match" text={{!!title}}>&bull;</$reveal><$reveal state="$:/language" type="nomatch" text={{!!title}}>&nbsp;</$reveal> <$link to={{!!title}}><$view field="description" format="text"><$view field="name" format="text"><$view field="title" format="text"/></$view></$view></$link></div>
<$select tiddler="$:/language">
<$list filter="[[$:/languages/en-GB]] [plugin-type[language]sort[title]]">
<option value=<<currentTiddler>>><$view field="description"><$view field="name"><$view field="title"/></$view></$view></option>
</$list>
</$linkcatcher>
</$select>

View File

@@ -1,9 +1,8 @@
title: $:/snippets/minithemeswitcher
\define lingo-base() $:/language/ControlPanel/Appearance/Theme/
<<lingo Prompt>> <$view tiddler={{$:/theme}} field="name"/>
<$linkcatcher to="$:/theme">
<$list filter="[plugin-type[theme]sort[title]]"><div><$reveal state="$:/theme" type="match" text={{!!title}}>&bull;</$reveal><$reveal state="$:/theme" type="nomatch" text={{!!title}}>&nbsp;</$reveal> <$link to={{!!title}}><$view field="name" format="text"/></$link></div>
<<lingo Prompt>> <$select tiddler="$:/theme">
<$list filter="[plugin-type[theme]sort[title]]">
<option value=<<currentTiddler>>><$view field="name"><$view field="title"/></$view></option>
</$list>
</$linkcatcher>
</$select>

View File

@@ -1,9 +1,8 @@
title: $:/snippets/viewswitcher
\define lingo-base() $:/language/ControlPanel/Appearance/StoryView/
<<lingo Prompt>> {{$:/view}}
<$linkcatcher to="$:/view"><$list filter="[storyviews[]]"><div><$reveal state="$:/view" type="match" text={{!!title}}>&bull;</$reveal><$reveal state="$:/view" type="nomatch" text={{!!title}}>&nbsp;</$reveal> <$link to={{!!title}}><$view field="title"/></$link>
</div>
<<lingo Prompt>> <$select tiddler="$:/view">
<$list filter="[storyviews[]]">
<option><$view field="title"/></option>
</$list>
</$linkcatcher>
</$select>

View File

@@ -9,6 +9,11 @@
"build": {
"index": [
"--rendertiddler","$:/core/save/all","index.html","text/plain"],
"externalimages": [
"--savetiddlers","[is[image]]","images",
"--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
"--setfield","[is[image]]","text","","text/plain",
"--rendertiddler","$:/core/save/all","externalimages.html","text/plain"],
"static": [
"--rendertiddler","$:/core/templates/static.template.html","static.html","text/plain",
"--rendertiddler","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",

View File

@@ -8,6 +8,14 @@ The MarkdownExample tiddler below is written in Markdown. Create wiki links with
[link text](#TiddlerTitle)
```
Markdown image syntax can be used to reference images by tiddler title or an external URI. For example:
```
![alt text](/path/to/img.jpg "Title")
![alt text](Motovun Jack.jpg "Title")
```
To add the plugin to your own TiddlyWiki5, just drag this link to the browser window:
[[$:/plugins/tiddlywiki/markdown]]

View File

@@ -0,0 +1,137 @@
/*\
title: test-tiddlers.js
type: application/javascript
tags: [[$:/tags/test-spec]]
Tests the tiddler object
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
describe("Tiddler tests", function() {
function compareTiddlers(fieldsA,fieldsB,excludeFields) {
var tiddlerA = new $tw.Tiddler(fieldsA),
tiddlerB = new $tw.Tiddler(fieldsB);
return tiddlerA.isEqual(tiddlerB,excludeFields);
}
// Our tests
it("should compare identical tiddlers", function() {
expect(compareTiddlers({
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
},{
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
})).toEqual(true);
});
it("should compare different tiddlers", function() {
expect(compareTiddlers({
title: "HelloThere2",
text: "one",
tags: ["one","two","three"]
},{
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
})).toEqual(false);
expect(compareTiddlers({
title: "HelloThere",
text: "one",
tags: ["one","three"]
},{
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
})).toEqual(false);
expect(compareTiddlers({
title: "HelloThere",
text: "one",
tags: ["one","two","three"],
caption: "Test"
},{
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
})).toEqual(false);
expect(compareTiddlers({
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
},{
title: "HelloThere",
text: "one",
tags: ["one","two","three"],
caption: "Test"
})).toEqual(false);
expect(compareTiddlers({
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
},{
title: "HelloThere",
text: "one"
})).toEqual(false);
});
it("should compare different tiddlers with exclusions", function() {
expect(compareTiddlers({
title: "HelloThere2",
text: "one",
tags: ["one","two","three"]
},{
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
},["title"])).toEqual(true);
expect(compareTiddlers({
title: "HelloThere",
text: "one",
tags: ["one","three"]
},{
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
},["tags"])).toEqual(true);
expect(compareTiddlers({
title: "HelloThere",
text: "one",
tags: ["one","two","three"],
caption: "Test"
},{
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
},["caption"])).toEqual(true);
expect(compareTiddlers({
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
},{
title: "HelloThere",
text: "one",
tags: ["one","two","three"],
caption: "Test"
},["caption"])).toEqual(true);
expect(compareTiddlers({
title: "HelloThere",
text: "one",
tags: ["one","two","three"]
},{
title: "HelloThere",
text: "one"
},["tags"])).toEqual(true);
});
});
})();

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