From 88c1a1e0628576e217742b840733e7ea70055bd4 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Fri, 2 Oct 2015 11:36:07 +0200 Subject: [PATCH 1/4] no delete confirmation for alerts --- core/modules/widgets/navigator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index c6aab7aee..8c6951b68 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -258,12 +258,12 @@ NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) { confirmationTitle = title; } // Seek confirmation - if((this.wiki.getTiddler(originalTitle) || (tiddler.fields.text || "") !== "") && !confirm($tw.language.getString( + if(!tiddler.hasTag("$:/tags/Alert") && ((this.wiki.getTiddler(originalTitle) || (tiddler.fields.text || "") !== "") && !confirm($tw.language.getString( "ConfirmDeleteTiddler", {variables: {title: confirmationTitle} } - ))) { + )))) { return false; } // Delete the original tiddler From 5d36e17c18e6aa84acda87a0919b58347b2b2a9a Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sat, 10 Oct 2015 16:35:22 +0200 Subject: [PATCH 2/4] Revert "no delete confirmation for alerts" This reverts commit 88c1a1e0628576e217742b840733e7ea70055bd4. --- core/modules/widgets/navigator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index 8c6951b68..c6aab7aee 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -258,12 +258,12 @@ NavigatorWidget.prototype.handleDeleteTiddlerEvent = function(event) { confirmationTitle = title; } // Seek confirmation - if(!tiddler.hasTag("$:/tags/Alert") && ((this.wiki.getTiddler(originalTitle) || (tiddler.fields.text || "") !== "") && !confirm($tw.language.getString( + if((this.wiki.getTiddler(originalTitle) || (tiddler.fields.text || "") !== "") && !confirm($tw.language.getString( "ConfirmDeleteTiddler", {variables: {title: confirmationTitle} } - )))) { + ))) { return false; } // Delete the original tiddler From 9a23c2471cebf856d9db8295beae402bfd6d82d7 Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sat, 10 Oct 2015 16:47:11 +0200 Subject: [PATCH 3/4] modified alert template and execute action-deletetiddler on currentTiddler by default --- core/modules/widgets/action-deletetiddler.js | 2 +- core/ui/AlertTemplate.tid | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/modules/widgets/action-deletetiddler.js b/core/modules/widgets/action-deletetiddler.js index 816f9f55e..f98346989 100644 --- a/core/modules/widgets/action-deletetiddler.js +++ b/core/modules/widgets/action-deletetiddler.js @@ -36,7 +36,7 @@ Compute the internal state of the widget */ DeleteTiddlerWidget.prototype.execute = function() { this.actionFilter = this.getAttribute("$filter"); - this.actionTiddler = this.getAttribute("$tiddler"); + this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler")); }; /* diff --git a/core/ui/AlertTemplate.tid b/core/ui/AlertTemplate.tid index c4e457b75..59e3bc503 100644 --- a/core/ui/AlertTemplate.tid +++ b/core/ui/AlertTemplate.tid @@ -2,8 +2,7 @@ title: $:/core/ui/AlertTemplate
-<$button message="tm-delete-tiddler" class="tc-btn-invisible"> -{{$:/core/images/delete-button}} +<$button class="tc-btn-invisible"><$action-deletetiddler/>{{$:/core/images/delete-button}}
<$view field="component"/> - <$view field="modified" format="date" template="0hh:0mm:0ss DD MM YYYY"/> <$reveal type="nomatch" state="!!count" text="">(count: <$view field="count"/>) From 00f6aafed6c36f63efb096b4ff20027a712ad43d Mon Sep 17 00:00:00 2001 From: Tobias Beer Date: Sat, 10 Oct 2015 21:01:07 +0200 Subject: [PATCH 4/4] being specific about the tiddler to be deleted via action-deletetiddler --- core/modules/widgets/action-deletetiddler.js | 2 +- core/ui/AlertTemplate.tid | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/action-deletetiddler.js b/core/modules/widgets/action-deletetiddler.js index f98346989..816f9f55e 100644 --- a/core/modules/widgets/action-deletetiddler.js +++ b/core/modules/widgets/action-deletetiddler.js @@ -36,7 +36,7 @@ Compute the internal state of the widget */ DeleteTiddlerWidget.prototype.execute = function() { this.actionFilter = this.getAttribute("$filter"); - this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler")); + this.actionTiddler = this.getAttribute("$tiddler"); }; /* diff --git a/core/ui/AlertTemplate.tid b/core/ui/AlertTemplate.tid index 59e3bc503..dd51643ff 100644 --- a/core/ui/AlertTemplate.tid +++ b/core/ui/AlertTemplate.tid @@ -2,7 +2,7 @@ title: $:/core/ui/AlertTemplate
-<$button class="tc-btn-invisible"><$action-deletetiddler/>{{$:/core/images/delete-button}} +<$button class="tc-btn-invisible"><$action-deletetiddler tiddler=<>/>{{$:/core/images/delete-button}}
<$view field="component"/> - <$view field="modified" format="date" template="0hh:0mm:0ss DD MM YYYY"/> <$reveal type="nomatch" state="!!count" text="">(count: <$view field="count"/>)