1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-19 11:59:55 +00:00

Added fold/unfold all buttons

More translations, @BramChen, apologies…
This commit is contained in:
Jermolene 2015-08-09 17:25:01 +01:00
parent 4bcf1e298b
commit ac08dc2e35
9 changed files with 78 additions and 4 deletions

View File

@ -0,0 +1,11 @@
title: $:/core/images/fold-all-button
tags: $:/tags/Image
<svg class="tc-image-fold-all tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<rect x="0" y="0" width="128" height="16" rx="8"></rect>
<rect x="0" y="64" width="128" height="16" rx="8"></rect>
<path d="M64.0292774,58.6235628 C61.9791013,58.6242848 59.9275217,57.8435723 58.3632024,56.279253 L35.7458219,33.6618725 C32.6211696,30.5372202 32.6166093,25.4673401 35.7408036,22.3431458 C38.8586409,19.2253085 43.9325646,19.2211982 47.0595304,22.348164 L64.0250749,39.3137085 L80.9906194,22.348164 C84.1152717,19.2235117 89.1851518,19.2189514 92.3093461,22.3431458 C95.4271834,25.460983 95.4312937,30.5349067 92.3043279,33.6618725 L69.6869474,56.279253 C68.1237851,57.8424153 66.0737951,58.6247195 64.0241231,58.6250809 Z" transform="translate(64.024316, 39.313708) scale(1, -1) translate(-64.024316, -39.313708) "></path>
<path d="M64.0292774,123.621227 C61.9791013,123.621949 59.9275217,122.841236 58.3632024,121.276917 L35.7458219,98.6595365 C32.6211696,95.5348842 32.6166093,90.4650041 35.7408036,87.3408098 C38.8586409,84.2229725 43.9325646,84.2188622 47.0595304,87.345828 L64.0250749,104.311373 L80.9906194,87.345828 C84.1152717,84.2211757 89.1851518,84.2166154 92.3093461,87.3408098 C95.4271834,90.458647 95.4312937,95.5325707 92.3043279,98.6595365 L69.6869474,121.276917 C68.1237851,122.840079 66.0737951,123.622383 64.0241231,123.622745 Z" transform="translate(64.024316, 104.311372) scale(1, -1) translate(-64.024316, -104.311372) "></path>
</g>
</svg>

View File

@ -1,7 +1,7 @@
title: $:/core/images/fold-button
tags: $:/tags/Image
<svg class="tc-image-unfold tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<svg class="tc-image-fold tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<rect x="0" y="0" width="128" height="16" rx="8"></rect>
<path d="M64.0292774,63.6235628 C61.9791013,63.6242848 59.9275217,62.8435723 58.3632024,61.279253 L35.7458219,38.6618725 C32.6211696,35.5372202 32.6166093,30.4673401 35.7408036,27.3431458 C38.8586409,24.2253085 43.9325646,24.2211982 47.0595304,27.348164 L64.0250749,44.3137085 L80.9906194,27.348164 C84.1152717,24.2235117 89.1851518,24.2189514 92.3093461,27.3431458 C95.4271834,30.460983 95.4312937,35.5349067 92.3043279,38.6618725 L69.6869474,61.279253 C68.1237851,62.8424153 66.0737951,63.6247195 64.0241231,63.6250809 Z" transform="translate(64.024316, 44.313708) scale(1, -1) translate(-64.024316, -44.313708) "></path>

View File

@ -0,0 +1,11 @@
title: $:/core/images/unfold-all-button
tags: $:/tags/Image
<svg class="tc-image-unfold-all tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<rect x="0" y="0" width="128" height="16" rx="8"></rect>
<rect x="0" y="64" width="128" height="16" rx="8"></rect>
<path d="M85.598226,8.34884273 C84.1490432,6.89863875 82.1463102,6 79.9340286,6 L47.9482224,6 C43.5292967,6 39.9411255,9.581722 39.9411255,14 C39.9411255,18.4092877 43.5260249,22 47.9482224,22 L71.9411255,22 L71.9411255,45.9929031 C71.9411255,50.4118288 75.5228475,54 79.9411255,54 C84.3504132,54 87.9411255,50.4151006 87.9411255,45.9929031 L87.9411255,14.0070969 C87.9411255,11.7964515 87.0447363,9.79371715 85.5956548,8.34412458 Z" transform="translate(63.941125, 30.000000) scale(1, -1) rotate(-45.000000) translate(-63.941125, -30.000000) "></path>
<path d="M85.6571005,72.2899682 C84.2079177,70.8397642 82.2051847,69.9411255 79.9929031,69.9411255 L48.0070969,69.9411255 C43.5881712,69.9411255 40,73.5228475 40,77.9411255 C40,82.3504132 43.5848994,85.9411255 48.0070969,85.9411255 L72,85.9411255 L72,109.934029 C72,114.352954 75.581722,117.941125 80,117.941125 C84.4092877,117.941125 88,114.356226 88,109.934029 L88,77.9482224 C88,75.737577 87.1036108,73.7348426 85.6545293,72.2852501 Z" transform="translate(64.000000, 93.941125) scale(1, -1) rotate(-45.000000) translate(-64.000000, -93.941125) "></path>
</g>
</svg>

View File

@ -1,7 +1,7 @@
title: $:/core/images/unfold-button
tags: $:/tags/Image
<svg class="tc-image-fold tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<svg class="tc-image-unfold tc-image-button" width="22pt" height="22pt" viewBox="0 0 128 128">
<g fill-rule="evenodd">
<rect x="0" y="0" width="128" height="16" rx="8"></rect>
<path d="M85.598226,11.3488427 C84.1490432,9.89863875 82.1463102,9 79.9340286,9 L47.9482224,9 C43.5292967,9 39.9411255,12.581722 39.9411255,17 C39.9411255,21.4092877 43.5260249,25 47.9482224,25 L71.9411255,25 L71.9411255,48.9929031 C71.9411255,53.4118288 75.5228475,57 79.9411255,57 C84.3504132,57 87.9411255,53.4151006 87.9411255,48.9929031 L87.9411255,17.0070969 C87.9411255,14.7964515 87.0447363,12.7937171 85.5956548,11.3441246 Z" transform="translate(63.941125, 33.000000) scale(1, -1) rotate(-45.000000) translate(-63.941125, -33.000000) "></path>

View File

@ -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

View File

@ -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;
})();

View File

@ -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=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-fold-all-tiddlers" $param=<<currentTiddler>> foldedStatePrefix="$:/state/folded/"/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
{{$:/core/images/fold-all-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/FoldAll/Caption}}/></span>
</$list>
</$button>

View File

@ -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=<<tv-config-toolbar-class>>>
<$action-sendmessage $message="tm-unfold-all-tiddlers" $param=<<currentTiddler>> foldedStatePrefix="$:/state/folded/"/>
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]" variable="listItem">
{{$:/core/images/unfold-all-button}}
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/UnfoldAll/Caption}}/></span>
</$list>
</$button>

View File

@ -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]]