Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 8981 Rev 8987
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
            'text': {
788
                updateCkeditor:function() {
-
 
789
                    CKEDITOR.instances.section_text.updateElement();
-
 
790
                },
-
 
791
                required: false,
788
                required: false,
792
            },
789
            },
793
        },
790
        },
794
        highlight: function(element) {
791
        highlight: function(element) {
795
            $(element).closest('.form-group').addClass('has-error');
792
            $(element).closest('.form-group').addClass('has-error');
Línea 817... Línea 814...
817
            var slug = $('#form-section #section-slug').val();
814
            var slug = $('#form-section #section-slug').val();
818
            if (slug) {
815
            if (slug) {
819
                objFormGenerator.editSection(
816
                objFormGenerator.editSection(
820
                    $('#form-section #section-slug').val(),
817
                    $('#form-section #section-slug').val(),
821
                    $('#form-section #section-name').val(),
818
                    $('#form-section #section-name').val(),
822
                    $('#form-section #section_text').val(),
819
                    $('#form-section #text').val(),
823
                );
820
                );
824
            } else {
821
            } else {
825
                objFormGenerator.addSection(
822
                objFormGenerator.addSection(
826
                    $('#form-section #section-name').val(),
823
                    $('#form-section #section-name').val(),
827
                    $('#form-section #section_text').val()
824
                    $('#form-section #text').val()
828
                );
825
                );
829
            }
826
            }
830
            renderSectionData(objFormGenerator.sections);
827
            renderSectionData(objFormGenerator.sections);
831
            $('#modal-section').modal('hide');
828
            $('#modal-section').modal('hide');
832
            return false;
829
            return false;
Línea 974... Línea 971...
974
    $('body').on('click', 'button[id="btn-add-section"]', function(e) {
971
    $('body').on('click', 'button[id="btn-add-section"]', function(e) {
975
        e.preventDefault();
972
        e.preventDefault();
976
        validatorFormSection.resetForm();
973
        validatorFormSection.resetForm();
977
        $('#form-section #section-slug').val('');
974
        $('#form-section #section-slug').val('');
978
        $('#form-section #section-name').val('');
975
        $('#form-section #section-name').val('');
979
        CKEDITOR.instances.section_text.setData('');
976
        CKEDITOR.instances.text.setData('');
980
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
977
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
981
        $('#modal-section').modal('show');
978
        $('#modal-section').modal('show');
982
    });
979
    });
983
    /**
980
    /**
984
     * Clicked on edit section
981
     * Clicked on edit section
Línea 992... Línea 989...
992
            section = objFormGenerator.sections[i];
989
            section = objFormGenerator.sections[i];
993
            if (slug == section.slug_section) {
990
            if (slug == section.slug_section) {
994
                validatorFormSection.resetForm();
991
                validatorFormSection.resetForm();
995
                $('#form-section #section-slug').val(section.slug_section);
992
                $('#form-section #section-slug').val(section.slug_section);
996
                $('#form-section #section-name').val(section.name);
993
                $('#form-section #section-name').val(section.name);
997
                CKEDITOR.instances.section_text.setData(section.text);
994
                CKEDITOR.instances.text.setData(section.text);
998
                showForm = true;
995
                showForm = true;
999
                break;
996
                break;
1000
            }
997
            }
1001
        }
998
        }
1002
        if (showForm) {
999
        if (showForm) {
Línea 1372... Línea 1369...
1372
     */
1369
     */
1373
    $('button.btn-refresh').click(function(e) {
1370
    $('button.btn-refresh').click(function(e) {
1374
        tableForm.fnDraw();
1371
        tableForm.fnDraw();
1375
    });
1372
    });
Línea 1376... Línea -...
1376
 
-
 
1377
    CKEDITOR.replace('section_text', {
-
 
1378
        toolbar: [
-
 
1379
                    { name: 'editing', items: ['Scayt'] },
-
 
1380
                    { name: 'links', items: ['Link', 'Unlink'] },
-
 
1381
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
-
 
1382
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
-
 
1383
                    '/',
-
 
1384
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
-
 
1385
                    { name: 'styles', items: ['Styles', 'Format'] },
-
 
1386
                    { name: 'tools', items: ['Maximize'] }
-
 
1387
                ],
-
 
1388
                removePlugins: 'elementspath,Anchor',
-
 
1389
                heigth: 100
1373
 
1390
    });
-
 
1391
    CKEDITOR.replace('description', {
1374
 
1392
        toolbar: [
-
 
1393
                    { name: 'editing', items: ['Scayt'] },
-
 
1394
                    { name: 'links', items: ['Link', 'Unlink'] },
-
 
1395
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
-
 
1396
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
-
 
1397
                    '/',
-
 
1398
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
-
 
1399
                    { name: 'styles', items: ['Styles', 'Format'] },
-
 
1400
                    { name: 'tools', items: ['Maximize'] }
-
 
1401
                ],
-
 
1402
                removePlugins: 'elementspath,Anchor',
-
 
1403
                heigth: 100
-
 
1404
    });
-
 
1405
    CKEDITOR.replace('text', {
1375
    const config = {
1406
        toolbar: [
1376
        toolbar: [
1407
                    { name: 'editing', items: ['Scayt'] },
1377
                    { name: 'editing', items: ['Scayt'] },
1408
                    { name: 'links', items: ['Link', 'Unlink'] },
1378
                    { name: 'links', items: ['Link', 'Unlink'] },
1409
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
1379
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
Línea 1413... Línea 1383...
1413
                    { name: 'styles', items: ['Styles', 'Format'] },
1383
                    { name: 'styles', items: ['Styles', 'Format'] },
1414
                    { name: 'tools', items: ['Maximize'] }
1384
                    { name: 'tools', items: ['Maximize'] }
1415
                ],
1385
                ],
1416
                removePlugins: 'elementspath,Anchor',
1386
                removePlugins: 'elementspath,Anchor',
1417
                heigth: 100
1387
                heigth: 100
1418
    });
1388
    }
-
 
1389
 
-
 
1390
    CKEDITOR.replace('text', config);
-
 
1391
    CKEDITOR.replace('description', config);
-
 
1392
    CKEDITOR.replace('text', config);
Línea 1419... Línea 1393...
1419
     
1393
     
1420
});
1394
});
1421
JS;
1395
JS;
1422
$this->inlineScript()->captureEnd();
1396
$this->inlineScript()->captureEnd();
Línea 1557... Línea 1531...
1557
                            <label for="section-name">LABEL_FIRST_NAME</label>
1531
                            <label for="section-name">LABEL_FIRST_NAME</label>
1558
                            <input type="text" name="section-name" id="section-name" class="form-control" maxlength="50" value="" />
1532
                            <input type="text" name="section-name" id="section-name" class="form-control" maxlength="50" value="" />
1559
                        </div>
1533
                        </div>
1560
                        <div class="form-group">
1534
                        <div class="form-group">
1561
                        <div class="form-group">
1535
                        <div class="form-group">
1562
                            <label for="section_text">LABEL_TEXT</label>
1536
                            <label for="text">LABEL_TEXT</label>
1563
                            <!--  ckeditor -->
1537
                            <!--  ckeditor -->
1564
                            <textarea  name="section_text" id="section_text" rows="5" class="ckeditor form-control"></textarea>
1538
                            <textarea  name="text" id="text" rows="5" class="ckeditor form-control"></textarea>
1565
                        </div>
1539
                        </div>
1566
                    </div>
1540
                    </div>
1567
                    <div class="modal-footer">
1541
                    <div class="modal-footer">
1568
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1542
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1569
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
1543
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>