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

Compare commits

...

91 Commits

Author SHA1 Message Date
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
112 changed files with 795 additions and 3885 deletions

View File

@@ -1,6 +1,6 @@
@echo off
rem build TiddlyWiki5 for five.tiddlywiki.com
rem build TiddlyWiki5 for tiddlywiki.com
rem Set up the build output directory
@@ -35,10 +35,12 @@ 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/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 ^
@@ -88,7 +90,7 @@ node .\tiddlywiki.js ^
rem Make the CNAME file that GitHub Pages requires
echo five.tiddlywiki.com > %TW5_BUILD_OUTPUT%\CNAME
echo tiddlywiki.com > %TW5_BUILD_OUTPUT%\CNAME
rem Run the test edition to run the Node.js tests and to generate test.html for tests in the browser

6
bld.sh
View File

@@ -1,6 +1,6 @@
#!/bin/bash
# build TiddlyWiki5 for five.tiddlywiki.com
# build TiddlyWiki5 for tiddlywiki.com
# Set up the build output directory
@@ -17,7 +17,7 @@ echo "Using TW5_BUILD_OUTPUT as [$TW5_BUILD_OUTPUT]"
# Make the CNAME file that GitHub Pages requires
echo "five.tiddlywiki.com" > $TW5_BUILD_OUTPUT/CNAME
echo "tiddlywiki.com" > $TW5_BUILD_OUTPUT/CNAME
# Create the `static` directories if necessary
@@ -36,10 +36,12 @@ 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/static.template.css $TW5_BUILD_OUTPUT/static/static.css text/plain \
--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html $TW5_BUILD_OUTPUT/static text/plain \

View File

