Skip to content

Commit

Permalink
Mise à jour de compatibilité avec Shaarli 0.6.3
Browse files Browse the repository at this point in the history
* prise en charge du gestionnaire de plugin
* ajout de la page 404
  • Loading branch information
alexisju committed Feb 2, 2016
1 parent 9f87f44 commit cf8a94f
Show file tree
Hide file tree
Showing 8 changed files with 364 additions and 13 deletions.
19 changes: 19 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
{include="includes"}
</head>
<body>
<div id="pageheader">
{include="page.header"}
</div>
<div id="am-container">
<div class="error-container">
<h1>404 Not found <small>Oh crap!</small></h1>
<p>{$error_message}</p>
<p>Would you mind <a href="?">clicking here</a>?</p>
</div>
</div>
{include="page.footer"}
</body>
</html>
2 changes: 1 addition & 1 deletion daily.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{/if}

<div class="paging_rss">
<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>
<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>
</div>
</div>
</div>
Expand Down
76 changes: 76 additions & 0 deletions inc/albinomouse.css
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,82 @@ ul.errors {
float: left;
}

/* Pluginadmin */

#pluginsadmin {
width: 80%;
padding: 20px 0 0 20px;
}

#pluginsadmin section {
padding: 20px 0;
}

#pluginsadmin .plugin_parameters {
margin: 10px 0;
}

#pluginsadmin h1 {
font-style: normal;
}

#pluginsadmin h2 {
font-size: 1.4em;
font-weight: bold;
}

#pluginsadmin table {
width: 100%;
}

#pluginsadmin table, #pluginsadmin th, #pluginsadmin td {
border-width: 1px 0;
border-style: solid;
border-color: #c0c0c0;
}

#pluginsadmin table th {
font-weight: bold;
padding: 10px 0;
}

#pluginsadmin table td {
padding: 5px 0;
}

#pluginsadmin input[type=submit] {
margin: 10px 0;
}

#pluginsadmin .plugin_parameter {
padding: 5px 0;
border-width: 1px 0;
border-style: solid;
border-color: #c0c0c0;
}

#pluginsadmin .float_label {
float: left;
width: 20%;
}

#pluginsadmin a {
color: black;
}

/* 404 page */
.error-container {

margin: 50px;
margin-top: 20px;
}

.error-container h1 {
text-decoration: none;
font-style: normal;
color: #C93030;
}

/* ---------------------- Responsive Albinomouse Template --------------------------------------------------*/

@media handheld, only screen and (max-width: 480px), only screen and (max-device-width: 854px) {
Expand Down
67 changes: 67 additions & 0 deletions inc/plugin_admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* Change the position counter of a row.
*
* @param elem Element Node to change.
* @param toPos int New position.
*/
function changePos(elem, toPos)
{
var elemName = elem.getAttribute('data-line')

elem.setAttribute('data-order', toPos);
var hiddenInput = document.querySelector('[name="order_'+ elemName +'"]');
hiddenInput.setAttribute('value', toPos);
}

/**
* Move a row up or down.
*
* @param pos Element Node to move.
* @param move int Move: +1 (down) or -1 (up)
*/
function changeOrder(pos, move)
{
var newpos = parseInt(pos) + move;
var line = document.querySelector('[data-order="'+ pos +'"]');
var changeline = document.querySelector('[data-order="'+ newpos +'"]');
var parent = changeline.parentNode;

changePos(line, newpos);
changePos(changeline, parseInt(pos));
var changeItem = move < 0 ? changeline : changeline.nextSibling;
parent.insertBefore(line, changeItem);
}

/**
* Move a row up in the table.
*
* @param pos int row counter.
*
* @returns false
*/
function orderUp(pos)
{
if (pos == 0) {
return false;
}
changeOrder(pos, -1);
return false;
}

/**
* Move a row down in the table.
*
* @param pos int row counter.
*
* @returns false
*/
function orderDown(pos)
{
var lastpos = document.querySelector('[data-order]:last-child').getAttribute('data-order');
if (pos == lastpos) {
return false;
}

changeOrder(pos, +1);
return false;
}
2 changes: 1 addition & 1 deletion linklist.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{if="$search_type=='tags'"}
<div id="searchcriteria">{$result_count} results for tags
{loop="search_crits"}
<span class="linktag" title="Remove tag"> <a href="?removetag={$value}">{$value} <span id="searchcriteria_result"><i class="glyphicon glyphicon-remove"></i></span></a></span>
<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>
{/loop}</div>
{/if}
{/if}
Expand Down
18 changes: 15 additions & 3 deletions page.header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@
<span id="am-title"><a href="?">{$shaarlititle}</a></span>
{if="!empty($linkcount)"}<span id="am-count" class="nomobile">a déjà partagé {$linkcount} liens !</span>{/if}
<div id="am-searchcontainer">
<form method="GET" class="searchform" name="searchform"><input type="text" id="searchform_value" name="searchterm" placeholder="recherche libre" tabindex=1> </form><br/>
<form method="GET" class="tagfilter" name="tagfilter">
<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}">
<form method="GET" class="searchform" name="searchform">
<input type="text" tabindex="1" id="searchform_value" name="searchterm" placeholder="recherche libre"
{if="!empty($search_crits) && $search_type=='fulltext'"}
value="{$search_crits}"
{/if}
>
</form><br/>
<form method="GET" class="tagfilter" name="tagfilter">
<input type="text" tabindex="2" name="searchtags" id="tagfilter_value" placeholder="recherche par tag"
{if="!empty($search_crits) && $search_type=='tags'"}
value="{function="implode(' ', $search_crits)"}"
{/if}
autocomplete="off" class="awesomplete" data-multiple data-minChars="1"
data-list="{loop="$tags"}{$key}, {/loop}"
>
</form>
</div>
{if="!empty($_GET['source']) && $_GET['source']=='bookmarklet'"}
Expand Down
134 changes: 134 additions & 0 deletions pluginsadmin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<!DOCTYPE html>
<html>
<head>{include="includes"}</head>
<body>
<div id="pageheader">
{include="page.header"}
</div>

