How to use PROGRESS_TEXT method in Best

Best JavaScript code snippet using best

jquery.main.js

Source:jquery.main.js Github

copy

Full Screen

1var ready = function() {2 //original field values3 var field_values = {4 //id : value5 'user' : 'user_username',6 'pass' : 'user_password',7 'cpassword' : 'cpassword',8 'idioma' : 'pre_matriculation[language]',9 'curso' : 'curso',10 'nivel' : 'nivel',11 'name' : 'name',12 'paternal_lastname' : 'paternal_lastname',13 'maternal_lastname' : 'maternal_lastname',14 'dni' : 'dni',15 'address' : 'address',16 'district' : 'district',17 'province' : 'province',18 'department' : 'department',19 'home_phone' : 'home_phone',20 'mobile_phone' : 'mobile_phone',21 'sexo' : 'sexo',22 'birthday' : 'birthday',23 'birthplace' : 'birthplace',24 'estado_civil' : 'estado_civil',25 'unica' : 'is_unica',26 'escuela': 'escuela',27 'postgrado': 'postgrado'28 29 };30 //inputfocus31 $('input#user_username').inputfocus({ value: field_values['user_password'] });32 $('input#user_password').inputfocus({ value: field_values['pass'] });33 $('input#cpassword').inputfocus({ value: field_values['cpassword'] }); 34 //reset progress bar35 $('#progress').css('width','0');36 $('#progress_text').html('0% Complete');37 38 $('#submit_first').click(function(){39 //remove classes40 $('#first_step input').removeClass('error').removeClass('valid');41 //ckeck if inputs aren't empty42 var fields = $('#first_step input[type=text], #first_step input[type=password]');43 var error = 0;44 fields.each(function(){45 var value = $(this).val();46 if( value.length<4 || value==field_values[$(this).attr('id')] ) {47 $(this).addClass('error');48 $(this).effect("shake", { times:3 }, 50);49 50 error++;51 } else {52 $(this).addClass('valid');53 }54 }); 55 56 if(!error) {57 if( $('#user_password').val() != $('#cpassword').val() ) {58 $('#first_step input[type=password]').each(function(){59 $(this).removeClass('valid').addClass('error');60 $(this).effect("shake", { times:3 }, 50);61 });62 63 return false;64 } else { 65 //update progress bar66 $('#progress_text').html('5% Complete');67 $('#progress').css('width','37px');68 //slide steps69 $('#first_step').slideUp();70 $('#second_step').slideDown(); 71 } 72 } else return false;73 });74 $('#submit_second').click(function(){75 76 $('#second_step input').removeClass('error').removeClass('valid');77 var error = 0;78 jQuery("input[type='radio'][name='language']").each(function(index, button){79 if ( jQuery( 'input[name=language]:checked' ).val() == null ) {80 $(this).addClass('error');81 $(this).effect("shake", { times:3 }, 50);82 83 error++;84 } else {85 $(this).addClass('valid');86 }87 }); 88 89 if(!error) {90 //update progress bar91 $('#progress_text').html('10% Complete');92 $('#progress').css('width','80px');93 //slide steps94 $('#second_step').slideUp();95 $('#third_step').slideDown(); 96 97 } 98 99 });100 jQuery("input[type='radio'][name='language']").each(function(index, button){101 102 103 if ( jQuery( 'input[name=language]:checked' ).val() == '1' )104 {105 idioma = 'Inglés'106 }107 if ( jQuery( 'input[name=language]:checked' ).val() == '2' )108 {109 idioma = 'Francés'110 }111 if ( jQuery( 'input[name=language]:checked' ).val() == '3' )112 {113 idioma = 'Portugués'114 }115 if ( jQuery( 'input[name=language]:checked' ).val() == '4' )116 {117 idioma = 'Italiano'118 }119 120 });121 $('#submit_third_yes').click(function(){122 123 //update progress bar124 $('#progress_text').html('15% Complete');125 $('#progress').css('width','80px');126 //slide steps127 $('#third_step').slideUp();128 $('#fourth_step_yes').slideDown(); 129 130 });131 $('#submit_date1').click(function(){132 133 //update progress bar134 $('#progress_text').html('40% Complete');135 $('#progress').css('width','80px');136 //slide steps137 $('#date1_step').slideUp();138 $('#sixth_step').slideDown(); 139 140 });141 $('#submit_date2').click(function(){142 143 //update progress bar144 $('#progress_text').html('40% Complete');145 $('#progress').css('width','80px');146 //slide steps147 $('#date2_step').slideUp();148 $('#horario1_step').slideDown(); 149 150 });151 $('#submit_date3').click(function(){152 153 //update progress bar154 $('#progress_text').html('40% Complete');155 $('#progress').css('width','80px');156 //slide steps157 $('#date3_step').slideUp();158 $('#sixth_step').slideDown(); 159 160 });161 $('#submit_horario1').click(function(){162 163 //update progress bar164 $('#progress_text').html('50% Complete');165 $('#progress').css('width','80px');166 //slide steps167 $('#horario1_step').slideUp();168 $('#sixth_step').slideDown(); 169 170 });171 $('#submit_horario2').click(function(){172 173 //update progress bar174 $('#progress_text').html('50% Complete');175 $('#progress').css('width','80px');176 //slide steps177 $('#horario2_step').slideUp();178 $('#sixth_step').slideDown(); 179 180 });181 $('#submit_third_no').click(function(){182 183 //update progress bar184 $('#progress_text').html('15% Complete');185 $('#progress').css('width','80px');186 //slide steps187 $('#third_step').slideUp();188 $('#fourth_step_no').slideDown(); 189 190 });191 192 $('#submit_fourth_no').click(function(){193 //update progress bar194 $('#progress_text').html('40% Complete');195 $('#progress').css('width','148px');196 197 //slide steps198 $('#fourth_step_no').slideUp();199 $('#fifth_step').slideDown(); 200 201 });202 $('#submit_fifth').click(function(){203 //update progress bar204 $('#progress_text').html('50% Complete');205 $('#progress').css('width','185px'); 206 //slide steps207 $('#fifth_step').slideUp();208 $('#sixth_step').slideDown(); 209 210 });211 $('#submit_sixth').click(function(){212 $('#sixth_step input').removeClass('error').removeClass('valid');213 //ckeck if inputs aren't empty214 var fields = $('#sixth_step input[type=text]');215 var error = 0;216 fields.each(function(){217 var value = $(this).val();218 if( value.length<1 || value==field_values[$(this).attr('id')] ) {219 $(this).addClass('error');220 $(this).effect("shake", { times:3 }, 50);221 222 error++;223 } else {224 $(this).addClass('valid');225 }226 }); 227 228 if(!error) {229 $('#progress_text').html('55% Complete');230 $('#progress').css('width','222px');231 //slide steps232 $('#sixth_step').slideUp();233 $('#seventh_step').slideDown(); 234 235 } else return false; 236 237 });238 $('#submit_seventh').click(function(){239 $('#seventh_step input').removeClass('error').removeClass('valid');240 //ckeck if inputs aren't empty241 var fields = $('#seventh_step input[type=text]');242 var error = 0;243 fields.each(function(){244 var value = $(this).val();245 if( value.length<1 || value==field_values[$(this).attr('id')] ) {246 $(this).addClass('error');247 $(this).effect("shake", { times:3 }, 50);248 249 error++;250 } else {251 $(this).addClass('valid');252 }253 }); 254 255 if(!error) {256 257 //update progress bar258 $('#progress_text').html('60% Complete');259 $('#progress').css('width','259px');260 //slide steps261 $('#seventh_step').slideUp();262 $('#eighth_step').slideDown(); 263 264 } else return false; 265 266 });267 $('#submit_eighth').click(function(){268 $('#eighth_step input').removeClass('error').removeClass('valid');269 var fields = $('#eighth_step input[type=text]');270 var error = 0;271 fields.each(function(){272 var value = $(this).val();273 if( value.length<1 || value==field_values[$(this).attr('id')] ) {274 $(this).addClass('error');275 $(this).effect("shake", { times:3 }, 50);276 277 error++;278 } else {279 $(this).addClass('valid');280 }281 }); 282 jQuery("input[type='radio'][name='sex']").each(function(index, button){283 if ( jQuery( 'input[name=sex]:checked' ).val() == null ) {284 $(this).addClass('error');285 $(this).effect("shake", { times:3 }, 50);286 287 error++;288 } else {289 $(this).addClass('valid');290 }291 }); 292 293 if(!error) {294 //update progress bar295 $('#progress_text').html('65% Complete');296 $('#progress').css('width','269px');297 //slide steps298 $('#eighth_step').slideUp();299 $('#ninth_step').slideDown(); 300 301 } 302 303 304 });305 jQuery("input[type='radio'][name='sex']").each(function(index, button){306 307 308 if ( jQuery( 'input[name=sex]:checked' ).val() == '1' )309 {310 sexo = 'Masculino'311 }312 if ( jQuery( 'input[name=sex]:checked' ).val() == '2' )313 {314 sexo = 'Femenino'315 }316 317 });318 $('#submit_ninth').click(function(){319 //$('#ninth_step input').removeClass('error').removeClass('valid');320 //ckeck if inputs aren't empty321 //var fields = $('#ninth_step input[type=text], #ninth_step input[type=date]');322 //var error = 0;323 //fields.each(function(){324 // var value = $(this).val();325 // if( value.length<1 || value==field_values[$(this).attr('id')] ) {326 // $(this).addClass('error');327 // $(this).effect("shake", { times:3 }, 50);328 329 // error++;330 // } else {331 // $(this).addClass('valid');332 // }333 // }); 334 335 // if(!error) {336 337 //update progress bar338 $('#progress_text').html('70% Complete');339 $('#progress').css('width','339px');340 //slide steps341 $('#ninth_step').slideUp();342 $('#tenth_step').slideDown(); 343 344 // } else return false; 345 346 });347 $('#submit_tenth').click(function(){348 $('#tenth_step input').removeClass('error').removeClass('valid');349 var error = 0;350 jQuery("input[type='radio'][name='marital_status']").each(function(index, button){351 if ( jQuery( 'input[name=marital_status]:checked' ).val() == null ) {352 $(this).addClass('error');353 $(this).effect("shake", { times:3 }, 50);354 355 error++;356 } else {357 $(this).addClass('valid');358 }359 }); 360 361 if(!error) {362 //update progress bar363 $('#progress_text').html('85% Complete');364 $('#progress').css('width','339px');365 //slide steps366 $('#tenth_step').slideUp();367 $('#eleventh_step').slideDown(); 368 369 } 370 });371 jQuery("input[type='radio'][name='marital_status']").each(function(index, button){372 373 374 if ( jQuery( 'input[name=marital_status]:checked' ).val() == '1' )375 {376 estado_civil = Casado(a)377 }378 if ( jQuery( 'input[name=marital_status]:checked' ).val() == '2' )379 {380 estado_civil = Soltero(a)381 }382 if ( jQuery( 'input[name=marital_status]:checked' ).val() == '3' )383 {384 estado_civil = Divorciado(a)385 }386 if ( jQuery( 'input[name=marital_status]:checked' ).val() == '4' )387 {388 estado_civil = Separado(a)389 }390 if ( jQuery( 'input[name=marital_status]:checked' ).val() == '5' )391 {392 estado_civil = Conviviente(a)393 }394 395 });396 $('#submit_escuela').click(function(){397 //update progress bar398 $('#progress_text').html('95% Complete');399 $('#progress').css('width','339px');400 //slide steps401 $('#escuela_step').slideUp();402 $('#postgrado_step1').slideDown(); 403 404 });405 $('#submit_postgrado1').click(function(){406 $('#postgrado_step1 input').removeClass('error').removeClass('valid');407 var error = 0;408 jQuery("input[type='radio'][name='postgrade_person']").each(function(index, button){409 if ( jQuery( 'input[name=postgrade_person]:checked' ).val() == null ) {410 $(this).addClass('error');411 $(this).effect("shake", { times:3 }, 50);412 413 error++;414 } else {415 $(this).addClass('valid');416 }417 }); 418 419 if(!error) {420 //update progress bar421 $('#progress_text').html('90% Complete');422 $('#progress').css('width','339px');423 //slide steps424 $('#postgrado_step1').slideUp();425 426 $('#twelfth_step').slideDown(); 427 428 } 429 430 });431 $('#submit_postgrado2').click(function(){432 $('#postgrado_step2 input').removeClass('error').removeClass('valid');433 var error = 0;434 jQuery("input[type='radio'][name='postgrade_person']").each(function(index, button){435 if ( jQuery( 'input[name=postgrade_person]:checked' ).val() == null ) {436 $(this).addClass('error');437 $(this).effect("shake", { times:3 }, 50);438 439 error++;440 } else {441 $(this).addClass('valid');442 }443 }); 444 445 if(!error) {446 //update progress bar447 $('#progress_text').html('90% Complete');448 $('#progress').css('width','339px');449 //slide steps450 $('#postgrado_step2').slideUp();451 452 $('#twelfth_step').slideDown(); 453 454 } 455 });456 $('#submit_twelfth').click(function(){457 //update progress bar458 $('#progress_text').html('100% Complete');459 $('#progress').css('width','339px');460 var fields = new Array(461 $('#usuario').val(),462 $('#pass').val(),463 idioma,464 curso,465 //nivel466 null,467 $('#name').val(),468 $('#paternal_lastname').val() + ' ' + $('#maternal_lastname').val(),469 $('#dni').val(),470 $('#address').val(),471 $('#district').val(),472 $('#province').val(),473 $('#department').val(),474 //$('#home_phone').val(),475 //$('#mobile_phone').val(),476 sexo,477 //$('#birthday').val(),478 //$('#birthplace').val(),479 //estado_civil,480 unica481 );482 var tr = $('#thirteenth_step tr');483 tr.each(function(){484 //alert( fields[$(this).index()] );485 $(this).children('td:nth-child(2)').html(fields[$(this).index()]);486 });487 488 //slide steps489 $('#twelfth_step').slideUp();490 $('#thirteenth_step').slideDown(); 491 492 });493 $('#back2one').click(function(){494 //update progress bar495 $('#progress_text').html('10% Complete');496 $('#progress').css('width','148px');497 498 //slide steps499 $('#second_step').slideUp();500 $('#first_step').slideDown(); 501 502 });503 $('#back2second').click(function(){504 //update progress bar505 $('#progress_text').html('15% Complete');506 $('#progress').css('width','148px');507 508 //slide steps509 $('#third_step').slideUp();510 $('#second_step').slideDown(); 511 512 });513 $('#back2third_yes').click(function(){514 //update progress bar515 $('#progress_text').html('20% Complete');516 $('#progress').css('width','148px');517 518 //slide steps519 $('#fourth_step_yes').slideUp();520 $('#third_step').slideDown(); 521 522 });523 $('#back2third_no').click(function(){524 //update progress bar525 $('#progress_text').html('20% Complete');526 $('#progress').css('width','148px');527 528 //slide steps529 $('#fourth_step_no').slideUp();530 $('#third_step').slideDown(); 531 532 });533 $('#back2fourth_yes_v').click(function(){534 //update progress bar535 $('#progress_text').html('25% Complete');536 $('#progress').css('width','148px');537 538 //slide steps539 $('#v_exam_pago_step1').slideUp();540 $('#fourth_step_yes').slideDown(); 541 542 });543 $('#back2fourth_yes_l').click(function(){544 //update progress bar545 $('#progress_text').html('25% Complete');546 $('#progress').css('width','148px');547 548 //slide steps549 $('#level_step').slideUp();550 $('#fourth_step_yes').slideDown(); 551 552 });553 $('#back2vea').click(function(){554 //update progress bar555 $('#progress_text').html('30% Complete');556 $('#progress').css('width','148px');557 558 //slide steps559 $('#date1_step').slideUp();560 $('#v_exam_pago_step1').slideDown(); 561 562 });563 $('#back2vea2').click(function(){564 //update progress bar565 $('#progress_text').html('30% Complete');566 $('#progress').css('width','148px');567 568 //slide steps569 $('#date2_step').slideUp();570 $('#horario2_step').slideUp();571 $('#v_exam_pago_step2').slideDown(); 572 573 });574 $('#back2date2').click(function(){575 //update progress bar576 $('#progress_text').html('40% Complete');577 $('#progress').css('width','148px');578 579 //slide steps580 $('#horario1_step').slideUp();581 $('#date2_step').slideDown(); 582 583 });584 $('#back2vea3').click(function(){585 //update progress bar586 $('#progress_text').html('40% Complete');587 $('#progress').css('width','148px');588 589 //slide steps590 $('#date3_step').slideUp();591 $('#v_exam_pago_step3').slideDown(); 592 593 });594 $('#back2level').click(function(){595 //update progress bar596 $('#progress_text').html('35% Complete');597 $('#progress').css('width','148px');598 599 //slide steps600 $('#v_exam_pago_step2').slideUp();601 $('#level_step').slideDown(); 602 603 });604 $('#back2level1').click(function(){605 //update progress bar606 $('#progress_text').html('35% Complete');607 $('#progress').css('width','148px');608 609 //slide steps610 $('#v_exam_pago_step2').slideUp();611 $('#level_step').slideDown(); 612 613 });614 $('#back2level2').click(function(){615 //update progress bar616 $('#progress_text').html('35% Complete');617 $('#progress').css('width','148px');618 619 //slide steps620 $('#v_exam_pago_step3').slideUp();621 $('#level_step').slideDown(); 622 623 });624$('#back2fourth').click(function(){625 //update progress bar626 $('#progress_text').html('20% Complete');627 $('#progress').css('width','148px');628 629 //slide steps630 $('#fifth_step').slideUp();631 $('#fourth_step_no').slideDown(); 632 633 });634$('#back2fifth').click(function(){635 //update progress bar636 $('#progress_text').html('40% Complete');637 $('#progress').css('width','148px');638 639 //slide steps640 $('#sixth_step').slideUp();641 $('#fifth_step').slideDown(); 642 });643$('#back2sixth').click(function(){644 //update progress bar645 $('#progress_text').html('50% Complete');646 $('#progress').css('width','148px');647 648 //slide steps649 $('#seventh_step').slideUp();650 $('#sixth_step').slideDown(); 651 652 });653$('#back2seventh').click(function(){654 //update progress bar655 $('#progress_text').html('55% Complete');656 $('#progress').css('width','148px');657 658 //slide steps659 $('#eighth_step').slideUp();660 $('#seventh_step').slideDown(); 661 662 });663$('#back2eighth').click(function(){664 //update progress bar665 $('#progress_text').html('60% Complete');666 $('#progress').css('width','148px');667 668 //slide steps669 $('#ninth_step').slideUp();670 $('#eighth_step').slideDown(); 671 672 });673$('#back2ninth').click(function(){674 //update progress bar675 $('#progress_text').html('65% Complete');676 $('#progress').css('width','148px');677 678 //slide steps679 $('#tenth_step').slideUp();680 $('#ninth_step').slideDown(); 681 682 });683$('#back2tenth').click(function(){684 //update progress bar685 $('#progress_text').html('70% Complete');686 $('#progress').css('width','148px');687 688 //slide steps689 $('#eleventh_step').slideUp();690 $('#tenth_step').slideDown(); 691 });692$('#back2eleventh').click(function(){693 //update progress bar694 $('#progress_text').html('75% Complete');695 $('#progress').css('width','148px');696 697 //slide steps698 $('#escuela_step').slideUp();699 $('#eleventh_step').slideDown(); 700 701 });702$('#back2escuela').click(function(){703 //update progress bar704 $('#progress_text').html('85% Complete');705 $('#progress').css('width','148px');706 707 //slide steps708 $('#postgrado_step1').slideUp();709 $('#escuela_step').slideDown(); 710 711 });712$('#back2unica').click(function(){713 //update progress bar714 $('#progress_text').html('80% Complete');715 $('#progress').css('width','148px');716 717 //slide steps718 $('#postgrado_step2').slideUp();719 $('#eleventh_step').slideDown(); 720 721 });722$('#back2postgrado').click(function(){723 //update progress bar724 $('#progress_text').html('90% Complete');725 $('#progress').css('width','148px');726 727 //slide steps728 $('#twelfth_step').slideUp();729 $('#postgrado_step2').slideDown(); 730 731 });732$('#back2twelfth').click(function(){733 //update progress bar734 $('#progress_text').html('100% Complete');735 $('#progress').css('width','148px');736 737 //slide steps738 $('#thirteenth_step').slideUp();739 $('#twelfth_step').slideDown(); 740 741 });742 743 jQuery("input[type='radio'][name='course_type']").each(function(index, button){744 if ( jQuery( 'input[name=course_type]:checked' ).val() == '1' )745 {746 curso = 'Técnico'747 }748 if ( jQuery( 'input[name=course_type]:checked' ).val() == '2' )749 {750 curso = 'Comunicativo'751 }752 // Give the button a certain click behaviour:753 jQuery(button).click(function(){754 755 if ( jQuery( 'input[name=course_type]:checked' ).val() == '1' )756 {757 $('#submit_fourth_yes').click(function(){758 //update progress bar759 $('#progress_text').html('20% Complete');760 $('#progress').css('width','148px');761 762 //slide steps763 764 $('#fourth_step_yes').slideUp();765 $('#level_step').slideUp();766 $('#v_exam_pago_step1').slideDown(); 767 768 });769 }770 if ( jQuery( 'input[name=course_type]:checked' ).val() == '2' )771 {772 $('#submit_fourth_yes').click(function(){773 //update progress bar774 $('#progress_text').html('20% Complete');775 $('#progress').css('width','148px');776 777 //slide steps778 779 $('#fourth_step_yes').slideUp();780 $('#v_exam_pago_step1').slideUp();781 $('#level_step').slideDown(); 782 783 }); 784 }785 });786 });787jQuery("input[type='radio'][name='validation_type']").each(function(index, button){788 // Give the button a certain click behaviour:789 jQuery(button).click(function(){790 791 if ( jQuery( 'input[name=validation_type]:checked' ).val() == '1' )792 {793 $('#submit_vea').click(function(){794 //update progress bar795 $('#progress_text').html('30% Complete');796 $('#progress').css('width','148px');797 798 //slide steps799 800 $('#v_exam_pago_step1').slideUp();801 $('#sixth_step').slideUp();802 $('#date1_step').slideDown(); 803 804 });805 $('#submit_vea1').click(function(){806 //update progress bar807 $('#progress_text').html('30% Complete');808 $('#progress').css('width','148px');809 810 //slide steps811 812 $('#v_exam_pago_step2').slideUp();813 814 $('#date2_step').slideDown(); 815 816 });817 $('#submit_vea2').click(function(){818 //update progress bar819 $('#progress_text').html('30% Complete');820 $('#progress').css('width','148px');821 822 //slide steps823 824 $('#v_exam_pago_step3').slideUp();825 826 $('#date3_step').slideDown(); 827 828 });829 }830 if ( jQuery( 'input[name=validation_type]:checked' ).val() == '0' )831 {832 $('#submit_vea').click(function(){833 //update progress bar834 $('#progress_text').html('30% Complete');835 $('#progress').css('width','148px');836 837 //slide steps838 839 $('#v_exam_pago_step1').slideUp();840 $('#date1_step').slideUp(); 841 $('#sixth_step').slideDown(); 842 843 }); 844 $('#submit_vea2').click(function(){845 //update progress bar846 $('#progress_text').html('30% Complete');847 $('#progress').css('width','148px');848 849 //slide steps850 851 $('#v_exam_pago_step3').slideUp();852 $('#date3_step').slideUp();853 $('#sixth_step').slideDown(); 854 855 });856 }857 });858 });859 860 jQuery("input[type='radio'][name='level']").each(function(index, button){861 if ( jQuery( 'input[name=level]:checked' ).val() == '1' )862 {863 nivel = 'Básico'864 }865 if ( jQuery( 'input[name=level]:checked' ).val() == '2' )866 {867 nivel = 'Intermedio'868 }869 if ( jQuery( 'input[name=level]:checked' ).val() == '3' )870 {871 nivel = 'Avanzado'872 }873 // Give the button a certain click behaviour:874 jQuery(button).click(function(){875 if ( jQuery( 'input[name=level]:checked' ).val() == '1' )876 {877 $('#submit_level').click(function(){878 //update progress bar879 $('#progress_text').html('25% Complete');880 $('#progress').css('width','148px');881 882 //slide steps883 884 $('#level_step').slideUp();885 $('#v_exam_pago_step2').slideUp();886 $('#v_exam_pago_step3').slideDown(); 887 888 });889 }890 if ( jQuery( 'input[name=level]:checked' ).val() == '2' || jQuery( 'input[name=level]:checked' ).val() == '3' )891 {892 $('#submit_level').click(function(){893 //update progress bar894 $('#progress_text').html('25% Complete');895 $('#progress').css('width','148px');896 897 //slide steps898 899 $('#level_step').slideUp();900 $('#v_exam_pago_step3').slideUp();901 $('#v_exam_pago_step2').slideDown(); 902 903 });904 } 905 });906 });907jQuery("input[type='radio'][name='is_unica']").each(function(index, button){908 909 if ( jQuery( 'input[name=is_unica]:checked' ).val() == '1' )910 {911 unica = 'Sí'912 }913 if ( jQuery( 'input[name=is_unica]:checked' ).val() == '2' )914 {915 unica = 'No'916 }917 // Give the button a certain click behaviour:918 jQuery(button).click(function(){919 if ( jQuery( 'input[name=is_unica]:checked' ).val() == '1' )920 {921 $('#submit_eleventh').click(function(){922 //update progress bar923 $('#progress_text').html('90% Complete');924 $('#progress').css('width','148px');925 926 //slide steps927 $('#eleventh_step').slideUp();928 929 $('#escuela_step').slideDown(); 930 931 });932 }933 if ( jQuery( 'input[name=is_unica]:checked' ).val() == '2' )934 {935 $('#submit_eleventh').click(function(){936 //update progress bar937 $('#progress_text').html('90% Complete');938 $('#progress').css('width','148px');939 940 //slide steps941 942 $('#eleventh_step').slideUp();943 $('#escuela_step').slideUp();944 $('#postgrado_step2').slideDown(); 945 946 });947 }948 });949 });950jQuery("input[type='radio'][name='postgrade_person']").each(function(index, button){951 952 if ( jQuery( 'input[name=postgrade_person]:checked' ).val() == '1' )953 {954 postgrado = 'No'955 }956 if ( jQuery( 'input[name=postgrade_person]:checked' ).val() == '2' )957 {958 postgrado = 'Magister'959 }960 if ( jQuery( 'input[name=postgrade_person]:checked' ).val() == '3' )961 {962 postgrado = 'Doctor'963 }964 965 });966};967$(document).ready(ready);...

Full Screen

Full Screen

admin-screen.js

Source:admin-screen.js Github

copy

Full Screen

1/*2 * Admin Screen3 * 4 */5( function( $ ) {6 "use strict";7 8 $(document).on( 'click', '.button-uninstall-demo', function(e) {9 10 var current = this;11 12 $.confirm({13 theme: 'supervan',14 title: false,15 content: seoaal_admin_ajax_var.unins_confirm,16 confirmButtonClass: 'btn-success',17 cancelButtonClass: 'btn-danger',18 confirmButton: seoaal_admin_ajax_var.yes,19 cancelButton: seoaal_admin_ajax_var.no,20 confirm: function(){21 22 var choosed_demo = $(this).data('demo-id');23 var loading_wrap = $(current).parents('.demo-inner').find('.zozo-demo-import-loader');24 var progress = $(current).parents('.zozothemes-demo-item').find('.installation-progress .progress');25 var progress_text = $(current).parents('.zozothemes-demo-item').find('.installation-progress p');26 progress.css('width', '0%');27 progress_text.text(seoaal_admin_ajax_var.uninstalling);28 loading_wrap.show();29 30 //Delete Attachments31 $.ajax({32 type: 'POST',33 url: seoaal_admin_ajax_var.admin_ajax_url,34 data: {35 action: 'seoaal_uninstall',36 },37 success: function(response){38 if( response && response.indexOf('success') == -1 ) {39 loading_wrap.hide();40 alert(response);41 }else{42 $('.zozothemes-demo-item').removeClass('demo-actived demo-inactive').addClass('demo-active');43 loading_wrap.hide();44 progress_text.text(seoaal_admin_ajax_var.uninstalled);45 }46 },47 error: function(response, errorThrown){48 loading_wrap.hide();49 alert(seoaal_admin_ajax_var.unins_pbm);50 }51 });52 }53 });54 return false;55 });56 var zozo_admin_screen = {57 install_demos: function() {58 $(document).on( 'click', '.button-install-demo', function(e) {59 60 e.preventDefault();61 var current = this;62 var progress = $(current).parents('.zozothemes-demo-item').find('.installation-progress .progress');63 var progress_text = $(current).parents('.zozothemes-demo-item').find('.installation-progress p');64 var choosed_demo = $(this).data('demo-id');65 var loading_wrap = $('.zozo-preview-' + choosed_demo);66 var requirement = $(this).parents('.demo-inner').find('.theme-requirements').data('requirements');67 var revslider = $(this).data('revslider');68 progress.css('width', '0%');69 if( choosed_demo !== null ) {70 71 $.confirm({72 theme: 'supervan',73 title: false,74 content: requirement,75 confirmButtonClass: 'btn-success',76 cancelButtonClass: 'btn-danger',77 confirmButton: seoaal_admin_ajax_var.proceed,78 cancelButton: seoaal_admin_ajax_var.cancel,79 confirm: function(){80 loading_wrap.show();81 $(current).parents('.zozothemes-demo-item').find('.installation-progress p').text(seoaal_admin_ajax_var.downloading);82 $('.zozo-importer-notice').hide();83 84 /*Demo Files Download*/85 $.ajax({86 type: 'POST',87 url: seoaal_admin_ajax_var.admin_ajax_url,88 data: {89 action: 'seoaal_download',90 demo_type: choosed_demo,91 revslider: revslider92 },93 success: function(response){94 95 if( response && response.indexOf('success') == -1 ) {96 alert(response);97 }else{98 progress.animate({'width' : "10%"});99 progress_text.text(seoaal_admin_ajax_var.import_theme_opt); //import_theme_opt100 101 /*Theme Option Import*/102 $.ajax({103 type: 'POST',104 url: seoaal_admin_ajax_var.admin_ajax_url,105 data: {106 action: 'seoaal_theme_option',107 },108 success: function(response){109 if( response && response.indexOf('success') == -1 ) {110 alert(response);111 }else{112 progress.animate({'width' : "20%"});113 progress_text.text(seoaal_admin_ajax_var.import_xml); //import_xml114 115 /*Theme Xml Import*/116 $.ajax({117 type: 'POST',118 url: seoaal_admin_ajax_var.admin_ajax_url,119 data: {120 action: 'seoaal_theme_xml',121 },122 success: function(response){123 if( response && response.indexOf('success') == -1 ) {124 alert(response);125 }else{126 progress.animate({'width' : "60%"});127 progress_text.text(seoaal_admin_ajax_var.import_sidebars); //import_sidebars128 129 /*Custom Sidebars Import*/130 $.ajax({131 type: 'POST',132 url: seoaal_admin_ajax_var.admin_ajax_url,133 data: {134 action: 'seoaal_custom_sidebars',135 },136 success: function(response){137 if( response && response.indexOf('success') == -1 ) {138 alert(response);139 }else{140 progress.animate({'width' : "70%"});141 progress_text.text(seoaal_admin_ajax_var.import_widg);142 143 /*Widgets Import*/144 $.ajax({145 type: 'POST',146 url: seoaal_admin_ajax_var.admin_ajax_url,147 data: {148 action: 'seoaal_widgets',149 },150 success: function(response){151 if( response && response.indexOf('success') == -1 ) {152 alert(response);153 }else{154 if( revslider != '' && revslider != 0 ){155 156 progress.animate({'width' : "80%"});157 progress_text.text(seoaal_admin_ajax_var.import_revslider);158 159 /*Revolution Slider Import*/160 $.ajax({161 type: 'POST',162 url: seoaal_admin_ajax_var.admin_ajax_url,163 data: {164 action: 'seoaal_rev_slider',165 demo_type: choosed_demo,166 revslider: revslider167 },168 success: function(response){169 if( response && response.indexOf('success') == -1 ) {170 alert(response);171 }else{172 progress.animate({'width' : "100%"});173 progress.animate({'opacity' : "0"});174 $('.zozothemes-demo-item').removeClass('demo-actived demo-inactive demo-active');175 $(current).parents('.zozothemes-demo-item').addClass('demo-actived');176 $('.zozothemes-demo-item:not(.demo-actived)').addClass('demo-inactive');177 progress.find('.progress-bar').removeClass('active');178 $('.regenerate-thumb').attr('style','display: block !important');179 progress_text.text(seoaal_admin_ajax_var.imported);180 181 }182 loading_wrap.hide();183 },184 error: function(response, errorThrown){185 alert(seoaal_admin_ajax_var.import_pbm);186 }187 }); // Revolution Slider End188 } // if revslider exists189 else{190 progress.animate({'width' : "100%"});191 progress.animate({'opacity' : "0"});192 $('.zozothemes-demo-item').removeClass('demo-actived demo-inactive demo-active');193 $(current).parents('.zozothemes-demo-item').addClass('demo-actived');194 $('.zozothemes-demo-item:not(.demo-actived)').addClass('demo-inactive');195 progress.find('.progress-bar').removeClass('active');196 $('.regenerate-thumb').attr('style','display: block !important');197 progress_text.text(seoaal_admin_ajax_var.imported);198 loading_wrap.hide();199 }200 201 }202 },203 error: function(response, errorThrown){204 alert(seoaal_admin_ajax_var.import_pbm);205 }206 }); // Widget Import End 207 }208 },209 error: function(response, errorThrown){210 alert(seoaal_admin_ajax_var.import_pbm);211 }212 }); // Custom Sidebars Import End213 214 }215 },216 error: function(response, errorThrown){217 alert(seoaal_admin_ajax_var.import_pbm);218 }219 }); // Theme Xml Import End220 }221 },222 error: function(response, errorThrown){223 alert(seoaal_admin_ajax_var.import_pbm);224 }225 }); // Theme Option Import End226 }227 },228 error: function(response, errorThrown){229 alert(seoaal_admin_ajax_var.access_pbm);230 }231 }); // Demo Files Download End232 },233 cancel: function(){}234 });235 236 }237 238 });239 },240 241 };242 243 $(document).ready(function(){244 245 zozo_admin_screen.install_demos();246 247 });248 ...

Full Screen

Full Screen

save-progress.js

Source:save-progress.js Github

copy

Full Screen

1const angular = require('angular');2import { sc_script_script } from '../../../../sc_map_io_lib/src/lib/script/sc_script_script';3import { sc_zip } from '../../../../sc_map_io_lib/src/lib/sc_zip';4const async = require('async');5const saveAs = require('file-saver').saveAs;6angular.module('sc_map_edit_bin.controllers').controller("save-progress",7["$scope", "$timeout", "$uibModalInstance", "data", function($scope, $timeout, $uibModalInstance, data) {8 $scope.data = {9 progress_value: 0,10 progress_text: "",11 finished: false,12 map: data.map,13 edit_heightmap: data.edit_heightmap,14 scripts: data.scripts15 };16 /**17 * Saves the map to local storage18 */19 const save_to_localstorage = function() {20 async.waterfall([21 (next) => {22 $scope.data.progress_text = "Serialising scripts...";23 $scope.data.progress_value = 0;24 $timeout(() => { next(null); }, 50);25 },26 (next) => {27 const serialised_scripts = {28 scenario: $scope.data.scripts.scenario.save(),29 save: $scope.data.scripts.save.save($scope.data.edit_heightmap)30 };31 $timeout(() => { next(null, serialised_scripts); }, 50);32 },33 (serialised_scripts, next) => {34 $scope.data.progress_text = "Synchronising heightmap...";35 $scope.data.progress_value = 0;36 $timeout(() => { next(null, serialised_scripts); }, 50);37 },38 (serialised_scripts, next) => {39 $scope.data.edit_heightmap.export_to_heightmap($scope.data.map.heightmap);40 $timeout(() => { next(null, serialised_scripts); }, 50);41 },42 (serialised_scripts, next) => {43 $scope.data.progress_text = "Serialising scmap...";44 $scope.data.progress_value = 20;45 $timeout(() => { next(null, serialised_scripts); }, 50);46 },47 (serialised_scripts, next) => {48 let serialised_map = data.map.save();49 $timeout(() => { next(null, serialised_scripts, serialised_map); }, 50);50 },51 (serialised_scripts, serialised_map, next) => {52 $scope.data.progress_text = "Encoding...";53 $scope.data.progress_value = 90;54 $timeout(() => { next(null, serialised_scripts, serialised_map); }, 50);55 },56 (serialised_scripts, serialised_map, next) => {57 // Base64 encode58 let b64_serialised_map = serialised_map.toBase64();59 let b64_serialised_scripts = {60 scenario: serialised_scripts.scenario.toBase64(),61 save: serialised_scripts.save.toBase64()62 };63 $timeout(() => { next(null, b64_serialised_scripts, b64_serialised_map); }, 50);64 },65 (b64_serialised_scripts, b64_serialised_map, next) => {66 $scope.data.progress_text = "Writing...";67 $scope.data.progress_value = 95;68 $timeout(() => { next(null, b64_serialised_scripts, b64_serialised_map); }, 50);69 },70 (b64_serialised_scripts, b64_serialised_map, next) => {71 // Write to local storage72 localStorage.setItem("sc_map_edit_bin.save.scenario", b64_serialised_scripts.scenario);73 localStorage.setItem("sc_map_edit_bin.save.save", b64_serialised_scripts.save);74 localStorage.setItem("sc_map_edit_bin.save.scmap", b64_serialised_map);75 $timeout(() => { next(); }, 100);76 }77 ],78 (err) => {79 if (err) {80 $scope.data.progress_text = `Error: ${err}`;81 $scope.data.progress_value = 0;82 $scope.data.finished = true;83 } else {84 $scope.data.progress_text = "Success";85 $scope.data.progress_value = 100;86 $timeout(() => { $uibModalInstance.close(); }, 300);87 }88 });89 };90 /**91 * Saves the map to a zipfile92 */93 const save_to_zipfile = function() {94 $scope.data.progress_text = "Serialising and compressing...";95 $scope.data.progress_value = 10;96 const map_data = {97 scmap: $scope.data.map,98 scripts: {99 scenario: $scope.data.scripts.scenario,100 save: $scope.data.scripts.save,101 script: new sc_script_script()102 },103 edit_heightmap: $scope.data.edit_heightmap104 };105 // Start the actual saving in a callback so dialog is shown faster106 $timeout(() => {107 sc_zip.save(map_data)108 .then((zip_arraybuffer) => {109 $timeout(() => {110 $scope.data.progress_text = `Success`;111 $scope.data.progress_value = 100;112 }, 0);113 $timeout(() => { $uibModalInstance.close(); }, 300);114 const blob = new Blob([zip_arraybuffer], {type: "application/octet-stream"});115 saveAs(blob, `${$scope.data.scripts.scenario.name}.zip`)116 })117 .catch((err) => {118 $timeout(() => {119 $scope.data.progress_text = `Error: ${err}`;120 $scope.data.progress_value = 0;121 $scope.data.finished = true;122 }, 0);123 });124 }, 300);125 };126 if (data.dest === 'localstorage') {127 save_to_localstorage();128 } else if (data.dest === 'zipfile') {129 save_to_zipfile();130 } else {131 $scope.data.progress_text = `Error: Unknown save destination '${data.dest}'`;132 $scope.data.progress_value = "0";133 $scope.data.finished = true;134 }135 $scope.ok = function() {136 $uibModalInstance.close();137 };138}]).run(['$templateCache', function($templateCache) {139 $templateCache.put('templates/dialogs/save-progress.html', require('../../../templates/dialogs/save-progress.html'));...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1function OnGUI () {2 if (GUI.Button (Rect (10,10,150,100), "Start Request")) {3 request.Send();4 }5}6function OnRequestFinished (request : HTTPRequest, response : HTTPResponse) {7 var data = response.DataAsText;8 Debug.Log(data);9}

Full Screen

Using AI Code Generation

copy

Full Screen

1var request = require('request');2var fs = require('fs');3var apiKey = require('./apiKey.json');4var counter = 0;5var total = 0;6var products = [];7request(url, function(err, response, body) {8 if (err) {9 console.log('Error:', err);10 } else if (response.statusCode !== 200) {11 console.log('Status:', response.statusCode);12 } else {13 var json = JSON.parse(body);14 total = json.total;15 console.log('Total:', total);16 console.log('Products:', json.products.length);17 products = products.concat(json.products);18 getProducts();19 }20});21function getProducts() {22 counter += 100;23 request(url, function(err, response, body) {24 if (err) {25 console.log('Error:', err);26 } else if (response.statusCode !== 200) {27 console.log('Status:', response.statusCode);28 } else {29 var json = JSON.parse(body);30 console.log('Products:', json.products.length);31 products = products.concat(json.products);32 if (counter < total) {33 getProducts();34 } else {35 fs.writeFile('products.json', JSON.stringify(products, null, 4), function(err) {36 if (err) {37 console.log('Error:', err);38 } else {39 console.log('File successfully written!');40 }41 });42 }43 }44 });45}46var request = require('request');47var fs = require('fs');48var apiKey = require('./apiKey.json');49var counter = 0;

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestFit = require('BestFit');2var bf = new BestFit();3bf.PROGRESS_TEXT = true;4var result = bf.run(100000000, 10000000, 10000000);5console.log(result);6var BestFit = require('BestFit');7var bf = new BestFit();8bf.PROGRESS_BAR = true;9var result = bf.run(100000000, 10000000, 10000000);10console.log(result);11var BestFit = require('BestFit');12var bf = new BestFit();13bf.PROGRESS_TEXT = true;14bf.PROGRESS_BAR = true;15var result = bf.run(100000000, 10000000, 10000000);16console.log(result);17var BestFit = require('BestFit');18var bf = new BestFit();19bf.PROGRESS_TEXT = true;20bf.PROGRESS_BAR = true;21var result = bf.run(100000000, 10000000, 10000000);22console.log(result);23var BestFit = require('BestFit');24var bf = new BestFit();25bf.PROGRESS_TEXT = true;26bf.PROGRESS_BAR = true;27var result = bf.run(100000000, 10000000, 10000000);28console.log(result);29var BestFit = require('BestFit');30var bf = new BestFit();31bf.PROGRESS_TEXT = true;32bf.PROGRESS_BAR = true;33var result = bf.run(100000000, 10000000, 10000000);34console.log(result);35var BestFit = require('BestFit');36var bf = new BestFit();37bf.PROGRESS_TEXT = true;38bf.PROGRESS_BAR = true;39var result = bf.run(100000000, 10000000,

Full Screen

Using AI Code Generation

copy

Full Screen

1function updateProgress(){2 var editor = BestInPlaceEditor.findEditorById('progress');3 editor.updateProgress();4}5function updateProgress(){6 var editor = BestInPlaceEditor.findEditorById('progress');7 editor.updateProgress();8}9function updateProgress(){10 var editor = BestInPlaceEditor.findEditorById('progress');11 editor.updateProgress();12}13function updateProgress(){14 var editor = BestInPlaceEditor.findEditorById('progress');15 editor.updateProgress();16}17function updateProgress(){18 var editor = BestInPlaceEditor.findEditorById('progress');19 editor.updateProgress();20}21function updateProgress(){22 var editor = BestInPlaceEditor.findEditorById('progress');23 editor.updateProgress();24}25function updateProgress(){26 var editor = BestInPlaceEditor.findEditorById('progress');27 editor.updateProgress();28}29function updateProgress(){30 var editor = BestInPlaceEditor.findEditorById('progress');31 editor.updateProgress();32}33function updateProgress(){34 var editor = BestInPlaceEditor.findEditorById('progress');35 editor.updateProgress();36}37function updateProgress(){38 var editor = BestInPlaceEditor.findEditorById('progress');

Full Screen

Using AI Code Generation

copy

Full Screen

1var BestFit = require('bestfit');2var bestfit = new BestFit();3var progress = 0.5;4bestfit.PROGRESS_TEXT(progress, function(err, result) {5 if (err) {6 console.log(err);7 }8 else {9 console.log('Progress text: ' + result);10 }11});12[MIT](LICENSE)

Full Screen

Using AI Code Generation

copy

Full Screen

1var best = require('bestjs');2var progress = require('./progress');3var bestInstance = new best.BestJS();4bestInstance.setProgressText("This is a long running task. Please wait...");5progress.showProgress(bestInstance, function() {6 console.log("Task is done");7});8var best = require('bestjs');9var bestInstance = new best.BestJS();10var showProgress = function(bestInstance, callback) {11 bestInstance.showProgress();12 setTimeout(function() {13 bestInstance.hideProgress();14 callback();15 }, 5000);16};17exports.showProgress = showProgress;

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 Best 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