No regular expressions were active.
1 |
|
/**
|
|
1 |
|
/**
|
2 |
|
*
$Id:
editor_plu
gin_src.js
2
6
8
200
7
-0
4
-
28
1
5
:
52
:
59
Z
spocke
$
|
|
2 |
|
*
$Id:
editor_plu
gin_src.js
6
97
200
8
-0
3
-
1
1
10
:
33
:
06
Z
spocke
$
|
3 |
|
*
|
|
|
4 |
|
* Moxieco
de DHTML W
indows scr
ipt.
|
|
|
5 |
|
*
|
|
3 |
|
*
|
6 |
|
* @author
Moxiecode
|
|
4 |
|
* @author
Moxiecode
|
7 |
|
*
@copyright
Copyright
©
2004-200
7
,
Moxiecode
Systems
AB,
All
rights
reserved.
|
|
5 |
|
*
@copyright
Copyright
©
2004-200
8
,
Moxiecode
Systems
AB,
All
rights
reserved.
|
8 |
|
*/
|
|
6 |
|
*/
|
9 |
|
|
|
7 |
|
|
10 |
|
// Patch o
penWindow,
closeWind
ow TinyMCE
functions
|
|
8 |
|
(function(
) {
|
|
|
9 |
|
var DO
M = tinymc
e.DOM, Ele
ment = tin
ymce.dom.E
lement, Ev
ent = tiny
mce.dom.Ev
ent, each
= tinymce.
each, is =
tinymce.i
s;
|
|
|
10 |
|
|
|
|
11 |
|
tinymc
e.create('
tinymce.pl
ugins.Inli
nePopups',
{
|
|
|
12 |
|
in
it : funct
ion(ed, ur
l) {
|
|
|
13 |
|
// Repla
ce window
manager
|
|
|
14 |
|
ed.onBef
oreRenderU
I.add(func
tion() {
|
|
|
15 |
|
ed.w
indowManag
er = new t
inymce.Inl
ineWindowM
anager(ed)
;
|
|
|
16 |
|
DOM.
loadCSS(ur
l + '/skin
s/' + (ed.
settings.i
nlinepopup
s_skin ||
'clearlook
s2') + "/w
indow.css"
);
|
|
|
17 |
|
});
|
|
|
18 |
|
},
|
11 |
|
|
|
19 |
|
|
12 |
|
var TinyMC
E_InlinePo
pupsPlugin
= {
|
|
|
13 |
|
getInf
o : functi
on() {
|
|
20 |
|
ge
tInfo : fu
nction() {
|
14 |
|
re
turn {
|
|
21 |
|
return {
|
15 |
|
longname
: 'Inline
Popups',
|
|
22 |
|
long
name : 'In
linePopups
',
|
16 |
|
author :
'Moxiecod
e Systems
AB',
|
|
23 |
|
auth
or : 'Moxi
ecode Syst
ems AB',
|
17 |
|
authorur
l : 'http:
//tinymce.
moxiecode.
com',
|
|
24 |
|
auth
orurl : 'h
ttp://tiny
mce.moxiec
ode.com',
|
18 |
|
infourl
: 'http://
wiki.moxie
code.com/i
ndex.php/T
inyMCE:Plu
gins/inlin
epopups',
|
|
25 |
|
info
url : 'htt
p://wiki.m
oxiecode.c
om/index.p
hp/TinyMCE
:Plugins/i
nlinepopup
s',
|
19 |
|
version
:
tiny
MCE
.majorVers
ion
+
"."
+
tiny
MCE
.minorVers
ion
|
|
26 |
|
version
:
tiny
mce
.majorVers
ion
+
"."
+
tiny
mce
.minorVers
ion
|
20 |
|
};
|
|
|
21 |
|
}
|
|
|
22 |
|
};
|
|
27 |
|
};
|
23 |
|
|
|
|
24 |
|
tinyMCE.ad
dPlugin("i
nlinepopup
s", TinyMC
E_InlinePo
pupsPlugin
);
|
|
|
25 |
|
|
|
|
26 |
|
// Patch o
penWindow,
closeWind
ow TinyMCE
functions
|
|
|
27 |
|
|
|
|
28 |
|
TinyMCE_En
gine.proto
type.orgOp
enWindow =
TinyMCE_E
ngine.prot
otype.open
Window;
|
|
|
29 |
|
TinyMCE_En
gine.proto
type.orgCl
oseWindow
= TinyMCE_
Engine.pro
totype.clo
seWindow;
|
|
|
30 |
|
|
|
|
31 |
|
TinyMCE_En
gine.proto
type.openW
indow = fu
nction(tem
plate, arg
s) {
|
|
|
32 |
|
// Doe
s the call
er support
inline
|
|
|
33 |
|
if (ar
gs['inline
'] != "yes
" || tinyM
CE.isOpera
|| tinyMC
E.getParam
("plugins"
).indexOf(
'inlinepop
ups') == -
1) {
|
|
|
34 |
|
mc
Windows.se
lectedWind
ow = null;
|
|
|
35 |
|
ar
gs['mce_in
side_ifram
e'] = fals
e;
|
|
|
36 |
|
th
is.orgOpen
Window(tem
plate, arg
s);
|
|
|
37 |
|
re
turn;
|
|
|
38 |
|
}
|
|
28 |
|
}
|
|
|
29 |
|
});
|
39 |
|
|
|
30 |
|
|
40 |
|
var ur
l, resizab
le, scroll
bars;
|
|
31 |
|
tinymc
e.create('
tinymce.In
lineWindow
Manager:ti
nymce.Wind
owManager'
, {
|
|
|
32 |
|
In
lineWindow
Manager :
function(e
d) {
|
|
|
33 |
|
var t =
this;
|
41 |
|
|
|
34 |
|
|
42 |
|
args['
mce_inside
_iframe']
= true;
|
|
35 |
|
t.parent
(ed);
|
43 |
|
tinyMC
E.windowAr
gs = args;
|
|
36 |
|
t.zIndex
= 1000;
|
|
|
37 |
|
t.count
= 0;
|
|
|
38 |
|
},
|
44 |
|
|
|
39 |
|
|
45 |
|
if (te
mplate['fi
le'].charA
t(0) != '/
' && templ
ate['file'
].indexOf(
'://') ==
-1)
|
|
40 |
|
op
en : funct
ion(f, p)
{
|
46 |
|
ur
l = tinyMC
E.baseURL
+ "/themes
/" + tinyM
CE.getPara
m("theme")
+ "/" + t
emplate['f
ile'];
|
|
41 |
|
var t =
this, id,
opt = '',
ed = t.edi
tor, dw =
0, dh = 0,
vp, po, m
df, clf, w
e, w, u;
|
47 |
|
else
|
|
|
48 |
|
ur
l = templa
te['file']
;
|
|
|
49 |
|
|
|
42 |
|
|
50 |
|
if (!(
width = pa
rseInt(tem
plate['wid
th'])))
|
|
43 |
|
f = f ||
{};
|
51 |
|
wi
dth = 320;
|
|
44 |
|
p = p ||
{};
|
52 |
|
|
|
45 |
|
|
53 |
|
if (!(
height = p
arseInt(te
mplate['he
ight'])))
|
|
46 |
|
// Run n
ative wind
ows
|
54 |
|
he
ight = 200
;
|
|
47 |
|
if (!f.i
nline)
|
|
|
48 |
|
retu
rn t.paren
t(f, p);
|
55 |
|
|
|
49 |
|
|
56 |
|
i
f
(!(minW
idth
=
parseInt(
template['
minW
idth
']))
)
|
|
50 |
|
t.bookma
rk = ed.se
lection.ge
tBookmark(
'simple');
|
57 |
|
mi
nWidth = 1
00;
|
|
51 |
|
id = DOM
.uniqueId(
);
|
|
|
52 |
|
vp = DOM
.getViewPo
rt();
|
|
|
53 |
|
f
.w
idth
=
parseInt(
f.w
idth
||
320
)
;
|
|
|
54 |
|
f.height
= parseIn
t(f.height
|| 240) +
(tinymce.
isIE ? 8 :
0);
|
|
|
55 |
|
f.min_wi
dth = pars
eInt(f.min
_width ||
150);
|
|
|
56 |
|
f.min_he
ight = par
seInt(f.mi
n_height |
| 100);
|
|
|
57 |
|
f.max_wi
dth = pars
eInt(f.max
_width ||
2000);
|
|
|
58 |
|
f.max_he
ight = par
seInt(f.ma
x_height |
| 2000);
|
|
|
59 |
|
f.left =
f.left ||
Math.roun
d(Math.max
(vp.x, vp.
x + (vp.w
/ 2.0) - (
f.width /
2.0)));
|
|
|
60 |
|
f.top =
f.top || M
ath.round(
Math.max(v
p.y, vp.y
+ (vp.h /
2.0) - (f.
height / 2
.0)));
|
|
|
61 |
|
f.movabl
e = f.resi
zable = tr
ue;
|
|
|
62 |
|
p.mce_wi
dth = f.wi
dth;
|
|
|
63 |
|
p.mce_he
ight = f.h
eight;
|
|
|
64 |
|
p.mce_in
line = tru
e;
|
|
|
65 |
|
p.mce_wi
ndow_id =
id;
|
|
|
66 |
|
p.mce_au
to_focus =
f.auto_fo
cus;
|
58 |
|
|
|
67 |
|
|
59 |
|
if (!(
minHeight
= parseInt
(template[
'minHeight
'])))
|
|
68 |
|
// Trans
pose
|
60 |
|
mi
nHeight =
100;
|
|
69 |
|
//
po = DOM
.getPos(ed
.getContai
ner());
|
|
|
70 |
|
//
f.left -
= po.x;
|
|
|
71 |
|
//
f.top -=
po.y;
|
61 |
|
|
|
72 |
|
|
62 |
|
resiza
ble = (arg
s && args[
'resizable
']) ? args
['resizabl
e'] : "no"
;
|
|
73 |
|
t.featur
es = f;
|
63 |
|
scroll
bars = (ar
gs && args
['scrollba
rs']) ? ar
gs['scroll
bars'] : "
no";
|
|
74 |
|
t.params
= p;
|
|
|
75 |
|
t.onOpen
.dispatch(
t, f, p);
|
64 |
|
|
|
76 |
|
|
65 |
|
height
+= 18;
|
|
77 |
|
if (f.ty
pe) {
|
|
|
78 |
|
opt
+= ' mceMo
dal';
|
66 |
|
|
|
79 |
|
|
67 |
|
// Rep
lace all a
rgs as var
iables in
URL
|
|
80 |
|
if (
f.type)
|
68 |
|
for (v
ar name in
args) {
|
|
81 |
|
opt += ' m
ce' + f.ty
pe.substri
ng(0, 1).t
oUpperCase
() + f.typ
e.substrin
g(1);
|
69 |
|
if
(typeof(a
rgs[name])
== 'funct
ion')
|
|
|
70 |
|
continue
;
|
|
|
71 |
|
|
|
82 |
|
|
72 |
|
ur
l = tinyMC
E.replaceV
ar(url, na
me, escape
(args[name
]));
|
|
83 |
|
f.re
sizable =
false;
|
73 |
|
}
|
|
84 |
|
}
|
74 |
|
|
|
85 |
|
|
75 |
|
var el
m = docume
nt.getElem
entById(th
is.selecte
dInstance.
editorId +
'_parent'
);
|
|
86 |
|
if (f.st
atusbar)
|
|
|
87 |
|
opt
+= ' mceSt
atusbar';
|
76 |
|
|
|
88 |
|
|
77 |
|
if (ti
nyMCE.hasP
lugin('ful
lscreen')
&& this.se
lectedInst
ance.getDa
ta('fullsc
reen').ena
bled)
|
|
89 |
|
if (f.re
sizable)
|
78 |
|
po
s = { absL
eft: 0, ab
sTop: 0 };
|
|
90 |
|
opt
+= ' mceRe
sizable';
|
79 |
|
else
|
|
|
80 |
|
po
s = tinyMC
E.getAbsPo
sition(elm
);
|
|
|
81 |
|
|
|
91 |
|
|
82 |
|
// Cen
ter div in
editor ar
ea
|
|
92 |
|
if (f.mi
nimizable)
|
83 |
|
pos.ab
sLeft += M
ath.round(
(elm.first
Child.clie
ntWidth /
2) - (widt
h / 2));
|
|
93 |
|
opt
+= ' mceMi
nimizable'
;
|
84 |
|
pos.ab
sTop += Ma
th.round((
elm.firstC
hild.clien
tHeight /
2) - (heig
ht / 2));
|
|
|
85 |
|
|
|
94 |
|
|
86 |
|
mcWind
ows.open(u
rl, mcWind
ows.idCoun
ter++, "mo
dal=yes,wi
dth=" + wi
dth+ ",hei
ght=" + he
ight + ",r
esizable="
+ resizab
le + ",scr
ollbars="
+ scrollba
rs + ",sta
tusbar=" +
resizable
+ ",left=
" + pos.ab
sLeft + ",
top=" + po
s.absTop +
",minWidt
h=" + minW
idth + ",m
inHeight="
+ minHeig
ht );
|
|
95 |
|
if (f.ma
ximizable)
|
87 |
|
};
|
|
96 |
|
opt
+= ' mceMa
ximizable'
;
|
88 |
|
|
|
97 |
|
|
89 |
|
TinyMCE_En
gine.proto
type.close
Window = f
unction(wi
n) {
|
|
98 |
|
if (f.mo
vable)
|
90 |
|
var go
tit = fals
e, n, w;
|
|
99 |
|
opt
+= ' mceMo
vable';
|
91 |
|
|
|
100 |
|
|
92 |
|
for (n
in mcWind
ows.window
s) {
|
|
101 |
|
// Creat
e DOM obje
cts
|
93 |
|
w
= mcWindow
s.windows[
n];
|
|
102 |
|
t._addAl
l(document
.body,
|
|
|
103 |
|
['di
v', {id :
id, 'class
' : ed.set
tings.inli
nepopups_s
kin || 'cl
earlooks2'
, dir : 'l
tr', style
: 'width:
100px;heig
ht:100px'}
,
|
|
|
104 |
|
['div', {i
d : id + '
_wrapper',
'class' :
'mceWrapp
er' + opt}
,
|
|
|
105 |
|
['div'
, {id : id
+ '_top',
'class' :
'mceTop'}
,
|
|
|
106 |
|
['
div', {'cl
ass' : 'mc
eLeft'}],
|
|
|
107 |
|
['
div', {'cl
ass' : 'mc
eCenter'}]
,
|
|
|
108 |
|
['
div', {'cl
ass' : 'mc
eRight'}],
|
|
|
109 |
|
['
span', {id
: id + '_
title'}, f
.title ||
'']
|
|
|
110 |
|
],
|
94 |
|
|
|
111 |
|
|
95 |
|
if
(typeof(w
) == 'func
tion')
|
|
112 |
|
['div'
, {id : id
+ '_middl
e', 'class
' : 'mceMi
ddle'},
|
96 |
|
continue
;
|
|
113 |
|
['
div', {id
: id + '_l
eft', 'cla
ss' : 'mce
Left'}],
|
|
|
114 |
|
['
span', {id
: id + '_
content'}]
,
|
|
|
115 |
|
['
div', {id
: id + '_r
ight', 'cl
ass' : 'mc
eRight'}]
|
|
|
116 |
|
],
|
97 |
|
|
|
117 |
|
|
98 |
|
if
(win.name
== w.id +
'_iframe'
) {
|
|
118 |
|
['div'
, {id : id
+ '_botto
m', 'class
' : 'mceBo
ttom'},
|
99 |
|
w.close(
);
|
|
119 |
|
['
div', {'cl
ass' : 'mc
eLeft'}],
|
100 |
|
gotit =
true;
|
|
120 |
|
['
div', {'cl
ass' : 'mc
eCenter'}]
,
|
101 |
|
}
|
|
121 |
|
['
div', {'cl
ass' : 'mc
eRight'}],
|
102 |
|
}
|
|
122 |
|
['
span', {id
: id + '_
status'},
'Content']
|
|
|
123 |
|
],
|
103 |
|
|
|
124 |
|
|
104 |
|
if (!g
otit)
|
|
125 |
|
['a',
{'class' :
'mceMove'
, tabindex
: '-1', h
ref : 'jav
ascript:;'
}],
|
105 |
|
th
is.orgClos
eWindow(wi
n);
|
|
126 |
|
['a',
{'class' :
'mceMin',
tabindex
: '-1', hr
ef : 'java
script:;',
onmousedo
wn : 'retu
rn false;'
}],
|
|
|
127 |
|
['a',
{'class' :
'mceMax',
tabindex
: '-1', hr
ef : 'java
script:;',
onmousedo
wn : 'retu
rn false;'
}],
|
|
|
128 |
|
['a',
{'class' :
'mceMed',
tabindex
: '-1', hr
ef : 'java
script:;',
onmousedo
wn : 'retu
rn false;'
}],
|
|
|
129 |
|
['a',
{'class' :
'mceClose
', tabinde
x : '-1',
href : 'ja
vascript:;
', onmouse
down : 're
turn false
;'}],
|
|
|
130 |
|
['a',
{id : id +
'_resize_
n', 'class
' : 'mceRe
size mceRe
sizeN', ta
bindex : '
-1', href
: 'javascr
ipt:;'}],
|
|
|
131 |
|
['a',
{id : id +
'_resize_
s', 'class
' : 'mceRe
size mceRe
sizeS', ta
bindex : '
-1', href
: 'javascr
ipt:;'}],
|
|
|
132 |
|
['a',
{id : id +
'_resize_
w', 'class
' : 'mceRe
size mceRe
sizeW', ta
bindex : '
-1', href
: 'javascr
ipt:;'}],
|
|
|
133 |
|
['a',
{id : id +
'_resize_
e', 'class
' : 'mceRe
size mceRe
sizeE', ta
bindex : '
-1', href
: 'javascr
ipt:;'}],
|
|
|
134 |
|
['a',
{id : id +
'_resize_
nw', 'clas
s' : 'mceR
esize mceR
esizeNW',
tabindex :
'-1', hre
f : 'javas
cript:;'}]
,
|
|
|
135 |
|
['a',
{id : id +
'_resize_
ne', 'clas
s' : 'mceR
esize mceR
esizeNE',
tabindex :
'-1', hre
f : 'javas
cript:;'}]
,
|
|
|
136 |
|
['a',
{id : id +
'_resize_
sw', 'clas
s' : 'mceR
esize mceR
esizeSW',
tabindex :
'-1', hre
f : 'javas
cript:;'}]
,
|
|
|
137 |
|
['a',
{id : id +
'_resize_
se', 'clas
s' : 'mceR
esize mceR
esizeSE',
tabindex :
'-1', hre
f : 'javas
cript:;'}]
|
|
|
138 |
|
]
|
|
|
139 |
|
]
|
|
|
140 |
|
);
|
106 |
|
|
|
141 |
|
|
107 |
|
tinyMC
E.selected
Instance.g
etWin().fo
cus();
|
|
142 |
|
DOM.setS
tyles(id,
{top : -10
000, left
: -10000})
;
|
108 |
|
};
|
|
|
109 |
|
|
|
143 |
|
|
110 |
|
TinyMCE_En
gine.proto
type.setWi
ndowTitle
= function
(win_ref,
title) {
|
|
144 |
|
// Fix g
ecko rende
ring bug,
where the
editors if
rame messe
d with win
dow conten
ts
|
111 |
|
for (v
ar n in mc
Windows.wi
ndows) {
|
|
145 |
|
if (tiny
mce.isGeck
o)
|
112 |
|
va
r win = mc
Windows.wi
ndows[n];
|
|
146 |
|
DOM.
setStyle(i
d, 'overfl
ow', 'auto
');
|
113 |
|
if
(typeof(w
in) == 'fu
nction')
|
|
|
114 |
|
continue
;
|
|
|
115 |
|
|
|
147 |
|
|
116 |
|
if
(win_ref.
name == wi
n.id + "_i
frame")
|
|
148 |
|
// Measu
re borders
|
117 |
|
window.f
rames[win.
id + "_ifr
ame"].docu
ment.getEl
ementById(
win.id + '
_title').i
nnerHTML =
title;
|
|
149 |
|
if (!f.t
ype) {
|
|
|
150 |
|
dw +
= DOM.get(
id + '_lef
t').client
Width;
|
|
|
151 |
|
dw +
= DOM.get(
id + '_rig
ht').clien
tWidth;
|
|
|
152 |
|
dh +
= DOM.get(
id + '_top
').clientH
eight;
|
|
|
153 |
|
dh +
= DOM.get(
id + '_bot
tom').clie
ntHeight;
|
118 |
|
}
|
|
154 |
|
}
|
119 |
|
};
|
|
|
120 |
|
|
|
155 |
|
|
121 |
|
// * * * *
* TinyMCE
_Windows c
lasses bel
ow
|
|
156 |
|
// Resiz
e window
|
122 |
|
|
|
157 |
|
DOM.setS
tyles(id,
{top : f.t
op, left :
f.left, w
idth : f.w
idth + dw,
height :
f.height +
dh});
|
123 |
|
// Windows
handler
|
|
|
124 |
|
function T
inyMCE_Win
dows() {
|
|
|
125 |
|
this.s
ettings =
new Array(
);
|
|
|
126 |
|
this.w
indows = n
ew Array()
;
|
|
|
127 |
|
this.i
sMSIE = (n
avigator.a
ppName ==
"Microsoft
Internet
Explorer")
;
|
|
|
128 |
|
this.i
sGecko = n
avigator.u
serAgent.i
ndexOf('Ge
cko') != -
1;
|
|
|
129 |
|
this.i
sSafari =
navigator.
userAgent.
indexOf('S
afari') !=
-1;
|
|
|
130 |
|
this.i
sMac = nav
igator.use
rAgent.ind
exOf('Mac'
) != -1;
|
|
|
131 |
|
this.i
sMSIE5_0 =
this.isMS
IE && (nav
igator.use
rAgent.ind
exOf('MSIE
5.0') !=
-1);
|
|
|
132 |
|
this.a
ction = "n
one";
|
|
|
133 |
|
this.s
electedWin
dow = null
;
|
|
|
134 |
|
this.l
astSelecte
dWindow =
null;
|
|
|
135 |
|
this.z
index = 10
01;
|
|
|
136 |
|
this.m
ouseDownSc
reenX = 0;
|
|
|
137 |
|
this.m
ouseDownSc
reenY = 0;
|
|
|
138 |
|
this.m
ouseDownLa
yerX = 0;
|
|
|
139 |
|
this.m
ouseDownLa
yerY = 0;
|
|
|
140 |
|
this.m
ouseDownWi
dth = 0;
|
|
|
141 |
|
this.m
ouseDownHe
ight = 0;
|
|
|
142 |
|
this.i
dCounter =
0;
|
|
|
143 |
|
};
|
|
|
144 |
|
|
|
158 |
|
|
145 |
|
TinyMCE_Wi
ndows.prot
otype.init
= functio
n(settings
) {
|
|
159 |
|
u = f.ur
l || f.fil
e;
|
146 |
|
this.s
ettings =
settings;
|
|
160 |
|
if (tiny
mce.relaxe
dDomain)
|
|
|
161 |
|
u +=
(u.indexO
f('?') ==
-1 ? '?' :
'&') + 'm
ce_rdomain
=' + tinym
ce.relaxed
Domain;
|
147 |
|
|
|
162 |
|
|
148 |
|
if (th
is.isMSIE)
|
|
163 |
|
if (!f.t
ype) {
|
149 |
|
th
is.addEven
t(document
, "mousemo
ve", mcWin
dows.event
Dispatcher
);
|
|
164 |
|
DOM.
add(id + '
_content',
'iframe',
{id : id
+ '_ifr',
src : 'jav
ascript:""
', frameBo
rder : 0,
style : 'b
order:0;wi
dth:10px;h
eight:10px
'});
|
150 |
|
else
|
|
165 |
|
DOM.
setStyles(
id + '_ifr
', {width
: f.width,
height :
f.height})
;
|
151 |
|
th
is.addEven
t(window,
"mousemove
", mcWindo
ws.eventDi
spatcher);
|
|
166 |
|
DOM.
setAttrib(
id + '_ifr
', 'src',
u);
|
152 |
|
|
|
167 |
|
}
else
{
|
153 |
|
this.a
ddEvent(do
cument, "m
ouseup", m
cWindows.e
ventDispat
cher);
|
|
168 |
|
DOM.
add(id + '
_wrapper',
'a', {id
: id + '_o
k', 'class
' : 'mceBu
tton mceOk
', href :
'javascrip
t:;', onmo
usedown :
'return fa
lse;'}, 'O
k');
|
154 |
|
|
|
|
155 |
|
this.a
ddEvent(wi
ndow, "res
ize", mcWi
ndows.even
tDispatche
r);
|
|
|
156 |
|
this.a
ddEvent(do
cument, "s
croll", mc
Windows.ev
entDispatc
her);
|
|
|
157 |
|
|
|
|
158 |
|
this.d
oc = docum
ent;
|
|
|
159 |
|
};
|
|
|
160 |
|
|
|
169 |
|
|
161 |
|
TinyMCE_Wi
ndows.prot
otype.getB
ounds = fu
nction() {
|
|
170 |
|
if (
f.type ==
'confirm')
|
162 |
|
if (!t
his.bounds
) {
|
|
171 |
|
DOM.add(id
+ '_wrapp
er', 'a',
{'class' :
'mceButto
n mceCance
l', href :
'javascri
pt:;', onm
ousedown :
'return f
alse;'}, '
Cancel');
|
163 |
|
va
r vp = tin
yMCE.getVi
ewPort(win
dow);
|
|
|
164 |
|
va
r top, lef
t, bottom,
right, do
cEl = this
.doc.docum
entElement
;
|
|
|
165 |
|
|
|
172 |
|
|
166 |
|
to
p = vp.
top;
|
|
173 |
|
DOM.
add(id + '
_middle',
'div', {'c
lass' : 'm
ceIcon'});
|
167 |
|
le
ft = vp.
left;
|
|
174 |
|
DOM.
setHTML(id
+ '_conte
nt', f.con
tent.repla
ce('\n', '
<br />'));
|
168 |
|
bo
ttom = vp.
height + t
op - 2;
|
|
|
169 |
|
ri
ght = vp.
width + l
eft - 22;
// TODO th
is number
is platfor
m dependan
t
|
|
|
170 |
|
//
x1, y1, x
2, y2
|
|
|
171 |
|
th
is.bounds
= [left, t
op, right,
bottom];
|
|
|
172 |
|
}
|
|
175 |
|
}
|
173 |
|
return
this.boun
ds;
|
|
|
174 |
|
};
|
|
|
175 |
|
|
|
|
176 |
|
TinyMCE_Wi
ndows.prot
otype.clam
pBoxPositi
on = funct
ion(x, y,
w, h, minW
, minH) {
|
|
|
177 |
|
var bo
unds = thi
s.getBound
s();
|
|
|
178 |
|
|
|
|
179 |
|
x = Ma
th.max(bou
nds[0], Ma
th.min(bou
nds[2], x
+ w) - w);
|
|
|
180 |
|
y = Ma
th.max(bou
nds[1], Ma
th.min(bou
nds[3], y
+ h) - h);
|
|
|
181 |
|
|
|
|
182 |
|
return
this.clam
pBoxSize(x
, y, w, h,
minW, min
H);
|
|
|
183 |
|
};
|
|
|
184 |
|
|
|
176 |
|
|
185 |
|
TinyMCE_Wi
ndows.prot
otype.clam
pBoxSize =
function(
x, y, w, h
, minW, mi
nH) {
|
|
177 |
|
// Regis
ter events
|
186 |
|
var bo
unds = thi
s.getBound
s();
|
|
178 |
|
mdf = Ev
ent.add(id
, 'mousedo
wn', funct
ion(e) {
|
|
|
179 |
|
var
n = e.targ
et, w, vp;
|
187 |
|
|
|
180 |
|
|
188 |
|
return
[
|
|
181 |
|
w =
t.windows[
id];
|
189 |
|
x,
y,
|
|
182 |
|
t.fo
cus(id);
|
190 |
|
Ma
th.max(min
W, Math.mi
n(bounds[2
], x + w)
- x),
|
|
|
191 |
|
Ma
th.max(min
H, Math.mi
n(bounds[3
], y + h)
- y)
|
|
|
192 |
|
];
|
|
|
193 |
|
};
|
|
|
194 |
|
|
|
183 |
|
|
195 |
|
TinyMCE_Wi
ndows.prot
otype.getP
aram = fun
ction(name
, default_
value) {
|
|
184 |
|
if (
n.nodeName
== 'A' ||
n.nodeNam
e == 'a')
{
|
196 |
|
var va
lue = null
;
|
|
185 |
|
if (n.clas
sName == '
mceMax') {
|
|
|
186 |
|
w.oldP
os = w.ele
ment.getXY
();
|
|
|
187 |
|
w.oldS
ize = w.el
ement.getS
ize();
|
197 |
|
|
|
188 |
|
|
198 |
|
value
= (typeof(
this.setti
ngs[name])
== "undef
ined") ? d
efault_val
ue : this.
settings[n
ame];
|
|
189 |
|
vp = D
OM.getView
Port();
|
199 |
|
|
|
190 |
|
|
200 |
|
// Fix
bool valu
es
|
|
191 |
|
// Red
uce viewpo
rt size to
avoid scr
ollbars
|
201 |
|
if (va
lue == "tr
ue" || val
ue == "fal
se")
|
|
192 |
|
vp.w -
= 2;
|
202 |
|
re
turn (valu
e == "true
");
|
|
193 |
|
vp.h -
= 2;
|
203 |
|
|
|
194 |
|
|
204 |
|
return
value;
|
|
195 |
|
w.elem
ent.moveTo
(vp.x, vp.
y);
|
205 |
|
};
|
|
196 |
|
w.elem
ent.resize
To(vp.w, v
p.h);
|
|
|
197 |
|
DOM.se
tStyles(id
+ '_ifr',
{width :
vp.w - w.d
eltaWidth,
height :
vp.h - w.d
eltaHeight
});
|
|
|
198 |
|
DOM.ad
dClass(id
+ '_wrappe
r', 'mceMa
ximized');
|
|
|
199 |
|
} else if
(n.classNa
me == 'mce
Med') {
|
|
|
200 |
|
// Res
et to old
size
|
|
|
201 |
|
w.elem
ent.moveTo
(w.oldPos.
x, w.oldPo
s.y);
|
|
|
202 |
|
w.elem
ent.resize
To(w.oldSi
ze.w, w.ol
dSize.h);
|
|
|
203 |
|
w.ifra
meElement.
resizeTo(w
.oldSize.w
- w.delta
Width, w.o
ldSize.h -
w.deltaHe
ight);
|
206 |
|
|
|
204 |
|
|
207 |
|
TinyMCE_Wi
ndows.prot
otype.even
tDispatche
r = functi
on(e) {
|
|
205 |
|
DOM.re
moveClass(
id + '_wra
pper', 'mc
eMaximized
');
|
208 |
|
e = ty
peof(e) ==
"undefine
d" ? windo
w.event :
e;
|
|
206 |
|
} else if
(n.classNa
me == 'mce
Move')
|
209 |
|
|
|
207 |
|
return
t._startD
rag(id, e,
n.classNa
me);
|
210 |
|
if (mc
Windows.se
lectedWind
ow == null
)
|
|
208 |
|
else if (D
OM.hasClas
s(n, 'mceR
esize'))
|
211 |
|
re
turn;
|
|
209 |
|
return
t._startD
rag(id, e,
n.classNa
me.substri
ng(13));
|
212 |
|
|
|
|
213 |
|
// Swi
tch focus
|
|
|
214 |
|
if (mc
Windows.is
Gecko && e
.type == "
mousedown"
) {
|
|
|
215 |
|
va
r elm = e.
currentTar
get;
|
|
|
216 |
|
|
|
|
217 |
|
fo
r (var n i
n mcWindow
s.windows)
{
|
|
|
218 |
|
var win
= mcWindow
s.windows[
n];
|
|
|
219 |
|
|
|
|
220 |
|
if (win.
headElemen
t == elm |
| win.resi
zeElement
== elm) {
|
|
|
221 |
|
win.
focus();
|
|
|
222 |
|
brea
k;
|
|
|
223 |
|
}
|
|
|
224 |
|
}
|
|
|
225 |
|
}
|
|
210 |
|
}
|
|
|
211 |
|
});
|
226 |
|
|
|
212 |
|
|
227 |
|
switch
(e.type)
{
|
|
213 |
|
clf = Ev
ent.add(id
, 'click',
function(
e) {
|
228 |
|
ca
se "mousem
ove":
|
|
214 |
|
var
n = e.targ
et;
|
229 |
|
mcWindow
s.selected
Window.onM
ouseMove(e
);
|
|
|
230 |
|
break;
|
|
|
231 |
|
|
|
215 |
|
|
232 |
|
ca
se "mouseu
p":
|
|
216 |
|
t.fo
cus(id);
|
233 |
|
mcWindow
s.selected
Window.onM
ouseUp(e);
|
|
|
234 |
|
break;
|
|
|
235 |
|
|
|
217 |
|
|
236 |
|
case
"
m
o
u
se
down"
:
|
|
218 |
|
if (
n.nodeName
== 'A' ||
n.nodeNam
e == 'a')
{
|
237 |
|
mcWindow
s.selected
Window.onM
ouseDown(e
);
|
|
219 |
|
switch (n.
className)
{
|
238 |
|
break;
|
|
220 |
|
case
'
m
ceCl
o
se
'
:
|
|
|
221 |
|
t.
close(null
, id);
|
|
|
222 |
|
re
turn Event
.cancel(e)
;
|
239 |
|
|
|
223 |
|
|
240 |
|
ca
se "focus"
:
|
|
224 |
|
case '
mceButton
mceOk':
|
241 |
|
mcWindow
s.selected
Window.onF
ocus(e);
|
|
225 |
|
case '
mceButton
mceCancel'
:
|
242 |
|
break;
|
|
226 |
|
f.
button_fun
c(n.classN
ame == 'mc
eButton mc
eOk');
|
243 |
|
ca
se "scroll
":
|
|
227 |
|
re
turn Event
.cancel(e)
;
|
244 |
|
ca
se "resize
":
|
|
|
245 |
|
if (mcWi
ndows.clam
pUpdateTim
eout)
|
|
|
246 |
|
clea
rTimeout(m
cWindows.c
lampUpdate
Timeout);
|
|
|
247 |
|
mcWindow
s.clampEve
ntType = e
.type;
|
|
|
248 |
|
mcWindow
s.clampUpd
ateTimeout
=
|
|
|
249 |
|
setT
imeout(fun
ction () {
mcWindows.
updateClam
ping()}, 1
00);
|
|
|
250 |
|
break;
|
|
|
251 |
|
}
|
|
228 |
|
}
|
252 |
|
};
|
|
|
253 |
|
|
|
|
254 |
|
TinyMCE_Wi
ndows.prot
otype.upda
teClamping
= functio
n () {
|
|
|
255 |
|
var cl
amp, overs
ize, etype
= mcWindo
ws.clampEv
entType;
|
|
|
256 |
|
|
|
|
257 |
|
this.b
ounds = nu
ll; // Rec
alc window
bounds on
resize/sc
roll
|
|
|
258 |
|
this.c
lampUpdate
Timeout =
null;
|
|
|
259 |
|
|
|
|
260 |
|
for (v
ar n in th
is.windows
) {
|
|
|
261 |
|
wi
n = this.w
indows[n];
|
|
|
262 |
|
if
(typeof(w
in) == 'fu
nction' ||
! win.win
Element) c
ontinue;
|
|
|
263 |
|
|
|
|
264 |
|
cl
amp = mcWi
ndows.clam
pBoxPositi
on(
|
|
|
265 |
|
win.left
, win.top,
|
|
|
266 |
|
win.winE
lement.scr
ollWidth,
|
|
|
267 |
|
win.winE
lement.scr
ollHeight,
|
|
|
268 |
|
win.feat
ures.minWi
dth,
|
|
|
269 |
|
win.feat
ures.minHe
ight
|
|
|
270 |
|
);
|
|
|
271 |
|
ov
ersize = (
|
|
|
272 |
|
clamp[2]
!= win.wi
nElement.s
crollWidth
||
|
|
|
273 |
|
clamp[3]
!= win.wi
nElement.s
crollHeigh
t
|
|
|
274 |
|
)
? true : f
alse;
|
|
|
275 |
|
|
|
|
276 |
|
if
(!oversiz
e || win.f
eatures.re
sizable ==
"yes" ||
etype != "
scroll")
|
|
|
277 |
|
win.move
To(clamp[0
], clamp[1
]);
|
|
|
278 |
|
if
(oversize
&& win.fe
atures.res
izable ==
"yes")
|
|
|
279 |
|
win.resi
zeTo(clamp
[2], clamp
[3]);
|
|
|
280 |
|
}
|
|
229 |
|
}
|
281 |
|
}
;
|
|
230 |
|
}
)
;
|
282 |
|
|
|
|
283 |
|
TinyMCE_Wi
ndows.prot
otype.addE
vent = fun
ction(obj,
name, han
dler) {
|
|
|
284 |
|
if (th
is.isMSIE)
|
|
|
285 |
|
ob
j.attachEv
ent("on" +
name, han
dler);
|
|
|
286 |
|
else
|
|
|
287 |
|
ob
j.addEvent
Listener(n
ame, handl
er, false)
;
|
|
|
288 |
|
};
|
|
|
289 |
|
|
|
231 |
|
|
290 |
|
TinyMCE_Wi
ndows.prot
otype.canc
elEvent =
function(e
) {
|
|
232 |
|
// Add w
indow
|
291 |
|
if (th
is.isMSIE)
{
|
|
233 |
|
t.window
s = t.wind
ows || {};
|
292 |
|
e.
returnValu
e = false;
|
|
234 |
|
w = t.wi
ndows[id]
= {
|
293 |
|
e.
cancelBubb
le = true;
|
|
235 |
|
id :
id,
|
294 |
|
} else
|
|
236 |
|
mous
edown_func
: mdf,
|
295 |
|
e.
preventDef
ault();
|
|
237 |
|
clic
k_func : c
lf,
|
|
|
238 |
|
elem
ent : new
Element(id
, {blocker
: 1, cont
ainer : ed
.getContai
ner()}),
|
|
|
239 |
|
ifra
meElement
: new Elem
ent(id + '
_ifr'),
|
|
|
240 |
|
feat
ures : f,
|
|
|
241 |
|
delt
aWidth : d
w,
|
|
|
242 |
|
delt
aHeight :
dh
|
296 |
|
};
|
|
243 |
|
};
|
297 |
|
|
|
244 |
|
|
298 |
|
TinyMCE_Wi
ndows.prot
otype.pars
eFeatures
= function
(opts) {
|
|
245 |
|
w.iframe
Element.on
('focus',
function()
{
|
299 |
|
// Cle
anup the o
ptions
|
|
246 |
|
t.fo
cus(id);
|
300 |
|
opts =
opts.toLo
werCase();
|
|
247 |
|
});
|
301 |
|
opts =
opts.repl
ace(/;/g,
",");
|
|
|
302 |
|
opts =
opts.repl
ace(/[^0-9
a-z=,]/g,
"");
|
|
|
303 |
|
|
|
|
304 |
|
var op
tionChunks
= opts.sp
lit(',');
|
|
|
305 |
|
var op
tions = ne
w Array();
|
|
|
306 |
|
|
|
248 |
|
|
307 |
|
option
s['left']
= "10";
|
|
249 |
|
// Setup
blocker
|
308 |
|
option
s['top'] =
"10";
|
|
250 |
|
if (t.co
unt == 0 &
& t.editor
.getParam(
'dialog_ty
pe') == 'm
odal') {
|
309 |
|
option
s['width']
= "300";
|
|
251 |
|
DOM.
add(DOM.do
c.body, 'd
iv', {
|
310 |
|
option
s['height'
] = "300";
|
|
252 |
|
id : 'mceM
odalBlocke
r',
|
311 |
|
option
s['minwidt
h'] = "100
";
|
|
253 |
|
'class' :
(t.editor.
settings.i
nlinepopup
s_skin ||
'clearlook
s2') + '_m
odalBlocke
r',
|
312 |
|
option
s['minheig
ht'] = "10
0";
|
|
254 |
|
style : {l
eft : vp.x
, top : vp
.y, width
: vp.w, he
ight : vp.
h, zIndex
: t.zIndex
- 1}
|
313 |
|
option
s['resizab
le'] = "ye
s";
|
|
255 |
|
});
|
314 |
|
option
s['minimiz
able'] = "
yes";
|
|
|
315 |
|
option
s['maximiz
able'] = "
yes";
|
|
|
316 |
|
option
s['close']
= "yes";
|
|
|
317 |
|
option
s['movable
'] = "yes"
;
|
|
|
318 |
|
option
s['statusb
ar'] = "ye
s";
|
|
|
319 |
|
option
s['scrollb
ars'] = "a
uto";
|
|
|
320 |
|
option
s['modal']
= "no";
|
|
|
321 |
|
|
|
256 |
|
|
322 |
|
if (op
ts == "")
|
|
257 |
|
DOM.
show('mceM
odalBlocke
r'); // Re
duces flic
ker in IE
|
323 |
|
re
turn optio
ns;
|
|
258 |
|
} else
|
|
|
259 |
|
DOM.
setStyle('
mceModalBl
ocker', 'z
-index', t
.zIndex -
1);
|
324 |
|
|
|
260 |
|
|
325 |
|
for (v
ar i=0; i<
optionChun
ks.length;
i++) {
|
|
261 |
|
t.focus(
id);
|
326 |
|
va
r parts =
optionChun
ks[i].spli
t('=');
|
|
262 |
|
t._fixIE
Layout(id,
1);
|
327 |
|
|
|
263 |
|
|
328 |
|
if
(parts.le
ngth == 2)
|
|
264 |
|
// Focus
ok button
|
329 |
|
options[
parts[0]]
= parts[1]
;
|
|
265 |
|
if (DOM.
get(id + '
_ok'))
|
330 |
|
}
|
|
266 |
|
DOM.
get(id + '
_ok').focu
s();
|
331 |
|
|
|
267 |
|
|
332 |
|
option
s['left']
= parseInt
(options['
left']);
|
|
268 |
|
t.count+
+;
|
333 |
|
option
s['top'] =
parseInt(
options['t
op']);
|
|
|
334 |
|
option
s['width']
= parseIn
t(options[
'width']);
|
|
|
335 |
|
option
s['height'
] = parseI
nt(options
['height']
);
|
|
|
336 |
|
option
s['minWidt
h'] = pars
eInt(optio
ns['minwid
th']);
|
|
|
337 |
|
option
s['minHeig
ht'] = par
seInt(opti
ons['minhe
ight']);
|
|
|
338 |
|
|
|
269 |
|
|
339 |
|
return
options
;
|
|
270 |
|
return
w
;
|
340 |
|
}
;
|
|
271 |
|
}
,
|
341 |
|
|
|
272 |
|
|
342 |
|
TinyMCE_Wi
ndows.prot
otype.open
= functio
n(url, nam
e, feature
s) {
|
|
273 |
|
fo
cus : func
tion(id) {
|
343 |
|
this.l
astSelecte
dWindow =
this.selec
tedWindow;
|
|
274 |
|
var t =
this, w =
t.windows[
id];
|
344 |
|
|
|
275 |
|
|
345 |
|
var wi
n = new Ti
nyMCE_Wind
ow();
|
|
276 |
|
w.zIndex
= this.zI
ndex++;
|
346 |
|
var wi
nDiv, html
= "", id;
|
|
277 |
|
w.elemen
t.setStyle
('zIndex',
w.zIndex)
;
|
347 |
|
var im
gPath = th
is.getPara
m("images_
path");
|
|
278 |
|
w.elemen
t.update()
;
|
348 |
|
|
|
279 |
|
|
349 |
|
featur
es = this.
parseFeatu
res(featur
es);
|
|
280 |
|
id = id
+ '_wrappe
r';
|
|
|
281 |
|
DOM.remo
veClass(t.
lastId, 'm
ceFocus');
|
|
|
282 |
|
DOM.addC
lass(id, '
mceFocus')
;
|
|
|
283 |
|
t.lastId
= id;
|
|
|
284 |
|
},
|
350 |
|
|
|
285 |
|
|
351 |
|
// Cla
mp specifi
ed dimensi
ons
|
|
286 |
|
_a
ddAll : fu
nction(te,
ne) {
|
352 |
|
var cl
amp = mcWi
ndows.clam
pBoxPositi
on(
|
|
287 |
|
var i, n
, t = this
, dom = ti
nymce.DOM;
|
353 |
|
fe
atures['le
ft'], feat
ures['top'
],
|
|
|
354 |
|
fe
atures['wi
dth'], fea
tures['hei
ght'],
|
|
|
355 |
|
fe
atures['mi
nWidth'],
features['
minHeight'
]
|
|
|
356 |
|
);
|
|
|
357 |
|
|
|
288 |
|
|
358 |
|
featur
es['left']
= clamp[0
];
|
|
289 |
|
if (is(n
e, 'string
'))
|
359 |
|
featur
es['top']
= clamp[1]
;
|
|
290 |
|
te.a
ppendChild
(dom.doc.c
reateTextN
ode(ne));
|
|
|
291 |
|
else if
(ne.length
) {
|
|
|
292 |
|
te =
te.append
Child(dom.
create(ne[
0], ne[1])
);
|
360 |
|
|
|
293 |
|
|
361 |
|
if (fe
atures['re
sizable']
== "yes")
{
|
|
294 |
|
for
(i=2; i<ne
.length; i
++)
|
362 |
|
fe
atures['wi
dth'] = cl
amp[2];
|
|
295 |
|
t._addAll(
te, ne[i])
;
|
363 |
|
fe
atures['he
ight'] = c
lamp[3];
|
|
|
364 |
|
}
|
|
296 |
|
}
|
|
|
297 |
|
},
|
365 |
|
|
|
298 |
|
|
366 |
|
// Cre
ate div
|
|
299 |
|
_s
tartDrag :
function(
id, se, ac
) {
|
367 |
|
id = "
mcWindow_"
+ name;
|
|
300 |
|
var t =
this, mu,
mm, d = do
cument, eb
, w = t.wi
ndows[id],
we = w.el
ement, sp
= we.getXY
(), p, sz,
ph, cp, v
p, sx, sy,
sex, sey,
dx, dy, d
w, dh;
|
368 |
|
win.de
ltaHeight
= 18;
|
|
|
369 |
|
|
|
301 |
|
|
370 |
|
if (fe
atures['st
atusbar']
== "yes")
{
|
|
302 |
|
// Get p
ositons an
d sizes
|
371 |
|
wi
n.deltaHei
ght += 13;
|
|
303 |
|
//
cp = DOM
.getPos(t.
editor.get
Container(
));
|
|
|
304 |
|
cp = {x
: 0, y : 0
};
|
|
|
305 |
|
vp = DOM
.getViewPo
rt();
|
372 |
|
|
|
306 |
|
|
373 |
|
if
(this.isM
SIE)
|
|
307 |
|
// Reduc
e viewport
size to a
void scrol
lbars whil
e dragging
|
374 |
|
win.delt
aHeight +=
1;
|
|
308 |
|
vp.w -=
2;
|
375 |
|
}
|
|
309 |
|
vp.
h
-=
2;
|
376 |
|
|
|
|
377 |
|
width
= parseInt
(features[
'width']);
|
|
|
378 |
|
height
= parseIn
t(features
['height']
)-win.delt
aHeight;
|
|
|
379 |
|
|
|
|
380 |
|
if (th
is.isMSIE)
|
|
|
381 |
|
widt
h
-=
2;
|
|
|
382 |
|
|
|
310 |
|
|
383 |
|
// Set
up first p
art of win
dow
|
|
311 |
|
sex = se
.screenX;
|
384 |
|
win.id
= id;
|
|
312 |
|
sey = se
.screenY;
|
385 |
|
win.ur
l = url;
|
|
313 |
|
dx = dy
= dw = dh
= 0;
|
386 |
|
win.na
me = name;
|
|
|
387 |
|
win.fe
atures = f
eatures;
|
|
|
388 |
|
this.w
indows[nam
e] = win;
|
|
|
389 |
|
|
|
314 |
|
|
390 |
|
iframe
Width = wi
dth;
|
|
315 |
|
// Handl
e mouse up
|
391 |
|
iframe
Height = h
eight;
|
|
316 |
|
mu = Eve
nt.add(d,
'mouseup',
function(
e) {
|
|
|
317 |
|
Even
t.remove(d
, 'mouseup
', mu);
|
|
|
318 |
|
Even
t.remove(d
, 'mousemo
ve', mm);
|
392 |
|
|
|
319 |
|
|
393 |
|
// Cre
ate inner
content
|
|
320 |
|
if (
eb)
|
394 |
|
html +
= '<!DOCTY
PE html PU
BLIC "-//W
3C//DTD HT
ML 4.0 Tra
nsitional/
/EN">';
|
|
321 |
|
eb.remove(
);
|
395 |
|
html +
= '<html>'
;
|
|
|
396 |
|
html +
= '<head>'
;
|
|
|
397 |
|
html +
= '<title>
Wrapper if
rame</titl
e>';
|
|
|
398 |
|
html +
= '<meta h
ttp-equiv=
"Content-T
ype" conte
nt="text/h
tml; chars
et=UTF-8">
';
|
|
|
399 |
|
html +
= '<link h
ref="' + t
his.getPar
am("css_fi
le") + '"
rel="style
sheet" typ
e="text/cs
s" />';
|
|
|
400 |
|
html +
= '</head>
';
|
|
|
401 |
|
html +
= '<body o
nload="par
ent.mcWind
ows.onLoad
(\'' + nam
e + '\');"
>';
|
|
|
402 |
|
|
|
322 |
|
|
403 |
|
html +
= '<div id
="' + id +
'_contain
er" class=
"mceWindow
">';
|
|
323 |
|
we.m
oveBy(dx,
dy);
|
404 |
|
html +
= '<div id
="' + id +
'_head" c
lass="mceW
indowHead"
onmousedo
wn="parent
.mcWindows
.windows[\
'' + name
+ '\'].foc
us();">';
|
|
324 |
|
we.r
esizeBy(dw
, dh);
|
405 |
|
html +
= ' <div
id="' + id
+ '_title
" class="m
ceWindowTi
tle"';
|
|
325 |
|
sz =
we.getSiz
e();
|
406 |
|
html +
= ' onsel
ectstart="
return fal
se;" unsel
ectable="o
n" style="
-moz-user-
select: no
ne !import
ant;"></di
v>';
|
|
326 |
|
DOM.
setStyles(
id + '_ifr
', {width
: sz.w - w
.deltaWidt
h, height
: sz.h - w
.deltaHeig
ht});
|
407 |
|
html +
= ' <di
v class="m
ceWindowHe
adTools">'
;
|
|
327 |
|
t._f
ixIELayout
(id, 1);
|
408 |
|
html +
= ' <
a href="ja
vascript:p
arent.mcWi
ndows.wind
ows[\'' +
name + '\'
].close();
" target="
_self" onm
ousedown="
return fal
se;" class
="mceWindo
wClose"><i
mg border=
"0" src="'
+ imgPath
+ '/windo
w_close.gi
f" /></a>'
;
|
|
|
409 |
|
if (fe
atures['re
sizable']
== "yes" &
& features
['maximiza
ble'] == "
yes")
|
|
|
410 |
|
ht
ml += '
<a href
="javascri
pt:parent.
mcWindows.
windows[\'
' + name +
'\'].maxi
mize();" t
arget="_se
lf" onmous
edown="ret
urn false;
" class="m
ceWindowMa
ximize"><i
mg border=
"0" src="'
+ imgPath
+ '/windo
w_maximize
.gif" /></
a>';
|
|
|
411 |
|
// htm
l += '
<a href=
"javascrip
t:mcWindow
s.windows[
\'' + name
+ '\'].mi
nimize();"
target="_
self" onmo
usedown="r
eturn fals
e;" class=
"mceWindow
Minimize">
</a>';
|
|
|
412 |
|
html +
= ' </d
iv>';
|
|
|
413 |
|
html +
= '</div><
div id="'
+ id + '_b
ody" class
="mceWindo
wBody" sty
le="width:
' + width
+ 'px; he
ight: ' +
height + '
px;">';
|
|
|
414 |
|
html +
= '<iframe
id="' + i
d + '_ifra
me" name="
' + id + '
_iframe" f
rameborder
="0" width
="' + ifra
meWidth +
'" height=
"' + ifram
eHeight +
'" src="'
+ url + '"
class="mc
eWindowBod
yIframe" s
crolling="
' + featur
es['scroll
bars'] + '
"></iframe
></div>';
|
|
|
415 |
|
|
|
328 |
|
|
416 |
|
if (fe
atures['st
atusbar']
== "yes")
{
|
|
329 |
|
retu
rn Event.c
ancel(e);
|
417 |
|
ht
ml += '<di
v id="' +
id + '_sta
tusbar" cl
ass="mceWi
ndowStatus
bar" onmou
sedown="pa
rent.mcWin
dows.windo
ws[\'' + n
ame + '\']
.focus();"
>';
|
|
330 |
|
});
|
418 |
|
|
|
331 |
|
|
419 |
|
if
(features
['resizabl
e'] == "ye
s") {
|
|
332 |
|
if (ac !
= 'Move')
|
420 |
|
if (this
.isGecko)
|
|
333 |
|
star
tMove();
|
421 |
|
html
+= '<div
id="' + id
+ '_resiz
e" class="
mceWindowR
esize"><di
v style="b
ackground-
image: url
(\'' + img
Path + '/w
indow_resi
ze.gif\');
width: 12
px; height
: 12px;"><
/div></div
>';
|
|
|
422 |
|
else
|
|
|
423 |
|
html
+= '<div
id="' + id
+ '_resiz
e" class="
mceWindowR
esize"><im
g onmoused
own="paren
t.mcWindow
s.windows[
\'' + name
+ '\'].fo
cus();" bo
rder="0" s
rc="' + im
gPath + '/
window_res
ize.gif" /
></div>';
|
|
|
424 |
|
}
|
|
|
425 |
|
|
|
334 |
|
|
426 |
|
ht
ml += '</d
iv>';
|
|
335 |
|
function
startMove
() {
|
427 |
|
}
|
|
336 |
|
if (
eb)
|
|
|
337 |
|
return;
|
428 |
|
|
|
338 |
|
|
429 |
|
html +
= '</div>'
;
|
|
339 |
|
t._f
ixIELayout
(id, 0);
|
430 |
|
|
|
340 |
|
|
431 |
|
html +
= '</body>
';
|
|
341 |
|
// S
etup event
blocker
|
432 |
|
html +
= '</html>
';
|
|
342 |
|
DOM.
add(d.body
, 'div', {
|
|
|
343 |
|
id : 'mceE
ventBlocke
r',
|
|
|
344 |
|
'class' :
'mceEventB
locker ' +
(t.editor
.settings.
inlinepopu
ps_skin ||
'clearloo
ks2'),
|
|
|
345 |
|
style : {l
eft : vp.x
, top : vp
.y, width
: vp.w + 2
, height :
vp.h + 2,
zIndex :
20001}
|
|
|
346 |
|
});
|
|
|
347 |
|
eb =
new Eleme
nt('mceEve
ntBlocker'
);
|
|
|
348 |
|
eb.u
pdate();
|
433 |
|
|
|
349 |
|
|
434 |
|
// Cre
ate iframe
|
|
350 |
|
// S
etup place
holder
|
435 |
|
this.c
reateFloat
ingIFrame(
id, featur
es['left']
, features
['top'], f
eatures['w
idth'], fe
atures['he
ight'], ht
ml);
|
|
351 |
|
p =
we.getXY()
;
|
|
|
352 |
|
sz =
we.getSiz
e();
|
|
|
353 |
|
sx =
cp.x + p.
x - vp.x;
|
|
|
354 |
|
sy =
cp.y + p.
y - vp.y;
|
|
|
355 |
|
DOM.
add(eb.get
(), 'div',
{id : 'mc
ePlaceHold
er', 'clas
s' : 'mceP
laceHolder
', style :
{left : s
x, top : s
y, width :
sz.w, hei
ght : sz.h
}});
|
|
|
356 |
|
ph =
new Eleme
nt('mcePla
ceHolder')
;
|
436 |
|
};
|
|
357 |
|
};
|
437 |
|
|
|
358 |
|
|
438 |
|
// Blocks
the docume
nt events
by placing
a image o
ver the wh
ole docume
nt
|
|
359 |
|
// Handl
e mouse mo
ve/drag
|
439 |
|
TinyMCE_Wi
ndows.prot
otype.setD
ocumentLoc
k = functi
on(state)
{
|
|
360 |
|
mm = Eve
nt.add(d,
'mousemove
', functio
n(e) {
|
440 |
|
var el
m = docume
nt.getElem
entById('m
cWindowEve
ntBlocker'
);
|
|
361 |
|
var
x, y, v;
|
441 |
|
|
|
362 |
|
|
442 |
|
if
(
sta
t
e
)
{
|
|
363 |
|
sta
r
t
Mov
e
(
)
;
|
443 |
|
if
(elm == n
ull) {
|
|
|
444 |
|
elm = do
cument.cre
ateElement
("div");
|
|
|
445 |
|
|
|
364 |
|
|
446 |
|
elm.id =
"mcWindow
EventBlock
er";
|
|
365 |
|
x =
e.screenX
- sex;
|
447 |
|
elm.styl
e.position
= "absolu
te";
|
|
366 |
|
y =
e.screenY
- sey;
|
448 |
|
elm.styl
e.left = "
0";
|
|
|
449 |
|
elm.styl
e.top = "0
";
|
|
|
450 |
|
|
|
367 |
|
|
451 |
|
document
.body.appe
ndChild(el
m);
|
|
368 |
|
swit
ch (ac) {
|
452 |
|
}
|
|
369 |
|
case 'Resi
zeW':
|
453 |
|
|
|
370 |
|
dx = x;
|
454 |
|
el
m.style.di
splay = "n
one";
|
|
371 |
|
dw = 0
- x;
|
|
|
372 |
|
break;
|
455 |
|
|
|
373 |
|
|
456 |
|
va
r imgPath
= this.get
Param("ima
ges_path")
;
|
|
374 |
|
case 'Resi
zeE':
|
457 |
|
va
r width =
document.b
ody.client
Width;
|
|
375 |
|
dw = x
;
|
458 |
|
va
r height =
document.
body.clien
tHeight;
|
|
376 |
|
break;
|
459 |
|
|
|
377 |
|
|
460 |
|
el
m.style.wi
dth = widt
h;
|
|
378 |
|
case 'Resi
zeN':
|
461 |
|
el
m.style.he
ight = hei
ght;
|
|
379 |
|
case 'Resi
zeNW':
|
462 |
|
el
m.innerHTM
L = '<img
src="' + i
mgPath + '
/spacer.gi
f" width="
' + width
+ '" heigh
t="' + hei
ght + '" /
>';
|
|
380 |
|
case 'Resi
zeNE':
|
|
|
381 |
|
if (ac
== "Resiz
eNW") {
|
|
|
382 |
|
dx
= x;
|
|
|
383 |
|
dw
= 0 - x;
|
|
|
384 |
|
} else
if (ac ==
"ResizeNE
")
|
|
|
385 |
|
dw
= x;
|
463 |
|
|
|
386 |
|
|
464 |
|
el
m.style.zI
ndex = mcW
indows.zin
dex-1;
|
|
387 |
|
dy = y
;
|
465 |
|
el
m.style.di
splay = "b
lock";
|
|
388 |
|
dh = 0
- y;
|
466 |
|
} else
if (elm !
= null) {
|
|
389 |
|
break
;
|
467 |
|
if
(mcWindow
s.windows.
length ==
0)
|
|
|
468 |
|
elm.pare
ntNode.rem
oveChild(e
lm);
|
|
|
469 |
|
el
se
|
|
|
470 |
|
elm.styl
e.zIndex =
mcWindows
.zindex-1;
|
|
|
471 |
|
}
|
|
|
472 |
|
}
;
|
|
|
473 |
|
|
|
390 |
|
|
474 |
|
// Gets ca
lled when
wrapper if
rame is in
itialized
|
|
391 |
|
case 'Resi
zeS':
|
475 |
|
TinyMCE_Wi
ndows.prot
otype.onLo
ad = funct
ion(name)
{
|
|
392 |
|
case 'Resi
zeSW':
|
476 |
|
var wi
n = mcWind
ows.window
s[name];
|
|
393 |
|
case 'Resi
zeSE':
|
477 |
|
var id
= "mcWind
ow_" + nam
e;
|
|
394 |
|
if (ac
== "Resiz
eSW") {
|
478 |
|
var wr
apperIfram
e = window
.frames[id
+ "_ifram
e"].frames
[0];
|
|
395 |
|
dx
= x;
|
479 |
|
var wr
apperDoc =
window.fr
ames[id +
"_iframe"]
.document;
|
|
396 |
|
dw
= 0 - x;
|
480 |
|
var do
c = window
.frames[id
+ "_ifram
e"].docume
nt;
|
|
397 |
|
} else
if (ac ==
"ResizeSE
")
|
481 |
|
var wi
nDiv = doc
ument.getE
lementById
("mcWindow
_" + name
+ "_div");
|
|
398 |
|
dw
= x;
|
482 |
|
var re
alIframe =
window.fr
ames[id +
"_iframe"]
.frames[0]
;
|
|
|
483 |
|
|
|
399 |
|
|
484 |
|
// Set
window da
ta
|
|
400 |
|
dh = y
;
|
485 |
|
win.id
= "mcWind
ow_" + nam
e;
|
|
401 |
|
break;
|
486 |
|
win.wi
nElement =
winDiv;
|
|
|
487 |
|
win.bo
dyElement
= doc.getE
lementById
(id + '_bo
dy');
|
|
|
488 |
|
win.if
rameElemen
t = doc.ge
tElementBy
Id(id + '_
iframe');
|
|
|
489 |
|
win.he
adElement
= doc.getE
lementById
(id + '_he
ad');
|
|
|
490 |
|
win.ti
tleElement
= doc.get
ElementByI
d(id + '_t
itle');
|
|
|
491 |
|
win.re
sizeElemen
t = doc.ge
tElementBy
Id(id + '_
resize');
|
|
|
492 |
|
win.co
ntainerEle
ment = doc
.getElemen
tById(id +
'_contain
er');
|
|
|
493 |
|
win.le
ft = win.f
eatures['l
eft'];
|
|
|
494 |
|
win.to
p = win.fe
atures['to
p'];
|
|
|
495 |
|
win.fr
ame = wind
ow.frames[
id + '_ifr
ame'].fram
es[0];
|
|
|
496 |
|
win.wr
apperFrame
= window.
frames[id
+ '_iframe
'];
|
|
|
497 |
|
win.wr
apperIFram
eElement =
document.
getElement
ById(id +
"_iframe")
;
|
|
|
498 |
|
|
|
402 |
|
|
499 |
|
// Add
event han
dlers
|
|
403 |
|
case 'mceM
ove':
|
500 |
|
mcWind
ows.addEve
nt(win.hea
dElement,
"mousedown
", mcWindo
ws.eventDi
spatcher);
|
|
404 |
|
dx = x
;
|
|
|
405 |
|
dy = y
;
|
|
|
406 |
|
break;
|
|
|
407 |
|
}
|
501 |
|
|
|
408 |
|
|
502 |
|
if (wi
n.resizeEl
ement != n
ull)
|
|
409 |
|
// B
oundary ch
eck
|
503 |
|
mc
Windows.ad
dEvent(win
.resizeEle
ment, "mou
sedown", m
cWindows.e
ventDispat
cher);
|
|
410 |
|
if (
dw < (v =
w.features
.min_width
- sz.w))
{
|
|
|
411 |
|
if (dx !==
0)
|
|
|
412 |
|
dx +=
dw - v;
|
504 |
|
|
|
413 |
|
|
505 |
|
if (mc
Windows.is
MSIE) {
|
|
414 |
|
dw = v;
|
506 |
|
mc
Windows.ad
dEvent(rea
lIframe.do
cument, "m
ousemove",
mcWindows
.eventDisp
atcher);
|
|
|
507 |
|
mc
Windows.ad
dEvent(rea
lIframe.do
cument, "m
ouseup", m
cWindows.e
ventDispat
cher);
|
|
|
508 |
|
} else
{
|
|
|
509 |
|
mc
Windows.ad
dEvent(rea
lIframe, "
mousemove"
, mcWindow
s.eventDis
patcher);
|
|
|
510 |
|
mc
Windows.ad
dEvent(rea
lIframe, "
mouseup",
mcWindows.
eventDispa
tcher);
|
|
|
511 |
|
mc
Windows.ad
dEvent(rea
lIframe, "
focus", mc
Windows.ev
entDispatc
her);
|
|
|
512 |
|
}
|
|
415 |
|
}
|
513 |
|
|
|
416 |
|
|
514 |
|
for (v
ar i=0; i<
window.fra
mes.length
; i++) {
|
|
417 |
|
if (
dh < (v =
w.features
.min_heigh
t - sz.h))
{
|
515 |
|
if
(!window.
frames[i].
_hasMouseH
andlers) {
|
|
418 |
|
if (dy !==
0)
|
516 |
|
if (mcWi
ndows.isMS
IE) {
|
|
419 |
|
dy +=
dh - v;
|
517 |
|
mcWi
ndows.addE
vent(windo
w.frames[i
].document
, "mousemo
ve", mcWin
dows.event
Dispatcher
);
|
|
|
518 |
|
mcWi
ndows.addE
vent(windo
w.frames[i
].document
, "mouseup
", mcWindo
ws.eventDi
spatcher);
|
|
|
519 |
|
} else {
|
|
|
520 |
|
mcWi
ndows.addE
vent(windo
w.frames[i
], "mousem
ove", mcWi
ndows.even
tDispatche
r);
|
|
|
521 |
|
mcWi
ndows.addE
vent(windo
w.frames[i
], "mouseu
p", mcWind
ows.eventD
ispatcher)
;
|
|
|
522 |
|
}
|
|
|
523 |
|
|
|
420 |
|
|
524 |
|
window.f
rames[i]._
hasMouseHa
ndlers = t
rue;
|
|
421 |
|
dh = v;
|
525 |
|
}
|
|
|
526 |
|
}
|
|
422 |
|
}
|
527 |
|
|
|
423 |
|
|
528 |
|
if (mc
Windows.is
MSIE) {
|
|
424 |
|
dw =
Math.min(
dw, w.feat
ures.max_w
idth - sz.
w);
|
529 |
|
mc
Windows.ad
dEvent(win
.frame.doc
ument, "mo
usemove",
mcWindows.
eventDispa
tcher);
|
|
425 |
|
dh =
Math.min(
dh, w.feat
ures.max_h
eight - sz
.h);
|
530 |
|
mc
Windows.ad
dEvent(win
.frame.doc
ument, "mo
useup", mc
Windows.ev
entDispatc
her);
|
|
426 |
|
dx =
Math.max(
dx, vp.x -
(sx + vp.
x));
|
531 |
|
} else
{
|
|
427 |
|
dy =
Math.max(
dy, vp.y -
(sy + vp.
y));
|
532 |
|
mc
Windows.ad
dEvent(win
.frame, "m
ousemove",
mcWindows
.eventDisp
atcher);
|
|
428 |
|
dx =
Math.min(
dx, (vp.w
+ vp.x) -
(sx + sz.w
+ vp.x));
|
533 |
|
mc
Windows.ad
dEvent(win
.frame, "m
ouseup", m
cWindows.e
ventDispat
cher);
|
|
429 |
|
dy =
Math.min(
dy, (vp.h
+ vp.y) -
(sy + sz.h
+ vp.y));
|
534 |
|
mc
Windows.ad
dEvent(win
.frame, "f
ocus", mcW
indows.eve
ntDispatch
er);
|
|
|
535 |
|
}
|
|
|
536 |
|
|
|
430 |
|
|
537 |
|
// Dis
patch open
window ev
ent
|
|
431 |
|
// M
ove if nee
ded
|
538 |
|
var fu
nc = this.
getParam("
on_open_wi
ndow", "")
;
|
|
432 |
|
if (
dx + dy !=
= 0) {
|
539 |
|
if (fu
nc != "")
|
|
433 |
|
if (sx + d
x < 0)
|
540 |
|
ev
al(func +
"(win);");
|
|
434 |
|
dx = 0
;
|
541 |
|
|
|
435 |
|
|
542 |
|
win.fo
cus();
|
|
436 |
|
if (sy + d
y < 0)
|
|
|
437 |
|
dy = 0
;
|
543 |
|
|
|
438 |
|
|
544 |
|
if (wi
n.features
['modal']
== "yes")
|
|
439 |
|
ph.moveTo(
sx + dx, s
y + dy);
|
545 |
|
mc
Windows.se
tDocumentL
ock(true);
|
|
440 |
|
}
|
546 |
|
}
;
|
|
|
547 |
|
|
|
441 |
|
|
548 |
|
TinyMCE_Wi
ndows.prot
otype.crea
teFloating
IFrame = f
unction(id
_prefix, l
eft, top,
width, hei
ght, html)
{
|
|
442 |
|
// R
esize if n
eeded
|
549 |
|
var if
rame = doc
ument.crea
teElement(
"iframe");
|
|
443 |
|
if (
dw + dh !=
= 0)
|
550 |
|
var di
v = docume
nt.createE
lement("di
v"), doc;
|
|
444 |
|
ph.resizeT
o(sz.w + d
w, sz.h +
dh);
|
551 |
|
|
|
445 |
|
|
552 |
|
width
= parseInt
(width);
|
|
446 |
|
retu
rn Event.c
ancel(e);
|
553 |
|
height
= parseIn
t(height)+
1;
|
|
447 |
|
});
|
554 |
|
|
|
448 |
|
|
555 |
|
// Cre
ate wrappe
r div
|
|
449 |
|
return E
vent.cance
l(se);
|
556 |
|
div.se
tAttribute
("id", id_
prefix + "
_div");
|
|
450 |
|
},
|
557 |
|
div.se
tAttribute
("width",
width);
|
|
|
558 |
|
div.se
tAttribute
("height",
(height))
;
|
|
|
559 |
|
div.st
yle.positi
on = "abso
lute";
|
|
|
560 |
|
|
|
451 |
|
|
561 |
|
div.st
yle.left =
left + "p
x";
|
|
452 |
|
re
sizeBy : f
unction(dw
, dh, id)
{
|
562 |
|
div.st
yle.top =
top + "px"
;
|
|
453 |
|
var w =
this.windo
ws[id];
|
563 |
|
div.st
yle.width
= width +
"px";
|
|
|
564 |
|
div.st
yle.height
= (height
) + "px";
|
|
|
565 |
|
div.st
yle.backgr
oundColor
= "white";
|
|
|
566 |
|
div.st
yle.displa
y = "none"
;
|
|
|
567 |
|
|
|
454 |
|
|
568 |
|
if (
this.isGec
ko
) {
|
|
455 |
|
if (
w
) {
|
569 |
|
if
rameWidth
= width +
2;
|
|
456 |
|
w.el
ement.resi
zeBy(dw, d
h);
|
570 |
|
if
rameHeight
= height
+ 2;
|
|
457 |
|
w.if
rameElemen
t.resizeBy
(dw, dh);
|
571 |
|
} else
{
|
|
|
572 |
|
if
rameWidth
= width;
|
|
|
573 |
|
if
rameHeight
= height
+ 1;
|
|
|
574 |
|
}
|
|
458 |
|
}
|
|
|
459 |
|
},
|
575 |
|
|
|
460 |
|
|
576 |
|
// Cre
ate iframe
|
|
461 |
|
cl
ose : func
tion(win,
id) {
|
577 |
|
iframe
.setAttrib
ute("id",
id_prefix
+ "_iframe
");
|
|
462 |
|
var t =
this, w, d
= documen
t, ix = 0,
fw;
|
578 |
|
iframe
.setAttrib
ute("name"
, id_prefi
x + "_ifra
me");
|
|
|
579 |
|
iframe
.setAttrib
ute("borde
r", "0");
|
|
|
580 |
|
iframe
.setAttrib
ute("frame
Border", "
0");
|
|
|
581 |
|
iframe
.setAttrib
ute("margi
nWidth", "
0");
|
|
|
582 |
|
iframe
.setAttrib
ute("margi
nHeight",
"0");
|
|
|
583 |
|
iframe
.setAttrib
ute("leftM
argin", "0
");
|
|
|
584 |
|
iframe
.setAttrib
ute("topMa
rgin", "0"
);
|
|
|
585 |
|
iframe
.setAttrib
ute("width
", iframeW
idth);
|
|
|
586 |
|
iframe
.setAttrib
ute("heigh
t", iframe
Height);
|
|
|
587 |
|
// ifr
ame.setAtt
ribute("sr
c", "../js
cripts/tin
y_mce/blan
k.htm");
|
|
|
588 |
|
// ifr
ame.setAtt
ribute("al
lowtranspa
rency", "f
alse");
|
|
|
589 |
|
iframe
.setAttrib
ute("scrol
ling", "no
");
|
|
|
590 |
|
iframe
.style.wid
th = ifram
eWidth + "
px";
|
|
|
591 |
|
iframe
.style.hei
ght = ifra
meHeight +
"px";
|
|
|
592 |
|
iframe
.style.bac
kgroundCol
or = "whit
e";
|
|
|
593 |
|
div.ap
pendChild(
iframe);
|
|
|
594 |
|
|
|
463 |
|
|
595 |
|
docume
nt.body.ap
pendChild(
div);
|
|
464 |
|
t.count-
-;
|
596 |
|
|
|
465 |
|
|
597 |
|
// Fix
ed MSIE 5.
0 issue
|
|
466 |
|
if (t.co
unt == 0)
|
598 |
|
div.in
nerHTML =
div.innerH
TML;
|
|
467 |
|
DOM.
remove('mc
eModalBloc
ker');
|
599 |
|
|
|
468 |
|
|
600 |
|
if (th
is.isSafar
i) {
|
|
469 |
|
// Proba
bly not in
line
|
601 |
|
//
Give Safa
ri some ti
me to setu
p
|
|
470 |
|
if (!id
&& win) {
|
602 |
|
wi
ndow.setTi
meout(func
tion() {
|
|
471 |
|
t
.
p
ar
en
t
(
win
);
|
603 |
|
var doc
= window.f
rames[id_p
refix + '_
iframe'].d
ocument;
|
|
472 |
|
retu
rn;
|
604 |
|
doc.open
();
|
|
|
605 |
|
doc.writ
e(html);
|
|
|
606 |
|
doc.clos
e();
|
|
|
607 |
|
},
10);
|
|
|
608 |
|
} else
{
|
|
|
609 |
|
do
c = window
.frames[id
_prefix +
'_iframe']
.window.do
cument;
|
|
|
610 |
|
doc
.
o
p
en
(
);
|
|
|
611 |
|
do
c.write(ht
ml);
|
|
|
612 |
|
do
c.close();
|
|
|
613 |
|
}
|
|
473 |
|
}
|
614 |
|
|
|
474 |
|
|
615 |
|
div.st
yle.displa
y = "block
";
|
|
475 |
|
if
(
w
=
t.w
indows
[
i
d
]
)
{
|
616 |
|
|
|
476 |
|
t.on
Close.disp
atch(t);
|
617 |
|
return
div;
|
|
477 |
|
Even
t.remove(d
, 'mousedo
wn', w.mou
sedownFunc
);
|
618 |
|
};
|
|
478 |
|
Even
t.remove(d
, 'click',
w.clickFu
nc);
|
619 |
|
|
|
|
620 |
|
// Window
instance
|
|
|
621 |
|
function T
inyMCE_Win
dow() {
|
|
|
622 |
|
};
|
|
|
623 |
|
|
|
|
624 |
|
TinyMCE_Wi
ndow.proto
type.focus
= functio
n() {
|
|
|
625 |
|
if
(
this
!
=
mcW
indows
.selectedW
i
n
d
ow
)
{
|
|
|
626 |
|
th
is.winElem
ent.style.
zIndex = +
+mcWindows
.zindex;
|
|
|
627 |
|
mc
Windows.la
stSelected
Window = m
cWindows.s
electedWin
dow;
|
|
|
628 |
|
mc
Windows.se
lectedWind
ow = this;
|
|
|
629 |
|
}
|
|
|
630 |
|
};
|
|
|
631 |
|
|
|
479 |
|
|
632 |
|
TinyMCE_Wi
ndow.proto
type.minim
ize = func
tion() {
|
|
480 |
|
DOM.
setAttrib(
id + '_ifr
', 'src',
'javascrip
t:""'); //
Prevent l
eak
|
633 |
|
};
|
|
481 |
|
w.el
ement.remo
ve();
|
|
|
482 |
|
dele
te t.windo
ws[id];
|
634 |
|
|
|
483 |
|
|
635 |
|
TinyMCE_Wi
ndow.proto
type.maxim
ize = func
tion() {
|
|
484 |
|
// F
ind front
most windo
w and focu
s that
|
636 |
|
if (th
is.restore
Size) {
|
|
485 |
|
each
(t.window
s, functio
n(w) {
|
637 |
|
th
is.moveTo(
this.resto
reSize[0],
this.rest
oreSize[1]
);
|
|
486 |
|
if (w.zInd
ex > ix) {
|
638 |
|
th
is.resizeT
o(this.res
toreSize[2
], this.re
storeSize[
3]);
|
|
487 |
|
fw = w
;
|
639 |
|
th
is.updateC
lamping();
|
|
488 |
|
ix = w
.zIndex;
|
640 |
|
th
is.restore
Size = nul
l;
|
|
|
641 |
|
} else
{
|
|
|
642 |
|
va
r bounds =
mcWindows
.getBounds
();
|
|
|
643 |
|
th
is.restore
Size = [
|
|
|
644 |
|
this.lef
t, this.to
p,
|
|
|
645 |
|
this.win
Element.sc
rollWidth,
|
|
|
646 |
|
this.win
Element.sc
rollHeight
|
|
|
647 |
|
];
|
|
|
648 |
|
th
is.moveTo(
bounds[0],
bounds[1]
);
|
|
|
649 |
|
th
is.resizeT
o(
|
|
|
650 |
|
bounds[2
] - bounds
[0],
|
|
|
651 |
|
bounds[3
] - bounds
[1]
|
|
|
652 |
|
)
;
|
|
|
653 |
|
}
|
|
489 |
|
}
|
654 |
|
}
;
|
|
490 |
|
}
)
;
|
655 |
|
|
|
|
656 |
|
TinyMCE_Wi
ndow.proto
type.start
Resize = f
unction()
{
|
|
|
657 |
|
mcWind
ows.action
= "resize
";
|
|
|
658 |
|
};
|
|
|
659 |
|
|
|
|
660 |
|
TinyMCE_Wi
ndow.proto
type.start
Move = fun
ction(e) {
|
|
|
661 |
|
mcWind
ows.action
= "move";
|
|
|
662 |
|
};
|
|
|
663 |
|
|
|
|
664 |
|
TinyMCE_Wi
ndow.proto
type.close
= functio
n() {
|
|
|
665 |
|
if (th
is.frame &
& this.fra
me['tinyMC
EPopup'])
|
|
|
666 |
|
th
is.frame['
tinyMCEPop
up'].resto
reSelectio
n();
|
|
|
667 |
|
|
|
|
668 |
|
if (mc
Windows.la
stSelected
Window !=
null)
|
|
|
669 |
|
mc
Windows.la
stSelected
Window.foc
us();
|
|
|
670 |
|
|
|
|
671 |
|
var mc
WindowsNew
= new Arr
ay();
|
|
|
672 |
|
for (v
ar n in mc
Windows.wi
ndows) {
|
|
|
673 |
|
va
r win = mc
Windows.wi
ndows[n];
|
|
|
674 |
|
if
(typeof(w
in) == 'fu
nction')
|
|
|
675 |
|
continue
;
|
|
|
676 |
|
|
|
491 |
|
|
677 |
|
if
(win.name
!= this.n
ame)
|
|
492 |
|
if (
fw)
|
678 |
|
mcWindow
sNew[n] =
win;
|
|
493 |
|
t.focus(fw
.id);
|
679 |
|
}
|
|
494 |
|
}
|
|
|
495 |
|
},
|
680 |
|
|
|
496 |
|
|
681 |
|
mcWind
ows.window
s = mcWind
owsNew;
|
|
497 |
|
se
tTitle : f
unction(ti
, id) {
|
682 |
|
|
|
498 |
|
DOM.get(
id + '_tit
le').inner
HTML = DOM
.encode(ti
);
|
683 |
|
// ale
rt(mcWindo
ws.doc.get
ElementByI
d(this.id
+ "_iframe
"));
|
|
499 |
|
},
|
684 |
|
|
|
500 |
|
|
685 |
|
var e
= mcWindow
s.doc.getE
lementById
(this.id +
"_iframe"
);
|
|
501 |
|
al
ert : func
tion(txt,
cb, s) {
|
686 |
|
e.pare
ntNode.rem
oveChild(e
);
|
|
502 |
|
var t =
this, w;
|
687 |
|
|
|
503 |
|
|
688 |
|
var e
= mcWindow
s.doc.getE
lementById
(this.id +
"_div");
|
|
504 |
|
w = t.op
en({
|
689 |
|
e.pare
ntNode.rem
oveChild(e
);
|
|
505 |
|
titl
e : t,
|
|
|
506 |
|
type
: 'alert'
,
|
|
|
507 |
|
butt
on_func :
function(s
) {
|
|
|
508 |
|
if (cb)
|
|
|
509 |
|
cb.cal
l(s || t,
s);
|
690 |
|
|
|
510 |
|
|
691 |
|
mcWind
ows.setDoc
umentLock(
false);
|
|
511 |
|
t.close(nu
ll, w.id);
|
692 |
|
};
|
|
512 |
|
},
|
693 |
|
|
|
513 |
|
cont
ent : DOM.
encode(t.e
ditor.getL
ang(txt, t
xt)),
|
694 |
|
TinyMCE_Wi
ndow.proto
type.onMou
seMove = f
unction(e)
{
|
|
514 |
|
inli
ne : 1,
|
695 |
|
var cl
amp;
|
|
515 |
|
widt
h : 400,
|
696 |
|
// Cal
culate rea
l X, Y
|
|
516 |
|
heig
ht : 130
|
697 |
|
var dx
= e.scree
nX - mcWin
dows.mouse
DownScreen
X;
|
|
517 |
|
});
|
698 |
|
var dy
= e.scree
nY - mcWin
dows.mouse
DownScreen
Y;
|
|
518 |
|
},
|
699 |
|
|
|
|
700 |
|
switch
(mcWindow
s.action)
{
|
|
|
701 |
|
ca
se "resize
":
|
|
|
702 |
|
clamp =
mcWindows.
clampBoxSi
ze(
|
|
|
703 |
|
this
.left, thi
s.top,
|
|
|
704 |
|
mcWi
ndows.mous
eDownWidth
+ (e.scre
enX - mcWi
ndows.mous
eDownScree
nX),
|
|
|
705 |
|
mcWi
ndows.mous
eDownHeigh
t + (e.scr
eenY - mcW
indows.mou
seDownScre
enY),
|
|
|
706 |
|
this
.features.
minWidth,
this.featu
res.minHei
ght
|
|
|
707 |
|
);
|
|
|
708 |
|
|
|
519 |
|
|
709 |
|
this.res
izeTo(clam
p[2], clam
p[3]);
|
|
520 |
|
co
nfirm : fu
nction(txt
, cb, s) {
|
|
|
521 |
|
var t =
this, w;
|
710 |
|
|
|
522 |
|
|
711 |
|
mcWindow
s.cancelEv
ent(e);
|
|
523 |
|
w = t.op
en({
|
712 |
|
break;
|
|
524 |
|
titl
e : t,
|
|
|
525 |
|
type
: 'confir
m',
|
|
|
526 |
|
butt
on_func :
function(s
) {
|
|
|
527 |
|
if (cb)
|
|
|
528 |
|
cb.cal
l(s || t,
s);
|
713 |
|
|
|
529 |
|
|
714 |
|
ca
se "move":
|
|
530 |
|
t.close(nu
ll, w.id);
|
715 |
|
this.lef
t = mcWind
ows.mouseD
ownLayerX
+ (e.scree
nX - mcWin
dows.mouse
DownScreen
X);
|
|
531 |
|
},
|
716 |
|
this.top
= mcWindo
ws.mouseDo
wnLayerY +
(e.screen
Y - mcWind
ows.mouseD
ownScreenY
);
|
|
532 |
|
cont
ent : DOM.
encode(t.e
ditor.getL
ang(txt, t
xt)),
|
717 |
|
this.upd
ateClampin
g();
|
|
533 |
|
inli
ne : 1,
|
|
|
534 |
|
widt
h : 400,
|
|
|
535 |
|
heig
ht : 130
|
|
|
536 |
|
});
|
|
|
537 |
|
},
|
718 |
|
|
|
538 |
|
|
719 |
|
mcWindow
s.cancelEv
ent(e);
|
|
539 |
|
//
Internal
functions
|
720 |
|
break;
|
|
|
721 |
|
}
|
|
|
722 |
|
};
|
|
|
723 |
|
|
|
540 |
|
|
724 |
|
TinyMCE_Wi
ndow.proto
type.moveT
o = functi
on (x, y)
{
|
|
541 |
|
_f
ixIELayout
: functio
n(id, s) {
|
725 |
|
this.l
eft = x;
|
|
542 |
|
var w, i
mg;
|
726 |
|
this.t
op = y;
|
|
|
727 |
|
|
|
543 |
|
|
728 |
|
this.w
inElement.
style.left
= this.le
ft + "px";
|
|
544 |
|
if (!tin
ymce.isIE6
)
|
729 |
|
this.w
inElement.
style.top
= this.top
+ "px";
|
|
545 |
|
retu
rn;
|
730 |
|
};
|
|
|
731 |
|
|
|
546 |
|
|
732 |
|
TinyMCE_Wi
ndow.proto
type.resiz
eTo = func
tion (widt
h, height)
{
|
|
547 |
|
// Fixes
the bug w
here hover
flickers
and does o
dd things
in IE6
|
733 |
|
this.w
rapperIFra
meElement.
style.widt
h = (width
+2) + 'px'
;
|
|
548 |
|
each(['n
','s','w',
'e','nw','
ne','sw','
se'], func
tion(v) {
|
734 |
|
this.w
rapperIFra
meElement.
style.heig
ht = (heig
ht+2) + 'p
x';
|
|
549 |
|
var
e = DOM.ge
t(id + '_r
esize_' +
v);
|
735 |
|
this.w
rapperIFra
meElement.
width = wi
dth+2;
|
|
|
736 |
|
this.w
rapperIFra
meElement.
height = h
eight+2;
|
|
|
737 |
|
this.w
inElement.
style.widt
h = width
+ 'px';
|
|
|
738 |
|
this.w
inElement.
style.heig
ht = heigh
t + 'px';
|
|
|
739 |
|
|
|
550 |
|
|
740 |
|
height
=
height
-
thi
s
.d
e
l
t
a
Height
;
|
|
551 |
|
DOM.
setStyles(
e, {
|
|
|
552 |
|
width : s
? e.client
Width : ''
,
|
|
|
553 |
|
height
:
s
?
e
.c
l
ien
t
Height
:
'',
|
|
|
554 |
|
cursor : D
OM.getStyl
e(e, 'curs
or', 1)
|
|
|
555 |
|
});
|
741 |
|
|
|
556 |
|
|
742 |
|
this.c
ontainerEl
ement.styl
e.width =
width + 'p
x';
|
|
557 |
|
DOM.
setStyle(i
d + "_bott
om", 'bott
om', '-1px
');
|
743 |
|
this.i
frameEleme
nt.style.w
idth = wid
th + 'px';
|
|
|
744 |
|
this.i
frameEleme
nt.style.h
eight = he
ight + 'px
';
|
|
|
745 |
|
this.b
odyElement
.style.wid
th = width
+ 'px';
|
|
|
746 |
|
this.b
odyElement
.style.hei
ght = heig
ht + 'px';
|
|
|
747 |
|
this.h
eadElement
.style.wid
th = width
+ 'px';
|
|
|
748 |
|
//this
.statusEle
ment.style
.width = w
idth + 'px
';
|
|
|
749 |
|
};
|
|
|
750 |
|
|
|
558 |
|
|
751 |
|
TinyMCE_Wi
ndow.proto
type.updat
eClamping
= function
() {
|
|
559 |
|
e =
0;
|
752 |
|
var cl
amp, overs
ize;
|
|
560 |
|
});
|
753 |
|
|
|
561 |
|
|
754 |
|
clamp
= mcWindow
s.clampBox
Position(
|
|
562 |
|
// Fixes
graphics
glitch
|
755 |
|
th
is.left, t
his.top,
|
|
563 |
|
if (w =
this.windo
ws[id]) {
|
756 |
|
th
is.winElem
ent.scroll
Width,
|
|
564 |
|
// F
ixes rende
ring bug a
fter resiz
e
|
757 |
|
th
is.winElem
ent.scroll
Height,
|
|
565 |
|
w.el
ement.hide
();
|
758 |
|
th
is.feature
s.minWidth
, this.fea
tures.minH
eight
|
|
566 |
|
w.el
ement.show
();
|
759 |
|
);
|
|
|
760 |
|
oversi
ze = (
|
|
|
761 |
|
cl
amp[2] !=
this.winEl
ement.scro
llWidth ||
|
|
|
762 |
|
cl
amp[3] !=
this.winEl
ement.scro
llHeight
|
|
|
763 |
|
) ? tr
ue : false
;
|
|
|
764 |
|
|
|
567 |
|
|
765 |
|
this.m
oveTo(clam
p[0], clam
p[1]);
|
|
568 |
|
// F
orced a re
paint of t
he window
|
766 |
|
if (th
is.feature
s.resizabl
e == "yes"
&& oversi
ze)
|
|
569 |
|
//DO
M.get(id).
style.filt
er = '';
|
767 |
|
th
is.resizeT
o(clamp[2]
, clamp[3]
);
|
|
|
768 |
|
};
|
|
|
769 |
|
|
|
570 |
|
|
770 |
|
function d
ebug(msg)
{
|
|
571 |
|
// I
E has a bu
g where im
ages used
in CSS won
't get loa
ded
|
771 |
|
docume
nt.getElem
entById('d
ebug').val
ue += msg
+ "\n";
|
|
572 |
|
// s
ometimes w
hen the ca
che in the
browser i
s disabled
|
|
|
573 |
|
// T
his fix tr
ies to sol
ve it by l
oading the
images us
ing the im
age object
|
|
|
574 |
|
each
(DOM.selec
t('div,a',
id), func
tion(e, i)
{
|
|
|
575 |
|
if (e.curr
entStyle.b
ackgroundI
mage != 'n
one') {
|
|
|
576 |
|
img =
new Image(
);
|
|
|
577 |
|
img.sr
c = e.curr
entStyle.b
ackgroundI
mage.repla
ce(/url\(\
"(.+)\"\)/
, '$1');
|
772 |
|
}
|
|
578 |
|
}
|
|
|
579 |
|
});
|
773 |
|
|
|
580 |
|
|
774 |
|
TinyMCE_Wi
ndow.proto
type.onMou
seUp = fun
ction(e) {
|
|
581 |
|
DOM.
get(id).st
yle.filter
= '';
|
775 |
|
mcWind
ows.action
= "none";
|
|
|
776 |
|
};
|
|
|
777 |
|
|
|
|
778 |
|
TinyMCE_Wi
ndow.proto
type.onFoc
us = funct
ion(e) {
|
|
|
779 |
|
// Gec
ko only ha
ndler
|
|
|
780 |
|
var wi
nRef = e.c
urrentTarg
et;
|
|
|
781 |
|
|
|
|
782 |
|
for (v
ar n in mc
Windows.wi
ndows) {
|
|
|
783 |
|
va
r win = mc
Windows.wi
ndows[n];
|
|
|
784 |
|
if
(typeof(w
in) == 'fu
nction')
|
|
|
785 |
|
continue
;
|
|
|
786 |
|
|
|
|
787 |
|
if
(winRef.n
ame == win
.id + "_if
rame") {
|
|
|
788 |
|
win.focu
s();
|
|
|
789 |
|
return;
|
|
|
790 |
|
}
|
|
582 |
|
}
|
791 |
|
}
|
|
583 |
|
}
|
792 |
|
}
;
|
|
584 |
|
}
)
;
|
793 |
|
|
|
|
794 |
|
TinyMCE_Wi
ndow.proto
type.onMou
seDown = f
unction(e)
{
|
|
|
795 |
|
var el
m = mcWind
ows.isMSIE
? this.wr
apperFrame
.event.src
Element :
e.target;
|
|
|
796 |
|
|
|
|
797 |
|
mcWind
ows.mouseD
ownScreenX
= e.scree
nX;
|
|
|
798 |
|
mcWind
ows.mouseD
ownScreenY
= e.scree
nY;
|
|
|
799 |
|
mcWind
ows.mouseD
ownLayerX
= this.lef
t;
|
|
|
800 |
|
mcWind
ows.mouseD
ownLayerY
= this.top
;
|
|
|
801 |
|
mcWind
ows.mouseD
ownWidth =
parseInt(
this.winEl
ement.styl
e.width);
|
|
|
802 |
|
mcWind
ows.mouseD
ownHeight
= parseInt
(this.winE
lement.sty
le.height)
;
|
|
|
803 |
|
|
|
|
804 |
|
if (th
is.resizeE
lement !=
null && el
m == this.
resizeElem
ent.firstC
hild)
|
|
|
805 |
|
th
is.startRe
size(e);
|
|
|
806 |
|
else
|
|
|
807 |
|
th
is.startMo
ve(e);
|
|
|
808 |
|
|
|
|
809 |
|
mcWind
ows.cancel
Event(e);
|
|
|
810 |
|
};
|
|
|
811 |
|
|
|
585 |
|
|
812 |
|
// Global
instance
|
|
586 |
|
// Reg
ister plug
in
|
813 |
|
var mcWind
ows = new
TinyMCE_Wi
ndows();
|
|
587 |
|
tinymc
e.PluginMa
nager.add(
'inlinepop
ups', tiny
mce.plugin
s.InlinePo
pups);
|
|
|
588 |
|
})();
|
814 |
|
|
|
589 |
|
|
815 |
|
// Initial
ize window
s
|
|
|
816 |
|
mcWindows.
init({
|
|
|
817 |
|
images
_path : ti
nyMCE.base
URL + "/pl
ugins/inli
nepopups/i
mages",
|
|
|
818 |
|
css_fi
le : tinyM
CE.baseURL
+ "/plugi
ns/inlinep
opups/css/
inlinepopu
p.css"
|
|
|
819 |
|
});
|
|
|