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

Compare commits

..

213 Commits

Author SHA1 Message Date
Jermolene
1638824adc Version number update for 5.0.6-beta 2014-01-03 17:16:19 +00:00
Jermolene
79bed656bb Update release date of 5.0.6 2014-01-03 17:15:27 +00:00
Jermolene
6fcfa2738a Docs updates 2014-01-03 17:14:01 +00:00
Jermolene
47ebed87f9 Docs updates 2014-01-03 17:13:03 +00:00
Jermolene
3c35c9ecf8 Improved instructions for TiddlyFox on Android 2014-01-03 13:55:30 +00:00
Jermolene
027421f5e6 More coding style consistency 2014-01-03 10:54:00 +00:00
Jermolene
1a74e2538c Cleaning up further coding style inconsistencies that have crept in 2014-01-03 10:50:00 +00:00
Jermolene
8fc5c1d4a0 Further style tweaks to #321 2014-01-03 10:48:00 +00:00
Jermolene
1374bd9d78 Coding style fixes for #321 2014-01-03 10:43:08 +00:00
Jermolene
307b5c7d6b Merging #321 Table valign from @Skeeve 2014-01-03 10:39:55 +00:00
Jeremy Ruston
5dea8ca758 Merge pull request #324 from Skeeve/nsort
Add numeric sort filter operators
2014-01-03 02:30:12 -08:00
Jermolene
3677fdd3b0 Moved docs to right edition 2014-01-03 09:18:36 +00:00
Jermolene
5758fcb69b Add instructions for adding a Twitter Follow button 2014-01-03 09:16:58 +00:00
Jermolene
385099c4f7 Clarify references to sudo 2014-01-02 21:47:01 +00:00
Jermolene
2343bb3e5b Switch to using 127.0.0.1 in docs 2014-01-02 20:07:05 +00:00
Jermolene
b132e1023d Add error checking to $tw.utils.setStyle() 2014-01-02 19:00:46 +00:00
Jermolene
2d99f4dc15 Update copyright year 2014-01-02 10:55:19 +00:00
Stephan Hradek
c9b319c41c nsort - adapted documentation 2014-01-01 23:59:09 +01:00
Jermolene
d0cd72ed85 Docs update 2014-01-01 20:51:38 +00:00
Jermolene
4289367b7f Add some more filter examples 2014-01-01 18:37:46 +00:00
Jermolene
b76ca5dc3b Clarify use of double square brackets in default tiddlers 2014-01-01 18:27:27 +00:00
Jermolene
71b5c561f2 Docs update 2014-01-01 18:19:50 +00:00
Jermolene
6a02535d08 Docs update 2014-01-01 17:59:55 +00:00
Jermolene
87fbd988f1 Add support for running TiddlyWiki under node-webkit 2014-01-01 17:59:47 +00:00
Jermolene
3d79eb87d1 First pass at an advanced search tiddler 2013-12-31 13:11:01 +00:00
Jermolene
089a838611 Docs update 2013-12-31 11:36:51 +00:00
Jermolene
e48e7e9443 Style improvements for alltiddlers.html 2013-12-31 11:34:10 +00:00
Jermolene
b9e80a270b All-in-one static HTML support
Added a first pass at generating an all-in-one static HTML
representation of a wiki, incorporating anchor links for wiki links
2013-12-31 09:43:46 +00:00
Jermolene
44568dc6ef Hide encryption status when running on the server
A partial fix for #303
2013-12-30 15:05:07 +00:00
Jermolene
d043bdd289 Fix problem with view widget relativedate format
Fixes #319
2013-12-30 13:08:48 +00:00
Jermolene
6d6e8afb9c Add a style rule for padding paragraphs within dropdowns
Fixes #306
2013-12-30 12:38:45 +00:00
Jermolene
bb0be9e02f Correct npm upgrading instructions
Fixes #304
2013-12-30 12:16:06 +00:00
Jermolene
5dd33904e7 Update docs for double backtick syntax 2013-12-30 12:13:23 +00:00
Jeremy Ruston
2ee5093944 Merge pull request #305 from Skeeve/issue_186
added a fix for issue #186
2013-12-30 04:06:05 -08:00
Jermolene
87a553d75d Docs update 2013-12-30 11:54:56 +00:00
Jermolene
ec7dff291d Fix problem with "import" button not working
Fixes #308
2013-12-30 11:54:51 +00:00
Jeremy Ruston
de2e5adf15 Merge pull request #307 from Skeeve/issue_94
added fix for issue #94 for horizontal rules, tables and typed block
2013-12-30 03:46:16 -08:00
Jermolene
b3ad61ce20 Add a failing test for @Skeeve's upcoming #307 2013-12-30 11:45:18 +00:00
Jeremy Ruston
5eb57365b6 Merge pull request #312 from Skeeve/issue_232
fixed issue#232
2013-12-30 03:25:37 -08:00
Jermolene
c49bc2b0a6 Update docs for tables in wikitext
Fixes #314
2013-12-30 10:51:25 +00:00
Jeremy Ruston
3494dd019d Merge pull request #318 from davidjade/master
Fix for #317
2013-12-30 02:33:27 -08:00
Jermolene
784e6d17f0 Update issues policy 2013-12-30 10:16:32 +00:00
Jermolene
9efd45dda9 Docs update 2013-12-30 10:16:24 +00:00
David Jade
3b114371d0 Only set placeholders when field has no data (fixes #317) 2013-12-29 17:18:00 -08:00
Jermolene
b6f2f1e1aa Add margin around message box icons 2013-12-29 22:54:26 +00:00
Jermolene
424147234e Add TiddlyWikiClassic upgrading warning 2013-12-29 22:52:46 +00:00
Stephan Hradek
38142d2b19 Missed that I need to explicitly need to git rm … 2013-12-29 22:32:23 +01:00
Jermolene
bd7db62da0 Added support for specifying hostname for the --server command
Fixes #301
2013-12-29 13:07:06 +00:00
Jermolene
4cdfbd6b36 Docs update 2013-12-29 12:54:08 +00:00
Jermolene
ef59a3743f Fix crashes when attempting full screen mode on browsers that don't support it
Fixes #311
2013-12-29 12:54:00 +00:00
Stephan Hradek
cee1bc0863 small typofix 2013-12-29 00:19:51 +01:00
Stephan Hradek
ce8c79ecfa changed sort and sortcs to support nsort and nsortcs 2013-12-29 00:15:11 +01:00
Jermolene
ac81d9d43f Docs update
Hopefully fixing #309
2013-12-28 17:57:11 +00:00
Jermolene
d69614259f Add TiddlyWiki Classic markup to type dropdown 2013-12-28 17:56:48 +00:00
Jermolene
0e88417e62 Update version number for next release 2013-12-28 17:49:35 +00:00
Stephan Hradek
46892371cb fixed issue#232 2013-12-28 17:46:53 +01:00
Stephan Hradek
f9de55ad5f added fix for issue #94 for horizontal rules, tables and typed block 2013-12-25 23:06:42 +01:00
Stephan Hradek
81106e500d added a fix for issue #186 2013-12-25 14:31:35 +01:00
Jermolene
cfad04a5d0 Version number update for 5.0.5-beta 2013-12-24 14:22:28 +00:00
Jermolene
1aa5dedfaf Docs update 2013-12-24 14:21:35 +00:00
Jermolene
98fdd3e184 Fix problem with modal positioning on narrow screens
Fixes #302
2013-12-24 09:44:40 +00:00
Jermolene
73c5ecdaa7 Added a green version of the favicon for the static pages 2013-12-24 09:09:01 +00:00
Jermolene
eef32e70e3 Added support for dynamic favicons
Now it’s possible to edit $:/favicon.ico with the image editor, and see
the changes instantly reflected in the browser.
2013-12-24 09:08:25 +00:00
Jermolene
ad6bf4f9c5 Extend support for .ico files
Now we can parse image/x-icon tiddlers for display, and provide an
entry for them in the type dropdown.
2013-12-24 09:07:25 +00:00
Jermolene
7db31dc138 Typo correction 2013-12-24 09:06:09 +00:00
Jermolene
7b7e799a70 Fixed problem with static content being included in empty.html
A bit of a hack to fix this problem:

https://groups.google.com/forum/#!topic/tiddlywikidev/Ucpbq5eeq8g
2013-12-23 09:53:31 +00:00
Jermolene
3aab737bea Docs update 2013-12-23 08:55:15 +00:00
Jermolene
12b4cc5d3e Update wiki.readFiles() to call the callback just once
Now we accumulate the results and just pass them to the callback once.
2013-12-23 08:55:11 +00:00
Jermolene
10c25c1692 Fix slow regexp in importing TiddlyWiki HTML files 2013-12-23 08:54:33 +00:00
Jermolene
c35742f916 Prepare version info for 5.0.5 2013-12-23 08:54:07 +00:00
Jermolene
15a41d7e57 Docs update 2013-12-22 16:25:01 +00:00
Jermolene
4e37fa7e47 Docs updates 2013-12-22 15:50:27 +00:00
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
Stephan Hradek
d739b6939a added core/modules/widgets/fieldradio.js 2013-12-05 00:15:06 +01: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
322 changed files with 2494 additions and 4724 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,10 +35,14 @@ 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 ^
--savetiddler $:/green_favicon.ico %TW5_BUILD_OUTPUT%/static/favicon.ico ^
--rendertiddler $:/core/templates/static.template.html %TW5_BUILD_OUTPUT%\static.html text/plain ^
--rendertiddler $:/core/templates/alltiddlers.template.html %TW5_BUILD_OUTPUT%\alltiddlers.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 ^
|| exit 1
@@ -87,7 +91,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

8
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,10 +36,14 @@ 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 \
--savetiddler $:/green_favicon.ico $TW5_BUILD_OUTPUT/static/favicon.ico \
--rendertiddler $:/core/templates/static.template.html $TW5_BUILD_OUTPUT/static.html text/plain \
--rendertiddler $:/core/templates/alltiddlers.template.html $TW5_BUILD_OUTPUT/alltiddlers.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 \
|| exit 1

View File

@@ -246,7 +246,7 @@ $tw.utils.parseDate = function(value) {
parseInt(value.substr(10,2)||"00",10),
parseInt(value.substr(12,2)||"00",10),
parseInt(value.substr(14,3)||"000",10)));
} else if ($tw.utils.isDate(value)) {
} else if($tw.utils.isDate(value)) {
return value;
} else {
return null;
@@ -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 {
@@ -282,7 +282,7 @@ $tw.utils.parseStringArray = function(value) {
}
} while(match);
return results;
} else if ($tw.utils.isArray(value)) {
} else if($tw.utils.isArray(value)) {
return value;
} else {
return null;
@@ -1152,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);
@@ -1198,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);
@@ -1232,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 {
@@ -1246,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
@@ -1253,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);
@@ -1411,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'>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://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=''><a class=' tw-tiddlylink tw-tiddlylink-missing' href='http://tiddlywiki.com/static/GitHub.html'>GitHub</a> Issues</h2><p>We use <a class=' tw-tiddlylink tw-tiddlylink-missing' href='http://tiddlywiki.com/static/GitHub.html'>GitHub</a> Issues to manage bug reports, feature requests for <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki.html'>TiddlyWiki</a>. To maintain their effectiveness we endeavour to have as few open issues as possible.</p><h3 class=''>Policies for Managing Issues</h3><p>Open issues must be actionable: generally either a reproducible bug report, or a specific feature request. From the perspective of the core developers, the issues list behaves like a shared todo list. Every item on the list requires a little bit of attention each time we check the list.</p><p><a class=' tw-tiddlylink tw-tiddlylink-missing' href='http://tiddlywiki.com/static/GitHub.html'>GitHub</a> Issues are not very good for managing ideas that are not immediately actionable. Better to use the <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/Community.html'>TiddlyWiki discussion groups</a> for open ended questions, or speculative discussions of new features.</p><h3 class=''>Creating Issues</h3><p>When you do create an issue, remember that 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

