forked from LinHQ1999/tw-backlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
backlink.tid
56 lines (53 loc) · 2.18 KB
/
backlink.tid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
title: $:/plugins/LinHQ/backlink/backlink
tags: $:/tags/ViewTemplate
type: text/vnd.tiddlywiki
list-after: $:/core/ui/ViewTemplate/body
<!-- [!is[system]search:text:word[{{$(currentTiddler)$}}]] [is[current]backlinks[]] +[unique[]] -->
\define exmatcher()
[!is[system]search:text:literal<currentTiddler>] -[<currentTiddler>] +[unique[]]
\end
\define shouldMatch()
[is[current]!is[system]]
\end
<$list filter=<<shouldMatch>>>
<$let extend=<<qualify "$:/state/backlink/ex">> foldall=<<qualify "$:/state/backlink/foldall">> curr=
<<currentTiddler>>>
<div class="bk-container">
<div class="bk-buttons">
<$reveal type="match" state=<<foldall>> text="yes">
<$button>
Overview
<$action-deletetiddler $tiddler=<<foldall>>/>
</$button>
</$reveal>
<$reveal type="nomatch" state=<<foldall>> text="yes">
<$button set=<<foldall>> setTo="yes">
Preview
</$button>
</$reveal>
<!-- 显示发现就不显示反链了 -->
<$reveal type="nomatch" state=<<extend>> text="yes">
<$button set=<<extend>> setTo="yes">
Linked
</$button>
</$reveal>
<$reveal type="match" state=<<extend>> text="yes">
<$button>
<!-- 避免膨胀 -->
<$action-deletetiddler $tiddler=<<extend>>/>
Global
</$button>
</$reveal>
</div>
<div class="bk-section">
<$reveal type="nomatch" state=<<extend>> text="yes">
<$list template="$:/plugins/LinHQ/backlink/templates/item"
filter="[is[current]backlinks[]]" />
</$reveal>
<$reveal type="match" state=<<extend>> text="yes">
<$list template="$:/plugins/LinHQ/backlink/templates/item" filter=<<exmatcher>> />
</$reveal>
</div>
</div>
</$let>
</$list>