[*] BO : add Loading information in back office

This commit is contained in:
aFolletete
2012-01-03 15:56:44 +00:00
parent 99b304b873
commit c4dfa97287
5 changed files with 81 additions and 31 deletions
@@ -94,6 +94,8 @@
</head>
<body{if $bo_color} style="background:{$bo_color}"{/if}>
{if $display_header}
<div id="ajax_running"><img src="../img/admin/ajax-loader-yellow.gif" alt="" /> {l s='Loading...'}</div>
<div id="top_container">
<div id="container">
{* begin HEADER *}
+18
View File
@@ -2195,3 +2195,21 @@ font-weight:normal;
.infoCustomer dl { margin: 7px 0;}
.infoCustomer dl dt {font-weight:bold; float:left; padding-right:5px;}
.infoCustomer dl dd { margin:0; padding:0;}
#ajax_running {
display: none;
position: absolute;
top: 0;
left: 40%;
z-index: 10000;
background-color: #FFF1A8;
color: #000;
font-weight: bold;
font-size: 14px;
padding: 5px 20px;
border-radius: 0 0 3px 3px;
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
width: 300px;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

+60 -31
View File
@@ -23,6 +23,9 @@
* International Registered Trademark & Property of PrestaShop SA
*/
var ajax_running_timeout = null;
var ajax_running_nb_queries = 0;
if (!id_language)
var id_language = Number(1);
@@ -410,11 +413,11 @@ if (helpboxes)
if ($('input'))
{
//Display by rollover
$('input').mouseover(function() {
$(this).parent().find('.hint:first').css('display', 'block');
$('input').mouseover(function() {
$(this).parent().find('.hint:first').css('display', 'block');
});
$('input').mouseout(function() { $(this).parent().find('.hint:first').css('display', 'none'); });
//display when you press the tab key
$('input').keydown(function (e) {
if ( e.keyCode === 9 ){
@@ -422,15 +425,15 @@ if (helpboxes)
$('input').blur(function() { $(this).parent().find('.hint:first').css('display', 'none'); });
}
});
}
}
if ($('select'))
{
//Display by rollover
$('select').mouseover(function() {
$(this).parent().find('.hint:first').css('display', 'block');
$('select').mouseover(function() {
$(this).parent().find('.hint:first').css('display', 'block');
});
$('select').mouseout(function() { $(this).parent().find('.hint:first').css('display', 'none'); });
//display when you press the tab key
$('select').keydown(function (e) {
if ( e.keyCode === 9 ){
@@ -442,26 +445,26 @@ if (helpboxes)
if ($('span.title_box'))
{
//Display by rollover
$('span.title_box').mouseover(function() {
$('span.title_box').mouseover(function() {
//get reference to the hint box
var parent = $(this).parent();
var box = parent.find('.hint:first');
var box = parent.find('.hint:first');
if (box.length > 0)
{
//gets parent position
var left_position = parent.offset().left;
//gets width of the box
var box_width = box.width();
//gets width of the screen
var document_width = $(document).width();
//changes position of the box if needed
if (document_width < (left_position + box_width))
box.css('margin-left', '-' + box_width + 'px');
//shows the box
box.css('display', 'block');
}
@@ -473,7 +476,7 @@ if (helpboxes)
/**
* Deprecated
*
*
* @param id_product
* @param id_image
*/
@@ -894,20 +897,6 @@ function trackClickOnHelp(label, doc_version)
});
}
$(document).ready(function()
{
$('.isInvisible input, .isInvisible select, .isInvisible textarea').attr('disabled', true);
$('.isInvisible label.conf_title').addClass('isDisabled');
// Disable options fields for each row with a multishop default checkbox
$('.preference_default_multishop input[type=checkbox]').each(function(k, v)
{
var key = $(v).attr('name');
var len = key.length;
checkMultishopDefaultValue(v, key.substr(17, len - 18));
});
});
function checkMultishopDefaultValue(obj, key)
{
if ($(obj).attr('checked') || $('#'+key).hasClass('isInvisible'))
@@ -924,7 +913,7 @@ function checkMultishopDefaultValue(obj, key)
}
/**
* Update the product image list position buttons
*
*
* @param DOM table imageTable
*/
function refreshImagePositions(imageTable)
@@ -976,7 +965,7 @@ function showSuccessMessage(msg, delay)
$("#ajax_confirmation")
.html("<div class=\"conf\">"+msg+"</div>").show().delay(delay).fadeOut("slow");
}
/** display a warning message in a #ajax_confirmation container
* @param string msg string to display
*/
@@ -989,11 +978,22 @@ function showErrorMessage(msg, delay)
}
$(document).ready(function(){
$('.isInvisible input, .isInvisible select, .isInvisible textarea').attr('disabled', true);
$('.isInvisible label.conf_title').addClass('isDisabled');
// Disable options fields for each row with a multishop default checkbox
$('.preference_default_multishop input[type=checkbox]').each(function(k, v)
{
var key = $(v).attr('name');
var len = key.length;
checkMultishopDefaultValue(v, key.substr(17, len - 18));
});
$(".copy2friendlyUrl").live('keyup',function(e){
if(!isArrowKey(e))
return copy2friendlyURL()
});
// on live will make this binded for dynamic content
$(".updateCurrentText").live('keyup change',function(e){
if(typeof e == KeyboardEvent)
@@ -1024,6 +1024,29 @@ $(document).ready(function(){
else
scroll.hide();
});
$('#ajax_running').ajaxStart(function() {
ajax_running_timeout = setTimeout(function() {showAjaxOverlay()}, 500);
});
$('#ajax_running').ajaxSend(function() {
ajax_running_nb_queries += 1;
});
$('#ajax_running').ajaxComplete(function() {
ajax_running_nb_queries -= 1;
if (ajax_running_nb_queries <= 0)
{
$(this).slideUp('fast');
clearTimeout(ajax_running_timeout);
}
});
$('#ajax_running').ajaxError(function() {
ajax_running_nb_queries = 0;
$(this).slideUp('fast');
clearTimeout(ajax_running_timeout);
});
});
// Delete all tags HTML
@@ -1044,3 +1067,9 @@ function stripHTML(oldString)
}
return newString;
}
function showAjaxOverlay()
{
$('#ajax_running').slideDown('fast');
clearTimeout(ajax_running_timeout);
}
+1
View File
@@ -3078,6 +3078,7 @@ $_LANGADM['AdminControllere30d2e2e3e089445907ea440d5f0d901'] = 'Cliquez ici pour
$_LANGADM['AdminControllera546b4ed60fa82d6e50475370c228979'] = 'Un nouveau message a été envoyé sur votre boutique.';
$_LANGADM['AdminControllerc3c0ad440e89fbca4e80ecb16691259c'] = 'Extrait :';
$_LANGADM['AdminController3c40bce8d041e25000f92477f7f8ab31'] = 'Cliquez ici pour voir ce message';
$_LANGADM['AdminController8524de963f07201e5c086830d370797f'] = 'Chargement en cours...';
$_LANGADM['AdminController529a53abbdf42a64cb2d149c0aeced04'] = 'Dernières commandes';
$_LANGADM['AdminController050a0d11da7943317186f76a36b14a6c'] = 'Pas de nouvelle commande passée sur votre boutique';
$_LANGADM['AdminControllerad0750ccecf0c31c43ce46ea7e665ea5'] = 'Voir toutes les commandes';