Added a link to the visible URL in the link list
Corrected CSS to prevent a line from showing underneath Fixes https://github.com/shaarli/Shaarli/issues/53
This commit is contained in:
parent
732e683bda
commit
d741c9fc16
2 changed files with 36 additions and 32 deletions
|
@ -51,9 +51,9 @@
|
|||
{if="$GLOBALS['config']['ARCHIVE_ORG']"}
|
||||
<span class="linkarchive"><a href="https://web.archive.org/web/{$value.url|htmlspecialchars}">archive</a> - </span>
|
||||
{/if}
|
||||
<div style="position:relative;display:inline;"><a href="http://qrfree.kaywa.com/?l=1&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#" width="13" height="13" title="QR-Code"></a></div> -
|
||||
<span class="linkurl" title="Short link">{$value.url|htmlspecialchars}</span><br>
|
||||
<div style="position:relative;display:inline;"><a href="http://qrfree.kaywa.com/?l=1&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#" width="13" height="13" title="QR-Code"></a></div> -
|
||||
<a href={$value.url|htmlspecialchars}><span class="linkurl" title="Short link">{$value.url|htmlspecialchars}</span></a><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}
|
||||
|
@ -68,12 +68,12 @@
|
|||
|
||||
</div>
|
||||
|
||||
{include="page.footer"}
|
||||
{include="page.footer"}
|
||||
|
||||
<script language="JavaScript">
|
||||
// Remove any displayed QR-Code
|
||||
function remove_qrcode()
|
||||
{
|
||||
{
|
||||
var elem = document.getElementById("permalinkQrcode");
|
||||
if (elem) elem.parentNode.removeChild(elem);
|
||||
return false;
|
||||
|
@ -81,7 +81,7 @@ function remove_qrcode()
|
|||
|
||||
// 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.
|
||||
{
|
||||
|
@ -97,18 +97,18 @@ function showQrCode(caller,loading=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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue