2013-02-26 10:09:41 +01:00
<!DOCTYPE html>
< html >
< head > {include="includes"}< / head >
< body >
< div id = "pageheader" >
2013-09-25 15:17:09 +02:00
{include="page.header"}
2014-12-02 21:00:52 +01:00
< div id = "headerform" class = "search" >
2015-03-16 16:13:04 +01:00
< 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 >
< 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 >
2013-09-25 15:17:09 +02:00
< / div >
2013-02-26 10:09:41 +01:00
< / div >
< div id = "linklist" >
{include="linklist.paging"}
{if="count($links)==0"}
< div id = "searchcriteria" > Nothing found.< / i > < / div >
{else}
{if="$search_type=='fulltext'"}
< div id = "searchcriteria" > {$result_count} results for < i > {$search_crits}< / i > < / div >
{/if}
{if="$search_type=='tags'"}
< div id = "searchcriteria" > {$result_count} results for tags < i >
{loop="search_crits"}
2014-12-02 21:00:52 +01:00
< span class = "linktag" title = "Remove tag" > < a href = "?removetag={$value|htmlspecialchars}" > {$value|htmlspecialchars} < span class = "remove" > x< / span > < / a > < / span >
2013-02-26 10:09:41 +01:00
{/loop}< / i > < / div >
{/if}
{/if}
< ul >
{loop="links"}
< li { if = "$value.class" } class = "{$value.class}" { / if } >
2014-12-12 17:01:02 +01:00
< a id = "{$value.linkdate|smallHash}" > < / a >
2013-02-26 10:09:41 +01:00
< div class = "thumbnail" > {$value.url|thumbnail}< / div >
< div class = "linkcontainer" >
{if="isLoggedIn()"}
2013-02-27 17:46:45 +01:00
< div class = "linkeditbuttons" >
< 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 >
< form method = "POST" class = "buttoneditform" > < input type = "hidden" name = "lf_linkdate" value = "{$value.linkdate}" >
< 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 >
< / div >
2013-02-26 10:09:41 +01:00
{/if}
2013-03-03 22:15:38 +01:00
< span class = "linktitle" > < a href = "{$redirector}{$value.url|htmlspecialchars}" > {$value.title|htmlspecialchars}< / a > < / span >
2013-02-26 10:09:41 +01:00
< br >
2014-12-02 21:00:52 +01:00
{if="$value.description"}< div class = "linkdescription" > {$value.description}< / div > {/if}
2013-02-26 10:09:41 +01:00
{if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"}
2015-03-12 21:57:19 +01:00
< span class = "linkdate" title = "Permalink" > < a href = "?{$value.linkdate|smallHash}" > {function="strftime('%c', $value.timestamp)"} - permalink< / a > - < / span >
2013-02-26 10:09:41 +01:00
{else}
< span class = "linkdate" title = "Short link here" > < a href = "?{$value.linkdate|smallHash}" > permalink< / a > - < / span >
{/if}
2014-11-08 18:19:52 +01:00
{if="$GLOBALS['config']['ARCHIVE_ORG']"}
2014-11-02 15:29:39 +01:00
< span class = "linkarchive" > < a href = "https://web.archive.org/web/{$value.url|htmlspecialchars}" > archive< / a > - < / span >
2014-11-08 18:19:52 +01:00
{/if}
2014-12-12 17:01:02 +01:00
< div class = "linkqrcode" > < a href = "http://qrfree.kaywa.com/?l=1&s=8&d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}"
2015-01-20 02:35:52 +01:00
onclick="return showQrCode(this);" class="qrcode" data-permalink="{$scripturl}?{$value.linkdate|smallHash}">
2015-03-12 21:57:19 +01:00
< img src = "images/qrcode.png#" alt = "QR-Code" title = "{function=" strftime ( ' % c ' , $ value . timestamp ) " } " > < / a > < / div > -
2014-12-12 17:01:02 +01:00
< a href = "{$value.url|htmlspecialchars}" > < span class = "linkurl" title = "Short link" > {$value.url|htmlspecialchars}< / span > < / a > < br >
2013-02-26 10:09:41 +01:00
{if="$value.tags"}
< div class = "linktaglist" >
{loop="value.taglist"}< span class = "linktag" title = "Add tag" > < a href = "?addtag={$value|urlencode}" > {$value|htmlspecialchars}< / a > < / span > {/loop}
< / div >
{/if}
< / div >
< / li >
{/loop}
< / ul >
{include="linklist.paging"}
< / div >
2014-11-21 19:43:53 +01:00
{include="page.footer"}
2013-09-25 15:17:09 +02:00
2014-12-12 17:01:02 +01:00
< script >
2013-09-25 15:17:09 +02:00
// Remove any displayed QR-Code
function remove_qrcode()
2014-11-21 19:43:53 +01:00
{
2013-09-25 15:17:09 +02:00
var elem = document.getElementById("permalinkQrcode");
if (elem) elem.parentNode.removeChild(elem);
return false;
}
2015-01-08 15:09:46 +01:00
function isCanvasSupported(){
var elem = document.createElement('canvas');
return !!(elem.getContext & & elem.getContext('2d'));
}
2013-09-25 15:17:09 +02:00
// Show the QR-Code of a permalink (when the QR-Code icon is clicked).
2015-01-08 15:09:46 +01:00
function showQrCode(caller,loading)
2014-11-21 19:43:53 +01:00
{
2015-01-08 15:09:46 +01:00
if( !isCanvasSupported() ) return true;
2013-09-25 15:17:09 +02:00
// Dynamic javascript lib loading: We only load qr.js if the QR code icon is clicked:
if (typeof(qr)=='undefined') // Load qr.js only if not present.
{
2015-01-08 15:09:46 +01:00
loading = typeof loading !== 'undefined' ? loading : false;
2013-09-25 15:17:09 +02:00
if (!loading) // If javascript lib is still loading, do not append script to body.
{
var element = document.createElement("script");
2015-01-09 12:41:52 +01:00
element.src = "inc/qr-1.1.3.min.js";
2013-09-25 15:17:09 +02:00
document.body.appendChild(element);
}
setTimeout(function() { showQrCode(caller,true);}, 200); // Retry in 200 milliseconds.
return false;
}
// Remove previous qrcode if present.
remove_qrcode();
2014-11-21 19:43:53 +01:00
2013-09-25 15:17:09 +02:00
// Build the div which contains the QR-Code:
var element = document.createElement('div');
element.id="permalinkQrcode";
2015-01-08 15:09:46 +01:00
// Make QR-Code div commit sepuku when clicked:
element.addEventListener('click', remove_qrcode ); // Works on every canvas supported browser
2014-11-21 19:43:53 +01:00
2013-09-25 15:17:09 +02:00
// Build the QR-Code:
2015-01-08 15:09:46 +01:00
var image = qr.image({size: 8,value: caller.getAttribute('data-permalink')});
2013-09-25 15:17:09 +02:00
if (image)
2014-11-21 19:43:53 +01:00
{
2013-09-25 15:17:09 +02:00
element.appendChild(image);
element.innerHTML+= "< br > Click to close";
caller.parentNode.appendChild(element);
}
else
{
element.innerHTML="Your browser does not seem to be HTML5 compatible.";
}
return false;
}
2013-02-26 10:09:41 +01:00
< / script >
< / body >
2013-09-25 15:17:09 +02:00
< / html >