includes/clientside/static/tinymce-init.js
author Dan
Sat, 08 Nov 2008 22:35:05 -0500
changeset 724 af6a618e5c94
parent 588 20484deb89cd
child 779 609e35845ec3
permissions -rw-r--r--
Fixed plugin manager not checking for plugin file existence before marking to load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
     1
//
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
     2
// TinyMCE support
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
     3
//
582
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
     4
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
     5
// Check tinyMCE to make sure its init is finished
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
     6
var initTinyMCE = function(e)
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
     7
{
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
     8
  if ( typeof(tinyMCE_GZ) == 'object' )
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
     9
  {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    10
    if ( !KILL_SWITCH && !DISABLE_MCE )
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    11
    {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    12
      tinyMCE_GZ.init(enano_tinymce_gz_options, function()
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    13
        {
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    14
          tinyMCE.init(enano_tinymce_options);
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    15
        });
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    16
      tinymce_initted = true;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    17
    }
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    18
  }
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    19
};
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    20
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    21
// editor options
582
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    22
if ( document.getElementById('mdgCss') )
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    23
{
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    24
  var css_url = document.getElementById('mdgCss').href;
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    25
}
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    26
else
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    27
{
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    28
  var css_url = scriptPath + '/includes/clientside/css/enano_shared.css';
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    29
}
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    30
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    31
var do_popups = ( is_Safari ) ? '' : ',inlinepopups';
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    32
var _skin = ( typeof(tinymce_skin) == 'string' ) ? tinymce_skin : 'default';
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    33
var tinymce_initted = false;
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    34
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    35
var enano_tinymce_options = {
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    36
  mode : "none",
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    37
  plugins : 'table,save,safari,pagebreak,style,layer,advhr,insertdatetime,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras' + do_popups,
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    38
  theme : 'advanced',
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    39
  skin : _skin,
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    40
  theme_advanced_resize_horizontal : false,
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    41
  theme_advanced_resizing : true,
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    42
  theme_advanced_toolbar_location : "top",
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    43
  theme_advanced_toolbar_align : "left",
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    44
  theme_advanced_buttons1 : "save,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,forecolor,backcolor,|,formatselect,|,fontselect,fontsizeselect",
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    45
  theme_advanced_buttons3_add_before : "tablecontrols,separator",
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    46
  theme_advanced_buttons3_add_after : "|,fullscreen",
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    47
  theme_advanced_statusbar_location : 'bottom',
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    48
  noneditable_noneditable_class : 'mce_readonly',
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    49
  content_css : css_url
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    50
};
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    51
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    52
var enano_tinymce_gz_options = {
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    53
	plugins : 'table,save,safari,pagebreak,style,layer,advhr,insertdatetime,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras' + do_popups,
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    54
	themes : 'advanced',
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    55
	languages : 'en',
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    56
	disk_cache : true,
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    57
	debug : false
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    58
};
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    59
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    60
// load the script
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    61
582
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    62
if ( !KILL_SWITCH && !DISABLE_MCE )
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    63
{
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    64
  var uri = scriptPath + '/includes/clientside/tinymce/tiny_mce_gzip.js';
588
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    65
  var sc = document.createElement('script');
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    66
  sc.src = uri;
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    67
  sc.type = 'text/javascript';
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    68
  var head = document.getElementsByTagName('head')[0];
20484deb89cd Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents: 582
diff changeset
    69
  head.appendChild(sc);
582
a38876c0793c Majorly reworked Javascript runtime stuff to use on-demand loading.
Dan
parents:
diff changeset
    70
}