PageSourceSearch

https://www.iconictiles.com.au/wp-content/plugins/product-enquiry-pro/js/public/frontend.js?ver=7.1.2

js iconictiles.com.au collected 2026-10-04 09:02:25 UTC 54,314 bytes, 1,373 lines download raw bytes

1/*! http://mths.be/placeholder v2.0.8 by @mathias */
2;
3var error_val = 0;
4var err_string = '';
5(function (window, document, $) {
6
7    var isOperaMini = Object.prototype.toString.call(window.operamini) == '[object OperaMini]';
8    var isInputSupported = 'placeholder' in document.createElement('input') && !isOperaMini;
9    var isTextareaSupported = 'placeholder' in document.createElement('textarea') && !isOperaMini;
10    var prototype = $.fn;
11    var valHooks = $.valHooks;
12    var propHooks = $.propHooks;
13    var hooks;
14    var placeholder;
15
16    if (isInputSupported && isTextareaSupported) {
17
18        placeholder = prototype.placeholder = function () {
19            return this;
20        };
21
22        placeholder.input = placeholder.textarea = true;
23
24    } else {
25
26        placeholder = prototype.placeholder = function () {
27            var $this = this;
28            $this
29            .filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]')
30            .not('.placeholder')
31            .bind({
32                'focus.placeholder': clearPlaceholder,
33                'blur.placeholder': setPlaceholder
34            })
35            .data('placeholder-enabled', true)
36            .trigger('blur.placeholder');
37            return $this;
38        };
39
40        placeholder.input = isInputSupported;
41        placeholder.textarea = isTextareaSupported;
42
43        hooks = {
44            'get': function (element) {
45                var $element = $(element);
46
47                var $passwordInput = $element.data('placeholder-password');
48                if ($passwordInput) {
49                    return $passwordInput[0].value;
50                }
51
52                return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value;
53            },
54            'set': function (element, value) {
55                var $element = $(element);
56
57                var $passwordInput = $element.data('placeholder-password');
58                if ($passwordInput) {
59                    return $passwordInput[0].value = value;
60                }
61
62                if (!$element.data('placeholder-enabled')) {
63                    return element.value = value;
64                }
65                if (value == '') {
66                    element.value = value;
67                    // Issue #56: Setting the placeholder causes problems if the element continues to have focus.
68                    if (element != safeActiveElement()) {
69                        // We can't use `triggerHandler` here because of dummy text/password inputs :(
70                        setPlaceholder.call(element);
71                    }
72                } else if ($element.hasClass('placeholder')) {
73                    clearPlaceholder.call(element, true, value) || (element.value = value);
74                } else {
75                    element.value = value;
76                }
77                // `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363
78                return $element;
79            }
80        };
81
82        if (!isInputSupported) {
83            valHooks.input = hooks;
84            propHooks.value = hooks;
85        }
86        if (!isTextareaSupported) {
87            valHooks.textarea = hooks;
88            propHooks.value = hooks;
89        }
90
91        $(function () {
92            // Look for forms
93            $(document).delegate('form', 'submit.placeholder', function () {
94                // Clear the placeholder values so they don't get submitted
95                var $inputs = $('.placeholder', this).each(clearPlaceholder);
96                setTimeout(function () {
97                    $inputs.each(setPlaceholder);
98                }, 10);
99            });
100        });
101
102        // Clear placeholder values upon page reload
103        $(window).bind('beforeunload.placeholder', function () {
104            $('.placeholder').each(function () {
105                this.value = '';
106            });
107        });
108
109    }
110
111    jQuery(document).on('input', '.wdm-modal_textarea, #wdm-message', function() {
112        var text_max = 500;
113        var text_length = jQuery(this).val().length;
114        var text_remaining = text_max - text_length;
115
116        jQuery(this).next('#lbl-char').find('.wdmRemainingCount').html(text_remaining);
117        if (text_remaining < 50) {
118            jQuery(this).next('#lbl-char').css('color','red');
119        } else {
120            jQuery(this).next('#lbl-char').css('color','#43454b');
121        }
122    });
123
124    function args(elem) {
125        // Return an object of element attributes
126        var newAttrs = {};
127        var rinlinejQuery = /^jQuery\d+$/;
128        $.each(elem.attributes, function (i, attr) {
129            if (attr.specified && !rinlinejQuery.test(attr.name)) {
130                newAttrs[attr.name] = attr.value;
131            }
132        });
133        return newAttrs;
134    }
135
136    function clearPlaceholder(event, value) {
137        var input = this;
138        var $input = $(input);
139        if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) {
140            if ($input.data('placeholder-password')) {
141                $input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id'));
142                // If `clearPlaceholder` was called from `$.valHooks.input.set`
143                if (event === true) {
144                    return $input[0].value = value;
145                }
146                $input.focus();
147            } else {
148                input.value = '';
149                $input.removeClass('placeholder');
150                input == safeActiveElement() && input.select();
151            }
152        }
153    }
154
155    function setPlaceholder() {
156        var $replacement;
157        var input = this;
158        var $input = $(input);
159        var id = this.id;
160        if (input.value == '') {
161            if (input.type == 'password') {
162                if (!$input.data('placeholder-textinput')) {
163                    try {
164                        $replacement = $input.clone().attr({'type': 'text'});
165                    } catch (e) {
166                        $replacement = $('<input>').attr($.extend(args(this), {'type': 'text'}));
167                    }
168                    $replacement
169                    .removeAttr('name')
170                    .data({
171                        'placeholder-password': $input,
172                        'placeholder-id': id
173                    })
174                    .bind('focus.placeholder', clearPlaceholder);
175                    $input
176                    .data({
177                        'placeholder-textinput': $replacement,
178                        'placeholder-id': id
179                    })
180                    .before($replacement);
181                }
182                $input = $input.removeAttr('id').hide().prev().attr('id', id).show();
183                // Note: `$input[0] != input` now!
184            }
185            $input.addClass('placeholder');
186            $input[0].value = $input.attr('placeholder');
187        } else {
188            $input.removeClass('placeholder');
189        }
190    }
191
192    function safeActiveElement() {
193        // Avoid IE9 `document.activeElement` of death
194        // https://github.com/mathiasbynens/jquery-placeholder/pull/99
195        try {
196            return document.activeElement;
197        } catch (err) {
198        }
199    }
200
201}(this, document, jQuery));
202
203jQuery(document).ready(function () {
204    /**
205     * The attached trigger handler performs two functionalities:
206     *   1. Disable enquiry button when variation is not selected.
207     *   2. Enable enquiry button when variation is selected.
208     */
209    jQuery('form.variations_form.cart').on('show_variation', enableDisableEnquiryButton);
210    jQuery('form.variations_form.cart').on('reset_data', enableDisableEnquiryButton);
211
212    jQuery('body').append('<div id="wdm-modal-clone"></div>');
213    jQuery('.btnAddRemark').click(function (e) {
214        e.preventDefault();
215        product_id = jQuery(this).attr('data-prod-id');
216
217        //This is for variable product
218        variation_id = '';
219        variation_detail = "";
220
221        if(jQuery('.variation_id').length>0 && jQuery('.variation_id').val() =='' || jQuery('.variation_id').val() == 0)
222        {
223            alert(wdm_data.select_variation);
224            return;
225        }
226        else if (jQuery('.variation_id').length>0) {
227            variation_id = jQuery('.variation_id').val();
228            jQuery('select[name^=attribute_]').each(function(ind, obj){
229                if(variation_detail = ""){
230                    variation_detail = jQuery(this).val();
231                }else{
232                    variation_detail = variation_detail.concat(','+jQuery(this).val());
233                }
234            });
235        }
236        //End of variable product
237
238
239        txt_remark = '#wdm_remark_' + product_id;
240        remark = jQuery(txt_remark).val();
241        elem = jQuery(this);
242        quantity =1;
243        if(jQuery('input[name="quantity"]').length>0)
244        {
245            quantity =jQuery('input[name="quantity"]').val();
246        }
247        mydatavar = {
248            action: 'wdm_add_product_in_enq_cart',
249            'product_id': product_id,
250            'remark': remark,
251            'product_quant':quantity,
252            'variation':variation_id,
253            'security' : jQuery('#AddCartNonce').val(),
254        };
255        jQuery(".quoteup_registered_parameter").each(function () {
256            mydatavar[jQuery(this).attr('id')] = jQuery(this).val();
257        });
258        jQuery('.wdmquoteup-loader').css('display', 'inline-block');
259        jQuery('#wdm-cart-count').addClass('animated infinite pulse');
260
261        jQuery.post(wdm_data.ajax_admin_url, mydatavar, function (response) {
262            if(response=='SECURITY_ISSUE'){
263             jQuery('.wdmquoteup-loader').css('display', 'none');
264             jQuery('#nonce_error').css('display', 'block');
265             elem.closest('form').css('display', 'none');
266
267             return false;
268         }
269
270         jQuery('.wdmquoteup-loader').css('display', 'none');
271         jQuery('.wdmquoteup-success-wrap').css('display', 'block');
272         elem.closest('form').css('display', 'none');
273         jQuery('#wdm-cart-count').removeClass('animated infinite pulse');
274         var count_val = parseInt(response);
275
276         var count_txt = '';
277         if(count_val > 1) {
278            count_txt = response+ ' ' + wdm_data.products_added_in_quote_cart;
279        } else {
280            count_txt = response+' ' + wdm_data.product_added_in_quote_cart;
281        }
282        jQuery('#wdm-cart-count').children('a').html('<span class="wdm-quoteupicon wdm-quoteupicon-list"></span><span class="wdm-quoteupicon-count">' + response + '</span>');
283        jQuery('#wdm-cart-count').children('a').attr('title',count_txt);
284        jQuery('#wdm-cart-count').css('display','block');
285
286    });
287        return false;
288
289    });
290    jQuery('input[type=text], textarea').click(function (event) {
291        event.preventDefault();
292    });
293
294    var error = 0;
295    jQuery('input, textarea').placeholder();
296
297    jQuery("#custname").change(function () {
298        jQuery('#custname').attr("placeholder", wdm_data.nm_place);
299    });
300    jQuery("#txtemail").change(function () {
301        jQuery("#txtemail").attr("placeholder", wdm_data.email_place);
302    });
303
304// This function is for adding the products to the enquiry cart if MPE
305jQuery("body").on("click", '[id^="wdm-quoteup-trigger-"]', function (event) {
306    var selector = jQuery(this);
307    if(wdm_data.MPE=='yes') {
308      if(selector.hasClass('added')){
309          return;
310      }
311
312      id = jQuery(this).attr('id');
313      number = id.match("wdm-quoteup-trigger-(.*)");
314      product_id = number[1];
315
316        // This is for variable product support
317        variation_id = "";
318        var variation_detail = [];
319        var $variation_id_obj = '';
320        $variation_id_obj = jQuery(wdm_data.variation_id_selector);
321        // If variation Id element is not found.
322        if ($variation_id_obj.length == 0) {
323            $variation_id_obj = selector.closest('.summary.entry-summary').find('.variation_id:first-child');
324        }
325  
326        if($variation_id_obj.length > 0 && selector.hasClass('quoteup-enq-btn-variable-product') && ($variation_id_obj.val() == '' || $variation_id_obj.val() == 0))
327        {
328            alert(wdm_data.select_variation);
329            return;
330        }
331        else if ($variation_id_obj.length>0 && selector.hasClass('quoteup-enq-btn-variable-product')) {
332            variation_id = $variation_id_obj.val();
333            var variationSelectorElement = pepGetVariationSelectorElement();
334            variationSelectorElement.find('select[name^=attribute_]').each(function(ind, obj) {
335                name = jQuery(this).attr('name');
336                name = name.substring(10);
337                variation = name + " : " + jQuery(this).val();
338                variation_detail.push(variation);
339            });
340        }
341        //ENd of code for variable product support
342
343        txt_remark = '#wdm_remark_' + product_id;
344        remark = jQuery(txt_remark).val();
345        quantity =1;
346        if(jQuery('input[name="quantity"]').length>0)
347        {
348            quantity =jQuery('input[name="quantity"]').val();
349        }
350
351        var data = {
352            action: 'wdm_trigger_add_to_enq_cart',
353            'product_id': product_id,
354            'remark': remark,
355            'product_quant':quantity,
356            'variation':variation_id,
357            'variation_detail' : variation_detail,
358            'author_email' : jQuery(this).next('#author_email').val(),
359            'language' : jQuery('#wdmLocale').val(),
360            'security' : jQuery('#AddCartNonce').val(),
361        };
362
363        selector.addClass('loading');
364        if (jQuery(event.target).is('a')){
365            selector.after('<img class=\'loading-image\' src="' + wdm_data.spinner_img_url + '"/>');
366            selector.prop('disabled', true);
367            event.preventDefault();
368        }
369        jQuery('[name^= attribute_]').change(function()
370        {
371        selector.html(wdm_data.view_quote_cart_link_with_text).removeClass('added'); 
372        selector.text(wdm_data.buttonText);
373        selector.removeAttr("onclick");
374        });
375        //Send ajax request
376        jQuery.ajax({
377            url: wdm_data.ajax_admin_url,
378            type: 'post',
379            dataType: 'json',
380            data: data,
381            // beforeSend: function () {
382            //     console.log(data);
383            // },
384            success: function ( response ) {
385                selector.html(wdm_data.view_quote_cart_link_with_text).addClass('added').removeClass('loading');
386                //If loading image is manually added, remove it after adding is succesful
387                if(selector.next().hasClass('loading-image')){
388                    selector.next().remove();
389                    selector.removeProp('disabled');
390                }
391                
392                //Adding onclick link because browsers other than Chrome don't support redirecting to link on clicking the button
393                selector.attr('onclick', "location.href='" + wdm_data.view_quote_cart_link + "'");
394
395                jQuery('#wdm-cart-count').removeClass('animated infinite pulse');
396                var intRegex = /^\d+$/;
397                if('SUCCESS' != response.status || !intRegex.test(response.product_count)){
398                    return;
399                }
400                var count_val = parseInt(response.product_count);
401                var count_txt = response.product_count_in_text;
402               
403                jQuery('#wdm-cart-count').children('a').html('<span class="wdm-quoteupicon wdm-quoteupicon-list"></span><span class="wdm-quoteupicon-count">' + count_val + '</span>');
404                jQuery('#wdm-cart-count').children('a').attr('title', count_txt);
405                jQuery('#wdm-cart-count').css('display','block');
406
407                // public_quoteup_show();
408                if (typeof public_quoteup_get_cart != "undefined") {
409                    public_quoteup_get_cart();
410                }
411            },
412            error: function ( error ) {
413                console.log(error);
414            }
415      
416        });
417        /* jQuery.post(wdm_data.ajax_admin_url, data, function (response) {
418            selector.html(wdm_data.view_quote_cart_link_with_text).addClass('added').removeClass('loading');
419            //If loading image is manually added, remove it after adding is succesful
420            if(selector.next().hasClass('loading-image')){
421                selector.next().remove();
422                selector.removeProp('disabled');
423            }
424            
425            //Adding onclick link because browsers other than Chrome don't support redirecting to link on clicking the button
426            selector.attr('onclick', "location.href='" + wdm_data.view_quote_cart_link + "'");
427
428            jQuery('#wdm-cart-count').removeClass('animated infinite pulse');
429            var intRegex = /^\d+$/;
430            if(!intRegex.test(response)){
431                return;
432            }
433            var count_val = parseInt(response);
434            var count_txt = '';
435            if(count_val > 1) {
436                count_txt = response+ ' ' + wdm_data.products_added_in_quote_cart;
437            } else {
438                count_txt = response+' ' + wdm_data.product_added_in_quote_cart;
439            }
440            jQuery('#wdm-cart-count').children('a').html('<span class="wdm-quoteupicon wdm-quoteupicon-list"></span><span class="wdm-quoteupicon-count">' + response + '</span>');
441            jQuery('#wdm-cart-count').children('a').attr('title',count_txt);
442            jQuery('#wdm-cart-count').css('display','block');
443
444            // public_quoteup_show();
445            // public_quoteup_get_cart();
446        }); */
447    }else{
448        //THis is for variable product support
449        // var $variation_id_obj = selector.closest('.summary.entry-summary').children('form').children('input.variation_id');
450
451        var $variation_id_obj = '';
452        $variation_id_obj = jQuery(wdm_data.variation_id_selector);
453        // If variation Id element is not found.
454        if ($variation_id_obj.length == 0) {
455            $variation_id_obj = selector.closest('.summary.entry-summary').find('.variation_id:first-child');
456        }
457
458        
459        if($variation_id_obj.length > 0 && selector.hasClass('quoteup-enq-btn-variable-product') && ($variation_id_obj.val() == '' || $variation_id_obj.val() == 0)
459)
460        {
461            alert(wdm_data.select_variation);
462            return;
463        }
464        //ENd of code for variable product support
465
466        event.preventDefault();
467
468        id = jQuery(this).attr('id');
469        number = id.match("wdm-quoteup-trigger-(.*)");
470        product_id = number[1];
471        modal = jQuery('#wdm-quoteup-modal-'+product_id);
472        header = modal.find('.wdm-modal-header');
473        form = modal.find('.wdm-modal-body form');
474        msg = jQuery('.wdm-msg');
475        var number = id.match("wdm-quoteup-trigger-(.*)");
476        if (header.parent().is("a")) {
477            header.unwrap();
478        }
479        if (form.parent().is("a")) {
480            form.unwrap();
481        }
482        if (msg.parent().is("a")) {
483            msg.unwrap();
484        }
485        jQuery('.wdm-quoteup-form').css('display', 'block');
486        modal_id = "#wdm-quoteup-modal-" + number[1];
487        formId = jQuery( modal_id ).find('form').attr('id');
488        if(formId == 'frm_enquiry') {
489            jQuery( modal_id ).appendTo("#wdm-modal-clone");
490            var oldModalId = jQuery('#wdm-modal-clone').children().attr('id');
491            // jQuery('#wdm-modal-clone').children().attr('id', 'clone-'+oldModalId);
492            jQuery(modal_id).modal('show');
493        } else {
494            jQuery( modal_id ).appendTo("#wdm-modal-clone");
495            jQuery('.wdm-quoteup-form').css('display', 'block');
496            modal_id = "#wdm-quoteup-modal-" + number[1];
497            jQuery(modal_id).modal('show');
498        }
499
500        jQuery('.wdm-modal-footer').css('display', 'block');
501        jQuery('#error').css('display', 'none');
502        jQuery('#nonce_error').css('display', 'none');
503        jQuery('.wdmquoteup-success-wrap').css('display', 'none');
504    }
505
506});
507
508jQuery('body').on('shown.bs.wdm-modal','.wdm-modal',function(e) {
509    id = jQuery(this).attr('id');
510    number = id.match("wdm-quoteup-modal-(.*)");
511    product_id = number[1];
512    jQuery('#wdm-quoteup-trigger-'+product_id).removeClass('loading');
513    jQuery('#wdm-cart-count').addClass('animated infinite pulse');
514    jQuery(this).find("input[type!='hidden']").first().focus();
515});
516
517jQuery('body').on('hidden.bs.wdm-modal','.wdm-modal',function(e) {
518    jQuery('#wdm-cart-count').removeClass('animated infinite pulse');
519    // formId = jQuery("#wdm-modal-clone").find('form').attr('id');
520    /*if(formId == 'frm_enquiry') {
521        jQuery('#wdm-modal-clone').empty();        
522    }*/
523});
524
525/**
526*Function called on click of the Send button on the Enquiry form.
527* Each field is validated on the client side and appropriate error message are displayed if required.
528* The google recaptcha is verified.
529* If all checks are passed there is an ajax call with all the parameters sent to the Server side.
530* Ajax call is made to submit the enquiry.
531* If the ajax call fails error is shown.
532*/
533
534jQuery("body").on('click', ' [id^="btnSend_"]', function (e) {
535    e.preventDefault();
536    error_val = 0;
537    err_string = '';
538    var $this = jQuery(this);
539    var $form_data;    
540    id_send = $this.attr('id');
541    var id_array = id_send.match("btnSend_(.*)");
542
543    p_name = jQuery('#product_name_' + id_array[1]).val();
544
545    var message = jQuery(this).closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#txtmsg').val();
546    var phone = jQuery(this).closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#txtphone').val();
547    var fields = wdm_data.fields;
548    var error_field;
549//This is for variable product support
550variation_id = '';
551variation_detail = [];
552var $variation_id_obj = '';
553$variation_id_obj = jQuery(wdm_data.variation_id_selector);
554// If variation Id element is not found.
555if($variation_id_obj.length == 0) {
556    $variation_id_obj = jQuery('#wdm-quoteup-trigger-'+id_array[1]).closest('.summary.entry-summary').find('.variation_id:first-child');
557}
558
559if ($variation_id_obj.length>0) {
560    variation_id = $variation_id_obj.val();
561    jQuery('select[name^=attribute_]').each(function(ind, obj){
562        name = jQuery(this).attr('name');
563        name = name.substring(10);
564        variation = name + " : " + jQuery(this).val();
565        variation_detail.push(variation);
566    });
567}
568//End of variable product code
569nm_regex = /^[a-zA-Z ]+$/;
570var enquiry_field;
571
572if (fields.length > 0) {
573    error_field = jQuery(this).closest('.form_input').siblings('.form-errors-wrap');
574    error_field.css( 'display', 'none' );
575    jQuery('.error-list-item').remove();
576    jQuery( '.wdm-error' ).removeClass('wdm-error');
577    for (i = 0; i < fields.length; i++) {
578
579        if('txtdate' == fields[i].id)
580        {
581            enquiry_field = $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find('input[id^=' + fields[i].id + ']');
582        }
583        else
584        {
585            enquiry_field = $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#' + fields[i].id);
586        }
587
588        var temp = enquiry_field.val();
589
590        var required = fields[i].required;
591        if (fields[i].validation !== "") {
592            var validation = new RegExp(fields[i].validation);
593        }
594
595        var message = fields[i].validation_message;
596        var flag = 0;
597        if (required == 'yes') {
598
599            if (fields[i].type == "file")
600            {
601
602                var attachedFiles = enquiry_field.prop('files');
603
604                if (attachedFiles.length < 1 || attachedFiles.length > 10) {
605                    enquiry_field.addClass('wdm-error');
606                    flag = 1;
607                    error_val = 1;
608                    err_string += '<li class="error-list-item">' + fields[i].required_message + '</li>';
609                } else {
610                    flag = 0;
611                    enquiry_field.removeClass('wdm-error');
612                }
613            }else if (fields[i].type == "text" || fields[i].type == "textarea")
614            {
615
616                if (temp == "") {
617                    enquiry_field.addClass('wdm-error');
618                    flag = 1;
619                    error_val = 1;
620                    err_string += '<li class="error-list-item">' + fields[i].required_message + '</li>';
621
622
623                } else {
624                    flag = 0;
625                    enquiry_field.removeClass('wdm-error');
626                }
627            }
628
629            else if (fields[i].type == "radio")
630            {
631                $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("[name=" + fields[i].id + "]").each(function () {
632
633                    var temp1 = jQuery(this);
634                    if (temp1.is(":checked"))
635                    {
636                        flag = 1;
637                    }
638                });
639
640                if (flag == 0)
641                {
642
643                    error_val = 1;
644                    $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#' + fields[i].id).parent().css("cssText", "background:#FCC !important;");
645                    err_string += '<li class="error-list-item">' + fields[i].required_message + '</li>';
646                } else
647                {
648                    $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#' + fields[i].id).parent().css("cssText", "background:white !important;");
649                }
650
651                    }//radio
652
653                    else if (fields[i].type == "checkbox")
654                    {
655                        $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("input[name=" + fields[i].id + "\\[\\]]").each(function () {
656
657                            var temp1 = jQuery(this);
658
659                            if (temp1.is(":checked")) {
660                                flag = 1;
661
662                            }
663                        });
664                        if (flag == 0) {
665
666                            error_val = 1;
667                            $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#' + fields[i].id).parent().css("cssText", "background:#FCC !important;");
668                            err_string += '<li class="error-list-item">' + fields[i].required_message + '</li>';
669                        } else
670                        {
671                            //$this.parent().siblings().find('#' + fields[i].id).parent().css("cssText", "background:white !important;");
672                $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#' + fields[i].id).parent().css("cssText", "background:white !important;");
673                        }
674
675                    }//checkbox
676                    else if(fields[i].type == "select")
677                    {
678                        $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("[name=" + fields[i].id + "]").each(function () {
679                           var temp1 = jQuery(this);
680                           if (temp1.val()!="#") {
681                            flag = 1;
682
683                        }
684                    });
685                        if (flag == 0)
686                        {
687                            error_val = 1;
688                            $this.closest('.form_input').siblings('.wdm-pep-form-inner').find('#' + fields[i].id).parent().css("cssText", "background:#FCC !important;");
689                            err_string += '<li class="error-list-item">' + fields[i].required_message + '</li>';
690                        } else
691                        {
692                            $this.closest('.form_input').siblings('.wdm-pep-form-inner').find('#' + fields[i].id).parent().css("cssText", "background:white !important;");
693                        }
694                    }
695                }//required
696
697                if (flag == 0)
698                    if (fields[i].validation != "" && temp != "")
699                    {
700                        if (!validation.test(temp))
701                        {
702
703                            enquiry_field.addClass('wdm-error');
704                            err_string += '<li class="error-list-item">' + message + '</li>';
705                            error_val = 1;
706                        }
707                        else {
708
709                            enquiry_field.removeClass('wdm-error');
710                        }
711
712                    }
713            }//for feilds loop
714        }//if
715
716        if (error_val == 0)
717        {
718            jQuery('.wdmquoteup-loader').css('display', 'inline-block');
719            jQuery('#submit_value').val(1);
720
721            let $cookieConField = $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("input[name='cookie-consent-cb[]']");
722            if($cookieConField.length > 0 && $cookieConField.is(":checked"))
723            {
724                let cname = $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#custname').val();
725                let cemail = $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#txtemail').val();
726                fun_set_cookie(cname, cemail);
727            }
728            else
729            {
730                fun_remove_cookie();
731            }
732
733            var $contactCC = jQuery('#wdm-modal-clone').find("#" + id_send).closest('.form_input').siblings('.wdm-quoteup-form-inner').find("#contact-cc");
734            if ($contactCC.length > 0 && $contactCC.is(":checked"))
735            {
736                var wdm_checkbox_val = 'checked';
737            }
738            else
739            {
740               var wdm_checkbox_val = 0;
741            }
742
743           quantity = 1;
744           if(jQuery('input[name="txtQty"]').length>0)
745           {
746            quantity =jQuery(this).closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#txtQty').val();
747        }
748        //Validates the enquiry nonce.
749        validate_enq = {
750            action: 'quoteupValidateNonce',
751            security: jQuery('#ajax_nonce').val(),
752        };
753        nonce_error = 0;
754        jQuery.post(wdm_data.ajax_admin_url, validate_enq, function (response)
755        {
756            if (response === '')
757            {
758
759                jQuery('.wdmquoteup-loader').css('display', 'none');
760                $this.closest('.form_input').siblings('#nonce_error').css('display', 'block');
761                nonce_error = 1;
762
763            }
764            else
765            {
766                jQuery('.wdmquoteup-loader').css('display', 'inline-block');
767                $form_data = new FormData();
768                $form_data.append( 'action', 'quoteupSubmitWooEnquiryForm' );
769                $form_data.append( 'security', jQuery('#ajax_nonce').val() );
770                $form_data.append( 'wdmLocale', $this.closest('#frm_enquiry').find('#wdmLocale').val());
771                $form_data.append( 'uemail', $this.closest('#frm_enquiry').find('#author_email').val() );
772                $form_data.append( 'product_name', jQuery('#product_name_' + id_array[1]).val() );
773                $form_data.append( 'product_price', jQuery('#product_price_' + id_array[1]).val() );
774                $form_data.append( 'variation_id', variation_id );
775                $form_data.append( 'variation_detail', variation_detail );
776                $form_data.append( 'product_img', jQuery('#product_img_' + id_array[1]).val() );
777                $form_data.append( 'product_id', jQuery('#product_id_' + id_array[1]).val() );
778                $form_data.append( 'product_quant', quantity );
779                $form_data.append( 'product_url', jQuery('#product_url_' + id_array[1]).val() );
780                $form_data.append( 'cc', wdm_checkbox_val );
781                $form_data.append( 'mc-subscription-checkbox', $this.closest('#frm_enquiry').find('.quoteup-mc-subscription-checkbox').prop('checked') );
782
783
784                jQuery(".quoteup_registered_parameter").each(function () {
785                    $form_data.append( jQuery(this).attr('id'), jQuery(this).val() );
786                    // $form_data[jQuery(this).attr('id')] = jQuery(this).val();
787                });
788                if (fields.length > 0) {
789
790                    for (i = 0; i < fields.length; i++) {
791
792                        if (fields[i].type == 'text' || fields[i].type == 'textarea' || fields[i].type == 'select') {
793                            // If field is txtdate.
794                            if ('txtdate' == fields[i].id) {
795                                $form_data.append( fields[i].id, $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("#" + fields[i].id + '-' + id_array[1]).val() );
796                            } else {
797                                $form_data.append( fields[i].id, $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("#" + fields[i].id).val() );
798                            }
799                            // $form_data[fields[i].id] = $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("#" + fields[i].id).val();
800                        }
801                        else if (fields[i].type == 'radio')
802                        {
803                            $form_data.append(fields[i].id, $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("[name='" + fields[i].id + "']:checked").val());
804                            // $form_data[fields[i].id] = $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("[name='" + fields[i].id + "']:checked").val();
805                        }
806                        else if (fields[i].type == 'checkbox')
807                        {
808                            var selected = "";
809                            $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("[name='" + fields[i].id + "[]']:checked").each(function () {
810                                if (selected == "") {
811
812                                    selected = jQuery(this).val();
813                                } else
814                                selected += "," + jQuery(this).val();
815                            });
816                            $form_data.append(fields[i].id, selected);
817                            // $form_data[fields[i].id] = selected;
818                        }
819                        else if (fields[i].type == 'multiple')
820                        {
821                            var selected = "";
822                            selected = $this.closest('.form_input').siblings('.wdm-quoteup-form-inner').find("#" + fields[i].id).multipleSelect('get
822Selects').join(',');
823                            $form_data.append(fields[i].id, selected);
824                            // $form_data[fields[i].id] = selected;
825                        } else if(fields[i].type == 'file')
826                        {
827                            var attachedFiles = $this.closest('.wdm-quoteup-form').find('.upload-field').prop('files');
828                            if(attachedFiles && attachedFiles.length > 0) {
829                                jQuery(attachedFiles).each(function(index, value){
830                                    $file = value;
831                                    $file_size = $file.size;
832                                    // $form_data.append( index, $file );
833                                    $form_data.append( $file.name, $file );
834                        // $form_data.append( 'media_file_name', $file.name );
835                    });
836                            }
837                        }
838
839                    }
840                }
841                
842                if ('undefined' != typeof quoteup_captcha_data && 'v3' === quoteup_captcha_data.captcha_version) {
843                    // captcha v3
844                    let site_key = quoteup_captcha_data.site_key;
845                    grecaptcha.execute(site_key, {action: 'quoteup_captcha'}).then(function(token) {
846                        $form_data.append('captcha', token);
847                        submitEnquiryFormAjax($form_data, $this, id_array, error_field);
848                    });
849                } else {
850                    if (jQuery('.g-recaptcha').length > 0){
851                        // captcha v2
852                        widgetID = $this.closest('#frm_enquiry').find('.g-recaptcha').attr('data-widgetID')
853                        $captcha = grecaptcha.getResponse(widgetID);
854                        if ($captcha != '') {
855                            $form_data.append('captcha', $captcha);
856                        }
857                    }
858                    submitEnquiryFormAjax($form_data, $this, id_array, error_field);
859                }
860            }
861        });
862}
863else
864{
865    error_field.css( 'display', 'block' );
866    error_field.find('ul.error-list').html(err_string);
867    return false;
868}
869
870return false;
871});
872
873function submitEnquiryFormAjax($form_data, $this, id_array, error_field)
874{
875    jQuery.ajax( {
876        type: 'POST',
877        url: wdm_data.ajax_admin_url,
878        data: $form_data,
879        contentType: false,
880        processData: false,
881        dataType: 'json',
882        // async: false,
883        cache: false,
884        success: function ( response ) {
885            jQuery('.wdmquoteup-loader').css('display', 'none');
886            if ( response.status == 'COMPLETED' ) {
887                // For old Analytics
888                if(window.ga && ga.create) {
889                    for (i=0; i < response.gaProducts.length; i++){
890                        ga( 'send', 'event', 'Product/Quote Enquiry Form', 'submit', response.gaProducts[i] );
891                    };
892                }
893
894                // For GA4 and Universal Analytics
895                if (typeof gtag == 'function') {
896                    for (i = 0; i < response.gaProducts.length; i++) {
897                        gtag('event', 'submit', {
898                            'event_category': 'Product/Quote Enquiry Form',
899                            'event_label': response.gaProducts[i]
900                        });
901                    }
902                }
903
904                if(wdm_data.redirect != 'n'){
905                    /**
906                     * Use this trigger event before PEP redirects to another page.
907                     *
908                     * @param object $this      The jQuery object of the button clicked to submit the form.
909                     * @param object $form_data Object of FormData containing the form values.
910                     * @param object $reponse   Ajax response.
911                     */
912                    jQuery(document).trigger('quoteupBeforeRedirect', [ $this, $form_data, response ]);
913                    window.location = wdm_data.redirect;                    
914                }
915                $this.closest('.wdm-quoteup-form').hide();
916
917                $this.closest('.form_input').parent('form').siblings('#success_' + id_array[1]).show();
918
919                /**
920                 * Use this trigger event to perform the actions/ manipulations before
921                 * the enquiry form is hidden when enquiry is successful.
922                 *
923                 * @param object $this      The jQuery object of the button clicked to submit the form.
924                 * @param object $form_data Object of FormData containing the form values.
925                 * @param object response   Ajax response.
926                 */
927                jQuery(document).trigger('quoteupEnquirySuccessBeforeFormHidden', [ $this, $form_data, response ]);
928
929                setTimeout(function() {
930                    id = $this.attr('id');
931                    number = id.match("btnSend_(.*)");
932                    modal_id = "#wdm-quoteup-modal-" + number[1];
933                    jQuery(modal_id).modal('hide');
934                    jQuery('.wdm-quoteup-form').css('display', 'none');
935                    jQuery('.wdm-modal-footer').css('display', 'none');
936                    jQuery('#error').css('display', 'none');
937                    jQuery('#nonce_error').css('display', 'none');
938                    jQuery('#success_' + number[1]).css('display', 'none'); 
939
940                    /**
941                     * Use this trigger event to perform the actions/ manipulations after
942                     * timeout when enquiry is successful.
943                     *
944                     * @param object $this      The jQuery object of the button clicked to submit the form.
945                     * @param object $form_data Object of FormData containing the form values.
946                     * @param object $reponse   Ajax response.
947                     */
948                    jQuery(document).trigger('quoteupEnquirySuccessAfterTimeout', [ $this, $form_data, response ]);
949                }, 2000)
950            } else {
951                if(response.status == 'failed')
952                {
953                    error_field.css( 'display', 'block' );
954                    error_field.find('ul.error-list').html(response.message);
955                    return false;
vendor: 13,360 bytes, lines 956-1373
956                }
957            }
958        }
959    });
960}
961
962/**
963 * Attached to WooCommerce trigger 'woocommerce_variation_has_changed'.
964 * This trigger handler performs two functionalities:
965 *   1. Disable enquiry button when variation is not selected.
966 *   2. Enable enquiry button when variation is selected.
967 */
968function enableDisableEnquiryButton(event, variation)
969{
970    let $this = jQuery(this),
971        productId = jQuery(this).data("product_id"), 
972        $enquiryButton = jQuery("button[id=wdm-quoteup-trigger-" + productId + "]"),
973        $variationIdObj = jQuery(wdm_data.variation_id_selector);
974
975    if ("1" == wdm_data.is_out_of_stock_set_enabled && ("undefined" == typeof variation || true == variation.is_in_stock)) {
976        $enquiryButton.attr('disabled','disabled');
977        $enquiryButton.hide();
978        return;
979    }
980
981    // If variation Id element is not found.
982    if ($variationIdObj.length == 0) {
983        $variationIdObj = $this.find('.variation_id:first-child');
984    }
985
986    // If enquiry button and '.variation_id' element is present.
987    if ($enquiryButton.length > 0 && $variationIdObj.length > 0) {
988        if ($variationIdObj.val() == '' || $variationIdObj.val() == 0) {
989            // Disable enquiry button when variation is not selected.
990            $enquiryButton.attr('disabled','disabled');
991        } else {
992            // Enable enquiry button when variation is selected.
993            $enquiryButton.show();
994            $enquiryButton.removeAttr('disabled');
995        }
996    }
997}
998});
999
1000//create cookie when Cookie consent field is selected
1001// Stores the customer name and Email.
1002function fun_set_cookie(cname, cemail)
1003{
1004    // var cname = $btnSend.closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#custname').val();
1005    // var cemail = $btnSend.closest('.form_input').siblings('.wdm-quoteup-form-inner').find('#txtemail').val();
1006
1007    if (cname != '' && cemail != '')
1008    {
1009        var d = new Date();
1010        d.setTime(d.getTime() + (90 * 24 * 60 * 60 * 1000));
1011        var expires = "expires=" + d.toGMTString();
1012        document.cookie = "wdmusername=" + cname + "; expires=" + expires + "; path=/";
1013        document.cookie = "wdmuseremail=" + cemail + "; expires=" + expires + ";path=/";
1014    }
1015
1016}
1017
1018// Remove cookie when cookie consent field is not present or not selected
1019// Removed the customer name and email
1020function fun_remove_cookie()
1021{
1022    document.cookie = "wdmusername=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;";
1023    document.cookie = "wdmuseremail=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/;";
1024}
1025
1026// Return the variation selector element or variation selector form element.
1027function pepGetVariationSelectorElement()
1028{
1029    if (jQuery('#product-'+product_id).find(".variations_form").length > 0) {
1030        return jQuery('#product-'+product_id).find(".variations_form");
1031    }
1032
1033    if (jQuery('.post-'+product_id).find(".variations_form").length > 0) {
1034        return jQuery('.post-'+product_id).find(".variations_form");
1035    }
1036
1037    if (jQuery('.postid-'+product_id).find(".variations_form").length > 0) {
1038        return jQuery('.postid-'+product_id).find(".variations_form");
1039    }
1040}
1041
1042
1043//bootstrap.js
1044/*!
1045 * Bootstrap v3.1.1 (http://getbootstrap.com)
1046 * Copyright 2011-2014 Twitter, Inc.
1047 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1048 */
1049
1050 if (typeof jQuery === 'undefined') {
1051    throw new Error('Bootstrap\'s JavaScript requires jQuery')
1052}
1053
1054/* ========================================================================
1055 * Bootstrap: transition.js v3.1.1
1056 * http://getbootstrap.com/javascript/#transitions
1057 * ========================================================================
1058 * Copyright 2011-2014 Twitter, Inc.
1059 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1060 * ======================================================================== */
1061
1062
1063 +function ($) {
1064    'use strict';
1065
1066    // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
1067    // ============================================================
1068
1069    function transitionEnd() {
1070        var el = document.createElement('bootstrap')
1071
1072        var transEndEventNames = {
1073            'WebkitTransition': 'webkitTransitionEnd',
1074            'MozTransition': 'transitionend',
1075            'OTransition': 'oTransitionEnd otransitionend',
1076            'transition': 'transitionend'
1077        }
1078
1079        for (var name in transEndEventNames) {
1080            if (el.style[name] !== undefined) {
1081                return {end: transEndEventNames[name]}
1082            }
1083        }
1084
1085        return false // explicit for ie8 (  ._.)
1086    }
1087
1088    // http://blog.alexmaccaw.com/css-transitions
1089    $.fn.emulateTransitionEnd = function (duration) {
1090        var called = false, $el = this
1091        $(this).one($.support.transition.end, function () {
1092            called = true
1093        })
1094        var callback = function () {
1095            if (!called)
1096                $($el).trigger($.support.transition.end)
1097        }
1098        setTimeout(callback, duration)
1099        return this
1100    }
1101
1102    $(function () {
1103        $.support.transition = transitionEnd()
1104    })
1105
1106}(jQuery);
1107
1108
1109
1110/* ========================================================================
1111 * Bootstrap: modal.js v3.1.1
1112 * http://getbootstrap.com/javascript/#modals
1113 * ========================================================================
1114 * Copyright 2011-2014 Twitter, Inc.
1115 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1116 * ======================================================================== */
1117
1118
1119 +function ($) {
1120    'use strict';
1121
1122    // MODAL CLASS DEFINITION
1123    // ======================
1124
1125    var Modal = function (element, options) {
1126        this.options = options
1127        this.$element = $(element)
1128        this.$backdrop =
1129        this.isShown = null
1130
1131        if (this.options.remote) {
1132            this.$element
1133            .find('.wdm-modal-content')
1134            .load(this.options.remote, $.proxy(function () {
1135                this.$element.trigger('loaded.bs.wdm-modal')
1136            }, this))
1137        }
1138    }
1139
1140    Modal.DEFAULTS = {
1141        backdrop: true,
1142        keyboard: true,
1143        show: true
1144    }
1145
1146    Modal.prototype.toggle = function (_relatedTarget) {
1147        return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
1148    }
1149
1150    Modal.prototype.show = function (_relatedTarget) {
1151        var that = this
1152        var e = $.Event('show.bs.wdm-modal', {relatedTarget: _relatedTarget})
1153
1154        this.$element.trigger(e)
1155
1156        if (this.isShown || e.isDefaultPrevented())
1157            return
1158
1159        this.isShown = true
1160
1161        this.escape()
1162
1163        this.$element.on('click.dismiss.bs.wdm-modal', '[data-dismiss="wdm-modal"]', $.proxy(this.hide, this))
1164
1165        this.backdrop(function () {
1166            var transition = $.support.transition && that.$element.hasClass('wdm-fade')
1167
1168            if (!that.$element.parent().length) {
1169                that.$element.appendTo(document.body) // don't move modals dom position
1170            }
1171
1172            that.$element
1173            .show()
1174            .scrollTop(0)
1175
1176            if (transition) {
1177                that.$element[0].offsetWidth // force reflow
1178            }
1179
1180            that.$element
1181            .addClass('in')
1182            .attr('aria-hidden', false)
1183
1184            that.enforceFocus()
1185
1186            var e = $.Event('shown.bs.wdm-modal', {relatedTarget: _relatedTarget})
1187
1188            transition ?
1189                    that.$element.find('.wdm-modal-dialog') // wait for modal to slide in
1190                    .one($.support.transition.end, function () {
1191                        that.$element.focus().trigger(e)
1192                    })
1193                    .emulateTransitionEnd(300) :
1194                    that.$element.focus().trigger(e)
1195                })
1196    }
1197
1198    Modal.prototype.hide = function (e) {
1199        if (e)
1200            e.preventDefault()
1201
1202        e = $.Event('hide.bs.wdm-modal')
1203
1204        this.$element.trigger(e)
1205
1206        if (!this.isShown || e.isDefaultPrevented())
1207            return
1208
1209        this.isShown = false
1210
1211        this.escape()
1212
1213        $(document).off('focusin.bs.wdm-modal')
1214
1215        this.$element
1216        .removeClass('in')
1217        .attr('aria-hidden', true)
1218        .off('click.dismiss.bs.wdm-modal')
1219
1220        $.support.transition && this.$element.hasClass('wdm-fade') ?
1221        this.$element
1222        .one($.support.transition.end, $.proxy(this.hideModal, this))
1223        .emulateTransitionEnd(300) :
1224        this.hideModal()
1225    }
1226
1227    Modal.prototype.enforceFocus = function () {
1228        $(document)
1229                .off('focusin.bs.wdm-modal') // guard against infinite focus loop
1230                .on('focusin.bs.wdm-modal', $.proxy(function (e) {
1231                    if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
1232                        this.$element.focus()
1233                    }
1234                }, this))
1235            }
1236
1237            Modal.prototype.escape = function () {
1238                if (this.isShown && this.options.keyboard) {
1239                    this.$element.on('keyup.dismiss.bs.wdm-modal', $.proxy(function (e) {
1240                        e.which == 27 && this.hide()
1241                    }, this))
1242                } else if (!this.isShown) {
1243                    this.$element.off('keyup.dismiss.bs.wdm-modal')
1244                }
1245            }
1246
1247            Modal.prototype.hideModal = function () {
1248                var that = this
1249                this.$element.hide()
1250                this.backdrop(function () {
1251                    that.removeBackdrop()
1252                    that.$element.trigger('hidden.bs.wdm-modal')
1253                })
1254            }
1255
1256            Modal.prototype.removeBackdrop = function () {
1257                this.$backdrop && this.$backdrop.remove()
1258                this.$backdrop = null
1259            }
1260
1261            Modal.prototype.backdrop = function (callback) {
1262                var animate = this.$element.hasClass('fade') ? 'fade' : ''
1263
1264                if (this.isShown && this.options.backdrop) {
1265                    var doAnimate = $.support.transition && animate
1266
1267                    this.$backdrop = $('<div class="wdm-modal-backdrop ' + animate + '" />')
1268                    .appendTo(document.body)
1269
1270                    this.$element.on('click.dismiss.bs.wdm-modal', $.proxy(function (e) {
1271                        if (e.target !== e.currentTarget)
1272                            return
1273                        this.options.backdrop == 'static'
1274                        ? this.$element[0].focus.call(this.$element[0])
1275                        : this.hide.call(this)
1276                    }, this))
1277
1278                    if (doAnimate)
1279                this.$backdrop[0].offsetWidth // force reflow
1280
1281            this.$backdrop.addClass('in')
1282
1283            if (!callback)
1284                return
1285
1286            doAnimate ?
1287            this.$backdrop
1288            .one($.support.transition.end, callback)
1289            .emulateTransitionEnd(150) :
1290            callback()
1291
1292        } else if (!this.isShown && this.$backdrop) {
1293            this.$backdrop.removeClass('in')
1294
1295            $.support.transition && this.$element.hasClass('wdm-fade') ?
1296            this.$backdrop
1297            .one($.support.transition.end, callback)
1298            .emulateTransitionEnd(150) :
1299            callback()
1300
1301        } else if (callback) {
1302            callback()
1303        }
1304    }
1305
1306
1307    // MODAL PLUGIN DEFINITION
1308    // =======================
1309
1310    var old = $.fn.modal
1311
1312    $.fn.modal = function (option, _relatedTarget) {
1313        return this.each(function () {
1314            var $this = $(this)
1315            var data = $this.data('bs.wdm-modal')
1316            var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
1317
1318            if (!data)
1319                $this.data('bs.wdm-modal', (data = new Modal(this, options)))
1320            if (typeof option == 'string')
1321                data[option](_relatedTarget)
1322            else if (options.show)
1323                data.show(_relatedTarget)
1324        })
1325    }
1326
1327    $.fn.modal.Constructor = Modal
1328
1329
1330    // MODAL NO CONFLICT
1331    // =================
1332
1333    $.fn.modal.noConflict = function () {
1334        $.fn.modal = old
1335        return this
1336    }
1337
1338
1339    // MODAL DATA-API
1340    // ==============
1341
1342    $(document).on('click.bs.wdm-modal.data-api', '[data-toggle="wdm-quoteup-modal"]', function (e) {
1343        var $this = $(this)
1344        var href = $this.attr('href')
1345        var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
1346        var option = $target.data('bs.wdm-modal') ? 'toggle' : $.extend({remote: !/#/.test(href) && href}, $target.data(), $this.data())
1347
1348        if ($this.is('a'))
1349            e.preventDefault()
1350
1351        $target
1352        .modal(option, this)
1353        .one('hide', function () {
1354            $this.is(':visible') && $this.focus()
1355        })
1356    })
1357
1358    $(document).on('show.bs.modal', '.wdm-modal', function () {
1359        $(document.body).addClass('wdm-modal-open');
1360
1361    })
1362    .on('hidden.bs.modal', '.wdm-modal', function () {
1363        $(document.body).removeClass('wdm-modal-open');
1364    });
1365
1366}(jQuery);
1367
1368/*
1369 // When WooCommerce changes SKU, copy new SKU value in the SKU column of Product Details Table 
1370 jQuery('.sku').observe('childlist subtree', function(){
1371    jQuery('#product_sku').val(jQuery(this).text());
1372});
1373*/

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.