No regular expressions were active.
1 |
|
var tinyMC
E_GZ = {
|
|
1 |
|
var tinyMC
E_GZ = {
|
2 |
|
settin
gs : {
|
|
2 |
|
settin
gs : {
|
3 |
|
pl
ugins : 's
tyle,layer
,table,sav
e,advhr,ad
vimage,adv
link,emoti
ons,iespel
l,insertda
tetime,pre
view,media
,searchrep
lace,print
,contextme
nu,paste,d
irectional
ity,fullsc
reen,noned
itable,vis
ualchars,n
onbreaking
,xhtmlxtra
s',
|
|
3 |
|
themes
:
'
',
|
4 |
|
themes
:
'
simple,adv
anced
',
|
|
4 |
|
pl
ugins : ''
,
|
5 |
|
languages
:
'
en
',
|
|
5 |
|
languages
:
'
',
|
6 |
|
di
sk_cache :
true,
|
|
6 |
|
di
sk_cache :
true,
|
7 |
|
pa
ge_name :
'tiny_mce_
gzip.php',
|
|
7 |
|
pa
ge_name :
'tiny_mce_
gzip.php',
|
8 |
|
debug
:
false
|
|
8 |
|
debug
:
false
,
|
|
|
9 |
|
su
ffix : ''
|
9 |
|
},
|
|
10 |
|
},
|
10 |
|
|
|
11 |
|
|
11 |
|
init
:
function(s
)
{
|
|
12 |
|
init
:
function(s
,
cb,
sc
)
{
|
12 |
|
va
r n, d = d
ocument, n
l, i, b =
'', sr, db
;
|
|
13 |
|
va
r t = this
, n, i, nl
= documen
t.getEleme
ntsByTagNa
me('script
');
|
13 |
|
|
|
|
14 |
|
th
is.isIE =
(navigator
.appName =
= "Microso
ft Interne
t Explorer
");
|
|
|
15 |
|
th
is.isOpera
= navigat
or.userAge
nt.indexOf
('Opera')
!= -1;
|
|
|
16 |
|
|
|
14 |
|
|
17 |
|
fo
r (n in s)
|
|
15 |
|
fo
r (n in s)
|
18 |
|
t
his
.settings[
n]
=
s[n];
|
|
16 |
|
t
.settings[
n]
=
s[n];
|
19 |
|
|
|
17 |
|
|
20 |
|
fo
r (i=0, nl
= d.getEl
ementsByTa
gName('bas
e'); i<nl.
length; i+
+) {
|
|
18 |
|
s
= t.settin
gs;
|
21 |
|
if (nl[i
].href)
|
|
|
22 |
|
b =
nl[i].href
;
|
|
|
23 |
|
}
|
|
|
24 |
|
|
|
19 |
|
|
25 |
|
for
(i=0
,
nl
=
d.getEleme
ntsByTagNa
me('script
')
;
i<nl.lengt
h;
i++)
{
|
|
20 |
|
for
(i=0
;
i<nl.lengt
h;
i++)
{
|
26 |
|
if (nl[i
].src && n
l[i].src.i
ndexOf('ti
ny_mce_gzi
p') != -1)
{
|
|
21 |
|
n
=
nl[i]
;
|
27 |
|
sr
=
nl[i]
.src
;
|
|
|
28 |
|
sr =
sr.substr
ing(0, sr.
lastIndexO
f('/'));
|
|
|
29 |
|
|
|
22 |
|
|
30 |
|
if
(
b
!=
''
&&
b
.indexOf('
://
')
=
=
-1)
|
|
23 |
|
if
(
n.src
&&
n.src
.indexOf('
tiny_mce
')
!
=
-1)
|
31 |
|
b += sr;
|
|
24 |
|
t.ba
seURL = n.
src.substr
ing(0, n.s
rc.lastInd
exOf('/'))
;
|
32 |
|
else
|
|
|
33 |
|
b = sr;
|
|
|
34 |
|
}
|
|
|
35 |
|
}
|
|
25 |
|
}
|
36 |
|
|
|
26 |
|
|
37 |
|
db
= documen
t.location
.href;
|
|
27 |
|
if
(!t.coreL
oaded)
|
|
|
28 |
|
t.loadSc
ripts(1, s
.themes, s
.plugins,
s.language
s, cb, sc)
;
|
|
|
29 |
|
},
|
|
|
30 |
|
|
|
|
31 |
|
loadSc
ripts : fu
nction(co,
th, pl, l
a, cb, sc)
{
|
|
|
32 |
|
va
r t = this
, x, w = w
indow, q,
c = 0, ti,
s = t.set
tings;
|
38 |
|
|
|
33 |
|
|
39 |
|
if
(db.index
Of('?') !=
-1)
|
|
34 |
|
fu
nction get
(s) {
|
40 |
|
db = db.
substring(
0, db.inde
xOf('?'));
|
|
35 |
|
x = 0;
|
41 |
|
|
|
36 |
|
|
42 |
|
db
= db.subs
tring(0, d
b.lastInde
xOf('/'));
|
|
37 |
|
try {
|
|
|
38 |
|
x =
new Active
XObject(s)
;
|
|
|
39 |
|
} catch
(s) {
|
|
|
40 |
|
}
|
43 |
|
|
|
41 |
|
|
44 |
|
if
(b.indexO
f('://') =
= -1 && b.
charAt(0)
!= '/')
|
|
42 |
|
return x
;
|
45 |
|
b = db +
"/" + b;
|
|
43 |
|
};
|
46 |
|
|
|
44 |
|
|
47 |
|
th
is.baseURL
= b + '/'
;
|
|
45 |
|
//
Build que
ry string
|
48 |
|
th
is.load(th
is.setting
s.page_nam
e);
|
|
46 |
|
q
= 'js=true
&diskcache
=' + (s.di
sk_cache ?
'true' :
'false') +
'&core='
+ (co ? 't
rue' : 'fa
lse') + '&
suffix=' +
escape(s.
suffix) +
'&themes='
+ escape(
th) + '&pl
ugins=' +
escape(pl)
+ '&langu
ages=' + e
scape(la);
|
49 |
|
},
|
|
|
50 |
|
|
|
47 |
|
|
51 |
|
load :
function(
v) {
|
|
48 |
|
if
(co)
|
52 |
|
va
r s = this
.settings,
h, d = do
cument, sp
2;
|
|
49 |
|
t.coreLo
aded = 1;
|
53 |
|
|
|
50 |
|
|
54 |
|
v
+= '?js=tr
ue&plugins
=' + escap
e(s.plugin
s);
|
|
51 |
|
//
Send requ
est
|
55 |
|
v
+= '&theme
s=' + esca
pe(s.theme
s);
|
|
52 |
|
x
= w.XMLHtt
pRequest ?
new XMLHt
tpRequest(
) : get('M
sxml2.XMLH
TTP') || g
et('Micros
oft.XMLHTT
P');
|
56 |
|
v
+= '&langu
ages=' + e
scape(s.la
nguages);
|
|
53 |
|
x.
overrideMi
meType &&
x.override
MimeType('
text/javas
cript');
|
57 |
|
v
+= '&diskc
ache=' + (
s.disk_cac
he ? 'true
' : 'false
');
|
|
54 |
|
x.
open('GET'
, t.baseUR
L + '/' +
s.page_nam
e + '?' +
q, !!cb);
|
58 |
|
//
v += this.
checkCompr
ess() ? ''
: '&compr
ess=false'
;
|
|
55 |
|
// x.
setRequest
Header('Co
ntent-Type
', 'text/j
avascript'
);
|
|
|
56 |
|
x.
send('');
|
59 |
|
|
|
57 |
|
|
60 |
|
th
is.loadFil
e(this.bas
eURL + v);
|
|
58 |
|
//
Handle as
yncronous
loading
|
|
|
59 |
|
if
(cb) {
|
|
|
60 |
|
// Wait
for respon
se
|
|
|
61 |
|
ti = w.s
etInterval
(function(
) {
|
|
|
62 |
|
if (
x.readySta
te == 4 ||
c++ > 100
00) {
|
|
|
63 |
|
w.clearInt
erval(ti);
|
|
|
64 |
|
|
|
|
65 |
|
if (c < 10
000 && x.s
tatus == 2
00) {
|
|
|
66 |
|
t.load
ed = 1;
|
|
|
67 |
|
t.eval
(x.respons
eText);
|
|
|
68 |
|
tinymc
e.dom.Even
t.domLoade
d = true;
|
|
|
69 |
|
cb.cal
l(sc || t,
x);
|
|
|
70 |
|
}
|
|
|
71 |
|
|
|
|
72 |
|
ti = x = n
ull;
|
|
|
73 |
|
}
|
|
|
74 |
|
}, 10);
|
|
|
75 |
|
}
else
|
|
|
76 |
|
t.eval(x
.responseT
ext);
|
61 |
|
},
|
|
77 |
|
},
|
62 |
|
|
|
78 |
|
|
63 |
|
checkCompr
es
s
:
function()
{
|
|
79 |
|
s
tart
:
function()
{
|
64 |
|
va
r sp2, ver
, na = nav
igator, ua
= navigat
or.userAge
nt;
|
|
80 |
|
va
r t = this
, each = t
inymce.eac
h, s = t.s
ettings, s
l, ln = s.
languages.
split(',')
;
|
65 |
|
|
|
81 |
|
|
66 |
|
//
Non IE br
owsers are
fine
|
|
82 |
|
ti
nymce.suff
ix = s.suf
fix;
|
67 |
|
if
(!this.is
IE)
|
|
|
68 |
|
return 1
;
|
|
|
69 |
|
|
|
83 |
|
|
70 |
|
sp
2 = na.app
MinorVersi
on.indexOf
('SP2') !=
-1;
|
|
84 |
|
//
Extend sc
ript loade
r
|
71 |
|
ve
r = parseF
loat(ua.ma
tch(/MSIE\
s+([0-9\.]
+)/)[1]);
|
|
85 |
|
ti
nymce.crea
te('tinymc
e.compress
or.ScriptL
oader:tiny
mce.dom.Sc
riptLoader
', {
|
|
|
86 |
|
loadScri
pts : func
tion(sc, c
b, s) {
|
|
|
87 |
|
var
ti = this,
th = [],
pl = [], l
a = [];
|
72 |
|
|
|
88 |
|
|
73 |
|
//
IE 6.0+ w
ith SP2 se
ems fine
|
|
89 |
|
each
(sc, funct
ion(o) {
|
74 |
|
if
(ver >= 6
&& sp2)
|
|
90 |
|
var u = o.
url;
|
75 |
|
return 1
;
|
|
|
76 |
|
|
|
91 |
|
|
77 |
|
//
IE 7.0+ s
eems fine
|
|
92 |
|
if ((!ti.l
ookup[u] |
| ti.looku
p[u].state
!= 2) &&
u.indexOf(
t.baseURL)
=== 0) {
|
78 |
|
if
(ver >= 7
)
|
|
93 |
|
// Col
lect theme
|
79 |
|
return 1
;
|
|
94 |
|
if (u.
indexOf('e
ditor_temp
late') !=
-1) {
|
|
|
95 |
|
th
.push(/\/t
hemes\/([^
\/]+)/.exe
c(u)[1]);
|
|
|
96 |
|
lo
ad(u, 1);
|
|
|
97 |
|
}
|
80 |
|
|
|
98 |
|
|
81 |
|
//
All other
s might fa
il
|
|
99 |
|
// Col
lect plugi
n
|
82 |
|
re
turn 0;
|
|
100 |
|
if (u.
indexOf('e
ditor_plug
in') != -1
) {
|
83 |
|
}
,
|
|
101 |
|
pl
.push(/\/p
lugins\/([
^\/]+)/.ex
ec(u)[1]);
|
|
|
102 |
|
lo
ad(u, 1);
|
|
|
103 |
|
}
|
84 |
|
|
|
104 |
|
|
85 |
|
loadFi
le : funct
ion(u) {
|
|
105 |
|
// Col
lect langu
age
|
86 |
|
va
r x, ex;
|
|
106 |
|
if (u.
indexOf('/
langs/') !
= -1) {
|
|
|
107 |
|
la
.push(/\/l
angs\/([^.
]+)/.exec(
u)[1]);
|
|
|
108 |
|
lo
ad(u, 1);
|
|
|
109 |
|
}
|
|
|
110 |
|
}
|
|
|
111 |
|
});
|
87 |
|
|
|
112 |
|
|
88 |
|
if
(
thi
s
.settings
['
de
bug']
)
|
|
113 |
|
if (
th.length
+ pl.lengt
h + la.len
gth > 0) {
|
89 |
|
alert('J
S: ' + u);
|
|
114 |
|
if
(
s
l
.settings
.strict_mo
de
)
{
|
|
|
115 |
|
// Asy
nc
|
|
|
116 |
|
t.load
Scripts(0,
th.join('
,'), pl.jo
in(','), l
a.join(','
), cb, s);
|
|
|
117 |
|
return
;
|
|
|
118 |
|
} else
|
|
|
119 |
|
t.load
Scripts(0,
th.join('
,'), pl.jo
in(','), l
a.join(','
), cb, s);
|
|
|
120 |
|
}
|
90 |
|
|
|
121 |
|
|
91 |
|
if
(this.isI
E) {
|
|
122 |
|
retu
rn ti.pare
nt(sc, cb,
s);
|
92 |
|
// Synch
ronous AJA
X load gzi
p JS file
|
|
|
93 |
|
try {
|
|
|
94 |
|
x =
new Active
XObject("M
icrosoft.X
MLHTTP");
|
|
|
95 |
|
} catch
(ex) {
|
|
|
96 |
|
x =
new Active
XObject("M
sxml2.XMLH
TTP");
|
|
|
97 |
|
}
|
|
123 |
|
}
|
|
|
124 |
|
})
;
|
98 |
|
|
|
125 |
|
|
99 |
|
x.open("
GET", u.re
place(/%2C
/g, ','),
false);
|
|
126 |
|
sl
= tinymce
.ScriptLoa
der = new
tinymce.co
mpressor.S
criptLoade
r();
|
100 |
|
x.send(n
ull);
|
|
|
101 |
|
|
|
127 |
|
|
102 |
|
this.scr
iptData =
x.response
Text;
|
|
128 |
|
fu
nction loa
d(u, sp) {
|
|
|
129 |
|
var o;
|
103 |
|
|
|
130 |
|
|
104 |
|
document
.write('<s
cript type
="text/jav
ascript">e
val(tinyMC
E_GZ.scrip
tData);</s
cript>');
|
|
131 |
|
if (!sp)
|
105 |
|
}
else
|
|
132 |
|
u =
t.baseURL
+ u;
|
106 |
|
document
.write('<s
cript type
="text/jav
ascript" s
rc="' + u
+ '"></scr
ipt>');
|
|
|
107 |
|
},
|
|
|
108 |
|
|
|
133 |
|
|
109 |
|
start
: function
() {
|
|
134 |
|
o = {url
: u, stat
e : 2};
|
110 |
|
va
r s = this
.settings,
p = TinyM
CE_Engine.
prototype;
|
|
135 |
|
sl.queue
.push(o);
|
|
|
136 |
|
sl.looku
p[o.url] =
o;
|
|
|
137 |
|
};
|
111 |
|
|
|
138 |
|
|
112 |
|
p.
__loadScri
pt = p.loa
dScript;
|
|
139 |
|
//
Add core
languages
|
113 |
|
p.
__importTh
emeLanguag
ePack = p.
importThem
eLanguageP
ack;
|
|
140 |
|
ea
ch (ln, fu
nction(c)
{
|
114 |
|
p.
__importPl
uginLangua
gePack = p
.importPlu
ginLanguag
ePack;
|
|
141 |
|
if (c)
|
115 |
|
p.
__loadNext
Script = p
.loadNextS
cript;
|
|
142 |
|
load
('/langs/'
+ c + '.j
s');
|
116 |
|
p.
loadScript
= p.impor
tThemeLang
uagePack =
p.importP
luginLangu
agePack =
p.loadNext
Script = f
unction()
{};
|
|
143 |
|
}
);
|
117 |
|
ti
nyMCE.base
URL = this
.baseURL.s
ubstring(0
, this.bas
eURL.lengt
h - 1);
|
|
|
118 |
|
ti
nyMCE.sett
ings = {};
|
|
|
119 |
|
ti
nyMCE.srcM
ode = '';
|
|
|
120 |
|
}
,
|
|
|
121 |
|
|
|
144 |
|
|
122 |
|
end :
function()
{
|
|
145 |
|
//
Add theme
s with lan
guages
|
123 |
|
va
r s = this
.settings,
l = tinyM
CE.loadedF
iles, la,
i, p = Tin
yMCE_Engin
e.prototyp
e;
|
|
146 |
|
ea
ch(s.theme
s.split(',
'), functi
on(n) {
|
|
|
147 |
|
if (n) {
|
|
|
148 |
|
load
('/themes/
' + n + '/
editor_tem
plate' + s
.suffix +
'.js');
|
124 |
|
|
|
149 |
|
|
125 |
|
th
is.addFile
s(s.plugin
s, 'plugin
s', 'edito
r_plugin.j
s');
|
|
150 |
|
each
(ln, func
tion(c) {
|
126 |
|
th
is.addFile
s(s.themes
, 'themes'
, 'editor_
template.j
s');
|
|
151 |
|
if (c)
|
|
|
152 |
|
load('
/themes/'
+ n + '/la
ngs/' + c
+ '.js');
|
|
|
153 |
|
});
|
|
|
154 |
|
}
|
|
|
155 |
|
})
;
|
127 |
|
|
|
156 |
|
|
128 |
|
la
= s.langu
ages.repla
ce(/\s+/,
'').split(
',')
|
|
157 |
|
//
Add plugi
ns with la
nguages
|
129 |
|
fo
r (i=0; i<
la.length;
i++)
|
|
158 |
|
ea
ch(s.plugi
ns.split('
,'), funct
ion(n) {
|
130 |
|
l[l.leng
th] = this
.baseURL +
'langs/'
+ la[i] +
'.js';
|
|
159 |
|
if (n) {
|
|
|
160 |
|
load
('/plugins
/' + n + '
/editor_pl
ugin' + s.
suffix + '
.js');
|
131 |
|
|
|
161 |
|
|
132 |
|
p.
loadScript
= p.__loa
dScript;
|
|
162 |
|
each
(ln, func
tion(c) {
|
133 |
|
p.
importThem
eLanguageP
ack = p.__
importThem
eLanguageP
ack;
|
|
163 |
|
if (c)
|
134 |
|
p.
importPlug
inLanguage
Pack = p._
_importPlu
ginLanguag
ePack;
|
|
164 |
|
load('
/plugins/'
+ n + '/l
angs/' + c
+ '.js');
|
135 |
|
p.
loadNextSc
ript = p._
_loadNextS
cript;
|
|
165 |
|
});
|
|
|
166 |
|
}
|
|
|
167 |
|
})
;
|
136 |
|
},
|
|
168 |
|
},
|
137 |
|
|
|
169 |
|
|
138 |
|
addFil
e
s
:
function(
f,
c,
e
)
{
|
|
170 |
|
e
nd
:
function(
)
{
|
139 |
|
va
r i, a, s
= this.set
tings, l =
tinyMCE.l
oadedFiles
, la, x;
|
|
171 |
|
},
|
140 |
|
|
|
172 |
|
|
141 |
|
a
= f.replac
e(/\s+/, '
').split('
,');
|
|
173 |
|
eval :
function(
co) {
|
142 |
|
fo
r (i=0; i<
a.length;
i++) {
|
|
174 |
|
va
r w = wind
ow;
|
143 |
|
if (a[i]
) {
|
|
|
144 |
|
l[l.
length] =
this.baseU
RL + c + '
/' + a[i]
+ '/' + e
;
|
|
|
145 |
|
|
|
175 |
|
|
146 |
|
la =
s.languag
es.replace
(/\s+/, ''
).split(',
')
|
|
176 |
|
//
Evaluate
script
|
147 |
|
for
(x=0; x<la
.length; x
++)
|
|
177 |
|
if
(!w.execS
cript) {
|
148 |
|
l[l.length
] = this.b
aseURL + c
+ '/' +
a[i] + '/l
angs/' + l
a[x] + '.j
s';
|
|
178 |
|
if (/Gec
ko/.test(n
avigator.u
serAgent))
|
149 |
|
}
|
|
179 |
|
eval
(co, w); /
/ Firefox
3.0
|
150 |
|
}
|
|
180 |
|
else
|
|
|
181 |
|
eval
.call(w, c
o);
|
|
|
182 |
|
}
else
|
|
|
183 |
|
eval(co)
; //w.exec
Script(co)
; // IE
|
151 |
|
}
|
|
184 |
|
}
|
152 |
|
};
|
|
185 |
|
};
|