1jQuery(function() { 2 3 var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) 4 var tooltipList = tooltipTriggerList.map(function(tooltipTriggerEl) { 5 return new bootstrap.Tooltip(tooltipTriggerEl, { container: ".elex-rqst-quote-wrap" }); 6 }); 7 //start off by hiding it 8 jQuery("#elex-rqst-quote-light-box-input").hide(); 9 10 // when the Change EVENT fires - 11 jQuery("#elex-rqst-quote-form-select").change(function(event) 12 13 { 14 if (jQuery(this).val() == "light_box") 15 jQuery("#elex-rqst-quote-light-box-input").show(); 16 else 17 jQuery("#elex-rqst-quote-light-box-input").hide(); 18 }); 19}); 20 21jQuery(document).ready(function() { 22 23 jQuery('.copy_api_key').click( function(e) { 24 var api_key = jQuery('#api_key').val(); 25 copyToClipboard(api_key); 26 jQuery('.rest_api_key').find('[data-bs-toggle="tooltip"]').tooltip({ 27 placement: "bottom", 28 title:'New' 29 }); 30 31 if(api_key.length > 0){ 32 jQuery("#rest_api_key_message").addClass("show"); 33 } 34 setTimeout(function() { 35 jQuery("#rest_api_key_message").removeClass("show"); 36 37 }, 3000); 38 }); 39 40 function copyToClipboard(text) { 41 if (navigator.clipboard && typeof navigator.clipboard.writeText === 'function') { 42 navigator.clipboard.writeText(text) 43 .then(() => { 44 // Success callback 45 jQuery("#rest_api_key_message").addClass("show"); 46 setTimeout(function() { 47 jQuery("#rest_api_key_message").removeClass("show"); 48 }, 3000); 49 }) 50 .catch((error) => { 51 // Error callback 52 jQuery("#rest_api_key_error_message").addClass("show"); 53 setTimeout(function() { 54 jQuery("#rest_api_key_error_message").removeClass("show"); 55 56 }, 3000); 57 }); 58 } else { 59 // Fallback for older browsers 60 const textarea = document.createElement('textarea'); 61 textarea.value = text; 62 textarea.style.position = 'fixed'; 63 document.body.appendChild(textarea); 64 textarea.focus(); 65 textarea.select(); 66 67 try { 68 const successful = document.execCommand('copy'); 69 jQuery("#rest_api_key_message").addClass("show"); 70 setTimeout(function() { 71 jQuery("#rest_api_key_message").removeClass("show"); 72 73 }, 3000); 74 75 } catch (error) { 76 jQuery("#rest_api_key_error_message").addClass("show"); 77 setTimeout(function() { 78 jQuery("#rest_api_key_error_message").removeClass("show"); 79 80 }, 3000); 81 } 82 83 document.body.removeChild(textarea); 84 } 85 } 86 87 jQuery('.products_by_name').select2({ 88 minimumInputLength: 3, 89 ajax:{ 90 url:request_a_quote_ajax_obj.ajax_url, 91 type: 'POST', 92 93 94 data: function (params) { 95 var query = { 96 search: params.term, 97 action: 'search_products_by_name', 98 req_a_quote_nonce : request_a_quote_ajax_obj.nonce 99 } 100 return query; 101 }, 102 processResults: function (data) { 103 return { 104 results: data.data, 105 }; 106 } 107 108 } 109 110 }); 111 112 jQuery('.products_by_cat').select2({ 113 minimumInputLength: 3, 114 ajax:{ 115 url:request_a_quote_ajax_obj.ajax_url, 116 type: 'POST', 117 118 data: function (params) { 119 var query = { 120 search: params.term, 121 action: 'search_products_by_category', 122 req_a_quote_nonce : request_a_quote_ajax_obj.nonce 123 } 124 return query; 125 }, 126 processResults: function (data) { 127 return { 128 results: data.data, 129 }; 130 } 131 132 } 133 134 }); 135 136 jQuery('.products_by_tag').select2({ 137 minimumInputLength: 3, 138 ajax:{ 139 url:request_a_quote_ajax_obj.ajax_url, 140 type: 'POST', 141 142 data: function (params) { 143 var query = { 144 search: params.term, 145 action: 'search_products_by_tag', 146 req_a_quote_nonce : request_a_quote_ajax_obj.nonce 147 148 } 149 return query; 150 }, 151 processResults: function (data) { 152 return { 153 results: data.data, 154 }; 155 } 156 157 } 158 159 }); 160 161 jQuery('.include_roles , .exclude_roles , .req_order_status , #add_more_item_btn_redirection , #selected_page ').select2({ 162 }); 163 164 // widget page button label sub sub checkbox 165 jQuery(".elex-rqust-quote-widget-button-label-content").hide(); 166 jQuery(".elex-rqust-quote-widget-button-label-check").change(function() { 167 if (jQuery(this).is(":checked")) { 168 jQuery(".elex-rqust-quote-widget-button-label-content").show(300); 169 } else { 170 jQuery(".elex-rqust-quote-widget-button-label-content").hide(200); 171 } 172 }); 173}); 174 175 176 177// Example starter JavaScript for disabling form submissions if there are invalid fields 178 179(function() { 180 'use strict' 181 182 // Fetch all the forms we want to apply custom Bootstrap validation styles to 183 var forms = document.querySelectorAll('.needs-validation') 184 185 // Loop over them and prevent submission 186 Array.prototype.slice.call(forms) 187 .forEach(function(form) { 188 form.addEventListener('submit', function(event) { 189 if (!form.checkValidity()) { 190 event.preventDefault() 191 event.stopPropagation() 192 } 193 194 form.classList.add('was-validated') 195 }, false) 196 }) 197})() 198 199jQuery(document).ready(function() { 200 // Get the reference to the div with the class "my-div" 201 var myDiv = jQuery('#quote_list'); 202 203 // var dyDiv = jQuery('.elex-raq-quote-details-container') 204 // Function to add class based on div width 205 function addClassBasedOnWidth() { 206 var windowWidth = jQuery(window).width(); 207 208 if(windowWidth > 990){ 209 // Get the current width of the div 210 var divWidth = myDiv.width(); 211 // Add the class "wide-div" if the width is greater than 400 pixels 212 if (divWidth < 1100) { 213 myDiv.addClass('elex-raq-quote-hide-names'); 214 } else { 215 // Remove the class "wide-div" if the width is less than or equal to 400 pixels 216 myDiv.removeClass('elex-raq-quote-hide-names'); 217 } 218 }else{ 219 220 myDiv.removeClass('elex-raq-quote-hide-names'); 221 } 222 223 } 224 // Call the function on page load 225 addClassBasedOnWidth(); 226 // Call the function on window resize to update the class if the div width changes 227 jQuery(window).resize(function() { 228 addClassBasedOnWidth(); 229 }); 230});
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.