Skip to content

Commit cf8a94f

Browse files
committed
Mise à jour de compatibilité avec Shaarli 0.6.3
* prise en charge du gestionnaire de plugin * ajout de la page 404
1 parent 9f87f44 commit cf8a94f

File tree

8 files changed

+364
-13
lines changed

8 files changed

+364
-13
lines changed

404.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
{include="includes"}
5+
</head>
6+
<body>
7+
<div id="pageheader">
8+
{include="page.header"}
9+
</div>
10+
<div id="am-container">
11+
<div class="error-container">
12+
<h1>404 Not found <small>Oh crap!</small></h1>
13+
<p>{$error_message}</p>
14+
<p>Would you mind <a href="?">clicking here</a>?</p>
15+
</div>
16+
</div>
17+
{include="page.footer"}
18+
</body>
19+
</html>

daily.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{/if}
3030

3131
<div class="paging_rss">
32-
<a href="?do=dailyrss" class="nomobile" title="daily rss feed"><img class="glyphicon" alt="rss" src="inc/img/feed-icon-fa.png" title="rss feed"></a>
32+
<a href="?do=dailyrss" class="nomobile" title="daily rss feed"><img class="glyphicon" alt="daily rss" src="inc/img/feed-icon-fa.png" title="daily rss feed"></a>
3333
</div>
3434
</div>
3535
</div>

inc/albinomouse.css

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,82 @@ ul.errors {
10591059
float: left;
10601060
}
10611061

1062+
/* Pluginadmin */
1063+
1064+
#pluginsadmin {
1065+
width: 80%;
1066+
padding: 20px 0 0 20px;
1067+
}
1068+
1069+
#pluginsadmin section {
1070+
padding: 20px 0;
1071+
}
1072+
1073+
#pluginsadmin .plugin_parameters {
1074+
margin: 10px 0;
1075+
}
1076+
1077+
#pluginsadmin h1 {
1078+
font-style: normal;
1079+
}
1080+
1081+
#pluginsadmin h2 {
1082+
font-size: 1.4em;
1083+
font-weight: bold;
1084+
}
1085+
1086+
#pluginsadmin table {
1087+
width: 100%;
1088+
}
1089+
1090+
#pluginsadmin table, #pluginsadmin th, #pluginsadmin td {
1091+
border-width: 1px 0;
1092+
border-style: solid;
1093+
border-color: #c0c0c0;
1094+
}
1095+
1096+
#pluginsadmin table th {
1097+
font-weight: bold;
1098+
padding: 10px 0;
1099+
}
1100+
1101+
#pluginsadmin table td {
1102+
padding: 5px 0;
1103+
}
1104+
1105+
#pluginsadmin input[type=submit] {
1106+
margin: 10px 0;
1107+
}
1108+
1109+
#pluginsadmin .plugin_parameter {
1110+
padding: 5px 0;
1111+
border-width: 1px 0;
1112+
border-style: solid;
1113+
border-color: #c0c0c0;
1114+
}
1115+
1116+
#pluginsadmin .float_label {
1117+
float: left;
1118+
width: 20%;
1119+
}
1120+
1121+
#pluginsadmin a {
1122+
color: black;
1123+
}
1124+
1125+
/* 404 page */
1126+
.error-container {
1127+
1128+
margin: 50px;
1129+
margin-top: 20px;
1130+
}
1131+
1132+
.error-container h1 {
1133+
text-decoration: none;
1134+
font-style: normal;
1135+
color: #C93030;
1136+
}
1137+
10621138
/* ---------------------- Responsive Albinomouse Template --------------------------------------------------*/
10631139

