mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-03 07:06:52 +00:00
Added first version of QR code generator plugin
This commit is contained in:
53
plugins/tiddlywiki/qrcode/ViewToolbarButton/Button.tid
Normal file
53
plugins/tiddlywiki/qrcode/ViewToolbarButton/Button.tid
Normal file
@@ -0,0 +1,53 @@
|
||||
title: $:/plugins/tiddlywiki/qrcode/ViewToolbarButton
|
||||
tags: $:/tags/ViewToolbar
|
||||
caption: {{$:/plugins/tiddlywiki/qrcode/icon}}
|
||||
short-caption: QR code
|
||||
description: Generate QR code for this tiddler
|
||||
|
||||
<span class="tc-popup-keep">
|
||||
<$button popup=<<qualify "$:/state/popup/qrcode">> tooltip={{$:/plugins/tiddlywiki/qrcode/ViewToolbarButton!!description}} aria-label={{$:/plugins/tiddlywiki/qrcode/ViewToolbarButton!!short-caption}} class=<<tv-config-toolbar-class>> class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
|
||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
|
||||
{{$:/plugins/tiddlywiki/qrcode/icon}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
|
||||
<span class="tc-btn-text"><$text text={{$:/plugins/tiddlywiki/qrcode/ViewToolbarButton!!short-caption}}/></span>
|
||||
</$list>
|
||||
</$button>
|
||||
</span>
|
||||
<$reveal state=<<qualify "$:/state/popup/qrcode">> type="popup" position="below" animate="yes">
|
||||
|
||||
<div class="tc-drop-down">
|
||||
|
||||
{{$:/plugins/tiddlywiki/qrcode/ViewToolbarButton||description}}
|
||||
|
||||
<$set name="tv-config-toolbar-icons" value="yes">
|
||||
|
||||
<$set name="tv-config-toolbar-text" value="yes">
|
||||
|
||||
<$set name="tv-config-toolbar-class" value="tc-btn-invisible">
|
||||
|
||||
<$set name="targetTiddler" value=<<currentTiddler>>>
|
||||
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbarButton/QRcode]!has[draft.of]]">
|
||||
|
||||
<$button popup=<<qualify "$:/state/popup/qrcode/type">> class="tc-btn-invisible" selectedClass="tc-selected">
|
||||
|
||||
<$action-sendmessage $message="tm-modal" $param=<<currentTiddler>> currentTiddler=<<targetTiddler>>/>
|
||||
|
||||
<$transclude field="caption" mode="inline"/>
|
||||
|
||||
</$button>
|
||||
|
||||
</$list>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</div>
|
||||
|
||||
</$reveal>
|
||||
12
plugins/tiddlywiki/qrcode/ViewToolbarButton/Raw.tid
Normal file
12
plugins/tiddlywiki/qrcode/ViewToolbarButton/Raw.tid
Normal file
@@ -0,0 +1,12 @@
|
||||
title: $:/plugins/tiddlywiki/qrcode/ViewToolbarButton/Raw
|
||||
tags: $:/tags/ViewToolbarButton/QRcode
|
||||
caption: Raw content of this tiddler
|
||||
subtitle: QR code of raw tiddler content
|
||||
|
||||
\define image()
|
||||
<img src=<<makeqr text:"""$(content)$""" size:"350">>/>
|
||||
\end
|
||||
|
||||
<$set name="content" value={{!!text}}>
|
||||
<<image>>
|
||||
</$set>
|
||||
12
plugins/tiddlywiki/qrcode/ViewToolbarButton/Rendered.tid
Normal file
12
plugins/tiddlywiki/qrcode/ViewToolbarButton/Rendered.tid
Normal file
@@ -0,0 +1,12 @@
|
||||
title: $:/plugins/tiddlywiki/qrcode/ViewToolbarButton/Rendered
|
||||
tags: $:/tags/ViewToolbarButton/QRcode
|
||||
caption: Rendered content of this tiddler
|
||||
subtitle: QR code of rendered tiddler content
|
||||
|
||||
\define image()
|
||||
<img src=<<makeqr text:"""$(content)$""" size:"350">>/>
|
||||
\end
|
||||
|
||||
<$wikify name="content" text={{!!text}} type="text" mode="block" output="formattedtext">
|
||||
<<image>>
|
||||
</$wikify>
|
||||
14
plugins/tiddlywiki/qrcode/ViewToolbarButton/URL.tid
Normal file
14
plugins/tiddlywiki/qrcode/ViewToolbarButton/URL.tid
Normal file
@@ -0,0 +1,14 @@
|
||||
title: $:/plugins/tiddlywiki/qrcode/ViewToolbarButton/URL
|
||||
tags: $:/tags/ViewToolbarButton/QRcode
|
||||
caption: URL of this tiddler
|
||||
subtitle: QR code of URL of this tiddler
|
||||
|
||||
\define image()
|
||||
<img src=<<makeqr text:"""$(url)$#$(hash)$""" size:"350">>/>
|
||||
\end
|
||||
|
||||
<$set name="url" value={{$:/info/url/full}}>
|
||||
<$set name="hash" filter="[<currentTiddler>encodeuricomponent[]]" select="0">
|
||||
<<image>>
|
||||
</$set>
|
||||
</$set>
|
||||
9
plugins/tiddlywiki/qrcode/ViewToolbarButton/styles.tid
Normal file
9
plugins/tiddlywiki/qrcode/ViewToolbarButton/styles.tid
Normal file
@@ -0,0 +1,9 @@
|
||||
title: $:/plugins/tiddlywiki/qrcode/styles
|
||||
tags: [[$:/tags/Stylesheet]]
|
||||
|
||||
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline
|
||||
|
||||
.tc-drop-down .tc-qrcode-drop-down img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
Reference in New Issue
Block a user