mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-04 11:02:51 +00:00
Update export button to use tiddler title as filename base
This commit is contained in:
parent
d6c5e51501
commit
e6043b07b9
@ -1,7 +1,7 @@
|
|||||||
title: $:/core/templates/exporters/CsvFile
|
title: $:/core/templates/exporters/CsvFile
|
||||||
tags: $:/tags/Exporter
|
tags: $:/tags/Exporter
|
||||||
description: {{$:/language/Exporters/CsvFile}}
|
description: {{$:/language/Exporters/CsvFile}}
|
||||||
filename: tiddlers.csv
|
extension: .csv
|
||||||
|
|
||||||
\define renderContent()
|
\define renderContent()
|
||||||
<$text text=<<csvtiddlers filter:"""$(exportFilter)$""" format:"quoted-comma-sep">>/>
|
<$text text=<<csvtiddlers filter:"""$(exportFilter)$""" format:"quoted-comma-sep">>/>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
title: $:/core/templates/exporters/JsonFile
|
title: $:/core/templates/exporters/JsonFile
|
||||||
tags: $:/tags/Exporter
|
tags: $:/tags/Exporter
|
||||||
description: {{$:/language/Exporters/JsonFile}}
|
description: {{$:/language/Exporters/JsonFile}}
|
||||||
filename: tiddlers.json
|
extension: .json
|
||||||
|
|
||||||
\define renderContent()
|
\define renderContent()
|
||||||
<$text text=<<jsontiddlers filter:"""$(exportFilter)$""">>/>
|
<$text text=<<jsontiddlers filter:"""$(exportFilter)$""">>/>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
title: $:/core/templates/exporters/StaticRiver
|
title: $:/core/templates/exporters/StaticRiver
|
||||||
tags: $:/tags/Exporter
|
tags: $:/tags/Exporter
|
||||||
description: {{$:/language/Exporters/StaticRiver}}
|
description: {{$:/language/Exporters/StaticRiver}}
|
||||||
filename: static.tiddlers.html
|
extension: .html
|
||||||
|
|
||||||
\define tv-wikilink-template() #$uri_encoded$
|
\define tv-wikilink-template() #$uri_encoded$
|
||||||
\define tv-config-toolbar-icons() no
|
\define tv-config-toolbar-icons() no
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
title: $:/core/templates/exporters/TidFile
|
title: $:/core/templates/exporters/TidFile
|
||||||
tags: $:/tags/Exporter
|
tags: $:/tags/Exporter
|
||||||
description: {{$:/language/Exporters/TidFile}}
|
description: {{$:/language/Exporters/TidFile}}
|
||||||
filename: tiddler.tid
|
extension: .tid
|
||||||
|
|
||||||
\define renderContent()
|
\define renderContent()
|
||||||
{{{ $(exportFilter)$ +[limit[1]] ||$:/core/templates/tid-tiddler}}}
|
{{{ $(exportFilter)$ +[limit[1]] ||$:/core/templates/tid-tiddler}}}
|
||||||
|
@ -6,4 +6,4 @@ description: {{$:/language/Buttons/ExportTiddler/Hint}}
|
|||||||
\define makeExportFilter()
|
\define makeExportFilter()
|
||||||
[[$(currentTiddler)$]]
|
[[$(currentTiddler)$]]
|
||||||
\end
|
\end
|
||||||
<$macrocall $name="exportButton" exportFilter=<<makeExportFilter>> lingoBase="$:/language/Buttons/ExportTiddler/"/>
|
<$macrocall $name="exportButton" exportFilter=<<makeExportFilter>> lingoBase="$:/language/Buttons/ExportTiddler/" baseFilename=<<currentTiddler>>/>
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
title: $:/core/macros/export
|
title: $:/core/macros/export
|
||||||
tags: $:/tags/Macro
|
tags: $:/tags/Macro
|
||||||
|
|
||||||
\define exportButton(exportFilter:"[!is[system]sort[title]]",lingoBase)
|
\define exportButtonFilename(baseFilename)
|
||||||
|
$baseFilename$$(extension)$
|
||||||
|
\end
|
||||||
|
|
||||||
|
\define exportButton(exportFilter:"[!is[system]sort[title]]",lingoBase,baseFilename:"tiddlers")
|
||||||
<span class="tc-popup-keep">
|
<span class="tc-popup-keep">
|
||||||
<$button popup=<<qualify "$:/state/popup/export">> tooltip={{$lingoBase$Hint}} aria-label={{$lingoBase$Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
|
<$button popup=<<qualify "$:/state/popup/export">> tooltip={{$lingoBase$Hint}} aria-label={{$lingoBase$Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
|
||||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
|
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
|
||||||
@ -15,9 +19,9 @@ tags: $:/tags/Macro
|
|||||||
<$reveal state=<<qualify "$:/state/popup/export">> type="popup" position="below" animate="yes">
|
<$reveal state=<<qualify "$:/state/popup/export">> type="popup" position="below" animate="yes">
|
||||||
<div class="tc-drop-down">
|
<div class="tc-drop-down">
|
||||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Exporter]]">
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Exporter]]">
|
||||||
<$set name="filename" value={{!!filename}}>
|
<$set name="extension" value={{!!extension}}>
|
||||||
<$button class="tc-btn-invisible">
|
<$button class="tc-btn-invisible">
|
||||||
<$action-sendmessage $message="tm-download-file" $param=<<currentTiddler>> exportFilter="""$exportFilter$""" filename=<<filename>>/>
|
<$action-sendmessage $message="tm-download-file" $param=<<currentTiddler>> exportFilter="""$exportFilter$""" filename=<<exportButtonFilename """$baseFilename$""">>/>
|
||||||
<$action-deletetiddler $tiddler=<<qualify "$:/state/popup/export">>/>
|
<$action-deletetiddler $tiddler=<<qualify "$:/state/popup/export">>/>
|
||||||
<$transclude field="description"/>
|
<$transclude field="description"/>
|
||||||
</$button>
|
</$button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user