]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - tpl/linklist.html
Plugins TODO.md
[github/shaarli/Shaarli.git] / tpl / linklist.html
CommitLineData
45034273
SS
1<!DOCTYPE html>
2<html>
65d62517
A
3<head>
4 <link type="text/css" rel="stylesheet" href="../inc/awesomplete.css" />
5 {include="includes"}
6</head>
45034273
SS
7<body>
8<div id="pageheader">
af77b2fd 9 {include="page.header"}
c133612f 10 <div id="headerform" class="search">
0923a2bc 11 <form method="GET" class="searchform" name="searchform">
12 <input type="text" tabindex="1" id="searchform_value" name="searchterm" placeholder="Search text" value=""> <input type="submit" value="Search" class="bigbutton"></form>
65d62517 13 <form method="GET" class="tagfilter" name="tagfilter">
0923a2bc 14 <input type="text" tabindex="2" name="searchtags" id="tagfilter_value" placeholder="Filter by tag" value="" list="tagsList" autocomplete="off" class="awesomplete" data-minChars="1">
65d62517
A
15 <datalist id="tagsList">
16 {loop="$tags"}<option>{$key}</option>{/loop}
17 </datalist>
18 <input type="submit" value="Search" class="bigbutton">
19 </form>
af77b2fd 20 </div>
45034273
SS
21</div>
22
23<div id="linklist">
24
25 {include="linklist.paging"}
26
27 {if="count($links)==0"}
28 <div id="searchcriteria">Nothing found.</i></div>
29 {else}
30 {if="$search_type=='fulltext'"}
31 <div id="searchcriteria">{$result_count} results for <i>{$search_crits}</i></div>
32 {/if}
33 {if="$search_type=='tags'"}
34 <div id="searchcriteria">{$result_count} results for tags <i>
35 {loop="search_crits"}
5f85fcd8 36 <span class="linktag" title="Remove tag"><a href="?removetag={$value}">{$value} <span class="remove">x</span></a></span>
45034273
SS
37 {/loop}</i></div>
38 {/if}
39 {/if}
40 <ul>
41 {loop="links"}
42 <li{if="$value.class"} class="{$value.class}"{/if}>
8079dfd1 43 <a id="{$value.linkdate|smallHash}"></a>
45034273
SS
44 <div class="thumbnail">{$value.url|thumbnail}</div>
45 <div class="linkcontainer">
45034273 46 {if="isLoggedIn()"}
b2877611
SS
47 <div class="linkeditbuttons">
48 <form method="GET" class="buttoneditform"><input type="hidden" name="edit_link" value="{$value.linkdate}"><input type="image" alt="Edit" src="images/edit_icon.png#" title="Edit" class="button_edit"></form><br>
49 <form method="POST" class="buttoneditform"><input type="hidden" name="lf_linkdate" value="{$value.linkdate}">
50 <input type="hidden" name="token" value="{$token}"><input type="hidden" name="delete_link"><input type="image" alt="Delete" src="images/delete_icon.png#" title="Delete" class="button_delete" onClick="return confirmDeleteLink();"></form>
51 </div>
45034273 52 {/if}
5f85fcd8 53 <span class="linktitle"><a href="{$redirector}{$value.url}">{$value.title}</a></span>
45034273 54 <br>
c133612f 55 {if="$value.description"}<div class="linkdescription">{$value.description}</div>{/if}
45034273 56 {if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"}
bec18701 57 <span class="linkdate" title="Permalink"><a href="?{$value.linkdate|smallHash}">{function="strftime('%c', $value.timestamp)"} - permalink</a> - </span>
45034273
SS
58 {else}
59 <span class="linkdate" title="Short link here"><a href="?{$value.linkdate|smallHash}">permalink</a> - </span>
60 {/if}
d2f51763 61 {if="$GLOBALS['config']['ARCHIVE_ORG']"}
5f85fcd8 62 <span class="linkarchive"><a href="https://web.archive.org/web/{$value.url}">archive</a> - </span>
d2f51763 63 {/if}
8079dfd1 64 <div class="linkqrcode"><a href="http://qrfree.kaywa.com/?l=1&amp;s=8&amp;d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}"
04751e04 65 onclick="return showQrCode(this);" class="qrcode" data-permalink="{$scripturl}?{$value.linkdate|smallHash}">
bec18701 66 <img src="images/qrcode.png#" alt="QR-Code" title="{function="strftime('%c', $value.timestamp)"}"></a></div> -
5f85fcd8 67 <a href="{$value.url}"><span class="linkurl" title="Short link">{$value.url}</span></a><br>
45034273
SS
68 {if="$value.tags"}
69 <div class="linktaglist">
5f85fcd8 70 {loop="value.taglist"}<span class="linktag" title="Add tag"><a href="?addtag={$value|urlencode}">{$value}</a></span> {/loop}
45034273
SS
71 </div>
72 {/if}
73 </div>
74 </li>
75 {/loop}
76 </ul>
77
78 {include="linklist.paging"}
79
80</div>
81
d741c9fc 82 {include="page.footer"}
af77b2fd 83
8079dfd1 84<script>
af77b2fd
SS
85// Remove any displayed QR-Code
86function remove_qrcode()
d741c9fc 87{
af77b2fd
SS
88 var elem = document.getElementById("permalinkQrcode");
89 if (elem) elem.parentNode.removeChild(elem);
90 return false;
91}
92
fe16b01e
A
93function isCanvasSupported(){
94 var elem = document.createElement('canvas');
95 return !!(elem.getContext && elem.getContext('2d'));
96}
97
af77b2fd 98// Show the QR-Code of a permalink (when the QR-Code icon is clicked).
fe16b01e 99function showQrCode(caller,loading)
d741c9fc 100{
fe16b01e
A
101 if( !isCanvasSupported() ) return true;
102
af77b2fd
SS
103 // Dynamic javascript lib loading: We only load qr.js if the QR code icon is clicked:
104 if (typeof(qr)=='undefined') // Load qr.js only if not present.
105 {
fe16b01e 106 loading = typeof loading !== 'undefined' ? loading : false;
af77b2fd
SS
107 if (!loading) // If javascript lib is still loading, do not append script to body.
108 {
109 var element = document.createElement("script");
8e0ad1d9 110 element.src = "inc/qr-1.1.3.min.js";
af77b2fd
SS
111 document.body.appendChild(element);
112 }
113 setTimeout(function() { showQrCode(caller,true);}, 200); // Retry in 200 milliseconds.
114 return false;
115 }
116
117 // Remove previous qrcode if present.
118 remove_qrcode();
d741c9fc 119
af77b2fd
SS
120 // Build the div which contains the QR-Code:
121 var element = document.createElement('div');
122 element.id="permalinkQrcode";
fe16b01e
A
123
124 // Make QR-Code div commit sepuku when clicked:
125 element.addEventListener('click', remove_qrcode ); // Works on every canvas supported browser
d741c9fc 126
af77b2fd 127 // Build the QR-Code:
fe16b01e 128 var image = qr.image({size: 8,value: caller.getAttribute('data-permalink')});
af77b2fd 129 if (image)
d741c9fc 130 {
af77b2fd
SS
131 element.appendChild(image);
132 element.innerHTML+= "<br>Click to close";
133 caller.parentNode.appendChild(element);
134 }
135 else
136 {
137 element.innerHTML="Your browser does not seem to be HTML5 compatible.";
138 }
139 return false;
140}
45034273 141</script>
65d62517 142<script src="inc/awesomplete.min.js#"></script>
45034273 143</body>
af77b2fd 144</html>