diff --git a/core/images/close-all-button.tid b/core/images/close-all-button.tid new file mode 100644 index 000000000..0d3e0f46d --- /dev/null +++ b/core/images/close-all-button.tid @@ -0,0 +1,15 @@ +title: $:/core/images/close-all-button +tags: $:/tags/Image + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index 9d5c1896a..0317ba1ba 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -8,6 +8,8 @@ Clone/Caption: clone Clone/Hint: Clone this tiddler Close/Caption: close Close/Hint: Close this tiddler +CloseAll/Caption: close all +CloseAll/Hint: Close all tiddlers CloseOthers/Caption: close others CloseOthers/Hint: Close other tiddlers ControlPanel/Caption: control panel diff --git a/core/modules/widgets/checkbox.js b/core/modules/widgets/checkbox.js index 64d4b2389..d13496c95 100644 --- a/core/modules/widgets/checkbox.js +++ b/core/modules/widgets/checkbox.js @@ -87,7 +87,8 @@ CheckboxWidget.prototype.getValue = function() { CheckboxWidget.prototype.handleChangeEvent = function(event) { var checked = this.inputDomNode.checked, tiddler = this.wiki.getTiddler(this.checkboxTitle), - newFields = {title: this.checkboxTitle, text: ""}, + fallbackFields = {text: ""}, + newFields = {title: this.checkboxTitle}, hasChanged = false; // Set the tag if specified if(this.checkboxTag && (!tiddler || tiddler.hasTag(this.checkboxTag) !== checked)) { @@ -110,7 +111,7 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) { } } if(hasChanged) { - this.wiki.addTiddler(new $tw.Tiddler(tiddler,newFields,this.wiki.getModificationFields())); + this.wiki.addTiddler(new $tw.Tiddler(fallbackFields,tiddler,newFields,this.wiki.getModificationFields())); } }; diff --git a/core/ui/PageControls/closeall.tid b/core/ui/PageControls/closeall.tid new file mode 100644 index 000000000..5c5c30b95 --- /dev/null +++ b/core/ui/PageControls/closeall.tid @@ -0,0 +1,12 @@ +title: $:/core/ui/Buttons/close-all +tags: $:/tags/PageControls +caption: {{$:/core/images/close-all-button}} {{$:/language/Buttons/CloseAll/Caption}} + +<$button message="tw-close-all-tiddlers" title={{$:/language/Buttons/CloseAll/Hint}} aria-label={{$:/language/Buttons/CloseAll/Caption}} class=<>> +<$list filter="[prefix[yes]]"> +{{$:/core/images/close-all-button}} + +<$list filter="[prefix[yes]]"> +<$text text={{$:/language/Buttons/CloseAll/Caption}}/> + + diff --git a/core/wiki/config/PageControlButtons.multids b/core/wiki/config/PageControlButtons.multids index 7d80b6d44..76bfbbfe7 100644 --- a/core/wiki/config/PageControlButtons.multids +++ b/core/wiki/config/PageControlButtons.multids @@ -3,3 +3,4 @@ title: $:/config/PageControlButtons/Visibility/$:/ core/ui/Buttons/encryption: hide core/ui/Buttons/home: hide core/ui/Buttons/permaview: hide +core/ui/Buttons/close-all: hide