1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-01-24 11:54:41 +00:00

Compare commits

...

192 Commits

Author SHA1 Message Date
Jermolene
1c17cfb0ff Version number update for 5.0.4-beta 2013-12-22 15:48:22 +00:00
Jermolene
912c26f848 Correct previous commit 2013-12-22 15:46:41 +00:00
Jermolene
a5de1cf7fb Docs update 2013-12-22 15:46:06 +00:00
Jermolene
84e0dc9d1a Docs update 2013-12-22 15:32:04 +00:00
Jermolene
39743b4758 Docs update 2013-12-22 15:07:32 +00:00
Jermolene
6091b41960 Docs update 2013-12-22 11:28:08 +00:00
Jermolene
2d1d53893a Adjust regex to work around an issue with importing certain tiddlers on Firefox 2013-12-22 11:28:03 +00:00
Jermolene
861e350444 Docs update 2013-12-21 20:56:38 +00:00
Jermolene
9a15cb0516 Docs correction 2013-12-21 20:56:31 +00:00
Jermolene
74fd683a22 Clean up indenting 2013-12-21 20:56:19 +00:00
Jermolene
8cc10d87d4 Added missing RawWidget
Fixes #298. Thanks to @buggyj for pointing it out.
2013-12-21 16:11:48 +00:00
Jeremy Ruston
ce13548884 Merge pull request #299 from davidjade/master
Better drag/drop for Firefox/Chrome and improved IE support
2013-12-21 05:34:43 -08:00
Jermolene
ffcc5a09f2 Improve TiddlyFox instructions 2013-12-21 09:12:30 +00:00
David Jade
7f5a8fc937 Better drag/drop for Firefox/Chrome and improved IE support 2013-12-20 19:57:05 -08:00
Jermolene
c740792105 Fixed illegal HTML comments
Pointed out by @Skeeve, double hyphens are not allowed inside HTML
comments
2013-12-20 18:22:01 +00:00
Jermolene
bd80bf4acc Regex optimisation suggested by @Skeeve 2013-12-20 18:14:11 +00:00
Jermolene
e66fb948c1 Typo from #296 2013-12-20 17:07:30 +00:00
Jermolene
79046c52b4 Make the tiddler text prompt be a placeholder 2013-12-20 17:07:15 +00:00
Jermolene
062c4e5400 Make the edit widget pass through the placeholder attribute 2013-12-20 17:06:57 +00:00
Jermolene
8538d69dc1 Update navigator widget to use wiki.generateNewTitle() 2013-12-20 16:53:49 +00:00
Jermolene
274c52005d Merge branch 'tiddlerexistsloops' of https://github.com/Skeeve/TiddlyWiki5 into Skeeve-tiddlerexistsloops 2013-12-20 16:49:12 +00:00
Jermolene
99dd029816 Drop the backticks around colour values
It’s safe to do since no CSS color could be inadvertantly wikified.
2013-12-20 16:44:04 +00:00
Jermolene
1c529ddcd4 Refactored stylesheet implementation
This way we reuse the refresh mechanism properly so that theme tweaks
can be applied interactively.
2013-12-20 15:31:16 +00:00
Jermolene
1491c261f5 Add quick build
For testing it’s handy to be able to build index.html quickly
2013-12-20 15:29:53 +00:00
Jermolene
3bcaab513d Fixed problem with insertBefore() method in fakedom
Was preventing refreshing of widget trees built against the fakedom.
2013-12-20 15:29:01 +00:00
Stephan Hradek
04077549ca Fixed the typos Mario noticed 2013-12-19 20:38:59 +01:00
Jermolene
6c1489fc2f Remove duplicate header
And provide a slightly more informative prompt
2013-12-19 16:53:48 +00:00
Jermolene
1336058336 Docs updates 2013-12-19 16:45:13 +00:00
Jermolene
b659c65959 Add offline download to TiddlyWeb control panel
Add button to download an offline-compatible snapshot to the TiddlyWeb
control panel
2013-12-19 16:28:42 +00:00
Jermolene
e8f16c1c97 Correct description of github-fork-ribbon plugin 2013-12-19 16:26:00 +00:00
Jermolene
6b51a51609 Docs updates 2013-12-19 10:08:14 +00:00
Jermolene
a4d063e884 Docs update 2013-12-19 07:59:18 +00:00
Stephan Hradek
42ba6852d1 changed 2 loops resolving name conflicts for new tiddlers as suggested in issue 294 2013-12-18 23:48:04 +01:00
Jermolene
638c8b2070 Fixes to fullscreen support
Prompted by this article:

