tinymce/init.js
changeset 0 c78d206bf01c
equal deleted inserted replaced
-1:000000000000 0:c78d206bf01c
       
     1 //
       
     2 // TinyMCE support
       
     3 //
       
     4 
       
     5 var DISABLE_MCE = false;
       
     6 
       
     7 // Check tinyMCE to make sure its init is finished
       
     8 var initTinyMCE = function(e)
       
     9 {
       
    10 	if ( typeof(tinyMCE_GZ) == 'object' )
       
    11 	{
       
    12 		if ( !KILL_SWITCH && !DISABLE_MCE )
       
    13 		{
       
    14 			tinyMCE_GZ.init(enano_tinymce_gz_options, function()
       
    15 				{
       
    16 					tinyMCE.init(enano_tinymce_options);
       
    17 				});
       
    18 			tinymce_initted = true;
       
    19 		}
       
    20 	}
       
    21 };
       
    22 
       
    23 // editor options
       
    24 if ( document.getElementById('mdgCss') )
       
    25 {
       
    26 	var css_url = document.getElementById('mdgCss').href;
       
    27 }
       
    28 else
       
    29 {
       
    30 	var css_url = scriptPath + '/includes/clientside/css/enano_shared.css';
       
    31 }
       
    32 
       
    33 var do_popups = ( is_Safari ) ? '' : ',inlinepopups';
       
    34 var _skin = ( typeof(tinymce_skin) == 'string' ) ? tinymce_skin : 'default';
       
    35 var tinymce_initted = false;
       
    36 
       
    37 var html = document.getElementsByTagName('html')[0];
       
    38 var direction = typeof(html.dir) != 'undefined' ? html.dir : 'ltr';
       
    39 
       
    40 var enano_tinymce_options = {
       
    41 	mode : "none",
       
    42 	plugins : 'table,save,safari,pagebreak,style,layer,advhr,insertdatetime,searchreplace,spellchecker,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,wordcount' + do_popups,
       
    43 	theme : 'advanced',
       
    44 	skin : _skin,
       
    45 	theme_advanced_resize_horizontal : false,
       
    46 	theme_advanced_resizing : true,
       
    47 	theme_advanced_toolbar_location : "top",
       
    48 	theme_advanced_toolbar_align : "left",
       
    49 	theme_advanced_buttons1 : "save,|,bold,italic,underline,strikethrough,|,spellchecker,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor,|,formatselect,|,fontselect,fontsizeselect",
       
    50 	theme_advanced_buttons3_add_before : "tablecontrols,separator",
       
    51 	theme_advanced_buttons3_add_after : "|,fullscreen",
       
    52 	theme_advanced_statusbar_location : 'bottom',
       
    53 	noneditable_noneditable_class : 'mce_readonly',
       
    54 	content_css : css_url,
       
    55 	spellchecker_rpc_url : scriptPath + '/includes/clientside/tinymce/plugins/spellchecker/rpc.php',
       
    56 	directionality : direction
       
    57 };
       
    58 
       
    59 var enano_tinymce_gz_options = {
       
    60 	plugins : 'table,save,safari,pagebreak,style,layer,advhr,insertdatetime,searchreplace,spellchecker,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras' + do_popups,
       
    61 	themes : 'advanced',
       
    62 	languages : 'en',
       
    63 	disk_cache : true,
       
    64 	debug : false
       
    65 };
       
    66 
       
    67 // load the script
       
    68 
       
    69 if ( !KILL_SWITCH && !DISABLE_MCE )
       
    70 {
       
    71 	var uri = scriptPath + '/plugins/tinymce/3rdparty/tiny_mce_gzip.js?327';
       
    72 	var sc = document.createElement('script');
       
    73 	sc.src = uri;
       
    74 	sc.type = 'text/javascript';
       
    75 	var head = document.getElementsByTagName('head')[0];
       
    76 	head.appendChild(sc);
       
    77 }