From 738952029bf6a504cb52980a198f054d3eae268b Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 20 Mar 2013 17:20:46 +0000 Subject: [PATCH] Icons for editing tiddlers --- core/images/cancel-button.svg | 3 +++ core/images/cancel-button.svg.meta | 2 ++ core/images/delete-button.svg | 3 +++ core/images/delete-button.svg.meta | 2 ++ core/images/done-button.svg | 3 +++ core/images/done-button.svg.meta | 2 ++ core/modules/widgets/navigator.js | 27 +++++++++++++++++++++++++++ core/templates/EditTemplate.tid | 4 +++- 8 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 core/images/cancel-button.svg create mode 100644 core/images/cancel-button.svg.meta create mode 100644 core/images/delete-button.svg create mode 100644 core/images/delete-button.svg.meta create mode 100644 core/images/done-button.svg create mode 100644 core/images/done-button.svg.meta diff --git a/core/images/cancel-button.svg b/core/images/cancel-button.svg new file mode 100644 index 000000000..4495094be --- /dev/null +++ b/core/images/cancel-button.svg @@ -0,0 +1,3 @@ + + +Layer 1 diff --git a/core/images/cancel-button.svg.meta b/core/images/cancel-button.svg.meta new file mode 100644 index 000000000..68afb96f0 --- /dev/null +++ b/core/images/cancel-button.svg.meta @@ -0,0 +1,2 @@ +title: $:/core/images/cancel-button.svg +type: image/svg+xml diff --git a/core/images/delete-button.svg b/core/images/delete-button.svg new file mode 100644 index 000000000..24ccc597f --- /dev/null +++ b/core/images/delete-button.svg @@ -0,0 +1,3 @@ + + +Layer 1 diff --git a/core/images/delete-button.svg.meta b/core/images/delete-button.svg.meta new file mode 100644 index 000000000..76a420869 --- /dev/null +++ b/core/images/delete-button.svg.meta @@ -0,0 +1,2 @@ +title: $:/core/images/delete-button.svg +type: image/svg+xml diff --git a/core/images/done-button.svg b/core/images/done-button.svg new file mode 100644 index 000000000..b5e507a86 --- /dev/null +++ b/core/images/done-button.svg @@ -0,0 +1,3 @@ + + +Layer 1 diff --git a/core/images/done-button.svg.meta b/core/images/done-button.svg.meta new file mode 100644 index 000000000..d7f5a19c2 --- /dev/null +++ b/core/images/done-button.svg.meta @@ -0,0 +1,2 @@ +title: $:/core/images/done-button.svg +type: image/svg+xml diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index a71ceb072..b6517bc03 100644 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -34,6 +34,7 @@ NavigatorWidget.prototype.generate = function() { {name: "tw-edit-tiddler", handlerObject: this, handlerMethod: "handleEditTiddlerEvent"}, {name: "tw-delete-tiddler", handlerObject: this, handlerMethod: "handleDeleteTiddlerEvent"}, {name: "tw-save-tiddler", handlerObject: this, handlerMethod: "handleSaveTiddlerEvent"}, + {name: "tw-cancel-tiddler", handlerObject: this, handlerMethod: "handleCancelTiddlerEvent"}, {name: "tw-close-tiddler", handlerObject: this, handlerMethod: "handleCloseTiddlerEvent"}, {name: "tw-new-tiddler", handlerObject: this, handlerMethod: "handleNewTiddlerEvent"} ]; @@ -214,6 +215,32 @@ NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) { return false; }; +// Take a tiddler out of edit mode without saving the changes +NavigatorWidget.prototype.handleCancelTiddlerEvent = function(event) { + this.getStoryList(); + var storyTiddlerModified = false; + for(var t=0; t <$button message="tw-delete-tiddler" class="btn btn-mini btn-success">delete <$button message="tw-save-tiddler" class="btn btn-mini btn-success">done + <$button message="tw-delete-tiddler" class="btn-invisible">{{$:/core/images/delete-button.svg}} <$button message="tw-cancel-tiddler" class="btn-invisible">{{$:/core/images/cancel-button.svg}} <$button message="tw-save-tiddler" class="btn-invisible">{{$:/core/images/done-button.svg}} + +<$view field="title"/> @@.title <$edit field="draft.title"/>