Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 6309 | Rev 6413 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6309 Rev 6311
Línea 570... Línea 570...
570
        $("#extended-box").modal('hide');
570
        $("#extended-box").modal('hide');
571
        return false;
571
        return false;
572
    });
572
    });
Línea 573... Línea -...
573
 
-
 
574
 
-
 
575
	var validatorWebsite = $('#form-website').validate({
-
 
576
        debug: true,
-
 
577
        onclick: false,
-
 
578
        onkeyup: false,
-
 
579
        onfocusout: false,
-
 
580
        ignore: [],
-
 
581
        rules: {
-
 
582
            'website': {
-
 
583
                required: false,
-
 
584
                maxlength: 250,
-
 
585
                url: true,
-
 
586
            },
-
 
587
        },
-
 
588
 
-
 
589
        submitHandler: function(form)
-
 
590
        {
-
 
591
            NProgress.start();
-
 
592
            $.ajax({
-
 
593
                'dataType'  : 'json',
-
 
594
                'accept'    : 'application/json',
-
 
595
                'method'    : 'post',
-
 
596
                'url'       :  $('#form-website').attr('action'),
-
 
597
                'data'      :  $('#form-website').serialize()
-
 
598
            }).done(function(response) {
-
 
599
                if(response['success']) {
-
 
600
 
-
 
601
                    $('#overview-website').html(response['data']['website']);
-
 
602
                    $("#website-box").modal('hide');
-
 
603
                } else {
-
 
604
                    validatorWebsite.resetForm();
-
 
605
                    if(jQuery.type(response['data']) == 'string') {
-
 
606
                        $.fn.showError(response['data']);
-
 
607
                    } else  {
-
 
608
                        $.each(response['data'], function( fieldname, errors ) {
-
 
609
                            $.fn.showFormErrorValidator('#form-website #' + fieldname, errors);
-
 
610
                        });
-
 
611
                    }
-
 
612
                }
-
 
613
            }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
614
                $.fn.showError(textStatus);
-
 
615
            }).always(function() {
-
 
616
                NProgress.done();
-
 
617
            });
-
 
618
            return false;
-
 
619
        },
-
 
620
        invalidHandler: function(form, validator) {
-
 
621
        
-
 
622
        }
-
 
623
    });
-
 
624
 
-
 
625
 
-
 
626
    $('.btn-website-edit').on("click", function(e){
-
 
627
        e.preventDefault();
-
 
628
 
-
 
629
        NProgress.start();
-
 
630
        $.ajax({
-
 
631
            'dataType'  : 'json',
-
 
632
            'accept'    : 'application/json',
-
 
633
            'method'    : 'get',
-
 
634
            'url'       : '$routeWebsite',
-
 
635
        }).done(function(response) {
-
 
636
           if(response['success']) {
-
 
637
                $('#form-website #website').val(response['data']['website']);
-
 
638
                validatorWebsite.resetForm();
-
 
639
 
-
 
640
                $("#website-box").modal('show');
-
 
641
            } else {
-
 
642
                $.fn.showError(response['data']);
-
 
643
            }
-
 
644
        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
645
            $.fn.showError(textStatus);
-
 
646
        }).always(function() {
-
 
647
            NProgress.done();
-
 
648
        });
-
 
649
        return false;
-
 
650
 
-
 
651
    });
-
 
652
    
-
 
653
    $('.btn-website-close').on("click", function(e){
-
 
654
        e.preventDefault();
-
 
655
        
-
 
656
        $("#website-box").modal('hide');
-
 
657
        return false;
-
 
658
    });
573
 
659
 
574
 
660
	var validatorFoundationYear = $('#form-foundation-year').validate({
575
	var validatorFoundationYear = $('#form-foundation-year').validate({
661
        debug: true,
576
        debug: true,
662
        onclick: false,
577
        onclick: false,