update 5.11.13
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/*********************************************************** TMMenuDropDown **********************************/
|
||||
function tmDropDown (elementType, elementClick, elementSlide, activeClass){
|
||||
elementType = elementType; // special if hidden element isn't next (like for cart block here)
|
||||
elementClick = elementClick; // element to click
|
||||
elementSlide = elementSlide; // element to show/hide
|
||||
activeClass = activeClass; // active class for "element to click"
|
||||
|
||||
|
||||
//show/hide elements
|
||||
$(elementClick).on('click touchstart', function(){
|
||||
if (elementType != 'cart')
|
||||
var subUl = $(this).next(elementSlide);
|
||||
else
|
||||
var subUl = $(this).parents('#header').find(elementSlide);
|
||||
if(subUl.is(':hidden')) {
|
||||
subUl.slideDown(),
|
||||
$(this).addClass(activeClass)
|
||||
}
|
||||
else {
|
||||
subUl.slideUp(),
|
||||
$(this).removeClass(activeClass)
|
||||
}
|
||||
$(elementClick).not(this).next(elementSlide).slideUp(),
|
||||
$(elementClick).not(this).removeClass(activeClass);
|
||||
return false
|
||||
}),
|
||||
|
||||
//enable clicks on showed elements
|
||||
$(elementSlide).on('click touchstart', function(e){
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
// hide showed elements on document click
|
||||
$(document).on('click touchstart', function(){
|
||||
if (elementType != 'cart')
|
||||
var elementHide = $(elementClick).next(elementSlide);
|
||||
else
|
||||
var elementHide = $(elementClick).parents('#header').find(elementSlide);
|
||||
$(elementHide).slideUp();
|
||||
})
|
||||
};
|
||||
$(document).ready(function(){
|
||||
tmDropDown ('', '#header .current', 'ul.toogle_content', 'active'); // all of this should be defined or left empty brackets
|
||||
//tmDropDown ('cart', 'li#shopping_cart > a', '#cart_block', 'active'); // all of this should be defined or left empty brackets
|
||||
});
|
||||
@@ -453,6 +453,7 @@ $(function() {
|
||||
updateState();
|
||||
updateNeedIDNumber();
|
||||
updateZipCode();
|
||||
$("select.form-control,input[type='checkbox']").uniform();
|
||||
});
|
||||
}
|
||||
else if (isGuest)
|
||||
@@ -726,8 +727,6 @@ function bindInputs()
|
||||
// Recyclable checkbox
|
||||
$('#recyclable').click(function() {
|
||||
updateCarrierSelectionAndGift();
|
||||
$("select.form-control,input[type='checkbox']").uniform();
|
||||
|
||||
});
|
||||
|
||||
// Gift checkbox update
|
||||
@@ -737,7 +736,6 @@ function bindInputs()
|
||||
else
|
||||
$('#gift_div').hide();
|
||||
updateCarrierSelectionAndGift();
|
||||
$("select.form-control,input[type='checkbox']").uniform();
|
||||
});
|
||||
|
||||
if ($('#gift').is(':checked'))
|
||||
@@ -755,6 +753,7 @@ function bindInputs()
|
||||
$('#cgv').click(function() {
|
||||
updatePaymentMethodsDisplay();
|
||||
});
|
||||
$("select.form-control,input[type='checkbox']").uniform();
|
||||
}
|
||||
|
||||
function multishippingMode(it)
|
||||
|
||||
@@ -23,14 +23,15 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
$('document').ready(function(){
|
||||
reloadProductComparison();
|
||||
});
|
||||
|
||||
reloadProductComparison = function() {
|
||||
$('input:checkbox.comparator').each(function() {
|
||||
var checkedCheckbox = $(this);
|
||||
if (checkedCheckbox.is(':checked'))
|
||||
checkedCheckbox.parent().addClass('checked');
|
||||
});
|
||||
$('a.cmp_remove').click(function(){
|
||||
|
||||
var idProduct = $(this).attr('rel').replace('ajax_id_product_', '');
|
||||
var idProduct = $(this).prop('rel').replace('ajax_id_product_', '');
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?controller=products-comparison&ajax=1&action=remove&id_product=' + idProduct,
|
||||
@@ -41,14 +42,12 @@ reloadProductComparison = function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('input:checkbox.comparator').click(function(){
|
||||
|
||||
var idProduct = $(this).attr('value').replace('comparator_item_', '');
|
||||
var totalValueNow = parseInt($('.bt_compare').next('.compare_product_count').val());
|
||||
var idProduct = $(this).prop('value').replace('comparator_item_', '');
|
||||
var checkbox = $(this);
|
||||
|
||||
if(checkbox.is(':checked'))
|
||||
{
|
||||
{
|
||||
$.ajax({
|
||||
url: 'index.php?controller=products-comparison&ajax=1&action=add&id_product=' + idProduct,
|
||||
async: true,
|
||||
@@ -56,12 +55,19 @@ reloadProductComparison = function() {
|
||||
success: function(data){
|
||||
if (data === '0')
|
||||
{
|
||||
checkbox.attr('checked', false);
|
||||
checkbox.prop('checked', false);
|
||||
alert(max_item);
|
||||
}
|
||||
else {
|
||||
checkbox.prop('checked', true),
|
||||
checkbox.parent().addClass('checked'),
|
||||
totalVal = totalValueNow +1,
|
||||
$('.bt_compare').next('.compare_product_count').val(totalVal),
|
||||
totalValue(totalVal)
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
checkbox.attr('checked', false);
|
||||
checkbox.prop('checked', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -73,12 +79,20 @@ reloadProductComparison = function() {
|
||||
cache: false,
|
||||
success: function(data){
|
||||
if (data === '0')
|
||||
checkbox.attr('checked', true);
|
||||
},
|
||||
|
||||
checkbox.prop('checked', true);
|
||||
checkbox.parent().removeClass('checked');
|
||||
totalVal = totalValueNow -1;
|
||||
$('.bt_compare').next('.compare_product_count').val(totalVal),
|
||||
totalValue(totalVal)
|
||||
},
|
||||
error: function(){
|
||||
checkbox.attr('checked', true);
|
||||
checkbox.prop('checked', true);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function totalValue(value) {
|
||||
$('.bt_compare').find('.total-compare-val').html(value);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
||||
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
|
||||
window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document);
|
||||
|
||||
/*! Respond.js v1.3.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
|
||||
(function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this);
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
$(document).on('keyup', 'input.validate, textarea.validate', function() {
|
||||
if ($(this).hasClass('is_required') || $(this).val().length)
|
||||
{
|
||||
if (window['validate_'+$(this).attr('data-validate')]($(this).val()))
|
||||
$(this).parent().removeClass('form-error').addClass('form-ok');
|
||||
else
|
||||
$(this).parent().addClass('form-error').removeClass('form-ok');
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user