<div id="am-container">

<noscript>
<div>
<ul class="errors">
<li>You need to enable Javascript to change plugin loading order.</li>
</ul>
</div>
<div class="clear"></div>
</noscript>

<div id="pluginsadmin">
<form action="?do=save_pluginadmin" method="POST">
<section id="enabled_plugins">
<h1>Enabled Plugins</h1>

<div>
{if="count($enabledPlugins)==0"}
<p>No plugin enabled.</p>
{else}
<table id="plugin_table">
<thead>
<tr>
<th class="center">Disable</th>
<th class="center">Order</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{loop="$enabledPlugins"}
<tr data-line="{$key}" data-order="{$counter}">
<td class="center"><input type="checkbox" name="{$key}" checked="checked"></td>
<td class="center">
<a href="#"
onclick="return orderUp(this.parentNode.parentNode.getAttribute('data-order'));">
</a>
<a href="#"
onclick="return orderDown(this.parentNode.parentNode.getAttribute('data-order'));">
</a>
<input type="hidden" name="order_{$key}" value="{$counter}">
</td>
<td>{$key}</td>
<td>{$value.description}</td>
</tr>
{/loop}
</tbody>
</table>
{/if}
</div>
</section>

<section id="disabled_plugins">
<h1>Disabled Plugins</h1>

<div>
{if="count($disabledPlugins)==0"}
<p>No plugin disabled.</p>
{else}
<table>
<tr>
<th class="center">Enable</th>
<th>Name</th>
<th>Description</th>
</tr>
{loop="$disabledPlugins"}
<tr>
<td class="center"><input type="checkbox" name="{$key}"></td>
<td>{$key}</td>
<td>{$value.description}</td>
</tr>
{/loop}
</table>
{/if}
</div>

<div class="center">
<input type="submit" value="Save"/>
</div>
</section>
</form>

<form action="?do=save_pluginadmin" method="POST">
<section id="plugin_parameters">
<h1>Enabled Plugin Parameters</h1>

<div>
{if="count($enabledPlugins)==0"}
<p>No plugin enabled.</p>
{else}
{loop="$enabledPlugins"}
{if="count($value.parameters) > 0"}
<div class="plugin_parameters">
<h2>{$key}</h2>
{loop="$value.parameters"}
<div class="plugin_parameter">
<div class="float_label">
<label for="{$key}">
<code>{$key}</code>
</label>
</div>
<div class="float_input">
<input name="{$key}" value="{$value}" id="{$key}"/>
</div>
</div>
{/loop}
</div>
{/if}
{/loop}
{/if}
<div class="center">
<input type="submit" name="parameters_form" value="Save"/>
</div>
</div>
</section>
</form>

</div>
</div>
{include="page.footer"}

<script src="inc/plugin_admin.js#"></script>
</body>
</html>
Loading

0 comments on commit cf8a94f

Please sign in to comment.