Sha256: d3c243c45f39ee44c13d228f3019827cb12f4a67dac7b85e27240f156bcc95f6

Contents?: true

Size: 1.89 KB

Versions: 8

Compression:

Stored size: 1.89 KB

Contents

CKEDITOR.dialog.add('code', function (editor) {
    return {
        title: 'Code',
        minWidth: 400,
        minHeight: 200,
        contents: [{
            id: 'tab1',
            label: 'First Tab',
            title: 'First Tab',
            elements: [{
                type: 'html',
                id: 'content',
                html: '<select size="1" name="chili">' +
                    '<option value="ruby">Ruby</option>' +
                    '<option value="haml">HAML</option>' +
                    '<option value="python">Python</option>' +
                    '<option value="yaml">YAML</option>' +
                    '<option value="html">HTML</option>' +
                    '<option value="php">PHP</option>' +
                    '<option value="sql">SQL</option>' +
                    '<option value="js">JavaScript</option>' +
                    '<option value="java">Java</option>' +
                    '<option value="css">CSS</option>' +
                    '</select>',
                validate: function () {
                    CKEDITOR.config.chili_val = this.getValue();
                }
            }, {
                id: 'input1',
                type: 'textarea',
                label: 'Вставьте код:',
                validate: function () {
                    if (!this.getValue()) {
                        alert('Empty Field');
                        return false;
                    }
                    var element = editor.document.createElement('pre');
                    element.setAttribute('class', 'code');
                    element.setAttribute('lang', CKEDITOR.config.chili_val);
                    element.setText(this.getValue());
                    editor.insertElement(element);
                    CKEDITOR.ENTER_BR;
                    return true;
                }
            }]
        }]
    };
});

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
glebtv-ckeditor-4.0.2.7 vendor/assets/javascripts/ckeditor/plugins/code/code/code.js
glebtv-ckeditor-4.0.2.6 vendor/assets/javascripts/ckeditor/plugins/code/code/code.js
glebtv-ckeditor-4.0.2.5 vendor/assets/javascripts/ckeditor/plugins/code/code/code.js
glebtv-ckeditor-4.0.2.4 vendor/assets/javascripts/ckeditor/plugins/code/code/code.js
glebtv-ckeditor-4.0.2.2 vendor/assets/javascripts/ckeditor/plugins/code/code/code.js
glebtv-ckeditor-4.0.2.1 vendor/assets/javascripts/ckeditor/plugins/code/code/code.js
glebtv-ckeditor-4.0.2 vendor/assets/javascripts/ckeditor/plugins/code/code/code.js
glebtv-ckeditor-4.0.1 vendor/assets/javascripts/ckeditor/plugins/code/code/code.js