mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
parent
400ab3b3c5
commit
3afa26b9a3
@ -3,6 +3,7 @@ title: $:/language/
|
||||
ClassicWarning/Hint: This tiddler is written in TiddlyWiki Classic wiki text format, which is not fully compatible with TiddlyWiki version 5. See http://tiddlywiki.com/static/Upgrading.html for more details.
|
||||
ClassicWarning/Upgrade/Caption: upgrade
|
||||
CloseAll/Button: close all
|
||||
ConfirmCancelTiddler: Do you wish to discard changes to the tiddler "<$text text=<<title>>/>"?
|
||||
ConfirmDeleteTiddler: Do you wish to delete the tiddler "<$text text=<<title>>/>"?
|
||||
ConfirmOverwriteTiddler: Do you wish to overwrite the tiddler "<$text text=<<title>>/>"?
|
||||
InvalidFieldName: Illegal characters in field name "<$text text=<<fieldName>>/>". Fields can only contain lowercase letters and the characters underscore (`_`), hyphen (`-`) and period (`.`)
|
||||
|
@ -333,11 +333,23 @@ NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) {
|
||||
originalTitle = draftTiddler.fields["draft.of"],
|
||||
storyList = this.getStoryList();
|
||||
if(draftTiddler && originalTitle) {
|
||||
// Ask for confirmation if the tiddler text has changed
|
||||
var isConfirmed = true;
|
||||
if(this.wiki.getTiddlerText(draftTitle) !== this.wiki.getTiddlerText(originalTitle)) {
|
||||
isConfirmed = confirm($tw.language.getString(
|
||||
"ConfirmCancelTiddler",
|
||||
{variables:
|
||||
{title: draftTitle}
|
||||
}
|
||||
));
|
||||
}
|
||||
// Remove the draft tiddler
|
||||
this.wiki.deleteTiddler(draftTitle);
|
||||
this.replaceFirstTitleInStory(storyList,draftTitle,originalTitle);
|
||||
this.addToHistory(originalTitle,event.navigateFromClientRect);
|
||||
this.saveStoryList(storyList);
|
||||
if(isConfirmed) {
|
||||
this.wiki.deleteTiddler(draftTitle);
|
||||
this.replaceFirstTitleInStory(storyList,draftTitle,originalTitle);
|
||||
this.addToHistory(originalTitle,event.navigateFromClientRect);
|
||||
this.saveStoryList(storyList);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user