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