1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-01-22 10:54:46 +00:00

Compare commits

...

398 Commits

Author SHA1 Message Date
buggyj
b9e3550747 added global macro file for tw2 parser 2014-04-15 18:44:25 +01:00
buggyj
3d1a8ee703 added updated tw2 parser 2014-04-15 12:45:23 +01:00
buggyj
17902d1a1e added tw2 original from 3d38d4add3/plugins/tiddlywiki/tw2parser 2014-04-15 12:29:16 +01:00
Jermolene
622d4a2d50 Version number update for 5.0.8-beta 2014-02-28 15:54:01 +00:00
Jermolene
0cff397111 Set release date for 5.0.8 2014-02-28 15:52:12 +00:00
Jermolene
fbf4486d92 Docs updates 2014-02-28 15:50:19 +00:00
Jermolene
2714e0939f Docs updates 2014-02-28 15:48:12 +00:00
Jermolene
bde6f8d2b8 Docs updates 2014-02-28 15:31:43 +00:00
Jermolene
4194f9f20f Retract change to new tiddler handling in navigator.js
Original commit: d5c31ed07f
2014-02-28 15:31:35 +00:00
Jeremy Ruston
2c6e7ef489 Merge pull request #451 from xcazin/fr-FR
Elements necessary to create fr-FR.html via bld-languages.sh, aside "de" and "zh" files
2014-02-28 09:08:24 +00:00
Xavier Cazin
cc5be5eb15 Elements necessary to create an empty fr-FR.html via bld-languages.sh, aside "de" and "zh" files 2014-02-27 23:19:38 +01:00
Jeremy Ruston
be8efe1bc7 Merge pull request #441 from BramChen/master
Keep up-to-date changes for chinese translation
2014-02-27 18:48:38 +00:00
Jeremy Ruston
db3c06ecd0 Merge pull request #446 from xcazin/fr-FR
Last fr-FR translations (along with minor improvements and corrections), plus a typo on transclusion of rendertiddlers.tid.
2014-02-27 18:45:02 +00:00
Jeremy Ruston
947b48bcf9 Merge pull request #447 from pmario/de-DE
Help text tiddlers initial translation to de-DE
2014-02-27 18:41:11 +00:00
Jeremy Ruston
bed6cc7d67 Merge pull request #450 from xcazin/modifications
Added blank lines to switch to block rendering in RevealWidget examples
2014-02-27 18:40:18 +00:00
Xavier Cazin
63cb0eb3db In the examples, missing blank lines prevented the revealed text
to display as a block when clicking on buttons.
2014-02-27 19:21:04 +01:00
Jermolene
89c7310a53 Docs update 2014-02-27 17:07:52 +00:00
Jermolene
f244293cac Add a link back to github for each tiddler on tiddlywiki.com 2014-02-27 16:30:24 +00:00
Jermolene
3994f0dbc6 Add new option to retain tiddler paths 2014-02-27 16:30:05 +00:00
Jermolene
66bb7ad6ba Add backups to the roadmap 2014-02-27 16:29:46 +00:00
Jermolene
84928ac99c Docs updates 2014-02-26 20:27:00 +00:00
Mario Pietsch
6b4ec343a7 help text tiddlers translated to de-DE 2014-02-26 21:14:35 +01:00
Jermolene
3ff85e9507 Docs updates about edition name changes 2014-02-26 19:58:30 +00:00
Jermolene
cd09cf3874 Better documentation for widget messages 2014-02-26 19:55:42 +00:00
Mario Pietsch
9ce79b0795 Merge branch 'master' of https://github.com/Jermolene/TiddlyWiki5 into de-DE 2014-02-26 19:41:33 +01:00
Xavier Cazin
e2f964ae73 Translation of new Help directory on server commands. Plus minor improvements on previous translated strings. 2014-02-26 16:09:31 +01:00
Xavier Cazin
2aca526d4e Typo in transclusion. 2014-02-26 15:12:17 +01:00
Jermolene
0aa9f26d51 Docs update 2014-02-26 08:27:40 +00:00
Bram Chen
9e820a602b Keep up-to-date changes for chinese translation 2014-02-26 12:18:00 +08:00
Jermolene
d38c513512 Remove some coloured tag pills
When we render the static representation we get case insensitive
titles, so “community” overwrites “Community”, unhelpfully.
2014-02-25 22:38:34 +00:00
Jermolene
83b2a5d305 More tag colours 2014-02-25 21:22:21 +00:00
Jermolene
bcc282016e Use proper tag pills in the tag manager 2014-02-25 21:22:15 +00:00
Jermolene
cdc99ac29c Whoops, retract change to defaulttiddlers 2014-02-25 20:16:38 +00:00
Jermolene
cf4eed0129 Add first pass at a tag manager
As independently suggested by @Skeeve and @Spangenhelm
2014-02-25 20:14:16 +00:00
Mario Pietsch
70306de1b1 changed favicon, so flag colors are right now 2014-02-25 16:58:43 +01:00
Jeremy Ruston
a1a5ada68f Merge pull request #437 from pmario/de-DE
de-DE added favicon and typo fixes
2014-02-25 14:51:48 +00:00
Jermolene
9233069065 Docs update 2014-02-25 14:51:14 +00:00
Jermolene
e5103c32f3 Move command documentation into the core 2014-02-25 14:50:37 +00:00
Jermolene
cadeb9654c Add help command 2014-02-25 14:50:18 +00:00
Jermolene
2ed8df0d1f Add a new "commands" filter 2014-02-25 14:49:56 +00:00
Jermolene
3636744d4f Add support for retrieving formatted text content from the fake dom
The idea is to convert HTML block elements into newlines, so that the
output is readable on a terminal.
2014-02-25 14:49:07 +00:00
Jermolene
8ce7c3920c Get rid of the old print command
We’ll be introducing a help command to replace it
2014-02-25 14:47:19 +00:00
Mario Pietsch
470c056b8d Merge branch 'master' of https://github.com/Jermolene/TiddlyWiki5 into de-DE 2014-02-25 12:13:30 +01:00
Mario Pietsch
fd3ce5f668 new favicon for german languages. some type fixes. 2014-02-25 12:13:19 +01:00
Jermolene
f42246f171 Docs update 2014-02-24 14:40:41 +00:00
Jermolene
599f5978c9 Docs updates 2014-02-24 14:09:29 +00:00
Jermolene
042698b508 Some rejigging of the editions folders
Now we’re optimising the editions for use with the —init command.
Documentation coming up.
2014-02-24 13:28:55 +00:00
Jermolene
a1ad735822 Extend the init command to allow editions to be merged
Now we can say “—init tw5.com clientserver” to get the tw5.com content
with the client server plugins.
2014-02-24 10:58:11 +00:00
Jermolene
3f6bf2452a Init command should remove any includeWikis definitions
The includeWikis references will otherwise be broken when the edition
is copied.
2014-02-24 10:14:17 +00:00
Jermolene
886d648568 Remove obsolete plugins from tw5.com edition 2014-02-24 09:39:45 +00:00
Jermolene
dd299bf769 Typos and style tweaks 2014-02-23 23:09:58 +00:00
Jermolene
f3930ad69c Add init command to initialise a wiki folder
Fixes #362
2014-02-23 22:58:17 +00:00
Jermolene
b0394f1560 Add support for utils-node modules that are only run under Node.js 2014-02-23 22:57:25 +00:00
Jermolene
327403b3c9 Docs update 2014-02-23 19:28:05 +00:00
Jermolene
6cd13efd48 Docs updates 2014-02-23 19:22:44 +00:00
Jeremy Ruston
6947f8ebc2 Merge pull request #431 from pmario/de-DE
Added new translations for de-DE
2014-02-23 18:08:27 +00:00
Jermolene
0623dd5b7f Include toolbar button colours in palettes 2014-02-23 17:54:38 +00:00
Jermolene
99ccdf4584 Add confirmation when deleting tiddlers
Fixes #381
2014-02-23 17:37:32 +00:00
Jeremy Ruston
a332b82df5 Merge pull request #434 from BramChen/master
Get back on the right path
2014-02-23 17:31:11 +00:00
Jermolene
7f5f4df562 Tweaks to the vanilla theme and palette entries 2014-02-23 17:19:58 +00:00
Bram Chen
2b4dfba2ff Get back on the right path 2014-02-23 20:41:44 +08:00
Jermolene
260080164f Update setTiddlerData() to preserve tiddler dictionaries
Previously, data tiddlers were always being saved in JSON format,
regardless of the original format.
2014-02-23 12:33:00 +00:00
Mario Pietsch
3f7ff22280 Merge branch 'master' of https://github.com/Jermolene/TiddlyWiki5 into de-DE 2014-02-22 19:16:25 +01:00
Mario Pietsch
51c1a863f8 translations for Misc.multids and ControlPanel. Fields moved to outer dir 2014-02-22 19:16:16 +01:00
Jermolene
823b4fa61b Docs updates 2014-02-22 17:06:02 +00:00
Jermolene
c3f9cf41d5 Tweaks to @giffmex's palettes 2014-02-22 17:05:56 +00:00
Jermolene
ecb845f1cd Require that wiki folders have a tiddlywiki.info file
Previously, we were just using default content if the tiddlywiki.info
file was missing. This allowed us to do things like `tiddlywiki
—server` without actually being in a valid wiki folder.

Fixes #361
2014-02-22 16:38:34 +00:00
Jeremy Ruston
0737e62161 Merge pull request #430 from xcazin/fr-FR
Corrections on fr-FR translation per Julie Strzelecki remarks.
2014-02-22 16:13:49 +00:00
Jermolene
39ee69910e More docs updates 2014-02-22 16:13:32 +00:00
Jermolene
2ab0facf3a Extend button widget to allow navigating to a tiddler
Fixes #327
2014-02-22 16:13:16 +00:00
Xavier Cazin
6bff3e3163 Corrections on fr-FR translation per Julie Strzelecki remarks. 2014-02-22 17:10:14 +01:00
Jermolene
ec606c89d2 Docs updates 2014-02-22 13:31:24 +00:00
Jermolene
9e0f1240c5 Change SiteTitle/SiteSubtitle into $:/SiteTitle and $:/SiteSubtitle
To make things more consistent
2014-02-22 11:39:18 +00:00
Jermolene
199fdb090d Convert @giffmex themes into colour palettes
Although there are some style changes in the existing themes they’re
mostly a matter of a changed palette.

@giffmex - I’ll send you a prerelease of 5.0.8 so that you can tweak
the palettes if you’ve got time.
2014-02-22 11:00:51 +00:00
Jermolene
d6a44b67a3 Fix control panel modules tab 2014-02-22 08:57:39 +00:00
Jeremy Ruston
2e7efe2dc0 Merge pull request #428 from xcazin/fr-FR
Change suffix tids to multids for 2 fr-translated multi tiddler files
2014-02-22 08:54:10 +00:00
Jermolene
639fd4be20 Docs updates 2014-02-22 08:53:58 +00:00
Jermolene
75ff9fb6c0 Allow the end of text to be treated as a linebreak for parsing HTML tags 2014-02-22 08:43:03 +00:00
Xavier Cazin
57c956716e Overlooked formatting consequences for 2 translation decisions 2014-02-21 23:02:17 +01:00
Xavier Cazin
cfa6f0a8a6 Change suffix of two MultiTiddlerFiles from tids to multids 2014-02-21 22:34:07 +01:00
Jermolene
0961b0426b Use import report tiddler only if more than one tiddler is imported
If there’s only one, just display the tiddler itself.
2014-02-21 20:17:34 +00:00
Jeremy Ruston
cf5fa875aa Merge pull request #426 from xcazin/fr-FR
Translation of recently added translateable strings.
2014-02-21 18:31:23 +00:00
Xavier Cazin
a812c6e386 Translation of recently added translateable strings. 2014-02-21 19:26:49 +01:00
Jermolene
dfbb6e1fba Ensure that $:/isEncrypted is reset if modified 2014-02-21 18:21:10 +00:00
Jermolene
31975e0042 Update importing so we don't open every imported tiddler
Instead we just display a report with links to each imported tiddler.
Should make importing much faster.
2014-02-21 18:21:10 +00:00
Jeremy Ruston
38ef4fa609 Merge pull request #425 from BramChen/master
Add "Misc.multids" to chinese language packs
2014-02-21 16:13:52 +00:00
Jermolene
7f66df78ff Cleaning up from mangled merge of @xcazin's fr-FR translation 2014-02-21 16:13:10 +00:00
Jermolene
96dc489ba8 Merge branch 'fr-FR' of https://github.com/xcazin/TiddlyWiki5 into xcazin-fr-FR
Conflicts:
	languages/fr-FR/ControlPanel.tids
	licenses/cla-individual.md
2014-02-21 16:05:11 +00:00
Bram Chen
34a7fc6084 Merge remote-tracking branch 'upstream/master' 2014-02-22 00:01:41 +08:00
Bram Chen
41575b8012 Add Misc.multids to chinese language packs and more words and phrases are improved 2014-02-22 00:01:06 +08:00
Jermolene
cb5b95add2 Extend fakedom to support .value property
So that 88ffb2ad12 will work on the server
2014-02-21 15:43:25 +00:00
Bram Chen
372553d9da Merge remote-tracking branch 'upstream/master' 2014-02-21 23:01:59 +08:00
Bram Chen
747ec243ff Merge remote-tracking branch 'upstream/master' 2014-02-21 22:41:08 +08:00
Jeremy Ruston
1bc2700137 Merge pull request #424 from BramChen/master
Improve more Simplified Chinese words and phrases used in chinese langua...
2014-02-21 14:38:38 +00:00
Jermolene
4ee277f41b Fix some missing translateables 2014-02-21 14:27:49 +00:00
Bram Chen
894588db54 Improve more Simplified Chinese words and phrases used in chinese language pack. 2014-02-21 22:12:41 +08:00
Jermolene
68bcbff753 Rough and ready control over bitmap editor line width and colour
Fixes #414
2014-02-21 14:06:04 +00:00
Jeremy Ruston
d4baf515ed Merge pull request #423 from Skeeve/patch-3
Update navigator.js
2014-02-21 09:40:16 +00:00
Skeeve
d5c31ed07f Update navigator.js
As described here: https://groups.google.com/d/msg/tiddlywikidev/AWvXz7RMIC4/gFF5crN2UJoJ

Providing a name for the new tiddler message only works if a skeleton tiddler already exists. If not, "New Tiddler" is taken. This change fixes that in that the provided name is taken even if there is no skeleton.
2014-02-21 10:37:20 +01:00
Jermolene
9b6c59e9a6 Allow .multids files to contain blank lines and ": " sequences
Also added a warning for multiple definitions of the same tiddler in a
multids file.

Fixes #415
2014-02-21 09:24:36 +00:00
Jermolene
ec0769d7ca Fix typo
Fixes #417, thanks @pmario
2014-02-21 09:11:27 +00:00
Xavier Cazin
93f5e736e7 Update cla-individual.md 2014-02-21 10:07:56 +01:00
Jermolene
c4058c4662 Another block mode vs inline mode fix 2014-02-21 09:07:46 +00:00
Jermolene
f59b84e63b Add DanieloRodriguez's BrainTest to Community tiddler
And remove Bram’s translation, because it will be built into 5.0.8
2014-02-20 22:47:40 +00:00
Jermolene
c17844b815 Another fix for the block vs inline handline 2014-02-20 22:43:04 +00:00
Jermolene
c761bbe2ed Restore stub French translation 2014-02-20 22:27:43 +00:00
Jermolene
279f32080d Start to make the core templates more readable
Yay for line breaks.
2014-02-20 22:22:45 +00:00
Jermolene
06a0d21734 Use double linebreaks to indicate content of a widget or html element should be parsed in block mode
Fixes #82.

