1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-08 14:55:17 +00:00

Add GettingStarted tiddler for empty TiddlyWikis

This commit is contained in:
Jeremy Ruston 2013-03-21 22:21:34 +00:00
parent 6f88a57a41
commit 4848a21c6b
2 changed files with 20 additions and 5 deletions

View File

@ -0,0 +1,11 @@
title: $:/messages/GettingStarted
type: text/vnd.tiddlywiki
subtitle: Welcome to ~TiddlyWiki
footer: <$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>
help: http://five.tiddlywiki.com/static/GettingStarted
This ~TiddlyWiki is empty.
You can create and edit tiddlers, but before you use ~TiddlyWiki in earnest it is strongly advised that you verify that you can save and retrieve your changes.
~TiddlyWiki5 is currently a preliminary alpha release. Visit http://five.tiddlywiki.com/ for the latest information on how to use it.

View File

@ -104,10 +104,14 @@ exports.startup = function() {
}); });
// If we're being viewed on a data: URI then give instructions for how to save // If we're being viewed on a data: URI then give instructions for how to save
if(document.location.protocol === "data:") { if(document.location.protocol === "data:") {
var event = document.createEvent("Event"); $tw.utils.dispatchCustomEvent(document,"tw-modal",{
event.initEvent("tw-modal",true,true); param: "$:/messages/SaveInstructions"
event.param = "$:/messages/SaveInstructions"; });
document.dispatchEvent(event); } else if($tw.wiki.countTiddlers() === 0){
// Otherwise, if give instructions if this is an empty TiddlyWiki
$tw.utils.dispatchCustomEvent(document,"tw-modal",{
param: "$:/messages/GettingStarted"
});
} }
// Display the PageTemplate // Display the PageTemplate
var templateTitle = "$:/templates/PageTemplate", var templateTitle = "$:/templates/PageTemplate",