No regular expressions were active.
|
|
1 |
|
tinyMCEPop
up.require
LangPack()
;
|
|
|
2 |
|
|
|
|
3 |
|
var Templa
teDialog =
{
|
|
|
4 |
|
preIni
t : functi
on() {
|
|
|
5 |
|
va
r url = ti
nyMCEPopup
.getParam(
"template_
external_l
ist_url");
|
|
|
6 |
|
|
|
|
7 |
|
if
(url != n
ull)
|
|
|
8 |
|
document
.write('<s
c'+'ript l
anguage="j
avascript"
type="tex
t/javascri
pt" src="'
+ tinyMCE
Popup.edit
or.documen
tBaseURI.t
oAbsolute(
url) + '">
</sc'+'rip
t>');
|
|
|
9 |
|
},
|
|
|
10 |
|
|
|
|
11 |
|
init :
function(
) {
|
|
|
12 |
|
va
r ed = tin
yMCEPopup.
editor, ts
rc, sel, x
, u;
|
|
|
13 |
|
|
|
|
14 |
|
ts
rc = ed.ge
tParam("te
mplate_tem
plates", f
alse);
|
|
|
15 |
|
se
l = docume
nt.getElem
entById('t
path');
|
|
|
16 |
|
|
|
|
17 |
|
//
Setup ext
ernal temp
late list
|
|
|
18 |
|
if
(!tsrc &&
typeof(ti
nyMCETempl
ateList) !
= 'undefin
ed') {
|
|
|
19 |
|
for (x=0
, tsrc = [
]; x<tinyM
CETemplate
List.lengt
h; x++)
|
|
|
20 |
|
tsrc
.push({tit
le : tinyM
CETemplate
List[x][0]
, src : ti
nyMCETempl
ateList[x]
[1], descr
iption : t
inyMCETemp
lateList[x
][2]});
|
|
|
21 |
|
}
|
|
|
22 |
|
|
|
|
23 |
|
fo
r (x=0; x<
tsrc.lengt
h; x++)
|
|
|
24 |
|
sel.opti
ons[sel.op
tions.leng
th] = new
Option(tsr
c[x].title
, tinyMCEP
opup.edito
r.document
BaseURI.to
Absolute(t
src[x].src
));
|
|
|
25 |
|
|
|
|
26 |
|
th
is.resize(
);
|
|
|
27 |
|
},
|
|
|
28 |
|
|
|
|
29 |
|
resize
: functio
n() {
|
|
|
30 |
|
va
r w, h, e;
|
|
|
31 |
|
|
|
|
32 |
|
if
(!self.in
nerWidth)
{
|
|
|
33 |
|
w = docu
ment.body.
clientWidt
h - 50;
|
|
|
34 |
|
h = docu
ment.body.
clientHeig
ht - 160;
|
|
|
35 |
|
}
else {
|
|
|
36 |
|
w = self
.innerWidt
h - 50;
|
|
|
37 |
|
h = self
.innerHeig
ht - 170;
|
|
|
38 |
|
}
|
|
|
39 |
|
|
|
|
40 |
|
e
= document
.getElemen
tById('tem
platesrc')
;
|
|
|
41 |
|
|
|
|
42 |
|
if
(e) {
|
|
|
43 |
|
e.style.
height = M
ath.abs(h)
+ 'px';
|
|
|
44 |
|
e.style.
width = M
ath.abs(w
- 5) + 'px
';
|
|
|
45 |
|
}
|
|
|
46 |
|
},
|
|
|
47 |
|
|
|
|
48 |
|
loadCS
SFiles : f
unction(d)
{
|
|
|
49 |
|
va
r ed = tin
yMCEPopup.
editor;
|
|
|
50 |
|
|
|
|
51 |
|
ti
nymce.each
(ed.getPar
am("conten
t_css", ''
).split(',
'), functi
on(u) {
|
|
|
52 |
|
d.write(
'<link hre
f="' + ed.
documentBa
seURI.toAb
solute(u)
+ '" rel="
stylesheet
" type="te
xt/css" />
');
|
|
|
53 |
|
})
;
|
|
|
54 |
|
},
|
|
|
55 |
|
|
|
|
56 |
|
select
Template :
function(
u) {
|
|
|
57 |
|
va
r d = wind
ow.frames[
'templates
rc'].docum
ent;
|
|
|
58 |
|
|
|
|
59 |
|
if
(!u)
|
|
|
60 |
|
return;
|
|
|
61 |
|
|
|
|
62 |
|
d.
body.inner
HTML = thi
s.template
HTML = thi
s.getFileC
ontents(u)
;
|
|
|
63 |
|
},
|
|
|
64 |
|
|
|
|
65 |
|
insert
: functio
n() {
|
|
|
66 |
|
ti
nyMCEPopup
.execComma
nd('mceIns
ertTemplat
e', false,
{
|
|
|
67 |
|
content
: this.tem
plateHTML,
|
|
|
68 |
|
selectio
n : tinyMC
EPopup.edi
tor.select
ion.getCon
tent()
|
|
|
69 |
|
})
;
|
|
|
70 |
|
|
|
|
71 |
|
ti
nyMCEPopup
.close();
|
|
|
72 |
|
},
|
|
|
73 |
|
|
|
|
74 |
|
getFil
eContents
: function
(u) {
|
|
|
75 |
|
va
r x, d, t
= 'text/pl
ain';
|
|
|
76 |
|
|
|
|
77 |
|
fu
nction g(s
) {
|
|
|
78 |
|
x = 0;
|
|
|
79 |
|
|
|
|
80 |
|
try {
|
|
|
81 |
|
x =
new Active
XObject(s)
;
|
|
|
82 |
|
} catch
(s) {
|
|
|
83 |
|
}
|
|
|
84 |
|
|
|
|
85 |
|
return x
;
|
|
|
86 |
|
};
|
|
|
87 |
|
|
|
|
88 |
|
x
= window.A
ctiveXObje
ct ? g('Ms
xml2.XMLHT
TP') || g(
'Microsoft
.XMLHTTP')
: new XML
HttpReques
t();
|
|
|
89 |
|
|
|
|
90 |
|
//
Synchrono
us AJAX lo
ad file
|
|
|
91 |
|
x.
overrideMi
meType &&
x.override
MimeType(t
);
|
|
|
92 |
|
x.
open("GET"
, u, false
);
|
|
|
93 |
|
x.
send(null)
;
|
|
|
94 |
|
|
|
|
95 |
|
re
turn x.res
ponseText;
|
|
|
96 |
|
}
|
|
|
97 |
|
};
|
|
|
98 |
|
|
|
|
99 |
|
TemplateDi
alog.preIn
it();
|
|
|
100 |
|
tinyMCEPop
up.onInit.
add(Templa
teDialog.i
nit, Templ
ateDialog)
;
|