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