How to use text2 method in wpt

Best JavaScript code snippet using wpt

execute.js

Source:execute.js Github

copy

Full Screen

1//menu informasi2$('#saldo').unbind('click').click(function() {saldo();});3$('#mutasi_transaksi').unbind('click').click(function() {mutasi_transaksi();});4$('#rekening_dplk').unbind('click').click(function() {rekening_dplk();});5$('#kartu_kredit_bni').unbind('click').click(function() {kartu_kredit_bni();});6$('#telepon_pasca_bayar').unbind('click').click(function() {telepon_pasca_bayar();});7$('#listrik').unbind('click').click(function() {listrik();});8$('#internet_tv_berlangganan').unbind('click').click(function() {internet_tv_berlangganan();});9$('#kai').unbind('click').click(function() {kai();});10$('#pgn').unbind('click').click(function() {pgn();});//CR1907711function saldo(){12 var x = 'SAL';13 exec(x);14}15function mutasi_transaksi(){16 var x = 'HST';17 exec(x);18}19function rekening_dplk(){20 var format = 'INQ DPLK ';21 var text1 = document.getElementById('text1').value;22 var x = format.concat(text1);23 if(text1 != ''){24 exec(x);25 }26}27function kartu_kredit_bni(){28 var format = 'TAG BNI ';29 var text1 = document.getElementById('text1').value;30 var x = format.concat(text1);31 if(text1 != ''){32 exec(x);33 }34}35function telepon_pasca_bayar(){36 var format = 'TAG ';37 var text1 = document.getElementById('text1').value;38 var text2 = document.getElementById('text2').value;39 var x = format.concat(text1,' ',text2);40 if(text2 != ''){41 exec(x);42 }43}44function listrik(){45 var format = 'TAG ';46 var text1 = document.getElementById('text1').value;47 var text2 = document.getElementById('text2').value;48 var x = format.concat(text1,' ',text2);49 if(text1 != '' && text2 != ''){50 exec(x);51 }52}53function internet_tv_berlangganan(){54 var format = 'TAG ';55 var text1 = document.getElementById('text1').value;56 var text2 = document.getElementById('text2').value;57 var x = format.concat(text1,' ',text2);58 if(text1 != '' && text2 != ''){59 exec(x);60 }61}62//end of menu informasi6364//menu transfer65$('#trf_rekening_bni').unbind('click').click(function() {trf_rekening_bni();});66$('#trf_antar_bank').unbind('click').click(function() {trf_antar_bank();});67$('#trf_dengan_berita').unbind('click').click(function() {trf_dengan_berita();});68$('#trf_dengan_notifikasi').unbind('click').click(function() {trf_dengan_notifikasi();});69$('#trf_dengan_berita_dan_notifikasi').unbind('click').click(function() {trf_dengan_berita_dan_notifikasi();});70$('#trf_sms_tunai').unbind('click').click(function() {trf_sms_tunai();});71$('#trf_rekening_dplk_bni_simponi').unbind('click').click(function() {trf_rekening_dplk_bni_simponi();});72function trf_rekening_bni(){73 var format = 'TRANSFER ';74 var text1 = document.getElementById('text1').value;75 var text2 = document.getElementById('text2').value;76 var x = format.concat(text1,' ',text2);77 if(text1 != '' && text2 != ''){78 exec(x);79 }80}81function trf_antar_bank(){82 var format = 'TRANSFER ANTARBANK ';83 var textTemp = document.getElementById('text1').value;84 var text1 = textTemp.split(" ");85 var text2 = document.getElementById('text2').value;86 var text3 = document.getElementById('text3').value;87 var text4 = document.getElementById('text4').value;88 var text5 = document.getElementById('text5').value;89 var x = format.concat(text1[0],text2,' ',text3,' #',text4,'# ', text5);90 if(text1 != '' && text2 != '' && text3 != ''){91 exec(x);92 }93}94function trf_dengan_berita(){95 var format = 'TRANSFER BERITA ';96 var text1 = document.getElementById('text1').value;97 var text2 = document.getElementById('text2').value;98 var text3 = document.getElementById('text3').value;99 var x = format.concat(text1,' ',text2,' #',text3,'#');100 if(text1 != '' && text2 != '' && text3 != ''){101 exec(x);102 }103}104function trf_dengan_notifikasi(){105 var format = 'TRANSFER NOTIFIKASI ';106 var text1 = document.getElementById('text1').value;107 var text2 = document.getElementById('text2').value;108 var text3 = document.getElementById('text3').value;109 var x = format.concat(text1,' ',text2,' ',text3);110 if(text1 != '' && text2 != '' && text3 != ''){111 exec(x);112 }113}114function trf_dengan_berita_dan_notifikasi(){115 var format = 'TRANSFER BERITANOTIFIKASI ';116 var text1 = document.getElementById('text1').value;117 var text2 = document.getElementById('text2').value;118 var text3 = document.getElementById('text3').value;119 var text4 = document.getElementById('text4').value;120 var x = format.concat(text1,' ',text2,' #',text3,'# ',text4);121 if(text1 != '' && text2 != '' && text3 != '' && text4 != ''){122 exec(x);123 }124}125function trf_sms_tunai(){126 var format = 'TUNAI ';127 var text1 = document.getElementById('text1').value;128 var text2 = document.getElementById('text2').value;129 var text3 = document.getElementById('text3').value;130 var text4 = document.getElementById('text4').value;131 var x = format.concat('#',text1,'# #',text2,'# ',text3,' ',text4);132 if(text1 != '' && text2 != '' && text3 != '' && text4 != ''){133 exec(x);134 }135}136function trf_rekening_dplk_bni_simponi(){137 var format = 'SETOR DPLK ';138 var text1 = document.getElementById('text1').value;139 var text2 = document.getElementById('text2').value;140 var x = format.concat(text1,' ',text2);141 if(text1 != '' && text2 != ''){142 exec(x);143 }144}145//end of menu transfer146147148//menu pembayaran149$('#kartu_kredit').unbind('click').click(function() {kartu_kredit();});150$('#telepon_pasca_bayar2').unbind('click').click(function() {telepon_pasca_bayar2();});151$('#listrik2').unbind('click').click(function() {listrik2();});152$('#air_listrik').unbind('click').click(function() {air_listrik();});153$('#tv_internet_berlangganan').unbind('click').click(function() {tv_internet_berlangganan();});154$('#tiket').unbind('click').click(function() {tiket();});155$('#zakat_infaq_qurban').unbind('click').click(function() {zakat_infaq_qurban();});156$('#penerimaan_negara').unbind('click').click(function() {penerimaan_negara();});157$('#asuransi').unbind('click').click(function() {asuransi();});158$('#pinjaman_personal').unbind('click').click(function() {pinjaman_personal();});159$('#samsat').unbind('click').click(function() {samsat();});160$('#angsuran_multi_finance').unbind('click').click(function() {angsuran_multi_finance();});161$('#um_ptkin').unbind('click').click(function() {um_ptkin();});162$('#sbmptn').unbind('click').click(function() {sbmptn();});163$('#bpjs').unbind('click').click(function() {bpjs();});164$('#tki').unbind('click').click(function() {tki();});165$('#kepelabuhanan').unbind('click').click(function() {kepelabuhanan();});166167function kartu_kredit(){168 var format = 'PAY ';169 var text1 = document.getElementById('text1').value;170 var text2 = document.getElementById('text2').value;171 var text3 = document.getElementById('text3').value;172 var x = format.concat(text1,' ',text2,' ',text3);173 if(text1 != '' && text2 != '' && text3 != ''){174 exec(x);175 }176}177function telepon_pasca_bayar2(){178 var format = 'PAY ';179 var text1 = document.getElementById('text1').value;180 var text2 = document.getElementById('text2').value;181 var x = format.concat(text1,' ',text2);182 if(text1 != '' && text2 != ''){183 exec(x);184 }185}186function listrik2(){187 var format = 'PAY ';188 var text1 = document.getElementById('text2').value;189 var text2 = document.getElementById('text3').value;190 var x = format.concat(text1,' ',text2);191 if(text1 != '' && text2 != ''){192 exec(x);193 }194}195function air_listrik(){196 var format = 'PAY PAM ';197 var text1 = document.getElementById('text1').value;198 var text2 = document.getElementById('text2').value;199 var x = format.concat(text1,' ',text2);200 if(text1 != '' && text2 != ''){201 exec(x);202 }203}204function tv_internet_berlangganan(){205 var format = 'PAY ';206 var text1 = document.getElementById('text1').value;207 var text2 = document.getElementById('text2').value;208 var x = '';209210 x = format.concat(text1,' ',text2);211 if(text2 != '')212 exec(x);213 else214 alert ('No pelanggan kosong');215 216}217218function tiket(){219 var format = 'PAY ';220 var text1 = document.getElementById('text1').value;221 var text2 = document.getElementById('text2').value;222 var x = format.concat(text1,' ',text2);223 if(text1 != '' && text2 != ''){224 exec(x);225 }226}227function zakat_infaq_qurban(){228 var format = document.getElementById('jenis').value;229 var merchant = document.getElementById('merchant').value;230 var jumlah = document.getElementById('text2').value;231 232 if(merchant=="RZ"){233 var nohp = document.getElementById('text1').value;234 if(nohp.length<9){235 alert("Nomor handphone tidak valid");236 return;237 }238 format = format.concat(' ',merchant,' ',nohp,' ',jumlah);239 } else {240 format = format.concat(' ',merchant,' ',jumlah);241 }242 243 if(jumlah>0){244 exec(format);245 }246 247}248function penerimaan_negara(){249 var format = 'PAY ';250 var text1 = $('#text1').val();251 var text2 = $('#text2').val();252 var text3 = $('#text3').val();253 var text4 = $('#text4').val();254 var text5 = $('#text5').val();255256 if(text1 != '' && text3 != ''){ //PNBP AHU257 var x = format.concat(text1,' ',text3);258 exec(x);259 } else if (text3 == '' && text5 != '') { //PBB260 var x = format.concat(text1, ' ', text3, ' ', text4, ' ', text5);261 exec(x);262 } else if (text3 == '' && text5 == '') { //Pajak Daerah263 var x = format.concat(text1,' ', text2, ' ', text3, ' ', text4);264 exec(x);265 }266}267function asuransi(){268 var format = 'PAY ';269 var text1 = document.getElementById('text1').value;270 var text2 = document.getElementById('text2').value;271 var text4 = document.getElementById('text4').value;272 var text5 = document.getElementById('text5').value;273 var text6 = document.getElementById('text6').value;274275 //set premi awal prudential276277 if(text2 !=''){ //Jiwasraya278 var x = format.concat(text1,' ',text2);279 exec(x);280 }else if(text5 !='' && text6 == ''){ //Bumiputera281 var x = format.concat(text1,' ',text4,' ',text5);282 exec(x);283 } else if (text5 !='' && text6 !='') { //Bumiputera topup premi, Prudential all284 var x = format.concat(text1,' ',text4,' ',text5, ' ', text6);285 exec(x);286 }287}288289function bpjs(){290 var format = 'PAY ';291 var text1 = document.getElementById('text1').value;292 var text2 = document.getElementById('text2').value;293 var text3 = document.getElementById('text3').value;294295 if(text1 !='' && text2 !='' && text3 !=''){296 var x = format.concat(text1,' ',text2,' ',text3);297 exec(x);298 }299}300301function pinjaman_personal(){302 var format = 'PAY KTA ';303 var text1 = document.getElementById('text1').value;304 var text2 = document.getElementById('text2').value;305 var text3 = document.getElementById('text3').value;306 var x = format.concat(text1,' ',text2,' ',text3);307 if(text1 != '' && text2 != '' && text3 != ''){308 exec(x);309 }310}311function samsat(){312 var format = 'PAY ';313 var text1 = document.getElementById('text1').value;314 var text2 = document.getElementById('text2').value;315 var text3 = document.getElementById('text3').value;316 var x = format.concat(text1,' ',text2,'',text3);317 if(text1 != '' && text2 != '' && text3 != ''){318 exec(x);319 }320}321function angsuran_multi_finance(){322 var format = 'PAY ';323 var text1 = document.getElementById('text1').value;324 var text2 = document.getElementById('text2').value;325 var x = format.concat(text1,' ',text2);326 if(text1 != '' && text2 != ''){327 exec(x);328 }329}330331function um_ptkin() {332 var format = 'PAY UMPTKIN ';333 var text1 = document.getElementById('text1').value;334 var x = format.concat(text1);335 336 if(text1 != ''){337 exec(x);338 }339}340341function sbmptn() {342 var format = 'PAY UTBK ';343 var text1 = document.getElementById('text1').value;344 var text2 = document.getElementById('text2').value;345 var x = format.concat(text1,' ',text2);346 if(text1 != '' && text2 != ''){347 exec(x);348 }349350}351352function kai() {353 var format = 'PAY ';354 var text1 = document.getElementById('text1').value;355 var text2 = document.getElementById('text2').value;356 var x = format.concat(text1,' ',text2);357358 if (text2 != '') {359 exec(x);360 }361}362//CR19077363function pgn() {364 var format = 'PAY PGN ';365 var text1 = document.getElementById('text1').value;366 var x = format.concat(text1);367 if (text1 != '')368 exec(x);369}370//END CR19077371function tki() {372 var format = 'PAY TKI ';373 var text1 = document.getElementById('text1').value;374 var x = format.concat(text1);375 if (text1 != '')376 exec(x);377}378//CR26171379function kepelabuhanan() {380 var format = 'PAY ';381 var text1 = document.getElementById('text1').value;382 var text2 = document.getElementById('text2').value;383 var x = format.concat(text1,' ',text2);384 if(text1 != '' && text2 != ''){385 exec(x);386 }387}388//end of menu pembayaran389390//menu pembelian391$('#LinkAja').unbind('click').click(function() {LinkAja();});392$('#hp_telepon').unbind('click').click(function() {hp_telepon();});393$('#token_listrik').unbind('click').click(function() {token_listrik();});394$('#paketData').unbind('click').click(function() {paketData();});395$('#tapCash').unbind('click').click(function() {tapCash();});396$('#GoJek').unbind('click').click(function() {GoJek();});397//('#GrabPay').unbind('click').click(function() {GrabPay();});398$('#unikqu').unbind('click').click(function() {unikqu();});399$('#uangElektronik').unbind('click').click(function() {uangElektronik();});400$('#orange').unbind('click').click(function() {orange();});401$('#lpg3kg').unbind('click').click(function() {lpg3kg();});402403function LinkAja() {404 var format = 'TOP ';405 var text1 = document.getElementById('text1').value;406 var text2 = document.getElementById('text2').value;407 var text3 = document.getElementById('text3').value;408 var x = format.concat(text1,' ', text2, ' ', text3);409 410 if (text1 != '' && text2 != '' && text3 != '') {411 exec(x);412 }413}414415function hp_telepon(){416 var format = 'TOP ';417 var re = /\./gi;418 var text1 = document.getElementById('text1').value;419 var text2 = document.getElementById('text2').value;420 var valText3 = document.getElementById('text3').value;421 var text3 = valText3.replace(re,'');422 if(text1 != '' && text2 != '' && text3 != ''){423 if(text1 == 'TELKOMSEL' || text1 == 'INDOSAT'){424 var x = format.concat(text2,' ',text3);425 }else{426 var x = format.concat(text1,' ',text2,' ',text3);427 }428 exec(x);429 }430}431432function token_listrik(){433 var text1 = document.getElementById('text1').value;434 var format = 'PLN';435 var text2 = document.getElementById('text2').value;436 var isChooseCek = document.getElementById('isChooseCek').value;437 var x = '';438 if(isChooseCek == 'false'){439 x = text1.concat(' ',format,' ',text2);440 if(text1 != '' && text2 != ''){441 exec(x);442 }443 }else{444 var text3 = document.getElementById('text3').value;445 x = text1.concat(' ',format,' ',text2,' ',text3);446 if(text1 != '' && text2 != '' && text3 != ''){447 exec(x);448 }449 }450}451452function tapCash() {453 var format = 'TOP TAPCASH ';454 var text1 = document.getElementById('text1').value;455 var text2 = document.getElementById('text2').value;456 var x = format.concat(text1,' ', text2, ' ');457 458 if (text1 != '' && text2 != '') {459 exec(x);460 }461}462463function paketData() {464 var format = 'TOP ';465 var text1 = document.getElementById('text1').value;466 var text2 = document.getElementById('text2').value;467 var text4 = document.getElementById('text4').value;468 var text5 = document.getElementById('text5').value;469 var text3 = document.getElementById('text3').value;470 var text6 = document.getElementById('text6').value;471 472473 if(text1=='PULSA INTERNET TELKOMSEL' && text5 != ''&& text3!=''){474 var x = format.concat(text1, ' ', text3, ' ', text5);475 exec(x);476 }477 else if(text1=='XLData' && text2 != '' && text3 != ''){478 var x = format.concat(text1, ' ', text3, ' ', text2);479 exec(x);480 }481 else if(text1=='indosat' && text4 != ''&& text3 != ''){482 var x = format.concat(text4, ' ', text3);483 exec(x);484 } 485 else if (text1=='Paket Digital Telkomsel'){486 var x = format.concat(text6, ' ', text3);487 exec(x);488 }489 490 else{491 alert('Semua Field Harus Diisi Sebelum Melanjutkan Transaksi');492 } 493 494 495}496497function GoJek() {498 var format = 'TOP ';499 var text1 = document.getElementById('text1').value;500 var text2 = document.getElementById('text2').value;501 var text3 = document.getElementById('text3').value;502 var x = format.concat(text1,' ', text2, ' ', text3, ' ');503 504 if (text1 != '' && text2 != '' && text3 != '') {505 exec(x);506 }507}508509/*function GrabPay() {510 var format = 'TOP ';511 var text1 = document.getElementById('text1').value;512 var text2 = document.getElementById('text2').value;513 var text3 = document.getElementById('text3').value;514 var x = format.concat(text1,' ', text2, ' ', text3);515 516 if (text1 != '' && text2 != '' && text3 != '') {517 exec(x);518 }519}*/520521function unikqu() {522 var format = 'TOP UNIKQU ';523 var text1 = $('#text1').val();524 var text2 = $('#text2').val();525526 var x = format.concat(text1, ' ', text2);527528 if (text1 != '' && text2 != '')529 exec(x);530}531532function uangElektronik() {533 var format = 'TOP ';534 var text1 = document.getElementById('text1').value;535 var text2 = document.getElementById('text2').value;536 var text3 = document.getElementById('text3').value;537 var x = format.concat(text1,' ', text2, ' ', text3);538 539 if (text1 != '' && text2 != '' && text3 != '') {540 exec(x);541 }542}543544function orange() {545 var format = 'TOP ORANGE ';546 var text1 = $('#text1').val();547 var text2 = $('#text2').val();548549 var x = format.concat(text1, ' ', text2);550551 if (text1 != '' && text2 != '')552 exec(x);553}554555function lpg3kg() {556 var format = 'PAY LPG3KG ';557 var text1 = document.getElementById('text1').value;558 var text2 = document.getElementById('text2').value;559 var text3 = document.getElementById('text3').value;560 var text4 = document.getElementById('text4').value;561562 var x = format.concat(text1,' ', text2, ' ', text3, ' ', text4);563564 if (text1 != '' && text2 != '' && text3 != '' && text4 != '') {565 exec(x);566 }567}568569function orange() {570 var format = 'TOP ORANGE ';571 var text1 = $('#text1').val();572 var text2 = $('#text2').val();573574 var x = format.concat(text1, ' ', text2);575576 if (text1 != '' && text2 != '')577 exec(x);578}579580//end of menu pembelian581582//menu epayment583//$('#epayment').unbind('click').click(function() {epayment();});584$('#ewallet').unbind('click').click(function() {ewallet();});585//function epayment(){586// var format = 'BELI ';587// var text1 = document.getElementById('text1').value;588// var text2 = document.getElementById('text2').value;589// var x = format.concat(text1,' ',text2);590// if(text1 != '' && text2 != ''){591// exec(x);592// }593//}594function ewallet(){595 var isChooseTopup = document.getElementById('isChooseTopup').value;596 var text2 = document.getElementById('text2').value;597 var x = '';598 if(isChooseTopup == 'false'){599 x = text2;600 exec(x);601 }else{602 var text3 = document.getElementById('text3').value;603 var text4 = document.getElementById('text4').value;604 x = text2.concat(' ',text3,' ',text4);605 if(text3 != '' && text4 != ''){606 exec(x);607 }608 }609}610//end of menu epayment611612613//menu pengaturan614$('#ganti_pin').unbind('click').click(function() {ganti_pin();});615$('#daftarRekening').unbind('click').click(function() {daftarRekening();});616$('#gantiRekening').unbind('click').click(function() {gantiRekening();});617618function ganti_pin(){619 var format = 'PIN ';620 var text1 = document.getElementById('text1').value;621 var text2 = document.getElementById('text2').value;622 var x = format.concat(text1,' ',text2);623 var t1Hide = text1.replace(/./g, '*');624 var t2Hide = text2.replace(/./g, '*');625 var y = format.concat(t1Hide,' ',t2Hide);626 if(text1 != '' && text2 != ''){627 exec(x,y);628 }629}630631function daftarRekening() {632 var format = 'DAFTAR REKENING ';633634 exec(format);635}636637function gantiRekening() {638 var format = 'GANTI REKENING ';639 var text1 = document.getElementById('text1').value;640 var x = format.concat(text1);641642 if (text1 != '') {643 exec(x);644 }645}646//end of menu pengaturan647648//menu free syntax649$('#free_syntax').unbind('click').click(function() {free_syntax();});650function free_syntax(){651 var x = document.getElementById('text1').value;652 if(x != ''){653 exec(x);654 }655}656//end of menu free syntax657658function exec(param1,param2){659 $(".loader").show();660 if(param1 != null){661 // var showMessage = (typeof param2 === 'undefined') ? param1 :param2;662 // $(document).ready(function() {663 // $.getScript("bootstrap/js/bootbox.min.js").done(function(){664 // bootbox.dialog({665 // message : showMessage,666 // title : "Anda akan mengirim ?",667 // buttons:{668 // warning:{669 // label:"Setuju",670 // className :"btn btn-warning",671 // callback : function(){672 send(param1);673 // }674 // },675 // default:{676 // label:"Batal",677 // className :"btn btn-default"678 // }679 // }680 // });681 // });682 // });683 }684}685686function send(message){687688 var data =[message];689 var isfavorit = window.document.getElementById('isFavoritID');690 isfavorit = (isfavorit == null ? false : isFavorit());691692 if(isfavorit){693 if(window.localStorage.length < 100){694 if(addFavorit()){695 customBridge.sendSMS(message);696 }else{697 boxAlert("Nama favorit tidak boleh kosong dan pesan anda gagal terkirim!");698 }699700 }else{701 boxAlert("Fitur favorit maksimal 100 item dan pesan anda gagal terkirim!");702 }703 }else{704 customBridge.sendSMS(message);705 }706}707708function boxAlert(msg){709 $('document').ready(function(){710 $.getScript("bootstrap/js/bootbox.min.js").done(function(){711 bootbox.alert(msg);712 });713 }); ...

