aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/linklist.html
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2015-07-15 11:47:12 +0200
committerArthurHoaro <arthur@hoa.ro>2015-11-07 15:27:22 +0100
commit567967fdf94b2b8ba2b2fc9c8836e89ac23c8c71 (patch)
tree6a8b3b2706b253a782a0b094e977524dccdf68da /tpl/linklist.html
parent0aec972a8bee1689ae79a436ae6e4236022b52ef (diff)
downloadShaarli-567967fdf94b2b8ba2b2fc9c8836e89ac23c8c71.tar.gz
Shaarli-567967fdf94b2b8ba2b2fc9c8836e89ac23c8c71.tar.zst
Shaarli-567967fdf94b2b8ba2b2fc9c8836e89ac23c8c71.zip
Template upgrade to handle plugin zones
Add a bunch of plugin placeholders in templates
Diffstat (limited to 'tpl/linklist.html')
-rw-r--r--tpl/linklist.html90
1 files changed, 24 insertions, 66 deletions
diff --git a/tpl/linklist.html b/tpl/linklist.html
index daf87060..9ed28853 100644
--- a/tpl/linklist.html
+++ b/tpl/linklist.html
@@ -17,6 +17,9 @@
17 </datalist> 17 </datalist>
18 <input type="submit" value="Search" class="bigbutton"> 18 <input type="submit" value="Search" class="bigbutton">
19 </form> 19 </form>
20 {loop="$plugins_header.fields_toolbar"}
21 {$value}
22 {/loop}
20 </div> 23 </div>
21</div> 24</div>
22 25
@@ -24,6 +27,12 @@
24 27
25 {include="linklist.paging"} 28 {include="linklist.paging"}
26 29
30 <div id="plugin_zone_start_linklist" class="plugin_zone">
31 {loop="$plugin_start_zone"}
32 {$value}
33 {/loop}
34 </div>
35
27 {if="count($links)==0"} 36 {if="count($links)==0"}
28 <div id="searchcriteria">Nothing found.</i></div> 37 <div id="searchcriteria">Nothing found.</i></div>
29 {else} 38 {else}
@@ -40,7 +49,7 @@
40 <ul> 49 <ul>
41 {loop="links"} 50 {loop="links"}
42 <li{if="$value.class"} class="{$value.class}"{/if}> 51 <li{if="$value.class"} class="{$value.class}"{/if}>
43 <a id="{$value.linkdate|smallHash}"></a> 52 <a id="{$value.shorturl}"></a>
44 <div class="thumbnail">{$value.url|thumbnail}</div> 53 <div class="thumbnail">{$value.url|thumbnail}</div>
45 <div class="linkcontainer"> 54 <div class="linkcontainer">
46 {if="isLoggedIn()"} 55 {if="isLoggedIn()"}
@@ -56,89 +65,38 @@
56 {if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"} 65 {if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"}
57 <span class="linkdate" title="Permalink"><a href="?{$value.linkdate|smallHash}">{function="strftime('%c', $value.timestamp)"} - permalink</a> - </span> 66 <span class="linkdate" title="Permalink"><a href="?{$value.linkdate|smallHash}">{function="strftime('%c', $value.timestamp)"} - permalink</a> - </span>
58 {else} 67 {else}
59 <span class="linkdate" title="Short link here"><a href="?{$value.linkdate|smallHash}">permalink</a> - </span> 68 <span class="linkdate" title="Short link here"><a href="?{$value.shorturl}">permalink</a> - </span>
60 {/if} 69 {/if}
61 {if="$GLOBALS['config']['ARCHIVE_ORG']"} 70
62 <span class="linkarchive"><a href="https://web.archive.org/web/{$value.url}">archive</a> - </span> 71 {loop="$value.link_plugin"}
63 {/if} 72 <span>{$value}</span> -
64 <div class="linkqrcode"><a href="http://qrfree.kaywa.com/?l=1&amp;s=8&amp;d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}" 73 {/loop}
65 onclick="return showQrCode(this);" class="qrcode" data-permalink="{$scripturl}?{$value.linkdate|smallHash}"> 74
66 <img src="images/qrcode.png#" alt="QR-Code" title="{function="strftime('%c', $value.timestamp)"}"></a></div> -
67 <a href="{$value.url}"><span class="linkurl" title="Short link">{$value.url}</span></a><br> 75 <a href="{$value.url}"><span class="linkurl" title="Short link">{$value.url}</span></a><br>
68 {if="$value.tags"} 76 {if="$value.tags"}
69 <div class="linktaglist"> 77 <div class="linktaglist">
70 {loop="value.taglist"}<span class="linktag" title="Add tag"><a href="?addtag={$value|urlencode}">{$value}</a></span> {/loop} 78 {loop="value.taglist"}<span class="linktag" title="Add tag"><a href="?addtag={$value|urlencode}">{$value}</a></span> {/loop}
71 </div> 79 </div>
72 {/if} 80 {/if}
81
82
73 </div> 83 </div>
74 </li> 84 </li>
75 {/loop} 85 {/loop}
76 </ul> 86 </ul>
77 87
88 <div id="plugin_zone_end_linklist" class="plugin_zone">
89 {loop="$plugin_end_zone"}
90 {$value}
91 {/loop}
92 </div>
93
78 {include="linklist.paging"} 94 {include="linklist.paging"}
79 95
80</div> 96</div>
81 97
82 {include="page.footer"} 98 {include="page.footer"}
83 99
84<script>
85// Remove any displayed QR-Code
86function remove_qrcode()
87{
88 var elem = document.getElementById("permalinkQrcode");
89 if (elem) elem.parentNode.removeChild(elem);
90 return false;
91}
92
93function isCanvasSupported(){
94 var elem = document.createElement('canvas');
95 return !!(elem.getContext && elem.getContext('2d'));
96}
97
98// Show the QR-Code of a permalink (when the QR-Code icon is clicked).
99function showQrCode(caller,loading)
100{
101 if( !isCanvasSupported() ) return true;
102
103 // Dynamic javascript lib loading: We only load qr.js if the QR code icon is clicked:
104 if (typeof(qr)=='undefined') // Load qr.js only if not present.
105 {
106 loading = typeof loading !== 'undefined' ? loading : false;
107 if (!loading) // If javascript lib is still loading, do not append script to body.
108 {
109 var element = document.createElement("script");
110 element.src = "inc/qr-1.1.3.min.js";
111 document.body.appendChild(element);
112 }
113 setTimeout(function() { showQrCode(caller,true);}, 200); // Retry in 200 milliseconds.
114 return false;
115 }
116
117 // Remove previous qrcode if present.
118 remove_qrcode();
119
120 // Build the div which contains the QR-Code:
121 var element = document.createElement('div');
122 element.id="permalinkQrcode";
123
124 // Make QR-Code div commit sepuku when clicked:
125 element.addEventListener('click', remove_qrcode ); // Works on every canvas supported browser
126
127 // Build the QR-Code:
128 var image = qr.image({size: 8,value: caller.getAttribute('data-permalink')});
129 if (image)
130 {
131 element.appendChild(image);
132 element.innerHTML+= "<br>Click to close";
133 caller.parentNode.appendChild(element);
134 }
135 else
136 {
137 element.innerHTML="Your browser does not seem to be HTML5 compatible.";
138 }
139 return false;
140}
141</script>
142<script src="inc/awesomplete.min.js#"></script> 100<script src="inc/awesomplete.min.js#"></script>
143</body> 101</body>
144</html> 102</html>