Added first version of QR code generator plugin

This commit is contained in:
Jermolene
2016-10-18 09:23:47 +01:00
parent 7a6d7e2a15
commit 22c1b04ee7
19 changed files with 2018 additions and 1 deletions

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

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

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

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

View 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%;
}