Codemagic plugin for TinyMCE

Add syntax highlighting and some other cool things to html editing from within TinyMCE.

Codemagic Plugin

Upload the codemagic folder to the TinyMCE plugins directory, then add the plugin to TinyMCE init in BxBaseConfig.php

Example:

 

<script type="text/javascript">
    tinyMCE_GZ.init({
        skin : "cirkuit",
        plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,media,searchreplace,directionality,fullscreen",
        themes : "advanced",
        languages : "en",
        disk_cache : true,
        debug : false
    });

    if (window.attachEvent)
        window.attachEvent( "onload", InitTiny );
    else
        window.addEventListener( "load", InitTiny, false);

    function InitTiny() {
        // Notice: The simple theme does not use all options some of them are limited to the advanced theme
        tinyMCE.init({
        skin : "cirkuit",
            convert_urls : false,
            mode : "specific_textareas",
            theme : "advanced",

            editor_selector : /(' . $sSelectors . ')/,

            plugins : "inlinepopups,embed,advlist,imagemanager,spellchecker,codemagic,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,directionality,fullscreen",

            theme_advanced_buttons1_add : "fontselect,fontsizeselect",
            theme_advanced_buttons2_remove : "code",
            theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,image,search,replace",
            theme_advanced_buttons2_add : "insertdate,inserttime,forecolor,backcolor",
            theme_advanced_buttons3_add : "emotions,codemagic,spellchecker,embed",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_statusbar_location : "bottom",

            plugin_insertdate_dateFormat : "%B %d, %Y",
            plugin_insertdate_timeFormat : "%I:%M %p",           
            theme_advanced_resizing : false,
            theme_advanced_resize_horizontal : false,

            entity_encoding : "raw",

            paste_use_dialog : false,
            paste_auto_cleanup_on_paste : true,
            paste_convert_headers_to_strong : false,
            paste_strip_class_attributes : "all",
            paste_remove_spans : false,
            paste_remove_styles : false,
extended_valid_elements: "iframe[class|src|frameborder=0|alt|title|width|height|align|name]"
        });
    }
</script>

codemagic.zip · 66.2K · 552 downloads
My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 12 Jun 2012

To add the plugin to the instance of TinyMCE in page builder, add the plugin to tinymce init in /administration/js/page_builder_tiny.js

 

EX:

 

tinyMCE.init({
    mode : "textareas",
    theme : "advanced",
   
    editor_selector : "form_input_html",
    content_css : "plugins/tiny_mce/dolphin.css",
   
    plugins : "codemagic,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,contextmenu,paste,directionality,fullscreen,visualchars,nonbreaking,xhtmlxtras",
    relative_urls : false,
   
    theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "forecolor,backcolor,|,bullist,numlist,|,outdent,indent,|,link,unlink,image,hr,|,sub,sup,|,insertdate,inserttime,|,styleprops",
    theme_advanced_buttons3 : "charmap,emotions,|,cite,abbr,acronym,attribs,|,preview,removeformat,|,codemagic,help",
    theme_advanced_buttons4 : "table,row_props,cell_props,delete_col,delete_row,delete_table,col_after,col_before,row_after,row_before,row_after,row_before,split_cells,merge_cells",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "center",

    entity_encoding : "raw",

    paste_use_dialog : false,
    paste_convert_headers_to_strong : false,
    paste_remove_spans : false,
    paste_remove_styles : false,
    valid_elements : "*[*]"

});

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 12 Jun 2012

To add the plugin to the instance of TinyMCE in the forums module, edit:

/modules/boonex/forum/layout/base_en/xsl/canvas_init.xsl

And

/modules/boonex/forum/layout/base_en/xsl/canvas_init.xsl

 

See previous examples

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 12 Jun 2012

Thanks for this, houstonlively.

Quote · 24 Jun 2012

Awesome stuff, as always.  Stuff like this should be in the default script.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 24 Jun 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.