[UPDATE] autohide notifications and settings update

This commit is contained in:
iAmShorty 2014-03-05 12:23:24 +01:00
parent 963b76ed80
commit 50de3925ca
4 changed files with 23 additions and 2 deletions

View File

@ -60,6 +60,13 @@ $aSettings['website'][] = array(
'name' => 'website_news_style', 'value' => $setting->getValue('website_news_style'),
'tooltip' => 'How News are displayed on Main Page.'
);
$aSettings['website'][] = array(
'display' => 'Auto Hide Notifications', 'type' => 'select',
'options' => array( 0 => 'Notifications always visible', 1 => 'Hide Notifications automatically' ),
'default' => 0,
'name' => 'website_notification_autohide', 'value' => $setting->getValue('website_notification_autohide'),
'tooltip' => 'Hides Notifications after 5 seconds.'
);
$aSettings['blockchain'][] = array(
'display' => 'Disable Blockexplorer', 'type' => 'select',
'options' => array( 0 => 'No', 1 => 'Yes' ),

View File

@ -101,6 +101,7 @@ $aGlobal['website']['title'] = $setting->getValue('website_title');
$aGlobal['website']['slogan'] = $setting->getValue('website_slogan');
$aGlobal['website']['email'] = $setting->getValue('website_email');
$aGlobal['website']['newsstyle'] = $setting->getValue('website_news_style');
$aGlobal['website']['notificationshide'] = $setting->getValue('website_notification_autohide');
$aGlobal['website']['api']['disabled'] = $setting->getValue('disable_api');
$aGlobal['website']['blockexplorer']['disabled'] = $setting->getValue('website_blockexplorer_disabled');
$aGlobal['website']['transactionexplorer']['disabled'] = $setting->getValue('website_transactionexplorer_disabled');

View File

@ -27,13 +27,26 @@ $(document).ready(function() {
$(function() {
// auto hide notification messages if set in config
// starting timeout in ms before first message is hidden
var hide_delay = 3000;
// time in ms to wait before hiding next message
var hide_next = 800;
$(".autohide").slideDown().each( function(index,el) {
window.setTimeout( function(){
$(el).slideUp(); // hide the message
}, hide_delay + hide_next*index);
});
// Check if lastlogin alert has been closed
if( $.cookie('lastlogin-box') === 'closed' ){
$('#lastlogin').hide();
}
// Check if MOTD alert has been closed
if( $.cookie('motd-box') === 'closed' ){
$('#motd').hide();
}
// Check if Backend Issues alert has been closed
if( $.cookie('backend-box') === 'closed' ){
$('#backend').hide();
}
@ -53,4 +66,4 @@ $(function() {
}
});
});
});

View File

@ -44,7 +44,7 @@
{nocache}
{if is_array($smarty.session.POPUP|default)}
{section popup $smarty.session.POPUP}
<div class="{if $smarty.session.POPUP[popup].DISMISS|default:"" == "yes"}alert-dismissable{/if} {$smarty.session.POPUP[popup].TYPE|default:"alert alert-info"}" id="{$smarty.session.POPUP[popup].ID|default:"static"}">
<div class="{if $smarty.session.POPUP[popup].DISMISS|default:"" == "yes"}alert-dismissable {/if} {$smarty.session.POPUP[popup].TYPE|default:"alert alert-info"} {if $smarty.session.POPUP[popup].ID|default:"static" == "static" AND $GLOBAL.website.notificationshide == 1}autohide{/if}" id="{$smarty.session.POPUP[popup].ID|default:"static"}">
{if $smarty.session.POPUP[popup].DISMISS|default:"no" == "yes"}
<button id="{$smarty.session.POPUP[popup].ID|default:"static"}" type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{/if}