1/** 2 * ISC License 3 * 4 * Copyright (c) 2025 idnovate.com 5 * idnovate is a Registered Trademark & Property of idnovate.com, innovación y desarrollo SCP 6 * 7 * Permission to use, copy, modify, and/or distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 13 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 16 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 * 19 * @author idnovate 20 * @copyright 2025 idnovate 21 * @license https://www.isc.org/licenses/ https://opensource.org/licenses/ISC ISC License 22 */ 23 24if (typeof updatePrice !== "undefined") { 25 updatePrice = (function() { 26 var updatePriceCached = updatePrice; 27 28 return function(json) { 29 updatePriceCached.apply(this, arguments); 30 showPriceModified(); 31 } 32 })(); 33} else if (typeof updateDisplay !== "undefined") { 34 updateDisplay = (function() { 35 var updateDisplayCached = updateDisplay; 36 37 return function(json) { 38 updateDisplayCached.apply(this, arguments); 39 showPriceModified(); 40 } 41 })(); 42} 43 44function showPriceModified(value) { 45 if (typeof combinationsFromController !== "undefined") { 46 if (combinationsFromController[parseInt(value)] != undefined) { 47 if (combinationsFromController[parseInt(value)] == 1) { 48 $('.product-flag.on-sale').show(); 49 } else { 50 if (parseInt($('#quantity_wanted').val()) >= combinationsFromController[parseInt(value)]) { 51 $('.product-flag.on-sale').show(); 52 } else { 53 $('.product-flag.on-sale').hide(); 54 } 55 } 56 } 57 } 58} 59 60jQuery(document).on("change", ".product-variants-item li input", function() { 61 showPriceModified(parseInt($(this).val())); 62}); 63 64jQuery(document).ready(function() { 65 showPriceModified(parseInt($('.product-variants-item input:radio:checked').val())); 66}) 67 68jQuery(document).on("click", ".bootstrap-touchspin-up", function() { 69 showPriceModified(parseInt($('.product-variants-item input:radio:checked').val())); 70}); 71 72jQuery(document).on("click", ".bootstrap-touchspin-down", function() { 73 showPriceModified(parseInt($(this).val())); 74}); 75 76 77function displayCountdown(countdown, countdown_selector, today, day_txt, hour_txt, minute_txt, second_txt) 78{ 79 let countDownDate = Date.parse(countdown.replace(/ /g,"T")+'Z'); 80 let now = Date.parse(today.replace(/ /g,"T")+'Z'); 81 var x = setInterval(function() { 82 var distance = countDownDate - now; 83 let days = Math.floor(distance / (1000 * 60 * 60 * 24)); 84 let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 85 let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 86 let seconds = Math.floor((distance % (1000 * 60)) / 1000); 87 88 $(countdown_selector).each(function() { 89 $(this).html(days + day_txt + ' ' + hours + hour_txt + ' ' + minutes + minute_txt + ' ' + seconds + second_txt); 90 }); 91 92 if (distance < 0) { 93 clearInterval(x); 94 $(countdown_selector).html(""); 95 } 96 now += 1000; 97 } 98 , 1000); 99} 100 101$(document).ready(function() { 102 $('.cd_element').each(function() { 103 const div = this; // Selecciona el primero que tenga esa clase 104 const id_product = div.dataset.id_product; 105 const countdown = div.dataset.countdown; 106 const today = div.dataset.today; 107 const day = div.dataset.day; 108 const hour = div.dataset.hour; 109 const minute = div.dataset.minute; 110 const second = div.dataset.second; 111 displayCountdown(countdown, ".countdown_"+id_product, today, day, hour, minute, second); 112 }) 113});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.