http://generatedcontent.org/post/70347573294/is-your-fullscreen-api-code
-up-to-date-find-out-how-to
2013-12-18 21:39:59 +00:00
Jermolene
cc39686693 Create tiddlers subfolder in wiki folder if it is not present 2013-12-18 21:11:52 +00:00
Jermolene
2b72e48a3a Improve prompt for --server command 2013-12-18 21:11:16 +00:00
Jermolene
0ec2224757 Fallback to a default tiddlywiki.info file if it does not exist
We fallback to settings suitable for the server version, to help people
get up and running quickly.
2013-12-18 21:11:00 +00:00
Jermolene
218b9c967e Docs update 2013-12-18 17:34:33 +00:00
Jermolene
a4e4b6797a Give a different coloured favicon for the client server edition 2013-12-18 17:34:02 +00:00
Jermolene
a4e3f66809 Add favicon.ico support to the server 2013-12-18 17:27:24 +00:00
Jermolene
07dd524016 Adjust build scripts to save favicon.ico from wiki
And add file type information for `image/x-icon`
2013-12-18 17:27:10 +00:00
Jermolene
f3b2788ed1 Add a savetiddler command
It saves tiddlers in their original, unrendered format
2013-12-18 17:26:23 +00:00
Jeremy Ruston
a389f9bc8c Merge pull request #181 from natecain/excludes_refactor
A small refactor and addition to exclude more files
2013-12-18 08:51:36 -08:00
Jermolene
1144504bb3 Docs update 2013-12-18 16:29:45 +00:00
Jeremy Ruston
72f07947ea Merge pull request #286 from willover/285
Fix Issue #285: Minor typo
2013-12-18 08:26:08 -08:00
Jeremy Ruston
e8549cba4b Merge pull request #292 from willover/291
Sign CLA (Issue #291)
2013-12-18 08:23:21 -08:00
willover
a5aa2c08b2 Sign CLA (@willover) 2013-12-18 15:47:57 +00:00
Jermolene
14b98f5966 Docs update 2013-12-18 12:05:26 +00:00
Jermolene
7ec516a746 Correct template for the static HTML rendering 2013-12-17 19:36:55 +00:00
willover
886b069dce Fix Issue #285: Minor typo
Fix Issue #285: and TiddlyWikiClassic is -> and "TiddlyWikiClassic" is
2013-12-17 18:49:54 +00:00
Jermolene
b50eb8da30 Fixed problem with tiddler navigation ordering 2013-12-17 15:42:53 +00:00
Jermolene
4ece301a97 Fix fieldmanger to update modified and modifier fields 2013-12-17 15:04:22 +00:00
Jermolene
810167bc7b Improve handling of double square brackets within tags
Now a [[ has to be preceded by the beginning of the string or a
whitespace and a ]] has to be followed by whitespace or the end of the
string to act as quotes.

Thanks to @Skeeve for the regex
2013-12-17 14:53:02 +00:00
Jermolene
1b2a5fe130 Fixed hover effects for Firefox
For some reason Firefox doesn’t like :hover on an SVG element
2013-12-17 13:59:39 +00:00
Jermolene
88d483a2c8 Docs update 2013-12-17 13:42:19 +00:00
Jermolene
db85bfe513 Fix problem with covering of the dragger image
Fixes #253
2013-12-17 13:39:46 +00:00
Jermolene
066a4d9fbc Coding style and layout tweaks 2013-12-17 13:32:15 +00:00
Jermolene
3e2f475324 Merge branch 'master' of https://github.com/davidjade/TiddlyWiki5 into davidjade-master 2013-12-17 13:26:08 +00:00
Jermolene
a5f33d875b Fix up rootwidget and page container
We need to properly link the page container to the rootwidget.

Fixes #223
2013-12-17 13:13:43 +00:00
Jermolene
6d09db5608 Add a favicon 2013-12-16 23:27:26 +00:00
Jermolene
23b2f74e94 Docs update 2013-12-16 08:57:05 +00:00
Jermolene
37a46adac8 Fix problem with radio widget refreshing 2013-12-16 08:52:18 +00:00
Jermolene
65e3780cc1 Preparing for 5.0.4 2013-12-16 08:52:06 +00:00
Jermolene
7d33dd71a2 Version number update for 5.0.3-beta 2013-12-15 17:00:25 +00:00
Jermolene
d03728ea71 Preparation for 5.0.3 2013-12-15 16:57:58 +00:00
Jermolene
9396d52b42 Docs updates 2013-12-15 16:57:51 +00:00
Jermolene
7dc7559b90 Adjust references to five.tiddlywiki.com 2013-12-15 16:53:10 +00:00
Jermolene
5ac5b2c76d Move markdown.js
Leaving it in node_modules meant that it wasn’t getting installed by npm

Fixes #281
2013-12-15 16:44:49 +00:00
Jermolene
d4d8cdf9a4 Getting ready for 5.0.3 2013-12-15 16:41:36 +00:00
Jermolene
9e5e08a7d3 Docs update 2013-12-15 14:57:56 +00:00
Jermolene
41c592b758 Revert the bump to 5.0.3
So that we can do rebuilds if needed as we execute the move to
tiddlywiki.com
2013-12-15 14:44:55 +00:00
Jermolene
84ad161eab Adjust cname for move to tiddlywiki.com 2013-12-15 14:44:33 +00:00
Jermolene
4ab431bb93 Preparing for 5.0.3 2013-12-15 14:40:30 +00:00
Jermolene
f6bea8f58b Docs updates 2013-12-15 14:37:37 +00:00
Jermolene
b8c9422161 Version number update for 5.0.2-beta 2013-12-15 14:35:15 +00:00
Jermolene
d7ebd461f2 Update for beta 2013-12-15 14:25:02 +00:00
Jermolene
57adbe5bf7 Fixed typo in hardlinebreak parser 2013-12-14 17:42:50 +00:00
Jermolene
34e6d79ef6 Tweak background colour of HTML-in-SVG demo
To make it look different from the page background colour
2013-12-14 17:38:46 +00:00
Jermolene
713d6945c6 Misplaced space 2013-12-14 17:22:26 +00:00
Jermolene
ef9175e7bc Remove debugging info 2013-12-14 17:07:47 +00:00
Jermolene
6a8feb216a Add parser rule for hard linebreaks 2013-12-14 17:05:57 +00:00
Jermolene
b1e7ba29f1 Improved static content for tw5.com 2013-12-14 15:17:34 +00:00
Jermolene
79c8935aef Style cleanups for MOTW
@davidjade I assume these changes are all safe from the BHO’s point of
view? Many thanks
2013-12-14 09:53:39 +00:00
Jermolene
8496337d30 Remove "coreversion" metadata from plugins
There’s no support for it yet, so it’s confusing.
2013-12-14 09:49:39 +00:00
Jermolene
2126ce1d17 Docs update 2013-12-14 09:46:10 +00:00
Jermolene
3f06384516 Adjusted plugin encoding so that the JSON text no longer duplicates the fields 2013-12-14 09:46:02 +00:00
Jermolene
053e09af6e Docs update 2013-12-14 09:25:11 +00:00
David Jade
0984e9322f Revised fix for IE drag/drop issue #252
Also improve browser drag/drop inter-op a tiny bit
2013-12-13 03:12:56 -08:00
Jermolene
c190b0f1ea Docs updates 2013-12-13 10:16:37 +00:00
David Jade
80e0714c0d Fix for IE drag/drop issue #252 2013-12-12 17:32:06 -08:00
Jermolene
819843e4b0 Docs updates 2013-12-12 22:38:19 +00:00
Jermolene
6386e60896 Docs for the radio widget 2013-12-12 20:37:05 +00:00
Jermolene
7c9b920e26 More style adjustments 2013-12-12 20:36:54 +00:00
Jermolene
ae4a2b58ed Complete renaming the radio widget 2013-12-12 19:49:43 +00:00
Jermolene
c73a7af95b Remove file mistakenly included in previous commit 2013-12-12 19:49:29 +00:00
Jermolene
1420aa2f58 Complete renamign the 'fieldradio' widget to 'radio' 2013-12-12 19:41:40 +00:00
Jermolene
0814f3623d Rename 'fieldradio' widget to just 'radio'
We’ve already got two widgets starting “field…”, and “radio” is more
consistent with the existing “checkbox” widget.
2013-12-12 19:40:27 +00:00
Jermolene
382d7e4449 Coding style consistency 2013-12-12 19:39:02 +00:00
Jermolene
e2cd611e45 Typo correction 2013-12-12 19:37:57 +00:00
Jermolene
bb03bb942f Merge branch 'fieldradio' of https://github.com/Skeeve/TiddlyWiki5 into Skeeve-fieldradio 2013-12-12 19:23:39 +00:00
Jermolene
fd996bad20 Fix problem with edit-text widget gaining class="undefined"
Fixes #269
2013-12-12 18:52:51 +00:00
Jermolene
3f3cac12ba Docs update
@davidjade - is what I’ve said about the FSO saver reasonable? I’m
conscious that it doesn’t really explain why TiddlyIE is better.
2013-12-12 18:45:20 +00:00
Jeremy Ruston
761b66028d Merge pull request #276 from davidjade/master
Added TiddlyIE and FSO saver modules
2013-12-12 10:18:30 -08:00
Jermolene
7e151a98da Docs update
Fixes #247

@giffmex - I appreciate that I haven’t fixed everything you mentioned
2013-12-12 18:16:16 +00:00
Jeremy Ruston
e537457d4b Merge pull request #265 from shakerlxxv/sign-cla
sign contributor license agreement
2013-12-12 09:19:35 -08:00
Jermolene
e686d62400 Docs updates 2013-12-12 17:19:17 +00:00
Jermolene
ae6d1b1685 Major refactoring of the navigator widget
Cleans things up, and hopefully fixes #267
2013-12-12 15:17:12 +00:00
Jermolene
49b3165fbd Fix occasional crash from trying to save a tiddler after it has been deleted 2013-12-12 15:16:44 +00:00
Jermolene
6a21965cee Docs updates 2013-12-12 10:38:00 +00:00
Jermolene
b9faadbbc9 Docs updates 2013-12-12 09:48:08 +00:00
Jermolene
c610161455 Adjust link colour
It was a bit too bright
2013-12-12 09:47:58 +00:00
Jermolene
6dbd178378 Merge branch 'issue_270' of https://github.com/Skeeve/TiddlyWiki5 into Skeeve-issue_270 2013-12-11 22:19:19 +00:00
Jermolene
77bca22d42 Docs update 2013-12-11 22:14:40 +00:00
Jermolene
9f058925f7 Fix problem with deleting tiddlers with the filesystemadaptor
Fixes #266
2013-12-11 22:02:34 +00:00
Jermolene
1b75242345 Fix up caller of wiki.forEachTiddler() 2013-12-11 22:01:20 +00:00
Jermolene
6298c7aa43 Refactor wiki.forEachTiddler() and wiki.getTiddlers() to take an options parameter 2013-12-11 22:01:02 +00:00
Stephan Hradek
853cca906c allowing variable number of arguments for non-argument macros 2013-12-11 22:59:52 +01:00
David Jade
cffe9375b2 Added TiddlyIE and FSO saver modules
Modified tiddlywiki5 template to support TiddlyIE and HTAs
Added empty.hta creation to bld scripts
Added TiddlyIE topics
2013-12-11 12:45:35 -08:00
Jermolene
b8897f86fb Ensure that tiddler manipulations affect the history
Previously edit tiddler etc wouldn’t actually navigate to the new
tiddler
2013-12-11 16:30:25 +00:00
Jermolene
409311b61e Docs update 2013-12-11 16:06:58 +00:00
Jermolene
d11cda4854 Rearrange control panel
Introduce version number too
2013-12-11 16:06:52 +00:00
Jermolene
6a71b399b0 Fix problem with transcluding non-string fields
Transcluding date or list fields (like `modified` or `tags`) was
crashing.
2013-12-11 15:51:32 +00:00
Jermolene
2e188a48f4 Docs update 2013-12-11 15:50:58 +00:00
Jermolene
b4733414e5 Improve upgrading instructions
Thanks @giffmex
2013-12-11 14:31:57 +00:00
Jermolene
67072371a0 Get rid of extraneous logging on filesystemadaptor 2013-12-11 13:13:48 +00:00
Jermolene
a9c209c62e Docs updates to get ready for beta
There will be quite a lot more of these updates…
2013-12-11 13:13:37 +00:00
Jermolene
bc84df1707 Formatting for definition lists 2013-12-11 13:12:56 +00:00
Jermolene
062822d45c Fix file system behaviour for loading new tiddlers
We don’t need to load tiddlers because they will all have been loaded
during bootup, or been created through the file system adaptor.
2013-12-11 11:45:15 +00:00
Jermolene
2e0e8a879f Docs update 2013-12-11 07:57:19 +00:00
Jermolene
2ffcbb76eb Remove modifier and creator fields from tiddlers in tw5.com
Keeps things tidier
2013-12-11 07:57:12 +00:00
Jermolene
50e1727ef7 Stop falling back to anonymous username
The `serve` command used to fallback the username parameter to
“ANONYMOUS” if it was not provided. Better is just to not set a
username if it is not provided; newly created tiddlers won’t get a
‘modifier’ field at all.
2013-12-11 07:45:36 +00:00
Jermolene
7a99fb1250 Update template used for deployment to TiddlyWeb
Missed from 5.0.0-alpha.16
2013-12-11 07:37:08 +00:00
Brian Shaver
e6e47ca83d sign contributor license agreement 2013-12-07 18:23:28 -05:00
Jermolene
489b40314b Docs update 2013-12-07 08:59:38 +00:00
Jermolene
14cf9ad24a Fix typo preventing page controls from being reordered 2013-12-07 08:59:32 +00:00
Jermolene
428e27d4bf Prepare version number for 5.0.2 release 2013-12-07 08:59:16 +00:00
Jermolene
0edf46dee1 Update 5.0.1-alpha release date 2013-12-06 17:54:25 +00:00
Jermolene
c38cd500f6 Readme update 2013-12-06 17:52:50 +00:00
Jermolene
3da825c6e1 Version number update for 5.0.1-alpha 2013-12-06 17:50:39 +00:00
Jermolene
559f9da9b4 Version number update for 5.0.1 2013-12-06 17:33:38 +00:00
Jermolene
8f6e3c641d More docs updates 2013-12-06 17:29:46 +00:00
Jermolene
aae8587660 Docs updates 2013-12-06 17:09:30 +00:00
Jermolene
5bb7ee2f88 Docs updates 2013-12-06 16:24:11 +00:00
Jeremy Ruston
0a93edb1b6 Merge pull request #249 from Skeeve/quotes
added quote rules
2013-12-06 01:16:39 -08:00
Stephan Hradek
b0ff8bee6a as requested - quote.js removed because of quotelist - do not forget to add some css classes 2013-12-06 09:57:56 +01:00
Jermolene
48f8046cf5 Fixed problem with cancelling editing the tiddler $:/StoryList 2013-12-06 08:45:24 +00:00
Jermolene
d4e6516a61 Improved upgrading docs 2013-12-06 07:12:35 +00:00
Jermolene
1fddcf075f Big docs update
Finally sorting out the wikitext documentation
2013-12-05 16:21:10 +00:00
Jermolene
d64c37c3b7 Block quote styles 2013-12-05 16:20:37 +00:00
Jermolene
ffcf2bfaac Missing comma
Omitted from 4d4a0e01b4
2013-12-05 16:20:22 +00:00
Jeremy Ruston
4d4a0e01b4 Merge pull request #258 from Skeeve/quotelist
inserted > into lists
2013-12-05 07:16:05 -08:00
Jermolene
b37a139aa7 Typo that prevented edit widget tiddler attribute from working 2013-12-05 10:37:40 +00:00
Jermolene
17277cf8fd Docs update 2013-12-05 10:37:23 +00:00
Stephan Hradek
374743883d inserted > into lists 2013-12-05 00:31:55 +01:00
Stephan Hradek
d739b6939a added core/modules/widgets/fieldradio.js 2013-12-05 00:15:06 +01:00
Jermolene
49ade66540 Extend navigator widget to allow target tiddler to be specified for certain events
Now the edit tiddler, delete tiddler, save tiddler and cancel tiddler
events can all be passed the tiddler title as the message param.
2013-12-04 13:09:26 +00:00
Jermolene
09e14dd8ad Docs updates 2013-12-03 18:05:45 +00:00
Jermolene
c30392c0c5 Docs update 2013-12-03 11:12:57 +00:00
Jermolene
fa8cc1c512 Update docs 2013-12-03 10:11:03 +00:00
Jermolene
21f795b542 Include the release date in the release history 2013-12-03 10:10:56 +00:00
Jermolene
1363d24e86 Retrospectively add a release date to earlier release notes 2013-12-03 10:10:41 +00:00
Jermolene
4cffa58df3 Fix viewing of date fields 2013-12-03 10:09:58 +00:00
Jermolene
7d0b930335 Update verbump script to include version number in commit message
Easier to find.
2013-12-03 10:09:37 +00:00
Jermolene
f3954d374d Add error reporting for the syncer module
Things were failing silently.
2013-12-03 09:35:02 +00:00
Jermolene
16170ce504 Blank out Google Analytics account information from clientserver edition
This also fixes a recently introduced problem: when I removed the last
`.tid` file from the `editions/clientserver/tiddlers/` directory, git
promptly stopped recording the directory in commits, and so newly
downloaded copies of the repo lacked the directory. That caused the
filesystemadaptor to fail to save newly created tiddlers.
2013-12-03 09:20:09 +00:00
Jermolene
9dcbdb5297 Move the docs to the right place 2013-12-03 09:17:59 +00:00
Jermolene
ecdfce1985 Fix tiddler layout on narrow viewports 2013-12-03 09:10:07 +00:00
Jermolene
88e0bd3251 Docs update 2013-12-03 09:05:53 +00:00
Jermolene
5ccd4988aa Update TiddlyDocs documentation 2013-12-02 20:30:38 +00:00
Jermolene
1e99f6cb67 Updated docs 2013-12-02 14:36:38 +00:00
Jermolene
41fc06ab4d Docs updates 2013-12-02 09:59:44 +00:00
Jermolene
b149ab47f4 Refactor importing to to use new wiki.importTiddler method 2013-12-02 09:59:38 +00:00
Jermolene
1b99dbb677 Add wiki.importTiddler()
Exactly like addTiddler except that it rejects plugins that are older
than the currently installed version.
2013-12-02 09:59:17 +00:00
Jermolene
c4814cec91 Include plugin version numbers in control panel 2013-12-02 09:58:44 +00:00
Jermolene
698efb66bb Update the version number preparatory to 5.0.1-alpha
The “prerelease” string will be changed to “alpha” when 5.0.1 is
released.
2013-12-02 09:58:33 +00:00
Jermolene
7a4abba9fd Ensure system tiddlers are imported
We no longer generate a separate “systemArea” for system tiddlers but
we still need to import it for older wikis
2013-12-02 09:57:54 +00:00
Jermolene
026a27c1ab Split out the parsing of semantic version strings 2013-12-02 09:57:19 +00:00
Jermolene
34ae1387a5 Expand the theme switcher in the control panel 2013-12-01 21:57:19 +00:00
Stephan Hradek
62b9fb336b fixed a small bug related to closing wiki-tag - no really 2013-12-01 22:05:49 +01:00
Stephan Hradek
8ed364ed72 fixed a small bug related to closing wiki-tag 2013-12-01 22:01:21 +01:00
Jermolene
b1aadc7e94 Docs update 2013-12-01 20:52:34 +00:00
Jermolene
eb41ca578d Fallback to a list of default themes
Avoids the situation where an empty wiki uses the vanilla theme unless
you explicitly apply a different theme.
2013-12-01 20:28:56 +00:00
Stephan Hradek
2ec58f7fa2 added quote rules 2013-12-01 21:21:15 +01:00
Jermolene
6be7e2c30e Resolve conflict 2013-12-01 20:11:40 +00:00
Jeremy Ruston
7ebb8702b2 Merge pull request #248 from davidjade/master
sign cla
2013-12-01 12:02:09 -08:00
David Jade
eac07fb6c3 sign cla 2013-12-01 11:46:53 -08:00
Jermolene
3a07cd4c55 Docs update
Added a link to @giffmex’s Bible study notebook, and updated the link
to Ton’s guide to building top menus and toolbars.
2013-12-01 13:35:59 +00:00
Jermolene
a12310f225 Fixed problem with rearranging $:/tags/PageControls/ 2013-12-01 13:25:48 +00:00
Stephan Hradek
593503fe09 sign contributor license agreement 2013-11-30 22:31:00 +01:00
Jermolene
7f4dffca77 Clarify location of license files 2013-11-30 16:25:15 +00:00
Jermolene
f9f9c96ca1 Update version number and ribbon colour for alpha-18 2013-11-30 15:23:43 +00:00
natecain
5e743262d4 A small refactor and addition to exclude more files
Refactored duplicated `excludeRegExp` into `$tw.boot.excludeRegExp`
  Added NPM's ignore list to ignore more files during node bootstrap
2013-10-13 12:58:10 -04:00
285 changed files with 2467 additions and 4887 deletions

View File

@@ -1,6 +1,6 @@
@echo off
rem build TiddlyWiki5 for five.tiddlywiki.com
rem build TiddlyWiki5 for tiddlywiki.com
rem Set up the build output directory
@@ -35,9 +35,11 @@ node .\tiddlywiki.js ^
.\editions\tw5.com ^
--verbose ^
--rendertiddler $:/core/save/all %TW5_BUILD_OUTPUT%\index.html text/plain ^
--savetiddler $:/favicon.ico %TW5_BUILD_OUTPUT%\favicon.ico ^
--rendertiddler ReadMe .\readme.md text/html ^
--rendertiddler ContributingTemplate .\contributing.md text/html ^
--rendertiddler $:/editions/tw5.com/download-empty %TW5_BUILD_OUTPUT%\empty.html text/plain ^
--rendertiddler $:/editions/tw5.com/download-empty %TW5_BUILD_OUTPUT%\empty.hta text/plain ^
--rendertiddler $:/core/templates/static.template.html %TW5_BUILD_OUTPUT%\static.html text/plain ^
--rendertiddler $:/core/templates/static.template.css %TW5_BUILD_OUTPUT%\static\static.css text/plain ^
--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html %TW5_BUILD_OUTPUT%\static text/plain ^
@@ -87,7 +89,7 @@ node .\tiddlywiki.js ^
rem Make the CNAME file that GitHub Pages requires
echo five.tiddlywiki.com > %TW5_BUILD_OUTPUT%\CNAME
echo tiddlywiki.com > %TW5_BUILD_OUTPUT%\CNAME
rem Run the test edition to run the Node.js tests and to generate test.html for tests in the browser

6
bld.sh
View File

@@ -1,6 +1,6 @@
#!/bin/bash
# build TiddlyWiki5 for five.tiddlywiki.com
# build TiddlyWiki5 for tiddlywiki.com
# Set up the build output directory
@@ -17,7 +17,7 @@ echo "Using TW5_BUILD_OUTPUT as [$TW5_BUILD_OUTPUT]"
# Make the CNAME file that GitHub Pages requires
echo "five.tiddlywiki.com" > $TW5_BUILD_OUTPUT/CNAME
echo "tiddlywiki.com" > $TW5_BUILD_OUTPUT/CNAME
# Create the `static` directories if necessary
@@ -36,9 +36,11 @@ node ./tiddlywiki.js \
./editions/tw5.com \
--verbose \
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/index.html text/plain \
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
--rendertiddler ReadMe ./readme.md text/html \
--rendertiddler ContributingTemplate ./contributing.md text/html \
--rendertiddler $:/editions/tw5.com/download-empty $TW5_BUILD_OUTPUT/empty.html text/plain \
--rendertiddler $:/editions/tw5.com/download-empty $TW5_BUILD_OUTPUT/empty.hta text/plain \
--rendertiddler $:/core/templates/static.template.html $TW5_BUILD_OUTPUT/static.html text/plain \
--rendertiddler $:/core/templates/static.template.css $TW5_BUILD_OUTPUT/static/static.css text/plain \
--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html $TW5_BUILD_OUTPUT/static text/plain \

View File

@@ -269,7 +269,7 @@ $tw.utils.stringifyList = function(value) {
// Parse a string array from a bracketted list. For example "OneTiddler [[Another Tiddler]] LastOne"
$tw.utils.parseStringArray = function(value) {
if(typeof value === "string") {
var memberRegExp = /(?:\[\[([^\]]+)\]\])|([^\s]+)/mg,
var memberRegExp = /(?:^|\s)(?:\[\[(.*?)\]\])(?=\s|$)|(\S+)/mg,
results = [],
match;
do {
@@ -344,14 +344,35 @@ $tw.utils.resolvePath = function(sourcepath,rootpath) {
};
/*
Returns true if the `actual` version is greater than or equal to the `required` version. Both are in `x.y.z` format.
Parse a semantic version string into its constituent parts
*/
$tw.utils.checkVersions = function(required,actual) {
var targetVersion = required.split("."),
currVersion = actual.split("."),
diff = [parseInt(targetVersion[0],10) - parseInt(currVersion[0],10),
parseInt(targetVersion[1],10) - parseInt(currVersion[1],10),
parseInt(targetVersion[2],10) - parseInt(currVersion[2],10)];
$tw.utils.parseVersion = function(version) {
var match = /^((\d+)\.(\d+)\.(\d+))(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?$/.exec(version);
if(match) {
return {
version: match[1],
major: parseInt(match[2],10),
minor: parseInt(match[3],10),
patch: parseInt(match[4],10),
prerelease: match[5],
build: match[6]
};
} else {
return null;
}
};
/*
Returns true if the version string A is greater than the version string B
*/
$tw.utils.checkVersions = function(versionStringA,versionStringB) {
var versionA = $tw.utils.parseVersion(versionStringA),
versionB = $tw.utils.parseVersion(versionStringB),
diff = [
versionA.major - versionB.major,
versionA.minor - versionB.minor,
versionA.patch - versionB.patch
];
return (diff[0] > 0) ||
(diff[0] === 0 && diff[1] > 0) ||
(diff[0] === 0 && diff[1] === 0 && diff[2] > 0);
@@ -1131,11 +1152,18 @@ $tw.loadTiddlersFromFile = function(filepath,fields) {
return {filepath: filepath, type: type, tiddlers: tiddlers, hasMetaFile: !!metadata};
};
/*
A default set of files for TiddlyWiki to ignore during load.
This matches what NPM ignores, and adds "*.meta" to ignore tiddler
metadata files.
*/
$tw.boot.excludeRegExp = /^\.DS_Store$|^.*\.meta$|^\..*\.swp$|^\._.*$|^\.git$|^\.hg$|^\.lock-wscript$|^\.svn$|^\.wafpickle-.*$|^CVS$|^npm-debug\.log$/;
/*
Load all the tiddlers recursively from a directory, including honouring `tiddlywiki.files` files for drawing in external files. Returns an array of {filepath:,type:,tiddlers: [{..fields...}],hasMetaFile:}. Note that no file information is returned for externally loaded tiddlers, just the `tiddlers` property.
*/
$tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
excludeRegExp = excludeRegExp || /^\.DS_Store$|.meta$/;
excludeRegExp = excludeRegExp || $tw.boot.excludeRegExp;
var tiddlers = [];
if(fs.existsSync(filepath)) {
var stat = fs.statSync(filepath);
@@ -1177,7 +1205,7 @@ $tw.loadTiddlersFromPath = function(filepath,excludeRegExp) {
Load the tiddlers from a plugin folder, and package them up into a proper JSON plugin tiddler
*/
$tw.loadPluginFolder = function(filepath,excludeRegExp) {
excludeRegExp = excludeRegExp || /^\.DS_Store$|.meta$/;
excludeRegExp = excludeRegExp || $tw.boot.excludeRegExp;
var stat, files, pluginInfo, pluginTiddlers = [], f, file, titlePrefix, t;
if(fs.existsSync(filepath)) {
stat = fs.statSync(filepath);
@@ -1211,13 +1239,14 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) {
var fields = {
title: pluginInfo.title,
type: "application/json",
text: JSON.stringify(pluginInfo,null,4),
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"
"plugin-type": pluginInfo["plugin-type"] || "plugin",
"dependents": $tw.utils.stringifyList(pluginInfo["dependents"] || [])
}
return fields;
} else {
@@ -1225,6 +1254,20 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) {
}
};
/*
Fallback tiddlywiki.info content
*/
$tw.boot.defaultWikiInfo = {
"plugins": [
"tiddlywiki/tiddlyweb",
"tiddlywiki/filesystem"
],
"themes": [
"tiddlywiki/vanilla",
"tiddlywiki/snowwhite"
]
};
/*
path: path of wiki directory
parentPaths: array of parent paths that we mustn't recurse into
@@ -1232,13 +1275,14 @@ parentPaths: array of parent paths that we mustn't recurse into
$tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
parentPaths = parentPaths || [];
var wikiInfoPath = path.resolve(wikiPath,$tw.config.wikiInfo),
wikiInfo = {},
wikiInfo,
pluginFields;
// Bail if we don't have a wiki info file
if(!fs.existsSync(wikiInfoPath)) {
$tw.utils.error("Missing tiddlywiki.info file at " + wikiPath);
if(fs.existsSync(wikiInfoPath)) {
wikiInfo = JSON.parse(fs.readFileSync(wikiInfoPath,"utf8"));
} else {
wikiInfo = $tw.boot.defaultWikiInfo;
}
wikiInfo = JSON.parse(fs.readFileSync(wikiInfoPath,"utf8"));
// Load any parent wikis
if(wikiInfo.includeWikis) {
parentPaths = parentPaths.slice(0);
@@ -1390,6 +1434,7 @@ $tw.boot.startup = function() {
$tw.utils.registerFileType("image/png","base64",".png");
$tw.utils.registerFileType("image/gif","base64",".gif");
$tw.utils.registerFileType("image/svg+xml","utf8",".svg");
$tw.utils.registerFileType("image/x-icon","base64",".ico");
$tw.utils.registerFileType("application/font-woff","base64",".woff");
// Create the wiki store for the app
$tw.wiki = new $tw.Wiki();

View File

@@ -1,8 +1,8 @@
<h1 class=''>Contributing to <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://five.tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a></h1><p><a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://five.tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a> welcomes contributions to its code and documentation via <a class='tw-tiddlylink-external' href='https://github.com/Jermolene/TiddlyWiki5' target='_blank'>GitHub</a>. Please take a moment to read these notes to help make the process as smooth as possible.</p><h2 class=''>Bug Reports</h2><p>From the perspective of the developers, a bug report that says little more than &quot;it doesn't work&quot; can be frustrating. For effective debugging, we need as much information as possible. At a minimum, please try to include:</p><ul><li>A descriptive title</li><li>A summary</li><li>Steps to reproduce</li><li>Expected behaviour</li><li>Context (OS, browser etc.)</li></ul><p>There's a lot of good material on the web about bug reports:</p><ul><li><a class='tw-tiddlylink-external' href='http://mhay68.tumblr.com/post/1648223018/what-makes-a-good-bug-report' target='_blank'>http://mhay68.tumblr.com/post/1648223018/what-makes-a-good-bug-report</a></li><li><a class='tw-tiddlylink-external' href='http://www.chiark.greenend.org.uk/~sgtatham/bugs.html' target='_blank'>http://www.chiark.greenend.org.uk/~sgtatham/bugs.html</a></li></ul><h2 class=''>Pull Requests</h2><p>Like other <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://five.tiddlywiki.com/static/OpenSource.html'>OpenSource</a> projects, <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://five.tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a> needs a signed contributor license agreement from individual contributors before contributions of code can be accepted. This is a legal agreement that allows contributors to assert that they own the copyright of their contribution, and that they agree to license it to the <a class=' tw-tiddlylink tw-tiddlylink-missing' href='http://five.tiddlywiki.com/static/UnaMesa.html'>UnaMesa</a> Association (the legal entity that owns <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://five.tiddlywiki.com/static/TiddlyWiki.html'>TiddlyWiki</a> on behalf of the community).</p><ul><li>For individuals use: <a class='tw-tiddlylink-external' href='https://github.com/Jermolene/TiddlyWiki5/tree/master/licenses/cla-individual.md' target='_blank'>CLA-individual</a></li><li>For entities use: <a class='tw-tiddlylink-external' href='https://github.com/Jermolene/TiddlyWiki5/tree/master/licenses/cla-entity.md' target='_blank'>CLA-entity</a></li></ul><p><em>This is a first pass at a CLA for <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://five.tiddlywiki.com/static/TiddlyWiki.html'>TiddlyWiki</a>. Please let us know if we missed something important. If we do have to make essential changes to the CLA, there is a possibility that all contributors will need to sign it again</em></p><h3 class=''>How to sign the CLA</h3><pre>git clone https://github.com/Jermolene/TiddlyWiki5.git TiddlyWiki5
<h1 class=''>Contributing to <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a></h1><p><a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a> welcomes contributions to its code and documentation via <a class='tw-tiddlylink-external' href='https://github.com/Jermolene/TiddlyWiki5' target='_blank'>GitHub</a>. Please take a moment to read these notes to help make the process as smooth as possible.</p><h2 class=''>Bug Reports</h2><p>For effective debugging, we need as much information as possible. At a minimum, please try to include:</p><ul><li>A descriptive title</li><li>A summary</li><li>Steps to reproduce</li><li>Expected behaviour</li><li>Context (OS, browser etc.)</li></ul><p>Consider also adding screenshots if it makes things clearer.</p><p>There's a lot of good material on the web about bug reports:</p><ul><li><a class='tw-tiddlylink-external' href='http://mhay68.tumblr.com/post/1648223018/what-makes-a-good-bug-report' target='_blank'>http://mhay68.tumblr.com/post/1648223018/what-makes-a-good-bug-report</a></li><li><a class='tw-tiddlylink-external' href='http://www.chiark.greenend.org.uk/~sgtatham/bugs.html' target='_blank'>http://www.chiark.greenend.org.uk/~sgtatham/bugs.html</a></li></ul><h2 class=''>Pull Requests</h2><p>Like other <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/OpenSource.html'>OpenSource</a> projects, <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a> needs a signed contributor license agreement from individual contributors. This is a legal agreement that allows contributors to assert that they own the copyright of their contribution, and that they agree to license it to the <a class=' tw-tiddlylink tw-tiddlylink-missing' href='http://tiddlywiki.com/static/UnaMesa.html'>UnaMesa</a> Association (the legal entity that owns <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki.html'>TiddlyWiki</a> on behalf of the community).</p><ul><li>For individuals use: <a class='tw-tiddlylink-external' href='https://github.com/Jermolene/TiddlyWiki5/tree/master/licenses/cla-individual.md' target='_blank'>licenses/CLA-individual</a></li><li>For entities use: <a class='tw-tiddlylink-external' href='https://github.com/Jermolene/TiddlyWiki5/tree/master/licenses/cla-entity.md' target='_blank'>licenses/CLA-entity</a></li></ul><p><em>This is a first pass at a CLA for <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki.html'>TiddlyWiki</a>. Please let us know if we missed something important. If we do have to make essential changes to the CLA, there is a possibility that all contributors will need to sign it again</em></p><h3 class=''>How to sign the CLA</h3><pre>git clone https://github.com/Jermolene/TiddlyWiki5.git TiddlyWiki5
cd TiddlyWiki5
git checkout -b sign-cla</pre><p><strong>Add your name and the date to cla-individual.md or cla-entity.md</strong>. Date format (YYYY/MM/DD)
eg: <code>Jeremy Ruston, @Jermolene, 2011/11/22</code></p><pre>git add .
git commit -m &quot;sign contributor license agreement&quot;
git push origin sign-cla</pre><p><strong>Go to your github repo and create a pull request.</strong></p><p><strong>Thank you!</strong></p><h4 class=''>Attribution</h4><p>The CLA documents used for this project where created using <a class='tw-tiddlylink-external' href='http://www.harmonyagreements.org' target='_blank'>Harmony Project Templates</a>. &quot;HA-CLA-I-LIST Version 1.0&quot; for &quot;CLA-individual&quot; and &quot;HA-CLA-E-LIST Version 1.0&quot; for &quot;CLA-entity&quot;
</p><p><em>This file was automatically generated by <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://five.tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a></em>
</p><p><em>This file was automatically generated by <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a></em>
</p>

View File

@@ -0,0 +1,46 @@
/*\
title: $:/core/modules/commands/savetiddler.js
type: application/javascript
module-type: command
Command to save the content of a tiddler to a file
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
name: "savetiddler",
synchronous: false
};
var Command = function(params,commander,callback) {
this.params = params;
this.commander = commander;
this.callback = callback;
};
Command.prototype.execute = function() {
if(this.params.length < 2) {
return "Missing filename";
}
var self = this,
fs = require("fs"),
path = require("path"),
title = this.params[0],
filename = this.params[1],
tiddler = this.commander.wiki.getTiddler(title),
type = tiddler.fields.type || "text/vnd.tiddlywiki",
contentTypeInfo = $tw.config.contentTypeInfo[type] || {encoding: "utf8"};
fs.writeFile(filename,tiddler.fields.text,contentTypeInfo.encoding,function(err) {
self.callback(err);
});
return null;
};
exports.Command = Command;
})();

View File

@@ -95,9 +95,8 @@ SimpleServer.prototype.listen = function(port) {
if(username && password) {
// Check they match
if(self.checkCredentials(request,username,password) !== "ALLOWED") {
response.setHeader("WWW-Authenticate", 'Basic realm="Admin Area"');
response.writeHead(401,"Authentication required",{
"WWW-Authenticate": 'Basic realm="TiddlyWiki5"'
"WWW-Authenticate": 'Basic realm="Please provide your username and password to login to TiddlyWiki5"'
});
response.end();
return;
@@ -197,13 +196,22 @@ var Command = function(params,commander,callback) {
response.end(text,"utf8");
}
});
this.server.addRoute({
method: "GET",
path: /^\/favicon.ico$/,
handler: function(request,response,state) {
response.writeHead(200, {"Content-Type": "image/x-icon"});
var buffer = state.wiki.getTiddlerText("$:/favicon.ico","");
response.end(buffer,"base64");
}
});
this.server.addRoute({
method: "GET",
path: /^\/recipes\/default\/tiddlers.json$/,
handler: function(request,response,state) {
response.writeHead(200, {"Content-Type": "application/json"});
var tiddlers = [];
state.wiki.forEachTiddler("title",function(title,tiddler) {
state.wiki.forEachTiddler({sortField: "title"},function(title,tiddler) {
var tiddlerFields = {};
$tw.utils.each(tiddler.fields,function(field,name) {
if(name !== "text") {
@@ -255,7 +263,7 @@ Command.prototype.execute = function() {
rootTiddler = this.params[1] || "$:/core/save/all",
renderType = this.params[2] || "text/plain",
serveType = this.params[3] || "text/html",
username = this.params[4] || "ANONYMOUS",
username = this.params[4],
password = this.params[5];
this.server.set({
rootTiddler: rootTiddler,
@@ -265,9 +273,8 @@ Command.prototype.execute = function() {
password: password
});
this.server.listen(port);
if(this.commander.verbose) {
console.log("Serving on port " + port);
}
console.log("Serving on port " + port);
console.log("(press ctrl-C to exit)");
return null;
};

View File

@@ -36,8 +36,8 @@ var parseTiddlerDiv = function(text /* [,fields] */) {
}
}
// Parse the DIV body
var divRegExp = /^\s*<div\s+([^>]*)>((?:\s|\S)*)<\/div>\s*$/gi,
subDivRegExp = /^\s*<pre>((?:\s|\S)*)<\/pre>\s*$/gi,
var divRegExp = /^\s*<div\s+([^>]*)>([(?:\s|\S)]*)<\/div>\s*$/gi,
subDivRegExp = /^\s*<pre>([(?:\s|\S)]*)<\/pre>\s*$/gi,
attrRegExp = /\s*([^=\s]+)\s*=\s*"([^"]*)"/gi,
match = divRegExp.exec(text);
if(match) {
@@ -96,7 +96,15 @@ exports["text/html"] = function(text,fields) {
match = storeAreaMarkerRegExp.exec(text);
if(match) {
// If so, it's either a classic TiddlyWiki file or a TW5 file
return deserializeTiddlyWikiFile(text,storeAreaMarkerRegExp.lastIndex,!!match[1],fields);
// First read the normal tiddlers
var results = deserializeTiddlyWikiFile(text,storeAreaMarkerRegExp.lastIndex,!!match[1],fields);
// Then any system tiddlers
var systemAreaMarkerRegExp = /<div id=["']?systemArea['"]?( style=["']?display:none;["']?)?>/gi,
sysMatch = systemAreaMarkerRegExp.exec(text);
if(sysMatch) {
results.push.apply(results,deserializeTiddlyWikiFile(text,systemAreaMarkerRegExp.lastIndex,!!sysMatch[1],fields));
}
return results
} else {
// It's not a TiddlyWiki so we'll return the entire HTML file as a tiddler
return deserializeHtmlFile(text,fields);

View File

@@ -0,0 +1,58 @@
/*\
title: $:/core/modules/parsers/wikiparser/rules/hardlinebreaks.js
type: application/javascript
module-type: wikirule
Wiki text inline rule for marking areas with hard line breaks. For example:
```
"""
This is some text
That is set like
It is a Poem
When it is
Clearly
Not
"""
```
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "hardlinebreaks";
exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /"""(?:\r?\n)?/mg;
};
exports.parse = function() {
var reEnd = /(""")|(\r?\n)/mg,
tree = [];
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
do {
// Parse the run up to the terminator
tree.push.apply(tree,this.parser.parseInlineRun(reEnd,{eatTerminator: false}));
// Redo the terminator match
reEnd.lastIndex = this.parser.pos;
var match = reEnd.exec(this.parser.source);
if(match) {
this.parser.pos = reEnd.lastIndex;
// Add a line break if the terminator was a line break
if(match[2]) {
tree.push({type: "element", tag: "br"});
}
}
} while(match && !match[1]);
// Return the nodes
return tree;
};
})();

View File

@@ -52,14 +52,15 @@ exports.types = {block: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /([\*#;:]+)/mg;
this.matchRegExp = /([\*#;:>]+)/mg;
};
var listTypes = {
"*": {listTag: "ul", itemTag: "li"},
"#": {listTag: "ol", itemTag: "li"},
";": {listTag: "dl", itemTag: "dt"},
":": {listTag: "dl", itemTag: "dd"}
":": {listTag: "dl", itemTag: "dd"},
">": {listTag: "blockquote", itemTag: "p"}
};
/*
@@ -71,7 +72,7 @@ exports.parse = function() {
// Cycle through the items in the list
while(true) {
// Match the list marker
var reMatch = /([\*#;:]+)/mg;
var reMatch = /([\*#;:>]+)/mg;
reMatch.lastIndex = this.parser.pos;
var match = reMatch.exec(this.parser.source);
if(!match || match.index !== this.parser.pos) {

View File

@@ -0,0 +1,93 @@
/*\
title: $:/core/modules/parsers/wikiparser/rules/quoteblock.js
type: application/javascript
module-type: wikirule
Wiki text rule for quote blocks. For example:
```
<<<.optionalClass(es) optional cited from
a quote
<<<
<<<.optionalClass(es)
a quote
<<< optional cited from
```
Quotes can be quoted by putting more <s
```
<<<
Quote Level 1
<<<<
QuoteLevel 2
<<<<
<<<
```
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.name = "quoteblock";
exports.types = {block: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /(<<<+)/mg;
};
exports.parse = function() {
var classes = ["tw-quote"];
// Get all the details of the match
var reEndString = "^" + this.match[1] + "(?!<)";
// Move past the <s
this.parser.pos = this.matchRegExp.lastIndex;
// Parse any classes, whitespace and then the optional cite itself
classes.push.apply(classes, this.parser.parseClasses());
this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});
var cite = this.parser.parseInlineRun(/(\r?\n)/mg);
// before handling the cite, parse the body of the quote
var tree= this.parser.parseBlocks(reEndString);
// If we got a cite, put it before the text
if ( cite.length > 0 ) {
tree.unshift({
type: "element",
tag: "cite",
children: cite
});
}
// Parse any optional cite
this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});
var cite = this.parser.parseInlineRun(/(\r?\n)/mg);
// If we got a cite, push it
if ( cite.length > 0 ) {
tree.push({
type: "element",
tag: "cite",
children: cite
});
}
// Return the blockquote element
return [{
type: "element",
tag: "blockquote",
attributes: {
class: { type: "string", value: classes.join(" ") },
},
children: tree
}];
};
})();

View File

@@ -0,0 +1,75 @@
/*\
title: $:/core/modules/savers/fsosaver.js
type: application/javascript
module-type: saver
Handles saving changes via MS FileSystemObject ActiveXObject
Note: Since TiddlyWiki's markup contains the MOTW, the FileSystemObject normally won't be available.
However, if the wiki is loaded as an .HTA file (Windows HTML Applications) then the FSO can be used.
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Select the appropriate saver module and set it up
*/
var FSOSaver = function(wiki) {
};
FSOSaver.prototype.save = function(text,method,callback) {
// Bail out unless this is a save (rather than a download)
if(method !== "save") {
return false;
}
// Get the pathname of this document
var pathname = unescape(document.location.pathname);
// Test for a Windows path of the form /x:\blah...
if(/^\/[A-Z]\:\\[^\\]+/i.test(pathname)) { // ie: ^/[a-z]:/[^/]+
// Remove the leading slash
pathname = pathname.substr(1);
} else if (document.location.hostname !== "" && /^\/\\[^\\]+\\[^\\]+/i.test(pathname)) { // test for \\server\share\blah... - ^/[^/]+/[^/]+
// Remove the leading slash
pathname = pathname.substr(1);
// reconstruct UNC path
pathname = "\\\\" + document.location.hostname + pathname;
} else return false;
// Save the file (as UTF-16)
var fso = new ActiveXObject("Scripting.FileSystemObject");
var file = fso.OpenTextFile(pathname,2,-1,-1);
file.Write(text);
file.Close();
return true;
};
/*
Information about this saver
*/
FSOSaver.prototype.info = {
name: "FSOSaver",
priority: 120
};
/*
Static method that returns true if this saver is capable of working
*/
exports.canSave = function(wiki) {
try {
return (window.location.protocol === "file:") && !!(new ActiveXObject("Scripting.FileSystemObject"));
} catch(e) { return false; }
};
/*
Create an instance of this saver
*/
exports.create = function(wiki) {
return new FSOSaver(wiki);
};
})();

View File

@@ -0,0 +1,73 @@
/*\
title: $:/core/modules/savers/tiddlyie.js
type: application/javascript
module-type: saver
Handles saving changes via Internet Explorer BHO extenion (TiddlyIE)
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Select the appropriate saver module and set it up
*/
var TiddlyIESaver = function(wiki) {
};
TiddlyIESaver.prototype.save = function(text,method,callback) {
// Bail out unless this is a save (rather than a download)
if(method !== "save") {
return false;
}
// check existence of TiddlyIE BHO extension (note: only works after document is complete)
if(typeof(window.TiddlyIE) != "undefined") {
// Get the pathname of this document
var pathname = unescape(document.location.pathname);
// Test for a Windows path of the form /x:/blah...
if(/^\/[A-Z]\:\/[^\/]+/i.test(pathname)) { // ie: ^/[a-z]:/[^/]+ (is this better?: ^/[a-z]:/[^/]+(/[^/]+)*\.[^/]+ )
// Remove the leading slash
pathname = pathname.substr(1);
// Convert slashes to backslashes
pathname = pathname.replace(/\//g,"\\");
} else if(document.hostname !== "" && /^\/[^\/]+\/[^\/]+/i.test(pathname)) { // test for \\server\share\blah... - ^/[^/]+/[^/]+
// Convert slashes to backslashes
pathname = pathname.replace(/\//g,"\\");
// reconstruct UNC path
pathname = "\\\\" + document.location.hostname + pathname;
} else return false;
// Prompt the user to save the file
window.TiddlyIE.save(pathname, text);
return true;
} else {
return false;
}
};
/*
Information about this saver
*/
TiddlyIESaver.prototype.info = {
name: "tiddlyiesaver",
priority: 1500
};
/*
Static method that returns true if this saver is capable of working
*/
exports.canSave = function(wiki) {
return (window.location.protocol === "file:");
};
/*
Create an instance of this saver
*/
exports.create = function(wiki) {
return new TiddlyIESaver(wiki);
};
})();

View File

@@ -59,13 +59,14 @@ exports.startup = function() {
});
// Install the animator
$tw.anim = new $tw.utils.Animator();
// Kick off the stylesheet manager
$tw.stylesheetManager = new $tw.utils.StylesheetManager($tw.wiki);
// Create a root widget for attaching event handlers. By using it as the parentWidget for another widget tree, one can reuse the event handlers
$tw.rootWidget = new widget.widget({type: "widget", children: []},{
wiki: $tw.wiki,
document: document
});
$tw.rootWidget = new widget.widget({
type: "widget",
children: []
},{
wiki: $tw.wiki,
document: document
});
// Install the modal message mechanism
$tw.modal = new $tw.utils.Modal($tw.wiki);
$tw.rootWidget.addEventListener("tw-modal",function(event) {
@@ -111,6 +112,20 @@ exports.startup = function() {
$tw.rootWidget.addEventListener("tw-clear-password",function(event) {
$tw.crypto.setPassword(null);
});
// Set up the styles
var styleTemplateTitle = "$:/core/ui/PageStylesheet",
styleParser = $tw.wiki.parseTiddler(styleTemplateTitle);
$tw.styleWidgetNode = $tw.wiki.makeWidget(styleParser,{document: $tw.document});
$tw.styleContainer = $tw.document.createElement("style");
$tw.styleWidgetNode.render($tw.styleContainer,null);
$tw.styleElement = document.createElement("style");
$tw.styleElement.innerHTML = $tw.styleContainer.textContent;
document.head.insertBefore($tw.styleElement,document.head.firstChild);
$tw.wiki.addEventListener("change",function(changes) {
if($tw.styleWidgetNode.refresh(changes,$tw.styleContainer,null)) {
$tw.styleElement.innerHTML = $tw.styleContainer.textContent;
}
});
// Display the PageMacros, which includes the PageTemplate
var templateTitle = "$:/core/ui/PageMacros",
parser = $tw.wiki.parseTiddler(templateTitle);
@@ -122,6 +137,9 @@ exports.startup = function() {
$tw.wiki.addEventListener("change",function(changes) {
$tw.pageWidgetNode.refresh(changes,$tw.pageContainer,null);
});
// Fix up the link between the root widget and the page container
$tw.rootWidget.domNodes = [$tw.pageContainer];
$tw.rootWidget.children = [$tw.pageWidgetNode];
// If we're being viewed on a data: URI then give instructions for how to save
if(document.location.protocol === "data:") {
$tw.utils.dispatchCustomEvent(document,"tw-modal",{

View File

@@ -68,13 +68,11 @@ Syncer.prototype.init = function() {
// Hashmap by title of {revision:,changeCount:,adaptorInfo:}
this.tiddlerInfo = {};
// Record information for known tiddlers
this.wiki.forEachTiddler(function(title,tiddler) {
if(tiddler.fields["revision"]) {
self.tiddlerInfo[title] = {
revision: tiddler.fields["revision"],
adaptorInfo: self.syncadaptor.getTiddlerInfo(tiddler),
changeCount: self.wiki.getChangeCount(title)
}
this.wiki.forEachTiddler({includeSystem: true},function(title,tiddler) {
self.tiddlerInfo[title] = {
revision: tiddler.fields["revision"],
adaptorInfo: self.syncadaptor.getTiddlerInfo(tiddler),
changeCount: self.wiki.getChangeCount(title)
}
});
// Tasks are {type: "load"/"save"/"delete", title:, queueTime:, lastModificationTime:}
@@ -385,6 +383,9 @@ Syncer.prototype.processTaskQueue = function() {
this.taskInProgress[task.title] = task;
// Dispatch the task
this.dispatchTask(task,function(err) {
if(err) {
console.log("Sync error while processing '" + task.title + "':\n" + err);
}
// Mark that this task is no longer in progress
delete self.taskInProgress[task.title];
// Process the next task
@@ -436,19 +437,21 @@ Syncer.prototype.dispatchTask = function(task,callback) {
var changeCount = this.wiki.getChangeCount(task.title),
tiddler = this.wiki.getTiddler(task.title);
this.log("Dispatching 'save' task:",task.title);
this.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {
if(err) {
return callback(err);
}
// Adjust the info stored about this tiddler
self.tiddlerInfo[task.title] = {
changeCount: changeCount,
adaptorInfo: adaptorInfo,
revision: revision
};
// Invoke the callback
callback(null);
});
if(tiddler) {
this.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {
if(err) {
return callback(err);
}
// Adjust the info stored about this tiddler
self.tiddlerInfo[task.title] = {
changeCount: changeCount,
adaptorInfo: adaptorInfo,
revision: revision
};
// Invoke the callback
callback(null);
});
}
} else if(task.type === "load") {
// Load the tiddler
this.log("Dispatching 'load' task:",task.title);
@@ -457,7 +460,9 @@ Syncer.prototype.dispatchTask = function(task,callback) {
return callback(err);
}
// Store the tiddler
self.storeTiddler(tiddlerFields);
if(tiddlerFields) {
self.storeTiddler(tiddlerFields);
}
// Invoke the callback
callback(null);
});

View File

@@ -13,7 +13,10 @@ Manages themes and styling.
"use strict";
var THEME_PLUGIN_TITLE = "$:/theme", // This tiddler contains the title of the current theme plugin
DEFAULT_THEME_PLUGIN = "$:/themes/tiddlywiki/vanilla";
DEFAULT_THEME_PLUGINS = [
"$:/themes/tiddlywiki/snowwhite",
"$:/themes/tiddlywiki/vanilla"
];
function ThemeManager(wiki) {
this.wiki = wiki;
@@ -32,7 +35,12 @@ function ThemeManager(wiki) {
ThemeManager.prototype.switchTheme = function() {
// Get the name of the current theme
var themePluginTitle = this.wiki.getTiddlerText(THEME_PLUGIN_TITLE,DEFAULT_THEME_PLUGIN);
var themePluginTitle = this.wiki.getTiddlerText(THEME_PLUGIN_TITLE);
// If it doesn't exist, then fallback to one of the default themes
var index = 0;
while(!this.wiki.getTiddler(themePluginTitle) && index < DEFAULT_THEME_PLUGINS.length) {
themePluginTitle = DEFAULT_THEME_PLUGINS[index++];
}
// Accumulate the titles of the plugins that we need to load
var themePlugins = [],
self = this,
@@ -40,8 +48,9 @@ ThemeManager.prototype.switchTheme = function() {
var tiddler = self.wiki.getTiddler(title);
if(tiddler && tiddler.isPlugin() && themePlugins.indexOf(title) === -1) {
themePlugins.push(title);
var pluginInfo = JSON.parse(self.wiki.getTiddlerText(title));
$tw.utils.each(pluginInfo.dependents,function(title) {
var pluginInfo = JSON.parse(self.wiki.getTiddlerText(title)),
dependents = $tw.utils.parseStringArray(tiddler.fields.dependents || "");
$tw.utils.each(dependents,function(title) {
accumulatePlugin(title);
});
}

View File

@@ -130,15 +130,7 @@ exports.convertEventName = function(eventName) {
// Setup constants for the current browser
exports.getBrowserInfo = function(info) {
info.requestFullScreen = document.body.webkitRequestFullScreen !== undefined ? "webkitRequestFullScreen" :
document.body.mozRequestFullScreen !== undefined ? "mozRequestFullScreen" :
document.body.requestFullScreen !== undefined ? "requestFullScreen" : "";
info.cancelFullScreen = document.webkitCancelFullScreen !== undefined ? "webkitCancelFullScreen" :
document.mozCancelFullScreen !== undefined ? "mozCancelFullScreen" :
document.cancelFullScreen !== undefined ? "cancelFullScreen" : "";
info.isFullScreen = document.webkitIsFullScreen !== undefined ? "webkitIsFullScreen" :
document.mozFullScreen !== undefined ? "mozFullScreen" :
document.fullScreen !== undefined ? "fullScreen" : "";
info.isIE = (/msie|trident/i.test(navigator.userAgent));
};
})();

View File

@@ -1,75 +0,0 @@
/*\
title: $:/core/modules/utils/styles.js
type: application/javascript
module-type: utils
The stylesheet manager automatically renders any tiddlers tagged "$:/tags/stylesheet" as HTML style elements.
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var STYLESHEET_ID_PREFIX = "tw-tiddler-stylesheet-",
STYLESHEET_TAG = "$:/tags/stylesheet";
function StylesheetManager(wiki) {
this.wiki = wiki;
this.stylesheets = {}; // Hashmap of currently rendered stylesheets
// Apply initial stylesheets
var self = this,
stylesheetTiddlers = this.wiki.filterTiddlers("[is[shadow]!has[draft.of]tag[" + STYLESHEET_TAG + "]] [!is[shadow]!has[draft.of]tag[" + STYLESHEET_TAG + "]]");
$tw.utils.each(stylesheetTiddlers,function(title,index) {
self.addStylesheet(title);
});
// Listen out for changes
this.wiki.addEventListener("change",function(changes) {
self.handleTiddlerChanges(changes);
});
}
StylesheetManager.prototype.addStylesheet = function(title) {
// Record the stylesheet in the hashmap
this.stylesheets[title] = true;
// Parse the tiddler and render as plain text
var text = this.wiki.renderTiddler("text/plain",title);
// Create a style element and put it in the document
var styleNode = document.createElement("style");
styleNode.setAttribute("type","text/css");
styleNode.setAttribute("id",STYLESHEET_ID_PREFIX + title);
styleNode.appendChild(document.createTextNode(text));
document.getElementsByTagName("head")[0].appendChild(styleNode);
};
StylesheetManager.prototype.removeStylesheet = function(title) {
// Remove the stylesheet from the hashmap
if($tw.utils.hop(this.stylesheets,title)) {
delete this.stylesheets[title];
}
// Remove the stylesheet from the document
var styleNode = document.getElementById(STYLESHEET_ID_PREFIX + title);
if(styleNode) {
styleNode.parentNode.removeChild(styleNode);
}
};
StylesheetManager.prototype.handleTiddlerChanges = function(changes) {
var self = this;
$tw.utils.each(changes,function(change,title) {
// Remove any existing stylesheet for the changed tiddler
if($tw.utils.hop(self.stylesheets,title)) {
self.removeStylesheet(title);
}
// Add the stylesheet if it is tagged and not a draft
var tiddler = self.wiki.getTiddler(title);
if(tiddler && tiddler.hasTag(STYLESHEET_TAG) && !tiddler.hasField("draft.of")) {
self.addStylesheet(title);
}
});
};
exports.StylesheetManager = StylesheetManager;
})();

View File

@@ -66,6 +66,7 @@ TW_Element.prototype.insertBefore = function(node,nextSibling) {
var p = this.children.indexOf(nextSibling);
if(p !== -1) {
this.children.splice(p,0,node);
node.parentNode = this;
} else {
this.appendChild(node);
}

View File

@@ -100,30 +100,62 @@ DropZoneWidget.prototype.handleDropEvent = function(event) {
};
DropZoneWidget.prototype.importData = function(dataTransfer) {
// Try each provided data type in turn
for(var t=0; t<this.importDataTypes.length; t++) {
var dataType = this.importDataTypes[t];
var data = dataTransfer.getData(dataType.type);
if(data !== "") {
var tiddlerFields = dataType.convertToFields(data);
if(!tiddlerFields.title) {
tiddlerFields.title = this.wiki.generateNewTitle("Untitled");
if(!$tw.browser.isIE || this.importDataTypes[t].IECompatible) {
// Get the data
var dataType = this.importDataTypes[t];
var data = dataTransfer.getData(dataType.type);
// Import the tiddlers in the data
if(data !== "" && data !== null) {
var tiddlerFields = dataType.convertToFields(data);
if(!tiddlerFields.title) {
tiddlerFields.title = this.wiki.generateNewTitle("Untitled");
}
this.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify([tiddlerFields])});
return;
}
this.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify([tiddlerFields])});
return;
}
};
};
DropZoneWidget.prototype.importDataTypes = [
{type: "text/vnd.tiddler", convertToFields: function(data) {
{type: "text/vnd.tiddler", IECompatible: false, convertToFields: function(data) {
return JSON.parse(data);
}},
{type: "text/plain", convertToFields: function(data) {
{type: "URL", IECompatible: true, convertToFields: function(data) {
// Check for tiddler data URI
var match = decodeURI(data).match(/^data\:text\/vnd\.tiddler,(.*)/i);
if(match) {
return JSON.parse(match[1]);
} else {
return { // As URL string
text: data
};
}
}},
{type: "text/x-moz-url", IECompatible: false, convertToFields: function(data) {
// Check for tiddler data URI
var match = decodeURI(data).match(/^data\:text\/vnd\.tiddler,(.*)/i);
if(match) {
return JSON.parse(match[1]);
} else {
return { // As URL string
text: data
};
}
}},
{type: "text/plain", IECompatible: false, convertToFields: function(data) {
return {
text: data
};
}},
{type: "text/uri-list", convertToFields: function(data) {
{type: "Text", IECompatible: true, convertToFields: function(data) {
return {
text: data
};
}},
{type: "text/uri-list", IECompatible: false, convertToFields: function(data) {
return {
text: data
};

View File

@@ -45,7 +45,9 @@ EditTextWidget.prototype.render = function(parent,nextSibling) {
domNode.setAttribute("placeholder",this.editPlaceholder);
}
// Assign classes
domNode.className = this.editClass;
if(this.editClass) {
domNode.className = this.editClass;
}
// Set the text
var editInfo = this.getEditInfo();
if(this.editTag === "textarea") {

View File

@@ -53,6 +53,7 @@ EditWidget.prototype.execute = function() {
this.editField = this.getAttribute("field","text");
this.editIndex = this.getAttribute("index");
this.editClass = this.getAttribute("class");
this.editPlaceholder = this.getAttribute("placeholder");
// Get the content type of the thing we're editing
var type;
if(this.editField === "text") {
@@ -68,10 +69,11 @@ EditWidget.prototype.execute = function() {
this.makeChildWidgets([{
type: "edit-" + editorType,
attributes: {
title: {type: "string", value: this.editTitle},
tiddler: {type: "string", value: this.editTitle},
field: {type: "string", value: this.editField},
index: {type: "string", value: this.editIndex},
"class": {type: "string", value: this.editClass}
"class": {type: "string", value: this.editClass},
"placeholder": {type: "string", value: this.editPlaceholder}
}
}]);
};

View File

@@ -75,7 +75,7 @@ FieldManglerWidget.prototype.handleAddFieldEvent = function(event) {
if(tiddler && typeof event.param === "string") {
var name = event.param.toLowerCase();
if(name !== "" && !$tw.utils.hop(tiddler.fields,name)) {
var addition = {};
var addition = this.wiki.getModificationFields();
addition[name] = "";
this.wiki.addTiddler(new $tw.Tiddler(tiddler,addition));
}
@@ -88,7 +88,7 @@ FieldManglerWidget.prototype.handleRemoveTagEvent = function(event) {
if(tiddler && tiddler.fields.tags) {
var p = tiddler.fields.tags.indexOf(event.param);
if(p !== -1) {
var modification = {};
var modification = this.wiki.getModificationFields();
modification.tags = (tiddler.fields.tags || []).slice(0);
modification.tags.splice(p,1);
this.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));
@@ -100,7 +100,7 @@ FieldManglerWidget.prototype.handleRemoveTagEvent = function(event) {
FieldManglerWidget.prototype.handleAddTagEvent = function(event) {
var tiddler = this.wiki.getTiddler(this.mangleTitle);
if(tiddler && typeof event.param === "string" && event.param !== "") {
var modification = {};
var modification = this.wiki.getModificationFields();
modification.tags = (tiddler.fields.tags || []).slice(0);
$tw.utils.pushTop(modification.tags,event.param);
this.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));

View File

@@ -91,7 +91,7 @@ LinkWidget.prototype.handleClickEvent = function (event) {
this.dispatchEvent({
type: "tw-navigate",
navigateTo: this.to,
navigateFromTitle: this.getVariable("currentTiddler"),
navigateFromTitle: this.getVariable("storyTiddler"),
navigateFromNode: this,
navigateFromClientRect: { top: bounds.top, left: bounds.left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, height: bounds.height
}
@@ -114,21 +114,32 @@ LinkWidget.prototype.handleDragStartEvent = function(event) {
this.dragImage.appendChild(inner);
this.document.body.appendChild(this.dragImage);
// Astoundingly, we need to cover the dragger up: http://www.kryogenix.org/code/browser/custom-drag-image.html
var bounds = this.dragImage.firstChild.getBoundingClientRect(),
cover = this.document.createElement("div");
var cover = this.document.createElement("div");
cover.className = "tw-tiddler-dragger-cover";
cover.style.left = (bounds.left - 16) + "px";
cover.style.top = (bounds.top - 16) + "px";
cover.style.width = (bounds.width + 32) + "px";
cover.style.height = (bounds.height + 32) + "px";
cover.style.left = (inner.offsetLeft - 16) + "px";
cover.style.top = (inner.offsetTop - 16) + "px";
cover.style.width = (inner.offsetWidth + 32) + "px";
cover.style.height = (inner.offsetHeight + 32) + "px";
this.dragImage.appendChild(cover);
// Set the data transfer properties
var dataTransfer = event.dataTransfer;
// First the image
dataTransfer.effectAllowed = "copy";
dataTransfer.setDragImage(this.dragImage.firstChild,-16,-16);
if(dataTransfer.setDragImage) {
dataTransfer.setDragImage(this.dragImage.firstChild,-16,-16);
}
// Then the data
dataTransfer.clearData();
dataTransfer.setData("text/vnd.tiddler",this.wiki.getTiddlerAsJson(this.to));
dataTransfer.setData("text/plain",this.wiki.getTiddlerText(this.to,""));
var jsonData = this.wiki.getTiddlerAsJson(this.to),
textData = this.wiki.getTiddlerText(this.to,"");
// IE doesn't like these content types
if(!$tw.browser.isIE) {
dataTransfer.setData("text/vnd.tiddler",jsonData);
dataTransfer.setData("text/plain",textData);
dataTransfer.setData("text/x-moz-url","data:text/vnd.tiddler," + encodeURI(jsonData));
}
dataTransfer.setData("URL","data:text/vnd.tiddler," + encodeURI(jsonData));
dataTransfer.setData("Text",textData);
event.stopPropagation();
} else {
event.preventDefault();

View File

@@ -70,131 +70,154 @@ NavigatorWidget.prototype.refresh = function(changedTiddlers) {
};
NavigatorWidget.prototype.getStoryList = function() {
this.storyList = this.wiki.getTiddlerList(this.storyTitle);
return this.storyTitle ? this.wiki.getTiddlerList(this.storyTitle) : null;
};
NavigatorWidget.prototype.saveStoryList = function() {
NavigatorWidget.prototype.saveStoryList = function(storyList) {
var storyTiddler = this.wiki.getTiddler(this.storyTitle);
this.wiki.addTiddler(new $tw.Tiddler({
title: this.storyTitle
},storyTiddler,{list: this.storyList}));
this.wiki.addTiddler(new $tw.Tiddler(
{title: this.storyTitle},
storyTiddler,
{list: storyList}
));
};
NavigatorWidget.prototype.findTitleInStory = function(title,defaultIndex) {
for(var t=0; t<this.storyList.length; t++) {
if(this.storyList[t] === title) {
return t;
NavigatorWidget.prototype.findTitleInStory = function(storyList,title,defaultIndex) {
var p = storyList.indexOf(title);
return p === -1 ? defaultIndex : p;
};
NavigatorWidget.prototype.removeTitleFromStory = function(storyList,title) {
var p = storyList.indexOf(title);
while(p !== -1) {
storyList.splice(p,1);
p = storyList.indexOf(title);
}
};
NavigatorWidget.prototype.replaceFirstTitleInStory = function(storyList,oldTitle,newTitle) {
var pos = storyList.indexOf(oldTitle);
if(pos !== -1) {
storyList[pos] = newTitle;
do {
pos = storyList.indexOf(oldTitle,pos + 1);
if(pos !== -1) {
storyList.splice(pos,1);
}
} while(pos !== -1);
} else {
storyList.splice(0,0,newTitle);
}
};
NavigatorWidget.prototype.addToStory = function(title,fromTitle) {
var storyList = this.getStoryList();
if(storyList) {
// See if the tiddler is already there
var slot = this.findTitleInStory(storyList,title,-1);
// If not we need to add it
if(slot === -1) {
// First we try to find the position of the story element we navigated from
slot = this.findTitleInStory(storyList,fromTitle,-1) + 1;
// Add the tiddler
storyList.splice(slot,0,title);
// Save the story
this.saveStoryList(storyList);
}
}
return defaultIndex;
}
};
/*
Add a new record to the top of the history stack
title: a title string or an array of title strings
fromPageRect: page coordinates of the origin of the navigation
*/
NavigatorWidget.prototype.addToHistory = function(title,fromPageRect) {
var titles = $tw.utils.isArray(title) ? title : [title];
// Add a new record to the top of the history stack
if(this.historyTitle) {
var historyList = this.wiki.getTiddlerData(this.historyTitle,[]);
$tw.utils.each(titles,function(title) {
historyList.push({title: title, fromPageRect: fromPageRect});
});
this.wiki.setTiddlerData(this.historyTitle,historyList);
}
};
/*
Handle a tw-navigate event
*/
NavigatorWidget.prototype.handleNavigateEvent = function(event) {
if(this.storyTitle) {
// Update the story tiddler if specified
this.getStoryList();
// See if the tiddler is already there
var slot = this.findTitleInStory(event.navigateTo,-1);
// If not we need to add it
if(slot === -1) {
// First we try to find the position of the story element we navigated from
slot = this.findTitleInStory(event.navigateFromTitle,-1) + 1;
// Add the tiddler
this.storyList.splice(slot,0,event.navigateTo);
// Save the story
this.saveStoryList();
}
}
// Add a new record to the top of the history stack
if(this.historyTitle) {
var historyList = this.wiki.getTiddlerData(this.historyTitle,[]);
historyList.push({title: event.navigateTo, fromPageRect: event.navigateFromClientRect});
this.wiki.setTiddlerData(this.historyTitle,historyList);
}
this.addToStory(event.navigateTo,event.navigateFromTitle);
this.addToHistory(event.navigateTo,event.navigateFromClientRect);
return false;
};
// Close a specified tiddler
NavigatorWidget.prototype.handleCloseTiddlerEvent = function(event) {
this.getStoryList();
var title = event.param || event.tiddlerTitle,
storyList = this.getStoryList();
// Look for tiddlers with this title to close
var slot = this.findTitleInStory(event.tiddlerTitle,-1);
if(slot !== -1) {
this.storyList.splice(slot,1);
this.saveStoryList();
}
this.removeTitleFromStory(storyList,title);
this.saveStoryList(storyList);
return false;
};
// Close all tiddlers
NavigatorWidget.prototype.handleCloseAllTiddlersEvent = function(event) {
this.storyList = [];
this.saveStoryList();
this.saveStoryList([]);
return false;
};
// Close other tiddlers
NavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) {
this.storyList = [event.tiddlerTitle];
this.saveStoryList();
var title = event.param || event.tiddlerTitle;
this.saveStoryList([title]);
return false;
};
// Place a tiddler in edit mode
NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {
this.getStoryList();
// Replace the specified tiddler with a draft in edit mode
var draftTiddler = this.getDraftTiddler(event.tiddlerTitle),
gotOne = false;
for(var t=this.storyList.length-1; t>=0; t--) {
// Replace the first story instance of the original tiddler name with the draft title
if(this.storyList[t] === event.tiddlerTitle) {
if(!gotOne) {
this.storyList[t] = draftTiddler.fields.title;
gotOne = true;
} else {
this.storyList.splice(t,1);
}
} else if(this.storyList[t] === draftTiddler.fields.title) {
// Remove any existing references to the draft
this.storyList.splice(t,1);
}
}
this.saveStoryList();
var title = event.param || event.tiddlerTitle,
draftTiddler = this.makeDraftTiddler(title),
draftTitle = draftTiddler.fields.title,
storyList = this.getStoryList();
this.removeTitleFromStory(storyList,draftTitle);
this.replaceFirstTitleInStory(storyList,title,draftTitle);
this.addToHistory(draftTitle,event.navigateFromClientRect);
this.saveStoryList(storyList);
return false;
};
// Delete a tiddler
NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) {
// Get the tiddler we're deleting
var tiddler = this.wiki.getTiddler(event.tiddlerTitle);
var title = event.param || event.tiddlerTitle,
tiddler = this.wiki.getTiddler(title),
storyList = this.getStoryList();
// Check if the tiddler we're deleting is in draft mode
if(tiddler.hasField("draft.title")) {
// Delete the original tiddler
this.wiki.deleteTiddler(tiddler.fields["draft.of"]);
var originalTitle = tiddler.fields["draft.of"];
this.wiki.deleteTiddler(originalTitle);
this.removeTitleFromStory(storyList,originalTitle);
}
// Delete this tiddler
this.wiki.deleteTiddler(event.tiddlerTitle);
this.wiki.deleteTiddler(title);
// Remove the closed tiddler from the story
this.getStoryList();
// Look for tiddler with this title to close
var slot = this.findTitleInStory(event.tiddlerTitle,-1);
if(slot !== -1) {
this.storyList.splice(slot,1);
this.saveStoryList();
}
this.removeTitleFromStory(storyList,title);
this.saveStoryList(storyList);
return false;
};
/*
Create/reuse the draft tiddler for a given title
*/
NavigatorWidget.prototype.getDraftTiddler = function(targetTitle) {
NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
// See if there is already a draft tiddler for this tiddler
var drafts = [];
this.wiki.forEachTiddler(function(title,tiddler) {
this.wiki.forEachTiddler({includeSystem: true},function(title,tiddler) {
if(tiddler.fields["draft.title"] && tiddler.fields["draft.of"] === targetTitle) {
drafts.push(tiddler);
}
@@ -234,71 +257,58 @@ NavigatorWidget.prototype.generateDraftTitle = function(title) {
// Take a tiddler out of edit mode, saving the changes
NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {
this.getStoryList();
var storyTiddlerModified = false; // We have to special case saving the story tiddler itself
for(var t=0; t<this.storyList.length; t++) {
if(this.storyList[t] === event.tiddlerTitle) {
var tiddler = this.wiki.getTiddler(event.tiddlerTitle);
if(tiddler) {
var draftTitle = (tiddler.fields["draft.title"] || "").trim(),
draftOf = (tiddler.fields["draft.of"] || "").trim();
if(draftTitle) {
var isRename = draftOf !== draftTitle,
isConfirmed = true;
if(isRename && this.wiki.tiddlerExists(draftTitle)) {
isConfirmed = confirm("Do you wish to overwrite the tiddler '" + draftTitle + "'?");
}
if(isConfirmed) {
// Save the draft tiddler as the real tiddler
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
title: draftTitle,
"draft.title": undefined,
"draft.of": undefined
},this.wiki.getModificationFields()));
// Remove the draft tiddler
this.wiki.deleteTiddler(event.tiddlerTitle);
// Remove the original tiddler if we're renaming it
if(isRename) {
this.wiki.deleteTiddler(draftOf);
}
// Make the story record point to the newly saved tiddler
this.storyList[t] = draftTitle;
// Check if we're modifying the story tiddler itself
if(draftTitle === this.storyTitle) {
storyTiddlerModified = true;
}
}
var title = event.param || event.tiddlerTitle,
tiddler = this.wiki.getTiddler(title),
storyList = this.getStoryList(),
storyTiddlerModified = false; // We have to special case saving the story tiddler itself
// Replace the original tiddler with the draft
if(tiddler) {
var draftTitle = (tiddler.fields["draft.title"] || "").trim(),
draftOf = (tiddler.fields["draft.of"] || "").trim();
if(draftTitle) {
var isRename = draftOf !== draftTitle,
isConfirmed = true;
if(isRename && this.wiki.tiddlerExists(draftTitle)) {
isConfirmed = confirm("Do you wish to overwrite the tiddler '" + draftTitle + "'?");
}
if(isConfirmed) {
// Save the draft tiddler as the real tiddler
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
title: draftTitle,
"draft.title": undefined,
"draft.of": undefined
},this.wiki.getModificationFields()));
// Remove the draft tiddler
this.wiki.deleteTiddler(title);
// Remove the original tiddler if we're renaming it
if(isRename) {
this.wiki.deleteTiddler(draftOf);
}
// Replace the draft in the story with the original
this.replaceFirstTitleInStory(storyList,title,draftTitle);
this.addToHistory(draftTitle,event.navigateFromClientRect);
if(draftTitle !== this.storyTitle) {
this.saveStoryList(storyList);
}
}
}
}
if(!storyTiddlerModified) {
this.saveStoryList();
}
return false;
};
// Take a tiddler out of edit mode without saving the changes
NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) {
this.getStoryList();
var storyTiddlerModified = false;
for(var t=0; t<this.storyList.length; t++) {
if(this.storyList[t] === event.tiddlerTitle) {
var tiddler = this.wiki.getTiddler(event.tiddlerTitle);
if(tiddler && tiddler.hasField("draft.title")) {
// Remove the draft tiddler
this.wiki.deleteTiddler(event.tiddlerTitle);
// Make the story record point to the original tiddler
this.storyList[t] = tiddler.fields["draft.title"];
// Check if we're modifying the story tiddler itself
if(tiddler.fields["draft.title"] === this.storyTitle) {
storyTiddlerModified = true;
}
}
}
}
if(!storyTiddlerModified) {
this.saveStoryList();
// Flip the specified tiddler from draft back to the original
var draftTitle = event.param || event.tiddlerTitle,
draftTiddler = this.wiki.getTiddler(draftTitle),
originalTitle = draftTiddler.fields["draft.of"],
storyList = this.getStoryList();
if(draftTiddler && originalTitle) {
// Remove the draft tiddler
this.wiki.deleteTiddler(draftTitle);
this.replaceFirstTitleInStory(storyList,draftTitle,originalTitle);
this.addToHistory(originalTitle,event.navigateFromClientRect);
this.saveStoryList(storyList);
}
return false;
};
@@ -306,18 +316,11 @@ NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) {
// Create a new draft tiddler
NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
// Get the story details
this.getStoryList();
var storyList = this.getStoryList();
// Get the template tiddler if there is one
var templateTiddler = this.wiki.getTiddler(event.param);
// Create the new tiddler
var baseTitle = (templateTiddler && templateTiddler.fields.title) || "New Tiddler",
title;
for(var t=0; true; t++) {
title = baseTitle + (t ? " " + t : "");
if(!this.wiki.tiddlerExists(title)) {
break;
}
}
var title = this.wiki.generateNewTitle((templateTiddler && templateTiddler.fields.title) || "New Tiddler");
var tiddler = new $tw.Tiddler(this.wiki.getCreationFields(),{
text: "Newly created tiddler",
title: title
@@ -326,7 +329,7 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
// Create the draft tiddler
var draftTitle = this.generateDraftTitle(title),
draftTiddler = new $tw.Tiddler({
text: "Type the text for the new tiddler"
text: ""
},templateTiddler,{
title: draftTitle,
"draft.title": title,
@@ -334,14 +337,12 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
},this.wiki.getModificationFields());
this.wiki.addTiddler(draftTiddler);
// Update the story to insert the new draft at the top
var slot = this.findTitleInStory(event.navigateFromTitle,-1) + 1;
this.storyList.splice(slot,0,draftTitle);
var slot = storyList.indexOf(event.navigateFromTitle);
storyList.splice(slot + 1,0,draftTitle);
// Save the updated story
this.saveStoryList();
this.saveStoryList(storyList);
// Add a new record to the top of the history stack
var history = this.wiki.getTiddlerData(this.historyTitle,[]);
history.push({title: draftTitle});
this.wiki.setTiddlerData(this.historyTitle,history);
this.addToHistory(draftTitle);
return false;
};
@@ -349,8 +350,8 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
var self = this;
// Get the story and history details
this.getStoryList();
var history = this.wiki.getTiddlerData(this.historyTitle,[]);
var storyList = this.getStoryList();
var history = [];
// Get the tiddlers
var tiddlers = [];
try {
@@ -359,25 +360,25 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
}
// Process each tiddler
$tw.utils.each(tiddlers,function(tiddlerFields) {
// Generate a unique title for the tiddler
var title = self.wiki.generateNewTitle(tiddlerFields.title);
var title = tiddlerFields.title;
// Add it to the store
self.wiki.addTiddler(new $tw.Tiddler(
var imported = self.wiki.importTiddler(new $tw.Tiddler(
self.wiki.getCreationFields(),
self.wiki.getModificationFields(),
tiddlerFields,
{title: title}
tiddlerFields
));
// Add it to the story
if(self.storyList.indexOf(title) === -1) {
self.storyList.unshift(title);
if(imported) {
// Add it to the story
if(storyList.indexOf(title) === -1) {
storyList.unshift(title);
}
// And to history
history.push(title);
}
// And to history
history.push({title: title});
});
// Save the updated story and history
this.saveStoryList();
this.wiki.setTiddlerData(this.historyTitle,history);
this.saveStoryList(storyList);
this.addToHistory(history);
return false;
};

View File

@@ -0,0 +1,129 @@
/*\
title: $:/core/modules/widgets/radio.js
type: application/javascript
module-type: widget
Radio widget
Will set a field to the selected value:
```
<$radio field="myfield" value="check 1">one</$radio>
<$radio field="myfield" value="check 2">two</$radio>
<$radio field="myfield" value="check 3">three</$radio>
```
|Parameter |Description |h
|tiddler |Name of the tiddler in which the field should be set. Defaults to current tiddler |
|field |The name of the field to be set |
|value |The value to set |
|class |Optional class name(s) |
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var RadioWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
RadioWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
RadioWidget.prototype.render = function(parent,nextSibling) {
// Save the parent dom node
this.parentDomNode = parent;
// Compute our attributes
this.computeAttributes();
// Execute our logic
this.execute();
// Create our elements
this.labelDomNode = this.document.createElement("label");
this.labelDomNode.setAttribute("class",this.radioClass);
this.inputDomNode = this.document.createElement("input");
this.inputDomNode.setAttribute("type","radio");
if(this.getValue() == this.radioValue) {
this.inputDomNode.setAttribute("checked","true");
}
this.labelDomNode.appendChild(this.inputDomNode);
this.spanDomNode = this.document.createElement("span");
this.labelDomNode.appendChild(this.spanDomNode);
// Add a click event handler
$tw.utils.addEventListeners(this.inputDomNode,[
{name: "change", handlerObject: this, handlerMethod: "handleChangeEvent"}
]);
// Insert the label into the DOM and render any children
parent.insertBefore(this.labelDomNode,nextSibling);
this.renderChildren(this.spanDomNode,null);
this.domNodes.push(this.labelDomNode);
};
RadioWidget.prototype.getValue = function() {
var tiddler = this.wiki.getTiddler(this.radioTitle);
return tiddler && tiddler.getFieldString(this.radioField);
};
RadioWidget.prototype.setValue = function() {
if(this.radioField) {
var tiddler = this.wiki.getTiddler(this.radioTitle),
addition = {};
addition[this.radioField] = this.radioValue;
this.wiki.addTiddler(new $tw.Tiddler(tiddler,addition));
}
};
RadioWidget.prototype.handleChangeEvent = function(event) {
if (this.inputDomNode.checked) {
this.setValue();
}
};
/*
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.radioValue = this.getAttribute("value");
this.radioClass = this.getAttribute("class","");
if(this.radioClass !== "") {
this.radioClass += " ";
}
this.radioClass += "tw-radio";
// Make the child widgets
this.makeChildWidgets();
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
RadioWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.value || changedAttributes["class"]) {
this.refreshSelf();
return true;
} else {
var refreshed = false;
if(changedTiddlers[this.radioTitle]) {
this.inputDomNode.checked = this.getValue() === this.radioValue;
refreshed = true;
}
return this.refreshChildren(changedTiddlers) || refreshed;
}
};
exports.radio = RadioWidget;
})();

View File

@@ -0,0 +1,53 @@
/*\
title: $:/core/modules/widgets/raw.js
type: application/javascript
module-type: widget
Raw widget
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var Widget = require("$:/core/modules/widgets/widget.js").widget;
var RawWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};
/*
Inherit from the base widget class
*/
RawWidget.prototype = new Widget();
/*
Render this widget into the DOM
*/
RawWidget.prototype.render = function(parent,nextSibling) {
this.parentDomNode = parent;
this.execute();
var div = this.document.createElement("div");
div.innerHTML=this.parseTreeNode.html;
parent.insertBefore(div,nextSibling);
this.domNodes.push(div);
};
/*
Compute the internal state of the widget
*/
RawWidget.prototype.execute = function() {
};
/*
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
RawWidget.prototype.refresh = function(changedTiddlers) {
return false;
};
exports.raw = RawWidget;
})();

View File

@@ -148,8 +148,9 @@ ViewWidget.prototype.getValueAsDoubleUrlEncoded = function() {
};
ViewWidget.prototype.getValueAsDate = function(format) {
var value = this.getValue();
if(value) {
format = format || "YYYY MM DD 0hh:0ss";
var value = $tw.utils.parseDate(this.getValue());
if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") {
return $tw.utils.formatDateString(value,format);
} else {
return "";

View File

@@ -143,29 +143,34 @@ Widget.prototype.evaluateMacroModule = function(name,actualParams,defaultValue)
if($tw.utils.hop($tw.macros,name)) {
var macro = $tw.macros[name],
args = [];
var nextAnonParameter = 0, // Next candidate anonymous parameter in macro call
paramInfo, paramValue;
// Step through each of the parameters in the macro definition
for(var p=0; p<macro.params.length; p++) {
// Check if we've got a macro call parameter with the same name
paramInfo = macro.params[p];
paramValue = undefined;
for(var m=0; m<actualParams.length; m++) {
if(actualParams[m].name === paramInfo.name) {
paramValue = actualParams[m].value;
if(macro.params.length > 0) {
var nextAnonParameter = 0, // Next candidate anonymous parameter in macro call
paramInfo, paramValue;
// Step through each of the parameters in the macro definition
for(var p=0; p<macro.params.length; p++) {
// Check if we've got a macro call parameter with the same name
paramInfo = macro.params[p];
paramValue = undefined;
for(var m=0; m<actualParams.length; m++) {
if(actualParams[m].name === paramInfo.name) {
paramValue = actualParams[m].value;
}
}
// If not, use the next available anonymous macro call parameter
while(nextAnonParameter < actualParams.length && actualParams[nextAnonParameter].name) {
nextAnonParameter++;
}
if(paramValue === undefined && nextAnonParameter < actualParams.length) {
paramValue = actualParams[nextAnonParameter++].value;
}
// If we've still not got a value, use the default, if any
paramValue = paramValue || paramInfo["default"] || "";
// Save the parameter
args.push(paramValue);
}
// If not, use the next available anonymous macro call parameter
while(nextAnonParameter < actualParams.length && actualParams[nextAnonParameter].name) {
nextAnonParameter++;
}
if(paramValue === undefined && nextAnonParameter < actualParams.length) {
paramValue = actualParams[nextAnonParameter++].value;
}
// If we've still not got a value, use the default, if any
paramValue = paramValue || paramInfo["default"] || "";
// Save the parameter
args.push(paramValue);
}
else for(var i=0; i<actualParams.length; ++i) {
args.push(actualParams[i].value);
}
return macro.run.apply(this,args)
} else {

View File

@@ -173,11 +173,11 @@ exports.tiddlerExists = function(title) {
Generate an unused title from the specified base
*/
exports.generateNewTitle = function(baseTitle) {
var c = 0;
do {
var title = baseTitle + (c ? " " + (c + 1) : "");
c++;
} while(this.tiddlerExists(title));
var c = 0,
title = baseTitle;
while(this.tiddlerExists(title)) {
title = baseTitle + " " + (++c);
};
return title;
};
@@ -210,6 +210,23 @@ exports.addTiddler = function(tiddler) {
this.enqueueTiddlerEvent(title);
};
/*
Like addTiddler() except it will silently reject any plugin tiddlers that are older than the currently loaded version. Returns true if the tiddler was imported
*/
exports.importTiddler = function(tiddler) {
var existingTiddler = this.getTiddler(tiddler.fields.title);
// Check if we're dealing with a plugin
if(tiddler && tiddler.hasField("plugin-type") && tiddler.hasField("version") && existingTiddler && existingTiddler.hasField("plugin-type") && existingTiddler.hasField("version")) {
// Reject the incoming plugin if it is older
if($tw.utils.checkVersions(existingTiddler.fields.version,tiddler.fields.version)) {
return false;
}
}
// Fall through to adding the tiddler
this.addTiddler(tiddler);
return true;
};
/*
Return a hashmap of the fields that should be set when a tiddler is created
*/
@@ -238,14 +255,23 @@ exports.getModificationFields = function() {
};
/*
Return a sorted array of non-system tiddler titles, optionally filtered by a tag
Return a sorted array of tiddler titles. Options include:
sortField: field to sort by
excludeTag: tag to exclude
includeSystem: whether to include system tiddlers (defaults to false)
*/
exports.getTiddlers = function(sortField,excludeTag) {
sortField = sortField || "title";
var tiddlers = [], t, titles = [];
exports.getTiddlers = function(options) {
options = options || {};
var self = this,
sortField = options.sortField || "title",
tiddlers = [], t, titles = [];
for(t in this.tiddlers) {
if($tw.utils.hop(this.tiddlers,t) && !this.isSystemTiddler(t) && (!excludeTag || !this.tiddlers[t].hasTag(excludeTag))) {
tiddlers.push(this.tiddlers[t]);
if($tw.utils.hop(this.tiddlers,t)) {
if(options.includeSystem || !this.isSystemTiddler(t)) {
if(!options.excludeTag || !this.tiddlers[t].hasTag(excludeTag)) {
tiddlers.push(this.tiddlers[t]);
}
}
}
}
tiddlers.sort(function(a,b) {
@@ -268,7 +294,7 @@ exports.getTiddlers = function(sortField,excludeTag) {
};
exports.countTiddlers = function(excludeTag) {
var tiddlers = this.getTiddlers(null,excludeTag);
var tiddlers = this.getTiddlers({excludeTag: excludeTag});
return $tw.utils.count(tiddlers);
};
@@ -306,12 +332,17 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive) {
});
};
exports.forEachTiddler = function(/* [sortField,[excludeTag,]]callback */) {
/*
For every tiddler invoke a callback(title,tiddler) with `this` set to the wiki object. Options include:
sortField: field to sort by
excludeTag: tag to exclude
includeSystem: whether to include system tiddlers (defaults to false)
*/
exports.forEachTiddler = function(/* [options,]callback */) {
var arg = 0,
sortField = arguments.length > 1 ? arguments[arg++] : null,
excludeTag = arguments.length > 2 ? arguments[arg++] : null,
options = arguments.length >= 2 ? arguments[arg++] : {},
callback = arguments[arg++],
titles = this.getTiddlers(sortField,excludeTag),
titles = this.getTiddlers(options),
t, tiddler;
for(t=0; t<titles.length; t++) {
tiddler = this.tiddlers[titles[t]];
@@ -740,7 +771,7 @@ exports.parseTextReference = function(title,field,index,options) {
if(text === undefined) {
text = "";
}
return this.parseText("text/vnd.tiddlywiki",text,options);
return this.parseText("text/vnd.tiddlywiki",text.toString(),options);
} else if(index) {
text = this.extractTiddlerDataItem(title,index,"");
return this.parseText("text/vnd.tiddlywiki",text,options);
@@ -909,7 +940,7 @@ exports.search = function(text,options) {
searchTermsRegExps = [new RegExp("(" + $tw.utils.escapeRegExp(text) + ")",flags)];
}
} else {
terms = text.replace(/( +)/g," ").split(" ");
terms = text.split(/ +/);
if(terms.length === 1 && terms[0] === "") {
searchTermsRegExps = null;
} else {

View File

@@ -0,0 +1,5 @@
title: $:/core/templates/MOTW.html
\rules only filteredtranscludeinline transcludeinline entity
<!-- The following comment is called a MOTW comment and is necessary for the TiddlyIE Internet Explorer extension -->
<!-- saved from url=(0021)http://tiddlywiki.com -->&#13;&#10;

View File

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

View File

@@ -6,7 +6,7 @@ title: $:/core/templates/store.area.template.html
`</div>`
</$reveal>
<$reveal type="match" state="$:/isEncrypted" text="yes">
`<!------------- Encrypted tiddlers --------->`
`<!--~~ Encrypted tiddlers ~~-->`
`<pre id="encryptedStoreArea" type="text/plain" style="display:none;">`
<$encrypt filter=<<saveTiddlerFilter>>/>
`</pre>`

View File

@@ -2,8 +2,9 @@ title: $:/core/templates/tiddlywiki5.html
\rules only filteredtranscludeinline transcludeinline
<!doctype html>
<html>
{{$:/core/templates/MOTW.html}}<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!-- Force IE standards mode for Intranet and HTA - should be the first meta -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="application-name" content="TiddlyWiki" />
<meta name="generator" content="TiddlyWiki" />
@@ -13,38 +14,39 @@ title: $:/core/templates/tiddlywiki5.html
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="format-detection" content="telephone=no" />
<meta name="copyright" content="{{$:/core/copyright.txt}}" />
<link rel="shortcut icon" href="favicon.ico">
<title>{{$:/core/wiki/title}}</title>
<!----------- This is a Tiddlywiki file. The points of interest in the file are marked with this pattern ----------->
<!--~~ This is a Tiddlywiki file. The points of interest in the file are marked with this pattern ~~-->
<!----------- Raw markup ----------->
<!--~~ Raw markup ~~-->
{{{ [tag[$:/core/wiki/rawmarkup]] ||$:/core/templates/plain-text-tiddler}}}
</head>
<body class="tw-body">
<!----------- Static styles ----------->
<!--~~ Static styles ~~-->
<div id="styleArea">
{{{ [is[system]type[text/css]] ||$:/core/templates/css-tiddler}}}
</div>
<!----------- Static content for Google and browsers without JavaScript ----------->
<!--~~ Static content for Google and browsers without JavaScript ~~-->
<noscript>
<div id="splashArea">
{{$:/core/templates/static.area}}
</div>
</noscript>
<!----------- Ordinary tiddlers ----------->
<!--~~ Ordinary tiddlers ~~-->
{{$:/core/templates/store.area.template.html}}
<!----------- Library modules ----------->
<!--~~ Library modules ~~-->
<div id="libraryModules" style="display:none;">
{{{ [is[system]type[application/javascript]library[yes]] ||$:/core/templates/javascript-tiddler}}}
</div>
<!----------- Boot kernel prologue ----------->
<!--~~ Boot kernel prologue ~~-->
<div id="bootKernelPrefix" style="display:none;">
{{ $:/boot/bootprefix.js ||$:/core/templates/javascript-tiddler}}
</div>
<!----------- Plugin modules ----------->
<!--~~ Plugin modules ~~-->
<div id="modules" style="display:none;">
{{{ [is[system]type[application/javascript]has[module-type]] ||$:/core/templates/module-tiddler}}}
</div>
<!----------- Boot kernel ----------->
<!--~~ Boot kernel ~~-->
<div id="bootKernel" style="display:none;">
{{ $:/boot/boot.js ||$:/core/templates/javascript-tiddler}}
</div>

View File

@@ -2,22 +2,13 @@ title: $:/core/ui/ControlPanel/Basics
tags: $:/tags/ControlPanel
caption: Basics
! Settings
|TiddlyWiki version |''<<version>>'' |
|[[Title of this TiddlyWiki|SiteTitle]] |<$edit-text tiddler="SiteTitle" default="" tag="input"/> |
|[[Subtitle|SiteSubtitle]] |<$edit-text tiddler="SiteSubtitle" default="" tag="input"/> |
|[[Username for signing edits|$:/status/UserName]] |<$edit-text tiddler="$:/status/UserName" default="" tag="input"/> |
|[[Animation duration|$:/config/AnimationDuration]] |<$edit-text tiddler="$:/config/AnimationDuration" default="" tag="input"/> |
|[[DefaultTiddlers|$:/DefaultTiddlers]] |Choose which tiddlers are displayed at startup:<br> <$edit-text tag="textarea" tiddler="$:/DefaultTiddlers"/> |
! Info
!! Your Stuff
* Number of tiddlers: <$count filter="[!is[system]]"/>
!! TiddlyWiki's Stuff
* Number of system tiddlers: <$count filter="[is[system]]"/>
* Number of shadow tiddlers: <$count filter="[is[shadow]]"/>
** Number of over-ridden shadow tiddlers: <$count filter="[!is[system]is[shadow]]"/>
|Tiddlers |''<$count filter="[!is[system]]"/>'' |
|System tiddlers |''<$count filter="[is[system]]"/>'' |
|Shadow tiddlers |''<$count filter="[is[shadow]]"/>'' |
|Overridden shadow tiddlers |''<$count filter="[!is[system]is[shadow]]"/>'' |

View File

@@ -2,6 +2,6 @@ title: $:/core/ui/ControlPanel/Plugins
tags: $:/tags/ControlPanel
caption: Plugins
<table><tbody><tr><th>Title</th><th>Description</th></tr><$list filter="[!has[draft.of]has[plugin-type]sort[title]]"><tr><td><$link to={{!!title}}><$view field="title"/></$link></td><td><$view field="description"/></td></tr></$list>
<table><tbody><tr><th>Title</th><th>Description</th><th>Version</th></tr><$list filter="[!has[draft.of]has[plugin-type]sort[title]]"><tr><td><$link to={{!!title}}><$view field="title"/></$link></td><td><$view field="description"/></td><td><$view field="version"/></td></tr></$list>
</tbody>
</table>

View File

@@ -1,7 +1,6 @@
title: $:/core/ui/EditTemplate
modifier: JeremyRuston
\define frame-classes()
tw-tiddler-frame tw-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
\end
<div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] +[tag[$:/tags/EditTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list></div>
<$set name="storyTiddler" value=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] +[tag[$:/tags/EditTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list></div></$set>

View File

@@ -1,6 +1,9 @@
title: $:/core/ui/EditTemplate/body
tags: $:/tags/EditTemplate
\define prompt()
Type the text for this tiddler
\end
<$reveal state="$:/ShowEditPreview" type="match" text="yes">
//<$transclude tiddler="$:/core/ui/EditorHint"/>// <$button type="set" set="$:/ShowEditPreview" setTo="no">hide preview</$button>
<div class="tw-tiddler-preview">
@@ -8,11 +11,11 @@ tags: $:/tags/EditTemplate
<$transclude />
</div>
<div class="tw-tiddler-preview-edit">
<$edit field="text" class="tw-edit-texteditor"/>
<$edit field="text" class="tw-edit-texteditor" placeholder=<<prompt>>/>
</div>
</div>
</$reveal>
<$reveal state="$:/ShowEditPreview" type="nomatch" text="yes">
//<$transclude tiddler="$:/core/ui/EditorHint"/>// <$button type="set" set="$:/ShowEditPreview" setTo="yes">show preview</$button>
<$edit field="text" class="tw-edit-texteditor"/>
<$edit field="text" class="tw-edit-texteditor" placeholder=<<prompt>>/>
</$reveal>

View File

@@ -13,5 +13,21 @@ title: $:/core/ui/PageMacros
</$reveal>
</$list>
</div>
\end
\define wikitext-example(src)
```
$src$
```
Renders as:
$src$
In HTML:
$$$text/vnd.tiddlywiki>text/html
$src$
$$$
\end
{{$:/core/ui/PageTemplate}}

View File

@@ -0,0 +1,5 @@
title: $:/core/ui/PageStylesheet
<$list filter="[is[shadow]tag[$:/tags/stylesheet]] [!is[shadow]tag[$:/tags/stylesheet]]">
<$transclude/>
</$list>

View File

@@ -6,7 +6,7 @@ tags: $:/tags/PageTemplate
<div class="tw-subtitle">{{SiteSubtitle}}</div>
<div class="tw-page-controls">
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/PageControls]] [!is[shadow]!has[draft.of]tag[$:/tags/PageControls]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/PageControls]] [!is[shadow]!has[draft.of]tag[$:/tags/PageControls]] +[tag[$:/tags/PageControls]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</div>
{{$:/core/ui/SideBarLists}}

View File

@@ -6,7 +6,7 @@ caption: Tools
---
{{$:/snippets/themeswitcher}}
{{$:/snippets/minithemeswitcher}}
---

View File

@@ -1,9 +1,8 @@
title: $:/core/ui/ViewTemplate
modifier: JeremyRuston
\define frame-classes()
tw-tiddler-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
\end
<$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] +[tag[$:/tags/ViewTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
<$set name="storyTiddler" value=<<currentTiddler>>><$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] +[tag[$:/tags/ViewTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</div>
</$tiddler></$set>
</$tiddler></$set></$set>

View File

@@ -2,7 +2,7 @@ title: GettingStarted
Welcome to TiddlyWiki, the non-linear personal web notebook.
To get started, first verify that you can save changes successfully - see http://five.tiddlywiki.com/ for detailed instructions.
To get started, first verify that you can save changes successfully - see http://tiddlywiki.com/ for detailed instructions.
Then you can:
@@ -10,4 +10,4 @@ Then you can:
* Save changes using the 'download' button in the sidebar
* Edit [[DefaultTiddlers|$:/DefaultTiddlers]] to determine which tiddlers appear when you open this wiki
* Edit the SiteTitle and SiteSubtitle
* Learn more about [[WikiText|http://five.tiddlywiki.com/static/WikiText.html]]
* Learn more about [[WikiText|http://tiddlywiki.com/static/WikiText.html]]

View File

@@ -0,0 +1,8 @@
title: $:/snippets/minithemeswitcher
Current theme: <$link to={{$:/theme}}><$view tiddler={{$:/theme}} field="name"/></$link>
<$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>
</$list>
</$linkcatcher>

View File

@@ -1,8 +1,8 @@
title: $:/snippets/themeswitcher
Current theme: {{$:/theme}}
Current theme: <$link to={{$:/theme}}><$view tiddler={{$:/theme}} field="name"/></$link>
<$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>
<$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"/>'' <$view field="description" format="text"/></$link></div>
</$list>
</$linkcatcher>
</$linkcatcher>

View File

@@ -0,0 +1,2 @@
title: $:/GoogleAnalyticsAccount

View File

@@ -0,0 +1,2 @@
title: $:/GoogleAnalyticsDomain

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -0,0 +1,2 @@
title: $:/favicon.ico
type: image/x-icon

View File

@@ -1,4 +1,3 @@
title: SiteSubtitle
modifier: JeremyRuston
Tahoe-LAFS edition

View File

@@ -1,4 +1,3 @@
title: SiteTitle
modifier: JeremyRuston
TiddlyWiki5

View File

@@ -1,5 +1,5 @@
title: HelloThere
This is TiddlyWiki5's browser-based test runner. See the bottom of this page for the test results.
This is TiddlyWiki's browser-based test runner for version <<version>>. See the bottom of this page for the test results.
http://five.tiddlywiki.com/
http://tiddlywiki.com/

View File

@@ -1,4 +1,3 @@
title: SiteSubtitle
modifier: JeremyRuston
browser-based test runner

View File

@@ -1,4 +1,3 @@
title: SiteTitle
modifier: JeremyRuston
TiddlyWiki5

View File

@@ -113,6 +113,15 @@ describe("WikiText parser tests", function() {
});
it("should parse hard linebreak areas", function() {
expect(parse("\"\"\"Something\nin the\nway she moves\n\"\"\"\n\n")).toEqual(
[ { type : 'element', tag : 'p', children : [ { type : 'text', text : 'Something' }, { type : 'element', tag : 'br' }, { type : 'text', text : 'in the' }, { type : 'element', tag : 'br' }, { type : 'text', text : 'way she moves' }, { type : 'element', tag : 'br' } ] } ]
);
});
});
})();

View File

@@ -1,6 +1,5 @@
modified: 201305070956
title: Acknowledgements
modifier: JeremyRuston
tags: introduction
TiddlyWiki5 wouldn't be possible without the ongoing support of the TiddlyWiki user and developer community. Their attention and feedback has made it possible to gain an understanding of what is wanted from the product, and their passion for it has taught me that it is worth the investment that I am making.

View File

@@ -1,7 +1,5 @@
created: 20130909151600000
creator: JeremyRuston
modified: 20131128103349581
modifier: JeremyRuston
modified: 20131218094207015
tags: community
title: Community
type: text/vnd.tiddlywiki
@@ -21,11 +19,13 @@ The TiddlyWiki discussion groups are mailing lists for talking about TiddlyWiki:
! Resources for TiddlyWiki5
* [[TW5 Mall|http://www.giffmex.org/tw5mall.htm]] -- DaveGifford's growing catalogue of hints and tips
* A [[guide to creating a fixed top menu|https://dl.dropboxusercontent.com/u/2638511/TW5_Test.htm]] from TonGerner
* A [[guide to creating a top menu and toolbars|http://tw5toolbar.tiddlyspot.com/]] from TonGerner
* A [[TW5Magick|http://tw5magick.tiddlyspot.com/]] -- a collection of hints and tips from StephanHradek
* A new theme from [[BobRobison|http://tw5gray.tiddlyspot.com]]
* [[Bestrew|http://nocategories.net/tiddlywiki/bestrew.html]] -- DylanKinnett's adaptation of TiddlyWiki5 as a writers manuscript submission tracker
* [[tw5-zh|http://tw5-zh.tiddlyspot.com]], a Chinese translation of TiddlyWiki5 by BramChen
* [[Coding for TiddlyWiki5|http://cjhunt.github.io]], an introduction to developing extensions and plugins from ChrisHunt
* [[Hosting TiddlyWiki5 on GoogleDrive|https://googledrive.com/host/0B51gSXixfJ2Qb0I4R2M4MWJVMlU]] from TonyChing
! Blog posts and articles about TiddlyWiki5
@@ -34,5 +34,7 @@ The TiddlyWiki discussion groups are mailing lists for talking about TiddlyWiki:
! Examples of TiddlyWiki5 being used in the wild
|!Site |!Description |
|http://freedombits.org |A manifesto for the preservation of free speech through the exchange of randomized data |
; http://freedombits.org
: A manifesto for the preservation of free speech through the exchange of randomized data
; http://giffmex.org/nt/1johnnotebase.html
: A study notebook for the Bible

View File

@@ -1,15 +1,14 @@
created: 201311011114
creator: JeremyRuston
modified: 201311011114
modifier: JeremyRuston
created: 20131101111400000
modified: 20131218121606089
tags: introduction
title: Contributing
type: text/vnd.tiddlywiki
TiddlyWiki5 welcomes contributions to its code and documentation via [[GitHub|https://github.com/Jermolene/TiddlyWiki5]]. Please take a moment to read these notes to help make the process as smooth as possible.
!! Bug Reports
From the perspective of the developers, a bug report that says little more than "it doesn't work" can be frustrating. For effective debugging, we need as much information as possible. At a minimum, please try to include:
For effective debugging, we need as much information as possible. At a minimum, please try to include:
* A descriptive title
* A summary
@@ -17,6 +16,8 @@ From the perspective of the developers, a bug report that says little more than
* Expected behaviour
* Context (OS, browser etc.)
Consider also adding screenshots if it makes things clearer.
There's a lot of good material on the web about bug reports:
* http://mhay68.tumblr.com/post/1648223018/what-makes-a-good-bug-report
@@ -24,10 +25,10 @@ There's a lot of good material on the web about bug reports:
!! Pull Requests
Like other OpenSource projects, TiddlyWiki5 needs a signed contributor license agreement from individual contributors before contributions of code can be accepted. This is a legal agreement that allows contributors to assert that they own the copyright of their contribution, and that they agree to license it to the UnaMesa Association (the legal entity that owns TiddlyWiki on behalf of the community).
Like other OpenSource projects, TiddlyWiki5 needs a signed contributor license agreement from individual contributors. This is a legal agreement that allows contributors to assert that they own the copyright of their contribution, and that they agree to license it to the UnaMesa Association (the legal entity that owns TiddlyWiki on behalf of the community).
* For individuals use: [[CLA-individual|https://github.com/Jermolene/TiddlyWiki5/tree/master/licenses/cla-individual.md]]
* For entities use: [[CLA-entity|https://github.com/Jermolene/TiddlyWiki5/tree/master/licenses/cla-entity.md]]
* For individuals use: [[licenses/CLA-individual|https://github.com/Jermolene/TiddlyWiki5/tree/master/licenses/cla-individual.md]]
* For entities use: [[licenses/CLA-entity|https://github.com/Jermolene/TiddlyWiki5/tree/master/licenses/cla-entity.md]]
//This is a first pass at a CLA for TiddlyWiki. Please let us know if we missed something important. If we do have to make essential changes to the CLA, there is a possibility that all contributors will need to sign it again//

View File

@@ -1,65 +1,39 @@
created: 201308241418
creator: JeremyRuston
modified: 201308251303
modifier: JeremyRuston
created: 20130824141800000
modified: 20131212093542990
tags: introduction
title: Docs
type: text/vnd.tiddlywiki
This is the main documentation hub for TiddlyWiki. See also the DeveloperDocs.
\define bulletList(tag)
{{$tag$}}
! Editions
TiddlyWiki5 can be used via these editions:
<$list filter="[tag[edition]sort[title]]" type="ul"/>
<ul><$list filter="[tag[$tag$]]"><li><$link to={{!!title}}><$view field="title"/></$link></li></$list></ul>
\end
This is the main documentation hub for TiddlyWiki. See also [[TiddlyWiki for Developers]].
! How to use ~TiddlyWiki5
<$list filter="[tag[howto]sort[title]]" type="ul"/>
<<bulletList "howto">>
! Concepts
The core concepts underlying TiddlyWiki are:
* [[Tiddlers]]
* [[Wiki]]
* TiddlyWiki
* WikiText
The machinery tying those concepts together includes:
* TiddlerFilters
* TiddlerFields
* TiddlerTemplates
* DataTiddlers
* ContentType
* SystemTiddlers
* [[Plugins]]
* [[Modules]] and [[ModuleType]]
<<bulletList "concepts">>
! Wiki Text Rules
These are the individual rules that make up WikiText:
<$list filter="[tag[wikitextrule]sort[title]]" type="ul"/>
<<bulletList "wikitext">>
! Widgets
Widgets give WikiText dynamic functionality:
<$list filter="[tag[widget]sort[title]]" type="ul"/>
<<bulletList "widget">>
! Commands
{{command}}
<$list filter="[tag[command]sort[title]]" type="ul"/>
<<bulletList "command">>
! Tips
{{tips}}
<$list filter="[tag[tips]sort[title]]" type="ul"/>
<<bulletList "tips">>
! Miscellaneous

View File

@@ -1,15 +1,13 @@
created: 20131119194500000
creator: JeremyRuston
modified: 20131129094606811
modifier: JeremyRuston
modified: 20131212094150331
tags: introduction
title: Download
type: text/vnd.tiddlywiki
Download single file editions of version ''<<version>>'' of TiddlyWiki5:
Download single file editions of version ''<<version>>'' of TiddlyWiki:
|{{$:/editions/tw5.com/snippets/download-empty-button}}|Get started with an empty wiki |
|{{$:/snippets/download-wiki-button}}|Download a full copy of this site, including all the documentation |
For more advanced configurations, you can run [[TiddlyWiki5 on Node.js]].
For more advanced configurations, you can run [[TiddlyWiki on Node.js]].

View File

@@ -1,7 +1,5 @@
created: 201309091551
creator: JeremyRuston
modified: 201309091551
modifier: JeremyRuston
title: Examples
Examples of TiddlyWiki5 being used in the wild:

View File

@@ -1,12 +1,10 @@
created: 20130822172800000
creator: JeremyRuston
modified: 20131129163630584
modifier: JeremyRuston
modified: 20131213100612914
tags: introduction
title: Features
type: text/vnd.tiddlywiki
* The ability to save changes on almost any desktop HTML5 compatible-browser, with custom apps to enable [[Saving on iPad/iPhone]] and [[Android|How to use TiddlyWiki5 as a standalone HTML file with AndTidWiki]], and a cross-platform [[Firefox extension|Saving with TiddlyFox]] that even runs on Android
* The ability to save changes on almost any desktop HTML5 compatible-browser, with custom apps to enable [[Saving on iPad/iPhone]] and [[Android|Saving on Android]], and a cross-platform [[Firefox extension|Saving with TiddlyFox]] that even runs on Android
* [[Bitmap images|Motovun Jack.jpg]] and [[SVG images|UsingSVG]] are first-class citizens alongside text
* Concise and expressive WikiText that generates semantic HTML
* Integrated [[AES encryption|Saving with Encryption]]
@@ -16,14 +14,14 @@ type: text/vnd.tiddlywiki
* Clone existing tiddlers (for example, <$button message="tw-new-tiddler" param=<<currentTiddler>>>clone this tiddler</$button>)
* TiddlyWiki is [[surprisingly scalable|Scalability]] to many thousands of tiddlers and megabytes of content
* Try out the <$button message="tw-full-screen">full screen support</$button>
* Explore the [[D3.js visualisation plugin|http://five.tiddlywiki.com/d3demo.html]]
* [[CodeMirror support via a plugin|http://five.tiddlywiki.com/codemirrordemo.html]]
* [[Markdown support via a plugin|http://five.tiddlywiki.com/markdowndemo.html]]
* Explore the [[D3.js visualisation plugin|http://tiddlywiki.com/d3demo.html]]
* [[CodeMirror support via a plugin|http://tiddlywiki.com/codemirrordemo.html]]
* [[Markdown support via a plugin|http://tiddlywiki.com/markdowndemo.html]]
* Many internal improvements:
** TiddlyWiki can now be run under [[Node.js]] as well as in the browser, allowing it to be used as a personal web server
** An elegant [[microkernel architecture|PluginMechanism]], that allows infinite customisation by replacing and augmenting the core modules
** TiddlyWiki5 can directly build both itself and previous (2.x.x) versions of TiddlyWiki from their constituent separate files, without needing external tools
** Run the TiddlyWiki5 [[test suite|TestingMechanism]] from http://five.tiddlywiki.com/test.html
** TiddlyWiki version 5 can directly build both itself and previous (2.x.x) versions of TiddlyWiki from their constituent separate files, without needing external tools
** Run the TiddlyWiki [[test suite|TestingMechanism]] from http://tiddlywiki.com/test.html
* Last but not least, TiddlyWiki is a rare example of a practical [[quine|Quine]]
The deep internal changes mean that TiddlyWiki5 is not compatible with previous versions, using different plugins, themes and so on. Content prepared for previous versions of TiddlyWiki will need massaging to work properly in TiddlyWiki5. When asking or searching for help be sure to specify TiddlyWiki5 (or TW5).
The deep internal changes mean that TiddlyWiki version 5 is not compatible with previous versions, using different plugins, themes and so on. Content prepared for previous versions of TiddlyWiki will need massaging to work properly. When asking or searching for help be sure to specify TiddlyWiki5 (or TW5).

View File

@@ -0,0 +1,7 @@
created: 20131213101024997
modified: 20131213101420914
title: Future of TiddlyWiki
type: text/vnd.tiddlywiki
TiddlyWiki is designed with the long term needs of its users in mind. Because it is OpenSource and needs no infrastructure, we can be confident that all we'll need to access a TiddlyWiki file even in the far future is an ordinary HTML browser. If you're starting to use TiddlyWiki at the beginning of your career you can be confident that it will carry you through to retirement.

View File

@@ -1,11 +1,12 @@
created: 20131129090249275
creator: JeremyRuston
modified: 20131129171927975
modifier: JeremyRuston
modified: 20131215165204528
tags: introduction
title: GettingStarted
type: text/vnd.tiddlywiki
TiddlyWiki is highly flexible, and there are many different ways to use it. Here we're focusing on using it as a standalone file in the browser, which is a good choice for most users as it doesn't require any special knowledge or tools. For more options you can also run [[TiddlyWiki5 on Node.js]].
TiddlyWiki is highly flexible, and there are many different ways to use it. Here we're focusing on using it as a standalone file in the browser, which is a good choice for most users as it doesn't require any special knowledge or tools. For more options you can also run [[TiddlyWiki on Node.js]].
[[Video Tutorials]] are available, too.
! The 'works anywhere' method
@@ -19,8 +20,11 @@ Saving changes as described above is quite inconvenient because of the degree of
! Other ways of saving changes
[[Saving with Encryption]] explains how to use TiddlyWiki5's built-in encryption to protect your content with a password.
[[Saving with Encryption]] explains how to use TiddlyWiki's built-in encryption to protect your content with a password.
You can also try:
* [[Saving on iPad/iPhone]]
* [[Saving on iPad/iPhone]] with the custom ''TWEdit'' app
* [[Saving on Android]] with the custom ''~AndTidWiki'' app
* [[Saving on InternetExplorer]] with the [[TiddlyIE]] extension, or via the [[Windows HTA Hack]]
* [[Saving on TiddlySpot]], a free service that lets you use TiddlyWiki online

View File

@@ -1,20 +1,21 @@
created: 20130822170200000
creator: JeremyRuston
modified: 20131130073307697
modifier: JeremyRuston
modified: 20131221173550176
tags: introduction
title: HelloThere
type: text/vnd.tiddlywiki
Welcome to TiddlyWiki5, a reboot of TiddlyWiki, the non-linear personal web notebook first released in 2004. It is a complete interactive wiki in JavaScript that can be run from a [[single HTML file in the browser|SingleFileApplication]] or as a powerful [[Node.js application|Node.js]].
Welcome to TiddlyWiki, a complete interactive wiki in JavaScript. It can be used as a [[single HTML file in the browser|SingleFileApplication]] or as a powerful [[Node.js application|Node.js]]. It is highly customisable: the entire user interface is itself implemented in hackable WikiText.
TiddlyWiki5 is currently in alpha at version //<<version>>// (see the detailed ReleaseHistory). There is a RoadMap for moving to beta and getting to the full release. It is a great time to get involved and support the future development of TiddlyWiki5.
This is version <<version>> of TiddlyWiki, a major reboot designed [[for the next 25 years|Future of TiddlyWiki]]. It is currently in beta (see the detailed ReleaseHistory). There is a RoadMap for moving to the full release. It is a great time to get involved and support the future development of TiddlyWiki.
//TiddlyWiki is a free, open source project that depends on [[your love and support|HelpingTiddlyWiki]] for its survival//.
<div class="tw-message-box">
<a class="tw-message-icon" href="http://tiddlywiki.com/" target="_blank">{{TiddlyWiki Classic.png}}</a>
The deep internal improvements mean that TiddlyWiki5 is not fully compatible with older versions. Existing content will need massaging, while plugins and themes will have to be completely rewritten. The upgrade path will get smoother as TiddlyWiki5 matures.
The original TiddlyWiki Classic is still available at http://tiddlywiki.com/.
!! TiddlyWikiClassic - http://classic.tiddlywiki.com
On this site, unless noted otherwise, "~TiddlyWiki" refers to the new version 5, and "~TiddlyWikiClassic" is used to identify the older version.
The deep internal improvements mean that the new version of TiddlyWiki is not fully compatible with TiddlyWikiClassic. Existing content will need massaging, while plugins and themes will have to be completely rewritten. The upgrade path will get smoother as the new version matures.
</div>

View File

@@ -1,7 +1,5 @@
created: 20130825160500000
creator: JeremyRuston
modified: 20131126195146799
modifier: JeremyRuston
modified: 20131206172505397
tags: community
title: HelpingTiddlyWiki
type: text/vnd.tiddlywiki
@@ -17,6 +15,14 @@ OpenSource projects like TiddlyWiki thrive on the feedback and engagement of use
! Help improve the documentation and code
There are many ways you can contribute to TiddlyWiki:
* Writing tutorials
* Contributing to the documentation on tiddlywiki.com
* Making video screencasts
* Curating relevant links, hints and tips on a wiki
The main TiddlyWiki documentation and code lives on GitHub, and welcomes [[contributions|Contributing]]:
* https://github.com/Jermolene/TiddlyWiki5

View File

@@ -1,7 +1,5 @@
created: 20131128075743966
creator: JeremyRuston
modified: 20131128093317966
modifier: JeremyRuston
tags: introduction
title: Philosophy of Tiddlers
type: text/vnd.tiddlywiki

View File

@@ -1,9 +1,8 @@
created: 201311081754007
creator: JeremyRuston
modified: 201311081754007
modifier: JeremyRuston
title: Release 5.0.0-alpha.11
tags: releasenote
released: 201311081806
This release is the culmination of a large scale refactoring of the widget mechanism of TiddlyWiki5. There are several changes to be aware of if upgrading from earlier versions:

View File

@@ -1,10 +1,8 @@
created: 201311081854007
creator: JeremyRuston
modified: 201311081854007
modifier: JeremyRuston
title: Release 5.0.0-alpha.12
tags: releasenote
released: 201311082141
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.0-alpha.11...v5.0.0-alpha.12]]//

View File

@@ -1,9 +1,8 @@
created: 201311091122007
creator: JeremyRuston
modified: 201311091122007
modifier: JeremyRuston
title: Release 5.0.0-alpha.13
tags: releasenote
released: 201311091927
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.0-alpha.12...v5.0.0-alpha.13]]//

View File

@@ -1,9 +1,8 @@
created: 201311101922007
creator: JeremyRuston
modified: 201311101922007
modifier: JeremyRuston
title: Release 5.0.0-alpha.14
tags: releasenote
released: 201311102315
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.0-alpha.13...v5.0.0-alpha.14]]//

View File

@@ -1,9 +1,8 @@
created: 201311122050007
creator: JeremyRuston
modified: 201311122050007
modifier: JeremyRuston
title: Release 5.0.0-alpha.15
tags: releasenote
released: 201311191221
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.0-alpha.14...v5.0.0-alpha.15]]//

View File

@@ -1,10 +1,9 @@
created: 20131119125600007
creator: JeremyRuston
modified: 20131130095531749
modifier: JeremyRuston
tags: releasenote
title: Release 5.0.0-alpha.16
type: text/vnd.tiddlywiki
released: 201311301325
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.0-alpha.15...v5.0.0-alpha.16]]//

View File

@@ -1,10 +1,9 @@
created: 20131130151600007
creator: JeremyRuston
modified: 20131130151631749
modifier: JeremyRuston
tags: releasenote
title: Release 5.0.0-alpha.17
type: text/vnd.tiddlywiki
released: 201311301519
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.0-alpha.16...v5.0.0-alpha.17]]//

View File

@@ -0,0 +1,26 @@
created: 20131201132300007
modified: 20131206161343895
tags: releasenote
title: Release 5.0.1-alpha
type: text/vnd.tiddlywiki
released: 201312061753
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.0-alpha.17...v5.0.1-alpha]]//
!! Improvements
* Changes to the importing process to enable a smoother [[Upgrading]] process
** Ignores attempts to import plugins that are older than currently installed plugins
** System tiddlers are now imported as usual
* If `$:/theme` isn't defined or refers to a missing tiddler, then fallback through ''Snow White'' to ''Vanilla''. This means that `empty.html` now defaults to ''Snow White''
* Added support for [[Block Quotes in WikiText]]
** Contributed by StephanHradek (@Skeeve on GitHub)
!! Bug fixes
* Fixed bug that was preventing `$:/tags/PageControls` tiddlers from being reordered
!! Internal changes
* Changed the [[TiddlyWiki5 Versioning]] policy
** New alpha releases will be `5.0.x-alpha`, beta releases will be `5.1.x-beta` and the final release will be `5.2.x`

View File

@@ -0,0 +1,30 @@
created: 20131211074600007
modified: 20131215142414174
tags: releasenote
title: Release 5.0.2-beta
type: text/vnd.tiddlywiki
released: 201312151436
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.1-alpha...v5.0.2-beta]]//
!! Improvements
* Added support for [[Hard Linebreaks in WikiText]]
* Added a new RadioWidget, contributed by StephanHradek (@Skeeve on GitHub)
* Two new savers for InternetExplorer, both contributed by DavidJade (@davidjade on GitHub)
** ''tiddlyie'' for [[saving with TiddlyIE|Saving with TiddlyIE]], an equivalent of TiddlyFox for InternetExplorer
** ''fsosaver'' that can [[save changes directly with InternetExplorer|Saving on InternetExplorer]] but requires the HTML file to be renamed `*.hta`
!! Bug fixes
* Fixed problem deleting tiddlers under the filesystemadaptor
* Fixed problem with transcluding fields containing lists or dates (eg, `{{!!tags}}`)
* Fixed problem with re-ordering page control tiddlers (ie tiddlers tagged `$:/tags/PageControls`)
* Update template used for deploying to TiddlyWeb
* Fixed problem with tiddler deletions via the file system adaptor
!! Internal changes
* Allowed variable number of arguments to [[JavaScript Macros]]
** Contributed by StephanHradek (@Skeeve on GitHub)
* Changed the format of plugin tiddlers to remove duplicated information (see the PluginMechanism)

View File

@@ -0,0 +1,10 @@
created: 201312151700
modified: 201312151700
tags: releasenote
title: Release 5.0.3-beta
type: text/vnd.tiddlywiki
released: 201312151700
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.2-beta...v5.0.3-beta]]//
This release includes minor bug fixes and documentation updates.

View File

@@ -0,0 +1,30 @@
created: 20131216100000000
modified: 20131221205551616
tags: releasenote
title: Release 5.0.4-prerelease
type: text/vnd.tiddlywiki
released: 201312221544
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.3-beta...v5.0.4-beta]]//
!! Improvements
* Switched to using an HTML5 placeholder for the default text of a new tiddler
* Refactored stylesheet handling so that theme tweaks are now applied immediately, and some ordering issues have been resolved
* Several improvements for running [[TiddlyWiki on Node.js]]:
** The `tiddlywiki.info` file in the root of [[wiki folder|TiddlyWikiFolders]] file is now optional, falling back to a default configuration suitable for serverside use ([[commit|https://github.com/Jermolene/TiddlyWiki5/commit/0ec2224757dd07f009246ec9ea97cd859d077e72]])
** The file system plugin now automatically creates the `tiddlers` subfolder in the [[wiki folder|TiddlyWikiFolders]]
* Added [[favicon.ico support|Using favicons]]
* Added SaveTiddlerCommand
!! Bug Fixes
* Fixed problem with tiddlers sometimes wrongly opening at the top of the story ([[commit|https://github.com/Jermolene/TiddlyWiki5/commit/b50eb8da302431cdfa7c37ac9ef1414a33d00292]])
* Fixed problem with refreshing RadioWidget
* Fixed problem with the dragger image being visible in some circumstances
* Fixed drag and drop support on InternetExplorer, contributed by DavidJade (@davidjade on GitHub)
* Fixed crash on modifying page template ([[commit|https://github.com/Jermolene/TiddlyWiki5/commit/a5f33d875b1339b08838203a4885f8a3a7d10353]])
* Updated fullscreen plugin to latest version of the API ([[commit|https://github.com/Jermolene/TiddlyWiki5/commit/638c8b207033f8cb01ac9efdca104d282fd4cffe]])
* Improved handling of double square brackets within tags (thanks to StephanHradek)
This release includes minor bug fixes and documentation updates.

View File

@@ -1,14 +1,14 @@
created: 201311091054007
creator: JeremyRuston
modified: 201311091054007
modifier: JeremyRuston
created: 20131109105400007
modified: 20131203093653197
title: ReleaseHistory
type: text/vnd.tiddlywiki
Here are the details of recent releases of TiddlyWiki5.
Here are the details of recent releases of TiddlyWiki5. See [[TiddlyWiki5 Versioning]] for details of how releases are named.
<$list filter="[tag[releasenote]!sort[created]]">
<div>
<h1><$link to={{!!title}}><$view field="title"/></$link></h1>
<div>''Release date: <$view field="released" format="date" template="DDth MMM YYYY at 0hh:0mm">TBA</$view>''</div>
<div>
<$transclude/>
</div>

View File

@@ -1,7 +1,5 @@
created: 201308221734
creator: JeremyRuston
modified: 201308221734
modifier: JeremyRuston
tags: features
title: Scalability

View File

@@ -1,7 +1,5 @@
created: 20131128090536894
creator: JeremyRuston
modified: 20131128093425922
modifier: JeremyRuston
tags: introduction
title: Structuring TiddlyWiki
type: text/vnd.tiddlywiki

View File

@@ -1,7 +1,5 @@
created: 201308230917000
creator: JeremyRuston
modified: 201311091500004
modifier: JeremyRuston
tags: community
title: TiddlyWiki Hangouts
type: text/vnd.tiddlywiki

View File

@@ -1,20 +0,0 @@
created: 20131129094353704
creator: JeremyRuston
modified: 20131129100329076
modifier: JeremyRuston
title: TiddlyWiki5 on Node.js
type: text/vnd.tiddlywiki
! Installation
For working on the command line with Node.js, you can install TiddlyWiki via [[npm|http://npmjs.org]]:
```
npm -g install tiddlywiki
```
The `-g` flag causes TiddlyWiki to be installed globally.
! Working with the TiddlyWiki5 repository
[[Working with the TiddlyWiki5 repository]] is recommended if you plan on forking the TiddlyWiki5 source code.

View File

@@ -0,0 +1,34 @@
created: 20131202102427114
modified: 20131219100250559
tags: howto
title: Upgrading
type: text/vnd.tiddlywiki
There are several methods for upgrading an existing TiddlyWiki document to a new release. There is a [[different procedure|Upgrading TiddlyWiki on Node.js]] for upgrading [[TiddlyWiki on Node.js]].
! Online upgrading
Note that none of your personal data leaves your browser with this process.
# Visit http://tiddlywiki.com/empty.html
# Drag your old TiddlyWiki HTML file into the browser window
#* Your tiddlers should be imported
# Save changes to save the new version.
This will download a file called ''empty.html'' to your computer. This file is the upgrade of your old file. You may need to open the location where ''empty.html'' was downloaded, rename ''empty.html'' with the name of the old file you are upgrading, and replace the old file by moving the new file in its place.
//For the moment you'll also need to manually update any plugins that are not included in empty.html://
># Open the control panel to the ''Plugins'' tab in your upgraded wiki
># Check the version numbers of the plugins you are using; any plugins with an older version than the version of [[$:/core]] will probably need updating
># Locate a wiki with the plugins you need to update and open the control panel ''Plugins'' tab
>#* http://tiddlywiki.com/d3demo.html for the D3 plugin
>#* http://tiddlywiki.com/codemirrordemo.html for the CodeMirror plugin
>#* http://tiddlywiki.com/markdowndemo.html for the MarkDown plugin
>#* http://tiddlywiki.com/ for most of the others
># Drag the plugin links one by one back to your own wiki. You should see the version numbers update in the control panel
># Save your wiki
! Offline upgrading
You can also download http://tiddlywiki.com/empty.html locally and perform the same drag-and-drop procedure to upgrade your files.

View File

@@ -0,0 +1,10 @@
title: SaveTiddlerCommand
tags: command
created: 20131218121606089
modified: 20131218121606089
Saves an individual tiddler in its raw text or binary format to the specified filename.
```
--savetiddler <title> <filename>
```

View File

@@ -1,7 +1,10 @@
title: ServerCommand
created: 20131219163923630
modified: 20131222150651114
tags: command
title: ServerCommand
type: text/vnd.tiddlywiki
The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage - in particular, TiddlyWiki5 is an old-school wiki in the sense that it offers no authentication.
The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage.
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`.
@@ -12,7 +15,7 @@ At the root, it serves a rendering of a specified tiddler. Away from the root, i
The parameters are:
* ''port'' - port number to serve from (defaults to "8080")
* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/tiddlywiki5.template.html")
* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/save/all")
* ''rendertype'' - the content type to which the root tiddler should be rendered (defaults to "text/plain")
* ''servetype'' - the content type with which the root tiddler should be served (defaults to "text/html")
* ''username'' - the default username for signing edits
@@ -23,5 +26,7 @@ If the password parameter is specified then the browser will prompt the user for
For example:
```
--server 8080 $:/core/tiddlywiki5.template.html text/plain text/html MyUserName
--server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd
```
To run multiple TiddlyWiki servers at the same time you'll need to put each one on a different port.

View File

@@ -1,7 +1,5 @@
created: 201308251449
creator: JeremyRuston
modified: 201308251449
modifier: JeremyRuston
tags: concepts
title: ContextTiddler

View File

@@ -1,7 +1,5 @@
created: 201308291647
creator: JeremyRuston
modified: 201308291647
modifier: JeremyRuston
tags: concepts
title: DataTiddlers

View File

@@ -1,7 +1,5 @@
created: 20131129162847412
creator: JeremyRuston
modified: 20131129162908445
modifier: JeremyRuston
tags: concepts
title: ModuleType
type: text/vnd.tiddlywiki

View File

@@ -1,7 +1,5 @@
created: 20131129162919588
creator: JeremyRuston
modified: 20131129162935396
modifier: JeremyRuston
tags: concepts
title: Modules
type: text/vnd.tiddlywiki

View File

@@ -1,7 +1,5 @@
created: 20130822080600000
creator: JeremyRuston
modified: 20131129163429930
modifier: JeremyRuston
tags: concepts
title: SystemTags
type: text/vnd.tiddlywiki

View File

@@ -1,7 +1,5 @@
created: 201308270759
creator: JeremyRuston
modified: 201311011115
modifier: JeremyRuston
tags: concepts
title: TextReference

View File

@@ -1,7 +1,5 @@
created: 20130825213300000
creator: JeremyRuston
modified: 20131129162830410
modifier: JeremyRuston
modified: 20131212095204933
tags: concepts
title: TiddlerFields
type: text/vnd.tiddlywiki
@@ -12,6 +10,7 @@ The standard fields are:
|!Field Name |!Reference |!Description |
|`title` |TitleField |{{$:/docs/fields/title}} |
|`text` |TextField |{{$:/docs/fields/text}} |
|`modified` |ModifiedField |{{$:/docs/fields/modified}} |
|`modifier` |ModifierField |{{$:/docs/fields/modifier}} |
|`created` |CreatedField |{{$:/docs/fields/created}} |

View File

@@ -1,7 +1,5 @@
created: 201308270800
creator: JeremyRuston
modified: 201311242006
modifier: JeremyRuston
tags: concepts
title: TiddlerFilters

View File

@@ -1,7 +1,5 @@
created: 20130825202900000
creator: JeremyRuston
modified: 20131128093306317
modifier: JeremyRuston
tags: concepts
title: TiddlerLinks
type: text/vnd.tiddlywiki

View File

@@ -1,7 +1,5 @@
created: 201308252135
creator: JeremyRuston
modified: 201308300907
modifier: JeremyRuston
tags: concepts
title: Tiddlers

View File

@@ -1,7 +1,5 @@
created: 20130822170700000
creator: JeremyRuston
modified: 20131129163834730
modifier: JeremyRuston
tags: concepts
title: TiddlyWiki
type: text/vnd.tiddlywiki

View File

@@ -1,7 +1,5 @@
created: 201308252136
creator: JeremyRuston
modified: 201308252136
modifier: JeremyRuston
tags: concepts
title: TiddlyWiki5

View File

@@ -1,12 +1,10 @@
created: 20130825214200000
creator: JeremyRuston
modified: 20131129095040600
modifier: JeremyRuston
modified: 20131212094058729
tags: dev
title: TiddlyWikiFolders
type: text/vnd.tiddlywiki
As well as traditional single file wikis, [[TiddlyWiki5 on Node.js]] supports wikis that are stored as a folder of individual tiddler files.
As well as traditional single file wikis, [[TiddlyWiki on Node.js]] supports wikis that are stored as a folder of individual tiddler files.
! Wiki folder files and folders

View File

@@ -1,287 +1,9 @@
created: 20131205155227468
modified: 20131205161350589
tags: concepts
type: text/vnd.tiddlywiki
title: WikiText
modified: 201310291329
\define wikitext-example(src)
```
$src$
```
Renders as:
$src$
In HTML:
$$$text/vnd.tiddlywiki>text/html
$src$
$$$
\end
type: text/vnd.tiddlywiki
WikiText is a concise, expressive way of typing a wide range of text formatting, hypertext and interactive features. It allows you to focus on writing without a complex user interface getting in the way. It is designed to be familiar for users of [[MarkDown|http://daringfireball.net/projects/markdown/]], but with more of a focus on linking and the interactive features.
! Linking in WikiText
A key capability of WikiText is the ability to make links to other tiddlers or to external websites. There are several ways of doing this:
* To link to a tiddler by title: `[[Tiddler Title]]`
* To link to a tiddler and specify the text of the link: `[[Displayed Link Title|Tiddler Title]]`
* For tiddler titles that match the CamelCase rules, just typing the title will automatically create a link
* To link to an external website, type the full URL of the site: `http://five.tiddlywiki.com/`
You can suppress a link from being recognised by preceding it with `~`. For example:
<<wikitext-example src:"* ~HelloThere is not a link
* ~http://google.com/ is not a link">>
! Paragraphs
To mark the end of a paragraph in TiddlyWiki you need to type `enter` twice to create a double line break:
```
This is the first paragraph.
And this is the second paragraph.
```
Single line breaks are ignored within paragraphs. For example:
<<wikitext-example src:"This is a
paragraph made
up of
short lines">>
! Formatting
Available character formatting includes:
* <code>&#96;backticks&#96;</code> for `code`
* `''bold''` for ''bold text''
* `//italic//` for //italic text//
* `__underscore__` for __underscored text__
* `^^superscript^^` for ^^superscript^^ text
* `,,subscript,,` for ,,subscripted,, text
* `~~strikethrough~~` for ~~strikethrough~~ text
You can also use triple backticks <code>&#96;&#96;&#96;</code> to mark code blocks:
<pre>
&#96;&#96;&#96;
This will be monospaced
&#96;&#96;&#96;
</pre>
The three backticks need to be at the start of the line and immediately followed by a newline, otherwise they won't be interpreted correctly.
Renders as:
```
This will be monospaced
```
! Transclusion
You can incorporate the content of one tiddler within another using the transclusion notation:
* `{{MyTiddler}}` transcludes a single tiddler
* `{{MyTiddler||TemplateTitle}}` displays the tiddler through a specified [[TiddlerTemplate|TiddlerTemplates]]
A similar syntax can be used to transclude a list of tiddlers matching a specified [[TiddlerFilter|TiddlerFilters]]:
```
{{{ [tag[mechanism]] }}}
{{{ [tag[mechanism]] ||TemplateTitle}}}
```
! Images
To display an image stored in a tiddler just transclude that tiddler:
```
{{Motovun Jack.jpg}}
```
Renders as:
{{Motovun Jack.jpg}}
! Lists
You can create unordered lists with `*` characters:
<<wikitext-example src:"* First list item
* Second list item
** A subitem
* Third list item
">>
Ordered lists use `#` instead of `*`:
# First item
# Second item
# Third item
You can also mix ordered and unordered list items:
<<wikitext-example src:"* To do today
*# Eat
* To get someone else to do
*# This
*# That
*## And the other
">>
You can also create HTML definition lists:
<<wikitext-example src:"; Term being defined
: Definition of that term
; Another term
: Another definition
">>
! Adding styles and classes
You can use this construction to cause the wrapped content to be assigned specified CSS classes or styles:
<<wikitext-example src:"@@.myStyle
* List One
* List Two
@@
">>
Similar syntax is used to assign styles. For example:
<<wikitext-example src:"@@background-color:red;
* List One
* List Two
@@
">>
Multiple styles and classes can be mixed. For example:
<<wikitext-example src:"@@.tw-tiddler-frame
@@width:400px;
Some text
@@
">>
You can also assign a CSS class to an individual member of a list with this notation:
<<wikitext-example src:"* List One
*.MyClass List Two
* List Three
">>
! Typographic Features
You can create an n-dash with a double hyphen `--` and an m-dash with a triple hyphen `---`. For example -- this is an example --- and so is this
You can include a horizontal rule with three or more dashes on their own on a line:
<<wikitext-example src:"
---
">>
! Macros
Macros are snippets of text that can be inserted with a concise shortcut. A macro is defined like this:
```
\define mysamplemacro(name:"Bugs Bunny",address:"Rabbit Hole Hill")
Hi, I'm $name$ and I live in $address$
\end
```
The first line of the definition specifies the macro name and any parameters. Parameters are named and can optionally have default values that are used if the parameter isn't specified at the time of calling. The body of the macro definition follows, terminated with `\end`. The macro can include parameters using the `$name$` construction.
Macro definitions must be placed at the top of a tiddler. Macros are available to the tiddler that defines them, plus any tiddlers that it transcludes.
Macros are used like this:
```
<<mysamplemacro>>
<<mysamplemacro "Donald Duck">>
<<mysamplemacro "Mickey Mouse" "Mouse House">>
```
Resulting in:
```
Hi I'm Bugs Bunny and I live in Rabbit Hole Hill
Hi I'm Donald Duck and I live in Rabbit Hole Hill
Hi I'm Mickey Mouse and I live in Mouse House
```
! HTML in WikiText
HTML tags and comments can be used directly in WikiText. For example:
```
<article class="hello">
This is my nice and simple block of text. HelloThere
<!-- This comment will not appear in the wikified output -->
</article>
```
Attributes in HTML tags can be specified as a transclusion or a macro invocation. For example, here the value of the `href` attribute will be set to the value of the tiddler MyLinkDestination:
```
<a href={{MyLinkDestination}}>link</a>
```
Here an attribute is specified as a macro invocation:
```
<a href=<<MyMacro "Brian">>>link</a>
```
! Widgets
Widgets provide rich functionality within WikiText. For example, the `<$video>` widget can be used to embed videos from YouTube, Vimeo or the Internet Archive:
```
<$video src="32001208" type="vimeo" />
```
For full details of the available widgets, see the [[Docs]].
! Headings
Headings are specified with one or more leading `!` characters:
```
! This is a level 1 heading
!! This is a level 2 heading
!!! This is a level 3 heading
```
CSS classes can be assigned to individual headings like this:
```
!.myStyle This heading has the class `myStyle`
```
! Other WikiText features
!! Typed Blocks
You can incorporate text of a different type within blocks of WikiText. For example:
```
$$$.js
return 2 + "string";
$$$
```
Renders as:
$$$.js
return 2 + "string";
$$$
See TypedBlockWikiText for more details
<$list filter="[tag[wikitext]sort[title]]"/>

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