PageSourceSearch

https://www.franchelle.com/wp-content/themes/shopkeeper/js/public/wc-product-quantity.js?ver=10.9.9

js franchelle.com collected 2026-10-10 00:37:23 UTC 2,159 bytes, 98 lines download raw bytes

1jQuery( function($) {
2
3    'use strict';
4
5    // Product Quantity Custom Buttons
6
7    $(document).on('click', '.plus-btn', function(e) {
8
9        var input = $(this).prev('input.custom-qty');
10
11    	if( $('body').hasClass('rtl') ) {
12    		input = $(this).next('input.custom-qty');
13    	}
14
15        var val  = parseInt(input.val());
16        if( !val ) { val = 0; }
17        var max  = parseInt(input.attr('max'));
18        var step = parseInt(input.attr('step')) || 1;
19
20        if( !isNaN(max) ) {
21            if( max > val ) {
22                input.val( val+step ).change();
23            }
24        } else {
25            input.val( val+step ).change();
26        }
27
28        return false;
29    });
30
31    $(document).on('click', '.minus-btn', function(e) {
32
33        var input = $(this).next('input.custom-qty');
34
35    	if( $('body').hasClass('rtl') ) {
36    		input = $(this).prev('input.custom-qty');
37    	}
38
39        var val  = parseInt(input.val());
40        if( !val ) { val = 0; }
41        var min  = parseInt(input.attr('min'));
42        var step = parseInt(input.attr('step')) || 1;
43
44        if( !isNaN(min) ) {
45            if( min < val ) {
46                input.val( val-step ).change();
47            }
48        } else {
49            input.val( val-step ).change();
50        }
51
52        return false;
53    });
54
55	var windowWidth = $(window).width();
56
57    // Input Quantity Long Press
58
59    if (  windowWidth > 1024 ) {
60
61		var timer;
62
63		$(document).on('mousedown', '.plus-btn', function(e) {
64
65		    var input = $(this).prev('input.custom-qty');
66		    var val = parseInt(input.val());
67
68		    timer = setInterval(function() {
69
70		        val++;
71		        input.val(val);
72
73		    }, 250);
74
75		});
76
77		$(document).on('mousedown', '.minus-btn', function(e) {
78
79		    var input = $(this).next('input.custom-qty');
80		    var val = parseInt(input.val());
81
82		    timer = setInterval(function() {
83
84		      	if (val > 1) {
85					val--;
86					input.val(val);
87		        }
88
89		     }, 250);
90		});
91
92
93		document.addEventListener("mouseup", function(){
94	   		if (timer) clearInterval(timer)
95		});
96
97	}
98});

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.