linklist.html 5.9 KB

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