The old behaviour was to parse the content of a widget or html element
in block mode if the opening tag was followed by a line break. The new
behaviour requires two line breaks.

This makes it possible to include linebreaks more liberally within
wikitext, although care must still be taken to only use double line
breaks when the block mode behaviour is desired.

The code change here is very simple, just a single line change in
html.js. Most of the other changes are to convert various single line
breaks into double line breaks.
2014-02-20 21:42:31 +00:00
Xavier Cazin
d8513b23c2 Removed .gitignore by mistake 2014-02-20 22:00:11 +01:00
Xavier Cazin
49b4e86091 Two last minute corrections that deserve being integrated. 2014-02-20 21:55:54 +01:00
Xavier Cazin
f522a96064 Last tweaks before pull request 2014-02-20 21:13:46 +01:00
Jermolene
8f9d88f25b Fix static stylesheets 2014-02-20 19:28:17 +00:00
Jermolene
e88f8ad4e9 Fix typo with <<color>> macro 2014-02-20 19:12:05 +00:00
Jermolene
0480bf023d Fix static CSS generation 2014-02-20 18:33:01 +00:00
Jermolene
e3c1906eaf Make the show/hide editor button be translateable
Missed by accident from earlier commit
2014-02-20 17:53:23 +00:00
Jeremy Ruston
45f29f6425 Merge pull request #421 from BramChen/master
Add palette editor translation for zh-Hant and zh-Hans
2014-02-20 17:35:43 +00:00
Jermolene
f4c7a269bd Allow "<<color>>" as a synonym for the "<<colour>>" macro
Entente cordiale!
2014-02-20 17:14:27 +00:00
Bram Chen
46b2c9e24c Merge remote-tracking branch 'upstream/master' 2014-02-21 00:44:34 +08:00
Bram Chen
f46864fff5 Add palette editor translation for zh-Hant and zh-Hans 2014-02-21 00:41:45 +08:00
Jermolene
5bc408fa75 Remove the old placeholder translations for French and US English 2014-02-20 16:20:14 +00:00
Jermolene
921ff6ae39 Make palette editor translateable 2014-02-20 16:07:03 +00:00
Jermolene
b9e72fb676 Move starlight themes macros into the core 2014-02-20 15:59:44 +00:00
Jermolene
1258c16e2b Add Simplified Chinese to tw5.com
We’ll have to stop adding every available translation to tiddlywiki.com.
2014-02-20 15:55:31 +00:00
Jeremy Ruston
35eb3aee35 Merge pull request #420 from BramChen/master
Add initial translation for Simplified Chinese (zh-Hans).
2014-02-20 15:14:26 +00:00
Bram Chen
12016bd0f8 Add initial translation for Simplified Chinese (zh-Hans). 2014-02-20 23:03:06 +08:00
Xavier Cazin
3817ba642d Consistency tweaks 2014-02-20 15:00:01 +01:00
Jeremy Ruston
d6ef67e817 Merge pull request #419 from BramChen/master
remove extraneous files in editions/zh-Hant
2014-02-20 13:10:54 +00:00
Bram Chen
a51a5e969f remove extraneous files in editions/zh-Hant 2014-02-20 21:03:26 +08:00
Jeremy Ruston
ae9d0f8288 Merge pull request #418 from BramChen/master
Add initial translation for Traditional Chinese (zh-Hant).
2014-02-20 12:22:30 +00:00
Bram Chen
b26b620548 Add initial translation for Traditional Chinese (zh-Hant). 2014-02-20 20:14:27 +08:00
Jermolene
d21fb85d94 Change .tids file extension to .multids
Hopefully less confusing
2014-02-20 10:27:02 +00:00
Jermolene
bcd86d5861 Add palette editor 2014-02-20 10:00:38 +00:00
Jermolene
5417b8c4d7 Add 'indexes' filter operator
Returns the indexes within a data tiddler.

We’re about to use this to enumerate the colours within a palette.
2014-02-20 10:00:13 +00:00
Jermolene
2744671211 Fix generateTitle to avoid clashing with shadow tiddlers 2014-02-20 09:58:01 +00:00
Jermolene
88ffb2ad12 Fix problem that was causing Chrome to display black in colour picker swatches
Hurrah!
2014-02-20 09:57:44 +00:00
Xavier Cazin
aa27305134 Very first pass. Certainly needs consistency checks 2014-02-20 00:29:02 +01:00
Jermolene
a186b6f978 Remove duplicate definition 2014-02-19 21:22:36 +00:00
Jeremy Ruston
e55e7ab31b Merge pull request #416 from pmario/de-DE
Add initial translation for de-AT and de-DE.
2014-02-18 21:09:33 +00:00
Jermolene
e1dfb621f5 Add colour swatches to palette switcher 2014-02-18 13:59:11 +00:00
Mario Pietsch
bd552aedde Add initial translation for de-AT and de-DE. de-AT depends on de-DE and doesn't contain any tiddlers atm. Added de-CH plugin info with no content atm. Added a de-AT-DE edition, that will contain german how-to's in the future. 2014-02-18 00:06:02 +01:00
Jermolene
3f89d2d0fa Documentation for translators
I’d appreciate help with putting together more complete and foolproof
instructions.
2014-02-17 22:46:30 +00:00
Jermolene
c999d82a23 Palette and theme tweaks 2014-02-17 22:45:46 +00:00
Jermolene
118b841aa2 More palette tweaks and polish 2014-02-17 17:30:02 +00:00
Jermolene
ca1daf5a4e First pass at switchable colour palettes
Fixes #410

Still some cleaning up to do, and we need a way for incomplete palettes
to inherit from a base palette.
2014-02-17 12:09:10 +00:00
Jermolene
5e9dae8fb4 Fix view widget so that it works with indexes 2014-02-17 11:28:48 +00:00
Jermolene
d00a82e9e9 Put language files in alphabetical order 2014-02-17 08:58:53 +00:00
Jermolene
3307604130 Make type information translateable 2014-02-16 19:58:53 +00:00
Jermolene
1ff8d225d9 Rejig the control panel to use nested tabs for Appearance and Advanced 2014-02-16 19:33:18 +00:00
Jermolene
489509c810 Add missing field descriptions 2014-02-16 19:11:11 +00:00
Jermolene
aa6e02ce8e Fix typo 2014-02-16 19:10:55 +00:00
Jermolene
df8ff9eb26 Make the control panel "internal" tab translatable 2014-02-16 19:02:24 +00:00
Jermolene
e051eb7d90 Making more things translateable
Now we’re done with the text that lives in tiddlers, and we’ll need to
get on with the text that is embedded in code modules.
2014-02-16 09:46:43 +00:00
Jermolene
75b9de222e Add a demo of alerts and tweak styles 2014-02-15 17:36:49 +00:00
Jermolene
5a45fffa9e Get the remaining core control panel tabs prepared for translation
We’ll do ThemeTweaks separately as it’s part of the Vanilla theme
2014-02-15 13:29:24 +00:00
Jermolene
5252328dd9 Add note about joining Google Groups without a Google account 2014-02-15 13:11:10 +00:00
Jermolene
a763610db1 Get rid of the separate language prompt tiddler
More consistent to stick with .tids files
2014-02-15 11:36:00 +00:00
Jermolene
c43cd325ca Reduce the inconsistent use of "language" vs. "lingo"
Now we’re just using the word “lingo” for the macro defined in
PageTemplate (where the abbreviation is useful), and using the full
word “language” everywhere else.

It’s possible that we should be using “locale” instead of “language”,
what do you think?
2014-02-15 11:32:11 +00:00
Jermolene
e9ba7f3d70 Add example of creating substories 2014-02-14 22:22:41 +00:00
Jermolene
68809f9333 Add a bit of the old TWC text talking about the "tiddler" name 2014-02-14 22:22:31 +00:00
Jermolene
42b8b86e52 Tidy up docs 2014-02-14 22:22:11 +00:00
Jermolene
69c0b5e031 Fix problem with pasting items into the browser 2014-02-14 20:00:23 +00:00
Jermolene
30997f3f24 Docs update 2014-02-14 19:28:44 +00:00
Jermolene
bea8730a47 Fix problem with tiddlers of the type text/css
Fixes #395
2014-02-14 19:25:38 +00:00
Jermolene
c3254bc981 Add hint for typing triple backticks on some keyboards 2014-02-14 19:09:49 +00:00
Jermolene
e43a190dab Docs updates 2014-02-14 12:40:37 +00:00
Jermolene
4836cf83e2 Enhance alerting to coalesce repeated alerts with the same text 2014-02-14 10:29:26 +00:00
Jermolene
44678b2ea2 Better not to use relative dates for alerts
Relative dates don’t autorefresh at the moment.
2014-02-14 10:00:02 +00:00
Jermolene
70a120d4a6 Expand the logging mechanism to support alerts overlaid on the main screen
Now we get decent visual indication of sync errors, for instance. Still
work to do to coalesce alerts so that the screen doesn’t fill up with
them after an interval. And probably we should add a button to clear
all alerts.
2014-02-14 07:53:41 +00:00
Jermolene
28212f08b2 Darker text for the "close all" text on the "open" sidebar tab 2014-02-13 19:25:25 +00:00
Jermolene
9bb600299f Extend the navigator widget to maintain the "current-tiddler" field on the history list 2014-02-13 17:59:51 +00:00
Jermolene
9db887748b Extend setTiddlerData() to set arbitrary fields 2014-02-13 17:59:33 +00:00
Jermolene
800bc639f9 Fix problem with the reveal widget not refreshing properly when used with text references
The check for changed tiddlers was failing because `this.stateTitle`
contains the entire text reference, not just the tiddler title.
2014-02-13 17:59:10 +00:00
Jermolene
dc8e84fcb7 Credit for @Tikkoneus's grammar docs 2014-02-13 15:47:05 +00:00
Jermolene
ad4e7ccb17 Add experimental support for building plugins in the browser
It’s a bit rough and ready, but works.
2014-02-13 14:23:27 +00:00
Jermolene
4654f6b971 Fix default tab in the "more" sidebar tab 2014-02-13 14:06:20 +00:00
Jermolene
6f23aeabb4 Add config tiddler for host string 2014-02-12 22:20:28 +00:00
Jermolene
21eae0135d Fix typos 2014-02-12 22:20:20 +00:00
Jermolene
470beabf17 Enhance links so that control/command clicking suppresses navigation
Control- or Command-clicking on a link will now open the target tiddler
but suppress navigating to it. Kind of like opening in a background tab.
2014-02-12 22:00:12 +00:00
Jeremy Ruston
523eae83ff Merge pull request #407 from Skeeve/regexp_filter
fixed an awful typo in the regexp
2014-02-12 21:38:54 +00:00
Jermolene
ca0c352278 Extend the transclude widget to fallback to displaying it's child nodes if the target isn't defined 2014-02-12 21:38:37 +00:00
Stephan Hradek
0dc8de9dd2 fixed an awful typo in the regexp
The regexp fails when backslashes are used in the search-regexp. The closing bracket was at the wrong position.
2014-02-12 22:34:13 +01:00
Jermolene
b5225f5ca8 Remove obsolete VideoWidget docs 2014-02-12 20:04:29 +00:00
Jermolene
1a8d6811b7 Add new edition for Tank, along with a build script 2014-02-12 18:29:32 +00:00
Jermolene
d56eec40c9 Update title for the TiddlyWeb edition 2014-02-12 18:29:10 +00:00
Jermolene
b72d7f1447 Remove extraneous tiddler from tw5tiddlyweb edition 2014-02-12 18:29:02 +00:00
Jermolene
ecad2bf7a8 Add better control over whether tiddlers are transcluded in block or inline mode 2014-02-12 17:59:28 +00:00
Jermolene
f67e216b3a Merge branch 'reduce-wikilinks' of https://github.com/pmario/TiddlyWiki5 into pmario-reduce-wikilinks 2014-02-12 16:32:28 +00:00
Jermolene
8b3bfa6805 Allow [title[Blah]] to match missing tiddlers
Fixes #404
2014-02-12 16:01:20 +00:00
Jermolene
01fa82fac1 Move the modal background blur effect from Snow White to Vanilla
It’s a slow effect, and so it should be possible to suppress it by
returning to the barebones Vanilla theme.
2014-02-12 15:33:21 +00:00
Jermolene
d5b526914b Simplify the regular expression for HTML comments
We were getting catastrophic backtracking in Chrome for some input
texts where the closing “—>” of the comment was omitted.
2014-02-12 15:24:03 +00:00
Jermolene
5c66bc6dbc Update the reveal widget to allow control over content retention
Thus bringing back the animation of the opening and closing of the info
panel.
2014-02-12 08:32:19 +00:00
Mario Pietsch
1eab3ecbb2 remove temporary files 2014-02-11 21:09:22 +01:00
Mario Pietsch
280bbde329 remove redundant wiki links in tiddlers 2014-02-11 21:02:23 +01:00
Jermolene
dd451800c7 Specify encoding for incoming requests
Fixes #397
2014-02-11 19:42:45 +00:00
Jermolene
190ced7cdd Sync from server even when not logged in 2014-02-11 19:10:40 +00:00
Jermolene
7a62a86baf Docs updates 2014-02-11 19:10:17 +00:00
Jermolene
1086c51019 Fixed problem with field mauling when reading skinny tiddlers
The problem was showing up as tiddlers with the field “fields” and the
value “[Object object]”.
2014-02-11 15:47:56 +00:00
Jermolene
daa79a8612 Move the en-GB language plugin into the core
We need to have the default language baked into the core so that we
don’t have problems if no language plugins are available.
2014-02-11 13:20:17 +00:00
Jermolene
441d9078fa Coding style tweaks for #399 2014-02-10 17:34:10 +00:00
Jeremy Ruston
f0ab607ea1 Merge pull request #399 from shendaras/patch-1
getRelativeDate: support for negative deltas
2014-02-10 17:33:08 +00:00
Jeremy Ruston
afaf5b23c9 Merge pull request #400 from shendaras/patch-2
Sign individual CLA.
2014-02-10 17:22:42 +00:00
Jermolene
f68d48fcd3 Docs on searching 2014-02-10 16:22:02 +00:00
Jermolene
10891081ca Added formal grammar documentation for tiddler filters 2014-02-10 15:52:49 +00:00
Jermolene
ecba4f71ea Clean up the highlight plugin
Fixing various issues that were preventing language specifiers from
working.
2014-02-10 13:51:38 +00:00
Jermolene
e003889171 Start translating the control panel 2014-02-09 20:34:58 +00:00
Jermolene
1f41daf433 Add support for multi-tiddler files with a .tids extension 2014-02-09 20:34:42 +00:00
Jermolene
a2cbc2deb5 Rejig the tabs macro to wikify captions
This will allow us to translate tab captions
2014-02-09 19:19:40 +00:00
Jermolene
dea08ed4f8 First pass at language plugins for internationalisation
Still quite a few details to work out, but this shows the basic idea of
re-using the theme mechanism to handle language plugins.

Comments and questions welcome.
2014-02-09 19:18:46 +00:00
Jermolene
d1bc053a9c Update control panel text 2014-02-08 17:30:02 +00:00
Jermolene
73c30716dc Unlinkify the current theme name
Having it link to the underlying plugin tiddler isn’t very useful
2014-02-08 17:29:42 +00:00
Jermolene
8ad34e2db9 Refactor the theme switcher to be a generic plugin switcher 2014-02-08 09:29:37 +00:00
Jermolene
b26a32b93a Remove obsolete stylesheet helper 2014-02-08 09:29:11 +00:00
Daniel Barrett
f54122b90e Sign individual CLA. 2014-02-07 08:18:44 -06:00
Jermolene
828fc9dcd0 Autosave when deleting a tiddler 2014-02-07 10:14:10 +00:00
Jermolene
f0d512edf0 Remove extraneous autosave attribute from navigator widget
Inadvertently committed.
2014-02-07 10:12:45 +00:00
Jermolene
2758e586bd Add a "filter" tab to advanced search 2014-02-07 10:07:57 +00:00
Jermolene
68bcfe1c8c Docs updates 2014-02-06 22:21:03 +00:00
Jermolene
dbd63e6fe7 Move some system tiddlers into the right name space
The tiddlers temporarily used for adding new fields and tags should be
in the $:/temp namespace so that they don’t dirty the store
2014-02-06 22:20:58 +00:00
Jermolene
a01bbd4b9c Add automatic saving and warning on exit with unsaved changes
We re-use some of the existing syncer mechanism. It was already keeping
track of changes to tiddlers in the store when working with a tiddler
syncadaptor. Now it also tracks changes when there is no syncadaptor,
allowing us to provide a warning if there are unsaved changes.
2014-02-06 21:36:30 +00:00
Jermolene
8e8e31fb9f Force position:relative on tag pills
This avoids a problem with tag pills not working properly within table
cells.
2014-02-06 12:48:10 +00:00
Jermolene
6d3d3322e5 Fix problem in server with URI encoding of titles in etags
Fixes #398
2014-02-05 19:39:29 +00:00
Daniel Barrett
d02ce5dbf3 oops, actually correct delta
Actually change delta to a positive number to get the logic the same.
2014-02-05 12:37:37 -06:00
Daniel Barrett
32f290dc13 getRelativeDate: support for negative deltas
Add support for format="relativedate" to be used when the date is in the future.
2014-02-05 11:44:01 -06:00
Jermolene
1d685df928 Add support for autosave
Causes the wiki to be autosaved whenever clicking “done” after editing
a tiddler. Only works with savers that support autosave. We should
probably make autosave configurable
2014-02-04 21:21:01 +00:00
Jermolene
4882f70557 Clearer explanation of key descriptor syntax 2014-02-04 20:05:34 +00:00
Jermolene
7eafd51a7d Use placeholder text for editing missing tiddlers
Fixes #387
2014-01-30 17:39:32 +00:00
Jermolene
e6fa9b8a85 Add number of tags to control panel "Basics" tab 2014-01-30 16:51:36 +00:00
Jeremy Ruston
1a54d590e1 Merge pull request #388 from simonbaird/sameday_tz_fix
Also fix timezone related eachday test failure
2014-01-30 08:30:29 -08:00
Jermolene
d72d245523 Remove "escape" keyboard shortcut for abandon editting
Too easy to trigger accidentally, until we have confirmations.
2014-01-30 16:26:50 +00:00
Jeremy Ruston
7b054440ca Merge pull request #374 from Skeeve/patch-1
Update utils.js
2014-01-30 08:24:00 -08:00
Simon Baird
6ed8a7624d Also fix timezone related eachday test failure
In some timezones, (eg GMT+6) the modified timestamps for the
'TiddlerOne' and 'Tiddler Three' test tiddlers were actually on
the same day. This was causing the 'eachday' filter test to fail.

Similar to the fix in commit 8487221, this just adjusts the
timestamp to ensure the test passes in any timezone.
2014-01-31 00:56:25 +10:00
Jermolene
e3a05625b2 Add experimental keyboard shortcut widget
It’s not cool that we have to use a separate keyboard widget for each
keyboard shortcut.

