mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-01 08:03:00 +00:00
Add GettingStarted tiddler for empty TiddlyWikis
This commit is contained in:
@@ -104,11 +104,15 @@ exports.startup = function() {
|
||||
});
|
||||
// If we're being viewed on a data: URI then give instructions for how to save
|
||||
if(document.location.protocol === "data:") {
|
||||
var event = document.createEvent("Event");
|
||||
event.initEvent("tw-modal",true,true);
|
||||
event.param = "$:/messages/SaveInstructions";
|
||||
document.dispatchEvent(event);
|
||||
}
|
||||
$tw.utils.dispatchCustomEvent(document,"tw-modal",{
|
||||
param: "$:/messages/SaveInstructions"
|
||||
});
|
||||
} 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
|
||||
var templateTitle = "$:/templates/PageTemplate",
|
||||
parser = $tw.wiki.parseTiddler(templateTitle),
|
||||
|
||||
Reference in New Issue
Block a user