@@ -4,7 +4,7 @@ type: text/plain
TiddlyWiki created by Jeremy Ruston, (jeremy [at] jermolene [dot] com)
Copyright © Jeremy Ruston 2004-2007
Copyright © UnaMesa Association 2007-2013
Copyright © UnaMesa Association 2007-2014
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

View File

@@ -0,0 +1,3 @@
title: $:/docs/types/image/x-icon
description: ICO format icon file
name: image/x-icon

View File

@@ -1,3 +1,3 @@
title: $:/docs/types/text/vnd.tiddlywiki
description: TW5 wikitext
description: TiddlyWiki version 5 wikitext
name: text/vnd.tiddlywiki

View File

@@ -0,0 +1,3 @@
title: $:/docs/types/text/x-tiddlywiki
description: TiddlyWiki Classic wikitext
name: text/x-tiddlywiki

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

@@ -79,7 +79,7 @@ SimpleServer.prototype.checkCredentials = function(request,incomingUsername,inco
}
}
SimpleServer.prototype.listen = function(port) {
SimpleServer.prototype.listen = function(port,host) {
var self = this;
http.createServer(function(request,response) {
// Compose the state object
@@ -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;
@@ -126,7 +125,7 @@ SimpleServer.prototype.listen = function(port) {
});
break;
}
}).listen(port);
}).listen(port,host);
};
var Command = function(params,commander,callback) {
@@ -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,8 +263,9 @@ 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",
password = this.params[5];
username = this.params[4],
password = this.params[5],
host = this.params[6];
this.server.set({
rootTiddler: rootTiddler,
renderType: renderType,
@@ -264,10 +273,9 @@ Command.prototype.execute = function() {
username: username,
password: password
});
this.server.listen(port);
if(this.commander.verbose) {
console.log("Serving on port " + port);
}
this.server.listen(port,host);
console.log("Serving on " + host + ":" + port);
console.log("(press ctrl-C to exit)");
return null;
};

View File

@@ -36,30 +36,35 @@ 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,
attrRegExp = /\s*([^=\s]+)\s*=\s*"([^"]*)"/gi,
match = divRegExp.exec(text);
var startRegExp = /^\s*<div\s+([^>]*)>(\s*<pre>)?/gi,
endRegExp,
match = startRegExp.exec(text);
if(match) {
var subMatch = subDivRegExp.exec(match[2]); // Body of the <DIV> tag
if(subMatch) {
result.text = subMatch[1];
// Old-style DIVs don't have the <pre> tag
if(match[2]) {
endRegExp = /<\/pre>\s*<\/div>\s*$/gi;
} else {
result.text = match[2];
endRegExp = /<\/div>\s*$/gi;
}
var endMatch = endRegExp.exec(text);
if(endMatch) {
// Extract the text
result.text = text.substring(match.index + match[0].length,endMatch.index);
// Process the attributes
var attrRegExp = /\s*([^=\s]+)\s*=\s*"([^"]*)"/gi,
attrMatch;
do {
attrMatch = attrRegExp.exec(match[1]);
if(attrMatch) {
var name = attrMatch[1];
var value = attrMatch[2];
result[name] = value;
}
} while(attrMatch);
return result;
}
var attrMatch;
do {
attrMatch = attrRegExp.exec(match[1]);
if(attrMatch) {
var name = attrMatch[1];
var value = attrMatch[2];
result[name] = value;
}
} while(attrMatch);
return result;
} else {
return undefined;
}
return undefined;
};
exports["application/x-tiddler-html-div"] = function(text,fields) {

View File

@@ -16,6 +16,30 @@ Filter operator for sorting
Export our filter function
*/
exports.sort = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!",false,false);
return results;
};
exports.nsort = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!",false,true);
return results;
};
exports.sortcs = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!",true,false);
return results;
};
exports.nsortcs = function(source,operator,options) {
var results = prepare_results(source);
options.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!",true,true);
return results;
};
var prepare_results = function (source) {
var results;
if($tw.utils.isArray(source)) {
results = source;
@@ -25,8 +49,7 @@ exports.sort = function(source,operator,options) {
results.push(title);
});
}
options.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!");
return results;
};
}
})();

