1$sa =jQuery; 2$sa(document).on( 3 "click", "#sa_bis_submit", function () { 4 var self = this; 5 var waiting_txt = (typeof sa_notices != 'undefined' && sa_notices['waiting_txt']) ? sa_notices['waiting_txt'] : "Please wait..."; 6 $sa(self).val(waiting_txt).attr("disabled", "disabled"); 7 8 var phone_number = $sa("[name=sa_bis_phone_phone]:hidden").val()?$sa("[name=sa_bis_phone_phone]:hidden").val():$sa("[name=sa_bis_phone_phone]").val(); 9 10 if(sa_otp_settings['show_countrycode']=='off') { 11 $sa(".sa_phone_error").remove(); 12 $sa(".phone-valid").after("<span class='error sa_phone_error' style='display:none'></span>"); 13 } 14 15 if(phone_number == '') { 16 $sa(".sa_phone_error").html("Please fill the number").fadeIn().css({"color":"red"}); 17 $sa("#sa_bis_submit").val("Notify Me").removeAttr("disabled",false); 18 return false; 19 } 20 21 if($sa(self).is("input")) { 22 $sa(self).val(waiting_txt).attr("disabled",true); 23 }else{ 24 $sa(self).text(waiting_txt).attr("disabled",true); 25 } 26 27 var product_id = $sa("#sa-product-id").val(); 28 var var_id = $sa("#sa-variation-id").val(); 29 var data = { 30 product_id: product_id, 31 variation_id: var_id, 32 user_phone: phone_number, 33 action: "smsalertbackinstock" 34 }; 35 $sa.ajax( 36 { 37 type: "post", 38 data: data, 39 success: function (msg) { 40 var r= $sa.parseJSON(msg); 41 $sa("fieldset").hide(); 42 if(r.status == "success") { 43 $sa(".sastock_output").html(r.description).fadeIn().css({"color":"#fff", 'background-color':'green'}); 44 }else{ 45 $sa(".sastock_output").html(r.description).fadeIn().css({"color":"#fff",'background-color':'red'}); 46 } 47 $sa(".sastock_output").css({'padding':'10px','border-radius':'4px','margin-bottom':'10px'}); 48 }, 49 error: function (request, status, error) { } 50 } 51 ); 52 return false; 53 } 54); 55$sa(".single_variation_wrap").on( 56 "show_variation", function (event, variation) { 57 $sa(".phone-valid").after("<span class='error sa_phone_error' style='display:none'></span>"); 58 // Fired when the user selects all the required dropdowns / attributes 59 // and a final variation is selected / shown 60 $sa(".smsalert_instock-subscribe-form").hide(); //remove existing form 61 $sa(".smsalert_instock-subscribe-form").fadeIn( 62 1000,'linear',function () { 63 64 if(sa_otp_settings['show_countrycode']=='on') { 65 var default_cc = (typeof sa_default_countrycode !='undefined' && sa_default_countrycode!='') ? sa_default_countrycode : '91'; 66 $sa(this).find('.phone-valid').intlTelInput("destroy"); 67 68 var parent_field_name = $sa(this).find('.phone-valid').attr("name"); 69 var object = $sa(this).saIntellinput({hiddenInput:false}); 70 71 72 var iti = $sa(this).find(".phone-valid").intlTelInput(object); 73 if(default_cc!='') { 74 var selected_cc = getCountryByCode(default_cc); 75 var show_default_cc = selected_cc[0].iso2.toUpperCase(); 76 iti.intlTelInput("setCountry",show_default_cc); 77 } 78 79 80 81 82 83 $sa(this).parents("form").find(".iti--separate-dial-code").append('<input type="hidden" name="'+parent_field_name+'">'); 84 85 86 iti.on( 87 'countrychange', function (e, countryData) { 88 var fullnumber = $sa(this).intlTelInput("getNumber"); 89 var field_name = $sa(this).attr('name'); 90 $sa(this).intlTelInput("setNumber",fullnumber); 91 $sa(this).parents("form").find('[name="'+field_name+'"]:hidden').val(fullnumber); 92 93 if ($sa(this).intlTelInput('isValidNumber')) { 94 reset(this); 95 $sa(this).parents("form").find(".sa-otp-btn-init").attr("disabled",fal
95se); 96 $sa(this).parents("form").find("#sign_with_mob_btn").attr("disabled",false); 97 } 98 else 99 { 100 101 var iti = $sa(this).intlTelInput("setNumber",fullnumber); 102 var errorCode = iti.intlTelInput('getValidationError'); 103 iti.parents(".iti--separate-dial-code").next(".sa_phone_error").text(errorMap[errorCode]); 104 $sa("#smsalert_otp_token_submit,#sc_btn").attr("disabled",true); 105 iti.parents(".iti--separate-dial-code").next(".sa_phone_error").removeAttr("style"); 106 iti.parents("form").find(".sa-otp-btn-init").attr("disabled",true); 107 iti.parents("form").find("#sign_with_mob_btn").attr("disabled",true); 108 $sa("#sa_bis_submit").attr("disabled",true); 109 } 110 } 111 ); 112 } 113 } 114 ); //add subscribe form to show 115 } 116); 117 118//get all country data 119function getCountryByCode(code) 120{ 121 return window.intlTelInputGlobals.getCountryData().filter( 122 function (data) { 123 return (data.dialCode == code) ? data.iso2 : ''; } 124 ); 125}
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.