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