diff --git a/admin/themes/default/img/loader.gif b/admin/themes/default/img/loader.gif new file mode 100644 index 000000000..424c17c32 Binary files /dev/null and b/admin/themes/default/img/loader.gif differ diff --git a/admin/themes/default/sass/partials/_chosen.sass b/admin/themes/default/sass/partials/_chosen.sass index b56215a15..0e76a91d6 100644 --- a/admin/themes/default/sass/partials/_chosen.sass +++ b/admin/themes/default/sass/partials/_chosen.sass @@ -20,7 +20,7 @@ $chosen-focus-box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, $chosen-focus-transition: border linear .2s, box-shadow linear .2s $chosen-height: $input-height-base $chosen-multi-height: $input-height-base + 6px -$chosen-sprite-path: '../img/chosen-sprite.png' +$chosen-sprite-path: '#{$img-path}/chosen-sprite.png' .chosen-select width: 100% diff --git a/admin/themes/default/sass/partials/_select2.scss b/admin/themes/default/sass/partials/_select2.scss index 13013a28c..1a1bfeec4 100644 --- a/admin/themes/default/sass/partials/_select2.scss +++ b/admin/themes/default/sass/partials/_select2.scss @@ -86,7 +86,7 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014 text-decoration: none; border: 0; - background: url('../img/select2.png') right top no-repeat; + background: url('#{$img-path}/select2.png') right top no-repeat; cursor: pointer; outline: 0; } @@ -182,7 +182,7 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014 display: block; width: 100%; height: 100%; - background: url('../img/select2.png') no-repeat 0 1px; + background: url('#{$img-path}/select2.png') no-repeat 0 1px; } .select2-search { @@ -215,8 +215,8 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014 -webkit-box-shadow: none; box-shadow: none; - background: #fff url('../img/select2.png') no-repeat 100% -22px; - background: url('../img/select2.png') no-repeat 100% -22px; + background: #fff url('#{$img-path}/select2.png') no-repeat 100% -22px; + background: url('#{$img-path}/select2.png') no-repeat 100% -22px; } .select2-drop.select2-drop-above .select2-search input { @@ -224,8 +224,8 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014 } .select2-search input.select2-active { - background: #fff url('../img/select2-spinner.gif') no-repeat 100%; - background: url('../img/select2-spinner.gif') no-repeat 100%; + background: #fff url('#{$img-path}/select2-spinner.gif') no-repeat 100%; + background: url('#{$img-path}/select2-spinner.gif') no-repeat 100%; } .select2-container-active .select2-choice, @@ -369,7 +369,7 @@ disabled look for disabled choices in the results dropdown } .select2-more-results.select2-active { - background: #f4f4f4 url('../img/select2-spinner.gif') no-repeat 100%; + background: #f4f4f4 url('#{$img-path}/select2-spinner.gif') no-repeat 100%; } .select2-more-results { @@ -456,7 +456,7 @@ html[dir="rtl"] .select2-container-multi .select2-choices li } .select2-container-multi .select2-choices .select2-search-field input.select2-active { - background: #fff url('../img/select2-spinner.gif') no-repeat 100% !important; + background: #fff url('#{$img-path}/select2-spinner.gif') no-repeat 100% !important; } .select2-default { @@ -512,7 +512,7 @@ html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice font-size: 1px; outline: none; - background: url('../img/select2.png') right top no-repeat; + background: url('#{$img-path}/select2.png') right top no-repeat; } html[dir="rtl"] .select2-search-choice-close { right: auto; @@ -590,7 +590,7 @@ html[dir="rtl"] .select2-search-choice-close { .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice .select2-arrow b { - background-image: url('../img/select2x2.png') !important; + background-image: url('#{$img-path}/select2x2.png') !important; background-repeat: no-repeat !important; background-size: 60px 40px !important; } @@ -607,7 +607,7 @@ html[dir="rtl"] .select2-search-choice-close { } .form-control .select2-choice .select2-arrow { - border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; } .form-control.select2-container { diff --git a/admin/themes/default/sass/partials/_tinymce.sass b/admin/themes/default/sass/partials/_tinymce.sass index de7e99302..7a5f7f448 100644 --- a/admin/themes/default/sass/partials/_tinymce.sass +++ b/admin/themes/default/sass/partials/_tinymce.sass @@ -1210,7 +1210,7 @@ i.mce-i-resize opacity: .6 filter: alpha(opacity = 60) zoom: 1 - background: white url('img/loader.gif') no-repeat center center + background: white url('#{$img-path}/loader.gif') no-repeat center center .mce-i-none width: 16px diff --git a/admin/themes/default/template/controllers/login/header.tpl b/admin/themes/default/template/controllers/login/header.tpl index d1d17ce21..161910564 100644 --- a/admin/themes/default/template/controllers/login/header.tpl +++ b/admin/themes/default/template/controllers/login/header.tpl @@ -54,14 +54,11 @@ {/if} {/foreach} {/if} - {foreach from=$js_files item=js_uri} - - {/foreach} - - {if (isset($js_def) && count($js_def) || isset($js_files) && count($js_files))} {include file=$smarty.const._PS_ALL_THEMES_DIR_|cat:"javascript.tpl"} {/if} + +
diff --git a/admin/themes/default/template/controllers/normal_products/images.tpl b/admin/themes/default/template/controllers/normal_products/images.tpl index 29e0f97e6..bae4675da 100644 --- a/admin/themes/default/template/controllers/normal_products/images.tpl +++ b/admin/themes/default/template/controllers/normal_products/images.tpl @@ -247,7 +247,7 @@ function afterDeleteProductImage(data) { data = $.parseJSON(data); - if (data) + if (data.status) { cover = 0; id = data.content.id; @@ -265,6 +265,8 @@ if (parseInt($("#countImage").html()) <= 1) $('#caption_selection').addClass('hidden'); + } else if (data.error) { + showErrorMessage(data.error); } } diff --git a/admin/themes/default/template/controllers/products/images.tpl b/admin/themes/default/template/controllers/products/images.tpl index 9648130ab..cc86ce61f 100644 --- a/admin/themes/default/template/controllers/products/images.tpl +++ b/admin/themes/default/template/controllers/products/images.tpl @@ -247,7 +247,7 @@ function afterDeleteProductImage(data) { data = $.parseJSON(data); - if (data) + if (data.status) { cover = 0; id = data.content.id; @@ -265,6 +265,8 @@ if (parseInt($("#countImage").html()) <= 1) $('#caption_selection').addClass('hidden'); + } else if (data.error) { + showErrorMessage(data.error); } } diff --git a/admin/themes/default/template/helpers/tree/tree.tpl b/admin/themes/default/template/helpers/tree/tree.tpl index 1eab06591..f9be10f4c 100644 --- a/admin/themes/default/template/helpers/tree/tree.tpl +++ b/admin/themes/default/template/helpers/tree/tree.tpl @@ -42,7 +42,7 @@ {if isset($use_checkbox) && $use_checkbox == true} function checkAll($tree) { - $tree.find(":input[type=checkbox]").each( + $tree.find(":input[type=checkbox]:not([hidden])").each( function() { $(this).prop("checked", true); @@ -53,7 +53,7 @@ function uncheckAll($tree) { - $tree.find(":input[type=checkbox]").each( + $tree.find(":input[type=checkbox]:not([hidden])").each( function() { $(this).prop("checked", false); @@ -64,7 +64,8 @@ {/if} {if isset($use_search) && $use_search == true} $("#{$id|escape:'html':'UTF-8'}-search").bind("typeahead:selected", function(obj, datum) { - $("#{$id|escape:'html':'UTF-8'}").find(":input").each( + var suffix = '{if isset($use_checkbox) && $use_checkbox == true}[]{/if}'; + $("#{$id|escape:'html':'UTF-8'}").find('[name="'+datum.input_name + suffix + '"]:input').each( function() { if ($(this).val() == datum.value) @@ -78,6 +79,15 @@ $(this).show(); $(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open'); }); + + {if isset($auto_select_children) && $auto_select_children == true} + if ($(this).closest('.tree-item').length == 0) { + $(this).closest('.tree-folder').find(':input[type=checkbox]').each(function(){ + $(this).prop('checked', true); + $(this).parent().addClass('tree-selected'); + }); + } + {/if} } } ); @@ -86,7 +96,7 @@ {if isset($auto_select_children) && $auto_select_children == true} $('#{$id|escape:'html':'UTF-8'}').find(':input[type=checkbox]').on('click', function(){ - if ($(this).closest('.tree-item').length ==0) { + if ($(this).closest('.tree-item').length == 0) { if ($(this).is(":checked")) { $(this).closest('.tree-folder').find(':input[type=checkbox]').each(function(){ $(this).prop('checked', true); @@ -111,9 +121,13 @@ }); {/if} - $(document).ready(function () { - var tree = $("#{$id|escape:'html':'UTF-8'}").tree('collapseAll'); + function startTree() { + if (typeof $.fn.tree === 'undefined') { + setTimeout(startTree, 100); + return; + } + var tree = $("#{$id|escape:'html':'UTF-8'}").tree('collapseAll'); if ($("#{$id|escape:'html':'UTF-8'}").find(":input:checked").length > 1) $('#expand-all-{$id|escape:'html':'UTF-8'}').hide(); @@ -127,6 +141,10 @@ $(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open'); }); }); + } + + $(document).ready(function () { + startTree(); }); {/block} \ No newline at end of file diff --git a/admin/themes/default/template/helpers/tree/tree_node_folder.tpl b/admin/themes/default/template/helpers/tree/tree_node_folder.tpl index 19191b8cc..ff0af7779 100644 --- a/admin/themes/default/template/helpers/tree/tree_node_folder.tpl +++ b/admin/themes/default/template/helpers/tree/tree_node_folder.tpl @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} -
  • +
  • +
  • +
  • +
  • +
  • +