diff --git a/admin-dev/themes/default/template/header.tpl b/admin-dev/themes/default/template/header.tpl index 22e2457bb..870849725 100644 --- a/admin-dev/themes/default/template/header.tpl +++ b/admin-dev/themes/default/template/header.tpl @@ -94,6 +94,8 @@ {if $display_header} +
{l s='Loading...'}
+
{* begin HEADER *} diff --git a/css/admin.css b/css/admin.css index f86b512a9..fe8e11280 100644 --- a/css/admin.css +++ b/css/admin.css @@ -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; +} \ No newline at end of file diff --git a/img/admin/ajax-loader-yellow.gif b/img/admin/ajax-loader-yellow.gif new file mode 100644 index 000000000..999a5e386 Binary files /dev/null and b/img/admin/ajax-loader-yellow.gif differ diff --git a/js/admin.js b/js/admin.js index 65d911c82..6c01757e7 100644 --- a/js/admin.js +++ b/js/admin.js @@ -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("
"+msg+"
").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); +} \ No newline at end of file diff --git a/translations/fr/admin.php b/translations/fr/admin.php index 499baaae7..2ec4644a6 100644 --- a/translations/fr/admin.php +++ b/translations/fr/admin.php @@ -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';