1/** 2 * All of the code for public-facing JavaScript source 3 * should reside in this file. 4 * 5 * @package woo-gift-cards-lite 6 */ 7 8(function( $ ) { 9 10 'use strict'; 11 jQuery( document ).ready( 12 function($){ 13 14 $('#wps_wgm_to_email').on('blur', function() { 15 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '' && wps_wgm.enable_sent_multiple_gc == 'on' && wps_wgm.is_imported != 'yes' ) { 16 var recipients = $(this).val(); 17 if (recipients) { 18 $(this).val(recipients.trim().split(/[ ,]+/).map(function (item) { 19 return item.trim(); 20 }).join(', ')); 21 } 22 23 wps_wgm_toggle_quantity(); 24 } 25 }); 26 27 function wps_wgm_toggle_quantity() { 28 if ($('#wps_wgm_to_email').length) { 29 var recipients = $('#wps_wgm_to_email').val().split(/[ ,]+/); 30 if (recipients.length > 1) { 31 $('.wps_wgm_recipient_count').text(recipients.length); 32 $('.wps_wgm_quantity_one_per_recipient').show(); 33 $('input.qty').val('1'); 34 $('.quantity').hide(); 35 $('.wps_wgm_msg_info_multiple_name').show(); 36 $( '.wps_wgm_msg_info').hide(); 37 $('.wps_wgm_msg_info_multiple_name').text( recipients.length + wps_wgm.recipient_name ); 38 } else { 39 $('.wps_wgm_quantity_one_per_recipient').hide(); 40 $('.wps_wgm_msg_info_multiple_name').hide(); 41 $( '.wps_wgm_msg_info').show(); 42 $('.quantity').show(); 43 } 44 } 45 } 46 47 function wps_wgm_is_email(email) { 48 var regex = /^[a-zA-Z0-9](\.?[a-zA-Z0-9_-])*@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/; 49 return regex.test(email); 50 } 51 52 $('#wps_wgm_price').keyup(function() { 53 if ( ',' == wps_wgm.decimal_separator ) { 54 this.value = this.value.replace(/[^0-9,]/g, ''); 55 } else { 56 this.value = this.value.replace(/[^0-9.]/g, ''); 57 } 58 59 var price = parseInt(this.value); 60 if ( wps_wgm.pricing_type.type == 'wps_wgm_user_price' && price < wps_wgm.pricing_type.min_user_price ) { 61 jQuery('.wps_wgm_min_user_price').show(); 62 } else { 63 jQuery('.wps_wgm_min_user_price').hide(); 64 } 65 $( '.wps_uwgc_price_button').css( 'background-color','' ); 66 $( '.wps_uwgc_price_button').css( 'color','' ); 67 }); 68 69 //variable price for giftcard. 70 wps_wgm_variable_price_change_page_load(jQuery('#wps_wgm_price').val()); 71 jQuery('#wps_wgm_price').change(function(){ 72 73 if (wps_wgm.pricing_type.type == 'wps_wgm_variable_price') { 74 75 var wps_wgm_price = jQuery(this).val(); 76 var wps_wgm_text = jQuery(this).find(':selected').text(); 77 jQuery( '#wps_wgm_variable_price_description' ).val( wps_wgm_text ); 78 wps_wgm_variable_price_change(wps_wgm_price); 79 } 80 }); 81 82 function wps_wgm_variable_price_change(wps_wgm_price) { 83 if (wps_wgm.pricing_type.type == 'wps_wgm_variable_price') { 84 var product_id = wps_wgm.product_id; 85 86 if ($('.summary.entry-summary').length > 0) { 87 88 } 89 90 var data = { 91 action:'wps_wgm_append_variable_price', 92 wps_wgm_price:wps_wgm_price, 93 product_id:product_id, 94 wps_nonce:wps_wgm.wps_wgm_nonce 95 }; 96 $.ajax({ 97 url: wps_wgm.ajaxurl, 98 type: "POST", 99 data: data, 100 dataType: 'json', 101 success: function(response) 102 { 103 if(response.result == true) 104 { 105 jQuery('#wps_wgm_text').html(response.new_price); 106 } 107 }, 108 complete: function() 109 { 110 if ($('.summary.entry-summary').length > 0) { 111 112 } 113 } 114 }); 115 } 116 } 117 function wps_wgm_variable_price_change_page_load(wps_wgm_price) { 118 if (wps_wgm.pricing_type.type == 'wps_wgm_variable_price') { 119 var product_id = wps_wgm.product_id; 120 var data = { 121 action:'wps_wgm_append_variable_price', 122 wps_wgm_price:wps_wgm_price, 123 product_id:product_id, 124 wps_nonce:wps_wgm.wps_wgm_nonce 125 }; 126 $.ajax({ 127 url: wps_wgm.ajaxurl, 128 type: "POST", 129 data: data, 130 dataType: 'json', 131 success: function(response) 132 { 133 if(response.result == true) 134 { 135 jQuery('#wps_wgm_text').html(response.new_price); 136 } 137 }, 138 139 }); 140 } 141 } 142 143 $("#wps_wgm_price").attr( "min", 1); 144 var check_elementor = $(document).find('.wps_wgm_added_wrapper').parents('.elementor-product-wgm_gift_card').length; 145 if (check_elementor != 0) { 146 if ($(document).find('.wps_wgm_added_wrapper').length) { 147 $(document).find('.wps_wgm_added_wrapper').siblings().wrapAll('<div class="wps_wgm_elementor"></div>'); 148 var modified_div = $(document).find('.wps_wgm_elementor'); 149 $(document).find('.wps_wgm_added_wrapper').append(modified_div); 150 } 151 } 152 153 $('body').on('click', '#wps_gift_this_product', function() { 154 $(document).ajaxComplete(function() { 155 var msg_length = $(document).find('#wps_wgm_message').val().length; 156 $('.wps_box_char').text(msg_length); 157 }); 158 }); 159 160 $(window).on( 'load', function() { 161 var msg_length = $(document).find('#wps_wgm_message').val().length; 162 $('.wps_box_char').text(msg_length); 163 } 164 ); 165
166 $("body").on( 'keyup', '#wps_wgm_message', 167 function(){ 168 var max_length = wps_wgm.msg_length; 169 var msg_length = $(document).find('#wps_wgm_message').val().length; 170 var html = '<ul>'; 171 var error = false; 172 if ( msg_length > max_length ) { 173 this.value = this.value.substring( 0, max_length ); 174 error = true; 175 $("#wps_wgm_message").addClass("wps_gw_error"); 176 html+="<li><b>"; 177 html+=wps_wgm.msg_length_err; 178 html+="</li>"; 179 } 180 if(msg_length == 0){ 181 $('.wps_box_char').text(0); 182 } 183 else if( msg_length > max_length ){ 184 $('.wps_box_char').text(max_length); 185 } else { 186 $('.wps_box_char').text(msg_length); 187 } 188 189 html += "</ul>"; 190 if(error) 191 { 192 $("#wps_wgm_error_notice").html(html); 193 $("#wps_wgm_error_notice").show(); 194 jQuery('html, body').animate({ 195 scrollTop: jQuery(".woocommerce-js").offset().top 196 }, 800); 197 } else { 198 $("#wps_wgm_error_notice").hide(); 199 } 200 } 201 ); 202 203 204 /*Js for select template on single product page*/ 205 $( 'body' ).on( 'click', '.wps_wgm_featured_img', 206 function(){ 207 $( '.wps_wgm_selected_template' ).find( '.wps_wgm_featured_img' ).removeClass( 'wps_wgm_pre_selected_temp' ); 208 var img_id = $( this ).attr( 'id' ); 209 var img_url = $(this).attr('src'); 210 $('.woocommerce-product-gallery__wrapper').find('.woocommerce-product-gallery__image a img').attr('srcset',img_url) 211 $('.woocommerce-product-gallery__wrapper').find('.woocommerce-product-gallery__image a').attr('href',img_url) 212 $('.woocommerce-product-gallery__wrapper').find('img').attr('src',img_url) 213 $( '#' + img_id ).addClass( 'wps_wgm_pre_selected_temp' ); 214 $( '#wps_wgm_selected_temp' ).val( img_id ); 215 } 216 ); 217 218 /* 219 Adds the Validation for some required fields for Single Product Page. 220 */ 221 jQuery( "body" ).on( 'click', '.single_add_to_cart_button', 222 function(e){ 223 if ( ( typeof wps_wgm.pricing_type.type != 'undefined' || $( '#wps_gift_this_product' ).prop("checked") == true ) ) { 224 e.preventDefault(); 225 $( "#wps_wgm_error_notice" ).hide(); 226 var from_mail = $( "#wps_wgm_from_name" ).val(); 227 var message = $( "#wps_wgm_message" ).val(); 228 message = message.trim(); 229 var price = $( "#wps_wgm_price" ).val(); 230 var error = false; 231 var product_type = wps_wgm.pricing_type.type; 232 var html = ""; 233 var to_mail = ''; 234 var mailformat = /^[a-zA-Z0-9](\.?[a-zA-Z0-9_-])*@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/; 235 html = "<ul>"; 236 237 var delivery_method = jQuery( document ).find( 'input[name="wps_wgm_send_giftcard"]:checked' ).val(); 238 239 // remove validation from to fields. 240 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '' && wps_wgm_remove_validation_to() == 'on') { 241 if (delivery_method == 'Mail to recipient') { 242 to_mail = $( "#wps_wgm_to_email" ).val(); 243 error = false; 244 } 245 if (delivery_method == 'Downloadable') { 246 to_mail = $( "#wps_wgm_to_download" ).val(); 247 error = false; 248 } 249 } else { 250 if (delivery_method == 'Mail to recipient') { 251 to_mail = $( "#wps_wgm_to_email" ).val(); 252 if (to_mail == null || to_mail == "") { 253 error = true; 254 $( "#wps_wgm_to_email" ).addClass( "wps_wgm_error" ); 255 html += "<li><b>"; 256 html += wps_wgm.to_empty; 257 html += "</li>"; 258 } else if ( ( wps_wgm.is_pro_active == null || wps_wgm.is_pro_active == '' || wps_wgm.is_customizable == 'yes' || wps_wgm.is_imported == 'yes' || wps_wgm.enable_sent_multiple_gc != 'on' ) && ! to_mail.match( mailformat ) ) { 259 error = true; 260 $( "#wps_wgm_to_email" ).addClass( "wps_wgm_error" ); 261 html += "<li><b>"; 262 html += wps_wgm.to_invalid; 263 html += "</li>"; 264 } else { 265 var recipients = $('#wps_wgm_to_email').val().split(/[ ,]+/); 266 var badRecipients = []; 267 268 for (var i = 0; i < recipients.length; i++) { 269 if ( ! wps_wgm_is_email(recipients[i])) { 270 badRecipients.push(recipients[i]); 271 } 272 } 273 274 if (badRecipients.length) {
275 alert(wps_wgm.to_invalid + '\n\n' + badRecipients.join('\n')); 276 e.preventDefault(); 277 return false; 278 } 279 } 280 } 281 } 282 283 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '' && wps_wgm_remove_validation_to_name() == 'on') { 284 285 } else { 286 if (delivery_method == 'Downloadable') { 287 to_mail = $( "#wps_wgm_to_download" ).val(); 288 if (to_mail == null || to_mail == "") { 289 error = true; 290 $( "#wps_wgm_to_download" ).addClass( "wps_wgm_error" ); 291 html += "<li><b>"; 292 html += wps_wgm.to_empty_name; 293 html += "</li>"; 294 } 295 } 296 if (delivery_method == 'shipping') { 297 to_mail = $( "#wps_wgm_to_ship" ).val(); 298 if (to_mail == null || to_mail == "") { 299 error = true; 300 $( "#wps_wgm_to_ship" ).addClass( "wps_wgm_error" ); 301 html += "<li><b>"; 302 html += wps_wgm.to_empty_name; 303 html += "</li>"; 304 } 305 } 306 } 307 308 if (price == null || price == "") { 309 error = true; 310 $( "#wps_wgm_price" ).addClass( "wps_wgm_error" ); 311 html += "<li><b>"; 312 html += wps_wgm.price_field; 313 html += "</li>"; 314 } 315 // Remove validation from field. 316 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '' && wps_wgm_remove_validation_from() == 'on') { 317 318 } else { 319 if (from_mail == null || from_mail == "") { 320 error = true; 321 $( "#wps_wgm_from_name" ).addClass( "wps_wgm_error" ); 322 html += "<li><b>"; 323 html += wps_wgm.from_empty; 324 html += "</li>"; 325 } 326 } 327 // for validation from message field. 328 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '' && wps_wgm_remove_validation_msg() == 'on') { 329 330 } else { 331 if (message == null || message == "") { 332 error = true; 333 $( "#wps_wgm_message" ).addClass( "wps_wgm_error" ); 334 html += "<li><b>"; 335 html += wps_wgm.msg_empty; 336 html += "</li>"; 337 } else if ( message.length > wps_wgm.msg_length ) { 338 error = true; 339 $( "#wps_wgm_message" ).addClass( "wps_wgm_error" ); 340 html += "<li><b>"; 341 html += wps_wgm.msg_length_err; 342 html += "</li>"; 343 } 344 } 345 346 if (product_type == "wps_wgm_range_price" || product_type == "wps_wgm_selected_with_price_range") { 347 var from = wps_wgm.pricing_type.from.replace(',', '.'); 348 var to = wps_wgm.pricing_type.to .replace( ',','.'); 349 var from = parseFloat( from ); 350 var to = parseFloat( to ); 351 352 var price = price.replace(',','.'); 353 price = parseFloat( price ); 354 355 if (price > to || price < from) { 356 error = true; 357 $( "#wps_wgm_price" ).addClass( "wps_wgm_error" ); 358 html += "<li><b>"; 359 html += wps_wgm.price_range; 360 html += "</li>"; 361 } 362 } 363 if (product_type == 'wps_wgm_user_price' ) { 364 price = parseInt( price ); 365 if ( price < wps_wgm.pricing_type.min_user_price ) { 366 error = true; 367 html += "<li><b>"; 368 html += wps_wgm.min_user_price; 369 html += "</li>"; 370 } 371 } 372 // if pro is active. 373 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '') { 374 var response = wps_wgm_add_to_card_validation( html,error ); 375 error = response.error; 376 html += response.html; 377 to_mail = response.to_mail; 378 } 379 html += "</ul>"; 380 if (error) { 381 $( "#wps_wgm_error_notice" ).html( html ); 382 $( "#wps_wgm_error_notice" ).show(); 383 jQuery( 'html, body' ).animate( 384 { 385 scrollTop: jQuery( ".woocommerce-js" ).offset().top 386 }, 387 800 388 ); 389 $( ".single_add_to_cart_button" ).removeClass( "loading" ); 390 } else { 391 $( "#wps_wgm_error_notice" ).html( "" ); 392 $( "#wps_wgm_error_notice" ).hide(); 393 $( this ).closest( "form.cart" ).submit(); 394 return true; 395 } 396 } 397 } 398 ); 399 400 /* Adds the Preview Validtion Here*/ 401 402 $( 'body' ).on('click', '.mwg_wgm_preview_email', 403 function(e) { 404 e.preventDefault() 405 var form_Data = new FormData(); 406 407 $( "#wps_wgm_error_notice" ).hide(); 408 var from_mail = $( "#wps_wgm_from_name" ).val(); 409 var message = $( "#wps_wgm_message" ).val(); 410 message = message.trim(); 411 var regex = /(<([^>]+)>)/ig; 412 var message = message.replace( regex,'' ); 413 var price = $( "#wps_wgm_price" ).val(); 414 var error = false;
415 var product_type = wps_wgm.pricing_type.type; 416 var mailformat = /^[a-zA-Z0-9](\.?[a-zA-Z0-9_-])*@[a-zA-Z0-9-]+(\.[a-zA-Z]{2,})+$/; 417 var to_mail = ''; 418 var send_date = ''; 419 var html = "<ul>"; 420 var delivery_method = jQuery( document ).find( 'input[name="wps_wgm_send_giftcard"]:checked' ).val(); 421 var variable_price_desc = $( '#wps_wgm_variable_price_description' ).val(); 422 // remove validation from to fields. 423 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '' && wps_wgm_remove_validation_to() == 'on') { 424 if (delivery_method == 'Mail to recipient') { 425 to_mail = $( "#wps_wgm_to_email" ).val(); 426 error = false; 427 } 428 if (delivery_method == 'Downloadable') { 429 to_mail = $( "#wps_wgm_to_download" ).val(); 430 error = false; 431 } 432 } else { 433 if (delivery_method == 'Mail to recipient') { 434 to_mail = $( "#wps_wgm_to_email" ).val(); 435 if (to_mail == null || to_mail == "") { 436 error = true; 437 $( "#wps_wgm_to_email" ).addClass( "wps_wgm_error" ); 438 html += "<li><b>"; 439 html += wps_wgm.to_empty; 440 html += "</li>"; 441 } else if ( ( wps_wgm.is_pro_active == null || wps_wgm.is_pro_active == '' || wps_wgm.is_customizable == 'yes' || wps_wgm.is_imported == 'yes' || wps_wgm.enable_sent_multiple_gc != 'on' ) && ! to_mail.match( mailformat ) ) { 442 error = true; 443 $( "#wps_wgm_to_email" ).addClass( "wps_wgm_error" ); 444 html += "<li><b>"; 445 html += wps_wgm.to_invalid; 446 html += "</li>"; 447 } else { 448 var recipients = $('#wps_wgm_to_email').val().split(/[ ,]+/); 449 var badRecipients = []; 450 451 for (var i = 0; i < recipients.length; i++) { 452 if ( ! wps_wgm_is_email(recipients[i])) { 453 badRecipients.push(recipients[i]); 454 } 455 } 456 457 if (badRecipients.length) { 458 alert(wps_wgm.to_invalid + '\n\n' + badRecipients.join('\n')); 459 e.preventDefault(); 460 return false; 461 } 462 } 463 } 464 } 465 466 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '' && wps_wgm_remove_validation_to_name() == 'on') { 467 468 } else { 469 if (delivery_method == 'Downloadable') { 470 to_mail = $( "#wps_wgm_to_download" ).val(); 471 if (to_mail == null || to_mail == "") { 472 error = true; 473 $( "#wps_wgm_to_download" ).addClass( "wps_wgm_error" ); 474 html += "<li><b>"; 475 html += wps_wgm.to_empty_name; 476 html += "</li>"; 477 } 478 } 479 } 480 481 if (price == null || price == "") { 482 error = true; 483 $( "#wps_wgm_price" ).addClass( "wps_wgm_error" ); 484 html += "<li><b>"; 485 html += wps_wgm.price_field; 486 html += "</li>"; 487 } 488 // remove validation from field. 489 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '' && wps_wgm_remove_validation_from() == 'on') { 490 491 } else { 492 if (from_mail == null || from_mail == "") { 493 error = true; 494 $( "#wps_wgm_from_name" ).addClass( "wps_wgm_error" ); 495 html += "<li><b>"; 496 html += wps_wgm.from_empty; 497 html += "</li>"; 498 } 499 } 500 // for validation from message. 501 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '' && wps_wgm_remove_validation_msg() == 'on') { 502 503 } else { 504 if (message == null || message == "") { 505 error = true; 506 $( "#wps_wgm_message" ).addClass( "wps_wgm_error" ); 507 html += "<li><b>"; 508 html += wps_wgm.msg_empty; 509 html += "</li>"; 510 } else if ( message.length > wps_wgm.msg_length ) { 511 error = true; 512 $( "#wps_wgm_message" ).addClass( "wps_wgm_error" ); 513 html += "<li><b>"; 514 html += wps_wgm.msg_length_err; 515 html += "</li>"; 516 } 517 } 518 519 if (product_type == "wps_wgm_range_price" || product_type == "wps_wgm_selected_with_price_range") { 520 var from = wps_wgm.pricing_type.from.replace(',', '.'); 521 var to = wps_wgm.pricing_type.to .replace( ',','.'); 522 var from = parseFloat( from ); 523 var to = parseFloat( to ); 524 525 var price = price.replace(',','.'); 526 price = parseFloat( price ); 527 528 if (price > to || price < from) { 529 error = true; 530 $( "#wps_wgm_price" ).addClass( "wps_wgm_error" ); 531 html += "<li><b>"; 532 html += wps_wgm.price_range; 533 html += "</li>"; 534 } 535 } 536 if (product_type == 'wps_wgm_user_price' ) { 537 price = parseInt( price ); 538 if ( price < wps_wgm.pricing_type.min_user_price ) { 539 error = true; 540 html += "<li><b>"; 541 html += wps_wgm.min_user_price; 542 html += "</li>"; 543 } 544 } 545 // if pro is active. 546 if (wps_wgm.is_pro_active != null && wps_wgm.is_pro_active != '') {
547 var response = wps_wgm_preview_validation( html,error,form_Data ); 548 error = response.error; 549 html += response.html; 550 to_mail = response.to_mail; 551 form_Data = response.form_Data; 552 send_date = response.send_date; 553 554 } 555 html += "</ul>"; 556 if (error) { 557 $( "#wps_wgm_error_notice" ).html( html ); 558 $( "#wps_wgm_error_notice" ).show(); 559 // WPS code for woodmart theme. 560 $( "#wps_wgm_error_notice" ).removeClass( 'hidden-notice' ); 561 // WPS code for woodmart theme. 562 jQuery( 'html, body' ).animate( 563 { 564 scrollTop: jQuery( ".woocommerce-js" ).offset().top 565 }, 566 800 567 ); 568 } else { 569 570 var product_id = wps_wgm.product_id; 571 var tempId = $( document ).find( '#wps_wgm_selected_temp' ).val(); 572 form_Data.append( 'action', 'wps_wgc_preview_thickbox_rqst' ); 573 form_Data.append( 'wps_nonce', wps_wgm.wps_wgm_nonce ); 574 form_Data.append( 'price', price ); 575 form_Data.append( 'from', from_mail ); 576 form_Data.append( 'to', to_mail ); 577 form_Data.append( 'message', message ); 578 form_Data.append( 'product_id', product_id ); 579 form_Data.append( 'tempId', tempId ); 580 form_Data.append( 'send_date', send_date ); 581 form_Data.append( 'variable_price_desc', variable_price_desc ); 582 form_Data.append( 'delivery_method', delivery_method ); 583 584 $.ajax( 585 { 586 url: wps_wgm.ajaxurl, 587 type: "POST", 588 data: form_Data, 589 processData: false, 590 contentType: false, 591 success: function(response) 592 { 593 $( "#mwg_wgm_preview_email" ).show(); 594 tb_show( "", response ); 595 } 596 } 597 ); 598 } 599 } 600 ); 601 } 602 ); 603 604})( jQuery ); 605 606////////////////// 607 608jQuery(document).ready(function () { 609 610 jQuery('#wps_wgm_send_giftcard1').prop('checked', true) 611 612 jQuery('#wps_wgm_price_preview').append(jQuery('#wps_wgm_price').val()); 613 614 jQuery("#wps_wgm_price").keyup(function () { 615 jQuery('#wps_wgm_price_preview').html(jQuery('#wps_wgm_price').val()); 616 }); 617 618 jQuery(document).on('click','.wps_uwgc_price_button', function(){ 619 jQuery('#wps_wgm_price_preview').html(jQuery('.wps_wgm_price').val()); 620 }) 621 jQuery(document).on('change', '#wps_wgm_price', function () { 622 jQuery('#wps_wgm_price_preview').html(jQuery('#wps_wgm_price').val()); 623 }); 624 jQuery("#wps_wgm_from_name").keyup(function () { 625 jQuery("#wps_from_preview").text( jQuery('#wps_wgm_from_name').val()); 626 }); 627 628 jQuery("#wps_wgm_message").keyup(function () { 629 jQuery("#wps_message_preview").text( jQuery('#wps_wgm_message').val()); 630 }); 631 632 jQuery("#wps_wgm_to_email").keyup(function () { 633 634 jQuery("#wps_wgm_to_download").val(''); 635 jQuery("#wps_wgm_to_ship").val(''); 636 jQuery("#wps_to_preview").text( jQuery('#wps_wgm_to_email').val()); 637 }); 638 jQuery("#wps_wgm_to_download").keyup(function () { 639 jQuery("#wps_wgm_to_email").val(''); 640 jQuery("#wps_wgm_to_ship").val(''); 641 jQuery("#wps_to_preview").text( jQuery('#wps_wgm_to_download').val()); 642 }); 643 jQuery("#wps_wgm_to_ship").keyup(function () { 644 jQuery("#wps_wgm_to_email").val(''); 645 jQuery("#wps_wgm_to_email").val(''); 646 jQuery("#wps_to_preview").text( jQuery('#wps_wgm_to_ship').val()); 647 }); 648 649 setTimeout(function (e) { 650 var product_preview = jQuery('.theme-flatsome.single-product .wps_wgm_wrapper_for_preview , .theme-oceanwp.single-product .wps_wgm_wrapper_for_preview').detach(); 651 jQuery(product_preview).insertAfter('.theme-flatsome.single-product .woocommerce-product-gallery'); 652 jQuery(product_preview).appendTo('.theme-oceanwp.single-product .woocommerce-product-gallery'); 653 }, 100) 654 655 656 657});
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.