mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Sort out the naming and location of shadow template tiddlers
This commit is contained in:
parent
9bc3dce953
commit
e0725bbb52
@ -41,7 +41,7 @@ exports.eventMap = {};
|
||||
|
||||
// Navigate to a specified tiddler
|
||||
exports.eventMap["tw-navigate"] = function(event) {
|
||||
var template = this.params.defaultViewTemplate || "ViewTemplate",
|
||||
var template = this.params.defaultViewTemplate || "$:/templates/ViewTemplate",
|
||||
storyTiddler = this.wiki.getTiddler(this.params.story),
|
||||
story = {tiddlers: []},
|
||||
navTiddler,t,tiddler;
|
||||
@ -75,7 +75,7 @@ exports.eventMap["tw-navigate"] = function(event) {
|
||||
exports.eventMap["tw-EditTiddler"] = function(event) {
|
||||
var template, storyTiddler, story, storyRecord, tiddler, t;
|
||||
// Put the specified tiddler into edit mode
|
||||
template = this.params.defaultEditTemplate || "EditTemplate";
|
||||
template = this.params.defaultEditTemplate || "$:/templates/EditTemplate";
|
||||
storyTiddler = this.wiki.getTiddler(this.params.story);
|
||||
story = {tiddlers: []};
|
||||
if(storyTiddler && $tw.utils.hop(storyTiddler.fields,"text")) {
|
||||
@ -107,7 +107,7 @@ exports.eventMap["tw-EditTiddler"] = function(event) {
|
||||
// Take a tiddler out of edit mode, saving the changes
|
||||
exports.eventMap["tw-SaveTiddler"] = function(event) {
|
||||
var template, storyTiddler, story, storyRecord, tiddler, storyTiddlerModified, t;
|
||||
template = this.params.defaultEditTemplate || "ViewTemplate";
|
||||
template = this.params.defaultEditTemplate || "$:/templates/ViewTemplate";
|
||||
storyTiddler = this.wiki.getTiddler(this.params.story);
|
||||
story = {tiddlers: []};
|
||||
storyTiddlerModified = false;
|
||||
|
@ -52,8 +52,9 @@ exports.startup = function() {
|
||||
// Host-specific startup
|
||||
if($tw.browser) {
|
||||
// Display the PageTemplate
|
||||
var renderer = $tw.wiki.parseTiddler("PageTemplate");
|
||||
renderer.execute([],"PageTemplate");
|
||||
var template = "$:/templates/PageTemplate",
|
||||
renderer = $tw.wiki.parseTiddler(template);
|
||||
renderer.execute([],template);
|
||||
renderer.renderInDom(document.body);
|
||||
$tw.wiki.addEventListener("",function(changes) {
|
||||
renderer.refreshInDom(changes);
|
||||
|
@ -1,4 +1,4 @@
|
||||
title: EditTemplate
|
||||
title: $:/templates/EditTemplate
|
||||
modifier: JeremyRuston
|
||||
|
||||
<<view title>> <<button SaveTiddler label:"done" class:"btn btn-mini btn-success">>
|
||||
|
@ -1,6 +1,6 @@
|
||||
title: PageTemplate
|
||||
title: $:/templates/PageTemplate
|
||||
|
||||
{{navigation-panel{<<chooser>>}}}{{zoomer-panel{<<zoomer>>}}}
|
||||
{{container-fluid{
|
||||
<<story story:StoryTiddlers storyview:scroller>>
|
||||
}}}
|
||||
<<story story:"$:/StoryTiddlers" storyview:scroller>>
|
||||
}}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
title: ViewTemplate
|
||||
title: $:/templates/ViewTemplate
|
||||
modifier: JeremyRuston
|
||||
|
||||
{{title{
|
||||
|
@ -1,10 +1,10 @@
|
||||
title: StoryTiddlers
|
||||
title: $:/StoryTiddlers
|
||||
type: application/json
|
||||
|
||||
{
|
||||
"tiddlers": [
|
||||
{"title": "HelloThere", "template": "ViewTemplate"},
|
||||
{"title": "Introduction", "template": "ViewTemplate"},
|
||||
{"title": "NewWikiTextFeatures", "template": "ViewTemplate"}
|
||||
{"title": "HelloThere", "template": "$:/templates/ViewTemplate"},
|
||||
{"title": "Introduction", "template": "$:/templates/ViewTemplate"},
|
||||
{"title": "NewWikiTextFeatures", "template": "$:/templates/ViewTemplate"}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user