MyShaarli/tpl/myShaarli_Columns/linklist.html

160 lines
7 KiB
HTML
Raw Normal View History

2013-02-26 10:09:41 +01:00
<!DOCTYPE html>
<html>
2015-06-26 12:23:23 +02:00
<head>
{include="includes"}
2015-07-17 11:28:43 +02:00
{if="empty($GLOBALS['disablejquery'])"}
<script src="inc/jquery.min.js#"></script>
<script src="inc/jquery-ui.min.js#"></script>
{/if}
2015-06-26 12:23:23 +02:00
</head>
2015-07-17 11:28:43 +02:00
<body>
<div id="pageheader">
{include="page.header"}
<div id="headerform">
<form method="get" class="searchform" name="searchform">
2015-05-05 14:34:29 +02:00
<input type="text" id="searchform_value" name="searchterm" value="" placeholder="Search text"/>
<input type="submit" value="Search" class="bigbutton"/>
</form>
2015-07-17 11:28:43 +02:00
<form method="get" class="tagfilter" name="tagfilter">
2015-06-26 12:23:23 +02:00
<input type="text" name="searchtags" id="tagfilter_value" value="{loop="search_crits"}{$value|htmlspecialchars} {/loop}" placeholder="Filter by tag"/>
2015-05-05 14:34:29 +02:00
<input type="submit" value="Filter by tag" class="bigbutton"/>
</form>
2015-07-17 11:28:43 +02:00
</div>
2013-09-27 09:38:01 +02:00
</div>
2015-07-17 11:28:43 +02:00
<div id="linklist">
{include="linklist.paging"}
{if="count($links)==0"}
<div id="searchcriteria">
Nothing found.
</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"} <span class="linktag" title="Remove tag"><a href="?removetag={$value|htmlspecialchars}">{$value|htmlspecialchars} <span class="removeTag">x</span></a></span> {/loop}</i>
</div>
{/if}
{/if}
<ul class="linkList">
2013-02-26 10:09:41 +01:00
{loop="links"}
2015-07-17 11:28:43 +02:00
<li {if="$value.class"} class="{$value.class}"{/if} >
<!--<a name="{$value.linkdate|smallHash}" id="{$value.linkdate|smallHash}"></a>-->
{if="$GLOBALS['config']['ENABLE_THUMBNAILS']"}
<div class="thumbnail">
{$value.url|thumbnail}
</div>
{/if}
<div class="linkcontainer {if="$GLOBALS['config']['ENABLE_THUMBNAILS']"}linkcontainerThumb{/if}">
{if="isLoggedIn()"}
<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>
{/if}
<h3 class="linktitle">{function="returnFavicon($value.url)"}<a href="{$redirector}{$value.url|htmlspecialchars}">{$value.title|htmlspecialchars}</a></h3>
{if="$value.description"}
<div class="linkdescription" {if condition="$search_type=='permalink'"}{/if}>
{$value.description}
</div>
{/if}
{if condition="isset($value.via) && !empty($value.via)"}
<div>
<a href="{$value.via}">Origine => {$value.via|getJustDomain}</a>
</div>{/if}
{if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"}
<span class="linkdate linkBottom" title="Permalink"><a href="?{$value.linkdate|smallHash}">{$value.localdate|htmlspecialchars} - permalink</a> - </span>
{else}
<span class="linkdate linkBottom" title="Short link here"><a href="?{$value.linkdate|smallHash}">permalink</a> - </span>
{/if}
2015-07-17 11:28:43 +02:00
<span class="linkarchive linkBottom"><a href="https://web.archive.org/web/{$value.url|htmlspecialchars}">Archive.org</a> - </span>
{if="$GLOBALS['config']['WALLABAG_URL'] && isLoggedIn()"}
<span class="linkWallabag linkBottom"><a href="{$GLOBALS['config']['WALLABAG_URL']}/?plainurl={$value.url|htmlspecialchars}">Save to Wallabag</a> - </span>
{/if}
<span><a href="http://qrfree.kaywa.com/?l=1&amp;s=8&d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}"
onclick="showQrCode(this); return false;" class="qrcode" data-permalink="{$scripturl}?{$value.linkdate|smallHash}"><img src="images/qrcode.png#" title="QR-Code" alt="qrcode logo"></a></span> - <span class="linkurl" title="Short link">{$value.url|htmlspecialchars}</span>
<br>
{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}
2013-02-26 10:09:41 +01:00
</div>
2015-07-17 11:28:43 +02:00
{/if}
</div>
<span class="clearFix">&nbsp;</span>
</li>
{/loop}
</ul>
{include="linklist.paging"}
</div>
{include="page.footer"}
2015-07-17 11:28:43 +02:00
<script>
$('#tagfilter_value').autocomplete({
source : '{$source}?ws=tags',
minLength : 1
});
// Remove any displayed QR-Code
function remove_qrcode() {
var elem = document.getElementById("permalinkQrcode");
if (elem)
elem.parentNode.removeChild(elem);
return false;
}
// Show the QR-Code of a permalink (when the QR-Code icon is clicked).
function showQrCode(caller,loading=false) {
// 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.
2013-09-27 09:38:01 +02:00
{
2015-07-17 11:28:43 +02:00
if (!loading)// If javascript lib is still loading, do not append script to body.
{
2013-09-27 09:38:01 +02:00
var element = document.createElement("script");
element.src = "inc/qr.min.js";
document.body.appendChild(element);
2015-07-17 11:28:43 +02:00
}
setTimeout(function() {
showQrCode(caller, true);
}, 200);
// Retry in 200 milliseconds.
return false;
}
// Remove previous qrcode if present.
remove_qrcode();
// Build the div which contains the QR-Code:
var element = document.createElement('div');
element.id = "permalinkQrcode";
// Make QR-Code div commit sepuku when clicked:
if (element.attachEvent) {
element.attachEvent('onclick', 'this.parentNode.removeChild(this);');
}// Damn IE
else {
element.setAttribute('onclick', 'this.parentNode.removeChild(this);');
}
// Build the QR-Code:
var image = qr.image({
size : 8,
value : caller.dataset.permalink
});
if (image) {
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.";
2013-09-27 09:38:01 +02:00
}
return false;
2015-07-17 11:28:43 +02:00
}
</script>
</body>
2013-09-27 09:38:01 +02:00
</html>