View File

@@ -1,32 +0,0 @@
/*\
title: $:/core/modules/filters/sortcs.js
type: application/javascript
module-type: filteroperator
Filter operator for case-sensitive sorting
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.sortcs = function(source,operator,options) {
var results;
if($tw.utils.isArray(source)) {
results = source;
} else {
results = [];
$tw.utils.each(source,function(element,title) {
results.push(title);
});
}
options.wiki.sortTiddlers(results,operator.operand,operator.prefix === "!",true);
return results;
};
})();

View File

@@ -38,6 +38,7 @@ exports["image/jpeg"] = ImageParser;
exports["image/png"] = ImageParser;
exports["image/gif"] = ImageParser;
exports["application/pdf"] = ImageParser;
exports["image/x-icon"] = ImageParser;
})();

View File

@@ -7,6 +7,7 @@ Wiki text inline rule for code runs. For example:
```
This is a `code run`.
This is another ``code run``
```
\*/
@@ -22,13 +23,13 @@ exports.types = {inline: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /`/mg;
this.matchRegExp = /(``?)/mg;
};
exports.parse = function() {
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
var reEnd = /`/mg;
var reEnd = new RegExp(this.match[1], "mg");
// Look for the end marker
reEnd.lastIndex = this.parser.pos;
var match = reEnd.exec(this.parser.source),

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

@@ -22,7 +22,7 @@ exports.types = {block: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /-{3,}\r?\n/mg;
this.matchRegExp = /-{3,}\r?(?:\n|$)/mg;
};
exports.parse = function() {

View File

@@ -59,7 +59,7 @@ exports.parse = function() {
// 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 ) {
if(cite.length > 0) {
tree.unshift({
type: "element",
tag: "cite",
@@ -71,7 +71,7 @@ exports.parse = function() {
this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});
var cite = this.parser.parseInlineRun(/(\r?\n)/mg);
// If we got a cite, push it
if ( cite.length > 0 ) {
if(cite.length > 0) {
tree.push({
type: "element",
tag: "cite",

View File

@@ -18,11 +18,11 @@ exports.types = {block: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /^\|(?:[^\n]*)\|(?:[fhck]?)\r?\n/mg;
this.matchRegExp = /^\|(?:[^\n]*)\|(?:[fhck]?)\r?(?:\n|$)/mg;
};
var processRow = function(prevColumns) {
var cellRegExp = /(?:\|([^\n\|]*)\|)|(\|[fhck]?\r?\n)/mg,
var cellRegExp = /(?:\|([^\n\|]*)\|)|(\|[fhck]?\r?(?:\n|$))/mg,
cellTermRegExp = /((?:\x20*)\|)/mg,
tree = [],
col = 0,
@@ -38,7 +38,8 @@ var processRow = function(prevColumns) {
if(last) {
last.rowSpanCount++;
$tw.utils.addAttributeToParseTreeNode(last.element,"rowspan",last.rowSpanCount);
$tw.utils.addAttributeToParseTreeNode(last.element,"valign","center");
var vAlign = $tw.utils.getAttributeValueFromParseTreeNode(last.element,"valign","center");
$tw.utils.addAttributeToParseTreeNode(last.element,"valign",vAlign);
if(colSpanCount > 1) {
$tw.utils.addAttributeToParseTreeNode(last.element,"colspan",colSpanCount);
colSpanCount = 1;
@@ -51,9 +52,20 @@ var processRow = function(prevColumns) {
colSpanCount++;
// Move to just before the `|` terminating the cell
this.parser.pos = cellRegExp.lastIndex - 1;
} else if(cellMatch[1] === "<" && prevCell) {
colSpanCount = 1 + $tw.utils.getAttributeValueFromParseTreeNode(prevCell,"colspan",1);
$tw.utils.addAttributeToParseTreeNode(prevCell,"colspan",colSpanCount);
colSpanCount = 1;
// Move to just before the `|` terminating the cell
this.parser.pos = cellRegExp.lastIndex - 1;
} else if(cellMatch[2]) {
// End of row
if(prevCell && colSpanCount > 1) {
if(prevCell.attributes && prevCell.attributes && prevCell.attributes.colspan) {
colSpanCount += prevCell.attributes.colspan.value;
} else {
colSpanCount -= 1;
}
$tw.utils.addAttributeToParseTreeNode(prevCell,"colspan",colSpanCount);
}
this.parser.pos = cellRegExp.lastIndex - 1;
@@ -64,6 +76,16 @@ var processRow = function(prevColumns) {
// Look for a space at the start of the cell
var spaceLeft = false,
chr = this.parser.source.substr(this.parser.pos,1);
var vAlign = null;
if(chr === "^") {
vAlign = "top";
} else if(chr === ",") {
vAlign = "bottom";
}
if(vAlign) {
this.parser.pos++;
chr = this.parser.source.substr(this.parser.pos,1);
}
while(chr === " ") {
spaceLeft = true;
this.parser.pos++;
@@ -89,7 +111,10 @@ var processRow = function(prevColumns) {
// Parse the cell
cell.children = this.parser.parseInlineRun(cellTermRegExp,{eatTerminator: true});
// Set the alignment for the cell
if(cellMatch[1].substr(cellMatch[1].length-1,1) === " ") { // spaceRight
if(vAlign) {
$tw.utils.addAttributeToParseTreeNode(cell,"valign",vAlign);
}
if(this.parser.source.substr(this.parser.pos - 2,1) === " ") { // spaceRight
$tw.utils.addAttributeToParseTreeNode(cell,"align",spaceLeft ? "center" : "left");
} else if(spaceLeft) {
$tw.utils.addAttributeToParseTreeNode(cell,"align","right");
@@ -107,8 +132,8 @@ var processRow = function(prevColumns) {
exports.parse = function() {
var rowContainerTypes = {"c":"caption", "h":"thead", "":"tbody", "f":"tfoot"},
table = {type: "element", tag: "table", children: []},
rowRegExp = /^\|([^\n]*)\|([fhck]?)\r?\n/mg,
rowTermRegExp = /(\|(?:[fhck]?)\r?\n)/mg,
rowRegExp = /^\|([^\n]*)\|([fhck]?)\r?(?:\n|$)/mg,
rowTermRegExp = /(\|(?:[fhck]?)\r?(?:\n|$))/mg,
prevColumns = [],
currRowType,
rowContainer,
@@ -124,7 +149,7 @@ exports.parse = function() {
this.parser.pos = rowMatch.index + rowMatch[0].length;
} else {
// Otherwise, create a new row if this one is of a different type
if(rowType != currRowType) {
if(rowType !== currRowType) {
rowContainer = {type: "element", tag: rowContainerTypes[rowType], children: []};
table.children.push(rowContainer);
currRowType = rowType;

View File

@@ -40,7 +40,7 @@ exports.init = function(parser) {
};
exports.parse = function() {
var reEnd = /\r?\n\$\$\$\r?\n/mg;
var reEnd = /\r?\n\$\$\$\r?(?:\n|$)/mg;
// Save the type
var parseType = this.match[1],
renderType = this.match[2];

View File

@@ -28,7 +28,7 @@ DownloadSaver.prototype.save = function(text,method,callback) {
// Set up the link
var link = document.createElement("a");
link.setAttribute("target","_blank");
if(Blob != undefined) {
if(Blob !== undefined) {
var blob = new Blob([text], {type: "text/html"});
link.setAttribute("href", URL.createObjectURL(blob));
} else {

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,61 @@
/*\
title: $:/core/modules/savers/nodewebkit.js
type: application/javascript
module-type: saver
Handles saving changes in the node-webkit environment
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false, netscape: false, Components: false */
"use strict";
var NodeWebKitSaver = function(wiki) {
};
NodeWebKitSaver.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 = document.location.pathname;
// Test for a Windows path of the form /x:/blah/blah
if(/^\/[A-Z]\:\//i.test(pathname)) {
// Remove the leading slash
pathname = pathname.substr(1);
// Convert slashes to backslashes
pathname = pathname.replace(/\//g,"\\");
}
// Try to save
var fs = require("fs");
fs.writeFile(pathname,text,callback);
return true;
};
/*
Information about this saver
*/
NodeWebKitSaver.prototype.info = {
name: "nodewebkit",
priority: 1700
};
/*
Static method that returns true if this saver is capable of working
*/
exports.canSave = function(wiki) {
// Check if we're running under node-webkit
return (typeof process == "object")
};
/*
Create an instance of this saver
*/
exports.create = function(wiki) {
return new NodeWebKitSaver(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,35 @@ exports.startup = function() {
$tw.rootWidget.addEventListener("tw-clear-password",function(event) {
$tw.crypto.setPassword(null);
});
// Set up the favicon
var faviconTitle = "$:/favicon.ico",
faviconLink = document.getElementById("faviconLink"),
setFavicon = function() {
var tiddler = $tw.wiki.getTiddler(faviconTitle);
if(tiddler) {
faviconLink.setAttribute("href","data:" + tiddler.fields.type + ";base64," + tiddler.fields.text);
}
};
setFavicon();
$tw.wiki.addEventListener("change",function(changes) {
if($tw.utils.hop(changes,faviconTitle)) {
setFavicon();
}
});
// 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 +152,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:}
@@ -439,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);
@@ -460,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

@@ -48,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

@@ -18,9 +18,11 @@ Set style properties of an element
styles: ordered array of {name: value} pairs
*/
exports.setStyle = function(element,styles) {
for(var t=0; t<styles.length; t++) {
for(var styleName in styles[t]) {
element.style[$tw.utils.convertStyleNameToPropertyName(styleName)] = styles[t][styleName];
if(element.nodeType === Element.ELEMENT_NODE) {
for(var t=0; t<styles.length; t++) {
for(var styleName in styles[t]) {
element.style[$tw.utils.convertStyleNameToPropertyName(styleName)] = styles[t][styleName];
}
}
}
};
@@ -130,15 +132,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

@@ -18,7 +18,7 @@ Code thanks to John Resig, http://ejohn.org/blog/comparing-document-position/
*/
exports.domContains = function(a,b) {
return a.contains ?
a != b && a.contains(b) :
a !== b && a.contains(b) :
!!(a.compareDocumentPosition(b) & 16);
};

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

@@ -19,6 +19,13 @@ exports.addAttributeToParseTreeNode = function(node,name,value) {
}
};
exports.getAttributeValueFromParseTreeNode = function(node,name,defaultValue) {
if(node.type === "element" && node.attributes && node.attributes[name] && node.attributes[name].value !== undefined) {
return node.attributes[name].value;
}
return defaultValue;
};
exports.addClassToParseTreeNode = function(node,classString) {
var classes = [];
if(node.type === "element") {

View File

@@ -275,7 +275,7 @@ exports.unescapeLineBreaks = function(s) {
// Copied from peg.js, thanks to David Majda
exports.escape = function(ch) {
var charCode = ch.charCodeAt(0);
if (charCode <= 0xFF) {
if(charCode <= 0xFF) {
return '\\x' + $tw.utils.pad(charCode.toString(16).toUpperCase());
} else {
return '\\u' + $tw.utils.pad(charCode.toString(16).toUpperCase(),4);

View File

@@ -39,8 +39,8 @@ BrowseWidget.prototype.render = function(parent,nextSibling) {
domNode.setAttribute("multiple","multiple");
// Add a click event handler
domNode.addEventListener("change",function (event) {
self.wiki.readFiles(event.target.files,function(tiddlerFields) {
self.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify([tiddlerFields])});
self.wiki.readFiles(event.target.files,function(tiddlerFieldsArray) {
self.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify(tiddlerFieldsArray)});
});
return false;
},false);

View File

@@ -90,8 +90,8 @@ DropZoneWidget.prototype.handleDropEvent = function(event) {
// Try to import the various data types we understand
this.importData(dataTransfer);
// Import any files in the drop
this.wiki.readFiles(dataTransfer.files,function(tiddlerFields) {
self.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify([tiddlerFields])});
this.wiki.readFiles(dataTransfer.files,function(tiddlerFieldsArray) {
self.dispatchEvent({type: "tw-import-tiddlers", param: JSON.stringify(tiddlerFieldsArray)});
});
// Tell the browser that we handled the drop
event.preventDefault();
@@ -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

@@ -37,17 +37,19 @@ EditTextWidget.prototype.render = function(parent,nextSibling) {
// Execute our logic
this.execute();
// Create our element
var editInfo = this.getEditInfo();
var domNode = this.document.createElement(this.editTag);
if(this.editType) {
domNode.setAttribute("type",this.editType);
}
if(this.editPlaceholder) {
if(editInfo.value === "" && this.editPlaceholder) {
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") {
domNode.appendChild(this.document.createTextNode(editInfo.value));
} else {

View File

@@ -41,7 +41,8 @@ var editorTypeMappings = {
"image/jpg": "bitmap",
"image/jpeg": "bitmap",
"image/gif": "bitmap",
"image/png": "bitmap"
"image/png": "bitmap",
"image/x-icon": "bitmap"
};
/*
@@ -53,6 +54,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") {
@@ -71,7 +73,8 @@ EditWidget.prototype.execute = function() {
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,100 +70,123 @@ 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 title = event.param || event.tiddlerTitle,
draftTiddler = this.getDraftTiddler(title),
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] === title) {
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();
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;
};
@@ -171,32 +194,30 @@ NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {
NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) {
// Get the tiddler we're deleting
var title = event.param || event.tiddlerTitle,
tiddler = this.wiki.getTiddler(title);
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(title);
// Remove the closed tiddler from the story
this.getStoryList();
// Look for tiddler with this title to close
var slot = this.findTitleInStory(title,-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);
}
@@ -236,73 +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 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
for(var t=0; t<this.storyList.length; t++) {
if(this.storyList[t] === title) {
var tiddler = this.wiki.getTiddler(title);
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);
}
// 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;
}
}
// 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;
// Flip the specified tiddler from draft back to the original
var draftTitle = event.param || event.tiddlerTitle,
draftTiddler = this.wiki.getTiddler(draftTitle);
if(draftTiddler && draftTiddler.hasField("draft.of")) {
var originalTitle = draftTiddler.fields["draft.of"];
draftTiddler = this.wiki.getTiddler(draftTitle),
originalTitle = draftTiddler.fields["draft.of"],
storyList = this.getStoryList();
if(draftTiddler && originalTitle) {
// Remove the draft tiddler
this.wiki.deleteTiddler(draftTitle);
// Swap the draft for the original in the story
for(var t=0; t<this.storyList.length; t++) {
if(this.storyList[t] === draftTitle) {
// Make the story record point to the original tiddler
this.storyList[t] = originalTitle;
storyTiddlerModified = true;
}
}
}
if(storyTiddlerModified) {
this.saveStoryList();
this.replaceFirstTitleInStory(storyList,draftTitle,originalTitle);
this.addToHistory(originalTitle,event.navigateFromClientRect);
this.saveStoryList(storyList);
}
return false;
};
@@ -310,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
@@ -330,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,
@@ -338,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;
};
@@ -353,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 {
@@ -372,16 +369,16 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
));
if(imported) {
// Add it to the story
if(self.storyList.indexOf(title) === -1) {
self.storyList.unshift(title);
if(storyList.indexOf(title) === -1) {
storyList.unshift(title);
}
// And to history
history.push({title: title});
history.push(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

@@ -158,8 +158,8 @@ ViewWidget.prototype.getValueAsDate = function(format) {
};
ViewWidget.prototype.getValueAsRelativeDate = function(format) {
var value = this.getValue();
if(value) {
var value = $tw.utils.parseDate(this.getValue());
if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") {
return $tw.utils.getRelativeDate((new Date()) - (new Date(value))).description;
} 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;
};
@@ -255,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) {
@@ -285,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);
};
@@ -296,21 +305,27 @@ Sort an array of tiddler titles by a specified field
isDescending: true if the sort should be descending
isCaseSensitive: true if the sort should consider upper and lower case letters to be different
*/
exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive) {
exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,isNumeric) {
var self = this;
titles.sort(function(a,b) {
if(sortField !== "title") {
a = self.getTiddler(a).fields[sortField] || "";
b = self.getTiddler(b).fields[sortField] || "";
}
if(!isCaseSensitive) {
if(typeof a === "string") {
a = a.toLowerCase();
}
if(typeof b === "string") {
b = b.toLowerCase();
if(!isNumeric || isNaN(a) || isNaN(b)) {
if(!isCaseSensitive) {
if(typeof a === "string") {
a = a.toLowerCase();
}
if(typeof b === "string") {
b = b.toLowerCase();
}
}
}
else {
a-= 0;
b-= 0;
}
if(a < b) {
return isDescending ? +1 : -1;
} else {
@@ -323,12 +338,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]];
@@ -757,7 +777,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);
@@ -926,7 +946,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 {
@@ -1010,16 +1030,23 @@ exports.getTiddlerText = function(title,defaultText) {
};
/*
Read an array of browser File objects, invoking callback(tiddlerFields) for each loaded file
Read an array of browser File objects, invoking callback(tiddlerFieldsArray) once they're all read
*/
exports.readFiles = function(files,callback) {
var result = [],
outstanding = files.length;
for(var f=0; f<files.length; f++) {
this.readFile(files[f],callback);
this.readFile(files[f],function(tiddlerFieldsArray) {
result.push.apply(result,tiddlerFieldsArray);
if(--outstanding === 0) {
callback(result);
}
});
};
};
/*
Read a browser File object, invoking callback(tiddlerFields) with the tiddler fields object
Read a browser File object, invoking callback(tiddlerFieldsArray) with an array of tiddler fields objects
*/
exports.readFile = function(file,callback) {
// Get the type, falling back to the filename extension
@@ -1049,15 +1076,10 @@ exports.readFile = function(file,callback) {
var commaPos = event.target.result.indexOf(",");
if(commaPos !== -1) {
tiddlerFields.text = event.target.result.substr(commaPos+1);
callback(tiddlerFields);
callback([tiddlerFields]);
}
} else {
var tiddlers = self.deserializeTiddlers(type,event.target.result,tiddlerFields);
if(tiddlers) {
$tw.utils.each(tiddlers,function(tiddlerFields) {
callback(tiddlerFields);
});
}
callback(self.deserializeTiddlers(type,event.target.result,tiddlerFields));
}
};
// Kick off the read

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

@@ -0,0 +1,3 @@
title: $:/core/templates/alltiddlers.content
{{{ [!is[system]sort[title]] ||$:/core/templates/static-tiddler}}}

View File

@@ -0,0 +1,28 @@
title: $:/core/templates/alltiddlers.template.html
type: text/vnd.tiddlywiki-html
\define tw-wikilink-template() #$uri_encoded$
\rules only filteredtranscludeinline transcludeinline
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="TiddlyWiki" />
<meta name="tiddlywiki-version" content="{{$:/core/templates/version}}" />
<meta name="format-detection" content="telephone=no">
<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
<title>{{$:/core/wiki/title}}</title>
<div id="styleArea">
{{{ [is[system]type[text/css]] ||$:/core/templates/css-tiddler}}}
</div>
<style type="text/css">
{{{ [tag[$:/tags/stylesheet]] [is[shadow]tag[$:/tags/stylesheet]] ||$:/core/templates/wikified-tiddler}}}
</style>
</head>
<body class="tw-body">
{{$:/StaticBanner||$:/core/templates/html-tiddler}}
<section class="story-river">
{{$:/core/templates/alltiddlers.content||$:/core/templates/html-tiddler}}
</section>
</body>
</html>

View File

@@ -0,0 +1,5 @@
title: $:/core/templates/static-tiddler
<a name=<<currentTiddler>>>
<$transclude tiddler="$:/core/ui/ViewTemplate"/>
</a>

View File

@@ -10,6 +10,7 @@ type: text/vnd.tiddlywiki-html
<meta name="generator" content="TiddlyWiki" />
<meta name="tiddlywiki-version" content="{{$:/core/templates/version}}" />
<meta name="format-detection" content="telephone=no">
<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
<title>{{$:/core/wiki/title}}</title>
<div id="styleArea">
{{{ [is[system]type[text/css]] ||$:/core/templates/css-tiddler}}}
@@ -20,6 +21,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

@@ -8,6 +8,7 @@ title: $:/core/templates/static.tiddler.html
<meta name="generator" content="TiddlyWiki" />
<meta name="tiddlywiki-version" content="`{{$:/core/templates/version}}`" />
<meta name="format-detection" content="telephone=no">
<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="static.css">
<title>`{{$:/core/wiki/title}}`</title>
</head>

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 id="faviconLink" 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

@@ -0,0 +1,3 @@
title: $:/AdvancedSearch
<div class="tw-advanced-search"><<tabs "[is[shadow]!has[draft.of]tag[$:/tags/AdvancedSearch]] [!is[shadow]!has[draft.of]tag[$:/tags/AdvancedSearch]] +[tag[$:/tags/AdvancedSearch]]" "$:/core/ui/AdvancedSearch/System">></div>

View File

@@ -0,0 +1,27 @@
title: $:/core/ui/AdvancedSearch/Shadows
tags: $:/tags/AdvancedSearch
caption: Shadows
<$linkcatcher to="$:/temp/advancedsearch">
Search for shadow tiddlers:
<div class="tw-search"><$edit-text tiddler="$:/temp/advancedsearch" type="search" tag="input"/><$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$link to="" class="btn-invisible">{{$:/core/images/close-button}}</$link></$reveal></div>
</$linkcatcher>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<div class="tw-search-results">
//<small><$count filter="[is[shadow]search{$:/temp/advancedsearch}]"/> matches</small>//
<$list filter="[is[shadow]search{$:/temp/advancedsearch}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
</div>
</$reveal>
<$reveal state="$:/temp/advancedsearch" type="match" text="">
</$reveal>

View File

@@ -0,0 +1,27 @@
title: $:/core/ui/AdvancedSearch/System
tags: $:/tags/AdvancedSearch
caption: System
<$linkcatcher to="$:/temp/advancedsearch">
Search for system tiddlers:
<div class="tw-search"><$edit-text tiddler="$:/temp/advancedsearch" type="search" tag="input"/><$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> <$link to="" class="btn-invisible">{{$:/core/images/close-button}}</$link></$reveal></div>
</$linkcatcher>
<$reveal state="$:/temp/advancedsearch" type="nomatch" text="">
<div class="tw-search-results">
//<small><$count filter="[search{$:/temp/advancedsearch}]"/> matches</small>//
<$list filter="[search{$:/temp/advancedsearch}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
</div>
</$reveal>
<$reveal state="$:/temp/advancedsearch" type="match" text="">
</$reveal>

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]]"/>
|[[DefaultTiddlers|$:/DefaultTiddlers]] |Choose which tiddlers are displayed at startup:<br> <$edit-text tag="textarea" tiddler="$:/DefaultTiddlers"/><br>//Use &#91;&#91;double square brackets&#93;&#93; for titles with spaces// |
|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

@@ -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,18 +1,21 @@
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>
<em class="tw-edit"><$transclude tiddler="$:/core/ui/EditorHint"/></em> <$button type="set" set="$:/ShowEditPreview" setTo="no">hide preview</$button>
<div class="tw-tiddler-preview">
<div class="tw-tiddler-preview-preview">
<$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"/>
<em class="tw-edit"><$transclude tiddler="$:/core/ui/EditorHint"/></em> <$button type="set" set="$:/ShowEditPreview" setTo="yes">show preview</$button>
<$edit field="text" class="tw-edit-texteditor" placeholder=<<prompt>>/>
</$reveal>

View File

@@ -9,6 +9,6 @@ tags: $:/tags/EditTemplate
</table>
</div>
<div class="tw-edit-field-add">//Add a new field:// <span class="tw-edit-field-add-name"><$edit-text tiddler="$:/NewFieldName" tag="input" default="" placeholder="field name" class="tw-edit-texteditor"/></span> <span class="tw-edit-field-add-button"><$button message="tw-add-field" param={{$:/NewFieldName}} set="$:/NewFieldName" setTo="" class="">add</$button></span></div>
<div class="tw-edit-field-add"><em class="tw-edit">Add a new field:</em> <span class="tw-edit-field-add-name"><$edit-text tiddler="$:/NewFieldName" tag="input" default="" placeholder="field name" class="tw-edit-texteditor"/></span> <span class="tw-edit-field-add-button"><$button message="tw-add-field" param={{$:/NewFieldName}} set="$:/NewFieldName" setTo="" class="">add</$button></span></div>
</$fieldmangler>

View File

@@ -1,7 +1,7 @@
title: $:/core/ui/EditTemplate/type
tags: $:/tags/EditTemplate
<p>//Type:// <$edit-text field="type" tag="input" default="" placeholder="type" focusPopup=<<qualify "$:/state/typeDropdown">> class="tw-edit-typeeditor"/> <$button popup=<<qualify "$:/state/typeDropdown">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button></p>
<p><em class="tw-edit">Type:</em> <$edit-text field="type" tag="input" default="" placeholder="type" focusPopup=<<qualify "$:/state/typeDropdown">> class="tw-edit-typeeditor"/> <$button popup=<<qualify "$:/state/typeDropdown">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button></p>
<div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/typeDropdown">> type="nomatch" text="" default="">

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]] [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,6 +6,10 @@ caption: Tools
---
[[AdvancedSearch|$:/AdvancedSearch]]
---
{{$:/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,2 @@
title: $:/temp/advancedsearch

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,24 @@ describe("WikiText parser tests", function() {
});
it("should parse horizontal rules", function() {
expect(parse("---Not a rule\n\n----\n\nBetween\n\n---")).toEqual(
[ { type : 'element', tag : 'p', children : [ { type : 'entity', entity : '&mdash;' }, { type : 'text', text : 'Not a rule' } ] }, { type : 'element', tag : 'hr' }, { type : 'element', tag : 'p', children : [ { type : 'text', text : 'Between' } ] }, { type : 'element', tag : 'hr' } ]
);
});
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,34 +1,4 @@
<h1 class=''>
Building classic <span>
TiddlyWiki</span> with <span>
TiddlyWiki5</span></h1><p>
<span>
TiddlyWiki5</span> can be used to build older 2.x.x versions of <span>
TiddlyWiki</span> from their constituent components. Doing so involves these additional features over and above those used for building <span>
TiddlyWiki5</span>:</p><ul>
<li>
The <code>
tiddlywiki2/loadrecipe</code> plugin, containing a deserializer module which allows tiddlers to be loaded from <span>
TiddlyWiki</span> 2.x.x <code>
.recipe</code> files</li><li>
The <code>
tiddlywiki2/stripcomments</code> plugin, containing a new viewer format for the <code>
&lt;$view&gt;</code> widget that strips single line <span>
JavaScript</span> comments starting <code>
//#</code></li><li>
The <code>
stripTitlePrefix='yes'</code> attribute of the <code>
&lt;$fields&gt;</code> widget, which removes prefixes wrapped in curly braces from the <code>
title</code> attribute<ul>
<li>
For example, <code>
{tiddler}HelloThere</code> would be transformed to <code>
HelloThere</code></li></ul></li></ul><h1 class=''>
Usage</h1><p>
<span>
TiddlyWikiClassic</span> is built from the command line by running <span>
TiddlyWiki5</span> under node.js. A typical usage would be:</p><pre>
node ../../tiddlywiki.js \
<h1 class=''>Building <span>TiddlyWikiClassic</span></h1><p><span>TiddlyWiki5</span> can be used to build older 2.x.x versions of <span>TiddlyWikiClassic</span> from their constituent components. Doing so involves these features:</p><ul><li>The <code>tiddlywiki/classictools</code> plugin, containing a deserializer module which allows tiddlers to be loaded from <span>TiddlyWiki</span> 2.x.x <code>.recipe</code> files</li><li>The <code>stripcomments</code> format for the <span>ViewWidget</span>, which strips single line <span>JavaScript</span> comments starting <code>//#</code></li><li>The <code>stripTitlePrefix='yes'</code> attribute of the <span>FieldsWidget</span>, which removes prefixes wrapped in curly braces from the <code>title</code> attribute<ul><li>For example, <code>{tiddler}HelloThere</code> would be transformed to <code>HelloThere</code></li></ul></li></ul><h1 class=''>Usage</h1><p><span>TiddlyWikiClassic</span> is built from the command line by running <span>TiddlyWiki on Node.js</span>. A typical usage would be:</p><pre>node ../../tiddlywiki.js \
--verbose \
--load &lt;path_to_recipe_file&gt; \
--rendertiddler $:/core/templates/tiddlywiki2.template.html &lt;path_to_write_index_file&gt; text/plain \

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: 20140103170711561
tags: community
title: Community
type: text/vnd.tiddlywiki
@@ -26,14 +24,18 @@ The TiddlyWiki discussion groups are mailing lists for talking about TiddlyWiki:
* 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
* Reaction to TiddlyWiki5 from the translator of the German edition of TiddlyWikiClassic: "[[TiddlyWiki 5 im Betatest|http://blog.netplanet.org/2014/01/03/tiddlywiki-5-im-betatest/]]"
* A gamers guide to using TiddlyWiki5: "[[Shining Ark 7 Using TiddlyWiki|http://helugame.wordpress.com/2013/09/07/shining-ark-7-using-tiddlywiki/]]"
* An introduction to TiddlyWiki5 by [[Moongift (in Japanese)|http://www.moongift.jp/2013/11/tiddlywiki5-%E3%83%87%E3%82%B6%E3%82%A4%E3%83%B3%E5%88%B7%E6%96%B0%E3%80%82%E6%AC%A1%E3%81%AE25%E5%B9%B4%E3%82%92%E7%9B%AE%E6%8C%87%E3%81%99tiddlywiki-2/]]
! 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://giffmex.org/nt/1johnnotebase.html |A study notebook for the Bible ||
; 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,24 @@
created: 201311011114
creator: JeremyRuston
modified: 201311301614
modifier: JeremyRuston
created: 20131101111400000
modified: 20131230101537722
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
!! GitHub Issues
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:
We use GitHub Issues to manage bug reports, feature requests for TiddlyWiki. To maintain their effectiveness we endeavour to have as few open issues as possible.
!!! Policies for Managing Issues
Open issues must be actionable: generally either a reproducible bug report, or a specific feature request. From the perspective of the core developers, the issues list behaves like a shared todo list. Every item on the list requires a little bit of attention each time we check the list.
GitHub Issues are not very good for managing ideas that are not immediately actionable. Better to use the [[TiddlyWiki discussion groups|Community]] for open ended questions, or speculative discussions of new features.
!!! Creating Issues
When you do create an issue, remember that for effective debugging, we need as much information as possible. At a minimum, please try to include:
* A descriptive title
* A summary
@@ -17,6 +26,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,7 +35,7 @@ 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: [[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]]

View File

@@ -1,7 +1,5 @@
created: 20130824141800000
creator: JeremyRuston
modified: 20131206163714703
modifier: JeremyRuston
modified: 20131212093542990
tags: introduction
title: Docs
type: text/vnd.tiddlywiki
@@ -11,7 +9,7 @@ type: text/vnd.tiddlywiki
<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 the DeveloperDocs.
This is the main documentation hub for TiddlyWiki. See also [[TiddlyWiki for Developers]].
! How to use ~TiddlyWiki5

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,7 +1,5 @@
created: 20130822172800000
creator: JeremyRuston
modified: 20131203112520519
modifier: JeremyRuston
modified: 20131213100612914
tags: introduction
title: Features
type: text/vnd.tiddlywiki
@@ -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,10 @@
created: 20131129090249275
creator: JeremyRuston
modified: 20131206172416371
modifier: JeremyRuston
modified: 20140103165133720
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 very 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.
@@ -15,16 +14,18 @@ TiddlyWiki is highly flexible, and there are many different ways to use it. Here
! The convenient and fast method
Saving changes as described above is quite inconvenient because of the degree of manual intervention that browsers require. The following alternative method is recommended for everyone who is able to use Mozilla's [[Firefox]] browser (including [[Firefox for Android]]).
Saving changes as described above is quite inconvenient because of the degree of manual intervention that browsers require. The following alternative method is recommended for everyone who is able to use Mozilla's [[Firefox]] browser.
{{Saving with TiddlyFox}}
! 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]] 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
* Running [[TiddlyWiki on node-webkit]], turning it into a native application on your desktop

View File

@@ -1,21 +1,21 @@
created: 20130822170200000
creator: JeremyRuston
modified: 20131206165151008
modifier: JeremyRuston
modified: 20140103165207217
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|Community]] and support the future development of TiddlyWiki.
//TiddlyWiki5 and TiddlyWiki Classic are free, open source projects that depend on [[your love and support|HelpingTiddlyWiki]] for their survival//.
//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>
!! TiddlyWiki Classic - http://tiddlywiki.com
!! TiddlyWikiClassic - http://classic.tiddlywiki.com
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.
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: 20131206172505397
modifier: JeremyRuston
tags: community
title: HelpingTiddlyWiki
type: text/vnd.tiddlywiki

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,7 +1,5 @@
created: 201311081754007
creator: JeremyRuston
modified: 201311081754007
modifier: JeremyRuston
title: Release 5.0.0-alpha.11
tags: releasenote
released: 201311081806

View File

@@ -1,7 +1,5 @@
created: 201311081854007
creator: JeremyRuston
modified: 201311081854007
modifier: JeremyRuston
title: Release 5.0.0-alpha.12
tags: releasenote
released: 201311082141

View File

@@ -1,7 +1,5 @@
created: 201311091122007
creator: JeremyRuston
modified: 201311091122007
modifier: JeremyRuston
title: Release 5.0.0-alpha.13
tags: releasenote
released: 201311091927

View File

@@ -1,7 +1,5 @@
created: 201311101922007
creator: JeremyRuston
modified: 201311101922007
modifier: JeremyRuston
title: Release 5.0.0-alpha.14
tags: releasenote
released: 201311102315

View File

@@ -1,7 +1,5 @@
created: 201311122050007
creator: JeremyRuston
modified: 201311122050007
modifier: JeremyRuston
title: Release 5.0.0-alpha.15
tags: releasenote
released: 201311191221

View File

@@ -1,7 +1,5 @@
created: 20131119125600007
creator: JeremyRuston
modified: 20131130095531749
modifier: JeremyRuston
tags: releasenote
title: Release 5.0.0-alpha.16
type: text/vnd.tiddlywiki

View File

@@ -1,7 +1,5 @@
created: 20131130151600007
creator: JeremyRuston
modified: 20131130151631749
modifier: JeremyRuston
tags: releasenote
title: Release 5.0.0-alpha.17
type: text/vnd.tiddlywiki

View File

@@ -1,10 +1,9 @@
created: 20131201132300007
creator: JeremyRuston
modified: 20131206161343895
modifier: JeremyRuston
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]]//
@@ -24,4 +23,4 @@ type: text/vnd.tiddlywiki
!! 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`
** Beta releases will be `5.0.x-beta` and the final release will be `5.1.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-beta
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

@@ -0,0 +1,18 @@
created: 20131223085100000
modified: 20131224142028933
tags: releasenote
title: Release 5.0.5-beta
type: text/vnd.tiddlywiki
released: 201312241430
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.4-beta...v5.0.5-beta]]//
!! Improvements
* Added support for [[Setting a favicon]]
!! Bug Fixes
* Fixed problem with modal wizard positioning on narrow screens
* Fix problem with static content being included in empty.html when downloaded from the full wiki
* Improved performance of tiddler import with large tiddlers on Firefox

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