diff --git a/core/language/en-GB/Misc.multids b/core/language/en-GB/Misc.multids index e7dfd68c3..35502b737 100644 --- a/core/language/en-GB/Misc.multids +++ b/core/language/en-GB/Misc.multids @@ -6,6 +6,7 @@ CloseAll/Button: close all ConfirmCancelTiddler: Do you wish to discard changes to the tiddler "<$text text=<>/>"? ConfirmDeleteTiddler: Do you wish to delete the tiddler "<$text text=<<title>>/>"? ConfirmOverwriteTiddler: Do you wish to overwrite the tiddler "<$text text=<<title>>/>"? +ConfirmEditShadowTiddler: Your about to edit a ShaddowTiddler. This will override the default system making upgrading non-trivial. Are you sure you want to edit "<$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 (`.`) MissingTiddler/Hint: Missing tiddler "<$text text=<<currentTiddler>>/>" - click {{$:/core/images/edit-button}} to create RecentChanges/DateFormat: DDth MMM YYYY diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index eb0d5425a..0f75cb7e9 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -181,9 +181,28 @@ NavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) { // Place a tiddler in edit mode NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) { + function isUnmodifiedShadow(title) { + // jshint eqnull:true + var tiddler = $tw.wiki.getTiddler(title); + return ( + $tw.wiki.isShadowTiddler(title) && + tiddler.fields.modified == null + ); + } + function confirmEditShadow(title) { + return confirm($tw.language.getString( + "ConfirmEditShadowTiddler", + {variables: + {title: title} + } + )); + } + var title = event.param || event.tiddlerTitle; + if(isUnmodifiedShadow(title) && !confirmEditShadow(title)) { + return false; + } // Replace the specified tiddler with a draft in edit mode - var title = event.param || event.tiddlerTitle, - draftTiddler = this.makeDraftTiddler(title), + var draftTiddler = this.makeDraftTiddler(title), draftTitle = draftTiddler.fields.title, storyList = this.getStoryList(); this.removeTitleFromStory(storyList,draftTitle);