1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Normalise custom event names

This commit is contained in:
Jeremy Ruston 2013-02-04 15:29:25 +00:00
parent 1f98ea5c87
commit 170c1425f7
6 changed files with 15 additions and 19 deletions

View File

@ -99,7 +99,7 @@ Modal.prototype.display = function(title,options) {
if(tiddler && tiddler.fields && tiddler.fields.footer) {
footerText = tiddler.fields.footer;
} else {
footerText = '<$button message="tw-close" class="btn btn-primary">Close</$button>';
footerText = '<$button message="tw-close-tiddler" class="btn btn-primary">Close</$button>';
}
var footerParser = this.wiki.parseText("text/vnd.tiddlywiki-run",footerText),
footerRenderTree = new $tw.WikiRenderTree(footerParser,{wiki: $tw.wiki});
@ -109,7 +109,7 @@ Modal.prototype.display = function(title,options) {
footerRenderTree.refreshInDom(changes);
});
// Add the close event handler
wrapper.addEventListener("tw-close",function(event) {
wrapper.addEventListener("tw-close-tiddler",function(event) {
// Force layout and animate the modal message away
$tw.utils.forceLayout(modalBackdrop);
$tw.utils.forceLayout(modalWrapper);
@ -126,7 +126,7 @@ Modal.prototype.display = function(title,options) {
document.body.removeChild(wrapper);
}
},false);
// Don't let anyone else handle the tw-close message
// Don't let anyone else handle the tw-close-tiddler message
event.stopPropagation();
return false;
},false);

View File

@ -110,10 +110,10 @@ ListWidget.prototype.createListElement = function(title) {
children: [this.createListElementMacro(title)],
events: [
{name: "tw-navigate", handlerFunction: handleEvent},
{name: "tw-EditTiddler", handlerFunction: handleEvent},
{name: "tw-SaveTiddler", handlerFunction: handleEvent},
{name: "tw-CloseTiddler", handlerFunction: handleEvent},
{name: "tw-NewTiddler", handlerFunction: handleEvent}
{name: "tw-edit-tiddler", handlerFunction: handleEvent},
{name: "tw-save-tiddler", handlerFunction: handleEvent},
{name: "tw-close-tiddler", handlerFunction: handleEvent},
{name: "tw-new-tiddler", handlerFunction: handleEvent}
]
};
};

View File

@ -31,10 +31,10 @@ NavigatorWidget.prototype.generate = function() {
this.children = this.renderer.renderTree.createRenderers(this.renderer.renderContext,this.renderer.parseTreeNode.children);
this.events = [
{name: "tw-navigate", handlerObject: this, handlerMethod: "handleNavigateEvent"},
{name: "tw-EditTiddler", handlerObject: this, handlerMethod: "handleEditTiddlerEvent"},
{name: "tw-SaveTiddler", handlerObject: this, handlerMethod: "handleSaveTiddlerEvent"},
{name: "tw-close", handlerObject: this, handlerMethod: "handleCloseTiddlerEvent"},
{name: "tw-NewTiddler", handlerObject: this, handlerMethod: "handleNewTiddlerEvent"}
{name: "tw-edit-tiddler", handlerObject: this, handlerMethod: "handleEditTiddlerEvent"},
{name: "tw-save-tiddler", handlerObject: this, handlerMethod: "handleSaveTiddlerEvent"},
{name: "tw-close-tiddler", handlerObject: this, handlerMethod: "handleCloseTiddlerEvent"},
{name: "tw-new-tiddler", handlerObject: this, handlerMethod: "handleNewTiddlerEvent"}
];
};

View File

@ -1,9 +1,7 @@
title: $:/templates/EditTemplate
modifier: JeremyRuston
<div class="tw-tiddler-frame">
<$view field="title"/> <$button message="tw-SaveTiddler" class="btn btn-mini btn-success">done</$button>
<$view field="title"/> <$button message="tw-save-tiddler" class="btn btn-mini btn-success">done</$button>
@@.title
<$edit field="draft.title"/>
@ -14,5 +12,3 @@ modifier: JeremyRuston
@@.body
<$edit field="text"/>
@@
</div>

View File

@ -13,7 +13,7 @@ title: $:/templates/PageTemplate
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" listview=classic itemClass="tw-menu-list-item"/>
<div class="edit-controls">
<$button message="tw-NewTiddler" class="btn btn-mini btn-success">New</$button>
<$button message="tw-new-tiddler" class="btn btn-mini btn-success">New</$button>
<$button message="tw-save-wiki" class="btn btn-mini btn-primary">Save</$button>
</div>

View File

@ -2,8 +2,8 @@ title: $:/templates/ViewTemplate
modifier: JeremyRuston
<span class="tw-tiddler-controls">
<$button message="tw-close" class="btn-invisible">{{$:/core/images/close-button.svg}}</$button>
<$button message="tw-EditTiddler" class="btn-invisible">{{$:/core/images/edit-button.svg}}</$button>
<$button message="tw-close-tiddler" class="btn-invisible">{{$:/core/images/close-button.svg}}</$button>
<$button message="tw-edit-tiddler" class="btn-invisible">{{$:/core/images/edit-button.svg}}</$button>
</span>
<span class="title">
<$view field="title"/>