Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 8968 Rev 8974
Línea 782... Línea 782...
782
            'section-name': {
782
            'section-name': {
783
                required: true,
783
                required: true,
784
                minlength: 2,
784
                minlength: 2,
785
                maxlength: 50
785
                maxlength: 50
786
            },
786
            },
787
            'section-text': {
787
            'section_text': {
788
                required: false,
788
                required: false,
789
            },
789
            },
790
        },
790
        },
791
        highlight: function(element) {
791
        highlight: function(element) {
792
            $(element).closest('.form-group').addClass('has-error');
792
            $(element).closest('.form-group').addClass('has-error');
Línea 814... Línea 814...
814
            var slug = $('#form-section #section-slug').val();
814
            var slug = $('#form-section #section-slug').val();
815
            if (slug) {
815
            if (slug) {
816
                objFormGenerator.editSection(
816
                objFormGenerator.editSection(
817
                    $('#form-section #section-slug').val(),
817
                    $('#form-section #section-slug').val(),
818
                    $('#form-section #section-name').val(),
818
                    $('#form-section #section-name').val(),
819
                    $('#form-section #section-text').val(),
819
                    $('#form-section #section_text').val(),
820
                );
820
                );
821
            } else {
821
            } else {
822
                objFormGenerator.addSection(
822
                objFormGenerator.addSection(
823
                    $('#form-section #section-name').val(),
823
                    $('#form-section #section-name').val(),
824
                    $('#form-section #section-text').val()
824
                    $('#form-section #section_text').val()
825
                );
825
                );
826
            }
826
            }
827
            renderSectionData(objFormGenerator.sections);
827
            renderSectionData(objFormGenerator.sections);
828
            $('#modal-section').modal('hide');
828
            $('#modal-section').modal('hide');
829
            return false;
829
            return false;
Línea 971... Línea 971...
971
    $('body').on('click', 'button[id="btn-add-section"]', function(e) {
971
    $('body').on('click', 'button[id="btn-add-section"]', function(e) {
972
        e.preventDefault();
972
        e.preventDefault();
973
        validatorFormSection.resetForm();
973
        validatorFormSection.resetForm();
974
        $('#form-section #section-slug').val('');
974
        $('#form-section #section-slug').val('');
975
        $('#form-section #section-name').val('');
975
        $('#form-section #section-name').val('');
976
        CKEDITOR.instances['section-text'].setData('');
976
        CKEDITOR.instances.section_text.setData('');
977
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
977
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
978
        $('#modal-section').modal('show');
978
        $('#modal-section').modal('show');
979
    });
979
    });
980
    /**
980
    /**
981
     * Clicked on edit section
981
     * Clicked on edit section
Línea 989... Línea 989...
989
            section = objFormGenerator.sections[i];
989
            section = objFormGenerator.sections[i];
990
            if (slug == section.slug_section) {
990
            if (slug == section.slug_section) {
991
                validatorFormSection.resetForm();
991
                validatorFormSection.resetForm();
992
                $('#form-section #section-slug').val(section.slug_section);
992
                $('#form-section #section-slug').val(section.slug_section);
993
                $('#form-section #section-name').val(section.name);
993
                $('#form-section #section-name').val(section.name);
994
                CKEDITOR.instances['section-text'].setData(section.text);
994
                CKEDITOR.instances.section_text.setData(section.text);
995
                showForm = true;
995
                showForm = true;
996
                break;
996
                break;
997
            }
997
            }
998
        }
998
        }
999
        if (showForm) {
999
        if (showForm) {
Línea 1369... Línea 1369...
1369
     */
1369
     */
1370
    $('button.btn-refresh').click(function(e) {
1370
    $('button.btn-refresh').click(function(e) {
1371
        tableForm.fnDraw();
1371
        tableForm.fnDraw();
1372
    });
1372
    });
Línea 1373... Línea 1373...
1373
 
1373
 
1374
    CKEDITOR.replace('#section-text', {
1374
    CKEDITOR.replace('section_text', {
1375
        toolbar: [
1375
        toolbar: [
1376
                    { name: 'editing', items: ['Scayt'] },
1376
                    { name: 'editing', items: ['Scayt'] },
1377
                    { name: 'links', items: ['Link', 'Unlink'] },
1377
                    { name: 'links', items: ['Link', 'Unlink'] },
1378
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
1378
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
Línea 1553... Línea 1553...
1553
                        <div class="form-group">
1553
                        <div class="form-group">
1554
                            <label for="section-name">LABEL_FIRST_NAME</label>
1554
                            <label for="section-name">LABEL_FIRST_NAME</label>
1555
                            <input type="text" name="section-name" id="section-name" class="form-control" maxlength="50" value="" />
1555
                            <input type="text" name="section-name" id="section-name" class="form-control" maxlength="50" value="" />
1556
                        </div>
1556
                        </div>
1557
                        <div class="form-group">
1557
                        <div class="form-group">
1558
                            <label for="section-text">LABEL_TEXT</label>
1558
                            <label for="section_text">LABEL_TEXT</label>
1559
                            <!--  ckeditor -->
1559
                            <!--  ckeditor -->
1560
                            <textarea  name="section-text" id="section-text" rows="5" class="ckeditor form-control"></textarea>
1560
                            <textarea  name="section_text" id="section_text" rows="5" class="ckeditor form-control"></textarea>
1561
                        </div>
1561
                        </div>
1562
                    </div>
1562
                    </div>
1563
                    <div class="modal-footer">
1563
                    <div class="modal-footer">
1564
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1564
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1565
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
1565
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>