Full Screen

Full Screen

Masks.js

Source:Masks.js Github

copy

Full Screen

1export const maskCpfCnpj = (text) => {2 let text2 = text.replace(/\./g, '').replace(/\-/g, '').replace(/\//g, '');3 let final_num = '';4 if (text2.length <= 11) {5 for (let i = 0; i < text2.length && i < 11; i++) {6 if (!isNaN(text2[i])) {7 if (i == 3) {8 final_num += '.' + text2[i];9 }10 else if (i == 6) {11 final_num += '.' + text2[i];12 }13 else if (i == 9) {14 final_num += '-' + text2[i];15 }16 else {17 final_num += text2[i] + '';18 }19 }20 }21 }22 else {23 // 35.590.099/0001-0324 for (let i = 0; i < text2.length && i < 14; i++) {25 if (!isNaN(text2[i])) {26 if (i == 2) {27 final_num += '.' + text2[i];28 }29 else if (i == 5) {30 final_num += '.' + text2[i];31 }32 else if (i == 8) {33 final_num += '/' + text2[i];34 }35 else if (i == 12) {36 final_num += '-' + text2[i];37 }38 else {39 final_num += text2[i] + '';40 }41 }42 }43 }44 return final_num;45 // this.setState({ cpf: final_num });46}47export const maskCnpj = (text) => {48 let text2 = text.replace(/\./g, '').replace(/\-/g, '').replace(/\//g, '');49 let final_num = '';50 // 35.590.099/0001-0351 for (let i = 0; i < text2.length && i < 14; i++) {52 // if (Number.isInteger(text[i])) {53 if (!isNaN(text2[i])) {54 if (i == 2) {55 final_num += '.' + text2[i];56 }57 else if (i == 5) {58 final_num += '.' + text2[i];59 }60 else if (i == 8) {61 final_num += '/' + text2[i];62 }63 else if (i == 12) {64 final_num += '-' + text2[i];65 }66 else {67 final_num += text2[i] + '';68 }69 }70 }71 return final_num;72 // this.setState({ cpf: final_num });73}74export const maskNascimento = (text) => {75 let text2 = text.replace('/', '').replace('/', '');76 let final_num = '';77 for (let i = 0; i < text2.length && i < 8; i++) {78 // if (Number.isInteger(text[i])) {79 if (i == 2) {80 final_num += '/' + text2[i];81 }82 else if (i == 4) {83 final_num += '/' + text2[i];84 }85 else {86 final_num += text2[i] + '';87 }88 // }89 }90 return final_num;91}92export const maskDatas = (text) => {93 let text2 = text.replace(/(\d*)-(\d*)-(\d*).*/, '$3/$2/$1');94 return text2;95}96export const maskTelefone = (text) => {97 let text2 = text.replace('(', '').replace(')', '').replace(' ', '').replace('-', '');98 let final_num = '';99 for (let i = 0; i < text2.length && i < 11; i++) {100 // if (Number.isInteger(text[i])) {101 if (!isNaN(text2[i])) {102 if (i == 0) {103 final_num += '(' + text2[i];104 }105 else if (i == 2) {106 final_num += ') ' + text2[i];107 }108 else if (i == 6 && text2.length <= 10) {109 final_num += '-' + text2[i];110 }111 else if (i == 7 && text2.length >= 11) {112 final_num += '-' + text2[i];113 }114 else {115 final_num += text2[i] + '';116 }117 }118 }119 return final_num;120}121export const maskRg = (text) => {122 let text2 = text.replace('.', '').replace('-', '').replace('.', '');123 let final_num = '';124 for (let i = 0; i < text2.length && i < 9; i++) {125 // if (Number.isInteger(text[i])) {126 if (i == 2) {127 final_num += '.' + text2[i];128 }129 else if (i == 5) {130 final_num += '.' + text2[i];131 }132 else if (i == 8) {133 final_num += '-' + text2[i];134 }135 else {136 final_num += text2[i] + '';137 }138 // }139 }140 return final_num;141 // this.setState({ cpf: final_num });142}143export const maskCep = (text) => {144 let text2 = text.replace('-', '');145 let final_num = '';146 for (let i = 0; i < text2.length && i < 8; i++) {147 // if (Number.isInteger(text[i])) {148 if (!isNaN(text2[i])) {149 if (i == 5) {150 final_num += '-' + text2[i];151 }152 else {153 final_num += text2[i] + '';154 }155 }156 // }157 }158 return final_num;159 // this.setState({ cep: final_num });160}161function reverseString(str) {162 // Step 1. Use the split() method to return a new array163 var splitString = str.split(""); // var splitString = "hello".split("");164 // ["h", "e", "l", "l", "o"]165 // Step 2. Use the reverse() method to reverse the new created array166 var reverseArray = splitString.reverse(); // var reverseArray = ["h", "e", "l", "l", "o"].reverse();167 // ["o", "l", "l", "e", "h"]168 // Step 3. Use the join() method to join all elements of the array into a string169 var joinArray = reverseArray.join(""); // var joinArray = ["o", "l", "l", "e", "h"].join("");170 // "olleh"171 //Step 4. Return the reversed string172 return joinArray; // "olleh"173}174export const maskPrice = (text) => {175 if (!text) return text;176 text = text.replace(',', '');177 text = text.replace(/\./g, '');178 text = text.replace('R', '');179 text = text.replace('$', '');180 text = text.replace(' ', '');181 let text2 = text;182 text = reverseString(text);183 let final_num = '';184 let minus = 4;185 for (let i = 0; i < text.length; i++) {186 if (isNaN(text[i])) {187 continue;188 }189 // if (Number.isInteger(text[i])) {190 if (i == 1 && i != text.length - 1) {191 final_num += text[i] + ',';192 }193 else if (i == minus && i != text.length - 1) {194 final_num += text[i] + '.';195 minus += 3;196 }197 else {198 final_num += text[i] + '';199 }200 // }201 }202 final_num = reverseString(final_num);203 if (text.length != 0)204 if(parseFloat(text2)>=0){205 final_num = 'R$ ' + final_num;206 }207 else{208 final_num = 'R$ -' + final_num;209 }210 // if(final_num.length==1){211 // final_num+='R$ 00.0'+final_num;212 // }213 // else if(final_num==2){214 // final_num+='R$ 00.'+final_num;215 // }216 // else{217 // final_num+='R$ '+final_num;218 // }219 return final_num;220}221export const maskNumber = (text2) => {222 let final_num = '';223 text2 = text2.replace(',', '')224 for (let i = 0; i < text2.length; i++) {225 if (!isNaN(text2[i]) || (text2[i] == '.' && !final_num.includes('.'))) {226 final_num += text2[i] + '';227 }228 }229 return final_num;230}231export const maskNumber1 = (text2) => {232 let final_num = '';233 text2 = text2.replace(',', '')234 for (let i = 0; i < text2.length; i++) {235 if (!isNaN(text2[i]) && text2[i]!=0|| (text2[i] == '.' && !final_num.includes('.'))) {236 final_num += text2[i] + '';237 }238 }239 return final_num;240}241export const maskDouble = (text) => {242 let text2 = text.replace(',', '');243 text2 = text2.replace('.', '');244 text2 = text2.replace(' ', '');245 console.log(text2);246 text2 = parseFloat(text2).toString();247 console.log(text2);248 let final_num = '';249 if (text2.length == 1) {250 if (!isNaN(text2[0])) {251 final_num += '0,0' + text2[0];252 }253 }254 else if (text2.length == 2) {255 if (!isNaN(text2[0]) && !isNaN(text2[1])) {256 final_num += '0,' + text2[0] + text2[1];257 }258 }259 else {260 for (let i = 0; i < text2.length; i++) {261 if (!isNaN(text2[i])) {262 if (i == text2.length - 3) {263 final_num += text2[i] + ',';264 }265 else {266 final_num += text2[i] + '';267 }268 }269 }270 }271 return final_num;272}273export const maskPercent = (text2) => {274 let final_num = '';275 // text2 = text2.replace(',', '').replace('.', '')276 for (let i = 0; i < text2.length; i++) {277 if (!isNaN(text2[i]) || (text2[i] == '.' && !final_num.includes('.'))) {278 final_num += text2[i] + '';279 }280 }281 // final_num+='%';282 return final_num;283}284export const maskCpf = (text) => {285 let text2 = text.replace(/\./g, '').replace(/\-/g, '').replace(/\//g, '');286 let final_num = '';287 for (let i = 0; i < text2.length && i < 11; i++) {288 if (!isNaN(text2[i])) {289 if (i == 3) {290 final_num += '.' + text2[i];291 }292 else if (i == 6) {293 final_num += '.' + text2[i];294 }295 else if (i == 9) {296 final_num += '-' + text2[i];297 }298 else {299 final_num += text2[i] + '';300 }301 }302 }303 return final_num;304 // this.setState({ cpf: final_num });...

Full Screen

Full Screen

Changetext.js

Source:Changetext.js Github

copy

Full Screen

1function TranslateYinglis(text) {2 var text2 = text.toLowerCase();3 //Replace words4 text2 = text2.replace(' goodnight ', ' nitenite ');5 text2 = text2.replace(" i don't ", " ion ");6 text2 = text2.replace(" want to ", " wanna ");7 text2 = text2.replace(" ion wanna ", " ionwanna ");8 text2 = text2.replace(" going to ", " gonna ");9 text2 = text2.replace(" discrete ", "discrete ");10 text2 = text2.replace(" english ", " yeinglis ");11 text2 = text2.replace(" yes ", " ye ");12 text2 = text2.replace(" oh no ", " wohno ");13 text2 = text2.replace(" peace ", " pspoice ");14 text2 = text2.replace(" lol ", " xD ");15 text2 = text2.replace(" if ", " yif ");16 text2 = text2.replace(" i am ", " i iz ");17 text2 = text2.replace(" im ", " i iz ");18 text2 = text2.replace(" is ", " iz ");19 //Apply rules20 text2 = text2.replace("ing ", "in ");21 text2 = text2.replace("ck", "cc");22 text2 = text2.replace("sh ", "sh");23 text2 = text2.replace(" s", " sh");24 text2 = text2.replace(" shh", " sh");25 text2 = text2.replace(" e", " ye");26 text2 = text2.replace("k", "g");27 text2 = text2.replace("me ", "m ");28 text2 = text2.replace(" m ", " me ");29 text2 = text2.replace(" aw", " wo");30 text2 = text2.replace("y ", "i ");31 text2 = text2.replace(" qu", " qw");32 return text2;33}34var elements = document.getElementsByTagName('*');35for (var i = 0; i < elements.length; i++) {36 var element = elements[i];37 for (var j = 0; j < element.childNodes.length; j++) {38 var node = element.childNodes[j];39 if (node.nodeType === 3) {40 var text = node.nodeValue;41 var replacedText = TranslateYinglis(text);42 if (replacedText !== text) {43 element.replaceChild(document.createTextNode(replacedText), node);44 }45 }46 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptext = require('wptext');2var text = wptext.text2();3console.log(text);4var wptext = require('wptext');5var text = wptext.text3();6console.log(text);7var wptext = require('wptext');8var text = wptext.text1();9console.log(text);10var wptext = require('wptext');11var text = wptext.text2();12console.log(text);13var wptext = require('wptext');14var text = wptext.text3();15console.log(text);

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptext2 = require('./wptext2.js');2console.log(wptext2.text2());3var text2 = function() {4 return 'text2';5}6module.exports.text2 = text2;7var wptext2 = require('wptext2.js');8var wptext2 = require('wptext2');9var wptext2 = require('./wptext2');10var fileDialog = require('file-dialog');11var files = fileDialog({multiple: false});12var fileDialog = require('file-dialog.js');13var files = fileDialog({multiple: false});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptext = require("wptext");2var text = wptext.text2();3console.log(text);4module.exports.text2 = function(){5 return "This is text2";6}

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptext2 = require('./wptext2');2console.log(wptext2.text2("hello world"));3exports.text2 = function(text){4 return text + " from wptext2";5};6exports.text = function(text){7 return text + " from wptext";8};9exports.text = function(text){10 return text + " from wp";11};12exports.text = function(text){13 return text + " from index";14};15exports.text2 = function(text){16 return text + " from wptext2";17};18exports.text = function(text){19 return text + " from wptext";20};21exports.text = function(text){22 return text + " from wp";23};24exports.text = function(text){25 return text + " from index";26};27exports.text = function(text){28 return text + " from index";29};30exports.text = function(text){31 return text + " from index";32};33exports.text = function(text){34 return text + " from index";35};36exports.text = function(text){37 return text + " from index";38};39exports.text2 = function(text){40 return text + " from wptext2";41};42exports.text = function(text){

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptext = require('wptext');2var text2 = wptext.text2;3var text = text2("Hello World");4console.log(text);5var text2 = function(text) {6 return text;7}8exports.text2 = text2;9var text2 = function(text) {10 return text;11}12exports.text2 = text2;13var text3 = function(text) {14 return text;15}16exports.text3 = text3;17var wptext = require('wptext');18var text2 = wptext.text2;19var text = text2("Hello World");20console.log(text);21var text3 = wptext.text3;22var text = text3("Hello World");23console.log(text);

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptext = require('./wptext');2var t = new wptext();3console.log(t.text2('Hello World'));4module.exports = wptext;5function wptext() {6 this.text2 = function (text) {7 return text + '2';8 };9}

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptext2 = require('wptext2');2var text2 = new wptext2();3var text = text2.text2("My text");4console.log(text);5var text2 = function() {6 this.text2 = function(text) {7 return text;8 }9}10module.exports = text2;

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful