diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index 7d09bb0b..16451595 100755 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -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' ), diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index c7fe7f71..9956a7e5 100755 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -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'); diff --git a/public/site_assets/bootstrap/js/mpos.js b/public/site_assets/bootstrap/js/mpos.js index da87eed8..36ac5f54 100755 --- a/public/site_assets/bootstrap/js/mpos.js +++ b/public/site_assets/bootstrap/js/mpos.js @@ -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() { } }); -}); \ No newline at end of file +}); diff --git a/public/templates/bootstrap/master.tpl b/public/templates/bootstrap/master.tpl index b07e93af..3562413a 100755 --- a/public/templates/bootstrap/master.tpl +++ b/public/templates/bootstrap/master.tpl @@ -44,7 +44,7 @@ {nocache} {if is_array($smarty.session.POPUP|default)} {section popup $smarty.session.POPUP} -
+
{if $smarty.session.POPUP[popup].DISMISS|default:"no" == "yes"} {/if}