Sha256: 8bac78dc4354732b7888010742415affe68dee89ca98e67bb7f313295e5b1af3

Contents?: true

Size: 1.61 KB

Versions: 4

Compression:

Stored size: 1.61 KB

Contents

function tinymce_init(){
  tinymce.init({
        selector: "textarea.editor",
        plugins: [
            "advlist autolink lists link image charmap print preview anchor",
            "searchreplace visualblocks code fullscreen",
            "insertdatetime media table contextmenu paste"
        ],
        toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image myblock",
        file_browser_callback : elFinderBrowser,
        relative_urls: false,
        content_css : [
            "<%=asset_path('optimacms/tinymce.css')%>",
            "<%=asset_path('optimacms/bootstrap.css')%>"
        ],
        protect2: [
            /\<\/?(if|endif)\>/g, // Protect <if> & </endif>
            /\<xsl\:[^>]+\>/g, // Protect <xsl:...>
            /<\?php.*?\?>/g // Protect php code
        ],
        setup: function(editor) {
            editor.addButton('myblock', {
                title: 'block',
                image: '<%=image_path("tinymce/icon_block2.png")%>',
                onclick: function() {
                    editor.insertContent('#{tinymce_editor_insert_block}');
                }

            });
        }
    });
}

function elFinderBrowser (field_name, url, type, win) {
    tinymce.activeEditor.windowManager.open({
        file: '/elfinder_manager',// use an absolute path!
        title: 'elFinder 2.1',
        width: 900,
        height: 450,
        resizable: 'no'
    }, {
        setUrl: function (url) {
            win.document.getElementById(field_name).value = url;
        }
    });


    return false;
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
optimacms-0.4.3 app/assets-old/javascripts/optimacms/tinymce_init.js.erb
optimacms-0.4.2 app/assets-old/javascripts/optimacms/tinymce_init.js.erb
optimacms-0.3.35 app/assets/javascripts/optimacms/tinymce_init.js.erb
optimacms-0.3.34 app/assets/javascripts/optimacms/tinymce_init.js.erb