| Server IP : 185.252.147.100 / Your IP : 216.73.217.33 Web Server : nginx/1.27.3 System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 User : mitr ( 1000) PHP Version : 8.2.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/html/mitrofanov.ru/public/wp-content/themes/greenshift/assets/qty/ |
Upload File : |
"use strict";function GSPB_quantityInput(t=document){let e=t.getElementsByClassName("quantity");for(let n=0;n<e.length;n++){let a=e[n],u=a.querySelector('input[type="number"]'),i=document.createElement("button");i.setAttribute("type","button"),i.classList.add("sub"),i.setAttribute("title","Down"),i.textContent="-",a.insertBefore(i,u);let l=document.createElement("button");l.setAttribute("type","button"),l.setAttribute("title","Up"),l.classList.add("add"),l.textContent="+",a.appendChild(l);let s=u.closest("form").querySelector("[data-quantity]");l.addEventListener("click",function(){let t=parseInt(u.value);isNaN(t)&&(t=0),u.value=t+1,s&&s.setAttribute("data-quantity",t+1),u.dispatchEvent(new Event("change"))}),i.addEventListener("click",function(){let t=parseInt(u.value),e=parseInt(u.getAttribute("min"));isNaN(t)&&(t=e),t>e&&(u.value=t-1,s&&s.setAttribute("data-quantity",t-1),u.dispatchEvent(new Event("change")))})}}GSPB_quantityInput();