mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-04 10:19:25 +02:00
Overlay notifications updated.
This commit is contained in:
parent
ab0600151e
commit
5ff1ca45f8
7 changed files with 78 additions and 27 deletions
|
@ -497,7 +497,7 @@ class Stream_Playlist
|
||||||
}
|
}
|
||||||
|
|
||||||
$democratic->add_vote($items);
|
$democratic->add_vote($items);
|
||||||
mouse_message(T_('Vote added'));
|
display_notification(T_('Vote added'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
//
|
//
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
initTabs();
|
initTabs();
|
||||||
$(document).mousemove(mouse_message_move);
|
$('#notification').click(function() {
|
||||||
|
clearNotification();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function initTabs()
|
function initTabs()
|
||||||
|
@ -86,23 +88,25 @@ function toggleVisible(element) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var mouseTimeout = null;
|
var notificationTimeout = null;
|
||||||
function mouseMessage(message, timeout) {
|
function displayNotification(message, timeout) {
|
||||||
if (mouseTimeout != null) {
|
if (notificationTimeout != null || !message) {
|
||||||
clearTimeout(mouseTimeout);
|
clearNotification();
|
||||||
mouseTimeout = null;
|
|
||||||
}
|
}
|
||||||
$('#mouse_message').html(message);
|
|
||||||
$('#mouse_message').fadeIn();
|
if (message) {
|
||||||
mouseTimeout = setTimeout(function() {
|
$('#notification-content').html(message);
|
||||||
$('#mouse_message').fadeOut();
|
$('#notification').removeClass('notification-out');
|
||||||
|
notificationTimeout = setTimeout(function() {
|
||||||
|
clearNotification();
|
||||||
}, timeout);
|
}, timeout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function mouse_message_move(e) {
|
function clearNotification() {
|
||||||
$('#mouse_message').css({top: e.clientY + 10,
|
clearTimeout(notificationTimeout);
|
||||||
left: e.clientX + 10
|
notificationTimeout = null;
|
||||||
});
|
$('#notification').addClass("notification-out");
|
||||||
}
|
}
|
||||||
|
|
||||||
// delayRun
|
// delayRun
|
||||||
|
|
|
@ -666,10 +666,10 @@ function toggle_visible($element)
|
||||||
|
|
||||||
} // toggle_visible
|
} // toggle_visible
|
||||||
|
|
||||||
function mouse_message($message, $timeout = 1000)
|
function display_notification($message, $timeout = 5000)
|
||||||
{
|
{
|
||||||
echo "<script type='text/javascript'>";
|
echo "<script type='text/javascript'>";
|
||||||
echo "mouseMessage('" . $message . "', " . $timeout . ");";
|
echo "displayNotification('" . $message . "', " . $timeout . ");";
|
||||||
echo "</script>\n";
|
echo "</script>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ require_once 'lib/init.php';
|
||||||
$title = "";
|
$title = "";
|
||||||
$text = "";
|
$text = "";
|
||||||
$next_url = "";
|
$next_url = "";
|
||||||
|
$notification_text = "";
|
||||||
|
|
||||||
// Switch on the action
|
// Switch on the action
|
||||||
switch ($_REQUEST['action']) {
|
switch ($_REQUEST['action']) {
|
||||||
|
@ -60,6 +61,12 @@ switch ($_REQUEST['action']) {
|
||||||
load_gettext();
|
load_gettext();
|
||||||
|
|
||||||
$preferences = $GLOBALS['user']->get_preferences($_REQUEST['tab'], $system);
|
$preferences = $GLOBALS['user']->get_preferences($_REQUEST['tab'], $system);
|
||||||
|
|
||||||
|
if ($_POST['method'] == 'admin') {
|
||||||
|
$notification_text = T_('Server preferences updated successfully');
|
||||||
|
} else {
|
||||||
|
$notification_text = T_('User preferences updated successfully');
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'admin_update_preferences':
|
case 'admin_update_preferences':
|
||||||
// Make sure only admins here
|
// Make sure only admins here
|
||||||
|
@ -74,6 +81,7 @@ switch ($_REQUEST['action']) {
|
||||||
}
|
}
|
||||||
|
|
||||||
update_preferences($_POST['user_id']);
|
update_preferences($_POST['user_id']);
|
||||||
|
|
||||||
header("Location: " . AmpConfig::get('web_path') . "/admin/users.php?action=show_preferences&user_id=" . scrub_out($_POST['user_id']));
|
header("Location: " . AmpConfig::get('web_path') . "/admin/users.php?action=show_preferences&user_id=" . scrub_out($_POST['user_id']));
|
||||||
break;
|
break;
|
||||||
case 'admin':
|
case 'admin':
|
||||||
|
@ -131,11 +139,13 @@ switch ($_REQUEST['action']) {
|
||||||
$GLOBALS['user']->upload_avatar();
|
$GLOBALS['user']->upload_avatar();
|
||||||
Error::add('general', T_('Error Update Failed'));
|
Error::add('general', T_('Error Update Failed'));
|
||||||
} else {
|
} else {
|
||||||
$_REQUEST['action'] = 'confirm';
|
//$_REQUEST['action'] = 'confirm';
|
||||||
$title = T_('Updated');
|
$title = T_('Updated');
|
||||||
$text = T_('Your Account has been updated');
|
$text = T_('Your Account has been updated');
|
||||||
$next_url = AmpConfig::get('web_path') . '/preferences.php?tab=account';
|
$next_url = AmpConfig::get('web_path') . '/preferences.php?tab=account';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$notification_text = T_('User updated successfully');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$fullname = $GLOBALS['user']->fullname;
|
$fullname = $GLOBALS['user']->fullname;
|
||||||
|
@ -153,6 +163,10 @@ switch ($_REQUEST['action']) {
|
||||||
show_confirmation($title,$text,$next_url,$cancel);
|
show_confirmation($title,$text,$next_url,$cancel);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
if (!empty($notification_text)) {
|
||||||
|
display_notification($notification_text);
|
||||||
|
}
|
||||||
|
|
||||||
// Show the default preferences page
|
// Show the default preferences page
|
||||||
require AmpConfig::get('prefix') . '/templates/show_preferences.inc.php';
|
require AmpConfig::get('prefix') . '/templates/show_preferences.inc.php';
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -132,7 +132,7 @@ switch ($_REQUEST['action']) {
|
||||||
ob_end_clean();*/
|
ob_end_clean();*/
|
||||||
debug_event('playlist', 'Items added successfully!', '5');
|
debug_event('playlist', 'Items added successfully!', '5');
|
||||||
ob_start();
|
ob_start();
|
||||||
mouse_message(T_('Added to playlist'));
|
display_notification(T_('Added to playlist'));
|
||||||
$results['rfc3514'] = ob_get_clean();
|
$results['rfc3514'] = ob_get_clean();
|
||||||
} else {
|
} else {
|
||||||
debug_event('playlist', 'No item to add. Aborting...', '5');
|
debug_event('playlist', 'No item to add. Aborting...', '5');
|
||||||
|
|
|
@ -297,7 +297,7 @@ $_SESSION['login'] = false;
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<!-- rfc3514 implementation -->
|
<!-- rfc3514 implementation -->
|
||||||
<div id="rfc3514" style="display:none;">0x0</div>
|
<div id="rfc3514" style="display:none;">0x0</div>
|
||||||
<div id="mouse_message"></div>
|
<div id="notification" class="notification-out"><img src="<?php echo $web_path; ?>/images/icon_info.png" /><span id="notification-content"></span></div>
|
||||||
<div id="maincontainer">
|
<div id="maincontainer">
|
||||||
<div id="header" class="header-<?php echo AmpConfig::get('ui_fixed') ? 'fixed' : 'float'; ?>"><!-- This is the header -->
|
<div id="header" class="header-<?php echo AmpConfig::get('ui_fixed') ? 'fixed' : 'float'; ?>"><!-- This is the header -->
|
||||||
<h1 id="headerlogo">
|
<h1 id="headerlogo">
|
||||||
|
|
|
@ -188,12 +188,42 @@ input[type=button]:focus:active, input[type=submit]:focus:active {
|
||||||
background-position: right;
|
background-position: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mouse_message {
|
#notification {
|
||||||
z-index: 9999;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
color: #303335;
|
top: auto;
|
||||||
text-shadow: 2px 2px 9px #fff;
|
bottom: 20px;
|
||||||
font-weight: bold;
|
left: 50%;
|
||||||
|
z-index: 8888;
|
||||||
|
width: 50%;
|
||||||
|
padding: 5px 20px;
|
||||||
|
margin: 0;
|
||||||
|
background-color: #000;
|
||||||
|
border-radius: 10px;
|
||||||
|
-webkit-box-shadow: 0 4px 12px rgba(0,0,0,.5);
|
||||||
|
box-shadow: 0 4px 12px rgba(0,0,0,.5);
|
||||||
|
-webkit-transition: all .5s;
|
||||||
|
transition: all .5s;
|
||||||
|
-webkit-transform: translate(-50%,0);
|
||||||
|
-ms-transform: translate(-50%,0);
|
||||||
|
transform: translate(-50%,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#notification.notification-out {
|
||||||
|
opacity: 0;
|
||||||
|
filter: alpha(opacity=0);
|
||||||
|
-webkit-transform: translate(-50%,80px);
|
||||||
|
-ms-transform: translate(-50%,80px);
|
||||||
|
transform: translate(-50%,80px);
|
||||||
|
}
|
||||||
|
|
||||||
|
#notification img {
|
||||||
|
height: 100%;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-top: -3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#notification-content {
|
||||||
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************
|
/***********************************************
|
||||||
|
@ -1041,6 +1071,8 @@ div.box.box_rules {
|
||||||
.cel_song, .cel_album, .cel_artist {
|
.cel_song, .cel_album, .cel_artist {
|
||||||
max-width: 350px;
|
max-width: 350px;
|
||||||
white-space: normal !important;
|
white-space: normal !important;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************
|
/***********************************************
|
||||||
|
@ -1361,6 +1393,7 @@ span.fatalerror {
|
||||||
.dynamic-star-rating {
|
.dynamic-star-rating {
|
||||||
width:95px;
|
width:95px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.star-rating ul,
|
.star-rating ul,
|
||||||
.star-rating a:hover,
|
.star-rating a:hover,
|
||||||
.star-rating .current-rating {
|
.star-rating .current-rating {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue