7 page_name : 'tiny_mce_gzip.pl',
12 init : function(s, cb, sc) {
13 var t = this, n, i, nl = document.getElementsByTagName('script');
20 if (window.tinyMCEPreInit) {
21 t.baseURL = tinyMCEPreInit.base;
23 for (i=0; i<nl.length; i++) {
26 if (n.src && n.src.indexOf('tiny_mce') != -1)
27 t.baseURL = n.src.substring(0, n.src.lastIndexOf('/'));
32 t.loadScripts(1, s.themes, s.plugins, s.languages, cb, sc);
35 loadScripts : function(co, th, pl, la, cb, sc) {
36 var t = this, x, w = window, q, c = 0, ti, s = t.settings;
42 x = new ActiveXObject(s);
50 q = 'js=true&diskcache=' + (s.disk_cache ? 'true' : 'false') + '&core=' + (co ? 'true' : 'false') + '&suffix=' + escape(s.suffix) + '&themes=' + escape(th) + '&plugins=' + escape(pl) + '&languages=' + escape(la);
56 x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Msxml2.XMLHTTP') || get('Microsoft.XMLHTTP');
57 x.overrideMimeType && x.overrideMimeType('text/javascript');
58 x.open('GET', t.baseURL + '/' + s.page_name + '?' + q, !!cb);
59 // x.setRequestHeader('Content-Type', 'text/javascript');
62 // Handle asyncronous loading
65 ti = w.setInterval(function() {
66 if (x.readyState == 4 || c++ > 10000) {
69 if (c < 10000 && x.status == 200) {
71 t.eval(x.responseText);
72 tinymce.dom.Event.domLoaded = true;
80 t.eval(x.responseText);
84 var t = this, each = tinymce.each, s = t.settings, ln = s.languages.split(',');
86 tinymce.suffix = s.suffix;
89 tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(u));
93 each(ln, function(c) {
95 load('langs/' + c + '.js');
98 // Add themes with languages
99 each(s.themes.split(','), function(n) {
101 load('themes/' + n + '/editor_template' + s.suffix + '.js');
103 each (ln, function(c) {
105 load('themes/' + n + '/langs/' + c + '.js');
110 // Add plugins with languages
111 each(s.plugins.split(','), function(n) {
113 load('plugins/' + n + '/editor_plugin' + s.suffix + '.js');
115 each(ln, function(c) {
117 load('plugins/' + n + '/langs/' + c + '.js');
126 eval : function(co) {
127 var se = document.createElement('script');
130 se.type = 'text/javascript';
133 // Add it to evaluate it and remove it
134 (document.getElementsByTagName('head')[0] || document.documentElement).appendChild(se);
135 se.parentNode.removeChild(se);