@@ -269,7 +269,7 @@ $tw.utils.stringifyList = function(value) {
// Parse a string array from a bracketted list. For example "OneTiddler [[Another Tiddler]] LastOne"
$tw.utils.parseStringArray = function(value) {
if(typeof value === "string") {
var memberRegExp = /(?:\[\[([^\]]+)\]\])|([^\s]+)/mg,
var memberRegExp = /(?:^|\s)(?:\[\[(.*?)\]\])(?=\s|$)|(\S+)/mg,
results = [],
match;
do {
@@ -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=''>Bug Reports</h2><p>For effective debugging, we need as much information as possible. At a minimum, please try to include:</p><ul><li>A descriptive title</li><li>A summary</li><li>Steps to reproduce</li><li>Expected behaviour</li><li>Context (OS, browser etc.)</li></ul><p>Consider also adding screenshots if it makes things clearer.</p><p>There's a lot of good material on the web about bug reports:</p><ul><li><a class='tw-tiddlylink-external' href='http://mhay68.tumblr.com/post/1648223018/what-makes-a-good-bug-report' target='_blank'>http://mhay68.tumblr.com/post/1648223018/what-makes-a-good-bug-report</a></li><li><a class='tw-tiddlylink-external' href='http://www.chiark.greenend.org.uk/~sgtatham/bugs.html' target='_blank'>http://www.chiark.greenend.org.uk/~sgtatham/bugs.html</a></li></ul><h2 class=''>Pull Requests</h2><p>Like other <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/OpenSource.html'>OpenSource</a> projects, <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a> needs a signed contributor license agreement from individual contributors. This is a legal agreement that allows contributors to assert that they own the copyright of their contribution, and that they agree to license it to the <a class=' tw-tiddlylink tw-tiddlylink-missing' href='http://tiddlywiki.com/static/UnaMesa.html'>UnaMesa</a> Association (the legal entity that owns <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki.html'>TiddlyWiki</a> on behalf of the community).</p><ul><li>For individuals use: <a class='tw-tiddlylink-external' href='https://github.com/Jermolene/TiddlyWiki5/tree/master/licenses/cla-individual.md' target='_blank'>licenses/CLA-individual</a></li><li>For entities use: <a class='tw-tiddlylink-external' href='https://github.com/Jermolene/TiddlyWiki5/tree/master/licenses/cla-entity.md' target='_blank'>licenses/CLA-entity</a></li></ul><p><em>This is a first pass at a CLA for <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki.html'>TiddlyWiki</a>. Please let us know if we missed something important. If we do have to make essential changes to the CLA, there is a possibility that all contributors will need to sign it again</em></p><h3 class=''>How to sign the CLA</h3><pre>git clone https://github.com/Jermolene/TiddlyWiki5.git TiddlyWiki5
cd TiddlyWiki5
git checkout -b sign-cla</pre><p><strong>Add your name and the date to cla-individual.md or cla-entity.md</strong>. Date format (YYYY/MM/DD)
eg: <code>Jeremy Ruston, @Jermolene, 2011/11/22</code></p><pre>git add .
git commit -m &quot;sign contributor license agreement&quot;
git push origin sign-cla</pre><p><strong>Go to your github repo and create a pull request.</strong></p><p><strong>Thank you!</strong></p><h4 class=''>Attribution</h4><p>The CLA documents used for this project where created using <a class='tw-tiddlylink-external' href='http://www.harmonyagreements.org' target='_blank'>Harmony Project Templates</a>. &quot;HA-CLA-I-LIST Version 1.0&quot; for &quot;CLA-individual&quot; and &quot;HA-CLA-E-LIST Version 1.0&quot; for &quot;CLA-entity&quot;
</p><p><em>This file was automatically generated by <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://five.tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a></em>
</p><p><em>This file was automatically generated by <a class=' tw-tiddlylink tw-tiddlylink-resolves' href='http://tiddlywiki.com/static/TiddlyWiki5.html'>TiddlyWiki5</a></em>
</p>

View File

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

View File

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

View File

@@ -95,9 +95,8 @@ SimpleServer.prototype.listen = function(port) {
if(username && password) {
// Check they match
if(self.checkCredentials(request,username,password) !== "ALLOWED") {
response.setHeader("WWW-Authenticate", 'Basic realm="Admin Area"');
response.writeHead(401,"Authentication required",{
"WWW-Authenticate": 'Basic realm="TiddlyWiki5"'
"WWW-Authenticate": 'Basic realm="Please provide your username and password to login to TiddlyWiki5"'
});
response.end();
return;
@@ -197,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$/,
@@ -265,9 +273,8 @@ Command.prototype.execute = function() {
password: password
});
this.server.listen(port);
if(this.commander.verbose) {
console.log("Serving on port " + port);
}
console.log("Serving on port " + port);
console.log("(press ctrl-C to exit)");
return null;
};

View File

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

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

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

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

View File

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

View File

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

View File

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

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

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

@@ -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;
};
@@ -940,7 +940,7 @@ exports.search = function(text,options) {
searchTermsRegExps = [new RegExp("(" + $tw.utils.escapeRegExp(text) + ")",flags)];
}
} else {
terms = text.replace(/( +)/g," ").split(" ");
terms = text.split(/ +/);
if(terms.length === 1 && terms[0] === "") {
searchTermsRegExps = null;
} else {
@@ -1024,16 +1024,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 +1070,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

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

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

View File

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

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

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

@@ -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: 20131218094207015
tags: community
title: Community
type: text/vnd.tiddlywiki
@@ -24,6 +24,8 @@ 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

View File

@@ -1,13 +1,14 @@
created: 201311011114
modified: 201311301614
created: 20131101111400000
modified: 20131218121606089
tags: introduction
title: Contributing
type: text/vnd.tiddlywiki
TiddlyWiki5 welcomes contributions to its code and documentation via [[GitHub|https://github.com/Jermolene/TiddlyWiki5]]. Please take a moment to read these notes to help make the process as smooth as possible.
!! Bug Reports
From the perspective of the developers, a bug report that says little more than "it doesn't work" can be frustrating. For effective debugging, we need as much information as possible. At a minimum, please try to include:
For effective debugging, we need as much information as possible. At a minimum, please try to include:
* A descriptive title
* A summary
@@ -15,6 +16,8 @@ From the perspective of the developers, a bug report that says little more than
* Expected behaviour
* Context (OS, browser etc.)
Consider also adding screenshots if it makes things clearer.
There's a lot of good material on the web about bug reports:
* http://mhay68.tumblr.com/post/1648223018/what-makes-a-good-bug-report
@@ -22,7 +25,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,5 +1,5 @@
created: 20131129090249275
modified: 20131212222628625
modified: 20131215165204528
tags: introduction
title: GettingStarted
type: text/vnd.tiddlywiki

View File

@@ -1,5 +1,5 @@
created: 20130822170200000
modified: 20131213101007165
modified: 20131221173550176
tags: introduction
title: HelloThere
type: text/vnd.tiddlywiki
@@ -8,14 +8,14 @@ Welcome to TiddlyWiki, a complete interactive wiki in JavaScript. It can be used
This is version <<version>> of TiddlyWiki, a major reboot designed [[for the next 25 years|Future of TiddlyWiki]]. It is currently in beta (see the detailed ReleaseHistory). There is a RoadMap for moving to the full release. It is a great time to get involved and support the future development of TiddlyWiki.
//TiddlyWiki is a free, open source project that depends on [[your love and support|HelpingTiddlyWiki]] for 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

@@ -1,16 +1,16 @@
created: 20131202102427114
modified: 20131212094500689
modified: 20131219100250559
tags: howto
title: Upgrading
type: text/vnd.tiddlywiki
There are several methods for upgrading an existing TiddlyWiki document to a new release.
There are several methods for upgrading an existing TiddlyWiki document to a new release. There is a [[different procedure|Upgrading TiddlyWiki on Node.js]] for upgrading [[TiddlyWiki on Node.js]].
! Online upgrading
Note that none of your personal data leaves your browser with this process.
# Visit http://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 +22,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,7 +1,10 @@
title: ServerCommand
created: 20131219163923630
modified: 20131222150651114
tags: command
title: ServerCommand
type: text/vnd.tiddlywiki
The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage - in particular, TiddlyWiki5 is an old-school wiki in the sense that it offers no authentication.
The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage.
At the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for `GET`, `PUT` and `DELETE`.
@@ -12,7 +15,7 @@ At the root, it serves a rendering of a specified tiddler. Away from the root, i
The parameters are:
* ''port'' - port number to serve from (defaults to "8080")
* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/tiddlywiki5.template.html")
* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/save/all")
* ''rendertype'' - the content type to which the root tiddler should be rendered (defaults to "text/plain")
* ''servetype'' - the content type with which the root tiddler should be served (defaults to "text/html")
* ''username'' - the default username for signing edits
@@ -23,5 +26,7 @@ If the password parameter is specified then the browser will prompt the user for
For example:
```
--server 8080 $:/core/tiddlywiki5.template.html text/plain text/html MyUserName
--server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd
```
To run multiple TiddlyWiki servers at the same time you'll need to put each one on a different port.

View File

@@ -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,24 @@
created: 20131219100608529
modified: 20131219163547622
tags: howto
title: Installing TiddlyWiki on Node.js
type: text/vnd.tiddlywiki
# Install [[Node.js]] from http://npmjs.org
# Open a command line terminal and type:
#> `npm -g install tiddlywiki`
#> If it fails with an error you may need to re-run the command as an administrator:
#> `sudo npm -g install tiddlywiki`
# 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://0.0.0.0: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: 20131219100657540
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://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).

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,11 @@
created: 20131219100544073
modified: 20131219100558017
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:
```
sudo npm -g upgrade 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: 20131219163213430
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 `sudo npm link` 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

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

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

View File

@@ -33,4 +33,4 @@ node ./tiddlywiki.js \
Then, open the `test.html` file in the browser to see the test results. There is a prebuilt version of `test.html` at:
http://five.tiddlywiki.com/test.html
http://tiddlywiki.com/test.html

View File

@@ -2,7 +2,7 @@ created: 201308251449
modified: 201308251449
title: ContributingTemplate
\define tw-wikilink-template() http://five.tiddlywiki.com/static/$uri_encoded$.html
\define tw-wikilink-template() http://tiddlywiki.com/static/$uri_encoded$.html
! Contributing to TiddlyWiki5
{{Contributing}}

View File

@@ -1,15 +1,19 @@
created: 20131129094758194
modified: 20131129094808390
modified: 20131222161808390
title: ReadMe
type: text/vnd.tiddlywiki
\define tw-wikilink-template() http://five.tiddlywiki.com/static/$uri_encoded$.html
! Welcome to TiddlyWiki5
\define tw-wikilink-template() http://tiddlywiki.com/static/$uri_encoded$.html
! Welcome to TiddlyWiki
{{HelloThere}}
! Getting started with TiddlyWiki under Node.js
{{TiddlyWiki5 on Node.js}}
{{TiddlyWiki on Node.js}}
//This readme file was automatically generated by TiddlyWiki5//
! Working with the TiddlyWiki5 repository
{{Working with the TiddlyWiki5 repository}}
//This readme file was automatically generated by TiddlyWiki//

View File

@@ -1,5 +1,5 @@
title: TiddlyWiki2ReadMe
\define tw-wikilinks() no
! Building classic TiddlyWiki with TiddlyWiki5
{{Building classic TiddlyWiki with TiddlyWiki5}}
! Building TiddlyWikiClassic
{{Building TiddlyWikiClassic}}

View File

@@ -9,7 +9,7 @@ TiddlySpot is a free hosting service for TiddlyWiki documents from Simon and Dan
TiddlyWiki5 isn't yet built in to TiddlySpot but you can use it by following these steps:
# Sign up for a new wiki at http://tiddlyspot.com/, and remember the wiki name and password
# Open TiddlyWiki5 in your browser from http://five.tiddlywiki.com/empty.html
# Open TiddlyWiki5 in your browser from http://tiddlywiki.com/empty.html
# Fill in the TiddlySpot wikiname and password in the control panel
# Click the "Save Changes" button. You should get a confirmation notification at the top right saying ''Saved wiki''. Saving can take several seconds if you're on a slow connection or working with a large wiki.
#* //This step won't work in Firefox thanks to its default security policy. Google Chrome works fine//

View File

@@ -11,7 +11,7 @@ Instructions for use:
# Open TWEdit
# Touch the title in the centre of the toolbar in order
#* A text box should appear allowing you to enter a URL
# Enter the URL `http://five.tiddlywiki.com/empty.html`
# Enter the URL `http://tiddlywiki.com/empty.html`
# When the empty TiddlyWiki5 has loaded, touch the ''save'' icon (it's the second icon from the right on the top toolbar)
#* An alert box should appear allowing you to enter a local filename
# Enter the filename you wish to use for the document (ending with `.html`)

View File

@@ -1,11 +1,11 @@
created: 20131129092753119
modified: 20131205151815248
created: 20131221085742684
modified: 20131221091154254
tags: howto
title: Saving with TiddlyFox
type: text/vnd.tiddlywiki
# Ensure you have the latest version of [[Firefox]]
# Install the TiddlyFox extension from:
# Install the latest release of the TiddlyFox extension from:
#* https://addons.mozilla.org/en-US/firefox/addon/tiddlyfox/
# Restart [[Firefox]]
# [[Download]] an empty TiddlyWiki by clicking this button:
@@ -19,3 +19,9 @@ type: text/vnd.tiddlywiki
# Save your changes by clicking the {{$:/core/images/save-button}} ''download'' button in the sidebar
#* Look for the yellow notification ''Saved wiki'' at the top right of the window
# Refresh the browser window to verify that your changes have been saved correctly
You can also install the latest development version of TiddlyFox direct from GitHub:
https://github.com/TiddlyWiki/TiddlyFox/raw/master/tiddlyfox.xpi
In case of difficulties downloading the empty wiki, you can download this [[direct link to empty.html|http://tiddlywiki.com/empty.html]].

View File

@@ -1,3 +1,3 @@
title: $:/StaticBanner
<div class="tw-static-alert"><div class="tw-static-alert-inner">This page is part of a static HTML representation of the ~TiddlyWiki at http://five.tiddlywiki.com/</div></div>
<div class="tw-static-alert"><div class="tw-static-alert-inner">This page is part of a static HTML representation of the ~TiddlyWiki at http://tiddlywiki.com/</div></div>

View File

@@ -3,7 +3,7 @@ tags: $:/tags/TiddlerInfo
caption: Static Link
\define makeLink()
http://five.tiddlywiki.com/static/<$view tiddler=<<currentTiddler>> field="title" format="doubleurlencoded"/>.html
http://tiddlywiki.com/static/<$view tiddler=<<currentTiddler>> field="title" format="doubleurlencoded"/>.html
\end
\define outerMakeLink()
<$macrocall $name="makeLink" $output="text/plain"/>

View File

@@ -3,4 +3,7 @@ title: $:/editions/tw5.com/download-empty
\define saveTiddlerFilter()
[[$:/core]] [[$:/isEncrypted]] [[$:/plugins/tiddlywiki/fullscreen]] [[$:/themes/tiddlywiki/snowwhite]] [[$:/themes/tiddlywiki/vanilla]] -[type[text/css]] -[type[application/javascript]has[module-type]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
\end
\define savingEmpty()
yes
\end
{{$:/core/templates/tiddlywiki5.html}}

View File

@@ -1,7 +1,10 @@
title: $:/core/templates/static.content
type: text/vnd.tiddlywiki
hack-to-give-us-something-to-compare-against: yes
<!-- For Google, and people without JavaScript-->
<$reveal state="!!hack-to-give-us-something-to-compare-against" type="nomatch" text=<<savingEmpty>>>
{{HelloThere}}
{{TiddlyWiki}}
@@ -11,3 +14,5 @@ type: text/vnd.tiddlywiki
{{Community}}
{{HelpingTiddlyWiki}}
</$reveal>

View File

@@ -9,7 +9,7 @@ A key capability of WikiText is the ability to make links to other tiddlers or t
* To link to a tiddler by title: `[[Tiddler Title]]`
* To link to a tiddler and specify the text of the link: `[[Displayed Link Title|Tiddler Title]]`
* For tiddler titles that match the CamelCase rules, just typing the title will automatically create a link
* To link to an external website, type the full URL of the site: `http://five.tiddlywiki.com/` or `[[TW5|http://five.tiddlywiki.com/]]`
* To link to an external website, type the full URL of the site: `http://tiddlywiki.com/` or `[[TW5|http://tiddlywiki.com/]]`
You can suppress a link from being recognised by preceding it with `~`. For example:

View File

@@ -124,3 +124,5 @@ David Jade, @davidjade, 2013/11/30
Stephan Hradek, @Skeeve, 2013/11/30
Brian Shaver, @shakerlxxv, 2013/12/07
Paul Bond, @willover, 2013/12/17

1
node_modules/.bin/md2html generated vendored
View File

@@ -1 +0,0 @@
../markdown/bin/md2html.js

2
node_modules/markdown/.npmignore generated vendored
View File

@@ -1,2 +0,0 @@
.seed.yml
test

7
node_modules/markdown/.travis.yml generated vendored
View File

@@ -1,7 +0,0 @@
language: node_js
node_js:
- "0.6"
- "0.8"
- "0.9"
- "0.10"
- "0.11"

View File

@@ -1,35 +0,0 @@
# Changelog for markdown
## v0.5.0 - 2013-07-26
There might be other bug fixes then the ones listed - I've been a bit lax at
updating the changes file, sorry :(
- Fix 'undefined' appearing in output for some cases with blockquotes
- Fix (multiple) global variable leaks. Ooops
- Fix IE8 issues (#68, #74, #97)
- Fix IE8 issue (#86)
- Handle windows line endings (#58)
- Allow spaces in img/link paths (#48)
- Add explicit text of the license to the readme (#74)
- Style tweaks by Xhmikosr (#83, #81, #82)
- Build now tested by TravisCI thanks to sebs (#85)
- Fix 'cuddled' header parsing (#94)
- Fix images inside links mistakenly requiring a title attribute to parse
correctly (#71)
## v0.4.0 - 2012-06-09
- Fix for anchors enclosed by parenthesis (issue #46)
- `npm test` will now run the entire test suite cleanly. (switch tests over to
node-tap). (#21)
- Allow inline elements to appear inside link text (#27)
- Improve link parsing when link is inside parenthesis (#38)
- Actually render image references (#36)
- Improve link parsing when multiple on a line (#5)
- Make it work in IE7/8 (#37)
- Fix blockquote merging/implicit conversion between string/String (#44, #24)
- md2html can now process stdin (#43)
- Fix jslint warnings (#42)
- Fix to correctly render self-closing tags (#40, #35, #28)

185
node_modules/markdown/README.markdown generated vendored
View File

@@ -1,185 +0,0 @@
# markdown-js
Yet another markdown parser, this time for JavaScript. There's a few
options that precede this project but they all treat markdown to HTML
conversion as a single step process. You pass markdown in and get HTML
out, end of story. We had some pretty particular views on how the
process should actually look, which include:
* producing well-formed HTML. This means that `em` and `strong` nesting
is important, as is the ability to output as both HTML and XHTML
* having an intermediate representation to allow processing of parsed
data (we in fact have two, both [JsonML]: a markdown tree and an HTML tree)
* being easily extensible to add new dialects without having to
rewrite the entire parsing mechanics
* having a good test suite. The only test suites we could find tested
massive blocks of input, and passing depended on outputting the HTML
with exactly the same whitespace as the original implementation
[JsonML]: http://jsonml.org/ "JSON Markup Language"
## Installation
Just the `markdown` library:
npm install markdown
Optionally, install `md2html` into your path
npm install -g markdown
## Usage
### Node
The simple way to use it with node is:
```js
var markdown = require( "markdown" ).markdown;
console.log( markdown.toHTML( "Hello *World*!" ) );
```
### Browser
It also works in a browser; here is a complete example:
```html
<!DOCTYPE html>
<html>
<body>
<textarea id="text-input" oninput="this.editor.update()"
rows="6" cols="60">Type **Markdown** here.</textarea>
<div id="preview"> </div>
<script src="lib/markdown.js"></script>
<script>
function Editor(input, preview) {
this.update = function () {
preview.innerHTML = markdown.toHTML(input.value);
};
input.editor = this;
this.update();
}
var $ = function (id) { return document.getElementById(id); };
new Editor($("text-input"), $("preview"));
</script>
</body>
</html>
```
### Command line
Assuming you've installed the `md2html` script (see Installation,
above), you can convert markdown to html:
```bash
# read from a file
md2html /path/to/doc.md > /path/to/doc.html
# or from stdin
echo 'Hello *World*!' | md2html
```
### More options
If you want more control check out the documentation in
[lib/markdown.js] which details all the methods and parameters
available (including examples!). One day we'll get the docs generated
and hosted somewhere for nicer browsing.
[lib/markdown.js]: http://github.com/evilstreak/markdown-js/blob/master/lib/markdown.js
Meanwhile, here's an example of using the multi-step processing to
make wiki-style linking work by filling in missing link references:
```js
var md = require( "markdown" ).markdown,
text = "[Markdown] is a simple text-based [markup language]\n" +
"created by [John Gruber]\n\n" +
"[John Gruber]: http://daringfireball.net";
// parse the markdown into a tree and grab the link references
var tree = md.parse( text ),
refs = tree[ 1 ].references;
// iterate through the tree finding link references
( function find_link_refs( jsonml ) {
if ( jsonml[ 0 ] === "link_ref" ) {
var ref = jsonml[ 1 ].ref;
// if there's no reference, define a wiki link
if ( !refs[ ref ] ) {
refs[ ref ] = {
href: "http://en.wikipedia.org/wiki/" + ref.replace(/\s+/, "_" )
};
}
}
else if ( Array.isArray( jsonml[ 1 ] ) ) {
jsonml[ 1 ].forEach( find_link_refs );
}
else if ( Array.isArray( jsonml[ 2 ] ) ) {
jsonml[ 2 ].forEach( find_link_refs );
}
} )( tree );
// convert the tree into html
var html = md.renderJsonML( md.toHTMLTree( tree ) );
console.log( html );
```
## Intermediate Representation
Internally the process to convert a chunk of markdown into a chunk of
HTML has three steps:
1. Parse the markdown into a JsonML tree. Any references found in the
parsing are stored in the attribute hash of the root node under the
key `references`.
2. Convert the markdown tree into an HTML tree. Rename any nodes that
need it (`bulletlist` to `ul` for example) and lookup any references
used by links or images. Remove the references attribute once done.
3. Stringify the HTML tree being careful not to wreck whitespace where
whitespace is important (surrounding inline elements for example).
Each step of this process can be called individually if you need to do
some processing or modification of the data at an intermediate stage.
For example, you may want to grab a list of all URLs linked to in the
document before rendering it to HTML which you could do by recursing
through the HTML tree looking for `a` nodes.
## Running tests
To run the tests under node you will need tap installed (it's listed as a
`devDependencies` so `npm install` from the checkout should be enough), then do
$ npm test
## Contributing
Do the usual github fork and pull request dance. Add yourself to the
contributors section of [package.json](/package.json) too if you want to.
## License
Released under the MIT license.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

52
node_modules/markdown/bin/md2html.js generated vendored
View File

@@ -1,52 +0,0 @@
#!/usr/bin/env node
(function () {
"use strict";
var fs = require("fs")
, markdown = require("markdown").markdown
, nopt = require("nopt")
, stream
, opts
, buffer = ""
;
opts = nopt(
{ "dialect": [ "Gruber", "Maruku"]
, "help": Boolean
}
);
if (opts.help) {
var name = process.argv[1].split("/").pop()
console.warn( require("util").format(
"usage: %s [--dialect=DIALECT] FILE\n\nValid dialects are Gruber (the default) or Maruku",
name
) );
process.exit(0);
}
var fullpath = opts.argv.remain[0];
if (fullpath && fullpath !== "-") {
stream = fs.createReadStream(fullpath);
} else {
stream = process.stdin;
}
stream.resume();
stream.setEncoding("utf8");
stream.on("error", function(error) {
console.error(error.toString());
process.exit(1);
});
stream.on("data", function(data) {
buffer += data;
});
stream.on("end", function() {
var html = markdown.toHTML(buffer, opts.dialect);
console.log(html);
});
}())

3
node_modules/markdown/lib/index.js generated vendored
View File

@@ -1,3 +0,0 @@
// super simple module for the most common nodejs use case.
exports.markdown = require("./markdown");
exports.parse = exports.markdown.toHTML;

View File

@@ -1,10 +0,0 @@
{
"folders":
[
{
"path": "/Users/ash/code/js/markdown-js",
"folder_exclude_patterns": ["node_modules"],
"file_exclude_patterns": ["*.sublime-*"]
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
../nopt/bin/nopt.js

View File

@@ -1 +0,0 @@
node_modules

View File

@@ -1,23 +0,0 @@
Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,210 +0,0 @@
If you want to write an option parser, and have it be good, there are
two ways to do it. The Right Way, and the Wrong Way.
The Wrong Way is to sit down and write an option parser. We've all done
that.
The Right Way is to write some complex configurable program with so many
options that you go half-insane just trying to manage them all, and put
it off with duct-tape solutions until you see exactly to the core of the
problem, and finally snap and write an awesome option parser.
If you want to write an option parser, don't write an option parser.
Write a package manager, or a source control system, or a service
restarter, or an operating system. You probably won't end up with a
good one of those, but if you don't give up, and you are relentless and
diligent enough in your procrastination, you may just end up with a very
nice option parser.
## USAGE
// my-program.js
var nopt = require("nopt")
, Stream = require("stream").Stream
, path = require("path")
, knownOpts = { "foo" : [String, null]
, "bar" : [Stream, Number]
, "baz" : path
, "bloo" : [ "big", "medium", "small" ]
, "flag" : Boolean
, "pick" : Boolean
, "many" : [String, Array]
}
, shortHands = { "foofoo" : ["--foo", "Mr. Foo"]
, "b7" : ["--bar", "7"]
, "m" : ["--bloo", "medium"]
, "p" : ["--pick"]
, "f" : ["--flag"]
}
// everything is optional.
// knownOpts and shorthands default to {}
// arg list defaults to process.argv
// slice defaults to 2
, parsed = nopt(knownOpts, shortHands, process.argv, 2)
console.log(parsed)
This would give you support for any of the following:
```bash
$ node my-program.js --foo "blerp" --no-flag
{ "foo" : "blerp", "flag" : false }
$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag
{ bar: 7, foo: "Mr. Hand", flag: true }
$ node my-program.js --foo "blerp" -f -----p
{ foo: "blerp", flag: true, pick: true }
$ node my-program.js -fp --foofoo
{ foo: "Mr. Foo", flag: true, pick: true }
$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.
{ foo: "Mr. Foo", argv: { remain: ["-fp"] } }
$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.
{ blatzk: 1000, flag: true, pick: true }
$ node my-program.js --blatzk true -fp # but they need a value
{ blatzk: true, flag: true, pick: true }
$ node my-program.js --no-blatzk -fp # unless they start with "no-"
{ blatzk: false, flag: true, pick: true }
$ node my-program.js --baz b/a/z # known paths are resolved.
{ baz: "/Users/isaacs/b/a/z" }
# if Array is one of the types, then it can take many
# values, and will always be an array. The other types provided
# specify what types are allowed in the list.
$ node my-program.js --many 1 --many null --many foo
{ many: ["1", "null", "foo"] }
$ node my-program.js --many foo
{ many: ["foo"] }
```
Read the tests at the bottom of `lib/nopt.js` for more examples of
what this puppy can do.
## Types
The following types are supported, and defined on `nopt.typeDefs`
* String: A normal string. No parsing is done.
* path: A file system path. Gets resolved against cwd if not absolute.
* url: A url. If it doesn't parse, it isn't accepted.
* Number: Must be numeric.
* Date: Must parse as a date. If it does, and `Date` is one of the options,
then it will return a Date object, not a string.
* Boolean: Must be either `true` or `false`. If an option is a boolean,
then it does not need a value, and its presence will imply `true` as
the value. To negate boolean flags, do `--no-whatever` or `--whatever
false`
* NaN: Means that the option is strictly not allowed. Any value will
fail.
* Stream: An object matching the "Stream" class in node. Valuable
for use when validating programmatically. (npm uses this to let you
supply any WriteStream on the `outfd` and `logfd` config options.)
* Array: If `Array` is specified as one of the types, then the value
will be parsed as a list of options. This means that multiple values
can be specified, and that the value will always be an array.
If a type is an array of values not on this list, then those are
considered valid values. For instance, in the example above, the
`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`,
and any other value will be rejected.
When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be
interpreted as their JavaScript equivalents, and numeric values will be
interpreted as a number.
You can also mix types and values, or multiple types, in a list. For
instance `{ blah: [Number, null] }` would allow a value to be set to
either a Number or null. When types are ordered, this implies a
preference, and the first type that can be used to properly interpret
the value will be used.
To define a new type, add it to `nopt.typeDefs`. Each item in that
hash is an object with a `type` member and a `validate` method. The
`type` member is an object that matches what goes in the type list. The
`validate` method is a function that gets called with `validate(data,
key, val)`. Validate methods should assign `data[key]` to the valid
value of `val` if it can be handled properly, or return boolean
`false` if it cannot.
You can also call `nopt.clean(data, types, typeDefs)` to clean up a
config object and remove its invalid properties.
## Error Handling
By default, nopt outputs a warning to standard error when invalid
options are found. You can change this behavior by assigning a method
to `nopt.invalidHandler`. This method will be called with
the offending `nopt.invalidHandler(key, val, types)`.
If no `nopt.invalidHandler` is assigned, then it will console.error
its whining. If it is assigned to boolean `false` then the warning is
suppressed.
## Abbreviations
Yes, they are supported. If you define options like this:
```javascript
{ "foolhardyelephants" : Boolean
, "pileofmonkeys" : Boolean }
```
Then this will work:
```bash
node program.js --foolhar --pil
node program.js --no-f --pileofmon
# etc.
```
## Shorthands
Shorthands are a hash of shorter option names to a snippet of args that
they expand to.
If multiple one-character shorthands are all combined, and the
combination does not unambiguously match any other option or shorthand,
then they will be broken up into their constituent parts. For example:
```json
{ "s" : ["--loglevel", "silent"]
, "g" : "--global"
, "f" : "--force"
, "p" : "--parseable"
, "l" : "--long"
}
```
```bash
npm ls -sgflp
# just like doing this:
npm ls --loglevel silent --global --force --long --parseable
```
## The Rest of the args
The config object returned by nopt is given a special member called
`argv`, which is an object with the following fields:
* `remain`: The remaining args after all the parsing has occurred.
* `original`: The args as they originally appeared.
* `cooked`: The args after flags and shorthands are expanded.
## Slicing
Node programs are called with more or less the exact argv as it appears
in C land, after the v8 and node-specific options have been plucked off.
As such, `argv[0]` is always `node` and `argv[1]` is always the
JavaScript program being run.
That's usually not very useful to you. So they're sliced off by
default. If you want them, then you can pass in `0` as the last
argument, or any other number that you'd like to slice off the start of
the list.

View File

@@ -1,51 +0,0 @@
#!/usr/bin/env node
var nopt = require("../lib/nopt")
, types = { num: Number
, bool: Boolean
, help: Boolean
, list: Array
, "num-list": [Number, Array]
, "str-list": [String, Array]
, "bool-list": [Boolean, Array]
, str: String
, clear: Boolean
, config: Boolean
, length: Number
}
, shorthands = { s: [ "--str", "astring" ]
, b: [ "--bool" ]
, nb: [ "--no-bool" ]
, tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ]
, "?": ["--help"]
, h: ["--help"]
, H: ["--help"]
, n: [ "--num", "125" ]
, c: ["--config"]
, l: ["--length"]
}
, parsed = nopt( types
, shorthands
, process.argv
, 2 )
console.log("parsed", parsed)
if (parsed.help) {
console.log("")
console.log("nopt cli tester")
console.log("")
console.log("types")
console.log(Object.keys(types).map(function M (t) {
var type = types[t]
if (Array.isArray(type)) {
return [t, type.map(function (type) { return type.name })]
}
return [t, type && type.name]
}).reduce(function (s, i) {
s[i[0]] = i[1]
return s
}, {}))
console.log("")
console.log("shorthands")
console.log(shorthands)
}

View File

@@ -1,30 +0,0 @@
#!/usr/bin/env node
//process.env.DEBUG_NOPT = 1
// my-program.js
var nopt = require("../lib/nopt")
, Stream = require("stream").Stream
, path = require("path")
, knownOpts = { "foo" : [String, null]
, "bar" : [Stream, Number]
, "baz" : path
, "bloo" : [ "big", "medium", "small" ]
, "flag" : Boolean
, "pick" : Boolean
}
, shortHands = { "foofoo" : ["--foo", "Mr. Foo"]
, "b7" : ["--bar", "7"]
, "m" : ["--bloo", "medium"]
, "p" : ["--pick"]
, "f" : ["--flag", "true"]
, "g" : ["--flag"]
, "s" : "--flag"
}
// everything is optional.
// knownOpts and shorthands default to {}
// arg list defaults to process.argv
// slice defaults to 2
, parsed = nopt(knownOpts, shortHands, process.argv, 2)
console.log("parsed =\n"+ require("util").inspect(parsed))

View File

@@ -1,612 +0,0 @@
// info about each config option.
var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
? function () { console.error.apply(console, arguments) }
: function () {}
var url = require("url")
, path = require("path")
, Stream = require("stream").Stream
, abbrev = require("abbrev")
module.exports = exports = nopt
exports.clean = clean
exports.typeDefs =
{ String : { type: String, validate: validateString }
, Boolean : { type: Boolean, validate: validateBoolean }
, url : { type: url, validate: validateUrl }
, Number : { type: Number, validate: validateNumber }
, path : { type: path, validate: validatePath }
, Stream : { type: Stream, validate: validateStream }
, Date : { type: Date, validate: validateDate }
}
function nopt (types, shorthands, args, slice) {
args = args || process.argv
types = types || {}
shorthands = shorthands || {}
if (typeof slice !== "number") slice = 2
debug(types, shorthands, args, slice)
args = args.slice(slice)
var data = {}
, key
, remain = []
, cooked = args
, original = args.slice(0)
parse(args, data, remain, types, shorthands)
// now data is full
clean(data, types, exports.typeDefs)
data.argv = {remain:remain,cooked:cooked,original:original}
Object.defineProperty(data.argv, 'toString', { value: function () {
return this.original.map(JSON.stringify).join(" ")
}, enumerable: false })
return data
}
function clean (data, types, typeDefs) {
typeDefs = typeDefs || exports.typeDefs
var remove = {}
, typeDefault = [false, true, null, String, Number, Array]
Object.keys(data).forEach(function (k) {
if (k === "argv") return
var val = data[k]
, isArray = Array.isArray(val)
, type = types[k]
if (!isArray) val = [val]
if (!type) type = typeDefault
if (type === Array) type = typeDefault.concat(Array)
if (!Array.isArray(type)) type = [type]
debug("val=%j", val)
debug("types=", type)
val = val.map(function (val) {
// if it's an unknown value, then parse false/true/null/numbers/dates
if (typeof val === "string") {
debug("string %j", val)
val = val.trim()
if ((val === "null" && ~type.indexOf(null))
|| (val === "true" &&
(~type.indexOf(true) || ~type.indexOf(Boolean)))
|| (val === "false" &&
(~type.indexOf(false) || ~type.indexOf(Boolean)))) {
val = JSON.parse(val)
debug("jsonable %j", val)
} else if (~type.indexOf(Number) && !isNaN(val)) {
debug("convert to number", val)
val = +val
} else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
debug("convert to date", val)
val = new Date(val)
}
}
if (!types.hasOwnProperty(k)) {
return val
}
// allow `--no-blah` to set 'blah' to null if null is allowed
if (val === false && ~type.indexOf(null) &&
!(~type.indexOf(false) || ~type.indexOf(Boolean))) {
val = null
}
var d = {}
d[k] = val
debug("prevalidated val", d, val, types[k])
if (!validate(d, k, val, types[k], typeDefs)) {
if (exports.invalidHandler) {
exports.invalidHandler(k, val, types[k], data)
} else if (exports.invalidHandler !== false) {
debug("invalid: "+k+"="+val, types[k])
}
return remove
}
debug("validated val", d, val, types[k])
return d[k]
}).filter(function (val) { return val !== remove })
if (!val.length) delete data[k]
else if (isArray) {
debug(isArray, data[k], val)
data[k] = val
} else data[k] = val[0]
debug("k=%s val=%j", k, val, data[k])
})
}
function validateString (data, k, val) {
data[k] = String(val)
}
function validatePath (data, k, val) {
data[k] = path.resolve(String(val))
return true
}
function validateNumber (data, k, val) {
debug("validate Number %j %j %j", k, val, isNaN(val))
if (isNaN(val)) return false
data[k] = +val
}
function validateDate (data, k, val) {
debug("validate Date %j %j %j", k, val, Date.parse(val))
var s = Date.parse(val)
if (isNaN(s)) return false
data[k] = new Date(val)
}
function validateBoolean (data, k, val) {
if (val instanceof Boolean) val = val.valueOf()
else if (typeof val === "string") {
if (!isNaN(val)) val = !!(+val)
else if (val === "null" || val === "false") val = false
else val = true
} else val = !!val
data[k] = val
}
function validateUrl (data, k, val) {
val = url.parse(String(val))
if (!val.host) return false
data[k] = val.href
}
function validateStream (data, k, val) {
if (!(val instanceof Stream)) return false
data[k] = val
}
function validate (data, k, val, type, typeDefs) {
// arrays are lists of types.
if (Array.isArray(type)) {
for (var i = 0, l = type.length; i < l; i ++) {
if (type[i] === Array) continue
if (validate(data, k, val, type[i], typeDefs)) return true
}
delete data[k]
return false
}
// an array of anything?
if (type === Array) return true
// NaN is poisonous. Means that something is not allowed.
if (type !== type) {
debug("Poison NaN", k, val, type)
delete data[k]
return false
}
// explicit list of values
if (val === type) {
debug("Explicitly allowed %j", val)
// if (isArray) (data[k] = data[k] || []).push(val)
// else data[k] = val
data[k] = val
return true
}
// now go through the list of typeDefs, validate against each one.
var ok = false
, types = Object.keys(typeDefs)
for (var i = 0, l = types.length; i < l; i ++) {
debug("test type %j %j %j", k, val, types[i])
var t = typeDefs[types[i]]
if (t && type === t.type) {
var d = {}
ok = false !== t.validate(d, k, val)
val = d[k]
if (ok) {
// if (isArray) (data[k] = data[k] || []).push(val)
// else data[k] = val
data[k] = val
break
}
}
}
debug("OK? %j (%j %j %j)", ok, k, val, types[i])
if (!ok) delete data[k]
return ok
}
function parse (args, data, remain, types, shorthands) {
debug("parse", args, data, remain)
var key = null
, abbrevs = abbrev(Object.keys(types))
, shortAbbr = abbrev(Object.keys(shorthands))
for (var i = 0; i < args.length; i ++) {
var arg = args[i]
debug("arg", arg)
if (arg.match(/^-{2,}$/)) {
// done with keys.
// the rest are args.
remain.push.apply(remain, args.slice(i + 1))
args[i] = "--"
break
}
var hadEq = false
if (arg.charAt(0) === "-" && arg.length > 1) {
if (arg.indexOf("=") !== -1) {
hadEq = true
var v = arg.split("=")
arg = v.shift()
v = v.join("=")
args.splice.apply(args, [i, 1].concat([arg, v]))
}
// see if it's a shorthand
// if so, splice and back up to re-parse it.
var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
debug("arg=%j shRes=%j", arg, shRes)
if (shRes) {
debug(arg, shRes)
args.splice.apply(args, [i, 1].concat(shRes))
if (arg !== shRes[0]) {
i --
continue
}
}
arg = arg.replace(/^-+/, "")
var no = null
while (arg.toLowerCase().indexOf("no-") === 0) {
no = !no
arg = arg.substr(3)
}
if (abbrevs[arg]) arg = abbrevs[arg]
var isArray = types[arg] === Array ||
Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1
// allow unknown things to be arrays if specified multiple times.
if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) {
if (!Array.isArray(data[arg]))
data[arg] = [data[arg]]
isArray = true
}
var val
, la = args[i + 1]
var isBool = typeof no === 'boolean' ||
types[arg] === Boolean ||
Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 ||
(typeof types[arg] === 'undefined' && !hadEq) ||
(la === "false" &&
(types[arg] === null ||
Array.isArray(types[arg]) && ~types[arg].indexOf(null)))
if (isBool) {
// just set and move along
val = !no
// however, also support --bool true or --bool false
if (la === "true" || la === "false") {
val = JSON.parse(la)
la = null
if (no) val = !val
i ++
}
// also support "foo":[Boolean, "bar"] and "--foo bar"
if (Array.isArray(types[arg]) && la) {
if (~types[arg].indexOf(la)) {
// an explicit type
val = la
i ++
} else if ( la === "null" && ~types[arg].indexOf(null) ) {
// null allowed
val = null
i ++
} else if ( !la.match(/^-{2,}[^-]/) &&
!isNaN(la) &&
~types[arg].indexOf(Number) ) {
// number
val = +la
i ++
} else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) {
// string
val = la
i ++
}
}
if (isArray) (data[arg] = data[arg] || []).push(val)
else data[arg] = val
continue
}
if (la && la.match(/^-{2,}$/)) {
la = undefined
i --
}
val = la === undefined ? true : la
if (isArray) (data[arg] = data[arg] || []).push(val)
else data[arg] = val
i ++
continue
}
remain.push(arg)
}
}
function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
// handle single-char shorthands glommed together, like
// npm ls -glp, but only if there is one dash, and only if
// all of the chars are single-char shorthands, and it's
// not a match to some other abbrev.
arg = arg.replace(/^-+/, '')
// if it's an exact known option, then don't go any further
if (abbrevs[arg] === arg)
return null
// if it's an exact known shortopt, same deal
if (shorthands[arg]) {
// make it an array, if it's a list of words
if (shorthands[arg] && !Array.isArray(shorthands[arg]))
shorthands[arg] = shorthands[arg].split(/\s+/)
return shorthands[arg]
}
// first check to see if this arg is a set of single-char shorthands
var singles = shorthands.___singles
if (!singles) {
singles = Object.keys(shorthands).filter(function (s) {
return s.length === 1
}).reduce(function (l,r) {
l[r] = true
return l
}, {})
shorthands.___singles = singles
debug('shorthand singles', singles)
}
var chrs = arg.split("").filter(function (c) {
return singles[c]
})
if (chrs.join("") === arg) return chrs.map(function (c) {
return shorthands[c]
}).reduce(function (l, r) {
return l.concat(r)
}, [])
// if it's an arg abbrev, and not a literal shorthand, then prefer the arg
if (abbrevs[arg] && !shorthands[arg])
return null
// if it's an abbr for a shorthand, then use that
if (shortAbbr[arg])
arg = shortAbbr[arg]
// make it an array, if it's a list of words
if (shorthands[arg] && !Array.isArray(shorthands[arg]))
shorthands[arg] = shorthands[arg].split(/\s+/)
return shorthands[arg]
}
if (module === require.main) {
var assert = require("assert")
, util = require("util")
, shorthands =
{ s : ["--loglevel", "silent"]
, d : ["--loglevel", "info"]
, dd : ["--loglevel", "verbose"]
, ddd : ["--loglevel", "silly"]
, noreg : ["--no-registry"]
, reg : ["--registry"]
, "no-reg" : ["--no-registry"]
, silent : ["--loglevel", "silent"]
, verbose : ["--loglevel", "verbose"]
, h : ["--usage"]
, H : ["--usage"]
, "?" : ["--usage"]
, help : ["--usage"]
, v : ["--version"]
, f : ["--force"]
, desc : ["--description"]
, "no-desc" : ["--no-description"]
, "local" : ["--no-global"]
, l : ["--long"]
, p : ["--parseable"]
, porcelain : ["--parseable"]
, g : ["--global"]
}
, types =
{ aoa: Array
, nullstream: [null, Stream]
, date: Date
, str: String
, browser : String
, cache : path
, color : ["always", Boolean]
, depth : Number
, description : Boolean
, dev : Boolean
, editor : path
, force : Boolean
, global : Boolean
, globalconfig : path
, group : [String, Number]
, gzipbin : String
, logfd : [Number, Stream]
, loglevel : ["silent","win","error","warn","info","verbose","silly"]
, long : Boolean
, "node-version" : [false, String]
, npaturl : url
, npat : Boolean
, "onload-script" : [false, String]
, outfd : [Number, Stream]
, parseable : Boolean
, pre: Boolean
, prefix: path
, proxy : url
, "rebuild-bundle" : Boolean
, registry : url
, searchopts : String
, searchexclude: [null, String]
, shell : path
, t: [Array, String]
, tag : String
, tar : String
, tmp : path
, "unsafe-perm" : Boolean
, usage : Boolean
, user : String
, username : String
, userconfig : path
, version : Boolean
, viewer: path
, _exit : Boolean
}
; [["-v", {version:true}, []]
,["---v", {version:true}, []]
,["ls -s --no-reg connect -d",
{loglevel:"info",registry:null},["ls","connect"]]
,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
,["ls --registry blargle", {}, ["ls"]]
,["--no-registry", {registry:null}, []]
,["--no-color true", {color:false}, []]
,["--no-color false", {color:true}, []]
,["--no-color", {color:false}, []]
,["--color false", {color:false}, []]
,["--color --logfd 7", {logfd:7,color:true}, []]
,["--color=true", {color:true}, []]
,["--logfd=10", {logfd:10}, []]
,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
,["--tmp=tmp -tar=gtar",
{tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
,["--logfd x", {}, []]
,["a -true -- -no-false", {true:true},["a","-no-false"]]
,["a -no-false", {false:false},["a"]]
,["a -no-no-true", {true:true}, ["a"]]
,["a -no-no-no-false", {false:false}, ["a"]]
,["---NO-no-No-no-no-no-nO-no-no"+
"-No-no-no-no-no-no-no-no-no"+
"-no-no-no-no-NO-NO-no-no-no-no-no-no"+
"-no-body-can-do-the-boogaloo-like-I-do"
,{"body-can-do-the-boogaloo-like-I-do":false}, []]
,["we are -no-strangers-to-love "+
"--you-know=the-rules --and=so-do-i "+
"---im-thinking-of=a-full-commitment "+
"--no-you-would-get-this-from-any-other-guy "+
"--no-gonna-give-you-up "+
"-no-gonna-let-you-down=true "+
"--no-no-gonna-run-around false "+
"--desert-you=false "+
"--make-you-cry false "+
"--no-tell-a-lie "+
"--no-no-and-hurt-you false"
,{"strangers-to-love":false
,"you-know":"the-rules"
,"and":"so-do-i"
,"you-would-get-this-from-any-other-guy":false
,"gonna-give-you-up":false
,"gonna-let-you-down":false
,"gonna-run-around":false
,"desert-you":false
,"make-you-cry":false
,"tell-a-lie":false
,"and-hurt-you":false
},["we", "are"]]
,["-t one -t two -t three"
,{t: ["one", "two", "three"]}
,[]]
,["-t one -t null -t three four five null"
,{t: ["one", "null", "three"]}
,["four", "five", "null"]]
,["-t foo"
,{t:["foo"]}
,[]]
,["--no-t"
,{t:["false"]}
,[]]
,["-no-no-t"
,{t:["true"]}
,[]]
,["-aoa one -aoa null -aoa 100"
,{aoa:["one", null, 100]}
,[]]
,["-str 100"
,{str:"100"}
,[]]
,["--color always"
,{color:"always"}
,[]]
,["--no-nullstream"
,{nullstream:null}
,[]]
,["--nullstream false"
,{nullstream:null}
,[]]
,["--notadate=2011-01-25"
,{notadate: "2011-01-25"}
,[]]
,["--date 2011-01-25"
,{date: new Date("2011-01-25")}
,[]]
,["-cl 1"
,{config: true, length: 1}
,[]
,{config: Boolean, length: Number, clear: Boolean}
,{c: "--config", l: "--length"}]
,["--acount bla"
,{"acount":true}
,["bla"]
,{account: Boolean, credentials: Boolean, options: String}
,{a:"--account", c:"--credentials",o:"--options"}]
,["--clear"
,{clear:true}
,[]
,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean}
,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}]
,["--file -"
,{"file":"-"}
,[]
,{file:String}
,{}]
,["--file -"
,{"file":true}
,["-"]
,{file:Boolean}
,{}]
].forEach(function (test) {
var argv = test[0].split(/\s+/)
, opts = test[1]
, rem = test[2]
, actual = nopt(test[3] || types, test[4] || shorthands, argv, 0)
, parsed = actual.argv
delete actual.argv
console.log(util.inspect(actual, false, 2, true), parsed.remain)
for (var i in opts) {
var e = JSON.stringify(opts[i])
, a = JSON.stringify(actual[i] === undefined ? null : actual[i])
if (e && typeof e === "object") {
assert.deepEqual(e, a)
} else {
assert.equal(e, a)
}
}
assert.deepEqual(rem, parsed.remain)
})
}

View File

@@ -1,23 +0,0 @@
Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
All rights reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,23 +0,0 @@
# abbrev-js
Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
Usage:
var abbrev = require("abbrev");
abbrev("foo", "fool", "folding", "flop");
// returns:
{ fl: 'flop'
, flo: 'flop'
, flop: 'flop'
, fol: 'folding'
, fold: 'folding'
, foldi: 'folding'
, foldin: 'folding'
, folding: 'folding'
, foo: 'foo'
, fool: 'fool'
}
This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.

View File

@@ -1,111 +0,0 @@
module.exports = exports = abbrev.abbrev = abbrev
abbrev.monkeyPatch = monkeyPatch
function monkeyPatch () {
Object.defineProperty(Array.prototype, 'abbrev', {
value: function () { return abbrev(this) },
enumerable: false, configurable: true, writable: true
})
Object.defineProperty(Object.prototype, 'abbrev', {
value: function () { return abbrev(Object.keys(this)) },
enumerable: false, configurable: true, writable: true
})
}
function abbrev (list) {
if (arguments.length !== 1 || !Array.isArray(list)) {
list = Array.prototype.slice.call(arguments, 0)
}
for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
}
// sort them lexicographically, so that they're next to their nearest kin
args = args.sort(lexSort)
// walk through each, seeing how much it has in common with the next and previous
var abbrevs = {}
, prev = ""
for (var i = 0, l = args.length ; i < l ; i ++) {
var current = args[i]
, next = args[i + 1] || ""
, nextMatches = true
, prevMatches = true
if (current === next) continue
for (var j = 0, cl = current.length ; j < cl ; j ++) {
var curChar = current.charAt(j)
nextMatches = nextMatches && curChar === next.charAt(j)
prevMatches = prevMatches && curChar === prev.charAt(j)
if (!nextMatches && !prevMatches) {
j ++
break
}
}
prev = current
if (j === cl) {
abbrevs[current] = current
continue
}
for (var a = current.substr(0, j) ; j <= cl ; j ++) {
abbrevs[a] = current
a += current.charAt(j)
}
}
return abbrevs
}
function lexSort (a, b) {
return a === b ? 0 : a > b ? 1 : -1
}
// tests
if (module === require.main) {
var assert = require("assert")
var util = require("util")
console.log("running tests")
function test (list, expect) {
var actual = abbrev(list)
assert.deepEqual(actual, expect,
"abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+
"actual: "+util.inspect(actual))
actual = abbrev.apply(exports, list)
assert.deepEqual(abbrev.apply(exports, list), expect,
"abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+
"actual: "+util.inspect(actual))
}
test([ "ruby", "ruby", "rules", "rules", "rules" ],
{ rub: 'ruby'
, ruby: 'ruby'
, rul: 'rules'
, rule: 'rules'
, rules: 'rules'
})
test(["fool", "foom", "pool", "pope"],
{ fool: 'fool'
, foom: 'foom'
, poo: 'pool'
, pool: 'pool'
, pop: 'pope'
, pope: 'pope'
})
test(["a", "ab", "abc", "abcd", "abcde", "acde"],
{ a: 'a'
, ab: 'ab'
, abc: 'abc'
, abcd: 'abcd'
, abcde: 'abcde'
, ac: 'acde'
, acd: 'acde'
, acde: 'acde'
})
console.log("pass")
}

View File

@@ -1,28 +0,0 @@
{
"name": "abbrev",
"version": "1.0.4",
"description": "Like ruby's abbrev module, but in js",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me"
},
"main": "./lib/abbrev.js",
"scripts": {
"test": "node lib/abbrev.js"
},
"repository": {
"type": "git",
"url": "http://github.com/isaacs/abbrev-js"
},
"license": {
"type": "MIT",
"url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE"
},
"readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n var abbrev = require(\"abbrev\");\n abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n \n // returns:\n { fl: 'flop'\n , flo: 'flop'\n , flop: 'flop'\n , fol: 'folding'\n , fold: 'folding'\n , foldi: 'folding'\n , foldin: 'folding'\n , folding: 'folding'\n , foo: 'foo'\n , fool: 'fool'\n }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/abbrev-js/issues"
},
"_id": "abbrev@1.0.4",
"_from": "abbrev@1"
}

File diff suppressed because one or more lines are too long

64
node_modules/markdown/package.json generated vendored

File diff suppressed because one or more lines are too long

5
node_modules/markdown/seed.yml generated vendored
View File

@@ -1,5 +0,0 @@
---
name: markdown-js
description: JavaScript implementation of Markdown
tags: markdown parser
version: 0.1.2

View File

@@ -1,7 +1,7 @@
{
"name": "tiddlywiki",
"preferGlobal": "true",
"version": "5.0.2-beta",
"version": "5.0.5-beta",
"author": "Jeremy Ruston <jeremy@jermolene.com>",
"description": "a non-linear personal web notebook",
"contributors": [

View File

@@ -38,11 +38,15 @@ function FileSystemAdaptor(syncer) {
});
}
for(var f in $tw.boot.files) {
var fileInfo = $tw.boot.files[f];
this.setwatcher(fileInfo.filepath, f);
}
// Create the <wiki>/tiddlers folder if it doesn't exist
// TODO: we should create the path recursively
if(!fs.existsSync($tw.boot.wikiTiddlersPath)) {
fs.mkdirSync($tw.boot.wikiTiddlersPath);
}
}
FileSystemAdaptor.prototype.getTiddlerInfo = function(tiddler) {

View File

@@ -12,18 +12,33 @@ Message handler for full screen mode
/*global $tw: false, Element: false */
"use strict";
var toggleFullScreen = function() {
if(document[$tw.browser.isFullScreen]) {
document[$tw.browser.cancelFullScreen]();
var d = document,
db = d.body,
_requestFullscreen = db.webkitRequestFullscreen !== undefined ? "webkitRequestFullscreen" :
db.mozRequestFullScreen !== undefined ? "mozRequestFullScreen" :
db.msRequestFullscreen !== undefined ? "msRequestFullscreen" :
db.requestFullscreen !== undefined ? "requestFullscreen" : "",
_exitFullscreen = d.webkitExitFullscreen !== undefined ? "webkitExitFullscreen" :
d.mozCancelFullScreen !== undefined ? "mozCancelFullScreen" :
d.msExitFullscreen !== undefined ? "msExitFullscreen" :
d.exitFullscreen !== undefined ? "exitFullscreen" : "",
_fullscreenElement = d.webkitFullscreenElement !== undefined ? "webkitFullscreenElement" :
d.mozFullScreenElement !== undefined ? "mozFullScreenElement" :
d.msFullscreenElement !== undefined ? "msFullscreenElement" :
d.fullscreenElement !== undefined ? "fullscreenElement" : "";
var toggleFullscreen = function() {
if(document[_fullscreenElement]) {
document[_exitFullscreen]();
} else {
document.documentElement[$tw.browser.requestFullScreen](Element.ALLOW_KEYBOARD_INPUT);
document.documentElement[_requestFullscreen](Element.ALLOW_KEYBOARD_INPUT);
}
};
exports.startup = function() {
// Install the full screen handler
$tw.rootWidget.addEventListener("tw-full-screen",function(event) {
toggleFullScreen();
toggleFullscreen();
});
};

View File

@@ -1,5 +1,5 @@
{
"title": "$:/plugins/tiddlywiki/github-fork-ribbon",
"description": "Codemirror plugin",
"description": "GitHub-style ribbon in pure CSS",
"author": "Simon Whitaker, adapted for TiddlyWiki by JeremyRuston"
}

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