Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 9003 Rev 9004
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': {
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').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').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.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.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
 
-
 
1374
 
1373
 
1375
    const config = {
1374
    CKEDITOR.replace('description', {
1376
        toolbar: [
1375
        toolbar: [
1377
                    { name: 'editing', items: ['Scayt'] },
1376
                    { name: 'editing', items: ['Scayt'] },
1378
                    { name: 'links', items: ['Link', 'Unlink'] },
1377
                    { name: 'links', items: ['Link', 'Unlink'] },
1379
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
1378
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
Línea 1383... Línea 1382...
1383
                    { name: 'styles', items: ['Styles', 'Format'] },
1382
                    { name: 'styles', items: ['Styles', 'Format'] },
1384
                    { name: 'tools', items: ['Maximize'] }
1383
                    { name: 'tools', items: ['Maximize'] }
1385
                ],
1384
                ],
1386
                removePlugins: 'elementspath,Anchor',
1385
                removePlugins: 'elementspath,Anchor',
1387
                heigth: 100
1386
                heigth: 100
1388
    }
1387
    });
1389
    CKEDITOR.replace('description', config);
1388
    CKEDITOR.replace('text', {
-
 
1389
        toolbar: [
-
 
1390
                    { name: 'editing', items: ['Scayt'] },
-
 
1391
                    { name: 'links', items: ['Link', 'Unlink'] },
-
 
1392
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
-
 
1393
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
-
 
1394
                    '/',
-
 
1395
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
-
 
1396
                    { name: 'styles', items: ['Styles', 'Format'] },
-
 
1397
                    { name: 'tools', items: ['Maximize'] }
-
 
1398
                ],
-
 
1399
                removePlugins: 'elementspath,Anchor',
1390
    CKEDITOR.replace('text', config);
1400
                heigth: 100
-
 
1401
    });
Línea 1391... Línea 1402...
1391
     
1402
     
1392
});
1403
});
1393
JS;
1404
JS;
1394
$this->inlineScript()->captureEnd();
1405
$this->inlineScript()->captureEnd();
Línea 1528... Línea 1539...
1528
                        <div class="form-group">
1539
                        <div class="form-group">
1529
                            <label for="section-name">LABEL_FIRST_NAME</label>
1540
                            <label for="section-name">LABEL_FIRST_NAME</label>
1530
                            <input type="text" name="section-name" id="section-name" class="form-control" maxlength="50" value="" />
1541
                            <input type="text" name="section-name" id="section-name" class="form-control" maxlength="50" value="" />
1531
                        </div>
1542
                        </div>
1532
                        <div class="form-group">
1543
                        <div class="form-group">
1533
                        <div class="form-group">
-
 
1534
                            <label for="section">LABEL_TEXT</label>
1544
                            <label for="section-text">LABEL_TEXT</label>
1535
                            <!--  ckeditor -->
1545
                            <!--  ckeditor -->
1536
                            <textarea  name="section" id="section" rows="5" class="ckeditor form-control"></textarea>
1546
                            <textarea  name="section-text" id="section-text" rows="5" class="ckeditor form-control"></textarea>
1537
                            
-
 
-
 
1547
                            <script>
-
 
1548
                                CKEDITOR.replace('section-text', {
-
 
1549
                                    toolbar: [
-
 
1550
                                        { name: 'editing', items: ['Scayt'] },
-
 
1551
                                        { name: 'links', items: ['Link', 'Unlink'] },
-
 
1552
                                        { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
-
 
1553
                                        { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
-
 
1554
                                        '/',
-
 
1555
                                        { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
-
 
1556
                                        { name: 'styles', items: ['Styles', 'Format'] },
-
 
1557
                                        { name: 'tools', items: ['Maximize'] }
-
 
1558
                                    ],
-
 
1559
                                    removePlugins: 'elementspath,Anchor',
-
 
1560
                                    heigth: 100
-
 
1561
                                });
-
 
1562
                            </script>
1538
                        </div>
1563
                        </div>
1539
                    </div>
1564
                    </div>
1540
                    <div class="modal-footer">
1565
                    <div class="modal-footer">
1541
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1566
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1542
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
1567
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>