$ = jQuery.noConflict(); jQuery(document).ready(function ($) { // click touch var isIOS = ((/iphone|ipad/gi).test(navigator.appVersion)); var myDown = isIOS ? "touchstart" : "mousedown"; var myUp = isIOS ? "touchend" : "mouseup"; $.event.special.myDown = { setup: function () { var isIOS = ((/iphone|ipad/gi).test(navigator.appVersion)); var myDown = isIOS ? "touchstart" : "mousedown"; $(this).bind(myDown + ".myDownEvent", function (event) { event.type = "myDown"; ($.event.dispatch || $.event.handle).call(this, event); }); }, teardown: function () { $(this).unbind(".myDownEvent"); } }; var m_body = $(document).find('body'); /*if( m_body.attr('id') == 'module-allinone_rewards-rewards' || m_body.attr('id') == 'module-allinone_rewards-sponsorship' ) { }*/ if(m_body.attr('id') == 'module-allinone_rewards-sponsorship') { var t_containerSponsorship = $(document).find('#idTab1 #sponsorship_form ul'); if(t_containerSponsorship.length > 0) { var t_sponsorShipUrl = t_containerSponsorship.find('li:first-child'); var t_sponsorShipUrlStart = t_sponsorShipUrl.html().indexOf('http'); if(t_sponsorShipUrlStart != -1) { var t_pos = t_sponsorShipUrlStart; var t_url = t_sponsorShipUrl.html().substring(t_pos); t_sponsorShipUrl.html(t_sponsorShipUrl.html().replace(t_url, ''+t_url+'Copier')); } } } $(document).on(myDown, '.sponsorship_url_copy', function(){ copyToClipboard('.sponsorship_url'); }); function copyToClipboard(element) { var $temp = jQuery(""); m_body.append($temp); $temp.val($(element).text()).select(); document.execCommand("copy"); $temp.remove(); } $(document).on('change', 'form#customer-form input.custom-check-registration-newsletter', function(){ var t_checked = false; var t_inputNl = $(document).find('form#customer-form input[name="newsletter"]'); $(document).find('input.custom-check-registration-newsletter').each(function(){ if($(this).is(':checked')) { t_checked = true; } }); if(t_checked) { t_inputNl.prop('checked', true); } else { t_inputNl.prop('checked', false); } }); $(document).find('.nosto_element.notitle h2').remove(); if($(document).find('button#submitReturnMerchandise').size() > 0) { $(document).find('#submitReturnMerchandiseSelect').on('change', function(){ var t_returnVal = $(this).val(); if(t_returnVal !== "") { $(document).find('button#submitReturnMerchandise').attr('disabled', false); } else { $(document).find('button#submitReturnMerchandise').attr('disabled', true); } }); } $(document).find('#nosto-page-product1 .nosto-image-container').css('height', 'auto'); });