Fixes #386
2014-01-30 13:40:36 +00:00
Jeremy Ruston
9acb10f781 Merge pull request #385 from simonbaird/sameday_tz_fix
Fix timezone related filter test failure
2014-01-30 00:45:47 -08:00
Simon Baird
8487221654 Fix timezone related sameday filter test failure
In certain timezones, 201304151312 UTC is not actually the same day
as 201304152219 any 201304151756. This was causing the test for the
'sameday' filter operator to fail. (I'm in GMT+10).

This is a quick-fix. I've just adjusted the timestamps to be close
together so they will be same day no matter what timezone you're in.
2014-01-30 18:24:05 +10:00
Simon Baird
6780a16ce9 Add Simon Baird to Contributor Licence Agreement 2014-01-30 13:13:22 +10:00
Jermolene
92aa682bc5 Update docs for 'has' filter operator 2014-01-29 21:49:48 +00:00
Jermolene
405b4a9007 Update URL for Stanford JavaScript Crypto Library 2014-01-29 21:49:38 +00:00
Jermolene
0c20092644 Refactor the image parser to avoid generating badly formed image src's
Previously, a transclusion of a skinny image tiddler (ie one where the
body has yet to be loaded) would render a broken image.
2014-01-29 19:11:05 +00:00
Skeeve
758d461823 Update utils.js
I think /\\/g is wrong as it will remove every \ from the string. I think, the usual way of keeping the following character is more appropriate.
2014-01-29 13:43:34 +01:00
Jermolene
29c4ed20ce Docs update 2014-01-29 09:05:33 +00:00
Jermolene
fa59382215 Add support for serving TW5 with lazily loaded images 2014-01-29 09:05:00 +00:00
Jermolene
02ba92c6b5 Add [is[image]] filter operator 2014-01-29 09:04:41 +00:00
Jermolene
e58d9c7008 Adjust documentation for ac163a59e8 2014-01-28 19:46:35 +00:00
Jermolene
ac163a59e8 Stop suppressing saving story list for the clientserver wiki
It’s useful to save it so that people can usefully set their
$:/DefaultTiddlers to `[list[$:/StoryList]]`
2014-01-28 19:44:10 +00:00
Jermolene
175e86078c Fix crash when wiki/themes folder contains files that are not themes
Fixes #370
2014-01-28 18:58:01 +00:00
Jermolene
3b255561b7 Add text/css to the type dropdown 2014-01-28 15:24:20 +00:00
Jermolene
59379b14fa Remove extraneous shadow tiddlers 2014-01-28 15:24:08 +00:00
Jermolene
5af30086c0 Fix substitution for nbsp
We were substituting the wrong character for non-breaking spaces
2014-01-28 15:23:58 +00:00
Jermolene
b342f6db67 Docs update 2014-01-27 17:10:07 +00:00
Jermolene
5d3dda1a17 Fix problem with highlighting only working in the DOM
The current implementation of the highlight plugin only works properly
in the browser, and doesn’t work under Node.js. It also doesn’t work
when rendering to the fakedom in the browser (as happens when rendering
stylesheets, for example).
2014-01-27 17:10:02 +00:00
Jermolene
70ed6e6ad3 Fixed problem with list filter
A bug was preventing the tiddler title from being omitted in the list
filter (ie, [list[HelloThere!!field]] worked, but [list[!!field]] did
not.
2014-01-27 16:24:28 +00:00
Jermolene
8d031afa94 Update instructions for releasing TiddlyWiki5 2014-01-27 16:23:41 +00:00
Jermolene
a42ba1a310 Update version number for next release 2014-01-27 16:23:27 +00:00
Jermolene
b4b524deae Update release date of 5.0.7 2014-01-26 21:08:13 +00:00
Jermolene
8f6ee1d2a8 Version number update for 5.0.7-beta 2014-01-26 21:04:38 +00:00
Jermolene
183e9544b4 Readme update 2014-01-26 20:59:36 +00:00
Jermolene
dfc57ffa49 More logging 2014-01-26 20:59:30 +00:00
Jermolene
3f9561dd95 Better logging 2014-01-26 18:53:31 +00:00
Jermolene
37ca86ff3d Docs updates 2014-01-26 17:49:43 +00:00
Jermolene
cf26986061 Update upgrading instructions 2014-01-26 13:54:08 +00:00
Jermolene
54822e25d4 Update static link generation 2014-01-26 13:34:53 +00:00
Jermolene
4a9108154d Readme update 2014-01-26 13:26:25 +00:00
Jermolene
8a88253b4e Remove the white background rectangle from Motovun Jack.svg 2014-01-26 13:24:39 +00:00
Jermolene
7891824883 Fix video protocol
YouTube’s default of missing out the protocol for the iframe src
unfortunately makes videos malfunction when viewing TiddlyWiki on a
file: URL
2014-01-26 13:24:27 +00:00
Jermolene
fca5681a1a Docs updates 2014-01-26 13:04:09 +00:00
Jeremy Ruston
5c9a5f5cba Merge pull request #360 from pmario/docs-cm
docs: CodeMirror config tiddler
2014-01-26 02:01:57 -08:00
Jermolene
69d342d46a Stop the reveal widget caching hidden content
Previously, when displayed content is hidden by the reveal widget there
was an optimisation such that the content was retained in the DOM but
hidden using CSS, so that it could be shown again quickly.

It turns out that a sideeffect of that optimisation is that clicking
through all the sidebar tabs leaves them all active, so that they all
need to be refreshed whenever a character is typed in an editor.

This commit suppresses the optimisation, so that hidden content is
removed from the DOM and the render tree.
2014-01-26 09:57:46 +00:00
Mario Pietsch
66254b436c fix #215 cm gutter adjust .CodeMirror-linenumber min-width, font-size. It should work up to 999 lines now. There should be a ControlPanel tab for codemirror 2014-01-25 23:33:24 +01:00
Mario Pietsch
d42981f201 docs: CodeMirror config tiddler needs to be type:application/json 2014-01-25 22:53:52 +01:00
Jeremy Ruston
04dbf99e54 Merge pull request #359 from pmario/fix-docs
some doc updates.
2014-01-25 13:26:42 -08:00
Jermolene
762940adbc No longer save system modules separately in the main HTML template
These tiddlers were being handled as `<script>` tags to make it easier
to debug them. But in fact modern dev tools are quite happy to debug
code that has been eval’d, and this arrangement was causing problems
for importing.

Fixes #335
2014-01-25 21:22:43 +00:00
Mario Pietsch
f58d4fb531 some doc updates. server default IP fix and changed Ton's entry page 2014-01-25 22:02:48 +01:00
Jermolene
45c45e098f Add a cancel button to the 'set password' dialog
Fixes #185
2014-01-25 19:55:56 +00:00
Jermolene
b5629ccc82 Update codemirror plugin docs
@pmario and @jbolila - could you kindly check whether the docs cover
everything?
2014-01-25 19:34:32 +00:00
Jermolene
bd067c6b1e Include the nodewebkitsaver in tw5.com
Just for the moment, to make it easier for people to find it.
2014-01-25 19:33:35 +00:00
Jermolene
1d10ccb368 Update release notes for 5.0.7 2014-01-25 19:33:00 +00:00
Jermolene
9297b27b89 Reference correct wiki object 2014-01-25 18:17:33 +00:00
Jermolene
0b3efe179e Extend list filter operator to take a text reference
Instead of just a title. Means that we can apply the list operator to
fields other than the list field.
2014-01-25 18:14:30 +00:00
Jermolene
e6843aabff Refactoring of new filter list operators 2014-01-25 17:44:36 +00:00
Jermolene
02d3861d7d Tests for the new filter operators 2014-01-25 17:44:14 +00:00
Jeremy Ruston
592ef257a2 Merge pull request #326 from Skeeve/listops
New list operations from @Skeeve
2014-01-25 08:51:26 -08:00
Jermolene
6ba9bf9a95 Boost the priority of the upload saver
If we’ve got an upload wiki name then we should always use the upload
saver.

See https://groups.google.com/d/topic/tiddlywiki/Jqd2jbPmYFA/discussion
2014-01-25 16:38:08 +00:00
Jermolene
18fe0c0f75 Add Jeffrey Kishner link to Community tiddler 2014-01-25 14:51:43 +00:00
Jermolene
c49681ecf3 Docs tweaks 2014-01-25 14:47:25 +00:00
Jermolene
6255b97b14 Resolve merge conflict 2014-01-25 14:41:48 +00:00
Jermolene
6cb44ac0cc Fix typo in field mangler docs
Fixes #358
2014-01-25 14:07:32 +00:00
Jermolene
b1b9c7d6cd Fix typo in codemirror editor 2014-01-25 14:07:10 +00:00
Jermolene
951147d502 Style tweaks 2014-01-24 21:45:37 +00:00
Jermolene
9539664e46 Merge branch 'codemirror_keymap' of https://github.com/jbolila/TiddlyWiki5 into jbolila-codemirror_keymap 2014-01-24 21:39:55 +00:00
Jermolene
f9b5d75446 Clarify that global macros are coming 2014-01-24 20:42:09 +00:00
Jermolene
70a7321edd Take editor configuration from configuration tiddlers
This should enable @buggyj to add an html editor by including a
configuration tiddler in the plugin.
2014-01-24 20:22:23 +00:00
Jermolene
9522050aa7 Merge @buggyj's CLA signature 2014-01-24 19:19:56 +00:00
Jermolene
8d37219545 Add some tests 2014-01-24 19:15:34 +00:00
Jermolene
a76da88380 Rename the operator portion after the colon to "suffix" 2014-01-24 19:15:27 +00:00
Jermolene
42262a637c Docs tweaks 2014-01-24 18:54:55 +00:00
Jermolene
e6a7a0db1e Style tweaks 2014-01-24 18:54:50 +00:00
Jermolene
edc71cb920 Merge branch 'regexp_filter' of https://github.com/Skeeve/TiddlyWiki5 into Skeeve-regexp_filter 2014-01-24 18:40:27 +00:00
Jermolene
bd48ecfcb1 Generate the copyright.md file in the same way we generate readme.md
Fixing #351
2014-01-24 18:35:17 +00:00
Jermolene
f4b27b33de Fixed problem with multiple tiddlers created from dragging a single file 2014-01-24 14:09:06 +00:00
Jermolene
644d88a6c5 Adjust control panel links 2014-01-24 13:43:51 +00:00
Jermolene
43eb81173d Add note about system tiddler naming conventions 2014-01-23 08:23:49 +00:00
Jermolene
a8eff78b62 Fix formatting 2014-01-23 08:22:55 +00:00
Jermolene
f90db97625 Correct year of release for 5.0.6 2014-01-23 08:22:45 +00:00
Jermolene
e339b6dffe Add documentation on sharing via Dropbox 2014-01-22 09:06:07 +00:00
Jermolene
64304f9b7f Ensure that new tiddlers created from a skeleton don't inherit created/creator fields 2014-01-21 21:00:08 +00:00
Jermolene
867dfabff8 Change initial default tiddlers to include most recently created tiddlers 2014-01-20 18:26:32 +00:00
Jermolene
b627bba277 Added link to download instructions 2014-01-20 17:48:03 +00:00
Jermolene
b9b1b001da Update Typed Blocks documentation 2014-01-20 17:14:38 +00:00
Jermolene
e9ae8d2015 Clarify upgrading instructions for encrypted wikis 2014-01-20 13:38:57 +00:00
Jermolene
2fc6451bf7 Rejigged encrypted import so that the current password isn't changed
We still try the currently stored password. If that doesn’t work then
we prompt for a password, but we no longer store the password in the
store.
2014-01-20 13:35:55 +00:00
Jermolene
f31369035b Update JavaScript Macro docs 2014-01-20 13:02:12 +00:00
Jermolene
1e54b1bcc9 Remove empty tag fields in the field mangler
This means that removing the last tag from a tiddler will remove the
tags field.
2014-01-20 11:53:26 +00:00
Jermolene
d3c421985c Add delete icon for the tiddler type editor 2014-01-20 11:21:12 +00:00
Jermolene
1c283c5586 Tighten "has" filter operator
We now require the field not to be an empty string in order to be
counted.
2014-01-20 08:59:01 +00:00
Jermolene
4f5a923ca0 Update release note 2014-01-19 21:46:01 +00:00
Jermolene
95cb99adb9 Enhance text widget to optionally use "text" attribute
This lets us use the text widget to render text in macros that we don’t
want to be wikified.
2014-01-19 21:45:55 +00:00
Jermolene
d5df78d979 Docs update 2014-01-19 20:16:29 +00:00
Jermolene
ed5cf8b044 Refactor importing of encrypted TiddlyWiki files so that it works on Node.js 2014-01-19 20:13:55 +00:00
Jermolene
98edbec46d Adjust the position of modal dialogues
The top was off the top of the window
2014-01-19 20:12:55 +00:00
Jermolene
299e9d15fb Add support for importing encrypted TiddlyWiki documents 2014-01-19 18:43:02 +00:00
Jermolene
2f4932fefc Expose the option to retain story ordering across restarts 2014-01-19 18:42:32 +00:00
Jermolene
5f1d49f2e0 Clarify the shadow GettingStarted docs 2014-01-19 18:42:20 +00:00
Jermolene
6ea9dc997f Remove extraneous full stop 2014-01-19 18:42:08 +00:00
Jermolene
c9d06ad18a Add link to French thesis notebook 2014-01-18 14:58:24 +00:00
Jermolene
3414f1ca8e Move node-webkit saver into a plugin
We don’t need it for TiddlyDesktop now that it reuses the TiddlyFox
saver. But it is still useful for embedding a TW directly into a
node-webkit app
2014-01-18 14:57:42 +00:00
Jermolene
60926198b1 Improve logic for initialising reading node tiddlers
We want fine control of whether tiddlers are read from the DOM or the
file system, without ganging it to whether we’re on node vs. browser.
2014-01-18 14:53:26 +00:00
Jermolene
2c790d982f Switch to using $tw.fakeDocument for the fakedom document object
So that we can free us `$tw.document` to be the actual DOM document
2014-01-15 14:57:35 +00:00
Jermolene
839361d54f Futher refactoring for TiddlyDesktop
We need finer control over the boot process so that we can force it to
load tiddlers from the Node.js file APIs rather than from the DOM
2014-01-15 14:51:04 +00:00
Stephan Hradek
14ca91a949 implemented the new regexp syntax 2014-01-14 22:08:05 +01:00
Stephan Hradek
81de74342d implemented the new regexp syntax 2014-01-14 22:07:20 +01:00
Stephan Hradek
0338c36610 implemented the field: syntax 2014-01-14 16:19:34 +01:00
Jermolene
c7fb0bd349 Start updating the boot kernel for more node-webkit integration
The goal is to make it possible to use the Node.js boot code under
node-webkit, so that we can directly load wiki folders
2014-01-14 14:09:04 +00:00
João Bolila
d7d5165847 all configuration and required libs in the config tiddler 2014-01-13 23:34:11 +00:00
Jeremy Ruston
aefc7b7ce2 Merge pull request #343 from csugden/patch-1
Updates "main" in package.json
2014-01-13 13:40:44 -08:00
Jeremy Ruston
1657111cb7 Merge pull request #344 from csugden/patch-2
Update cla-individual.md
2014-01-13 13:39:08 -08:00
csugden
08a8689117 Update cla-individual.md 2014-01-13 21:22:13 +00:00
csugden
b1b38dc143 Updates "main" in package.json
Fixes require "Error: Cannot find module 'tiddlywiki'"
2014-01-13 18:29:22 +00:00
Jermolene
22f48198bd Update release note 2014-01-13 17:59:22 +00:00
Jermolene
4072c4461d Switch to using a real ellipsis for advanced search 2014-01-13 17:59:14 +00:00
Jermolene
43fb16f232 Updates to the batch files
We should build highlightdemo.html on Windows
2014-01-13 17:33:33 +00:00
Jermolene
809c441ab3 Merge branch 'master' of https://github.com/jbolila/TiddlyWiki5 into jbolila-master 2014-01-13 17:28:08 +00:00
Jermolene
9985efa406 Fix link to tutsplus.com node-webkit tutorial 2014-01-13 17:02:21 +00:00
Jermolene
84e149e36c Reset the JavaScript error dialogue width
It inadvertantly got affected by the change to the password dialogue.
2014-01-13 16:17:08 +00:00
Jermolene
25423d2d07 Clarified the PHP instructions 2014-01-13 12:32:46 +00:00
Jermolene
12770ca3e6 Use an explicit default host
Thus fixing #339
2014-01-13 09:09:54 +00:00
Stephan Hradek
a5d75db8d2 Thinking about your mail led me to this new push -> Mail follows 2014-01-13 08:44:53 +01:00
Stephan Hradek
9444ef095f I feel ashamed :( Somehow this slipped me :( Sorry! 2014-01-12 23:37:11 +01:00
Jermolene
b04141fefd Don't load tiddlers that don't have a title
We were getting problems (eg, adding a `readme.md` to a plugin without
an accompanying `readme.md.meta` would end up creating a tiddler called
“undefined”)
2014-01-12 21:48:18 +00:00
João Bolila
c74bf6a655 in resp to https://github.com/Jermolene/TiddlyWiki5/pull/328#issuecomment-32131402 2014-01-12 21:48:03 +00:00
Jermolene
19080f9958 Update coding style guidelines 2014-01-12 21:28:58 +00:00
Jermolene
b5d2b79a37 Add nbsp handling to htmlDecode 2014-01-12 20:11:51 +00:00
João Bolila
17b542980f if a function 2014-01-12 20:03:34 +00:00
João Bolila
8f4e1587a2 rename from mode to keymap bindings (Vim and Emacs bindings) 2014-01-12 19:38:27 +00:00
Jermolene
4b000fac72 Added some docs about naming conventions for system tiddlers 2014-01-12 19:02:15 +00:00
João Bolila
426f2978cf fixes of a newbie, me 2014-01-12 17:09:24 +00:00
Jermolene
bad2e36e45 Remove obsolete itemClass attribute on the list widget 2014-01-12 17:01:18 +00:00
Jermolene
a4f895dc4d Introduce coding style guidelines 2014-01-12 16:56:05 +00:00
Jermolene
e254529763 More configuration controls for TiddlySpot saver
And more reliable checking of the result returned from the server
2014-01-12 12:05:15 +00:00
Jermolene
5dff212e5a Clarify comment in main template 2014-01-12 11:58:45 +00:00
Jermolene
b7a1db1e9f Display tiddler data dictionaries as plain text 2014-01-12 11:58:32 +00:00
Jermolene
6964120fce Move PHP docs 2014-01-11 21:46:33 +00:00
João Bolila
a704498155 added suport for vim and emacs keymaps (codemirror updated to 3.20) 2014-01-11 15:23:49 +00:00
Jermolene
83811bc2a9 Updated docs 2014-01-11 10:22:17 +00:00
Jermolene
bd40977c85 Fix docs error 2014-01-11 09:50:34 +00:00
Jermolene
e87097c22e Updated docs for saving to a PHP server 2014-01-11 09:39:50 +00:00
Jermolene
e74cb05540 Adjust CLA docs 2014-01-11 08:58:54 +00:00
Jermolene
b326315b0e Make the password dialogue narrower
To make it work better on mobile devices
2014-01-10 16:51:39 +00:00
Stephan Hradek
a3384d101e Extended the filter documentation 2014-01-10 13:23:26 +01:00
Stephan Hradek
8ef520ef37 Created regexp search for milestone 5.1 2014-01-10 10:32:49 +01:00
Jermolene
b64b7982af Fix notification removal to not rely on transitionEnd events 2014-01-09 22:26:21 +00:00
João Bolila
c5035fc0b0 highlight.js updated to version 8.0 (http://highlightjs.org/) 2014-01-09 14:32:31 +00:00
Jermolene
2740f8c1f0 A trivial change for testing purposes 2014-01-08 18:04:49 +00:00
Jermolene
209bc78268 Clean up whitespace 2014-01-08 16:51:42 +00:00
Jermolene
ffcc215e8f Add ellipsis for advanced search next to search box 2014-01-08 10:43:50 +00:00
Jermolene
0fb13e649b Exclude non-system tiddlers from system tiddler search 2014-01-08 09:55:06 +00:00
João Bolila
b42eefe1e8 Merge remote-tracking branch 'upstream/master' 2014-01-08 04:47:20 +00:00
João Bolila
82a48cf85c codeblock as a widget and plugin for highlight code blocks 2014-01-07 22:57:46 +00:00
Stephan Hradek
9fee9b1043 Fix for Paul's concerns 2014-01-07 21:12:59 +01:00
Jermolene
d57010d2fb Docs updates 2014-01-07 11:57:42 +00:00
Jermolene
f2409d4245 Fixed problem with positioning of the sidebar in the centralised theme 2014-01-07 11:09:56 +00:00
João Bolila
4181de5b74 sign contributor license agreement 2014-01-05 20:01:26 +00:00
Jermolene
954901d788 Start adding export options to the control panel 2014-01-05 17:24:53 +00:00
Jermolene
4688190c96 Docs update 2014-01-05 16:33:01 +00:00
João Bolila
a1d2e70307 Plugin for syntax highlighting with highlight.js from Ivan Sagalaev 2014-01-05 09:58:01 +00:00
Jermolene
e0f428b9b2 Fixed problem with Element.ELEMENT_NODE undefined on Safari 2014-01-04 15:15:12 +00:00
Jermolene
504f353844 Update docs with new video tutorials 2014-01-04 13:56:21 +00:00
Jermolene
7857464ab5 Correct another npm typo 2014-01-04 12:05:24 +00:00
Stephan Hradek
103f4f6637 added some more filters 2014-01-04 00:01:17 +01:00
Jermolene
b06e09a4d3 Fix typo in default date format string for view widget
Fixes #320
2014-01-03 18:34:27 +00:00
Jermolene
9d72570092 Update version number for next version 2014-01-03 18:33:03 +00:00
Stephan Hradek
b652238650 fixed issue #241 - created first, last, rest and reverse filter functions 2014-01-01 22:38:08 +01:00
Stephan Hradek
917865c393 fixed an initialization error 2013-12-31 11:09:17 +01:00
Stephan Hradek
ec14a0a16d vertical alignment of cells - version 2 2013-12-31 11:05:08 +01:00
Stephan Hradek
ce8cc7607f changed to conform to Jeremy's standards - sorry… 2013-12-30 13:44:32 +01:00
Stephan Hradek
eb7b82696b fixed documentation for issue #314 2013-12-30 09:51:54 +01:00
Stephan Hradek
14868d8228 also fixed issue #315 2013-12-30 00:28:43 +01:00
Stephan Hradek
3cc8138133 fixed issue #314 - fix for > at end of line 2013-12-29 23:57:42 +01:00
Stephan Hradek
8e080eac0a fixed issue #314 2013-12-29 23:51:22 +01:00
630 changed files with 13252 additions and 2011 deletions

52
bld-languages.sh Normal file
View File

@@ -0,0 +1,52 @@
#!/bin/bash
# Abbreviated version of bld.sh for quicker builds
# Set up the build output directory
if [ -z "$TW5_BUILD_OUTPUT" ]; then
TW5_BUILD_OUTPUT=../jermolene.github.com
fi
if [ ! -d "$TW5_BUILD_OUTPUT" ]; then
echo 'A valid TW5_BUILD_OUTPUT environment variable must be set'
exit 1
fi
echo "Using TW5_BUILD_OUTPUT as [$TW5_BUILD_OUTPUT]"
# Make the CNAME file that GitHub Pages requires
echo "tiddlywiki.com" > $TW5_BUILD_OUTPUT/CNAME
# The tw5.com wiki
# index.html: the main file, including content
node ./tiddlywiki.js \
./editions/de-AT-DE \
--verbose \
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/de-AT-DE.html text/plain \
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
|| exit 1
node ./tiddlywiki.js \
./editions/zh-Hant \
--verbose \
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/zh-Hant.html text/plain \
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
|| exit 1
node ./tiddlywiki.js \
./editions/zh-Hans \
--verbose \
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/zh-Hans.html text/plain \
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
|| exit 1
node ./tiddlywiki.js \
./editions/fr-FR \
--verbose \
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/fr-FR.html text/plain \
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
|| exit 1

View File

@@ -38,6 +38,7 @@ node .\tiddlywiki.js ^
--savetiddler $:/favicon.ico %TW5_BUILD_OUTPUT%\favicon.ico ^
--rendertiddler ReadMe .\readme.md text/html ^
--rendertiddler ContributingTemplate .\contributing.md text/html ^
--rendertiddler $:/core/copyright.txt .\licenses\copyright.md text/plain ^
--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 ^
@@ -89,6 +90,14 @@ node .\tiddlywiki.js ^
|| exit 1
rem highlightdemo.html: wiki to demo highlight plugin
node .\tiddlywiki.js ^
.\editions\highlightdemo ^
--verbose ^
--rendertiddler $:/core/save/all %TW5_BUILD_OUTPUT%\highlightdemo.html text/plain ^
|| exit 1
rem Make the CNAME file that GitHub Pages requires
echo tiddlywiki.com > %TW5_BUILD_OUTPUT%\CNAME

9
bld.sh
View File

@@ -39,6 +39,7 @@ node ./tiddlywiki.js \
--savetiddler $:/favicon.ico $TW5_BUILD_OUTPUT/favicon.ico \
--rendertiddler ReadMe ./readme.md text/html \
--rendertiddler ContributingTemplate ./contributing.md text/html \
--rendertiddler $:/core/copyright.txt ./licenses/copyright.md text/plain \
--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 \
@@ -89,6 +90,14 @@ node ./tiddlywiki.js \
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/markdowndemo.html text/plain \
|| exit 1
# highlightdemo.html: wiki to demo highlight plugin
node ./tiddlywiki.js \
./editions/highlightdemo \
--verbose \
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/highlightdemo.html text/plain \
|| exit 1
# Run the test edition to run the Node.js tests and to generate test.html for tests in the browser
./test.sh

View File

@@ -14,10 +14,10 @@ Error message and password prompt
z-index: 20000;
position: fixed;
text-align: center;
width: 480px;
width: 200px;
top: 4em;
left: 50%;
margin-left: -264px; /* - width/2 - paddingHorz/2 - border */
margin-left: -144px; /* - width/2 - paddingHorz/2 - border */
padding: 16px 16px 16px 16px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
@@ -29,6 +29,8 @@ Error message and password prompt
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
background-color: rgb(255, 75, 75);
border: 8px solid rgb(255, 0, 0);
width: 480px;
margin-left: -244px; /* - width/2 - paddingHorz/2 - border */
}
.tw-error-form div {
@@ -54,4 +56,9 @@ Error message and password prompt
.tw-password-wrapper h1 {
font-size: 16px;
line-height: 20px;
padding-bottom: 16px;
}
.tw-password-wrapper input {
width: 100%;
}

View File

@@ -38,7 +38,7 @@ $tw.boot = $tw.boot || {};
/////////////////////////// Standard node.js libraries
var fs, path, vm;
if(!$tw.browser) {
if($tw.node) {
fs = require("fs");
path = require("path");
vm = require("vm");
@@ -46,15 +46,6 @@ if(!$tw.browser) {
/////////////////////////// Utility functions
/*
Log a message
*/
$tw.utils.log = function(/* args */) {
if(console !== undefined && console.log !== undefined) {
return Function.apply.call(console.log, console, arguments);
}
};
/*
Check if an object has a property
*/
@@ -207,10 +198,10 @@ $tw.utils.deepDefaults = function(object /*, sourceObjectList */) {
};
/*
Convert "&amp;" to &, "&lt;" to <, "&gt;" to > and "&quot;" to "
Convert "&amp;" to &, "&nbsp;" to nbsp, "&lt;" to <, "&gt;" to > and "&quot;" to "
*/
$tw.utils.htmlDecode = function(s) {
return s.toString().replace(/&lt;/mg,"<").replace(/&gt;/mg,">").replace(/&quot;/mg,"\"").replace(/&amp;/mg,"&");
return s.toString().replace(/&lt;/mg,"<").replace(/&nbsp;/mg,"\xA0").replace(/&gt;/mg,">").replace(/&quot;/mg,"\"").replace(/&amp;/mg,"&");
};
/*
@@ -380,10 +371,11 @@ $tw.utils.checkVersions = function(versionStringA,versionStringB) {
/*
Register file type information
flags: "image" for image types
*/
$tw.utils.registerFileType = function(type,encoding,extension) {
$tw.utils.registerFileType = function(type,encoding,extension,flags) {
$tw.config.fileExtensionInfo[extension] = {type: type};
$tw.config.contentTypeInfo[type] = {encoding: encoding, extension: extension};
$tw.config.contentTypeInfo[type] = {encoding: encoding, extension: extension, flags: flags || []};
};
/*
@@ -448,11 +440,13 @@ Adds a new password prompt. Options are:
submitText: text to use for submit button (defaults to "Login")
serviceName: text of the human readable service name
noUserName: set true to disable username prompt
canCancel: set true to enable a cancel button (callback called with null)
callback: function to be called on submission with parameter of object {username:,password:}. Callback must return `true` to remove the password prompt
*/
$tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
// Create and add the prompt to the DOM
var submitText = options.submitText || "Login",
var self = this,
submitText = options.submitText || "Login",
dm = $tw.utils.domMaker,
children = [dm("h1",{text: options.serviceName})];
if(!options.noUserName) {
@@ -465,6 +459,19 @@ $tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
attributes: {type: "password", name: "password", placeholder: "Password"},
"class": "input-small"
}));
if(options.canCancel) {
children.push(dm("button",{
text: "Cancel",
"class": "btn",
eventListeners: [{
name: "click",
handlerFunction: function(event) {
self.removePrompt(promptInfo);
options.callback(null);
}
}]
}));
}
children.push(dm("button",{
attributes: {type: "submit"},
text: submitText,
@@ -492,12 +499,7 @@ $tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
// Call the callback
if(options.callback(data)) {
// Remove the prompt if the callback returned true
var i = self.passwordPrompts.indexOf(promptInfo);
if(i !== -1) {
self.passwordPrompts.splice(i,1);
promptInfo.form.parentNode.removeChild(promptInfo.form);
self.setWrapperDisplay();
}
self.removePrompt(promptInfo);
} else {
// Clear the password if the callback returned false
$tw.utils.each(form.elements,function(element) {
@@ -520,17 +522,29 @@ $tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
this.setWrapperDisplay();
};
$tw.utils.PasswordPrompt.prototype.removePrompt = function(promptInfo) {
var i = this.passwordPrompts.indexOf(promptInfo);
if(i !== -1) {
this.passwordPrompts.splice(i,1);
promptInfo.form.parentNode.removeChild(promptInfo.form);
this.setWrapperDisplay();
}
}
/*
Crypto helper object for encrypted content. It maintains the password text in a closure, and provides methods to change
the password, and to encrypt/decrypt a block of text
*/
$tw.utils.Crypto = function() {
var sjcl = $tw.browser ? window.sjcl : require("./sjcl.js"),
password = null,
callSjcl = function(method,inputText) {
currentPassword = null,
callSjcl = function(method,inputText,password) {
password = password || currentPassword;
var outputText;
try {
outputText = sjcl[method](password,inputText);
if(password) {
outputText = sjcl[method](password,inputText);
}
} catch(ex) {
console.log("Crypto error:" + ex);
outputText = null;
@@ -538,22 +552,26 @@ $tw.utils.Crypto = function() {
return outputText;
};
this.setPassword = function(newPassword) {
password = newPassword;
currentPassword = newPassword;
this.updateCryptoStateTiddler();
};
this.updateCryptoStateTiddler = function() {
if($tw.wiki && $tw.wiki.addTiddler) {
$tw.wiki.addTiddler(new $tw.Tiddler({title: "$:/isEncrypted", text: password ? "yes" : "no"}));
if($tw.wiki) {
var state = currentPassword ? "yes" : "no",
tiddler = $tw.wiki.getTiddler("$:/isEncrypted");
if(!tiddler || tiddler.fields.text !== state) {
$tw.wiki.addTiddler(new $tw.Tiddler({title: "$:/isEncrypted", text: state}));
}
}
};
this.hasPassword = function() {
return !!password;
return !!currentPassword;
}
this.encrypt = function(text) {
return callSjcl("encrypt",text);
this.encrypt = function(text,password) {
return callSjcl("encrypt",text,password);
};
this.decrypt = function(text) {
return callSjcl("decrypt",text);
this.decrypt = function(text,password) {
return callSjcl("decrypt",text,password);
};
};
@@ -779,7 +797,9 @@ $tw.Wiki.prototype.addTiddler = function(tiddler) {
if(!(tiddler instanceof $tw.Tiddler)) {
tiddler = new $tw.Tiddler(tiddler);
}
this.tiddlers[tiddler.fields.title] = tiddler;
if(tiddler.fields.title) {
this.tiddlers[tiddler.fields.title] = tiddler;
}
};
$tw.Wiki.prototype.addTiddlers = function(tiddlers) {
@@ -859,10 +879,12 @@ $tw.Wiki.prototype.unpackPluginTiddlers = function() {
// Extract the constituent tiddlers
$tw.utils.each(pluginInfo.tiddlers,function(constituentTiddler,constituentTitle) {
// Save the tiddler object
self.shadowTiddlers[constituentTitle] = {
source: tiddler.fields.title,
tiddler: new $tw.Tiddler(constituentTiddler,{title: constituentTitle})
};
if(constituentTitle) {
self.shadowTiddlers[constituentTitle] = {
source: tiddler.fields.title,
tiddler: new $tw.Tiddler(constituentTiddler,{title: constituentTitle})
};
}
});
});
};
@@ -911,7 +933,7 @@ $tw.Wiki.prototype.getTiddler = function(title) {
var t = this.tiddlers[title];
if(t instanceof $tw.Tiddler) {
return t;
} else if($tw.utils.hop(this.shadowTiddlers,title)) {
} else if(title !== undefined && $tw.utils.hop(this.shadowTiddlers,title)) {
return this.shadowTiddlers[title].tiddler;
} else {
return undefined;
@@ -974,6 +996,34 @@ $tw.modules.define("$:/boot/tiddlerdeserializer/tid","tiddlerdeserializer",{
return [fields];
}
});
$tw.modules.define("$:/boot/tiddlerdeserializer/tids","tiddlerdeserializer",{
"application/x-tiddlers": function(text,fields) {
var titles = [],
tiddlers = [],
match = /\r?\n\r?\n/mg.exec(text);
if(match) {
fields = $tw.utils.parseFields(text.substr(0,match.index),fields);
var lines = text.substr(match.index + match[0].length).split(/\r?\n/mg);
for(var t=0; t<lines.length; t++) {
var line = lines[t];
if(line.charAt(0) !== "#") {
var colonPos= line.indexOf(": ");
if(colonPos !== -1) {
var tiddler = $tw.utils.extend({},fields);
tiddler.title = (tiddler.title || "") + line.substr(0,colonPos);
if(titles.indexOf(tiddler.title) !== -1) {
console.log("Warning: .multids file contains multiple definitions for " + tiddler.title);
}
titles.push(tiddler.title);
tiddler.text = line.substr(colonPos + 2);
tiddlers.push(tiddler);
}
}
}
}
return tiddlers;
}
});
$tw.modules.define("$:/boot/tiddlerdeserializer/txt","tiddlerdeserializer",{
"text/plain": function(text,fields,type) {
fields.text = text;
@@ -1096,7 +1146,7 @@ $tw.modules.define("$:/boot/tiddlerdeserializer/dom","tiddlerdeserializer",{
}
});
$tw.loadTiddlers = function() {
$tw.loadTiddlersBrowser = function() {
// In the browser, we load tiddlers from certain elements
var containerIds = [
"libraryModules",
@@ -1131,6 +1181,12 @@ $tw.boot.decryptEncryptedTiddlers = function(callback) {
callback();
};
}
/////////////////////////// Node definitions
if($tw.node) {
/*
Load the tiddlers contained in a particular file (and optionally extract fields from the accompanying .meta file) returned as {filepath:,type:,tiddlers:[],hasMetaFile:}
*/
@@ -1226,12 +1282,14 @@ $tw.loadPluginFolder = function(filepath,excludeRegExp) {
// Save the plugin tiddlers into the plugin info
pluginInfo.tiddlers = pluginInfo.tiddlers || {};
for(t=0; t<pluginTiddlers.length; t++) {
pluginInfo.tiddlers[pluginTiddlers[t].title] = pluginTiddlers[t];
if(pluginTiddlers[t].title) {
pluginInfo.tiddlers[pluginTiddlers[t].title] = pluginTiddlers[t];
}
}
}
}
// Give the plugin the same version number as the core if it doesn't have one
if(!("version" in pluginInfo)) {
if(pluginInfo && !("version" in pluginInfo)) {
pluginInfo.version = $tw.packageInfo.version;
}
// Save the plugin tiddler
@@ -1254,20 +1312,6 @@ $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
@@ -1281,7 +1325,7 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
if(fs.existsSync(wikiInfoPath)) {
wikiInfo = JSON.parse(fs.readFileSync(wikiInfoPath,"utf8"));
} else {
wikiInfo = $tw.boot.defaultWikiInfo;
return null;
}
// Load any parent wikis
if(wikiInfo.includeWikis) {
@@ -1316,10 +1360,19 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
}
}
}
// Load any languages listed in the wiki info file
if(wikiInfo.languages) {
var languagesBasePath = path.resolve($tw.boot.corePath,$tw.config.languagesPath);
for(var t=0; t<wikiInfo.languages.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(languagesBasePath,"./" + wikiInfo.languages[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
}
// Load the wiki files, registering them as writable
var resolvedWikiPath = path.resolve(wikiPath,$tw.config.wikiTiddlersSubDir);
$tw.utils.each($tw.loadTiddlersFromPath(resolvedWikiPath),function(tiddlerFile) {
$tw.wiki.addTiddlers(tiddlerFile.tiddlers);
if(tiddlerFile.filepath) {
$tw.utils.each(tiddlerFile.tiddlers,function(tiddler) {
$tw.boot.files[tiddler.title] = {
@@ -1329,7 +1382,16 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
};
});
}
$tw.wiki.addTiddlers(tiddlerFile.tiddlers);
});
// Save the original tiddler file locations if requested
if(wikiInfo.config && wikiInfo.config["retain-original-tiddler-path"]) {
var output = [];
for(var title in $tw.boot.files) {
output.push(title + ": " + path.relative(resolvedWikiPath,$tw.boot.files[title].filepath) + "\n");
}
$tw.wiki.addTiddler({title: "$:/config/OriginalTiddlerPaths", type: "application/x-tiddler-dictionary", text: output.join("")});
}
// Save the path to the tiddlers folder for the filesystemadaptor
$tw.boot.wikiTiddlersPath = path.resolve($tw.boot.wikiPath,$tw.config.wikiTiddlersSubDir);
// Load any plugins within the wiki folder
@@ -1354,10 +1416,21 @@ $tw.loadWikiTiddlers = function(wikiPath,parentPaths) {
}
}
}
// Load any languages within the wiki folder
var wikiLanguagesPath = path.resolve(wikiPath,$tw.config.wikiLanguagesSubDir);
if(fs.existsSync(wikiLanguagesPath)) {
var languageFolders = fs.readdirSync(wikiLanguagesPath);
for(t=0; t<languageFolders.length; t++) {
pluginFields = $tw.loadPluginFolder(path.resolve(wikiLanguagesPath,"./" + languageFolders[t]));
if(pluginFields) {
$tw.wiki.addTiddler(pluginFields);
}
}
}
return wikiInfo;
};
$tw.loadTiddlers = function() {
$tw.loadTiddlersNode = function() {
// Load the boot tiddlers
$tw.utils.each($tw.loadTiddlersFromPath($tw.boot.bootPath),function(tiddlerFile) {
$tw.wiki.addTiddlers(tiddlerFile.tiddlers);
@@ -1370,12 +1443,17 @@ $tw.loadTiddlers = function() {
}
};
// End of if(!$tw.browser)
// End of if($tw.node)
}
/////////////////////////// Main startup function called once tiddlers have been decrypted
$tw.boot.startup = function() {
/*
Startup TiddlyWiki. Options are:
readBrowserTiddlers: whether to read tiddlers from the HTML file we're executing within; if not, tiddlers are read from the file system with Node.js APIs
*/
$tw.boot.startup = function(options) {
options = options || {};
// Initialise some more $tw properties
$tw.utils.deepDefaults($tw,{
modules: { // Information about each module
@@ -1385,16 +1463,19 @@ $tw.boot.startup = function() {
config: { // Configuration overridables
pluginsPath: "../plugins/",
themesPath: "../themes/",
languagesPath: "../languages/",
editionsPath: "../editions/",
wikiInfo: "./tiddlywiki.info",
wikiPluginsSubDir: "./plugins",
wikiThemesSubDir: "./themes",
wikiLanguagesSubDir: "./languages",
wikiTiddlersSubDir: "./tiddlers",
jsModuleHeaderRegExpString: "^\\/\\*\\\\(?:\\r?\\n)((?:^[^\\r\\n]*(?:\\r?\\n))+?)(^\\\\\\*\\/$(?:\\r?\\n)?)",
fileExtensionInfo: {}, // Map file extension to {type:}
contentTypeInfo: {} // Map type to {encoding:,extension:}
}
});
if(!$tw.browser) {
if(!options.readBrowserTiddlers) {
// For writable tiddler files, a hashmap of title to {filepath:,type:,hasMetaFile:}
$tw.boot.files = {};
// System paths and filenames
@@ -1403,17 +1484,14 @@ $tw.boot.startup = function() {
// If the first command line argument doesn't start with `--` then we
// interpret it as the path to the wiki folder, which will otherwise default
// to the current folder
if($tw.boot.argv[0] === "*") {
$tw.boot.wikiPath = undefined;
$tw.boot.argv = $tw.boot.argv.slice(1);
} else if($tw.boot.argv[0] && $tw.boot.argv[0].indexOf("--") !== 0) {
if($tw.boot.argv[0] && $tw.boot.argv[0].indexOf("--") !== 0) {
$tw.boot.wikiPath = $tw.boot.argv[0];
$tw.boot.argv = $tw.boot.argv.slice(1);
} else {
$tw.boot.wikiPath = process.cwd();
}
// Read package info
$tw.packageInfo = require("../package");
$tw.packageInfo = require("../package.json");
// Check node version number
if($tw.utils.checkVersions($tw.packageInfo.engines.node.substr(2),process.version.substr(1))) {
$tw.utils.error("TiddlyWiki5 requires node.js version " + $tw.packageInfo.engines.node);
@@ -1422,6 +1500,7 @@ $tw.boot.startup = function() {
// Add file extension information
$tw.utils.registerFileType("text/vnd.tiddlywiki","utf8",".tid");
$tw.utils.registerFileType("application/x-tiddler","utf8",".tid");
$tw.utils.registerFileType("application/x-tiddlers","utf8",".multids");
$tw.utils.registerFileType("application/x-tiddler-html-div","utf8",".tiddler");
$tw.utils.registerFileType("text/vnd.tiddlywiki2-recipe","utf8",".recipe");
$tw.utils.registerFileType("text/plain","utf8",".txt");
@@ -1429,12 +1508,12 @@ $tw.boot.startup = function() {
$tw.utils.registerFileType("text/html","utf8",".html");
$tw.utils.registerFileType("application/javascript","utf8",".js");
$tw.utils.registerFileType("application/json","utf8",".json");
$tw.utils.registerFileType("application/pdf","base64",".pdf");
$tw.utils.registerFileType("image/jpeg","base64",".jpg");
$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/pdf","base64",".pdf",["image"]);
$tw.utils.registerFileType("image/jpeg","base64",".jpg",["image"]);
$tw.utils.registerFileType("image/png","base64",".png",["image"]);
$tw.utils.registerFileType("image/gif","base64",".gif",["image"]);
$tw.utils.registerFileType("image/svg+xml","utf8",".svg",["image"]);
$tw.utils.registerFileType("image/x-icon","base64",".ico",["image"]);
$tw.utils.registerFileType("application/font-woff","base64",".woff");
// Create the wiki store for the app
$tw.wiki = new $tw.Wiki();
@@ -1444,7 +1523,11 @@ $tw.boot.startup = function() {
$tw.Wiki.tiddlerDeserializerModules = {};
$tw.modules.applyMethods("tiddlerdeserializer",$tw.Wiki.tiddlerDeserializerModules);
// Load tiddlers
$tw.loadTiddlers();
if(options.readBrowserTiddlers) {
$tw.loadTiddlersBrowser();
} else {
$tw.loadTiddlersNode();
}
// Unpack plugin tiddlers
$tw.wiki.registerPluginTiddlers("plugin");
$tw.wiki.unpackPluginTiddlers();
@@ -1453,7 +1536,9 @@ $tw.boot.startup = function() {
// And any modules within plugins
$tw.wiki.defineShadowModules();
// Make sure the crypto state tiddler is up to date
$tw.crypto.updateCryptoStateTiddler();
if($tw.crypto) {
$tw.crypto.updateCryptoStateTiddler();
}
// Run any startup modules
$tw.modules.forEachModuleOfType("startup",function(title,module) {
if(module.startup) {
@@ -1474,13 +1559,15 @@ $tw.boot.boot = function() {
// Preload any encrypted tiddlers
$tw.boot.decryptEncryptedTiddlers(function() {
// Startup
$tw.boot.startup();
$tw.boot.startup({
readBrowserTiddlers: !!$tw.browser
});
});
};
/////////////////////////// Autoboot in the browser
if($tw.browser) {
if($tw.browser && !$tw.boot.suppressBoot) {
$tw.boot.boot();
}
@@ -1493,6 +1580,3 @@ if(typeof(exports) !== "undefined") {
} else {
_boot(window.$tw);
}

View File

@@ -16,7 +16,12 @@ var _bootprefix = (function($tw) {
"use strict";
$tw = $tw || {browser: typeof(window) !== "undefined" ? {} : null};
$tw = $tw || {};
// Detect platforms
$tw.browser = typeof(window) !== "undefined" ? {} : null;
$tw.node = typeof(process) === "object" ? {} : null;
$tw.nodeWebKit = $tw.node && global.window && global.window.nwDispatcher ? {} : null;
/*
Information about each module is kept in an object with these members:
@@ -92,6 +97,3 @@ if(typeof(exports) === "undefined") {
// Export functionality as a module
exports.bootprefix = _bootprefix;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
title: $:/config/EditorTypeMappings/image/gif
bitmap

View File

@@ -0,0 +1,3 @@
title: $:/config/EditorTypeMappings/image/jpeg
bitmap

View File

@@ -0,0 +1,3 @@
title: $:/config/EditorTypeMappings/image/jpg
bitmap

View File

@@ -0,0 +1,3 @@
title: $:/config/EditorTypeMappings/image/png
bitmap

View File

@@ -0,0 +1,3 @@
title: $:/config/EditorTypeMappings/image/x-icon
bitmap

View File

@@ -0,0 +1,3 @@
title: $:/config/EditorTypeMappings/text/vnd.tiddlywiki
text

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/bag
The name of the bag from which a tiddler came

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/color
The CSS color value associated with a tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/created
The date a tiddler was created

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/creator
The name of the person who created a tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/description
The descriptive text for a wizard

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/draft.of
For draft tiddlers, contains the title of the tiddler of which this is a draft

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/draft.title
For draft tiddlers, contains the proposed new title of the tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/footer
The footer text for a wizard

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/icon
The title of the tiddler containing the icon associated with a tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/library
If set to "yes" indicates that a tiddler should be saved as a JavaScript library

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/list
An ordered list of tiddler titles associated with a tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/modified
The date and time at which a tiddler was last modified

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/modifier
The tiddler title associated with the person who last modified a tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/name
The human readable name associated with a plugin tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/plugin-priority
A numerical value indicating the priority of a plugin tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/plugin-type
The type of plugin in a plugin tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/revision
The revision of the tiddler held at the server

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/source
The source URL associated with a tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/subtitle
The subtitle text for a wizard

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/tags
A list of tags associated with a tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/text
The body text of a tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/title
The unique name of a tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/fields/type
The content type of a tiddler

View File

@@ -1,3 +0,0 @@
title: $:/docs/moduletypes/animation
Animation modules contain animations that may be used with the RevealWidget.

View File

@@ -1,3 +0,0 @@
title: $:/docs/types/application/json
description: JSON data
name: application/json

View File

@@ -1,3 +0,0 @@
title: $:/docs/types/image/gif
description: GIF image
name: image/gif

View File

@@ -1,3 +0,0 @@
title: $:/docs/types/image/png
description: PNG image
name: image/png

7
core/language/en-GB.tid Normal file
View File

@@ -0,0 +1,7 @@
title: $:/languages/en-GB
name: en-GB
description: English (British)
author: JeremyRuston
core-version: >=5.0.0"
Stub pseudo-plugin for the default language

View File

@@ -0,0 +1,72 @@
title: $:/language/ControlPanel/
Advanced/Caption: Advanced
Advanced/Hint: Internal information about this TiddlyWiki
Advanced/LoadedModules/Caption: Loaded Modules
Advanced/LoadedModules/Hint: These are the currently loaded tiddler modules linked to their source tiddlers. Any italicised modules lack a source tiddler, typically because they were setup during the boot process.
Advanced/TiddlerFields/Caption: Tiddler Fields
Advanced/TiddlerFields/Hint: This is the full set of TiddlerFields in use in this wiki (including system tiddlers but excluding shadow tiddlers).
Appearance/Caption: Appearance
Appearance/Hint: Ways to customise the appearance of your TiddlyWiki.
Appearance/Palette/Caption: Palette
Appearance/Palette/Editor/Clone/Caption: clone
Appearance/Palette/Editor/Clone/Prompt: It is recommended that you clone this shadow palette before editing it
Appearance/Palette/Editor/Prompt/Modified: This shadow palette has been modified
Appearance/Palette/Editor/Prompt: Editing
Appearance/Palette/Editor/Reset/Caption: reset
Appearance/Palette/ShowEditor/Caption: show editor
Appearance/Palette/HideEditor/Caption: hide editor
Appearance/Palette/Prompt: Current palette:
Appearance/StoryView/Caption: Story View
Appearance/StoryView/Prompt: Current view:
Appearance/Theme/Caption: Theme
Appearance/Theme/Prompt: Current theme:
Basics/AnimDuration/Prompt: Animation duration:
Basics/Caption: Basics
Basics/DefaultTiddlers/BottomHint: Use &#91;&#91;double square brackets&#93;&#93; for titles with spaces. Or you can choose to <$button set="$:/DefaultTiddlers" setTo="[list[$:/StoryList]]">retain story ordering</$button>
Basics/DefaultTiddlers/Prompt: Default tiddlers:
Basics/DefaultTiddlers/TopHint: Choose which tiddlers are displayed at startup:
Basics/Language/Prompt: Hello! Current language:
Basics/OverriddenShadowTiddlers/Prompt: Number of overridden shadow tiddlers:
Basics/ShadowTiddlers/Prompt: Number of shadow tiddlers:
Basics/Subtitle/Prompt: Subtitle:
Basics/SystemTiddlers/Prompt: Number of system tiddlers:
Basics/Tags/Prompt: Number of tags:
Basics/Tiddlers/Prompt: Number of tiddlers:
Basics/Title/Prompt: Title of this ~TiddlyWiki:
Basics/Username/Prompt: Username for signing edits:
Basics/Version/Prompt: ~TiddlyWiki version:
Plugins/Caption: Plugins
Plugins/Fields/Description: Description
Plugins/Fields/Title: Title
Plugins/Fields/Version: Version
Saving/AutoSave/Disabled/Button: enable
Saving/AutoSave/Disabled/Prompt: Autosave is currently disabled
Saving/AutoSave/Enabled/Button: disable
Saving/AutoSave/Enabled/Prompt: Autosave is currently enabled
Saving/AutoSave: Autosave
Saving/Caption: Saving
Saving/Heading: Saving
Saving/TiddlySpot/Advanced/Heading: Advanced Settings
Saving/TiddlySpot/BackupDir: Backup Directory
Saving/TiddlySpot/Backups: Backups
Saving/TiddlySpot/Filename: Upload Filename
Saving/TiddlySpot/Heading: ~TiddlySpot
Saving/TiddlySpot/Hint: //The server URL defaults to `http://<wikiname>.tiddlyspot.com/store.cgi` and can be changed to use a custom server address//
Saving/TiddlySpot/Password: Password
Saving/TiddlySpot/ServerURL: Server URL
Saving/TiddlySpot/UploadDir: Upload Directory
Saving/TiddlySpot/UserName: Wiki Name
Tools/Caption: Tools
Tools/Download/Full/Caption: Download full wiki
Tools/Encryption/ChangePassword/Button: change password
Tools/Encryption/ClearPassword/Button: clear password
Tools/Encryption/Disabled/Prompt: This wiki is not encrypted
Tools/Encryption/Enabled/Prompt: This wiki is encrypted
Tools/Encryption/Heading: Encryption
Tools/Encryption/SetPassword/Button: set password
Tools/Export/AllAsStaticHTML/Caption: Download all tiddlers as static HTML
Tools/Export/Heading: Export
Tools/Import/Heading: Import
Tools/Import/Hint: Browse for files on your computer to import their contents (the individual tiddlers within TiddlyWiki HTML files are imported separately). You can also drag and drop files directly to the browser window.
Tools/Import/Prompt: Import:

View File

@@ -0,0 +1,22 @@
title: $:/language/Docs/ModuleTypes/
animation: Animations that may be used with the RevealWidget.
browser-startup: Startup functions that are only executed in the browser.
command: Commands that can be executed under Node.js.
config: Data to be inserted into `$tw.config`.
filteroperator: Individual filter operator methods.
global: Global data to be inserted into `$tw`.
isfilteroperator: Operands for the ''is'' filter operator.
macro: JavaScript macro definitions.
parser: Parsers for different content types.
saver: Savers handle different methods for saving files from the browser.
startup: Startup functions.
storyview: Story views customise the animation and behaviour of list widgets.
tiddlerdeserializer: Converts different content types into tiddlers.
tiddlerfield: Defines the behaviour of an individual tiddler field.
tiddlermethod: Adds methods to the `$tw.Tiddler` prototype.
utils: Adds methods to `$tw.utils`.
utils-node: Adds Node.js-specific methods to `$tw.utils`.
widget: Widgets encapsulate DOM rendering and refreshing.
wikimethod: Adds methods to `$tw.Wiki`.
wikirule: Individual parser rules for the main WikiText parser.

View File

@@ -0,0 +1,14 @@
title: $:/language/EditTemplate/
Body/Hint: Use WikiText to add formatting, images, and dynamic features
Body/Placeholder: Type the text for this tiddler
Body/Preview/Button/Hide: hide preview
Body/Preview/Button/Show: show preview
Fields/Add/Button: add
Fields/Add/Name/Placeholder: field name
Fields/Add/Prompt: Add a new field:
Fields/Add/Value/Placeholder: field value
Tags/Add/Button: add
Tags/Add/Placeholder: tag name
Type/Placeholder: content type
Type/Prompt: Type:

View File

@@ -0,0 +1,32 @@
title: $:/language/Docs/Fields/
bag: The name of the bag from which a tiddler came
caption: The text to be displayed on a tab or button
color: The CSS color value associated with a tiddler
component: The name of the component responsible for an [[alert tiddler|AlertMechanism]]
current-tiddler: Used to cache the top tiddler in a [[history list|HistoryMechanism]]
created: The date a tiddler was created
creator: The name of the person who created a tiddler
dependents: For a plugin, lists the dependent plugin titles
description: The descriptive text for a plugin, or a modal dialogue
draft.of: For draft tiddlers, contains the title of the tiddler of which this is a draft
draft.title: For draft tiddlers, contains the proposed new title of the tiddler
footer: The footer text for a wizard
hack-to-give-us-something-to-compare-against: A temporary storage field used in [[$:/core/templates/static.content]]
icon: The title of the tiddler containing the icon associated with a tiddler
library: If set to "yes" indicates that a tiddler should be saved as a JavaScript library
list: An ordered list of tiddler titles associated with a tiddler
modified: The date and time at which a tiddler was last modified
modifier: The tiddler title associated with the person who last modified a tiddler
name: The human readable name associated with a plugin tiddler
plugin-priority: A numerical value indicating the priority of a plugin tiddler
plugin-type: The type of plugin in a plugin tiddler
revision: The revision of the tiddler held at the server
released: Date of a TiddlyWiki release
source: The source URL associated with a tiddler
subtitle: The subtitle text for a wizard
tags: A list of tags associated with a tiddler
text: The body text of a tiddler
title: The unique name of a tiddler
type: The content type of a tiddler
version: Version information for a plugin

View File

@@ -7,7 +7,7 @@ To get started, first verify that you can save changes successfully - see http:/
Then you can:
* Create new tiddlers using the 'plus' button in the sidebar
* Visit the [[control panel|$:/ControlPanel]] using the 'cog' button in the sidebar to customise your wiki
** Stop this message appearing by changing the default tiddlers under the ''Basics'' tab
* 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://tiddlywiki.com/static/WikiText.html]]

View File

@@ -0,0 +1,22 @@
title: $:/language/Help/default
\define commandTitle()
$:/language/Help/$(command)$
\end
```
usage: tiddlywiki [<wikifolder>] [--<command> [<args>...]...]
```
Available commands:
<ul>
<$list filter="[commands[]sort[title]]" variable="command">
<li><$link to=<<commandTitle>>><$macrocall $name="command" $type="text/plain" $output="text/plain"/></$link>: <$transclude tiddler=<<commandTitle>> field="description"/></li>
</$list>
</ul>
To get detailed help on a command:
```
tiddlywiki --help <command>
```

View File

@@ -0,0 +1,10 @@
title: $:/language/Help/help
description: Display help for TiddlyWiki commands
Displays help text for a command:
```
--help [<command>]
```
If the command name is omitted then a list of available commands is displayed.

View File

@@ -0,0 +1,23 @@
title: $:/language/Help/init
description: Initialise a new wiki folder
Initialise an empty [[WikiFolder|WikiFolders]] with a copy of the specified edition.
```
--init <edition> [<edition> ...]
```
For example:
```
tiddlywiki ./MyWikiFolder --init empty
```
Note:
* The wiki folder directory will be created if necessary
* The "edition" defaults to ''empty''
* The init command will fail if the wiki folder is not empty
* The init command removes any `includeWikis` definitions in the edition's `tiddlywiki.info` file
* When multiple editions are specified, editions initialised later will overwrite any files shared with earlier editions (so, the final `tiddlywiki.info` file will be copied from the last edition)
* `--help editions` returns a list of available editions

View File

@@ -0,0 +1,14 @@
title: $:/language/Help/load
description: Load tiddlers from a file
Load tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files
```
--load <filepath>
```
To load tiddlers from an encrypted TiddlyWiki file you should first specify the password with the PasswordCommand. For example:
```
tiddlywiki ./MyWiki --password pa55w0rd --load my_encrypted_wiki.html
```

View File

@@ -0,0 +1,3 @@
title: $:/language/Help/notfound
No such help item

View File

@@ -0,0 +1,9 @@
title: $:/language/Help/password
description: Set a password for subsequent crypto operations
Set a password for subsequent crypto operations
```
--password <password>
```

View File

@@ -0,0 +1,8 @@
title: $:/language/Help/rendertiddler
description: Render an individual tiddler as a specified ContentType
Render an individual tiddler as a specified ContentType, defaults to `text/html` and save it to the specified filename:
```
--rendertiddler <title> <filename> [<type>]
```

View File

@@ -0,0 +1,14 @@
title: $:/language/Help/rendertiddlers
description: Render tiddlers matching a filter to a specified ContentType
Render a set of tiddlers matching a filter to separate files of a specified ContentType (defaults to `text/html`) and extension (defaults to `.html`).
```
--rendertiddlers <filter> <template> <pathname> [<type>] [<extension>]
```
For example:
```
--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html ./static text/plain
```

View File

@@ -0,0 +1,8 @@
title: $:/language/Help/savetiddler
description: Saves a raw tiddler to a file
Saves an individual tiddler in its raw text or binary format to the specified filename.
```
--savetiddler <title> <filename>
```

View File

@@ -0,0 +1,30 @@
title: $:/language/Help/server
description: Provides an HTTP server interface to 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.
At the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for `GET`, `PUT` and `DELETE`.
```
--server <port> <roottiddler> <rendertype> <servetype> <username> <password> <host>
```
The parameters are:
* ''port'' - port number to serve from (defaults to "8080")
* ''roottiddler'' - the tiddler to serve at the root (defaults to "$:/core/save/all")
* ''rendertype'' - the content type to which the root tiddler should be rendered (defaults to "text/plain")
* ''servetype'' - the content type with which the root tiddler should be served (defaults to "text/html")
* ''username'' - the default username for signing edits
* ''password'' - optional password for basic authentication
* ''host'' - optional hostname to serve from (defaults to "127.0.0.1" aka "localhost")
If the password parameter is specified then the browser will prompt the user for the username and password. Note that the password is transmitted in plain text so this implementation isn't suitable for general use.
For example:
```
--server 8080 $:/core/save/all text/plain text/html MyUserName passw0rd
```
To run multiple TiddlyWiki servers at the same time you'll need to put each one on a different port.

View File

@@ -0,0 +1,8 @@
title: $:/language/Help/verbose
description: Triggers verbose output mode
Triggers verbose output, useful for debugging
```
--verbose
```

View File

@@ -0,0 +1,8 @@
title: $:/language/Help/version
description: Displays the version number of TiddlyWiki
Displays the version number of TiddlyWiki.
```
--version
```

View File

@@ -0,0 +1,4 @@
title: $:/language/
RecentChanges/DateFormat: DDth MMM YYYY
CloseAll/Button: close all

View File

@@ -1,8 +1,8 @@
title: $:/messages/Download
title: $:/language/Modals/Download
type: text/vnd.tiddlywiki
subtitle: Download changes
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>
help: http://five.tiddlywiki.com/static/DownloadingChanges.html
help: http://tiddlywiki.com/static/DownloadingChanges.html
Your browser only supports manual saving.

View File

@@ -1,8 +1,8 @@
title: $:/messages/SaveInstructions
title: $:/language/Modals/SaveInstructions
type: text/vnd.tiddlywiki
subtitle: Save your work
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>
help: http://five.tiddlywiki.com/static/SavingChanges
help: http://tiddlywiki.com/static/SavingChanges.html
Your changes to this wiki need to be saved as a ~TiddlyWiki HTML file.

View File

@@ -0,0 +1,4 @@
title: $:/language/Notifications/
Save/Done: Saved wiki
Save/Starting: Starting to save wiki

View File

@@ -0,0 +1,10 @@
title: $:/language/Search/
Advanced/Matches: //<small><$count filter={{$:/temp/advancedsearch}}/> matches</small>//
Filter/Caption: Filter
Filter/Hint: Search via a [[filter expression|http://tiddlywiki.com/static/TiddlerFilters.html]]
Matches: //<small><$count filter="[!is[system]search{$:/temp/search}]"/> matches</small>//
Shadows/Caption: Shadows
Shadows/Hint: Search for shadow tiddlers
System/Caption: System
System/Hint: Search for system tiddlers

View File

@@ -0,0 +1,17 @@
title: $:/language/SideBar/
All/Caption: All
Drafts/Caption: Drafts
Missing/Caption: Missing
More/Caption: More
Open/Caption: Open
Orphans/Caption: Orphans
Recent/Caption: Recent
Shadows/Caption: Shadows
System/Caption: System
Tags/Caption: Tags
Tags/TagManager/Caption: Tag Manager
Tags/Untagged/Caption: untagged
Tools/Caption: Tools
Types/Caption: Types

View File

@@ -1,3 +1,3 @@
title: SiteSubtitle
title: $:/SiteSubtitle
a non-linear personal web notebook

View File

@@ -0,0 +1,3 @@
title: $:/SiteTitle
My ~TiddlyWiki

View File

@@ -0,0 +1,11 @@
title: $:/language/TiddlerInfo/
Fields/Caption: Fields
List/Caption: List
List/Empty: This tiddler does not have a list
Listed/Caption: Listed
Listed/Empty: This tiddler is not listed by any others
References/Caption: References
References/Empty: No tiddlers link to this one
Tagging/Caption: Tagging
Tagging/Empty: No tiddlers are tagged with this one

View File

@@ -0,0 +1,3 @@
title: $:/language/Docs/Types/application/json
description: JSON data
name: application/json

View File

@@ -1,3 +1,3 @@
title: $:/docs/types/application/x-tiddler-dictionary
title: $:/language/Docs/Types/application/x-tiddler-dictionary
description: Data dictionary
name: application/x-tiddler-dictionary

View File

@@ -0,0 +1,3 @@
title: $:/language/Docs/Types/image/gif
description: GIF image
name: image/gif

View File

@@ -1,3 +1,3 @@
title: $:/docs/types/image/jpeg
title: $:/language/Docs/Types/image/jpeg
description: JPEG image
name: image/jpeg

View File

@@ -0,0 +1,3 @@
title: $:/language/Docs/Types/image/png
description: PNG image
name: image/png

View File

@@ -1,3 +1,3 @@
title: $:/docs/types/image/svg+xml
title: $:/language/Docs/Types/image/svg+xml
description: Structured Vector Graphics image
name: image/svg+xml

View File

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

View File

@@ -0,0 +1,3 @@
title: $:/language/Docs/Types/text/css
description: Static stylesheet
name: text/css

View File

@@ -1,3 +1,3 @@
title: $:/docs/types/text/plain
title: $:/language/Docs/Types/text/plain
description: Plain text
name: text/plain

View File

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

View File

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

View File

@@ -1,16 +0,0 @@
title: $:/messages/EnterEditMode
type: text/vnd.tiddlywiki
subtitle: Editing this wiki
footer: <<button close class:"btn btn-primary"><Close>>
help: http://five.tiddlywiki.com/static/EditMode
You can edit this wiki and save your changes. You are strongly advised to verify that saving is working properly before trusting ~TiddlyWiki with your data.
The following methods of saving changes are available:
* Using Firefox's built-in file system access
* Uploading to a simple server script
* Using HTML5's data URI and download attribute
[x] Don't show this message again

View File

@@ -1,3 +0,0 @@
title: $:/messages/Saved
Saved wiki

View File

@@ -1,3 +0,0 @@
title: $:/messages/StartingSave
Starting to save wiki

View File

@@ -0,0 +1,41 @@
/*\
title: $:/core/modules/commands/help.js
type: application/javascript
module-type: command
Help command
\*/
(function(){
/*jshint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
name: "help",
synchronous: true
};
var Command = function(params,commander) {
this.params = params;
this.commander = commander;
};
Command.prototype.execute = function() {
var subhelp = this.params[0] || "default",
helpBase = "$:/language/Help/",
text;
if(!this.commander.wiki.getTiddler(helpBase + subhelp)) {
subhelp = "notfound";
}
// Wikify the help as formatted text (ie block elements generate newlines)
text = this.commander.wiki.renderTiddler("text/plain-formatted",helpBase + subhelp);
// Remove any leading linebreaks
text = text.replace(/^(\r?\n)*/g,"");
this.commander.streams.output.write(text);
};
exports.Command = Command;
})();

View File

@@ -0,0 +1,59 @@
/*\
title: $:/core/modules/commands/init.js
type: application/javascript
module-type: command
Command to initialise an empty wiki folder
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
name: "init",
synchronous: true
};
var Command = function(params,commander) {
this.params = params;
this.commander = commander;
};
Command.prototype.execute = function() {
var fs = require("fs"),
path = require("path");
// Check that we don't already have a valid wiki folder
if($tw.boot.wikiTiddlersPath) {
return "Wiki folder is not empty";
}
// Loop through each of the specified editions
var editions = this.params.length > 0 ? this.params : ["empty"];
for(var editionIndex=0; editionIndex<editions.length; editionIndex++) {
var editionName = editions[editionIndex];
// Check the edition exists
var editionPath = path.resolve($tw.boot.corePath,$tw.config.editionsPath) + "/" + editionName;
if(!$tw.utils.isDirectory(editionPath)) {
return "Edition '" + editionName + "' not found";
}
// Copy the edition content
var err = $tw.utils.copyDirectory(editionPath,$tw.boot.wikiPath);
if(!err) {
this.commander.streams.output.write("Copied edition '" + editionName + "' to " + $tw.boot.wikiPath + "\n");
} else {
return err;
}
}
// Tweak the tiddlywiki.info to remove any included wikis
var packagePath = $tw.boot.wikiPath + "/tiddlywiki.info",
packageJson = JSON.parse(fs.readFileSync(packagePath));
delete packageJson.includeWikis;
fs.writeFileSync(packagePath,JSON.stringify(packageJson,null,$tw.config.preferences.jsonSpaces));
return null;
};
exports.Command = Command;
})();

View File

@@ -1,114 +0,0 @@
/*\
title: $:/core/modules/commands/print.js
type: application/javascript
module-type: command
Print command for inspecting TiddlyWiki internals
\*/
(function(){
/*jshint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
name: "print",
synchronous: true
};
var Command = function(params,commander) {
this.params = params;
this.commander = commander;
this.output = commander.streams.output;
};
Command.prototype.execute = function() {
if(this.params.length < 1) {
return "Too few parameters for print command";
}
var subcommand = this.subcommands[this.params[0]];
if(subcommand) {
return subcommand.call(this);
} else {
return "Unknown subcommand (" + this.params[0] + ") for print command";
}
};
Command.prototype.subcommands = {};
Command.prototype.subcommands.tiddler = function() {
if(this.params.length < 2) {
return "Too few parameters for print tiddler command";
}
var tiddler = this.commander.wiki.getTiddler(this.params[1]);
if(!tiddler) {
return "No such tiddler as '" + this.params[1] + "'";
}
this.output.write("Tiddler '" + this.params[1] + "' contains these fields:\n");
for(var t in tiddler.fields) {
this.output.write(" " + t + ": " + tiddler.getFieldString(t) + "\n");
}
return null; // No error
};
Command.prototype.subcommands.tiddlers = function() {
var tiddlers = this.commander.wiki.getTiddlers();
this.output.write("Wiki contains these tiddlers:\n");
for(var t=0; t<tiddlers.length; t++) {
this.output.write(tiddlers[t] + "\n");
}
return null; // No error
};
Command.prototype.subcommands.system = function() {
var tiddlers = this.commander.wiki.getSystemTitles();
this.output.write("Wiki contains these system tiddlers:\n");
for(var t=0; t<tiddlers.length; t++) {
this.output.write(tiddlers[t] + "\n");
}
return null; // No error
};
Command.prototype.subcommands.config = function() {
var self = this;
var quotePropertyName = function(p) {
var unquotedPattern = /^[A-Za-z0-9_]*$/mg;
if(unquotedPattern.test(p)) {
return p;
} else {
return "[\"" + $tw.utils.stringify(p) + "\"]";
}
},
printConfig = function(object,prefix) {
for(var n in object) {
var v = object[n];
if(typeof v === "object") {
printConfig(v,prefix + "." + quotePropertyName(n));
} else if(typeof v === "string") {
self.output.write(prefix + "." + quotePropertyName(n) + ": \"" + $tw.utils.stringify(v) + "\"\n");
} else {
self.output.write(prefix + "." + quotePropertyName(n) + ": " + v.toString() + "\n");
}
}
},
printObject = function(heading,object) {
self.output.write(heading +"\n");
for(var n in object) {
self.output.write(" " + n + "\n");
}
};
this.output.write("Configuration:\n");
printConfig($tw.config," $tw.config");
printObject("Tiddler field modules:",$tw.Tiddler.fieldModules);
printObject("Loaded modules:",$tw.modules.titles);
printObject("Command modules:",$tw.commands);
printObject("Parser modules:",$tw.wiki.parsers);
printObject("Macro modules:",$tw.wiki.macros);
printObject("Deserializer modules:",$tw.Wiki.tiddlerDeserializerModules);
return null; // No error
};
exports.Command = Command;
})();

View File

@@ -42,7 +42,7 @@ Command.prototype.execute = function() {
$tw.utils.each(tiddlers,function(title) {
var parser = wiki.parseTiddler(template),
widgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}});
var container = $tw.document.createElement("div");
var container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null);
var text = type === "text/html" ? container.innerHTML : container.textContent;
fs.writeFileSync(path.resolve(pathname,encodeURIComponent(title) + extension),text,"utf8");

View File

@@ -108,6 +108,9 @@ SimpleServer.prototype.listen = function(port,host) {
response.end();
return;
}
// Set the encoding for the incoming request
// TODO: Presumably this would need tweaking if we supported PUTting binary tiddlers
request.setEncoding("utf8");
// Dispatch the appropriate method
switch(request.method) {
case "GET": // Intentional fall-through
@@ -157,7 +160,7 @@ var Command = function(params,commander,callback) {
state.wiki.addTiddler(new $tw.Tiddler(state.wiki.getCreationFields(),fields,{title: title}));
var changeCount = state.wiki.getChangeCount(title).toString();
response.writeHead(204, "OK",{
Etag: "\"default/" + title + "/" + changeCount + ":\""
Etag: "\"default/" + encodeURIComponent(title) + "/" + changeCount + ":\""
});
response.end();
}
@@ -265,7 +268,7 @@ Command.prototype.execute = function() {
serveType = this.params[3] || "text/html",
username = this.params[4],
password = this.params[5],
host = this.params[6];
host = this.params[6] || "127.0.0.1";
this.server.set({
rootTiddler: rootTiddler,
renderType: renderType,

View File

@@ -35,5 +35,6 @@ exports.htmlEntities = {quot:34, amp:38, apos:39, lt:60, gt:62, nbsp:160, iexcl:
exports.htmlVoidElements = "area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr".split(",");
exports.htmlBlockElements = "address,article,aside,audio,blockquote,canvas,dd,div,dl,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,li,noscript,ol,output,p,pre,section,table,tfoot,ul,video".split(",");
})();

View File

@@ -100,7 +100,7 @@ exports["text/html"] = function(text,fields) {
var storeAreaMarkerRegExp = /<div id=["']?storeArea['"]?( style=["']?display:none;["']?)?>/gi,
match = storeAreaMarkerRegExp.exec(text);
if(match) {
// If so, it's either a classic TiddlyWiki file or a TW5 file
// If so, it's either a classic TiddlyWiki file or an unencrypted TW5 file
// First read the normal tiddlers
var results = deserializeTiddlyWikiFile(text,storeAreaMarkerRegExp.lastIndex,!!match[1],fields);
// Then any system tiddlers
@@ -111,8 +111,15 @@ exports["text/html"] = function(text,fields) {
}
return results
} else {
// It's not a TiddlyWiki so we'll return the entire HTML file as a tiddler
return deserializeHtmlFile(text,fields);
// Check whether we've got an encrypted file
var encryptedStoreArea = $tw.utils.extractEncryptedStoreArea(text);
if(encryptedStoreArea) {
// If so, attempt to decrypt it using the current password
return $tw.utils.decryptStoreArea(encryptedStoreArea);
} else {
// It's not a TiddlyWiki so we'll return the entire HTML file as a tiddler
return deserializeHtmlFile(text,fields);
}
}
};

View File

@@ -33,31 +33,55 @@ function parseFilterOperation(operators,filterString,p) {
operator.prefix = filterString.charAt(p++);
}
// Get the operator name
bracketPos = filterString.indexOf("[",p);
curlyBracketPos = filterString.indexOf("{",p);
if((bracketPos === -1) && (curlyBracketPos === -1)) {
var nextBracketPos = filterString.substring(p).search(/[\[\{\/]/);
if(nextBracketPos === -1) {
throw "Missing [ in filter expression";
}
if(bracketPos === -1 || (curlyBracketPos !== -1 && curlyBracketPos < bracketPos)) {
// Curly brackets
operator.indirect = true;
operator.operator = filterString.substring(p,curlyBracketPos);
p = curlyBracketPos + 1;
} else {
// Square brackets
operator.operator = filterString.substring(p,bracketPos);
p = bracketPos + 1;
nextBracketPos += p;
var bracket = filterString.charAt(nextBracketPos);
operator.operator = filterString.substring(p,nextBracketPos);
// Any suffix?
var colon = operator.operator.indexOf(':');
if(colon > -1) {
operator.suffix = operator.operator.substring(colon + 1);
operator.operator = operator.operator.substring(0,colon) || "field";
}
if(operator.operator === "") {
// Empty operator means: title
else if(operator.operator === "") {
operator.operator = "title";
}
// Get the operand
bracketPos = filterString.indexOf(operator.indirect ? "}" : "]",p);
if(bracketPos === -1) {
p = nextBracketPos + 1;
switch (bracket) {
case '{': // Curly brackets
operator.indirect = true;
nextBracketPos = filterString.indexOf('}',p);
break;
case '[': // Square brackets
nextBracketPos = filterString.indexOf(']',p);
break;
case '/': // regexp brackets
var rex = /^((?:[^\\\/]*|\\.)*)\/(?:\(([mygi]+)\))?/g,
rexMatch = rex.exec(filterString.substring(p));
if(rexMatch) {
operator.regexp = new RegExp(rexMatch[1], rexMatch[2]);
nextBracketPos = p + rex.lastIndex - 1;
}
else {
throw "Unterminated regular expression in filter expression";
}
break;
}
if(nextBracketPos === -1) {
throw "Missing closing bracket in filter expression";
}
operator.operand = filterString.substring(p,bracketPos);
p = bracketPos + 1;
if(!operator.regexp) {
operator.operand = filterString.substring(p,nextBracketPos);
}
p = nextBracketPos + 1;
// Push this operator
operators.push(operator);
} while(filterString.charAt(p) !== "]");
@@ -161,7 +185,9 @@ exports.compileFilter = function(filterString) {
results = operatorFunction(accumulator,{
operator: operator.operator,
operand: operand,
prefix: operator.prefix
prefix: operator.prefix,
suffix: operator.suffix,
regexp: operator.regexp
},{
wiki: self,
currTiddlerTitle: currTiddlerTitle
@@ -193,6 +219,7 @@ exports.compileFilter = function(filterString) {
});
// Return a function that applies the operations to a source array/hashmap of tiddler titles
return function(source,currTiddlerTitle) {
source = source || self.tiddlers;
var results = [];
$tw.utils.each(operationFunctions,function(operationFunction) {
operationFunction(results,source,currTiddlerTitle);

View File

@@ -0,0 +1,27 @@
/*\
title: $:/core/modules/filters/commands.js
type: application/javascript
module-type: filteroperator
Filter operator for returning the names of the commands available in this wiki
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.commands = function(source,operator,options) {
var results = [];
$tw.utils.each($tw.commands,function(commandInfo,name) {
results.push(name);
});
results.sort();
return results;
};
})();

View File

@@ -16,12 +16,20 @@ Filter operator for comparing fields for equality
Export our filter function
*/
exports.field = function(source,operator,options) {
var results = [];
var results = [],
fieldname = (operator.suffix || operator.operator).toLowerCase(),
isTitle = fieldname === "title";
// Function to check an individual title
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title);
if(tiddler) {
var match = tiddler.getFieldString(operator.operator) === operator.operand;
var tiddler = options.wiki.getTiddler(title),
text = tiddler ? tiddler.getFieldString(fieldname) : (isTitle ? title : null),
match;
if(text !== null) {
if(operator.regexp) {
match = !!operator.regexp.exec(text);
} else {
match = text === operator.operand;
}
if(operator.prefix === "!") {
match = !match;
}

View File

@@ -21,7 +21,7 @@ exports.has = function(source,operator,options) {
function checkTiddler(title) {
var tiddler = options.wiki.getTiddler(title);
if(tiddler) {
var match = $tw.utils.hop(tiddler.fields,operator.operand);
var match = $tw.utils.hop(tiddler.fields,operator.operand) && tiddler.fields[operator.operand] !== "";
if(operator.prefix === "!") {
match = !match;
}

View File

@@ -0,0 +1,43 @@
/*\
title: $:/core/modules/filters/indexes.js
type: application/javascript
module-type: filteroperator
Filter operator for returning the indexes of a data tiddler
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.indexes = function(source,operator,options) {
var self = this,
results = [];
// Function to check an individual title
function checkTiddler(title) {
// Return the fields on the specified tiddler
var data = options.wiki.getTiddlerData(title,{});
if(data) {
$tw.utils.pushTop(results,Object.keys(data));
}
}
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
results.sort();
return results;
};
})();

View File

@@ -0,0 +1,43 @@
/*\
title: $:/core/modules/filters/is/image.js
type: application/javascript
module-type: isfilteroperator
Filter function for [is[image]]
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.image = function(source,prefix,options) {
var results = [];
// Function to check a tiddler
function checkTiddler(title) {
var match = options.wiki.isImageTiddler(title);
if(prefix === "!") {
match = !match;
}
if(match) {
results.push(title);
}
};
// Iterate through the source tiddlers
if($tw.utils.isArray(source)) {
$tw.utils.each(source,function(title) {
checkTiddler(title);
});
} else {
$tw.utils.each(source,function(element,title) {
checkTiddler(title);
});
}
return results;
};
})();

View File

@@ -17,7 +17,8 @@ Export our filter function
*/
exports.list = function(source,operator,options) {
var results = [],
list = options.wiki.getTiddlerList(operator.operand);
tr = $tw.utils.parseTextReference(operator.operand),
list = options.wiki.getTiddlerList(tr.title || options.currTiddlerTitle,tr.field,tr.index);
function checkTiddler(title) {
var match = list.indexOf(title) !== -1;
if(operator.prefix === "!") {

View File

@@ -0,0 +1,87 @@
/*\
title: $:/core/modules/filters/listops.js
type: application/javascript
module-type: filteroperator
Filter operators for manipulating the current selection list
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Reverse list
*/
exports.reverse = function(source,operator,options) {
var results = [];
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
$tw.utils.each(source,function(title) {
results.unshift(title);
});
return results;
};
/*
First entry/entries in list
*/
exports.first = function(source,operator,options) {
var count = parseInt(operator.operand) || 1;
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
return source.slice(0,Math.min(count,source.length));
};
/*
Last entry/entries in list
*/
exports.last = function(source,operator,options) {
var count = parseInt(operator.operand) || 1;
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
return source.slice(-count);
};
/*
All but the first entry/entries of the list
*/
exports.rest = function(source,operator,options) {
var count = parseInt(operator.operand) || 1;
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
return source.slice(count);
};
exports.butfirst = exports.rest;
exports.bf = exports.rest;
/*
All but the last entry/entries of the list
*/
exports.butlast = function(source,operator,options) {
var count = parseInt(operator.operand) || 1;
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
return source.slice(0,-count);
};
exports.bl = exports.butlast;
/*
The nth member of the list
*/
exports.nth = function(source,operator,options) {
var count = parseInt(operator.operand) || 1;
if(!$tw.utils.isArray(source)) {
source = Object.keys(source).sort();
}
return source.slice(count-1,count);
};
})();

View File

@@ -13,23 +13,23 @@ The image parser parses an image into an embeddable HTML element
"use strict";
var ImageParser = function(type,text,options) {
var element = "img",
var element = {
type: "element",
tag: "img",
attributes: {}
},
src;
if(type === "application/pdf" || type === ".pdf") {
src = "data:application/pdf;base64," + text;
element = "embed";
} else if(type === "image/svg+xml" || type === ".svg") {
src = "data:image/svg+xml," + encodeURIComponent(text);
} else {
src = "data:" + type + ";base64," + text;
}
this.tree = [{
type: "element",
tag: element,
attributes: {
"src": {type: "string", value: src}
if(text) {
if(type === "application/pdf" || type === ".pdf") {
element.attributes.src = {type: "string", value: "data:application/pdf;base64," + text};
element.tag = "embed";
} else if(type === "image/svg+xml" || type === ".svg") {
element.attributes.src = {type: "string", value: "data:image/svg+xml," + encodeURIComponent(text)};
} else {
element.attributes.src = {type: "string", value: "data:" + type + ";base64," + text};
}
}];
}
this.tree = [element];
};
exports["image/svg+xml"] = ImageParser;

View File

@@ -28,6 +28,7 @@ exports["text/x-tiddlywiki"] = TextParser;
exports["application/javascript"] = TextParser;
exports["application/json"] = TextParser;
exports["text/css"] = TextParser;
exports["application/x-tiddler-dictionary"] = TextParser;
})();

View File

@@ -23,14 +23,15 @@ exports.types = {block: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match
this.matchRegExp = /```\r?\n/mg;
// Regexp to match and get language if defined
this.matchRegExp = /```([\w-]*)\r?\n/mg;
};
exports.parse = function() {
var reEnd = /(\r?\n```$)/mg;
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
// Look for the end of the block
reEnd.lastIndex = this.parser.pos;
var match = reEnd.exec(this.parser.source),
@@ -43,14 +44,14 @@ exports.parse = function() {
text = this.parser.source.substr(this.parser.pos);
this.parser.pos = this.parser.sourceLength;
}
// Return the pre element
// Return the $codeblock widget
return [{
type: "element",
tag: "pre",
children: [{
type: "text",
text: text
}]
type: "element",
tag: "$codeblock",
attributes: {
code: {type: "string", value: text},
language: {type: "string", value: this.match[1]}
}
}];
};

View File

@@ -9,6 +9,8 @@ Wiki text block rule for HTML comments. For example:
<!-- This is a comment -->
```
Note that the syntax for comments is simplified to an opening "<!--" sequence and a closing "-->" sequence -- HTML itself implements a more complex format (see http://ostermiller.org/findhtmlcomment.html)
\*/
(function(){
@@ -21,13 +23,26 @@ exports.types = {block: true};
exports.init = function(parser) {
this.parser = parser;
// Regexp to match - HTML comment regexp by Stephen Ostermiller, http://ostermiller.org/findhtmlcomment.html
this.matchRegExp = /\<![ \r\n\t]*(?:--(?:[^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>\r?\n/mg;
this.matchRegExp = /\<!--/mg;
this.endMatchRegExp = /--\>/mg;
};
exports.findNextMatch = function(startPos) {
this.matchRegExp.lastIndex = startPos;
this.match = this.matchRegExp.exec(this.parser.source);
if(this.match) {
this.endMatchRegExp.lastIndex = startPos + this.match[0].length;
this.endMatch = this.endMatchRegExp.exec(this.parser.source);
if(this.endMatch) {
return this.match.index;
}
}
return undefined;
};
exports.parse = function() {
// Move past the match
this.parser.pos = this.matchRegExp.lastIndex;
this.parser.pos = this.endMatchRegExp.lastIndex;
// Don't return any elements
return [];
};

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