Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15443 Rev 16796
Línea 67... Línea 67...
67
 
67
 
68
 
68
 
69
$this->inlineScript()->captureStart();
69
$this->inlineScript()->captureStart();
70
echo <<<JS
70
echo <<<JS
71
    const classFormGenerator = function() {
71
    const classFormGenerator = function() {
72
    this.id = 0,
72
        this.id = 0,
73
        this.table = '',
73
        this.table = '',
74
        this.name = '',
74
        this.name = '',
75
        this.text = '',
75
        this.text = '',
76
        this.status = 'a',
76
        this.status = 'a',
77
        this.sections = [],
77
        this.sections = [],
78
        this.clear = function() {
78
        this.clear = function() {
79
            this.sections = [];
79
            this.sections = [];
-
 
80
            this.render();
80
            this.render();
81
        },
81
        },
82
 
82
        /**
83
        /**
83
         * Render array sections
84
         * Render array sections
84
         */
85
         */
Línea 417... Línea 418...
417
                this.renderSection(slug_section);
418
                this.renderSection(slug_section);
418
            }
419
            }
419
        }
420
        }
420
}
421
}
Línea -... Línea 422...
-
 
422
 
421
 
423
 
422
function htmlEntities(str) {
424
function htmlEntities(str) {
423
    return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
425
    return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
-
 
426
}
424
}
427
 
425
jQuery(document).ready(function($) {
-
 
426
    var objFormGenerator = new classFormGenerator();
-
 
427
    objFormGenerator.render();
428
jQuery(document).ready(function($) {
428
    var allowEdit = $allowEdit;
429
    var allowEdit = $allowEdit;
-
 
430
    var allowDelete = $allowDelete;
-
 
431
 
-
 
432
 
-
 
433
 
-
 
434
    var objFormGenerator = new classFormGenerator();
-
 
435
    objFormGenerator.render();
429
    var allowDelete = $allowDelete;
436
 
430
    /**
437
    /**
431
     * Get rows and set data table
438
     * Get rows and set data table
432
     */
439
     */
433
    var tableForm = $('#gridTable').dataTable({
440
    var tableForm = $('#gridTable').dataTable({
Línea 566... Línea 573...
566
                    return s;
573
                    return s;
567
                }
574
                }
568
            }
575
            }
569
        ],
576
        ],
570
    });
577
    });
-
 
578
 
571
    /**
579
    /**
572
     * Clicked on edit form
580
     * Clicked on edit form
573
     */
581
     */
574
    $('body').on('click', 'button.btn-edit-form', function(e) {
582
    $('body').on('click', 'button.btn-edit-form', function(e) {
575
        e.preventDefault();
583
        e.preventDefault();
Línea 610... Línea 618...
610
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
618
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
611
            }
619
            }
612
        }).fail(function(jqXHR, textStatus, errorThrown) {
620
        }).fail(function(jqXHR, textStatus, errorThrown) {
613
            $.fn.showError(textStatus);
621
            $.fn.showError(textStatus);
614
        });
622
        });
-
 
623
 
615
    });
624
    });
-
 
625
 
616
    $(document).on('click', '[data-type="select_all"]', function() {
626
    $(document).on('click', '[data-type="select_all"]', function() {
617
        if ($('input[name="select_all"]:checked').val() == 'all') {
627
        if ($('input[name="select_all"]:checked').val() == 'all') {
618
            $('[data-type="select"]').prop('checked', true);
628
            $('[data-type="select"]').prop('checked', true);
619
            $('[data-action="delete"]').removeClass('hide');
629
            $('[data-action="delete"]').removeClass('hide');
620
        } else {
630
        } else {
Línea 632... Línea 642...
632
        $.each($("input[name='select[]']:checked"), function() {
642
        $.each($("input[name='select[]']:checked"), function() {
633
            selected.push($(this).val());
643
            selected.push($(this).val());
634
        });
644
        });
635
        return selected;
645
        return selected;
636
    }
646
    }
-
 
647
 
637
    $(document).on('change', "input[name='select[]']", function() {
648
    $(document).on('change', "input[name='select[]']", function() {
638
        var c = currentSelected();
649
        var c = currentSelected();
639
        var cc = getLength();
650
        var cc = getLength();
640
        if (c.length == cc) {
651
        if (c.length == cc) {
641
            if ($('[data-action="delete"]').hasClass('hide')) {
652
            if ($('[data-action="delete"]').hasClass('hide')) {