588
|
1 |
//
|
|
2 |
// TinyMCE support
|
|
3 |
//
|
582
|
4 |
|
588
|
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
|
582
|
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 enano_tinymce_options = {
|
|
36 |
mode : "none",
|
784
72df14a56a03
Added spell-checking support for TinyMCE on user request (see: http://forum.enanocms.org/topic/11/)
Dan
diff
changeset
|
37 |
plugins : 'table,save,safari,pagebreak,style,layer,advhr,insertdatetime,searchreplace,spellchecker,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras' + do_popups,
|
582
|
38 |
theme : 'advanced',
|
|
39 |
skin : _skin,
|
|
40 |
theme_advanced_resize_horizontal : false,
|
|
41 |
theme_advanced_resizing : true,
|
|
42 |
theme_advanced_toolbar_location : "top",
|
|
43 |
theme_advanced_toolbar_align : "left",
|
784
72df14a56a03
Added spell-checking support for TinyMCE on user request (see: http://forum.enanocms.org/topic/11/)
Dan
diff
changeset
|
44 |
theme_advanced_buttons1 : "save,|,bold,italic,underline,strikethrough,|,spellchecker,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor,|,formatselect,|,fontselect,fontsizeselect",
|
582
|
45 |
theme_advanced_buttons3_add_before : "tablecontrols,separator",
|
|
46 |
theme_advanced_buttons3_add_after : "|,fullscreen",
|
|
47 |
theme_advanced_statusbar_location : 'bottom',
|
|
48 |
noneditable_noneditable_class : 'mce_readonly',
|
784
72df14a56a03
Added spell-checking support for TinyMCE on user request (see: http://forum.enanocms.org/topic/11/)
Dan
diff
changeset
|
49 |
content_css : css_url,
|
72df14a56a03
Added spell-checking support for TinyMCE on user request (see: http://forum.enanocms.org/topic/11/)
Dan
diff
changeset
|
50 |
spellchecker_rpc_url : scriptPath + '/includes/clientside/tinymce/plugins/spellchecker/rpc.php',
|
582
|
51 |
};
|
|
52 |
|
|
53 |
var enano_tinymce_gz_options = {
|
784
72df14a56a03
Added spell-checking support for TinyMCE on user request (see: http://forum.enanocms.org/topic/11/)
Dan
diff
changeset
|
54 |
plugins : 'table,save,safari,pagebreak,style,layer,advhr,insertdatetime,searchreplace,spellchecker,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras' + do_popups,
|
582
|
55 |
themes : 'advanced',
|
|
56 |
languages : 'en',
|
|
57 |
disk_cache : true,
|
|
58 |
debug : false
|
|
59 |
};
|
|
60 |
|
588
|
61 |
// load the script
|
|
62 |
|
582
|
63 |
if ( !KILL_SWITCH && !DISABLE_MCE )
|
|
64 |
{
|
779
609e35845ec3
load_component() now accepts an array, and most JS components are loaded all in one request now. Totally modular baby. And failsafe too.
Dan
diff
changeset
|
65 |
var uri = scriptPath + '/includes/clientside/tinymce/tiny_mce_gzip.js?3211';
|
588
|
66 |
var sc = document.createElement('script');
|
|
67 |
sc.src = uri;
|
|
68 |
sc.type = 'text/javascript';
|
|
69 |
var head = document.getElementsByTagName('head')[0];
|
|
70 |
head.appendChild(sc);
|
582
|
71 |
}
|