1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Update export button to use tiddler title as filename base

This commit is contained in:
Jermolene 2014-11-22 14:19:10 +00:00
parent d6c5e51501
commit e6043b07b9
6 changed files with 12 additions and 8 deletions

View File

@ -1,7 +1,7 @@
title: $:/core/templates/exporters/CsvFile
tags: $:/tags/Exporter
description: {{$:/language/Exporters/CsvFile}}
filename: tiddlers.csv
extension: .csv
\define renderContent()
<$text text=<<csvtiddlers filter:"""$(exportFilter)$""" format:"quoted-comma-sep">>/>

View File

@ -1,7 +1,7 @@
title: $:/core/templates/exporters/JsonFile
tags: $:/tags/Exporter
description: {{$:/language/Exporters/JsonFile}}
filename: tiddlers.json
extension: .json
\define renderContent()
<$text text=<<jsontiddlers filter:"""$(exportFilter)$""">>/>

View File

@ -1,7 +1,7 @@
title: $:/core/templates/exporters/StaticRiver
tags: $:/tags/Exporter
description: {{$:/language/Exporters/StaticRiver}}
filename: static.tiddlers.html
extension: .html
\define tv-wikilink-template() #$uri_encoded$
\define tv-config-toolbar-icons() no

View File

@ -1,7 +1,7 @@
title: $:/core/templates/exporters/TidFile
tags: $:/tags/Exporter
description: {{$:/language/Exporters/TidFile}}
filename: tiddler.tid
extension: .tid
\define renderContent()
{{{ $(exportFilter)$ +[limit[1]] ||$:/core/templates/tid-tiddler}}}

View File

@ -6,4 +6,4 @@ description: {{$:/language/Buttons/ExportTiddler/Hint}}
\define makeExportFilter()
[[$(currentTiddler)$]]
\end
<$macrocall $name="exportButton" exportFilter=<<makeExportFilter>> lingoBase="$:/language/Buttons/ExportTiddler/"/>
<$macrocall $name="exportButton" exportFilter=<<makeExportFilter>> lingoBase="$:/language/Buttons/ExportTiddler/" baseFilename=<<currentTiddler>>/>

View File

@ -1,7 +1,11 @@
title: $:/core/macros/export
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">
<$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]]">
@ -15,9 +19,9 @@ tags: $:/tags/Macro
<$reveal state=<<qualify "$:/state/popup/export">> type="popup" position="below" animate="yes">
<div class="tc-drop-down">
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Exporter]]">
<$set name="filename" value={{!!filename}}>
<$set name="extension" value={{!!extension}}>
<$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">>/>
<$transclude field="description"/>
</$button>