Commit 27db65fb authored by  JosephK's avatar JosephK

Regroupement des options d'affichage + rajout vue private only

parent e6d1e6b1
......@@ -152,9 +152,13 @@ $t['Picture wall'] = 'Mur d’images';
$t['Daily'] = 'Journal';
$t['Search'] = 'Rechercher';
$t['Change links per page'] = 'Changer le nombre de liens par page';
$t['Display options'] = 'Options d’affichage';
$t['Links per page:'] = 'Liens par page :';
$t[' links'] = ' liens';
$t['Custom value...'] = 'Au choix…';
$t['Show only private links'] = 'Afficher uniquement les liens privés';
$t['actually enabled'] = 'actuellement activé';
$t['actually disabled'] = 'actuellement désactivé';
//$t['RSS Feed'] = '';
//$t['ATOM Feed'] = '';
//$t['Add link'] = 'Ajouter un lien';
......
......@@ -12,30 +12,63 @@ if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS']) && !function_exists(t
// Pré-remplissage Login
$account = explode('/', $ShaarliRoot);
?>
// Read/Write cookies (copy from Framanav)
function f$Cookie(set, name, value, time) {
if (set == 'w') {
time = typeof time !== 'undefined' ? time : 365*24*60*60*1000;
var today = new Date(), expires = new Date();
expires.setTime(today.getTime() + time);
document.cookie = name + "=" + encodeURIComponent(value) + ";expires=" + expires.toGMTString();
} else {
var oRegex = new RegExp("(?:; )?" + name + "=([^;]*);?");
if (oRegex.test(document.cookie)) {
return decodeURIComponent(RegExp["$1"]);
} else {
return null;
}
}
}
jQuery(document).ready(function(){
// Button Show/Hide link description ~~> to move in link filter menu
if(/do=daily|login/i.test(window.location.href) || !(/=/i.test(window.location.href))) {
jQuery('.sl-menu .list-inline.pull-right').prepend(
'<li><a id="descToggle" href="javascript:void(0);" title="<?php echo t('Hide links descriptions'); ?>">'+
'<i class="fa fa-fw fa-lg fa-toggle-on"></i><span class="sr-only"><?php echo t('Hide links descriptions'); ?></span>'+
// Button Show/Hide link description
if(/do=daily|login|searchterm|searchtag/i.test(window.location.href) || !(/=/i.test(window.location.href))) {
var descHide = f$Cookie('r','descHide');
var divider = (jQuery('.dropdown.paging_linksperpage ul li').length > 0) ? '<li class="divider"></li>' : '';
jQuery('.dropdown.paging_linksperpage ul.dropdown-menu').append(
divider+
'<li><a id="descToggle" href="javascript:void(0);">'+
'<i class="fa fa-fw fa-lg fa-toggle-on"></i> <?php echo t('Show links descriptions'); ?><span class="sr-only"><?php echo t('actually disabled'); ?></span>'+
'</a></li>'
);
jQuery('#descToggle').click(
function(){
if(jQuery(this).children('i').hasClass('fa-toggle-on')) {
jQuery('.link-description').hide();
jQuery('#descToggle').attr('title', '<?php echo t('Show links descriptions'); ?>');
jQuery('#descToggle').children('i').addClass('fa-toggle-off').removeClass('fa-toggle-on');
jQuery('#descToggle').children('.sr-only').text('<?php echo t('Show links descriptions'); ?>');
jQuery('#descToggle').children('.sr-only').text('<?php echo t('actually enabled'); ?>');
f$Cookie('w','descHide',true);
} else {
jQuery('.link-description').show();
jQuery('#descToggle').attr('title', '<?php echo t('Hide links descriptions'); ?>');
jQuery('#descToggle').children('i').removeClass('fa-toggle-off').addClass('fa-toggle-on');
jQuery('#descToggle').children('.sr-only').text('<?php echo t('Hide links descriptions'); ?>');
jQuery('#descToggle').children('.sr-only').text('<?php echo t('actually disabled'); ?>');
f$Cookie('w','descHide',false);
}
}
);
if(descHide) {
jQuery('#descToggle').trigger('click');
}
} else {
jQuery('.paging_linksperpage').hide();
}
jQuery('#configform #titleLink,#configform #updateCheck').parent().parent().hide();
......
......@@ -1018,6 +1018,10 @@ html,body {
padding:15px;
}
form.linksperpage {
padding:0 10px;
}
/* Footer */
#footer.container {
margin: 30px auto;
......
......@@ -27,15 +27,31 @@
<i class="fa fa-fw fa-lg fa-search"></i><span class="sr-only">{'Search'|t}</span>
</a></li>
<li class="dropdown paging_linksperpage">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{'Change links per page'|t}">
<i class="fa fa-fw fa-lg fa-filter"></i><span class="sr-only">{'Change links per page'|t}</span>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{'Display options'|t}">
<i class="fa fa-fw fa-lg fa-eye"></i><span class="sr-only">{'Display options'|t}</span>
</a>
<ul class="dropdown-menu">
<ul class="dropdown-menu dropdown-menu-right">
{if="$plugins_header._PAGE_ == linklist"}
<li class="dropdown-header">{'Links per page:'|t}</li>
<li><a href="?linksperpage=20">20{' links'|t}</a></li>
<li><a href="?linksperpage=50">50{' links'|t}</a></li>
<li><a href="?linksperpage=100">100{' links'|t}</a></li>
<li><form method="GET" class="linksperpage"><input type="text" name="linksperpage" size="2" class="form-control input-sm" placeholder="{'Custom value...'|t}" ></form></li>
{if="isLoggedIn()"}
<li class="divider"></li>
<li>
<a href="?privateonly">
{if="$privateonly"}
<i class="fa fa-fw fa-lg fa-toggle-on"></i>
{'Show only private links'|t} <span class="sr-only">{'actually enabled'|t}</span>
{else}
<i class="fa fa-fw fa-lg fa-toggle-off"></i>
{'Show only private links'|t} <span class="sr-only">{'actually disabled'|t}</span>
{/if}
</a>
</li>
{/if}
{/if}
</ul>
</li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment