mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-24 03:44:41 +00:00
Compare commits
155 Commits
v5.0.1
...
v5.0.5-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfad04a5d0 | ||
|
|
1aa5dedfaf | ||
|
|
98fdd3e184 | ||
|
|
73c5ecdaa7 | ||
|
|
eef32e70e3 | ||
|
|
ad6bf4f9c5 | ||
|
|
7db31dc138 | ||
|
|
7b7e799a70 | ||
|
|
3aab737bea | ||
|
|
12b4cc5d3e | ||
|
|
10c25c1692 | ||
|
|
c35742f916 | ||
|
|
15a41d7e57 | ||
|
|
4e37fa7e47 | ||
|
|
1c17cfb0ff | ||
|
|
912c26f848 | ||
|
|
a5de1cf7fb | ||
|
|
84e0dc9d1a | ||
|
|
39743b4758 | ||
|
|
6091b41960 | ||
|
|
2d1d53893a | ||
|
|
861e350444 | ||
|
|
9a15cb0516 | ||
|
|
74fd683a22 | ||
|
|
8cc10d87d4 | ||
|
|
ce13548884 | ||
|
|
ffcc5a09f2 | ||
|
|
7f5a8fc937 | ||
|
|
c740792105 | ||
|
|
bd80bf4acc | ||
|
|
e66fb948c1 | ||
|
|
79046c52b4 | ||
|
|
062c4e5400 | ||
|
|
8538d69dc1 | ||
|
|
274c52005d | ||
|
|
99dd029816 | ||
|
|
1c529ddcd4 | ||
|
|
1491c261f5 | ||
|
|
3bcaab513d | ||
|
|
04077549ca | ||
|
|
6c1489fc2f | ||
|
|
1336058336 | ||
|
|
b659c65959 | ||
|
|
e8f16c1c97 | ||
|
|
6b51a51609 | ||
|
|
a4d063e884 | ||
|
|
42ba6852d1 | ||
|
|
638c8b2070 | ||
|
|
cc39686693 | ||
|
|
2b72e48a3a | ||
|
|
0ec2224757 | ||
|
|
218b9c967e | ||
|
|
a4e4b6797a | ||
|
|
a4e3f66809 | ||
|
|
07dd524016 | ||
|
|
f3b2788ed1 | ||
|
|
a389f9bc8c | ||
|
|
1144504bb3 | ||
|
|
72f07947ea | ||
|
|
e8549cba4b | ||
|
|
a5aa2c08b2 | ||
|
|
14b98f5966 | ||
|
|
7ec516a746 | ||
|
|
886b069dce | ||
|
|
b50eb8da30 | ||
|
|
4ece301a97 | ||
|
|
810167bc7b | ||
|
|
1b2a5fe130 | ||
|
|
88d483a2c8 | ||
|
|
db85bfe513 | ||
|
|
066a4d9fbc | ||
|
|
3e2f475324 | ||
|
|
a5f33d875b | ||
|
|
6d09db5608 | ||
|
|
23b2f74e94 | ||
|
|
37a46adac8 | ||
|
|
65e3780cc1 | ||
|
|
7d33dd71a2 | ||
|
|
d03728ea71 | ||
|
|
9396d52b42 | ||
|
|
7dc7559b90 | ||
|
|
5ac5b2c76d | ||
|
|
d4d8cdf9a4 | ||
|
|
9e5e08a7d3 | ||
|
|
41c592b758 | ||
|
|
84ad161eab | ||
|
|
4ab431bb93 | ||
|
|
f6bea8f58b | ||
|
|
b8c9422161 | ||
|
|
d7ebd461f2 | ||
|
|
57adbe5bf7 | ||
|
|
34e6d79ef6 | ||
|
|
713d6945c6 | ||
|
|
ef9175e7bc | ||
|
|
6a8feb216a | ||
|
|
b1e7ba29f1 | ||
|
|
79c8935aef | ||
|
|
8496337d30 | ||
|
|
2126ce1d17 | ||
|
|
3f06384516 | ||
|
|
053e09af6e | ||
|
|
0984e9322f | ||
|
|
c190b0f1ea | ||
|
|
80e0714c0d | ||
|
|
819843e4b0 | ||
|
|
6386e60896 | ||
|
|
7c9b920e26 | ||
|
|
ae4a2b58ed | ||
|
|
c73a7af95b | ||
|
|
1420aa2f58 | ||
|
|
0814f3623d | ||
|
|
382d7e4449 | ||
|
|
e2cd611e45 | ||
|
|
bb03bb942f | ||
|
|
fd996bad20 | ||
|
|
3f3cac12ba | ||
|
|
761b66028d | ||
|
|
7e151a98da | ||
|
|
e537457d4b | ||
|
|
e686d62400 | ||
|
|
ae6d1b1685 | ||
|
|
49b3165fbd | ||
|
|
6a21965cee | ||
|
|
b9faadbbc9 | ||
|
|
c610161455 | ||
|
|
6dbd178378 | ||
|
|
77bca22d42 | ||
|
|
9f058925f7 | ||
|
|
1b75242345 | ||
|
|
6298c7aa43 | ||
|
|
853cca906c | ||
|
|
cffe9375b2 | ||
|
|
b8897f86fb | ||
|
|
409311b61e | ||
|
|
d11cda4854 | ||
|
|
6a71b399b0 | ||
|
|
2e188a48f4 | ||
|
|
b4733414e5 | ||
|
|
67072371a0 | ||
|
|
a9c209c62e | ||
|
|
bc84df1707 | ||
|
|
062822d45c | ||
|
|
2e0e8a879f | ||
|
|
2ffcbb76eb | ||
|
|
50e1727ef7 | ||
|
|
7a99fb1250 | ||
|
|
e6e47ca83d | ||
|
|
489b40314b | ||
|
|
14cf9ad24a | ||
|
|
428e27d4bf | ||
|
|
0edf46dee1 | ||
|
|
c38cd500f6 | ||
|
|
3da825c6e1 | ||
|
|
d739b6939a | ||
|
|
5e743262d4 |
7
bld.cmd
7
bld.cmd
@@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
|
||||
rem build TiddlyWiki5 for five.tiddlywiki.com
|
||||
rem build TiddlyWiki5 for tiddlywiki.com
|
||||
|
||||
rem Set up the build output directory
|
||||
|
||||
@@ -35,9 +35,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 ^
|
||||
@@ -87,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
|
||||
|
||||
|
||||
7
bld.sh
7
bld.sh
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# build TiddlyWiki5 for five.tiddlywiki.com
|
||||
# build TiddlyWiki5 for tiddlywiki.com
|
||||
|
||||
# Set up the build output directory
|
||||
|
||||
@@ -17,7 +17,7 @@ echo "Using TW5_BUILD_OUTPUT as [$TW5_BUILD_OUTPUT]"
|
||||
|
||||
# Make the CNAME file that GitHub Pages requires
|
||||
|
||||
echo "five.tiddlywiki.com" > $TW5_BUILD_OUTPUT/CNAME
|
||||
echo "tiddlywiki.com" > $TW5_BUILD_OUTPUT/CNAME
|
||||
|
||||
# Create the `static` directories if necessary
|
||||
|
||||
@@ -36,9 +36,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 \
|
||||
|
||||
42
boot/boot.js
42
boot/boot.js
@@ -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);
|
||||
@@ -1232,13 +1239,14 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) {
|
||||
var fields = {
|
||||
title: pluginInfo.title,
|
||||
type: "application/json",
|
||||
text: JSON.stringify(pluginInfo,null,4),
|
||||
text: JSON.stringify({tiddlers: pluginInfo.tiddlers},null,4),
|
||||
"plugin-priority": pluginInfo["plugin-priority"],
|
||||
"name": pluginInfo["name"],
|
||||
"version": pluginInfo["version"],
|
||||
"thumbnail": pluginInfo["thumbnail"],
|
||||
"description": pluginInfo["description"],
|
||||
"plugin-type": pluginInfo["plugin-type"] || "plugin"
|
||||
"plugin-type": pluginInfo["plugin-type"] || "plugin",
|
||||
"dependents": $tw.utils.stringifyList(pluginInfo["dependents"] || [])
|
||||
}
|
||||
return fields;
|
||||
} else {
|
||||
@@ -1246,6 +1254,20 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) {
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Fallback tiddlywiki.info content
|
||||
*/
|
||||
$tw.boot.defaultWikiInfo = {
|
||||
"plugins": [
|
||||
"tiddlywiki/tiddlyweb",
|
||||
"tiddlywiki/filesystem"
|
||||
],
|
||||
"themes": [
|
||||
"tiddlywiki/vanilla",
|
||||
"tiddlywiki/snowwhite"
|
||||
]
|
||||
};
|
||||
|
||||
/*
|
||||
path: path of wiki directory
|
||||
parentPaths: array of parent paths that we mustn't recurse into
|
||||
@@ -1253,13 +1275,14 @@ parentPaths: array of parent paths that we mustn't recurse into
|
||||
$tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
|
||||
parentPaths = parentPaths || [];
|
||||
var wikiInfoPath = path.resolve(wikiPath,$tw.config.wikiInfo),
|
||||
wikiInfo = {},
|
||||
wikiInfo,
|
||||
pluginFields;
|
||||
// Bail if we don't have a wiki info file
|
||||
if(!fs.existsSync(wikiInfoPath)) {
|
||||
$tw.utils.error("Missing tiddlywiki.info file at " + wikiPath);
|
||||
if(fs.existsSync(wikiInfoPath)) {
|
||||
wikiInfo = JSON.parse(fs.readFileSync(wikiInfoPath,"utf8"));
|
||||
} else {
|
||||
wikiInfo = $tw.boot.defaultWikiInfo;
|
||||
}
|
||||
wikiInfo = JSON.parse(fs.readFileSync(wikiInfoPath,"utf8"));
|
||||
// Load any parent wikis
|
||||
if(wikiInfo.includeWikis) {
|
||||
parentPaths = parentPaths.slice(0);
|
||||
@@ -1411,6 +1434,7 @@ $tw.boot.startup = function() {
|
||||
$tw.utils.registerFileType("image/png","base64",".png");
|
||||
$tw.utils.registerFileType("image/gif","base64",".gif");
|
||||
$tw.utils.registerFileType("image/svg+xml","utf8",".svg");
|
||||
$tw.utils.registerFileType("image/x-icon","base64",".ico");
|
||||
$tw.utils.registerFileType("application/font-woff","base64",".woff");
|
||||
// Create the wiki store for the app
|
||||
$tw.wiki = new $tw.Wiki();
|
||||
|
||||
@@ -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 "it doesn't work" 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 "sign contributor license agreement"
|
||||
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>. "HA-CLA-I-LIST Version 1.0" for "CLA-individual" and "HA-CLA-E-LIST Version 1.0" for "CLA-entity"
|
||||
</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>
|
||||
3
core/docs/types/image_x-icon.tid
Normal file
3
core/docs/types/image_x-icon.tid
Normal file
@@ -0,0 +1,3 @@
|
||||
title: $:/docs/types/image/x-icon
|
||||
description: ICO format icon file
|
||||
name: image/x-icon
|
||||
46
core/modules/commands/savetiddler.js
Normal file
46
core/modules/commands/savetiddler.js
Normal 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;
|
||||
|
||||
})();
|
||||
@@ -95,9 +95,8 @@ SimpleServer.prototype.listen = function(port) {
|
||||
if(username && password) {
|
||||
// Check they match
|
||||
if(self.checkCredentials(request,username,password) !== "ALLOWED") {
|
||||
response.setHeader("WWW-Authenticate", 'Basic realm="Admin Area"');
|
||||
response.writeHead(401,"Authentication required",{
|
||||
"WWW-Authenticate": 'Basic realm="TiddlyWiki5"'
|
||||
"WWW-Authenticate": 'Basic realm="Please provide your username and password to login to TiddlyWiki5"'
|
||||
});
|
||||
response.end();
|
||||
return;
|
||||
@@ -197,13 +196,22 @@ var Command = function(params,commander,callback) {
|
||||
response.end(text,"utf8");
|
||||
}
|
||||
});
|
||||
this.server.addRoute({
|
||||
method: "GET",
|
||||
path: /^\/favicon.ico$/,
|
||||
handler: function(request,response,state) {
|
||||
response.writeHead(200, {"Content-Type": "image/x-icon"});
|
||||
var buffer = state.wiki.getTiddlerText("$:/favicon.ico","");
|
||||
response.end(buffer,"base64");
|
||||
}
|
||||
});
|
||||
this.server.addRoute({
|
||||
method: "GET",
|
||||
path: /^\/recipes\/default\/tiddlers.json$/,
|
||||
handler: function(request,response,state) {
|
||||
response.writeHead(200, {"Content-Type": "application/json"});
|
||||
var tiddlers = [];
|
||||
state.wiki.forEachTiddler("title",function(title,tiddler) {
|
||||
state.wiki.forEachTiddler({sortField: "title"},function(title,tiddler) {
|
||||
var tiddlerFields = {};
|
||||
$tw.utils.each(tiddler.fields,function(field,name) {
|
||||
if(name !== "text") {
|
||||
@@ -255,7 +263,7 @@ Command.prototype.execute = function() {
|
||||
rootTiddler = this.params[1] || "$:/core/save/all",
|
||||
renderType = this.params[2] || "text/plain",
|
||||
serveType = this.params[3] || "text/html",
|
||||
username = this.params[4] || "ANONYMOUS",
|
||||
username = this.params[4],
|
||||
password = this.params[5];
|
||||
this.server.set({
|
||||
rootTiddler: rootTiddler,
|
||||
@@ -265,9 +273,8 @@ Command.prototype.execute = function() {
|
||||
password: password
|
||||
});
|
||||
this.server.listen(port);
|
||||
if(this.commander.verbose) {
|
||||
console.log("Serving on port " + port);
|
||||
}
|
||||
console.log("Serving on port " + port);
|
||||
console.log("(press ctrl-C to exit)");
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
})();
|
||||
|
||||
|
||||
58
core/modules/parsers/wikiparser/rules/hardlinebreaks.js
Normal file
58
core/modules/parsers/wikiparser/rules/hardlinebreaks.js
Normal file
@@ -0,0 +1,58 @@
|
||||
/*\
|
||||
title: $:/core/modules/parsers/wikiparser/rules/hardlinebreaks.js
|
||||
type: application/javascript
|
||||
module-type: wikirule
|
||||
|
||||
Wiki text inline rule for marking areas with hard line breaks. For example:
|
||||
|
||||
```
|
||||
"""
|
||||
This is some text
|
||||
That is set like
|
||||
It is a Poem
|
||||
When it is
|
||||
Clearly
|
||||
Not
|
||||
"""
|
||||
```
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.name = "hardlinebreaks";
|
||||
exports.types = {inline: true};
|
||||
|
||||
exports.init = function(parser) {
|
||||
this.parser = parser;
|
||||
// Regexp to match
|
||||
this.matchRegExp = /"""(?:\r?\n)?/mg;
|
||||
};
|
||||
|
||||
exports.parse = function() {
|
||||
var reEnd = /(""")|(\r?\n)/mg,
|
||||
tree = [];
|
||||
// Move past the match
|
||||
this.parser.pos = this.matchRegExp.lastIndex;
|
||||
do {
|
||||
// Parse the run up to the terminator
|
||||
tree.push.apply(tree,this.parser.parseInlineRun(reEnd,{eatTerminator: false}));
|
||||
// Redo the terminator match
|
||||
reEnd.lastIndex = this.parser.pos;
|
||||
var match = reEnd.exec(this.parser.source);
|
||||
if(match) {
|
||||
this.parser.pos = reEnd.lastIndex;
|
||||
// Add a line break if the terminator was a line break
|
||||
if(match[2]) {
|
||||
tree.push({type: "element", tag: "br"});
|
||||
}
|
||||
}
|
||||
} while(match && !match[1]);
|
||||
// Return the nodes
|
||||
return tree;
|
||||
};
|
||||
|
||||
})();
|
||||
75
core/modules/savers/fsosaver.js
Normal file
75
core/modules/savers/fsosaver.js
Normal file
@@ -0,0 +1,75 @@
|
||||
/*\
|
||||
title: $:/core/modules/savers/fsosaver.js
|
||||
type: application/javascript
|
||||
module-type: saver
|
||||
|
||||
Handles saving changes via MS FileSystemObject ActiveXObject
|
||||
|
||||
Note: Since TiddlyWiki's markup contains the MOTW, the FileSystemObject normally won't be available.
|
||||
However, if the wiki is loaded as an .HTA file (Windows HTML Applications) then the FSO can be used.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Select the appropriate saver module and set it up
|
||||
*/
|
||||
var FSOSaver = function(wiki) {
|
||||
};
|
||||
|
||||
FSOSaver.prototype.save = function(text,method,callback) {
|
||||
// Bail out unless this is a save (rather than a download)
|
||||
if(method !== "save") {
|
||||
return false;
|
||||
}
|
||||
// Get the pathname of this document
|
||||
var pathname = unescape(document.location.pathname);
|
||||
// Test for a Windows path of the form /x:\blah...
|
||||
if(/^\/[A-Z]\:\\[^\\]+/i.test(pathname)) { // ie: ^/[a-z]:/[^/]+
|
||||
// Remove the leading slash
|
||||
pathname = pathname.substr(1);
|
||||
} else if (document.location.hostname !== "" && /^\/\\[^\\]+\\[^\\]+/i.test(pathname)) { // test for \\server\share\blah... - ^/[^/]+/[^/]+
|
||||
// Remove the leading slash
|
||||
pathname = pathname.substr(1);
|
||||
// reconstruct UNC path
|
||||
pathname = "\\\\" + document.location.hostname + pathname;
|
||||
} else return false;
|
||||
|
||||
// Save the file (as UTF-16)
|
||||
var fso = new ActiveXObject("Scripting.FileSystemObject");
|
||||
var file = fso.OpenTextFile(pathname,2,-1,-1);
|
||||
|
||||
file.Write(text);
|
||||
file.Close();
|
||||
return true;
|
||||
};
|
||||
|
||||
/*
|
||||
Information about this saver
|
||||
*/
|
||||
FSOSaver.prototype.info = {
|
||||
name: "FSOSaver",
|
||||
priority: 120
|
||||
};
|
||||
|
||||
/*
|
||||
Static method that returns true if this saver is capable of working
|
||||
*/
|
||||
exports.canSave = function(wiki) {
|
||||
try {
|
||||
return (window.location.protocol === "file:") && !!(new ActiveXObject("Scripting.FileSystemObject"));
|
||||
} catch(e) { return false; }
|
||||
};
|
||||
|
||||
/*
|
||||
Create an instance of this saver
|
||||
*/
|
||||
exports.create = function(wiki) {
|
||||
return new FSOSaver(wiki);
|
||||
};
|
||||
|
||||
})();
|
||||
73
core/modules/savers/tiddlyie.js
Normal file
73
core/modules/savers/tiddlyie.js
Normal file
@@ -0,0 +1,73 @@
|
||||
/*\
|
||||
title: $:/core/modules/savers/tiddlyie.js
|
||||
type: application/javascript
|
||||
module-type: saver
|
||||
|
||||
Handles saving changes via Internet Explorer BHO extenion (TiddlyIE)
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Select the appropriate saver module and set it up
|
||||
*/
|
||||
var TiddlyIESaver = function(wiki) {
|
||||
};
|
||||
|
||||
TiddlyIESaver.prototype.save = function(text,method,callback) {
|
||||
// Bail out unless this is a save (rather than a download)
|
||||
if(method !== "save") {
|
||||
return false;
|
||||
}
|
||||
// check existence of TiddlyIE BHO extension (note: only works after document is complete)
|
||||
if(typeof(window.TiddlyIE) != "undefined") {
|
||||
// Get the pathname of this document
|
||||
var pathname = unescape(document.location.pathname);
|
||||
// Test for a Windows path of the form /x:/blah...
|
||||
if(/^\/[A-Z]\:\/[^\/]+/i.test(pathname)) { // ie: ^/[a-z]:/[^/]+ (is this better?: ^/[a-z]:/[^/]+(/[^/]+)*\.[^/]+ )
|
||||
// Remove the leading slash
|
||||
pathname = pathname.substr(1);
|
||||
// Convert slashes to backslashes
|
||||
pathname = pathname.replace(/\//g,"\\");
|
||||
} else if(document.hostname !== "" && /^\/[^\/]+\/[^\/]+/i.test(pathname)) { // test for \\server\share\blah... - ^/[^/]+/[^/]+
|
||||
// Convert slashes to backslashes
|
||||
pathname = pathname.replace(/\//g,"\\");
|
||||
// reconstruct UNC path
|
||||
pathname = "\\\\" + document.location.hostname + pathname;
|
||||
} else return false;
|
||||
|
||||
// Prompt the user to save the file
|
||||
window.TiddlyIE.save(pathname, text);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Information about this saver
|
||||
*/
|
||||
TiddlyIESaver.prototype.info = {
|
||||
name: "tiddlyiesaver",
|
||||
priority: 1500
|
||||
};
|
||||
|
||||
/*
|
||||
Static method that returns true if this saver is capable of working
|
||||
*/
|
||||
exports.canSave = function(wiki) {
|
||||
return (window.location.protocol === "file:");
|
||||
};
|
||||
|
||||
/*
|
||||
Create an instance of this saver
|
||||
*/
|
||||
exports.create = function(wiki) {
|
||||
return new TiddlyIESaver(wiki);
|
||||
};
|
||||
|
||||
})();
|
||||
@@ -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",{
|
||||
|
||||
@@ -68,13 +68,11 @@ Syncer.prototype.init = function() {
|
||||
// Hashmap by title of {revision:,changeCount:,adaptorInfo:}
|
||||
this.tiddlerInfo = {};
|
||||
// Record information for known tiddlers
|
||||
this.wiki.forEachTiddler(function(title,tiddler) {
|
||||
if(tiddler.fields["revision"]) {
|
||||
self.tiddlerInfo[title] = {
|
||||
revision: tiddler.fields["revision"],
|
||||
adaptorInfo: self.syncadaptor.getTiddlerInfo(tiddler),
|
||||
changeCount: self.wiki.getChangeCount(title)
|
||||
}
|
||||
this.wiki.forEachTiddler({includeSystem: true},function(title,tiddler) {
|
||||
self.tiddlerInfo[title] = {
|
||||
revision: tiddler.fields["revision"],
|
||||
adaptorInfo: self.syncadaptor.getTiddlerInfo(tiddler),
|
||||
changeCount: self.wiki.getChangeCount(title)
|
||||
}
|
||||
});
|
||||
// Tasks are {type: "load"/"save"/"delete", title:, queueTime:, lastModificationTime:}
|
||||
@@ -439,19 +437,21 @@ Syncer.prototype.dispatchTask = function(task,callback) {
|
||||
var changeCount = this.wiki.getChangeCount(task.title),
|
||||
tiddler = this.wiki.getTiddler(task.title);
|
||||
this.log("Dispatching 'save' task:",task.title);
|
||||
this.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
// Adjust the info stored about this tiddler
|
||||
self.tiddlerInfo[task.title] = {
|
||||
changeCount: changeCount,
|
||||
adaptorInfo: adaptorInfo,
|
||||
revision: revision
|
||||
};
|
||||
// Invoke the callback
|
||||
callback(null);
|
||||
});
|
||||
if(tiddler) {
|
||||
this.syncadaptor.saveTiddler(tiddler,function(err,adaptorInfo,revision) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
// Adjust the info stored about this tiddler
|
||||
self.tiddlerInfo[task.title] = {
|
||||
changeCount: changeCount,
|
||||
adaptorInfo: adaptorInfo,
|
||||
revision: revision
|
||||
};
|
||||
// Invoke the callback
|
||||
callback(null);
|
||||
});
|
||||
}
|
||||
} else if(task.type === "load") {
|
||||
// Load the tiddler
|
||||
this.log("Dispatching 'load' task:",task.title);
|
||||
@@ -460,7 +460,9 @@ Syncer.prototype.dispatchTask = function(task,callback) {
|
||||
return callback(err);
|
||||
}
|
||||
// Store the tiddler
|
||||
self.storeTiddler(tiddlerFields);
|
||||
if(tiddlerFields) {
|
||||
self.storeTiddler(tiddlerFields);
|
||||
}
|
||||
// Invoke the callback
|
||||
callback(null);
|
||||
});
|
||||
|
||||
@@ -48,8 +48,9 @@ ThemeManager.prototype.switchTheme = function() {
|
||||
var tiddler = self.wiki.getTiddler(title);
|
||||
if(tiddler && tiddler.isPlugin() && themePlugins.indexOf(title) === -1) {
|
||||
themePlugins.push(title);
|
||||
var pluginInfo = JSON.parse(self.wiki.getTiddlerText(title));
|
||||
$tw.utils.each(pluginInfo.dependents,function(title) {
|
||||
var pluginInfo = JSON.parse(self.wiki.getTiddlerText(title)),
|
||||
dependents = $tw.utils.parseStringArray(tiddler.fields.dependents || "");
|
||||
$tw.utils.each(dependents,function(title) {
|
||||
accumulatePlugin(title);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -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;
|
||||
|
||||
})();
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -45,7 +45,9 @@ EditTextWidget.prototype.render = function(parent,nextSibling) {
|
||||
domNode.setAttribute("placeholder",this.editPlaceholder);
|
||||
}
|
||||
// Assign classes
|
||||
domNode.className = this.editClass;
|
||||
if(this.editClass) {
|
||||
domNode.className = this.editClass;
|
||||
}
|
||||
// Set the text
|
||||
var editInfo = this.getEditInfo();
|
||||
if(this.editTag === "textarea") {
|
||||
|
||||
@@ -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}
|
||||
}
|
||||
}]);
|
||||
};
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -70,100 +70,123 @@ NavigatorWidget.prototype.refresh = function(changedTiddlers) {
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.getStoryList = function() {
|
||||
this.storyList = this.wiki.getTiddlerList(this.storyTitle);
|
||||
return this.storyTitle ? this.wiki.getTiddlerList(this.storyTitle) : null;
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.saveStoryList = function() {
|
||||
NavigatorWidget.prototype.saveStoryList = function(storyList) {
|
||||
var storyTiddler = this.wiki.getTiddler(this.storyTitle);
|
||||
this.wiki.addTiddler(new $tw.Tiddler({
|
||||
title: this.storyTitle
|
||||
},storyTiddler,{list: this.storyList}));
|
||||
this.wiki.addTiddler(new $tw.Tiddler(
|
||||
{title: this.storyTitle},
|
||||
storyTiddler,
|
||||
{list: storyList}
|
||||
));
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.findTitleInStory = function(title,defaultIndex) {
|
||||
for(var t=0; t<this.storyList.length; t++) {
|
||||
if(this.storyList[t] === title) {
|
||||
return t;
|
||||
NavigatorWidget.prototype.findTitleInStory = function(storyList,title,defaultIndex) {
|
||||
var p = storyList.indexOf(title);
|
||||
return p === -1 ? defaultIndex : p;
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.removeTitleFromStory = function(storyList,title) {
|
||||
var p = storyList.indexOf(title);
|
||||
while(p !== -1) {
|
||||
storyList.splice(p,1);
|
||||
p = storyList.indexOf(title);
|
||||
}
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.replaceFirstTitleInStory = function(storyList,oldTitle,newTitle) {
|
||||
var pos = storyList.indexOf(oldTitle);
|
||||
if(pos !== -1) {
|
||||
storyList[pos] = newTitle;
|
||||
do {
|
||||
pos = storyList.indexOf(oldTitle,pos + 1);
|
||||
if(pos !== -1) {
|
||||
storyList.splice(pos,1);
|
||||
}
|
||||
} while(pos !== -1);
|
||||
} else {
|
||||
storyList.splice(0,0,newTitle);
|
||||
}
|
||||
};
|
||||
|
||||
NavigatorWidget.prototype.addToStory = function(title,fromTitle) {
|
||||
var storyList = this.getStoryList();
|
||||
if(storyList) {
|
||||
// See if the tiddler is already there
|
||||
var slot = this.findTitleInStory(storyList,title,-1);
|
||||
// If not we need to add it
|
||||
if(slot === -1) {
|
||||
// First we try to find the position of the story element we navigated from
|
||||
slot = this.findTitleInStory(storyList,fromTitle,-1) + 1;
|
||||
// Add the tiddler
|
||||
storyList.splice(slot,0,title);
|
||||
// Save the story
|
||||
this.saveStoryList(storyList);
|
||||
}
|
||||
}
|
||||
return defaultIndex;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Add a new record to the top of the history stack
|
||||
title: a title string or an array of title strings
|
||||
fromPageRect: page coordinates of the origin of the navigation
|
||||
*/
|
||||
NavigatorWidget.prototype.addToHistory = function(title,fromPageRect) {
|
||||
var titles = $tw.utils.isArray(title) ? title : [title];
|
||||
// Add a new record to the top of the history stack
|
||||
if(this.historyTitle) {
|
||||
var historyList = this.wiki.getTiddlerData(this.historyTitle,[]);
|
||||
$tw.utils.each(titles,function(title) {
|
||||
historyList.push({title: title, fromPageRect: fromPageRect});
|
||||
});
|
||||
this.wiki.setTiddlerData(this.historyTitle,historyList);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Handle a tw-navigate event
|
||||
*/
|
||||
NavigatorWidget.prototype.handleNavigateEvent = function(event) {
|
||||
if(this.storyTitle) {
|
||||
// Update the story tiddler if specified
|
||||
this.getStoryList();
|
||||
// See if the tiddler is already there
|
||||
var slot = this.findTitleInStory(event.navigateTo,-1);
|
||||
// If not we need to add it
|
||||
if(slot === -1) {
|
||||
// First we try to find the position of the story element we navigated from
|
||||
slot = this.findTitleInStory(event.navigateFromTitle,-1) + 1;
|
||||
// Add the tiddler
|
||||
this.storyList.splice(slot,0,event.navigateTo);
|
||||
// Save the story
|
||||
this.saveStoryList();
|
||||
}
|
||||
}
|
||||
// Add a new record to the top of the history stack
|
||||
if(this.historyTitle) {
|
||||
var historyList = this.wiki.getTiddlerData(this.historyTitle,[]);
|
||||
historyList.push({title: event.navigateTo, fromPageRect: event.navigateFromClientRect});
|
||||
this.wiki.setTiddlerData(this.historyTitle,historyList);
|
||||
}
|
||||
this.addToStory(event.navigateTo,event.navigateFromTitle);
|
||||
this.addToHistory(event.navigateTo,event.navigateFromClientRect);
|
||||
return false;
|
||||
};
|
||||
|
||||
// Close a specified tiddler
|
||||
NavigatorWidget.prototype.handleCloseTiddlerEvent = function(event) {
|
||||
this.getStoryList();
|
||||
var title = event.param || event.tiddlerTitle,
|
||||
storyList = this.getStoryList();
|
||||
// Look for tiddlers with this title to close
|
||||
var slot = this.findTitleInStory(event.tiddlerTitle,-1);
|
||||
if(slot !== -1) {
|
||||
this.storyList.splice(slot,1);
|
||||
this.saveStoryList();
|
||||
}
|
||||
this.removeTitleFromStory(storyList,title);
|
||||
this.saveStoryList(storyList);
|
||||
return false;
|
||||
};
|
||||
|
||||
// Close all tiddlers
|
||||
NavigatorWidget.prototype.handleCloseAllTiddlersEvent = function(event) {
|
||||
this.storyList = [];
|
||||
this.saveStoryList();
|
||||
this.saveStoryList([]);
|
||||
return false;
|
||||
};
|
||||
|
||||
// Close other tiddlers
|
||||
NavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) {
|
||||
this.storyList = [event.tiddlerTitle];
|
||||
this.saveStoryList();
|
||||
var title = event.param || event.tiddlerTitle;
|
||||
this.saveStoryList([title]);
|
||||
return false;
|
||||
};
|
||||
|
||||
// Place a tiddler in edit mode
|
||||
NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {
|
||||
this.getStoryList();
|
||||
// Replace the specified tiddler with a draft in edit mode
|
||||
var title = event.param || event.tiddlerTitle,
|
||||
draftTiddler = this.getDraftTiddler(title),
|
||||
gotOne = false;
|
||||
for(var t=this.storyList.length-1; t>=0; t--) {
|
||||
// Replace the first story instance of the original tiddler name with the draft title
|
||||
if(this.storyList[t] === title) {
|
||||
if(!gotOne) {
|
||||
this.storyList[t] = draftTiddler.fields.title;
|
||||
gotOne = true;
|
||||
} else {
|
||||
this.storyList.splice(t,1);
|
||||
}
|
||||
} else if(this.storyList[t] === draftTiddler.fields.title) {
|
||||
// Remove any existing references to the draft
|
||||
this.storyList.splice(t,1);
|
||||
}
|
||||
}
|
||||
this.saveStoryList();
|
||||
draftTiddler = this.makeDraftTiddler(title),
|
||||
draftTitle = draftTiddler.fields.title,
|
||||
storyList = this.getStoryList();
|
||||
this.removeTitleFromStory(storyList,draftTitle);
|
||||
this.replaceFirstTitleInStory(storyList,title,draftTitle);
|
||||
this.addToHistory(draftTitle,event.navigateFromClientRect);
|
||||
this.saveStoryList(storyList);
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -171,32 +194,30 @@ NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {
|
||||
NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) {
|
||||
// Get the tiddler we're deleting
|
||||
var title = event.param || event.tiddlerTitle,
|
||||
tiddler = this.wiki.getTiddler(title);
|
||||
tiddler = this.wiki.getTiddler(title),
|
||||
storyList = this.getStoryList();
|
||||
// Check if the tiddler we're deleting is in draft mode
|
||||
if(tiddler.hasField("draft.title")) {
|
||||
// Delete the original tiddler
|
||||
this.wiki.deleteTiddler(tiddler.fields["draft.of"]);
|
||||
var originalTitle = tiddler.fields["draft.of"];
|
||||
this.wiki.deleteTiddler(originalTitle);
|
||||
this.removeTitleFromStory(storyList,originalTitle);
|
||||
}
|
||||
// Delete this tiddler
|
||||
this.wiki.deleteTiddler(title);
|
||||
// Remove the closed tiddler from the story
|
||||
this.getStoryList();
|
||||
// Look for tiddler with this title to close
|
||||
var slot = this.findTitleInStory(title,-1);
|
||||
if(slot !== -1) {
|
||||
this.storyList.splice(slot,1);
|
||||
this.saveStoryList();
|
||||
}
|
||||
this.removeTitleFromStory(storyList,title);
|
||||
this.saveStoryList(storyList);
|
||||
return false;
|
||||
};
|
||||
|
||||
/*
|
||||
Create/reuse the draft tiddler for a given title
|
||||
*/
|
||||
NavigatorWidget.prototype.getDraftTiddler = function(targetTitle) {
|
||||
NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
|
||||
// See if there is already a draft tiddler for this tiddler
|
||||
var drafts = [];
|
||||
this.wiki.forEachTiddler(function(title,tiddler) {
|
||||
this.wiki.forEachTiddler({includeSystem: true},function(title,tiddler) {
|
||||
if(tiddler.fields["draft.title"] && tiddler.fields["draft.of"] === targetTitle) {
|
||||
drafts.push(tiddler);
|
||||
}
|
||||
@@ -236,73 +257,58 @@ NavigatorWidget.prototype.generateDraftTitle = function(title) {
|
||||
|
||||
// Take a tiddler out of edit mode, saving the changes
|
||||
NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {
|
||||
this.getStoryList();
|
||||
var title = event.param || event.tiddlerTitle,
|
||||
tiddler = this.wiki.getTiddler(title),
|
||||
storyList = this.getStoryList(),
|
||||
storyTiddlerModified = false; // We have to special case saving the story tiddler itself
|
||||
for(var t=0; t<this.storyList.length; t++) {
|
||||
if(this.storyList[t] === title) {
|
||||
var tiddler = this.wiki.getTiddler(title);
|
||||
if(tiddler) {
|
||||
var draftTitle = (tiddler.fields["draft.title"] || "").trim(),
|
||||
draftOf = (tiddler.fields["draft.of"] || "").trim();
|
||||
if(draftTitle) {
|
||||
var isRename = draftOf !== draftTitle,
|
||||
isConfirmed = true;
|
||||
if(isRename && this.wiki.tiddlerExists(draftTitle)) {
|
||||
isConfirmed = confirm("Do you wish to overwrite the tiddler '" + draftTitle + "'?");
|
||||
}
|
||||
if(isConfirmed) {
|
||||
// Save the draft tiddler as the real tiddler
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
|
||||
title: draftTitle,
|
||||
"draft.title": undefined,
|
||||
"draft.of": undefined
|
||||
},this.wiki.getModificationFields()));
|
||||
// Remove the draft tiddler
|
||||
this.wiki.deleteTiddler(title);
|
||||
// Remove the original tiddler if we're renaming it
|
||||
if(isRename) {
|
||||
this.wiki.deleteTiddler(draftOf);
|
||||
}
|
||||
// Make the story record point to the newly saved tiddler
|
||||
this.storyList[t] = draftTitle;
|
||||
// Check if we're modifying the story tiddler itself
|
||||
if(draftTitle === this.storyTitle) {
|
||||
storyTiddlerModified = true;
|
||||
}
|
||||
}
|
||||
// Replace the original tiddler with the draft
|
||||
if(tiddler) {
|
||||
var draftTitle = (tiddler.fields["draft.title"] || "").trim(),
|
||||
draftOf = (tiddler.fields["draft.of"] || "").trim();
|
||||
if(draftTitle) {
|
||||
var isRename = draftOf !== draftTitle,
|
||||
isConfirmed = true;
|
||||
if(isRename && this.wiki.tiddlerExists(draftTitle)) {
|
||||
isConfirmed = confirm("Do you wish to overwrite the tiddler '" + draftTitle + "'?");
|
||||
}
|
||||
if(isConfirmed) {
|
||||
// Save the draft tiddler as the real tiddler
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
|
||||
title: draftTitle,
|
||||
"draft.title": undefined,
|
||||
"draft.of": undefined
|
||||
},this.wiki.getModificationFields()));
|
||||
// Remove the draft tiddler
|
||||
this.wiki.deleteTiddler(title);
|
||||
// Remove the original tiddler if we're renaming it
|
||||
if(isRename) {
|
||||
this.wiki.deleteTiddler(draftOf);
|
||||
}
|
||||
// Replace the draft in the story with the original
|
||||
this.replaceFirstTitleInStory(storyList,title,draftTitle);
|
||||
this.addToHistory(draftTitle,event.navigateFromClientRect);
|
||||
if(draftTitle !== this.storyTitle) {
|
||||
this.saveStoryList(storyList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!storyTiddlerModified) {
|
||||
this.saveStoryList();
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// Take a tiddler out of edit mode without saving the changes
|
||||
NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) {
|
||||
this.getStoryList();
|
||||
var storyTiddlerModified = false;
|
||||
// Flip the specified tiddler from draft back to the original
|
||||
var draftTitle = event.param || event.tiddlerTitle,
|
||||
draftTiddler = this.wiki.getTiddler(draftTitle);
|
||||
if(draftTiddler && draftTiddler.hasField("draft.of")) {
|
||||
var originalTitle = draftTiddler.fields["draft.of"];
|
||||
draftTiddler = this.wiki.getTiddler(draftTitle),
|
||||
originalTitle = draftTiddler.fields["draft.of"],
|
||||
storyList = this.getStoryList();
|
||||
if(draftTiddler && originalTitle) {
|
||||
// Remove the draft tiddler
|
||||
this.wiki.deleteTiddler(draftTitle);
|
||||
// Swap the draft for the original in the story
|
||||
for(var t=0; t<this.storyList.length; t++) {
|
||||
if(this.storyList[t] === draftTitle) {
|
||||
// Make the story record point to the original tiddler
|
||||
this.storyList[t] = originalTitle;
|
||||
storyTiddlerModified = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(storyTiddlerModified) {
|
||||
this.saveStoryList();
|
||||
this.replaceFirstTitleInStory(storyList,draftTitle,originalTitle);
|
||||
this.addToHistory(originalTitle,event.navigateFromClientRect);
|
||||
this.saveStoryList(storyList);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
@@ -310,18 +316,11 @@ NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) {
|
||||
// Create a new draft tiddler
|
||||
NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
|
||||
// Get the story details
|
||||
this.getStoryList();
|
||||
var storyList = this.getStoryList();
|
||||
// Get the template tiddler if there is one
|
||||
var templateTiddler = this.wiki.getTiddler(event.param);
|
||||
// Create the new tiddler
|
||||
var baseTitle = (templateTiddler && templateTiddler.fields.title) || "New Tiddler",
|
||||
title;
|
||||
for(var t=0; true; t++) {
|
||||
title = baseTitle + (t ? " " + t : "");
|
||||
if(!this.wiki.tiddlerExists(title)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
var title = this.wiki.generateNewTitle((templateTiddler && templateTiddler.fields.title) || "New Tiddler");
|
||||
var tiddler = new $tw.Tiddler(this.wiki.getCreationFields(),{
|
||||
text: "Newly created tiddler",
|
||||
title: title
|
||||
@@ -330,7 +329,7 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
|
||||
// Create the draft tiddler
|
||||
var draftTitle = this.generateDraftTitle(title),
|
||||
draftTiddler = new $tw.Tiddler({
|
||||
text: "Type the text for the new tiddler"
|
||||
text: ""
|
||||
},templateTiddler,{
|
||||
title: draftTitle,
|
||||
"draft.title": title,
|
||||
@@ -338,14 +337,12 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
|
||||
},this.wiki.getModificationFields());
|
||||
this.wiki.addTiddler(draftTiddler);
|
||||
// Update the story to insert the new draft at the top
|
||||
var slot = this.findTitleInStory(event.navigateFromTitle,-1) + 1;
|
||||
this.storyList.splice(slot,0,draftTitle);
|
||||
var slot = storyList.indexOf(event.navigateFromTitle);
|
||||
storyList.splice(slot + 1,0,draftTitle);
|
||||
// Save the updated story
|
||||
this.saveStoryList();
|
||||
this.saveStoryList(storyList);
|
||||
// Add a new record to the top of the history stack
|
||||
var history = this.wiki.getTiddlerData(this.historyTitle,[]);
|
||||
history.push({title: draftTitle});
|
||||
this.wiki.setTiddlerData(this.historyTitle,history);
|
||||
this.addToHistory(draftTitle);
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -353,8 +350,8 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) {
|
||||
NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
||||
var self = this;
|
||||
// Get the story and history details
|
||||
this.getStoryList();
|
||||
var history = this.wiki.getTiddlerData(this.historyTitle,[]);
|
||||
var storyList = this.getStoryList();
|
||||
var history = [];
|
||||
// Get the tiddlers
|
||||
var tiddlers = [];
|
||||
try {
|
||||
@@ -372,16 +369,16 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) {
|
||||
));
|
||||
if(imported) {
|
||||
// Add it to the story
|
||||
if(self.storyList.indexOf(title) === -1) {
|
||||
self.storyList.unshift(title);
|
||||
if(storyList.indexOf(title) === -1) {
|
||||
storyList.unshift(title);
|
||||
}
|
||||
// And to history
|
||||
history.push({title: title});
|
||||
history.push(title);
|
||||
}
|
||||
});
|
||||
// Save the updated story and history
|
||||
this.saveStoryList();
|
||||
this.wiki.setTiddlerData(this.historyTitle,history);
|
||||
this.saveStoryList(storyList);
|
||||
this.addToHistory(history);
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
129
core/modules/widgets/radio.js
Normal file
129
core/modules/widgets/radio.js
Normal file
@@ -0,0 +1,129 @@
|
||||
/*\
|
||||
title: $:/core/modules/widgets/radio.js
|
||||
type: application/javascript
|
||||
module-type: widget
|
||||
|
||||
Radio widget
|
||||
|
||||
Will set a field to the selected value:
|
||||
|
||||
```
|
||||
<$radio field="myfield" value="check 1">one</$radio>
|
||||
<$radio field="myfield" value="check 2">two</$radio>
|
||||
<$radio field="myfield" value="check 3">three</$radio>
|
||||
```
|
||||
|
||||
|Parameter |Description |h
|
||||
|tiddler |Name of the tiddler in which the field should be set. Defaults to current tiddler |
|
||||
|field |The name of the field to be set |
|
||||
|value |The value to set |
|
||||
|class |Optional class name(s) |
|
||||
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var Widget = require("$:/core/modules/widgets/widget.js").widget;
|
||||
|
||||
var RadioWidget = function(parseTreeNode,options) {
|
||||
this.initialise(parseTreeNode,options);
|
||||
};
|
||||
|
||||
/*
|
||||
Inherit from the base widget class
|
||||
*/
|
||||
RadioWidget.prototype = new Widget();
|
||||
|
||||
/*
|
||||
Render this widget into the DOM
|
||||
*/
|
||||
RadioWidget.prototype.render = function(parent,nextSibling) {
|
||||
// Save the parent dom node
|
||||
this.parentDomNode = parent;
|
||||
// Compute our attributes
|
||||
this.computeAttributes();
|
||||
// Execute our logic
|
||||
this.execute();
|
||||
// Create our elements
|
||||
this.labelDomNode = this.document.createElement("label");
|
||||
this.labelDomNode.setAttribute("class",this.radioClass);
|
||||
this.inputDomNode = this.document.createElement("input");
|
||||
this.inputDomNode.setAttribute("type","radio");
|
||||
if(this.getValue() == this.radioValue) {
|
||||
this.inputDomNode.setAttribute("checked","true");
|
||||
}
|
||||
this.labelDomNode.appendChild(this.inputDomNode);
|
||||
this.spanDomNode = this.document.createElement("span");
|
||||
this.labelDomNode.appendChild(this.spanDomNode);
|
||||
// Add a click event handler
|
||||
$tw.utils.addEventListeners(this.inputDomNode,[
|
||||
{name: "change", handlerObject: this, handlerMethod: "handleChangeEvent"}
|
||||
]);
|
||||
// Insert the label into the DOM and render any children
|
||||
parent.insertBefore(this.labelDomNode,nextSibling);
|
||||
this.renderChildren(this.spanDomNode,null);
|
||||
this.domNodes.push(this.labelDomNode);
|
||||
};
|
||||
|
||||
RadioWidget.prototype.getValue = function() {
|
||||
var tiddler = this.wiki.getTiddler(this.radioTitle);
|
||||
return tiddler && tiddler.getFieldString(this.radioField);
|
||||
};
|
||||
|
||||
RadioWidget.prototype.setValue = function() {
|
||||
if(this.radioField) {
|
||||
var tiddler = this.wiki.getTiddler(this.radioTitle),
|
||||
addition = {};
|
||||
addition[this.radioField] = this.radioValue;
|
||||
this.wiki.addTiddler(new $tw.Tiddler(tiddler,addition));
|
||||
}
|
||||
};
|
||||
|
||||
RadioWidget.prototype.handleChangeEvent = function(event) {
|
||||
if (this.inputDomNode.checked) {
|
||||
this.setValue();
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Compute the internal state of the widget
|
||||
*/
|
||||
RadioWidget.prototype.execute = function() {
|
||||
// Get the parameters from the attributes
|
||||
this.radioTitle = this.getAttribute("tiddler",this.getVariable("currentTiddler"));
|
||||
this.radioField = this.getAttribute("field");
|
||||
this.radioValue = this.getAttribute("value");
|
||||
this.radioClass = this.getAttribute("class","");
|
||||
if(this.radioClass !== "") {
|
||||
this.radioClass += " ";
|
||||
}
|
||||
this.radioClass += "tw-radio";
|
||||
// Make the child widgets
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
|
||||
/*
|
||||
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
|
||||
*/
|
||||
RadioWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.value || changedAttributes["class"]) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
} else {
|
||||
var refreshed = false;
|
||||
if(changedTiddlers[this.radioTitle]) {
|
||||
this.inputDomNode.checked = this.getValue() === this.radioValue;
|
||||
refreshed = true;
|
||||
}
|
||||
return this.refreshChildren(changedTiddlers) || refreshed;
|
||||
}
|
||||
};
|
||||
|
||||
exports.radio = RadioWidget;
|
||||
|
||||
})();
|
||||
53
core/modules/widgets/raw.js
Normal file
53
core/modules/widgets/raw.js
Normal 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;
|
||||
|
||||
})();
|
||||
@@ -143,29 +143,34 @@ Widget.prototype.evaluateMacroModule = function(name,actualParams,defaultValue)
|
||||
if($tw.utils.hop($tw.macros,name)) {
|
||||
var macro = $tw.macros[name],
|
||||
args = [];
|
||||
var nextAnonParameter = 0, // Next candidate anonymous parameter in macro call
|
||||
paramInfo, paramValue;
|
||||
// Step through each of the parameters in the macro definition
|
||||
for(var p=0; p<macro.params.length; p++) {
|
||||
// Check if we've got a macro call parameter with the same name
|
||||
paramInfo = macro.params[p];
|
||||
paramValue = undefined;
|
||||
for(var m=0; m<actualParams.length; m++) {
|
||||
if(actualParams[m].name === paramInfo.name) {
|
||||
paramValue = actualParams[m].value;
|
||||
if(macro.params.length > 0) {
|
||||
var nextAnonParameter = 0, // Next candidate anonymous parameter in macro call
|
||||
paramInfo, paramValue;
|
||||
// Step through each of the parameters in the macro definition
|
||||
for(var p=0; p<macro.params.length; p++) {
|
||||
// Check if we've got a macro call parameter with the same name
|
||||
paramInfo = macro.params[p];
|
||||
paramValue = undefined;
|
||||
for(var m=0; m<actualParams.length; m++) {
|
||||
if(actualParams[m].name === paramInfo.name) {
|
||||
paramValue = actualParams[m].value;
|
||||
}
|
||||
}
|
||||
// If not, use the next available anonymous macro call parameter
|
||||
while(nextAnonParameter < actualParams.length && actualParams[nextAnonParameter].name) {
|
||||
nextAnonParameter++;
|
||||
}
|
||||
if(paramValue === undefined && nextAnonParameter < actualParams.length) {
|
||||
paramValue = actualParams[nextAnonParameter++].value;
|
||||
}
|
||||
// If we've still not got a value, use the default, if any
|
||||
paramValue = paramValue || paramInfo["default"] || "";
|
||||
// Save the parameter
|
||||
args.push(paramValue);
|
||||
}
|
||||
// If not, use the next available anonymous macro call parameter
|
||||
while(nextAnonParameter < actualParams.length && actualParams[nextAnonParameter].name) {
|
||||
nextAnonParameter++;
|
||||
}
|
||||
if(paramValue === undefined && nextAnonParameter < actualParams.length) {
|
||||
paramValue = actualParams[nextAnonParameter++].value;
|
||||
}
|
||||
// If we've still not got a value, use the default, if any
|
||||
paramValue = paramValue || paramInfo["default"] || "";
|
||||
// Save the parameter
|
||||
args.push(paramValue);
|
||||
}
|
||||
else for(var i=0; i<actualParams.length; ++i) {
|
||||
args.push(actualParams[i].value);
|
||||
}
|
||||
return macro.run.apply(this,args)
|
||||
} else {
|
||||
|
||||
@@ -173,11 +173,11 @@ exports.tiddlerExists = function(title) {
|
||||
Generate an unused title from the specified base
|
||||
*/
|
||||
exports.generateNewTitle = function(baseTitle) {
|
||||
var c = 0;
|
||||
do {
|
||||
var title = baseTitle + (c ? " " + (c + 1) : "");
|
||||
c++;
|
||||
} while(this.tiddlerExists(title));
|
||||
var c = 0,
|
||||
title = baseTitle;
|
||||
while(this.tiddlerExists(title)) {
|
||||
title = baseTitle + " " + (++c);
|
||||
};
|
||||
return title;
|
||||
};
|
||||
|
||||
@@ -255,14 +255,23 @@ exports.getModificationFields = function() {
|
||||
};
|
||||
|
||||
/*
|
||||
Return a sorted array of non-system tiddler titles, optionally filtered by a tag
|
||||
Return a sorted array of tiddler titles. Options include:
|
||||
sortField: field to sort by
|
||||
excludeTag: tag to exclude
|
||||
includeSystem: whether to include system tiddlers (defaults to false)
|
||||
*/
|
||||
exports.getTiddlers = function(sortField,excludeTag) {
|
||||
sortField = sortField || "title";
|
||||
var tiddlers = [], t, titles = [];
|
||||
exports.getTiddlers = function(options) {
|
||||
options = options || {};
|
||||
var self = this,
|
||||
sortField = options.sortField || "title",
|
||||
tiddlers = [], t, titles = [];
|
||||
for(t in this.tiddlers) {
|
||||
if($tw.utils.hop(this.tiddlers,t) && !this.isSystemTiddler(t) && (!excludeTag || !this.tiddlers[t].hasTag(excludeTag))) {
|
||||
tiddlers.push(this.tiddlers[t]);
|
||||
if($tw.utils.hop(this.tiddlers,t)) {
|
||||
if(options.includeSystem || !this.isSystemTiddler(t)) {
|
||||
if(!options.excludeTag || !this.tiddlers[t].hasTag(excludeTag)) {
|
||||
tiddlers.push(this.tiddlers[t]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tiddlers.sort(function(a,b) {
|
||||
@@ -285,7 +294,7 @@ exports.getTiddlers = function(sortField,excludeTag) {
|
||||
};
|
||||
|
||||
exports.countTiddlers = function(excludeTag) {
|
||||
var tiddlers = this.getTiddlers(null,excludeTag);
|
||||
var tiddlers = this.getTiddlers({excludeTag: excludeTag});
|
||||
return $tw.utils.count(tiddlers);
|
||||
};
|
||||
|
||||
@@ -323,12 +332,17 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive) {
|
||||
});
|
||||
};
|
||||
|
||||
exports.forEachTiddler = function(/* [sortField,[excludeTag,]]callback */) {
|
||||
/*
|
||||
For every tiddler invoke a callback(title,tiddler) with `this` set to the wiki object. Options include:
|
||||
sortField: field to sort by
|
||||
excludeTag: tag to exclude
|
||||
includeSystem: whether to include system tiddlers (defaults to false)
|
||||
*/
|
||||
exports.forEachTiddler = function(/* [options,]callback */) {
|
||||
var arg = 0,
|
||||
sortField = arguments.length > 1 ? arguments[arg++] : null,
|
||||
excludeTag = arguments.length > 2 ? arguments[arg++] : null,
|
||||
options = arguments.length >= 2 ? arguments[arg++] : {},
|
||||
callback = arguments[arg++],
|
||||
titles = this.getTiddlers(sortField,excludeTag),
|
||||
titles = this.getTiddlers(options),
|
||||
t, tiddler;
|
||||
for(t=0; t<titles.length; t++) {
|
||||
tiddler = this.tiddlers[titles[t]];
|
||||
@@ -757,7 +771,7 @@ exports.parseTextReference = function(title,field,index,options) {
|
||||
if(text === undefined) {
|
||||
text = "";
|
||||
}
|
||||
return this.parseText("text/vnd.tiddlywiki",text,options);
|
||||
return this.parseText("text/vnd.tiddlywiki",text.toString(),options);
|
||||
} else if(index) {
|
||||
text = this.extractTiddlerDataItem(title,index,"");
|
||||
return this.parseText("text/vnd.tiddlywiki",text,options);
|
||||
@@ -926,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 {
|
||||
@@ -1010,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
|
||||
@@ -1049,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
|
||||
|
||||
5
core/templates/MOTW.html.tid
Normal file
5
core/templates/MOTW.html.tid
Normal file
@@ -0,0 +1,5 @@
|
||||
title: $:/core/templates/MOTW.html
|
||||
|
||||
\rules only filteredtranscludeinline transcludeinline entity
|
||||
<!-- The following comment is called a MOTW comment and is necessary for the TiddlyIE Internet Explorer extension -->
|
||||
<!-- saved from url=(0021)http://tiddlywiki.com -->
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>`
|
||||
|
||||
@@ -2,8 +2,9 @@ title: $:/core/templates/tiddlywiki5.html
|
||||
|
||||
\rules only filteredtranscludeinline transcludeinline
|
||||
<!doctype html>
|
||||
<html>
|
||||
{{$:/core/templates/MOTW.html}}<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!-- Force IE standards mode for Intranet and HTA - should be the first meta -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="application-name" content="TiddlyWiki" />
|
||||
<meta name="generator" content="TiddlyWiki" />
|
||||
@@ -13,38 +14,39 @@ title: $:/core/templates/tiddlywiki5.html
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="copyright" content="{{$:/core/copyright.txt}}" />
|
||||
<link id="faviconLink" rel="shortcut icon" href="favicon.ico">
|
||||
<title>{{$:/core/wiki/title}}</title>
|
||||
<!----------- This is a Tiddlywiki file. The points of interest in the file are marked with this pattern ----------->
|
||||
<!--~~ This is a Tiddlywiki file. The points of interest in the file are marked with this pattern ~~-->
|
||||
|
||||
<!----------- Raw markup ----------->
|
||||
<!--~~ Raw markup ~~-->
|
||||
{{{ [tag[$:/core/wiki/rawmarkup]] ||$:/core/templates/plain-text-tiddler}}}
|
||||
</head>
|
||||
<body class="tw-body">
|
||||
<!----------- Static styles ----------->
|
||||
<!--~~ Static styles ~~-->
|
||||
<div id="styleArea">
|
||||
{{{ [is[system]type[text/css]] ||$:/core/templates/css-tiddler}}}
|
||||
</div>
|
||||
<!----------- Static content for Google and browsers without JavaScript ----------->
|
||||
<!--~~ Static content for Google and browsers without JavaScript ~~-->
|
||||
<noscript>
|
||||
<div id="splashArea">
|
||||
{{$:/core/templates/static.area}}
|
||||
</div>
|
||||
</noscript>
|
||||
<!----------- Ordinary tiddlers ----------->
|
||||
<!--~~ Ordinary tiddlers ~~-->
|
||||
{{$:/core/templates/store.area.template.html}}
|
||||
<!----------- Library modules ----------->
|
||||
<!--~~ Library modules ~~-->
|
||||
<div id="libraryModules" style="display:none;">
|
||||
{{{ [is[system]type[application/javascript]library[yes]] ||$:/core/templates/javascript-tiddler}}}
|
||||
</div>
|
||||
<!----------- Boot kernel prologue ----------->
|
||||
<!--~~ Boot kernel prologue ~~-->
|
||||
<div id="bootKernelPrefix" style="display:none;">
|
||||
{{ $:/boot/bootprefix.js ||$:/core/templates/javascript-tiddler}}
|
||||
</div>
|
||||
<!----------- Plugin modules ----------->
|
||||
<!--~~ Plugin modules ~~-->
|
||||
<div id="modules" style="display:none;">
|
||||
{{{ [is[system]type[application/javascript]has[module-type]] ||$:/core/templates/module-tiddler}}}
|
||||
</div>
|
||||
<!----------- Boot kernel ----------->
|
||||
<!--~~ Boot kernel ~~-->
|
||||
<div id="bootKernel" style="display:none;">
|
||||
{{ $:/boot/boot.js ||$:/core/templates/javascript-tiddler}}
|
||||
</div>
|
||||
|
||||
@@ -2,22 +2,13 @@ title: $:/core/ui/ControlPanel/Basics
|
||||
tags: $:/tags/ControlPanel
|
||||
caption: Basics
|
||||
|
||||
! Settings
|
||||
|
||||
|TiddlyWiki version |''<<version>>'' |
|
||||
|[[Title of this TiddlyWiki|SiteTitle]] |<$edit-text tiddler="SiteTitle" default="" tag="input"/> |
|
||||
|[[Subtitle|SiteSubtitle]] |<$edit-text tiddler="SiteSubtitle" default="" tag="input"/> |
|
||||
|[[Username for signing edits|$:/status/UserName]] |<$edit-text tiddler="$:/status/UserName" default="" tag="input"/> |
|
||||
|[[Animation duration|$:/config/AnimationDuration]] |<$edit-text tiddler="$:/config/AnimationDuration" default="" tag="input"/> |
|
||||
|[[DefaultTiddlers|$:/DefaultTiddlers]] |Choose which tiddlers are displayed at startup:<br> <$edit-text tag="textarea" tiddler="$:/DefaultTiddlers"/> |
|
||||
|
||||
! Info
|
||||
|
||||
!! Your Stuff
|
||||
|
||||
* Number of tiddlers: <$count filter="[!is[system]]"/>
|
||||
|
||||
!! TiddlyWiki's Stuff
|
||||
|
||||
* Number of system tiddlers: <$count filter="[is[system]]"/>
|
||||
* Number of shadow tiddlers: <$count filter="[is[shadow]]"/>
|
||||
** Number of over-ridden shadow tiddlers: <$count filter="[!is[system]is[shadow]]"/>
|
||||
|Tiddlers |''<$count filter="[!is[system]]"/>'' |
|
||||
|System tiddlers |''<$count filter="[is[system]]"/>'' |
|
||||
|Shadow tiddlers |''<$count filter="[is[shadow]]"/>'' |
|
||||
|Overridden shadow tiddlers |''<$count filter="[!is[system]is[shadow]]"/>'' |
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
title: $:/core/ui/EditTemplate
|
||||
modifier: JeremyRuston
|
||||
|
||||
\define frame-classes()
|
||||
tw-tiddler-frame tw-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
|
||||
\end
|
||||
<div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] +[tag[$:/tags/EditTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list></div>
|
||||
<$set name="storyTiddler" value=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/EditTemplate]] +[tag[$:/tags/EditTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list></div></$set>
|
||||
|
||||
@@ -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>
|
||||
|
||||
5
core/ui/PageStylesheet.tid
Normal file
5
core/ui/PageStylesheet.tid
Normal file
@@ -0,0 +1,5 @@
|
||||
title: $:/core/ui/PageStylesheet
|
||||
|
||||
<$list filter="[is[shadow]tag[$:/tags/stylesheet]] [!is[shadow]tag[$:/tags/stylesheet]]">
|
||||
<$transclude/>
|
||||
</$list>
|
||||
@@ -6,7 +6,7 @@ tags: $:/tags/PageTemplate
|
||||
<div class="tw-subtitle">{{SiteSubtitle}}</div>
|
||||
|
||||
<div class="tw-page-controls">
|
||||
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/PageControls]] [!is[shadow]!has[draft.of]tag[$:/tags/PageControls]] [tag[$:/tags/PageControls]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
||||
<$list filter="[is[shadow]!has[draft.of]tag[$:/tags/PageControls]] [!is[shadow]!has[draft.of]tag[$:/tags/PageControls]] +[tag[$:/tags/PageControls]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
||||
</div>
|
||||
|
||||
{{$:/core/ui/SideBarLists}}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
title: $:/core/ui/ViewTemplate
|
||||
modifier: JeremyRuston
|
||||
|
||||
\define frame-classes()
|
||||
tw-tiddler-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
|
||||
\end
|
||||
<$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] +[tag[$:/tags/ViewTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
||||
<$set name="storyTiddler" value=<<currentTiddler>>><$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] [!is[shadow]!has[draft.of]tag[$:/tags/ViewTemplate]] +[tag[$:/tags/ViewTemplate]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
|
||||
</div>
|
||||
</$tiddler></$set>
|
||||
</$tiddler></$set></$set>
|
||||
|
||||
@@ -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]]
|
||||
|
||||
BIN
editions/clientserver/tiddlers/system/favicon.ico
Normal file
BIN
editions/clientserver/tiddlers/system/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
2
editions/clientserver/tiddlers/system/favicon.ico.meta
Normal file
2
editions/clientserver/tiddlers/system/favicon.ico.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
title: $:/favicon.ico
|
||||
type: image/x-icon
|
||||
@@ -1,4 +1,3 @@
|
||||
title: SiteSubtitle
|
||||
modifier: JeremyRuston
|
||||
|
||||
Tahoe-LAFS edition
|
||||
@@ -1,4 +1,3 @@
|
||||
title: SiteTitle
|
||||
modifier: JeremyRuston
|
||||
|
||||
TiddlyWiki5
|
||||
@@ -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/
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
title: SiteSubtitle
|
||||
modifier: JeremyRuston
|
||||
|
||||
browser-based test runner
|
||||
@@ -1,4 +1,3 @@
|
||||
title: SiteTitle
|
||||
modifier: JeremyRuston
|
||||
|
||||
TiddlyWiki5
|
||||
@@ -113,6 +113,15 @@ describe("WikiText parser tests", function() {
|
||||
|
||||
});
|
||||
|
||||
it("should parse hard linebreak areas", function() {
|
||||
expect(parse("\"\"\"Something\nin the\nway she moves\n\"\"\"\n\n")).toEqual(
|
||||
|
||||
[ { type : 'element', tag : 'p', children : [ { type : 'text', text : 'Something' }, { type : 'element', tag : 'br' }, { type : 'text', text : 'in the' }, { type : 'element', tag : 'br' }, { type : 'text', text : 'way she moves' }, { type : 'element', tag : 'br' } ] } ]
|
||||
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
@@ -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>
|
||||
<$view></code> widget that strips single line <span>
|
||||
JavaScript</span> comments starting <code>
|
||||
//#</code></li><li>
|
||||
The <code>
|
||||
stripTitlePrefix='yes'</code> attribute of the <code>
|
||||
<$fields></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 <path_to_recipe_file> \
|
||||
--rendertiddler $:/core/templates/tiddlywiki2.template.html <path_to_write_index_file> text/plain \
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
modified: 201305070956
|
||||
title: Acknowledgements
|
||||
modifier: JeremyRuston
|
||||
tags: introduction
|
||||
|
||||
TiddlyWiki5 wouldn't be possible without the ongoing support of the TiddlyWiki user and developer community. Their attention and feedback has made it possible to gain an understanding of what is wanted from the product, and their passion for it has taught me that it is worth the investment that I am making.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20130909151600000
|
||||
creator: JeremyRuston
|
||||
modified: 20131128103349581
|
||||
modifier: JeremyRuston
|
||||
modified: 20131218094207015
|
||||
tags: community
|
||||
title: Community
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -26,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
|
||||
|
||||
@@ -34,6 +34,7 @@ The TiddlyWiki discussion groups are mailing lists for talking about TiddlyWiki:
|
||||
|
||||
! Examples of TiddlyWiki5 being used in the wild
|
||||
|
||||
|!Site |!Description |
|
||||
|http://freedombits.org |A manifesto for the preservation of free speech through the exchange of randomized data |
|
||||
|http://giffmex.org/nt/1johnnotebase.html |A study notebook for the Bible ||
|
||||
; http://freedombits.org
|
||||
: A manifesto for the preservation of free speech through the exchange of randomized data
|
||||
; http://giffmex.org/nt/1johnnotebase.html
|
||||
: A study notebook for the Bible
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
created: 201311011114
|
||||
creator: JeremyRuston
|
||||
modified: 201311301614
|
||||
modifier: JeremyRuston
|
||||
created: 20131101111400000
|
||||
modified: 20131218121606089
|
||||
tags: introduction
|
||||
title: Contributing
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
TiddlyWiki5 welcomes contributions to its code and documentation via [[GitHub|https://github.com/Jermolene/TiddlyWiki5]]. Please take a moment to read these notes to help make the process as smooth as possible.
|
||||
|
||||
!! Bug Reports
|
||||
|
||||
From the perspective of the developers, a bug report that says little more than "it doesn't work" can be frustrating. For effective debugging, we need as much information as possible. At a minimum, please try to include:
|
||||
For effective debugging, we need as much information as possible. At a minimum, please try to include:
|
||||
|
||||
* A descriptive title
|
||||
* A summary
|
||||
@@ -17,6 +16,8 @@ From the perspective of the developers, a bug report that says little more than
|
||||
* Expected behaviour
|
||||
* Context (OS, browser etc.)
|
||||
|
||||
Consider also adding screenshots if it makes things clearer.
|
||||
|
||||
There's a lot of good material on the web about bug reports:
|
||||
|
||||
* http://mhay68.tumblr.com/post/1648223018/what-makes-a-good-bug-report
|
||||
@@ -24,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]]
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20130824141800000
|
||||
creator: JeremyRuston
|
||||
modified: 20131206163714703
|
||||
modifier: JeremyRuston
|
||||
modified: 20131212093542990
|
||||
tags: introduction
|
||||
title: Docs
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -11,7 +9,7 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
<ul><$list filter="[tag[$tag$]]"><li><$link to={{!!title}}><$view field="title"/></$link></li></$list></ul>
|
||||
\end
|
||||
This is the main documentation hub for TiddlyWiki. See also the DeveloperDocs.
|
||||
This is the main documentation hub for TiddlyWiki. See also [[TiddlyWiki for Developers]].
|
||||
|
||||
! How to use ~TiddlyWiki5
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
created: 20131119194500000
|
||||
creator: JeremyRuston
|
||||
modified: 20131129094606811
|
||||
modifier: JeremyRuston
|
||||
modified: 20131212094150331
|
||||
tags: introduction
|
||||
title: Download
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Download single file editions of version ''<<version>>'' of TiddlyWiki5:
|
||||
Download single file editions of version ''<<version>>'' of TiddlyWiki:
|
||||
|
||||
|{{$:/editions/tw5.com/snippets/download-empty-button}}|Get started with an empty wiki |
|
||||
|{{$:/snippets/download-wiki-button}}|Download a full copy of this site, including all the documentation |
|
||||
|
||||
For more advanced configurations, you can run [[TiddlyWiki5 on Node.js]].
|
||||
For more advanced configurations, you can run [[TiddlyWiki on Node.js]].
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201309091551
|
||||
creator: JeremyRuston
|
||||
modified: 201309091551
|
||||
modifier: JeremyRuston
|
||||
title: Examples
|
||||
|
||||
Examples of TiddlyWiki5 being used in the wild:
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20130822172800000
|
||||
creator: JeremyRuston
|
||||
modified: 20131203112520519
|
||||
modifier: JeremyRuston
|
||||
modified: 20131213100612914
|
||||
tags: introduction
|
||||
title: Features
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -16,14 +14,14 @@ type: text/vnd.tiddlywiki
|
||||
* Clone existing tiddlers (for example, <$button message="tw-new-tiddler" param=<<currentTiddler>>>clone this tiddler</$button>)
|
||||
* TiddlyWiki is [[surprisingly scalable|Scalability]] to many thousands of tiddlers and megabytes of content
|
||||
* Try out the <$button message="tw-full-screen">full screen support</$button>
|
||||
* Explore the [[D3.js visualisation plugin|http://five.tiddlywiki.com/d3demo.html]]
|
||||
* [[CodeMirror support via a plugin|http://five.tiddlywiki.com/codemirrordemo.html]]
|
||||
* [[Markdown support via a plugin|http://five.tiddlywiki.com/markdowndemo.html]]
|
||||
* Explore the [[D3.js visualisation plugin|http://tiddlywiki.com/d3demo.html]]
|
||||
* [[CodeMirror support via a plugin|http://tiddlywiki.com/codemirrordemo.html]]
|
||||
* [[Markdown support via a plugin|http://tiddlywiki.com/markdowndemo.html]]
|
||||
* Many internal improvements:
|
||||
** TiddlyWiki can now be run under [[Node.js]] as well as in the browser, allowing it to be used as a personal web server
|
||||
** An elegant [[microkernel architecture|PluginMechanism]], that allows infinite customisation by replacing and augmenting the core modules
|
||||
** TiddlyWiki5 can directly build both itself and previous (2.x.x) versions of TiddlyWiki from their constituent separate files, without needing external tools
|
||||
** Run the TiddlyWiki5 [[test suite|TestingMechanism]] from http://five.tiddlywiki.com/test.html
|
||||
** TiddlyWiki version 5 can directly build both itself and previous (2.x.x) versions of TiddlyWiki from their constituent separate files, without needing external tools
|
||||
** Run the TiddlyWiki [[test suite|TestingMechanism]] from http://tiddlywiki.com/test.html
|
||||
* Last but not least, TiddlyWiki is a rare example of a practical [[quine|Quine]]
|
||||
|
||||
The deep internal changes mean that TiddlyWiki5 is not compatible with previous versions, using different plugins, themes and so on. Content prepared for previous versions of TiddlyWiki will need massaging to work properly in TiddlyWiki5. When asking or searching for help be sure to specify TiddlyWiki5 (or TW5).
|
||||
The deep internal changes mean that TiddlyWiki version 5 is not compatible with previous versions, using different plugins, themes and so on. Content prepared for previous versions of TiddlyWiki will need massaging to work properly. When asking or searching for help be sure to specify TiddlyWiki5 (or TW5).
|
||||
|
||||
7
editions/tw5.com/tiddlers/Future of TiddlyWiki.tid
Normal file
7
editions/tw5.com/tiddlers/Future of TiddlyWiki.tid
Normal file
@@ -0,0 +1,7 @@
|
||||
created: 20131213101024997
|
||||
modified: 20131213101420914
|
||||
title: Future of TiddlyWiki
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
TiddlyWiki is designed with the long term needs of its users in mind. Because it is OpenSource and needs no infrastructure, we can be confident that all we'll need to access a TiddlyWiki file even in the far future is an ordinary HTML browser. If you're starting to use TiddlyWiki at the beginning of your career you can be confident that it will carry you through to retirement.
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
created: 20131129090249275
|
||||
creator: JeremyRuston
|
||||
modified: 20131206172416371
|
||||
modifier: JeremyRuston
|
||||
modified: 20131215165204528
|
||||
tags: introduction
|
||||
title: GettingStarted
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
TiddlyWiki is highly flexible, and there are many different ways to use it. Here we're focusing on using it as a standalone file in the browser, which is a good choice for most users as it doesn't require any special knowledge or tools. For more options you can also run [[TiddlyWiki5 on Node.js]].
|
||||
TiddlyWiki is highly flexible, and there are many different ways to use it. Here we're focusing on using it as a standalone file in the browser, which is a good choice for most users as it doesn't require any special knowledge or tools. For more options you can also run [[TiddlyWiki on Node.js]].
|
||||
|
||||
[[Video Tutorials]] are available, too.
|
||||
|
||||
@@ -21,10 +20,11 @@ Saving changes as described above is quite inconvenient because of the degree of
|
||||
|
||||
! Other ways of saving changes
|
||||
|
||||
[[Saving with Encryption]] explains how to use TiddlyWiki5's built-in encryption to protect your content with a password.
|
||||
[[Saving with Encryption]] explains how to use TiddlyWiki's built-in encryption to protect your content with a password.
|
||||
|
||||
You can also try:
|
||||
|
||||
* [[Saving on iPad/iPhone]] with the custom ''TWEdit'' app
|
||||
* [[Saving on Android]] with the custom ''~AndTidWiki'' app
|
||||
* [[Saving on InternetExplorer]] with the [[TiddlyIE]] extension, or via the [[Windows HTA Hack]]
|
||||
* [[Saving on TiddlySpot]], a free service that lets you use TiddlyWiki online
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
created: 20130822170200000
|
||||
creator: JeremyRuston
|
||||
modified: 20131206165151008
|
||||
modifier: JeremyRuston
|
||||
modified: 20131221173550176
|
||||
tags: introduction
|
||||
title: HelloThere
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Welcome to TiddlyWiki5, a reboot of TiddlyWiki, the non-linear personal web notebook first released in 2004. It is a complete interactive wiki in JavaScript that can be run from a [[single HTML file in the browser|SingleFileApplication]] or as a powerful [[Node.js application|Node.js]].
|
||||
Welcome to TiddlyWiki, a complete interactive wiki in JavaScript. It can be used as a [[single HTML file in the browser|SingleFileApplication]] or as a powerful [[Node.js application|Node.js]]. It is highly customisable: the entire user interface is itself implemented in hackable WikiText.
|
||||
|
||||
TiddlyWiki5 is currently in alpha at version //<<version>>// (see the detailed ReleaseHistory). There is a RoadMap for moving to beta and getting to the full release. It is a great time to get involved and support the future development of TiddlyWiki5.
|
||||
This is version <<version>> of TiddlyWiki, a major reboot designed [[for the next 25 years|Future of TiddlyWiki]]. It is currently in beta (see the detailed ReleaseHistory). There is a RoadMap for moving to the full release. It is a great time to get involved and support the future development of TiddlyWiki.
|
||||
|
||||
//TiddlyWiki5 and TiddlyWiki Classic are free, open source projects that depend on [[your love and support|HelpingTiddlyWiki]] for their survival//.
|
||||
//TiddlyWiki is a free, open source project that depends on [[your love and support|HelpingTiddlyWiki]] for its survival//.
|
||||
|
||||
<div class="tw-message-box">
|
||||
<a class="tw-message-icon" href="http://tiddlywiki.com/" target="_blank">{{TiddlyWiki Classic.png}}</a>
|
||||
|
||||
!! TiddlyWiki Classic - http://tiddlywiki.com
|
||||
!! TiddlyWikiClassic - http://classic.tiddlywiki.com
|
||||
|
||||
The deep internal improvements mean that TiddlyWiki5 is not fully compatible with older versions. Existing content will need massaging, while plugins and themes will have to be completely rewritten. The upgrade path will get smoother as TiddlyWiki5 matures.
|
||||
On this site, unless noted otherwise, "~TiddlyWiki" refers to the new version 5, and "~TiddlyWikiClassic" is used to identify the older version.
|
||||
|
||||
The deep internal improvements mean that the new version of TiddlyWiki is not fully compatible with TiddlyWikiClassic. Existing content will need massaging, while plugins and themes will have to be completely rewritten. The upgrade path will get smoother as the new version matures.
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20130825160500000
|
||||
creator: JeremyRuston
|
||||
modified: 20131206172505397
|
||||
modifier: JeremyRuston
|
||||
tags: community
|
||||
title: HelpingTiddlyWiki
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20131128075743966
|
||||
creator: JeremyRuston
|
||||
modified: 20131128093317966
|
||||
modifier: JeremyRuston
|
||||
tags: introduction
|
||||
title: Philosophy of Tiddlers
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201311081754007
|
||||
creator: JeremyRuston
|
||||
modified: 201311081754007
|
||||
modifier: JeremyRuston
|
||||
title: Release 5.0.0-alpha.11
|
||||
tags: releasenote
|
||||
released: 201311081806
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201311081854007
|
||||
creator: JeremyRuston
|
||||
modified: 201311081854007
|
||||
modifier: JeremyRuston
|
||||
title: Release 5.0.0-alpha.12
|
||||
tags: releasenote
|
||||
released: 201311082141
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201311091122007
|
||||
creator: JeremyRuston
|
||||
modified: 201311091122007
|
||||
modifier: JeremyRuston
|
||||
title: Release 5.0.0-alpha.13
|
||||
tags: releasenote
|
||||
released: 201311091927
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201311101922007
|
||||
creator: JeremyRuston
|
||||
modified: 201311101922007
|
||||
modifier: JeremyRuston
|
||||
title: Release 5.0.0-alpha.14
|
||||
tags: releasenote
|
||||
released: 201311102315
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201311122050007
|
||||
creator: JeremyRuston
|
||||
modified: 201311122050007
|
||||
modifier: JeremyRuston
|
||||
title: Release 5.0.0-alpha.15
|
||||
tags: releasenote
|
||||
released: 201311191221
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20131119125600007
|
||||
creator: JeremyRuston
|
||||
modified: 20131130095531749
|
||||
modifier: JeremyRuston
|
||||
tags: releasenote
|
||||
title: Release 5.0.0-alpha.16
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20131130151600007
|
||||
creator: JeremyRuston
|
||||
modified: 20131130151631749
|
||||
modifier: JeremyRuston
|
||||
tags: releasenote
|
||||
title: Release 5.0.0-alpha.17
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
created: 20131201132300007
|
||||
creator: JeremyRuston
|
||||
modified: 20131206161343895
|
||||
modifier: JeremyRuston
|
||||
tags: releasenote
|
||||
title: Release 5.0.1-alpha
|
||||
type: text/vnd.tiddlywiki
|
||||
released: 201312061753
|
||||
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.0-alpha.17...v5.0.1-alpha]]//
|
||||
|
||||
@@ -24,4 +23,4 @@ type: text/vnd.tiddlywiki
|
||||
!! Internal changes
|
||||
|
||||
* Changed the [[TiddlyWiki5 Versioning]] policy
|
||||
** New alpha releases will be `5.0.x-alpha`, beta releases will be `5.1.x-beta` and the final release will be `5.2.x`
|
||||
** Beta releases will be `5.0.x-beta` and the final release will be `5.1.x`
|
||||
|
||||
30
editions/tw5.com/tiddlers/Release 5.0.2beta.tid
Normal file
30
editions/tw5.com/tiddlers/Release 5.0.2beta.tid
Normal file
@@ -0,0 +1,30 @@
|
||||
created: 20131211074600007
|
||||
modified: 20131215142414174
|
||||
tags: releasenote
|
||||
title: Release 5.0.2-beta
|
||||
type: text/vnd.tiddlywiki
|
||||
released: 201312151436
|
||||
|
||||
//[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.0.1-alpha...v5.0.2-beta]]//
|
||||
|
||||
!! Improvements
|
||||
|
||||
* Added support for [[Hard Linebreaks in WikiText]]
|
||||
* Added a new RadioWidget, contributed by StephanHradek (@Skeeve on GitHub)
|
||||
* Two new savers for InternetExplorer, both contributed by DavidJade (@davidjade on GitHub)
|
||||
** ''tiddlyie'' for [[saving with TiddlyIE|Saving with TiddlyIE]], an equivalent of TiddlyFox for InternetExplorer
|
||||
** ''fsosaver'' that can [[save changes directly with InternetExplorer|Saving on InternetExplorer]] but requires the HTML file to be renamed `*.hta`
|
||||
|
||||
!! Bug fixes
|
||||
|
||||
* Fixed problem deleting tiddlers under the filesystemadaptor
|
||||
* Fixed problem with transcluding fields containing lists or dates (eg, `{{!!tags}}`)
|
||||
* Fixed problem with re-ordering page control tiddlers (ie tiddlers tagged `$:/tags/PageControls`)
|
||||
* Update template used for deploying to TiddlyWeb
|
||||
* Fixed problem with tiddler deletions via the file system adaptor
|
||||
|
||||
!! Internal changes
|
||||
|
||||
* Allowed variable number of arguments to [[JavaScript Macros]]
|
||||
** Contributed by StephanHradek (@Skeeve on GitHub)
|
||||
* Changed the format of plugin tiddlers to remove duplicated information (see the PluginMechanism)
|
||||
10
editions/tw5.com/tiddlers/Release 5.0.3beta.tid
Normal file
10
editions/tw5.com/tiddlers/Release 5.0.3beta.tid
Normal 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.
|
||||
30
editions/tw5.com/tiddlers/Release 5.0.4beta.tid
Normal file
30
editions/tw5.com/tiddlers/Release 5.0.4beta.tid
Normal 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.
|
||||
18
editions/tw5.com/tiddlers/Release 5.0.5beta.tid
Normal file
18
editions/tw5.com/tiddlers/Release 5.0.5beta.tid
Normal 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
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20131109105400007
|
||||
creator: JeremyRuston
|
||||
modified: 20131203093653197
|
||||
modifier: JeremyRuston
|
||||
title: ReleaseHistory
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308221734
|
||||
creator: JeremyRuston
|
||||
modified: 201308221734
|
||||
modifier: JeremyRuston
|
||||
tags: features
|
||||
title: Scalability
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20131128090536894
|
||||
creator: JeremyRuston
|
||||
modified: 20131128093425922
|
||||
modifier: JeremyRuston
|
||||
tags: introduction
|
||||
title: Structuring TiddlyWiki
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308230917000
|
||||
creator: JeremyRuston
|
||||
modified: 201311091500004
|
||||
modifier: JeremyRuston
|
||||
tags: community
|
||||
title: TiddlyWiki Hangouts
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
created: 20131129094353704
|
||||
creator: JeremyRuston
|
||||
modified: 20131129100329076
|
||||
modifier: JeremyRuston
|
||||
title: TiddlyWiki5 on Node.js
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
! Installation
|
||||
|
||||
For working on the command line with Node.js, you can install TiddlyWiki via [[npm|http://npmjs.org]]:
|
||||
|
||||
```
|
||||
npm -g install tiddlywiki
|
||||
```
|
||||
|
||||
The `-g` flag causes TiddlyWiki to be installed globally.
|
||||
|
||||
! Working with the TiddlyWiki5 repository
|
||||
|
||||
[[Working with the TiddlyWiki5 repository]] is recommended if you plan on forking the TiddlyWiki5 source code.
|
||||
@@ -1,34 +1,34 @@
|
||||
created: 20131202102427114
|
||||
creator: JeremyRuston
|
||||
modified: 20131205175047321
|
||||
modifier: JeremyRuston
|
||||
modified: 20131219100250559
|
||||
tags: howto
|
||||
title: Upgrading
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
There are several methods for upgrading an existing TiddlyWiki5 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
|
||||
# Drag your old TiddlyWiki5 HTML file into the browser window
|
||||
# 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
|
||||
# Save changes to save the new version.
|
||||
|
||||
This will download a file called ''empty.html'' to your computer. This file is the upgrade of your old file. You may need to open the location where ''empty.html'' was downloaded, rename ''empty.html'' with the name of the old file you are upgrading, and replace the old file by moving the new file in its place.
|
||||
|
||||
//For the moment you'll also need to manually update any plugins that are not included in empty.html://
|
||||
|
||||
># Open the control panel to the ''Plugins'' tab in your upgraded wiki
|
||||
># Check the version numbers of the plugins you are using; any plugins with an older version than the version of [[$:/core]] will probably need updating
|
||||
># Locate a wiki with the plugins you need to update and open the control panel ''Plugins'' tab
|
||||
>#* http://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.
|
||||
|
||||
10
editions/tw5.com/tiddlers/commands/SaveTiddlerCommand.tid
Normal file
10
editions/tw5.com/tiddlers/commands/SaveTiddlerCommand.tid
Normal 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>
|
||||
```
|
||||
@@ -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.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308251449
|
||||
creator: JeremyRuston
|
||||
modified: 201308251449
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: ContextTiddler
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308291647
|
||||
creator: JeremyRuston
|
||||
modified: 201308291647
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: DataTiddlers
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20131129162847412
|
||||
creator: JeremyRuston
|
||||
modified: 20131129162908445
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: ModuleType
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20131129162919588
|
||||
creator: JeremyRuston
|
||||
modified: 20131129162935396
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: Modules
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20130822080600000
|
||||
creator: JeremyRuston
|
||||
modified: 20131129163429930
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: SystemTags
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308270759
|
||||
creator: JeremyRuston
|
||||
modified: 201311011115
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: TextReference
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20130825213300000
|
||||
creator: JeremyRuston
|
||||
modified: 20131129162830410
|
||||
modifier: JeremyRuston
|
||||
modified: 20131212095204933
|
||||
tags: concepts
|
||||
title: TiddlerFields
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -12,6 +10,7 @@ The standard fields are:
|
||||
|
||||
|!Field Name |!Reference |!Description |
|
||||
|`title` |TitleField |{{$:/docs/fields/title}} |
|
||||
|`text` |TextField |{{$:/docs/fields/text}} |
|
||||
|`modified` |ModifiedField |{{$:/docs/fields/modified}} |
|
||||
|`modifier` |ModifierField |{{$:/docs/fields/modifier}} |
|
||||
|`created` |CreatedField |{{$:/docs/fields/created}} |
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308270800
|
||||
creator: JeremyRuston
|
||||
modified: 201311242006
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: TiddlerFilters
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20130825202900000
|
||||
creator: JeremyRuston
|
||||
modified: 20131128093306317
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: TiddlerLinks
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308252135
|
||||
creator: JeremyRuston
|
||||
modified: 201308300907
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: Tiddlers
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20130822170700000
|
||||
creator: JeremyRuston
|
||||
modified: 20131129163834730
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: TiddlyWiki
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308252136
|
||||
creator: JeremyRuston
|
||||
modified: 201308252136
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: TiddlyWiki5
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
created: 20130825214200000
|
||||
creator: JeremyRuston
|
||||
modified: 20131129095040600
|
||||
modifier: JeremyRuston
|
||||
modified: 20131212094058729
|
||||
tags: dev
|
||||
title: TiddlyWikiFolders
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
As well as traditional single file wikis, [[TiddlyWiki5 on Node.js]] supports wikis that are stored as a folder of individual tiddler files.
|
||||
As well as traditional single file wikis, [[TiddlyWiki on Node.js]] supports wikis that are stored as a folder of individual tiddler files.
|
||||
|
||||
! Wiki folder files and folders
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 20131205155227468
|
||||
creator: JeremyRuston
|
||||
modified: 20131205161350589
|
||||
modifier: JeremyRuston
|
||||
tags: concepts
|
||||
title: WikiText
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201311010911
|
||||
creator: JeremyRuston
|
||||
modified: 201311010911
|
||||
modifier: JeremyRuston
|
||||
title: BT
|
||||
|
||||
BT (née British Telecom) is the UK's largest telecommunications company. In 2007, [[Osmosoft]] was acquired by BT. JeremyRuston subsequently left BT in 2011.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308281853
|
||||
creator: JeremyRuston
|
||||
modified: 201308281853
|
||||
modifier: JeremyRuston
|
||||
tags: definitions
|
||||
title: CamelCase
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308281859
|
||||
creator: JeremyRuston
|
||||
modified: 201308281859
|
||||
modifier: JeremyRuston
|
||||
tags: definitions concepts
|
||||
title: ContentType
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
created: 201308251549
|
||||
creator: JeremyRuston
|
||||
modified: 201308251604
|
||||
modifier: JeremyRuston
|
||||
tags: definitions
|
||||
title: FederatialLimited
|
||||
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
created: 201308251421
|
||||
creator: JeremyRuston
|
||||
modified: 201308251421
|
||||
modifier: JeremyRuston
|
||||
created: 20130825142100000
|
||||
modified: 20131214090859260
|
||||
tags: definitions
|
||||
title: JavaScript
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
JavaScript is a computer language originally introduced by browsers as the standard scripting language for the web. It has since been recognised as a powerful language in its own right, and has been adopted widely beyond the browser.
|
||||
JavaScript is a computer language that was originally introduced by browsers as a way of scripting web pages. At first it was considered a poorly designed toy, but over the years has become recognised as a powerful language in its own right, and has been adopted widely beyond the browser.
|
||||
|
||||
JavaScript looks like this:
|
||||
|
||||
```
|
||||
function circleArea(radius) {
|
||||
return radius * 2 * 3.141592653;
|
||||
}
|
||||
```
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user