10641140
@media handheld, only screen and (max-width: 480px), only screen and (max-device-width: 854px) {

inc/plugin_admin.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
* Change the position counter of a row.
3+
*
4+
* @param elem Element Node to change.
5+
* @param toPos int New position.
6+
*/
7+
function changePos(elem, toPos)
8+
{
9+
var elemName = elem.getAttribute('data-line')
10+
11+
elem.setAttribute('data-order', toPos);
12+
var hiddenInput = document.querySelector('[name="order_'+ elemName +'"]');
13+
hiddenInput.setAttribute('value', toPos);
14+
}
15+
16+
/**
17+
* Move a row up or down.
18+
*
19+
* @param pos Element Node to move.
20+
* @param move int Move: +1 (down) or -1 (up)
21+
*/
22+
function changeOrder(pos, move)
23+
{
24+
var newpos = parseInt(pos) + move;
25+
var line = document.querySelector('[data-order="'+ pos +'"]');
26+
var changeline = document.querySelector('[data-order="'+ newpos +'"]');
27+
var parent = changeline.parentNode;
28+
29+
changePos(line, newpos);
30+
changePos(changeline, parseInt(pos));
31+
var changeItem = move < 0 ? changeline : changeline.nextSibling;
32+
parent.insertBefore(line, changeItem);
33+
}
34+
35+
/**
36+
* Move a row up in the table.
37+
*
38+
* @param pos int row counter.
39+
*
40+
* @returns false
41+
*/
42+
function orderUp(pos)
43+
{
44+
if (pos == 0) {
45+
return false;
46+
}
47+
changeOrder(pos, -1);
48+
return false;
49+
}
50+
51+
/**
52+
* Move a row down in the table.
53+
*
54+
* @param pos int row counter.
55+
*
56+
* @returns false
57+
*/
58+
function orderDown(pos)
59+
{
60+
var lastpos = document.querySelector('[data-order]:last-child').getAttribute('data-order');
61+
if (pos == lastpos) {
62+
return false;
63+
}
64+
65+
changeOrder(pos, +1);
66+
return false;
67+
}

linklist.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{if="$search_type=='tags'"}
2828
<div id="searchcriteria">{$result_count} results for tags
2929
{loop="search_crits"}
30-
<span class="linktag" title="Remove tag"> <a href="?removetag={$value}">{$value} <span id="searchcriteria_result"><i class="glyphicon glyphicon-remove"></i></span></a></span>
30+
<span class="linktag" title="Remove tag"> <a href="?removetag={function="urlencode($value)"}">{$value} <span id="searchcriteria_result"><i class="glyphicon glyphicon-remove"></i></span></a></span>
3131
{/loop}</div>
3232
{/if}
3333
{/if}

page.header.html

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22
<span id="am-title"><a href="?">{$shaarlititle}</a></span>
33
{if="!empty($linkcount)"}<span id="am-count" class="nomobile">a déjà partagé {$linkcount} liens !</span>{/if}
44
<div id="am-searchcontainer">
5-
<form method="GET" class="searchform" name="searchform"><input type="text" id="searchform_value" name="searchterm" placeholder="recherche libre" tabindex=1> </form><br/>
6-
<form method="GET" class="tagfilter" name="tagfilter">
7-
<input type="text" tabindex="2" name="searchtags" id="tagfilter_value" placeholder="recherche par tag" value="" autocomplete="off" class="awesomplete" data-multiple data-minChars="1" data-list="{loop="$tags"}{$key}, {/loop}">
5+
<form method="GET" class="searchform" name="searchform">
6+
<input type="text" tabindex="1" id="searchform_value" name="searchterm" placeholder="recherche libre"
7+
{if="!empty($search_crits) && $search_type=='fulltext'"}
8+
value="{$search_crits}"
9+
{/if}
10+
>
11+
</form><br/>
12+
<form method="GET" class="tagfilter" name="tagfilter">
13+
<input type="text" tabindex="2" name="searchtags" id="tagfilter_value" placeholder="recherche par tag"
14+
{if="!empty($search_crits) && $search_type=='tags'"}
15+
value="{function="implode(' ', $search_crits)"}"
16+
{/if}
17+
autocomplete="off" class="awesomplete" data-multiple data-minChars="1"
18+
data-list="{loop="$tags"}{$key}, {/loop}"
19+
>
820
</form>
921
</div>
1022
{if="!empty($_GET['source']) && $_GET['source']=='bookmarklet'"}

pluginsadmin.html

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>{include="includes"}</head>
4+
<body>
5+
<div id="pageheader">
6+
{include="page.header"}
7+
</div>
8+
9+
<div id="am-container">
10+
11+
<noscript>
12+
<div>
13+
<ul class="errors">
14+
<li>You need to enable Javascript to change plugin loading order.</li>
15+
</ul>
16+
</div>
17+
<div class="clear"></div>
18+
</noscript>
19+
20+
<div id="pluginsadmin">
21+
<form action="?do=save_pluginadmin" method="POST">
22+
<section id="enabled_plugins">
23+
<h1>Enabled Plugins</h1>
24+
25+
<div>
26+
{if="count($enabledPlugins)==0"}
27+
<p>No plugin enabled.</p>
28+
{else}
29+
<table id="plugin_table">
30+
<thead>
31+
<tr>
32+
<th class="center">Disable</th>
33+
<th class="center">Order</th>
34+
<th>Name</th>
35+
<th>Description</th>
36+
</tr>
37+
</thead>
38+
<tbody>
39+
{loop="$enabledPlugins"}
40+
<tr data-line="{$key}" data-order="{$counter}">
41+
<td class="center"><input type="checkbox" name="{$key}" checked="checked"></td>
42+
<td class="center">
43+
<a href="#"
44+
onclick="return orderUp(this.parentNode.parentNode.getAttribute('data-order'));">
45+
46+
</a>
47+
<a href="#"
48+
onclick="return orderDown(this.parentNode.parentNode.getAttribute('data-order'));">
49+
50+
</a>
51+
<input type="hidden" name="order_{$key}" value="{$counter}">
52+
</td>
53+
<td>{$key}</td>
54+
<td>{$value.description}</td>
55+
</tr>
56+
{/loop}
57+
</tbody>
58+
</table>
59+
{/if}
60+
</div>
61+
</section>
62+
63+
<section id="disabled_plugins">
64+
<h1>Disabled Plugins</h1>
65+
66+
<div>
67+
{if="count($disabledPlugins)==0"}
68+
<p>No plugin disabled.</p>
69+
{else}
70+
<table>
71+
<tr>
72+
<th class="center">Enable</th>
73+
<th>Name</th>
74+
<th>Description</th>
75+
</tr>
76+
{loop="$disabledPlugins"}
77+
<tr>
78+
<td class="center"><input type="checkbox" name="{$key}"></td>
79+
<td>{$key}</td>
80+
<td>{$value.description}</td>
81+
</tr>
82+
{/loop}
83+
</table>
84+
{/if}
85+
</div>
86+
87+
<div class="center">
88+
<input type="submit" value="Save"/>
89+
</div>
90+
</section>
91+
</form>
92+
93+
<form action="?do=save_pluginadmin" method="POST">
94+
<section id="plugin_parameters">
95+
<h1>Enabled Plugin Parameters</h1>
96+
97+
<div>
98+
{if="count($enabledPlugins)==0"}
99+
<p>No plugin enabled.</p>
100+
{else}
101+
{loop="$enabledPlugins"}
102+
{if="count($value.parameters) > 0"}
103+
<div class="plugin_parameters">
104+
<h2>{$key}</h2>
105+
{loop="$value.parameters"}
106+
<div class="plugin_parameter">
107+
<div class="float_label">
108+
<label for="{$key}">
109+
<code>{$key}</code>
110+
</label>
111+
</div>
112+
<div class="float_input">
113+
<input name="{$key}" value="{$value}" id="{$key}"/>
114+
</div>
115+
</div>
116+
{/loop}
117+
</div>
118+
{/if}
119+
{/loop}
120+
{/if}
121+
<div class="center">
122+
<input type="submit" name="parameters_form" value="Save"/>
123+
</div>
124+
</div>
125+
</section>
126+
</form>
127+
128+
</div>
129+
</div>
130+
{include="page.footer"}
131+
132+
<script src="inc/plugin_admin.js#"></script>
133+
</body>
134+
</html>

0 commit comments

Comments
 (0)