diff --git a/core/images/fold-all-button.tid b/core/images/fold-all-button.tid new file mode 100644 index 000000000..c74ae421a --- /dev/null +++ b/core/images/fold-all-button.tid @@ -0,0 +1,11 @@ +title: $:/core/images/fold-all-button +tags: $:/tags/Image + + + + + + + + + \ No newline at end of file diff --git a/core/images/fold-button.tid b/core/images/fold-button.tid index e497e9831..190e61d64 100644 --- a/core/images/fold-button.tid +++ b/core/images/fold-button.tid @@ -1,7 +1,7 @@ title: $:/core/images/fold-button tags: $:/tags/Image - + diff --git a/core/images/unfold-all-button.tid b/core/images/unfold-all-button.tid new file mode 100644 index 000000000..29f217b94 --- /dev/null +++ b/core/images/unfold-all-button.tid @@ -0,0 +1,11 @@ +title: $:/core/images/unfold-all-button +tags: $:/tags/Image + + + + + + + + + \ No newline at end of file diff --git a/core/images/unfold-button.tid b/core/images/unfold-button.tid index 42a5ea335..bd4e9036d 100644 --- a/core/images/unfold-button.tid +++ b/core/images/unfold-button.tid @@ -1,7 +1,7 @@ title: $:/core/images/unfold-button tags: $:/tags/Image - + diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index 01feb8410..817573e9a 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -36,6 +36,10 @@ Unfold/Caption: unfold tiddler Unfold/Hint: Unfold the body of this tiddler FoldOthers/Caption: fold other tiddlers FoldOthers/Hint: Fold the bodies of other opened tiddlers +FoldAll/Caption: fold all tiddlers +FoldAll/Hint: Fold the bodies of all opened tiddlers +UnfoldAll/Caption: unfold all tiddlers +UnfoldAll/Hint: Unfold the bodies of all opened tiddlers FullScreen/Caption: full-screen FullScreen/Hint: Enter or leave full-screen mode Help/Caption: help diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index 51152e9fb..0706e5191 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -31,7 +31,9 @@ var NavigatorWidget = function(parseTreeNode,options) { {type: "tm-import-tiddlers", handler: "handleImportTiddlersEvent"}, {type: "tm-perform-import", handler: "handlePerformImportEvent"}, {type: "tm-fold-tiddler", handler: "handleFoldTiddlerEvent"}, - {type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"} + {type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"}, + {type: "tm-fold-all-tiddlers", handler: "handleFoldAllTiddlersEvent"}, + {type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"} ]); }; @@ -589,6 +591,24 @@ NavigatorWidget.prototype.handleFoldOtherTiddlersEvent = function(event) { }); }; +NavigatorWidget.prototype.handleFoldAllTiddlersEvent = function(event) { + var self = this, + paramObject = event.paramObject || {}, + prefix = paramObject.foldedStatePrefix; + $tw.utils.each(this.getStoryList(),function(title) { + self.wiki.setText(prefix + title,"text",null,"hide"); + }); +}; + +NavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) { + var self = this, + paramObject = event.paramObject || {}, + prefix = paramObject.foldedStatePrefix; + $tw.utils.each(this.getStoryList(),function(title) { + self.wiki.setText(prefix + title,"text",null,"show"); + }); +}; + exports.navigator = NavigatorWidget; })(); diff --git a/core/ui/PageControls/fold-all.tid b/core/ui/PageControls/fold-all.tid new file mode 100644 index 000000000..f5ce98698 --- /dev/null +++ b/core/ui/PageControls/fold-all.tid @@ -0,0 +1,14 @@ +title: $:/core/ui/Buttons/fold-all +tags: $:/tags/PageControls +caption: {{$:/core/images/fold-all-button}} {{$:/language/Buttons/FoldAll/Caption}} +description: {{$:/language/Buttons/FoldAll/Hint}} + +<$button tooltip={{$:/language/Buttons/FoldAll/Hint}} aria-label={{$:/language/Buttons/FoldAll/Caption}} class=<>> +<$action-sendmessage $message="tm-fold-all-tiddlers" $param=<> foldedStatePrefix="$:/state/folded/"/> +<$list filter="[prefix[yes]]" variable="listItem"> +{{$:/core/images/fold-all-button}} + +<$list filter="[prefix[yes]]"> +<$text text={{$:/language/Buttons/FoldAll/Caption}}/> + + \ No newline at end of file diff --git a/core/ui/PageControls/unfold-all.tid b/core/ui/PageControls/unfold-all.tid new file mode 100644 index 000000000..21185cb64 --- /dev/null +++ b/core/ui/PageControls/unfold-all.tid @@ -0,0 +1,14 @@ +title: $:/core/ui/Buttons/unfold-all +tags: $:/tags/PageControls +caption: {{$:/core/images/unfold-all-button}} {{$:/language/Buttons/UnfoldAll/Caption}} +description: {{$:/language/Buttons/UnfoldAll/Hint}} + +<$button tooltip={{$:/language/Buttons/UnfoldAll/Hint}} aria-label={{$:/language/Buttons/UnfoldAll/Caption}} class=<>> +<$action-sendmessage $message="tm-unfold-all-tiddlers" $param=<> foldedStatePrefix="$:/state/folded/"/> +<$list filter="[prefix[yes]]" variable="listItem"> +{{$:/core/images/unfold-all-button}} + +<$list filter="[prefix[yes]]"> +<$text text={{$:/language/Buttons/UnfoldAll/Caption}}/> + + \ No newline at end of file diff --git a/core/wiki/tags/PageControls.tid b/core/wiki/tags/PageControls.tid index bfea33aa2..9ed29e911 100644 --- a/core/wiki/tags/PageControls.tid +++ b/core/wiki/tags/PageControls.tid @@ -1,2 +1,2 @@ title: $:/tags/PageControls -list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/palette]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]] +list: [[$:/core/ui/Buttons/home]] [[$:/core/ui/Buttons/close-all]] [[$:/core/ui/Buttons/fold-all]] [[$:/core/ui/Buttons/unfold-all]] [[$:/core/ui/Buttons/permaview]] [[$:/core/ui/Buttons/new-tiddler]] [[$:/core/ui/Buttons/new-journal]] [[$:/core/ui/Buttons/import]] [[$:/core/ui/Buttons/export-page]] [[$:/core/ui/Buttons/control-panel]] [[$:/core/ui/Buttons/advanced-search]] [[$:/core/ui/Buttons/tag-manager]] [[$:/core/ui/Buttons/language]] [[$:/core/ui/Buttons/palette]] [[$:/core/ui/Buttons/theme]] [[$:/core/ui/Buttons/storyview]] [[$:/core/ui/Buttons/encryption]] [[$:/core/ui/Buttons/full-screen]] [[$:/core/ui/Buttons/save-wiki]] [[$:/core/ui/Buttons/refresh]] [[$:/core/ui/Buttons/more-page-actions]]