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

Compare commits

...

149 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
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
David Jade
80e0714c0d Fix for IE drag/drop issue #252 2013-12-12 17:32:06 -08: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
165 changed files with 1503 additions and 4013 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,11 +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
@@ -88,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

7
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,11 +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);
@@ -1247,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
@@ -1254,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);
@@ -1412,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,6 +196,15 @@ 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$/,
@@ -256,7 +264,8 @@ Command.prototype.execute = function() {
renderType = this.params[2] || "text/plain",
serveType = this.params[3] || "text/html",
username = this.params[4],
password = this.params[5];
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

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

@@ -32,7 +32,7 @@ FSOSaver.prototype.save = function(text,method,callback) {
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... - ^/[^/]+/[^/]+
} else if(document.location.hostname !== "" && /^\/\\[^\\]+\\[^\\]+/i.test(pathname)) { // test for \\server\share\blah... - ^/[^/]+/[^/]+
// Remove the leading slash
pathname = pathname.substr(1);
// reconstruct UNC path

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

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

@@ -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,11 +37,12 @@ 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
@@ -49,7 +50,6 @@ EditTextWidget.prototype.render = function(parent,nextSibling) {
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

@@ -320,14 +320,7 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
// 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
@@ -336,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,

View File

@@ -84,7 +84,7 @@ RadioWidget.prototype.setValue = function() {
};
RadioWidget.prototype.handleChangeEvent = function(event) {
if (this.inputDomNode.checked) {
if(this.inputDomNode.checked) {
this.setValue();
}
};
@@ -98,7 +98,7 @@ RadioWidget.prototype.execute = function() {
this.radioField = this.getAttribute("field");
this.radioValue = this.getAttribute("value");
this.radioClass = this.getAttribute("class","");
if (this.radioClass !== "") {
if(this.radioClass !== "") {
this.radioClass += " ";
}
this.radioClass += "tw-radio";
@@ -117,7 +117,7 @@ RadioWidget.prototype.refresh = function(changedTiddlers) {
} else {
var refreshed = false;
if(changedTiddlers[this.radioTitle]) {
this.inputDomNode.checked = this.getValue();
this.inputDomNode.checked = this.getValue() === this.radioValue;
refreshed = true;
}
return this.refreshChildren(changedTiddlers) || refreshed;

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

@@ -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;
};
@@ -305,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 {
@@ -940,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 {
@@ -1024,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
@@ -1063,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,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

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

@@ -7,7 +7,7 @@ caption: Basics
|[[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"/> |
|[[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]]"/>'' |

View File

@@ -3,4 +3,4 @@ title: $:/core/ui/EditTemplate
\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,6 +6,10 @@ caption: Tools
---
[[AdvancedSearch|$:/AdvancedSearch]]
---
{{$:/snippets/minithemeswitcher}}
---

View File

@@ -3,6 +3,6 @@ title: $:/core/ui/ViewTemplate
\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,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

@@ -113,6 +113,15 @@ 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(

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,5 +1,5 @@
created: 20130909151600000
modified: 20131211130139832
modified: 20140103170711561
tags: community
title: Community
type: text/vnd.tiddlywiki
@@ -24,9 +24,12 @@ 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/]]

View File

@@ -1,13 +1,24 @@
created: 201311011114
modified: 201311301614
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
@@ -15,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
@@ -22,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

@@ -14,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
** 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://five.tiddlywiki.com/test.html
** 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 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

@@ -1,10 +1,10 @@
created: 20131129090249275
modified: 20131212222628625
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 [[TiddlyWiki 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.
@@ -14,7 +14,7 @@ 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}}
@@ -28,3 +28,4 @@ You can also try:
* [[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
modified: 20131213101007165
modified: 20140103165207217
tags: introduction
title: HelloThere
type: text/vnd.tiddlywiki
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.
This is version <<version>> of TiddlyWiki, a major reboot designed [[for the next 25 years|Future of TiddlyWiki]]. It is currently in beta (see the detailed ReleaseHistory). There is a RoadMap for moving to the full release. It is a great time to get involved and support the future development of TiddlyWiki.
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.
//TiddlyWiki is a free, open source project that depends 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>
!! TiddlyWikiClassic - http://classic.tiddlywiki.com
On this site, unless noted otherwise, "~TiddlyWiki" refers to the new version 5, and ~TiddlyWikiClassic is used to identify the older version.
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

@@ -23,4 +23,4 @@ released: 201312061753
!! 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

@@ -3,6 +3,7 @@ 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]]//

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

View File

@@ -0,0 +1,27 @@
created: 20131228164411884
modified: 20140103164959903
tags: releasenote
title: Release 5.0.6-beta
type: text/vnd.tiddlywiki
released: 201301031714
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.5-beta...v5.0.6-beta]]//
!! Improvements
* [[Added|https://github.com/Jermolene/TiddlyWiki5/pull/324]] support for numeric sorting to TiddlerFilters (thanks to StephanHradek)
* [[Extended|https://github.com/Jermolene/TiddlyWiki5/pull/321]] [[Tables in WikiText]] to allow for vertical alignment of cells (thanks to StephanHradek)
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/87fbd988f1fb0164411af190adfe6b6a2404eef3]] experimental support for running [[TiddlyWiki on node-webkit]]
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/3d79eb87d1c609195b8c518c08e167994b20a346]] an [[$:/AdvancedSearch]]
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/bd7db62da052ec6262c3319eaa11f00e5c452a7b]] support for specifying hostname for the ServerCommand
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/b9e80a270b7f67db816e9b06e2f71f9c9dd86c17]] a first pass at generating an all-in-one static HTML representation of a wiki, complete with internal anchor links for wiki links
** See http://tiddlywiki.com/alltiddlers.html
* [[Hide|https://github.com/Jermolene/TiddlyWiki5/commit/44568dc6ef64be8c1370df8f682777c2c805fee7]] encryption features when running on the server
* [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/2ee50939447cf2948e49e5905520943ea4075975]] [[double backticks|Formatting in WikiText]] as an alternative for delimitting inline code (thanks to StephanHradek)
!! Bug Fixes
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/ec7dff291dadb3e128e1db34b4ded6b57bc8ed46]] import ''browse'' button
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/commit/ef59a3743f02c726f20e035c5d28665000fda79a]] crash when attempting full screen mode on browsers that don't support it
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/pull/307]] requirement for a newline immediately after a horizontal rule, table or typed block (thanks to StephanHradek)
* [[Fixed|https://github.com/Jermolene/TiddlyWiki5/pull/318]] problem with ''placeholder'' attibute on InternetExplorer (thanks to DavidJade)

View File

@@ -1,16 +1,25 @@
created: 20131202102427114
modified: 20131212094500689
modified: 20131229220836002
tags: howto
title: Upgrading
type: text/vnd.tiddlywiki
There are several methods for upgrading an existing TiddlyWiki document to a new release.
There are several methods for upgrading an existing TiddlyWiki version 5 document to a new release. There is a [[different procedure|Upgrading TiddlyWiki on Node.js]] for upgrading [[TiddlyWiki on Node.js]].
<div class="tw-message-box">
<a class="tw-message-icon" href="http://tiddlywiki.com/" target="_blank">{{TiddlyWiki Classic.png}}</a>
!! Upgrading from TiddlyWikiClassic
Remember that TiddlyWiki version 5 is not fully backwards compatible with the older TiddlyWikiClassic. It is recommended that users of TiddlyWikiClassic should not attempt to upgrade their existing files until the new version is more mature.
</div>
! Online upgrading
Note that none of your personal data leaves your browser with this process.
# Visit http://five.tiddlywiki.com/empty.html
# Visit http://tiddlywiki.com/empty.html
# Drag your old TiddlyWiki HTML file into the browser window
#* Your tiddlers should be imported
# Save changes to save the new version.
@@ -22,13 +31,13 @@ This will download a file called ''empty.html'' to your computer. This file is t
># Open the control panel to the ''Plugins'' tab in your upgraded wiki
># Check the version numbers of the plugins you are using; any plugins with an older version than the version of [[$:/core]] will probably need updating
># Locate a wiki with the plugins you need to update and open the control panel ''Plugins'' tab
>#* http://five.tiddlywiki.com/d3demo.html for the D3 plugin
>#* http://five.tiddlywiki.com/codemirrordemo.html for the CodeMirror plugin
>#* http://five.tiddlywiki.com/markdowndemo.html for the MarkDown plugin
>#* http://five.tiddlywiki.com/ for most of the others
>#* http://tiddlywiki.com/d3demo.html for the D3 plugin
>#* http://tiddlywiki.com/codemirrordemo.html for the CodeMirror plugin
>#* http://tiddlywiki.com/markdowndemo.html for the MarkDown plugin
>#* http://tiddlywiki.com/ for most of the others
># Drag the plugin links one by one back to your own wiki. You should see the version numbers update in the control panel
># Save your wiki
! Offline upgrading
You can also download http://five.tiddlywiki.com/empty.html locally and perform the same drag-and-drop procedure to upgrade your files.
You can also download http://tiddlywiki.com/empty.html locally and perform the same drag-and-drop procedure to upgrade your files.

View File

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

View File

@@ -1,27 +1,33 @@
title: ServerCommand
created: 20131219163923630
modified: 20131229130513478
tags: command
title: ServerCommand
type: text/vnd.tiddlywiki
The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage - in particular, TiddlyWiki5 is an old-school wiki in the sense that it offers no authentication.
The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage.
At the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for `GET`, `PUT` and `DELETE`.
```
--server <port> <roottiddler> <rendertype> <servetype> <username>
--server <port> <roottiddler> <rendertype> <servetype> <username> <password> <host>
```
The parameters are:
* ''port'' - port number to serve from (defaults to "8080")
* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/tiddlywiki5.template.html")
* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/save/all")
* ''rendertype'' - the content type to which the root tiddler should be rendered (defaults to "text/plain")
* ''servetype'' - the content type with which the root tiddler should be served (defaults to "text/html")
* ''username'' - the default username for signing edits
* ''password'' - optional password for basic authentication
* ''host'' - optional hostname to serve from (defaults to "0.0.0.0")
If the password parameter is specified then the browser will prompt the user for the username and password. Note that the password is transmitted in plain text so this implementation isn't suitable for general use.
For example:
```
--server 8080 $:/core/tiddlywiki5.template.html text/plain text/html MyUserName
--server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd
```
To run multiple TiddlyWiki servers at the same time you'll need to put each one on a different port.

View File

@@ -1,5 +1,5 @@
created: 20130822080600000
modified: 20131129163429930
modified: 20131228161338857
tags: concepts
title: SystemTags
type: text/vnd.tiddlywiki
@@ -11,6 +11,7 @@ System tags are used to give special behaviour to tiddlers:
* [[$:/tags/ControlPanel]] for control panel tabs
* [[$:/tags/SideBar]] for sidebar tabs
* [[$:/tags/MoreSideBar]] for tabs in the "more" sidebar
* [[$:/tags/ViewTemplate]] for the view template
* [[$:/tags/ViewToolbar]] for the view mode tiddler toolbar
* [[$:/tags/EditTemplate]] for the edit template
* [[$:/tags/EditToolbar]] for the edit mode tiddler toolbar

View File

@@ -1,7 +1,8 @@
created: 201308270800
modified: 201311242006
created: 20130827080000000
modified: 20140101183713761
tags: concepts
title: TiddlerFilters
type: text/vnd.tiddlywiki
Filters are used in TiddlyWiki to choose tiddlers by specifying simple match criteria.
@@ -16,6 +17,8 @@ The mechanism is easiest to understand by first presenting some example filter s
|`[title[MyTiddler]]` |The single tiddler titled `MyTiddler` (if it exists) |
|`HelloThere Introduction` |The tiddlers titled `HelloThere` and `Introduction` (if they exist) |
|`[tag[important]]` |All tiddlers with the tag `important` |
|`[tag[important]tag[secret]]` |All tiddlers with both the tag `important` and the tag `secret` |
|`[tag[important]!tag[secret]]` |All tiddlers with the tag `important` but not the tag `secret` |
|`[!tag[important]]` |All tiddlers not with the tag `important` |
|`[tag[important]sort[title]]` |All tiddlers with the tag `important` sorted by title |
|`[tag[important]!sort[title]]` |All tiddlers with the tag `important` reverse sorted by title |
@@ -36,6 +39,8 @@ A filter string consists of one or more runs of filter operators that each look
* ''has'': tests whether a tiddler has the field specified in the operand
* ''sort'': sorts the tiddlers by the field specified in the operand
* ''sortcs'': a case sensitive sort of the current tiddlers by the field specified in the operand
* ''nsort'': sorts the tiddlers numerically by the field specified in the operand
* ''nsortcs'': a case sensitive (for the non-numerical elements) numerical sort of the current tiddlers by the field specified in the operand
* ''prefix'': tests whether a tiddlers title starts with the prefix specified in the operand
* ''limit'': limits the number of subresults to the integer specified in the operand
* ''tag'': tests whether a given tag is (`[tag[mytag]]`) or is not (`[!tag[mytag]]`) present on the tiddler

View File

@@ -1,12 +1,14 @@
created: 201308251625
modified: 201308251625
created: 20130825162500000
modified: 20131228084302609
tags: definitions
title: JeremyRuston
type: text/vnd.tiddlywiki
I'm the inventor of TiddlyWiki. I am available through my company FederatialLimited for consultancy and speaking engagements.
You can find me on these services:
* jeremy (at) jermolene (dot) com
* [[Jermolene on GitHub|https://github.com/Jermolene]]
* [[Jermolene on GitTip|https://www.gittip.com/Jermolene/]], a micropayment service
* [[@Jermolene on Twitter|http://twitter.com/#!/jermolene]]

View File

@@ -1,9 +1,17 @@
created: 20130825161100000
modified: 20131129093610165
modified: 20140103135209965
tags: definitions
title: TiddlyFox
type: text/vnd.tiddlywiki
TiddlyFox is an extension for Firefox that allows standalone TiddlyWiki files to save their changes directly to the file system. TiddlyFox works on both desktop and smartphone versions of [[Firefox]].
TiddlyFox is an extension for Firefox that allows standalone TiddlyWiki files to save their changes directly to the file system. TiddlyFox works on both desktop and smartphone versions of [[Firefox]]. See [[Saving with TiddlyFox]] or [[Saving with TiddlyFox on Android]] for detailed instructions.
See [[Saving with TiddlyFox]].
TiddlyFox can be downloaded from the Mozilla Addons site:
https://addons.mozilla.org/en-US/firefox/addon/tiddlyfox/
<<<
You can also install the latest development version of TiddlyFox direct from GitHub:
https://github.com/TiddlyWiki/TiddlyFox/raw/master/tiddlyfox.xpi
<<<

View File

@@ -0,0 +1,9 @@
created: 20131222152210279
modified: 20131222153004673
tags: definitions
title: TiddlyWikiClassic
type: text/vnd.tiddlywiki
"~TiddlyWiki Classic" refers to versions prior to 5.0, when TiddlyWiki was completely rewritten from the ground up. TiddlyWiki Classic is still being maintained at:
http://classic.tiddlywiki.com/

View File

@@ -0,0 +1,10 @@
created: 20140101164042231
modified: 20140101173537147
tags: definitions
title: node-webkit
type: text/vnd.tiddlywiki
node-webkit is an OpenSource application that fuses the functionality of a web browser with that of [[Node.js]]. It makes it possible to use web applications as though they were native apps, with full access to the file system and other native facilities. Learn more from the [[official site|https://github.com/rogerwang/node-webkit]] or [[this introductory blog post|http://dev.tutsplus.com/tutorials/introduction-to-html5-desktop-apps-with-node-webkit--net-36296]].
See [[TiddlyWiki on node-webkit]] for details of how to use TiddlyWiki with node-webkit.

View File

@@ -0,0 +1,25 @@
created: 20131219100608529
modified: 20140102214547249
tags: howto
title: Installing TiddlyWiki on Node.js
type: text/vnd.tiddlywiki
# Install [[Node.js]] from http://nodejs.org
# Open a command line terminal and type:
#> `npm install -g tiddlywiki`
#> If it fails with an error you may need to re-run the command as an administrator:
#> `npm install -g tiddlywiki` (Windows)
#> `sudo npm install -g tiddlywiki` (Mac/Linux)
# Check TiddlyWiki is installed by typing:
#> `tiddlywiki --version`
# In response, you should see TiddlyWiki report its current version (eg `5.0.4-beta`; you may also see other debugging information reported)
# Try it out:
## `mkdir mywiki` to create a folder for a new wiki
## `cd mywiki` to move into the new folder
## `tiddlywiki --server` to start TiddlyWiki
## Visit http://127.0.0.1:8080/ in your browser
## Try editing and creating tiddlers
The `-g` flag causes TiddlyWiki to be installed globally. Without it, TiddlyWiki will only be available in the directory where you installed it.
A slightly different method for installation is recommended if you plan on forking the source code in order to study it or contribute to it. See [[Working with the TiddlyWiki5 repository]].

View File

@@ -0,0 +1,61 @@
created: 20131219100637788
modified: 20140102200458024
tags: howto dev
title: Scripts for TiddlyWiki on Node.js
type: text/vnd.tiddlywiki
! Script Files
The TiddlyWiki5 repo contains several scripts that are used to build and deploy TiddlyWiki5 (.sh for *nix and .cmd for Windows). They can serve as a useful starting point for your own scripts.
!! `bld`: builds tw5.com
This script builds several variants of TiddlyWiki5 for deployment on tiddlywiki.com.
By default, files are output to a folder called `jermolene.github.com`, sibling to the TiddlyWiki5 repo directory. For example:
```
/TiddlyWork/ - Directory for working with TiddlyWiki5
/TiddlyWiki5/ - Directory containing the TiddlyWiki5 repo from GitHub
/jermolene.github.com/ - Directory for output files
```
You can override the build output directory by defining the environment variable `TW5_BUILD_OUTPUT`. The easiest way to do this is to create a personal batch file to invoke TiddlyWiki5 that first sets the environment variable and then invokes `bld`.
The files output by `bld` are:
* `readme.md` main readme file, output to the TiddlyWiki5 directory
* `index.html` TiddlyWiki5 standalone HTML file with content from the `tw5.com` edition
* `empty.html` TiddlyWiki5 standalone HTML file with no content
* `encrypted.html` TiddlyWiki5 standalone HTML file encrypted with the password `password`
* `test.html` TiddlyWiki5 browser-based test suite (see TestingMechanism)
* `static.html` static HTML version of the DefaultTiddlers of the `tw5.com` edition
* `static/*.html` and `static/static.css` static HTML versions of individual tiddlers
`bld` also runs the TiddlyWiki5 Node.js-based test suite (see TestingMechanism)
!! `serve`: serves tw5.com
```
serve.sh <username> [<password>]
```
Or:
```
serve.cmd <username> [<password>]
```
This script starts TiddlyWiki5 running as an HTTP server with the content from the `clientserver` edition. By default, the Node.js serves on port 8080. If the optional `username` parameter is provided, it is used for signing edits. If the `password` is provided then HTTP basic authentication is used.
To experiment with this configuration, run the script and then visit `http://127.0.0.1:8080` in a browser.
Changes made in the browser propagate to the server over HTTP (use the browser developer console to see these requests). The server then syncs changes to the file system (and logs each change to the screen).
!! `wbld`: builds TiddlyWiki5 for TiddlyWeb
This script builds and deploys the code for [[TiddlyWiki5 in the Sky for TiddlyWeb]]. If you want to experiment with your own builds of TiddlyWiki5 for TiddlyWeb you could use this batch file as a base.
!! `2bld`: builds TiddlyWiki 2.6.5
This script builds TiddlyWiki 2.6.5 from the original source and then displays the differences between them (`diff` is used for *nix, `fc` for Windows).

View File

@@ -1,18 +1,28 @@
created: 20131129094353704
modified: 20131212094217023
modified: 20131219100410583
title: TiddlyWiki on Node.js
type: text/vnd.tiddlywiki
Running TiddlyWiki on [[Node.js]] brings several important benefits over and above the single file version:
* You can edit your content on any suitably compatible HTML5 browser, including smartphones and tablets
* Individual tiddlers are stored in separate files, which you can organise as you wish
* The ability to build multiple wikis that blend different combinations of shared and unique content
! Installation
For working on the command line with Node.js, you can install TiddlyWiki via [[npm|http://npmjs.org]]:
{{Installing TiddlyWiki on Node.js}}
```
npm -g install tiddlywiki
```
! Usage
The `-g` flag causes TiddlyWiki to be installed globally.
{{Using TiddlyWiki on Node.js}}
! Working with the TiddlyWiki5 repository
! Upgrading
[[Working with the TiddlyWiki5 repository]] is recommended if you plan on forking the TiddlyWiki5 source code.
{{Upgrading TiddlyWiki on Node.js}}
! Commands
The following commands are available:
<ul><$list filter="[tag[command]]"><li><$link to={{!!title}}><$view field="title"/></$link></li></$list></ul>

View File

@@ -0,0 +1,17 @@
created: 20131219100544073
modified: 20140102214521628
tags: howto
title: Upgrading TiddlyWiki on Node.js
type: text/vnd.tiddlywiki
If you've installed [[TiddlyWiki on Node.js]] on the usual way, when a new version is released you can upgrade it with this command:
```
npm update -g tiddlywiki
```
On Mac or Linux you'll need to add ''sudo'' like this:
```
sudo npm update -g tiddlywiki
```

View File

@@ -0,0 +1,27 @@
created: 20131219100520659
modified: 20131219163807594
tags: howto
title: Using TiddlyWiki on Node.js
type: text/vnd.tiddlywiki
TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on TiddlyWikiFolders, TiddlerFiles and TiddlyWikiFiles.
For example, the following command loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in static HTML:
```
tiddlywiki --verbose --load mywiki.html --rendertiddler ReadMe ./readme.html
```
Running `tiddlywiki` from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces.
The first argument is the optional path to the [[TiddlyWikiFolder|TiddlyWikiFolders]] to be loaded. If not present, then the current directory is used.
The commands and their individual arguments follow, each command being identified by the prefix `--`.
```
tiddlywiki [<wikipath>] [--<command> [<arg>[,<arg>]]]
```
The available commands are:
<ul><$list filter="[tag[command]]"><li><$link to={{!!title}}><$view field="title"/></$link></li></$list></ul>

View File

@@ -1,80 +1,18 @@
created: 20130825214500000
modified: 20131129095206930
tags: edition
created: 20131219100444289
modified: 20140102214438862
tags: dev howto
title: Working with the TiddlyWiki5 repository
type: text/vnd.tiddlywiki
TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on tiddlers, TiddlyWikiFolders, TiddlerFiles and TiddlyWikiFiles. For example, the following command loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in HTML:
! Setting Up
```
node tiddlywiki.js --verbose --load mywiki.html --rendertiddler ReadMe ./readme.html
```
If you plan on working with the TiddlyWiki5 source code then follow these steps:
In order to use TiddlyWiki5 on the command line you must first install node.js from http://nodejs.org/
# Fork the TiddlyWiki5 GitHub repository from https://github.com/Jermolene/TiddlyWiki5
# Clone a local copy of your fork
# Open a command line terminal and change the current working directory to the root of the repo
# Type `npm link` (Windows) or `sudo npm link` (Mac/Linux) to tell [[npm]] to use this copy of the repo as the globally installed one
!!Usage
After this procedure you can work with TiddlyWiki5 via [[npm]] as though it were installed in the usual way with `npm -g install tiddlywiki`.
Running `tiddlywiki.js` from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces.
The first argument is the optional path to the [[TiddlyWikiFolder|TiddlyWikiFolders]] to be loaded. If not present, then the current directory is used.
The commands and their individual arguments follow, each command being identified by the prefix `--`.
```
node tiddlywiki.js [<wikipath>] [--<command> [<arg>[,<arg>]]]
```
!! Script Files
For trying TiddlyWiki5 out under Node.js, several scripts are provided (.sh for *nix and .cmd for Windows):
!!! `bld`: builds tw5.com
This script builds several variants of TiddlyWiki5 for deployment on tiddlywiki.com.
By default, files are output to a folder called `jermolene.github.com`, sibling to the TiddlyWiki5 source directory. For example:
```
/TiddlyWork/ - Directory for working with TiddlyWiki5
/TiddlyWiki5/ - Directory containing the TiddlyWiki5 repo from GitHub
/jermolene.github.com/ - Directory for output files
```
You can override the build output directory by defining the environment variable `TW5_BUILD_OUTPUT`. The easiest way to do this is to create a personal batch file to invoke TiddlyWiki5 that first sets the environment variable and then invokes `bld`.
The files output by `bld` are:
* `readme.md` main readme file, output to the TiddlyWiki5 directory
* `index.html` TiddlyWiki5 standalone HTML file with content from the `tw5.com` edition
* `empty.html` TiddlyWiki5 standalone HTML file with no content
* `encrypted.html` TiddlyWiki5 standalone HTML file encrypted with the password `password`
* `test.html` TiddlyWiki5 browser-based test suite (see TestingMechanism)
* `static.html` static HTML version of the DefaultTiddlers of the `tw5.com` edition
* `static/*.html` and `static/static.css` static HTML versions of individual tiddlers
`bld` also runs the TiddlyWiki5 Node.js-based test suite (see TestingMechanism)
!!! `serve.sh <username>` or `serve.cmd <username>`: serves tw5.com
This script starts TiddlyWiki5 running as an HTTP server with the content from the `clientserver` edition. By default, the Node.js serves on port 8080. If the optional `username` parameter is provided, it is used for signing edits.
To experiment with this configuration, run the script and then visit `http://0.0.0.0:8080` in a browser.
Changes made in the browser propagate to the server over HTTP (use the browser developer console to see these requests). The server then syncs changes to the file system (and logs each change to the screen).
!!! `wbld`: builds TiddlyWiki5 for TiddlyWeb
This script builds and deploys the code for [[TiddlyWiki5 in the Sky for TiddlyWeb]]. If you want to experiment with your own builds of TiddlyWiki5 for TiddlyWeb you could use this batch file as a base.
!!! `2bld`: builds TiddlyWiki 2.6.5
This script builds TiddlyWiki 2.6.5 from the original source and then displays the differences between them (`diff` is used for *nix, `fc` for Windows).
!!Commands
The following commands are available:
<$list filter="[tag[command]sort[title]]">
!!! <$view field="title" format="link"/>
<$transclude />
</$list>
See also [[Scripts for TiddlyWiki on Node.js]].

View File

@@ -0,0 +1,17 @@
created: 20131224074240979
modified: 20131224075348329
tags: howto
title: Setting a favicon
type: text/vnd.tiddlywiki
"favicons" are small icons that most browsers display to help users identify websites.
! favicons in the Browser
When TiddlyWiki starts up in the browser it looks for a tiddler called [[$:/favicon.ico]] and dynamically uses it as the favicon for the page. If you modify the image then the favicon changes instantly to reflect it.
! favicons on the Server
On the server, the ServerCommand will serve the tiddler [[$:/favicon.ico]] at the path `/favicon.ico`.

View File

@@ -0,0 +1,23 @@
created: 20140101174035140
modified: 20140101175304016
title: TiddlyWiki on node-webkit
type: text/vnd.tiddlywiki
[[node-webkit]] allows TiddlyWiki to be set up as a native application for Windows, Mac OS X or Linux.
! Setting up
# Create a folder with the following contents:
## The appropriate copy of [[node-webkit]] for your platform, downloaded from https://github.com/rogerwang/node-webkit
## Your TiddlyWiki HTML file as `index.html`
## A file called `package.json` with the following content:
##> {{packge.json for node-webkit}}
# Run the [[node-webkit]] application
#* If it doesn't work, you may need to unblock the application before your operating system will run it
#** OS X: see http://support.apple.com/kb/PH14369
# Try saving changes in the usual way
! Limitations
MP3 audio and H264 video are not supported without special steps [[described on the node-webkit wiki|https://github.com/rogerwang/node-webkit/wiki/Support-mp3-and-h264-in-video-and-audio-tag]].

View File

@@ -20,7 +20,7 @@ It saves the tiddler ReadMe to the file `./readme.md` in the `text/html` format.
By default, tiddler links will be rendered as `<a>` links to a relative URI consisting of the title of the tiddler. This behaviour can be overridden by defining the macro `tw-wikilink-template`, as is done at the top of the tiddler ReadMe:
```
\define tw-wikilink-template() http://five.tiddlywiki.com/static/$uri_encoded$.html
\define tw-wikilink-template() http://tiddlywiki.com/static/$uri_encoded$.html
```
See the LinkWidget for more details.

View File

@@ -39,7 +39,7 @@ You can include simple text strings in SVG images using the `<text>` element:
HTML or WikiText content can be included within inline SVG images using the `<foreignObject>` element. For example:
<svg width="260px" height="260px"><circle cx="150" cy="150" r="100" fill="blue" stoke="red"/><foreignObject x="70" y="110" width="150" height="180"><body style="background:#dec;">Here is some text that requires a word wrap, and includes a [[link to a tiddler|HelloThere]].</body></foreignObject></svg>
<svg width="260px" height="260px"><circle cx="150" cy="150" r="100" fill="blue" stoke="red"/><foreignObject x="70" y="110" width="150" height="180"><body>Here is some text that requires a word wrap, and includes a [[link to a tiddler|HelloThere]].</body></foreignObject></svg>
! Transcluding SVG elements

View File

@@ -0,0 +1,14 @@
created: 20140101174749409
modified: 20140101174811711
title: packge.json for node-webkit
type: text/plain
{
"name": "tiddlywiki",
"main": "./index.html",
"window": {
"toolbar": true,
"width": 1024,
"height": 768
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

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

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