No regular expressions were active.
1 |
|
/**
|
|
1 |
|
/**
|
2 |
|
*
Orca Inter
active For
um Script
|
|
2 |
|
*
O
rca Intera
ctive Foru
m Script
|
3 |
|
*
--------
-------
|
|
3 |
|
*
---------
------
|
4 |
|
* Sta
rted
: Mon
Mar 23 200
6
|
|
4 |
|
* Star
ted
: Mo
n Mar 23 2
006
|
5 |
|
* Cop
yright
: (C)
2007 BoonE
x Group
|
|
5 |
|
* Copy
right
: (C
) 2007 Boo
nEx Group
|
6 |
|
* Web
site
: http
://www.boo
nex.com
|
|
6 |
|
* Webs
ite
: ht
tp://www.b
oonex.com
|
7 |
|
* This fi
le is part
of Orca -
Interacti
ve Forum S
cript
|
|
7 |
|
* This fil
e is part
of Orca -
Interactiv
e Forum Sc
ript
|
8 |
|
* GPL
|
|
8 |
|
* Creative
Commons A
ttribution
3.0 Licen
se
|
9 |
|
**/
|
|
9 |
|
**/
|
10 |
|
|
|
10 |
|
|
11 |
|
|
|
11 |
|
|
12 |
|
/**
|
|
12 |
|
/**
|
13 |
|
* html ed
itor
|
|
13 |
|
* html ed
itor
|
14 |
|
*/
|
|
14 |
|
*/
|
15 |
|
|
|
15 |
|
|
16 |
|
BxEditor =
function
(i)
|
|
16 |
|
BxEditor =
function
(i)
|
17 |
|
{
|
|
17 |
|
{
|
18 |
|
// thi
s._el
|
|
18 |
|
// thi
s._el
|
19 |
|
// thi
s._moz
|
|
19 |
|
// thi
s._moz
|
20 |
|
// thi
s._doc
|
|
20 |
|
// thi
s._doc
|
21 |
|
this._
name = i;
|
|
21 |
|
this._
name = i;
|
22 |
|
}
|
|
22 |
|
}
|
23 |
|
|
|
23 |
|
|
24 |
|
BxEditor.p
rototype.s
etName = f
unction (i
)
|
|
24 |
|
BxEditor.p
rototype.s
etName = f
unction (i
)
|
25 |
|
{
|
|
25 |
|
{
|
26 |
|
this._
name = i;
|
|
26 |
|
this._
name = i;
|
27 |
|
}
|
|
27 |
|
}
|
28 |
|
|
|
28 |
|
|
29 |
|
BxEditor.p
rototype.i
nit = func
tion ()
|
|
29 |
|
BxEditor.p
rototype.i
nit = func
tion ()
|
30 |
|
{
|
|
30 |
|
{
|
31 |
|
this._
el = docum
ent.getEle
mentById (
this._name
);
|
|
31 |
|
this._
el = docum
ent.getEle
mentById (
this._name
);
|
32 |
|
if (!t
his._el.co
ntentDocum
ent)
|
|
32 |
|
if (!t
his._el.co
ntentDocum
ent)
|
33 |
|
{
|
|
33 |
|
{
|
34 |
|
th
is._el = w
indow[this
._name];
|
|
34 |
|
th
is._el = w
indow[this
._name];
|
35 |
|
}
|
|
35 |
|
}
|
36 |
|
|
|
36 |
|
|
37 |
|
this._
doc = this
._el.docum
ent ? this
._el.docum
ent : this
._el.conte
ntDocument
;
|
|
37 |
|
this._
doc = this
._el.docum
ent ? this
._el.docum
ent : this
._el.conte
ntDocument
;
|
38 |
|
|
|
38 |
|
|
39 |
|
if (!t
his._doc.d
esignMode)
|
|
39 |
|
if (!t
his._doc.d
esignMode)
|
40 |
|
{
|
|
40 |
|
{
|
41 |
|
alert('
please
upgrade
your
browser
');
|
|
41 |
|
alert('
[L[
please
upgrade
your
browser
]]
');
|
42 |
|
re
turn;
|
|
42 |
|
re
turn;
|
43 |
|
}
|
|
43 |
|
}
|
44 |
|
|
|
44 |
|
|
45 |
|
this._
doc.design
Mode = 'on
';
|
|
45 |
|
this._
doc.design
Mode = 'on
';
|
46 |
|
|
|
46 |
|
|
47 |
|
}
|
|
47 |
|
}
|
48 |
|
|
|
48 |
|
|
49 |
|
|
|
49 |
|
|
50 |
|
BxEditor.p
rototype.i
nitMenu =
function (
)
|
|
50 |
|
BxEditor.p
rototype.i
nitMenu =
function (
)
|
51 |
|
{
|
|
51 |
|
{
|
52 |
|
var a
= {
|
|
52 |
|
var a
= {
|
53 |
|
0:{'
left':0, '
make':'Bol
d'},
|
|
53 |
|
0:{'
left':0, '
make':'Bol
d'},
|
54 |
|
1:{'
left':-18,
'make':'I
talic'},
|
|
54 |
|
1:{'
left':-18,
'make':'I
talic'},
|
55 |
|
2:{'
left':-36,
'make':'U
nderline'}
,
|
|
55 |
|
2:{'
left':-36,
'make':'U
nderline'}
,
|
56 |
|
3:{'
left':-216
, 'make':'
Code'},
|
|
56 |
|
3:{'
left':-216
, 'make':'
Code'},
|
57 |
|
4:{'
left':-162
, 'make':'
BulletedLi
st'},
|
|
57 |
|
4:{'
left':-162
, 'make':'
BulletedLi
st'},
|
58 |
|
5:{'
left':-144
, 'make':'
NumberedLi
st'},
|
|
58 |
|
5:{'
left':-144
, 'make':'
NumberedLi
st'},
|
59 |
|
6:{'
left':-180
, 'make':'
Outdent'},
|
|
59 |
|
6:{'
left':-180
, 'make':'
Outdent'},
|
60 |
|
7:{'
left':-198
, 'make':'
Indent'},
|
|
60 |
|
7:{'
left':-198
, 'make':'
Indent'},
|
61 |
|
8:{'
left':-288
, 'make':'
RemoveForm
at'}
|
|
61 |
|
8:{'
left':-288
, 'make':'
RemoveForm
at'}
|
62 |
|
}
|
|
62 |
|
}
|
63 |
|
var le
n = 9;
|
|
63 |
|
var le
n = 9;
|
64 |
|
var ul
= documen
t.createEl
ement ('ul
');
|
|
64 |
|
var ul
= documen
t.createEl
ement ('ul
');
|
65 |
|
var im
g = docume
nt.createE
lement ('i
mg');
|
|
65 |
|
var im
g = docume
nt.createE
lement ('i
mg');
|
66 |
|
var $t
his = this
;
|
|
66 |
|
var $t
his = this
;
|
67 |
|
|
|
67 |
|
|
68 |
|
|
|
68 |
|
|
69 |
|
img.sr
c = "sp.gi
f";
|
|
69 |
|
img.sr
c = "sp.gi
f";
|
70 |
|
img.st
yle.width
= '18px';
|
|
70 |
|
img.st
yle.width
= '18px';
|
71 |
|
img.st
yle.height
= '18px';
|
|
71 |
|
img.st
yle.height
= '18px';
|
72 |
|
img.st
yle.border
= 'none';
|
|
72 |
|
img.st
yle.border
= 'none';
|
73 |
|
|
|
73 |
|
|
74 |
|
ul.sty
le.listSty
le = 'none
';
|
|
74 |
|
ul.sty
le.listSty
le = 'none
';
|
75 |
|
ul.sty
le.margin
= '0';
|
|
75 |
|
ul.sty
le.margin
= '0';
|
76 |
|
ul.sty
le.marginT
op = '5px'
;
|
|
76 |
|
ul.sty
le.marginT
op = '5px'
;
|
77 |
|
ul.sty
le.marginB
ottom = '5
px';
|
|
77 |
|
ul.sty
le.marginB
ottom = '5
px';
|
78 |
|
ul.sty
le.padding
= '0';
|
|
78 |
|
ul.sty
le.padding
= '0';
|
79 |
|
ul.sty
le.clear =
'both';
|
|
79 |
|
ul.sty
le.clear =
'both';
|
80 |
|
ul.sty
le.height
= '20px';
|
|
80 |
|
ul.sty
le.height
= '20px';
|
81 |
|
ul.sty
le.width =
(len*20)
+ 'px';
|
|
81 |
|
ul.sty
le.width =
(len*20)
+ 'px';
|
82 |
|
ul.sty
le.backgro
undColor =
'#999999'
;
|
|
82 |
|
ul.sty
le.backgro
undColor =
'#999999'
;
|
83 |
|
ul.sty
le.overflo
w = 'hidde
n';
|
|
83 |
|
ul.sty
le.overflo
w = 'hidde
n';
|
84 |
|
|
|
84 |
|
|
85 |
|
for (v
ar r in a)
|
|
85 |
|
for (v
ar r in a)
|
86 |
|
{
|
|
86 |
|
{
|
87 |
|
va
r li = doc
ument.crea
teElement(
'li');
|
|
87 |
|
va
r li = doc
ument.crea
teElement(
'li');
|
88 |
|
va
r img2 = i
mg.cloneNo
de(false);
|
|
88 |
|
va
r img2 = i
mg.cloneNo
de(false);
|
89 |
|
li
._func = a
[r].make;
|
|
89 |
|
li
._func = a
[r].make;
|
90 |
|
|
|
90 |
|
|
91 |
|
li
.style.wid
th = '18px
';
|
|
91 |
|
li
.style.wid
th = '18px
';
|
92 |
|
li
.style.hei
ght = '18p
x';
|
|
92 |
|
li
.style.hei
ght = '18p
x';
|
93 |
|
li
.style.bor
der = '1px
solid #99
9999';
|
|
93 |
|
li
.style.bor
der = '1px
solid #99
9999';
|
94 |
|
li
.style.bac
kgroundIma
ge = 'url(
toolbar.gi
f)';
|
|
94 |
|
li
.style.bac
kgroundIma
ge = 'url(
toolbar.gi
f)';
|
95 |
|
li
.style.bac
kgroundPos
ition = a[
r].left +
'px 0px';
|
|
95 |
|
li
.style.bac
kgroundPos
ition = a[
r].left +
'px 0px';
|
96 |
|
li
.style.ove
rflow = 'h
idden';
|
|
96 |
|
li
.style.ove
rflow = 'h
idden';
|
97 |
|
li
.style.sty
leFloat =
'left';
|
|
97 |
|
li
.style.sty
leFloat =
'left';
|
98 |
|
li
.style.css
Float = 'l
eft';
|
|
98 |
|
li
.style.css
Float = 'l
eft';
|
99 |
|
li
.title = a
[r].make;
|
|
99 |
|
li
.title = a
[r].make;
|
100 |
|
|
|
100 |
|
|
101 |
|
li
.onmouseov
er = funct
ion () { t
his.style.
border = '
1px solid
#ffffff';
}
|
|
101 |
|
li
.onmouseov
er = funct
ion () { t
his.style.
border = '
1px solid
#ffffff';
}
|
102 |
|
li
.onmouseou
t = functi
on () { t
his.style.
border = '
1px solid
#999999';
this.style
.backgroun
dColor = '
transparen
t'; }
|
|
102 |
|
li
.onmouseou
t = functi
on () { t
his.style.
border = '
1px solid
#999999';
this.style
.backgroun
dColor = '
transparen
t'; }
|
103 |
|
li
.onmousedo
wn = funct
ion () { t
his.style.
background
Color = '#
bbbbbb'; }
|
|
103 |
|
li
.onmousedo
wn = funct
ion () { t
his.style.
background
Color = '#
bbbbbb'; }
|
104 |
|
li
.onmouseup
= functio
n () { t
his.style.
background
Color = 't
ransparent
'; }
|
|
104 |
|
li
.onmouseup
= functio
n () { t
his.style.
background
Color = 't
ransparent
'; }
|
105 |
|
li
.onclick =
function
() { eval
('$this.ma
ke' + this
._func + '
()'); }
|
|
105 |
|
li
.onclick =
function
() { eval
('$this.ma
ke' + this
._func + '
()'); }
|
106 |
|
|
|
106 |
|
|
107 |
|
li
.appendChi
ld (img2);
|
|
107 |
|
li
.appendChi
ld (img2);
|
108 |
|
|
|
108 |
|
|
109 |
|
ul
.appendChi
ld(li);
|
|
109 |
|
ul
.appendChi
ld(li);
|
110 |
|
}
|
|
110 |
|
}
|
111 |
|
|
|
111 |
|
|
112 |
|
if (th
is._el.fra
meElement)
|
|
112 |
|
if (th
is._el.fra
meElement)
|
113 |
|
th
is._el.fra
meElement.
parentNode
.insertBef
ore (ul, t
his._el.fr
ameElement
);
|
|
113 |
|
th
is._el.fra
meElement.
parentNode
.insertBef
ore (ul, t
his._el.fr
ameElement
);
|
114 |
|
else
|
|
114 |
|
else
|
115 |
|
th
is._el.par
entNode.in
sertBefore
(ul, this
._el);
|
|
115 |
|
th
is._el.par
entNode.in
sertBefore
(ul, this
._el);
|
116 |
|
}
|
|
116 |
|
}
|
117 |
|
|
|
117 |
|
|
118 |
|
|
|
118 |
|
|
119 |
|
BxEditor.p
rototype.m
akeBold =
function (
)
|
|
119 |
|
BxEditor.p
rototype.m
akeBold =
function (
)
|
120 |
|
{
|
|
120 |
|
{
|
121 |
|
this._
el.focus()
;
|
|
121 |
|
this._
el.focus()
;
|
122 |
|
this._
doc.execCo
mmand('bol
d', false,
null);
|
|
122 |
|
this._
doc.execCo
mmand('bol
d', false,
null);
|
123 |
|
}
|
|
123 |
|
}
|
124 |
|
|
|
124 |
|
|
125 |
|
BxEditor.p
rototype.m
akeItalic
= function
()
|
|
125 |
|
BxEditor.p
rototype.m
akeItalic
= function
()
|
126 |
|
{
|
|
126 |
|
{
|
127 |
|
this._
el.focus()
;
|
|
127 |
|
this._
el.focus()
;
|
128 |
|
this._
doc.execCo
mmand('ita
lic', fals
e, null);
|
|
128 |
|
this._
doc.execCo
mmand('ita
lic', fals
e, null);
|
129 |
|
}
|
|
129 |
|
}
|
130 |
|
|
|
130 |
|
|
131 |
|
BxEditor.p
rototype.m
akeUnderli
ne = funct
ion ()
|
|
131 |
|
BxEditor.p
rototype.m
akeUnderli
ne = funct
ion ()
|
132 |
|
{
|
|
132 |
|
{
|
133 |
|
this._
el.focus()
;
|
|
133 |
|
this._
el.focus()
;
|
134 |
|
this._
doc.execCo
mmand('und
erline', f
alse, null
);
|
|
134 |
|
this._
doc.execCo
mmand('und
erline', f
alse, null
);
|
135 |
|
}
|
|
135 |
|
}
|
136 |
|
|
|
136 |
|
|
137 |
|
BxEditor.p
rototype.m
akeBullete
dList = fu
nction ()
|
|
137 |
|
BxEditor.p
rototype.m
akeBullete
dList = fu
nction ()
|
138 |
|
{
|
|
138 |
|
{
|
139 |
|
this._
el.focus()
;
|
|
139 |
|
this._
el.focus()
;
|
140 |
|
this._
doc.execCo
mmand('Ins
ertUnorder
edList', f
alse, null
);
|
|
140 |
|
this._
doc.execCo
mmand('Ins
ertUnorder
edList', f
alse, null
);
|
141 |
|
}
|
|
141 |
|
}
|
142 |
|
|
|
142 |
|
|
143 |
|
BxEditor.p
rototype.m
akeNumbere
dList = fu
nction ()
|
|
143 |
|
BxEditor.p
rototype.m
akeNumbere
dList = fu
nction ()
|
144 |
|
{
|
|
144 |
|
{
|
145 |
|
this._
el.focus()
;
|
|
145 |
|
this._
el.focus()
;
|
146 |
|
this._
doc.execCo
mmand('Ins
ertOrdered
List', fal
se, null);
|
|
146 |
|
this._
doc.execCo
mmand('Ins
ertOrdered
List', fal
se, null);
|
147 |
|
}
|
|
147 |
|
}
|
148 |
|
|
|
148 |
|
|
149 |
|
BxEditor.p
rototype.m
akeOutdent
= functio
n ()
|
|
149 |
|
BxEditor.p
rototype.m
akeOutdent
= functio
n ()
|
150 |
|
{
|
|
150 |
|
{
|
151 |
|
this._
el.focus()
;
|
|
151 |
|
this._
el.focus()
;
|
152 |
|
this._
doc.execCo
mmand('out
dent', fal
se, null);
|
|
152 |
|
this._
doc.execCo
mmand('out
dent', fal
se, null);
|
153 |
|
}
|
|
153 |
|
}
|
154 |
|
|
|
154 |
|
|
155 |
|
BxEditor.p
rototype.m
akeIndent
= function
()
|
|
155 |
|
BxEditor.p
rototype.m
akeIndent
= function
()
|
156 |
|
{
|
|
156 |
|
{
|
157 |
|
this._
el.focus()
;
|
|
157 |
|
this._
el.focus()
;
|
158 |
|
this._
doc.execCo
mmand('ind
ent', fals
e, null);
|
|
158 |
|
this._
doc.execCo
mmand('ind
ent', fals
e, null);
|
159 |
|
}
|
|
159 |
|
}
|
160 |
|
|
|
160 |
|
|
161 |
|
|
|
161 |
|
|
162 |
|
BxEditor.p
rototype.m
akeRemoveF
ormat = fu
nction ()
|
|
162 |
|
BxEditor.p
rototype.m
akeRemoveF
ormat = fu
nction ()
|
163 |
|
{
|
|
163 |
|
{
|
164 |
|
this._
el.focus()
;
|
|
164 |
|
this._
el.focus()
;
|
165 |
|
// this._
clean_node
s(this._ge
t_selected
_tags(this
._el.conte
ntWindow,
'pre'), 'c
ode')
|
|
165 |
|
// this._
clean_node
s(this._ge
t_selected
_tags(this
._el.conte
ntWindow,
'pre'), 'c
ode')
|
166 |
|
this._
doc.execCo
mmand('Rem
oveFormat'
, false, t
rue);
|
|
166 |
|
this._
doc.execCo
mmand('Rem
oveFormat'
, false, t
rue);
|
167 |
|
}
|
|
167 |
|
}
|
168 |
|
|
|
168 |
|
|
169 |
|
BxEditor.p
rototype.m
akeCode =
function (
)
|
|
169 |
|
BxEditor.p
rototype.m
akeCode =
function (
)
|
170 |
|
{
|
|
170 |
|
{
|
171 |
|
var r
= this._do
c.execComm
and('Forma
tBlock', f
alse, 'blo
ckquote');
|
|
171 |
|
var r
= this._do
c.execComm
and('Forma
tBlock', f
alse, 'blo
ckquote');
|
172 |
|
if (!r
)
|
|
172 |
|
if (!r
)
|
173 |
|
{
|
|
173 |
|
{
|
174 |
|
th
is._doc.ex
ecCommand(
'FormatBlo
ck', false
, 'Definit
ion');
|
|
174 |
|
th
is._doc.ex
ecCommand(
'FormatBlo
ck', false
, 'Definit
ion');
|
175 |
|
th
is._format
_pre_ie();
|
|
175 |
|
th
is._format
_pre_ie();
|
176 |
|
}
|
|
176 |
|
}
|
177 |
|
else
|
|
177 |
|
else
|
178 |
|
{
|
|
178 |
|
{
|
179 |
|
th
is._format
_pre_moz (
);
|
|
179 |
|
th
is._format
_pre_moz (
);
|
180 |
|
}
|
|
180 |
|
}
|
181 |
|
this._
el.focus()
;
|
|
181 |
|
this._
el.focus()
;
|
182 |
|
}
|
|
182 |
|
}
|
183 |
|
|
|
183 |
|
|
184 |
|
|
|
184 |
|
|
185 |
|
/*
|
|
185 |
|
/*
|
186 |
|
Formatted
= pre
|
|
186 |
|
Formatted
= pre
|
187 |
|
Address =
address
|
|
187 |
|
Address =
address
|
188 |
|
Heading 1
= h1
|
|
188 |
|
Heading 1
= h1
|
189 |
|
Heading 6
= h6
|
|
189 |
|
Heading 6
= h6
|
190 |
|
Numbered L
ist = ol l
i
|
|
190 |
|
Numbered L
ist = ol l
i
|
191 |
|
Bulleted L
ist = ul l
i
|
|
191 |
|
Bulleted L
ist = ul l
i
|
192 |
|
Directory
List = dir
li
|
|
192 |
|
Directory
List = dir
li
|
193 |
|
Menu List
= menu li
|
|
193 |
|
Menu List
= menu li
|
194 |
|
Definition
Term = dl
dt
|
|
194 |
|
Definition
Term = dl
dt
|
195 |
|
Definition
= dl dd
|
|
195 |
|
Definition
= dl dd
|
196 |
|
|
|
196 |
|
|
197 |
|
*/
|
|
197 |
|
*/
|
198 |
|
|
|
198 |
|
|
199 |
|
BxEditor.p
rototype.m
akeFont =
function (
)
|
|
199 |
|
BxEditor.p
rototype.m
akeFont =
function (
)
|
200 |
|
{
|
|
200 |
|
{
|
201 |
|
this._
el.focus()
;
|
|
201 |
|
this._
el.focus()
;
|
202 |
|
this._
doc.execCo
mmand('Fon
tName', fa
lse, 'Aria
l');
|
|
202 |
|
this._
doc.execCo
mmand('Fon
tName', fa
lse, 'Aria
l');
|
203 |
|
}
|
|
203 |
|
}
|
204 |
|
|
|
204 |
|
|
205 |
|
BxEditor.p
rototype.m
akeHeading
= functio
n (h)
|
|
205 |
|
BxEditor.p
rototype.m
akeHeading
= functio
n (h)
|
206 |
|
{
|
|
206 |
|
{
|
207 |
|
this._
el.focus()
;
|
|
207 |
|
this._
el.focus()
;
|
208 |
|
if (!t
his._doc.e
xecCommand
('FormatBl
ock', fals
e, 'h' + h
))
|
|
208 |
|
if (!t
his._doc.e
xecCommand
('FormatBl
ock', fals
e, 'h' + h
))
|
209 |
|
th
is._doc.ex
ecCommand(
'FormatBlo
ck', false
, 'Heading
' + h);
|
|
209 |
|
th
is._doc.ex
ecCommand(
'FormatBlo
ck', false
, 'Heading
' + h);
|
210 |
|
}
|
|
210 |
|
}
|
211 |
|
|
|
211 |
|
|
212 |
|
BxEditor.p
rototype.g
etText = f
unction ()
|
|
212 |
|
BxEditor.p
rototype.g
etText = f
unction ()
|
213 |
|
{
|
|
213 |
|
{
|
214 |
|
if (th
is._el.con
tentDocume
nt)
|
|
214 |
|
if (th
is._el.con
tentDocume
nt)
|
215 |
|
{
|
|
215 |
|
{
|
216 |
|
re
turn this.
_el.conten
tDocument.
body.inner
HTML;
|
|
216 |
|
re
turn this.
_el.conten
tDocument.
body.inner
HTML;
|
217 |
|
}
|
|
217 |
|
}
|
218 |
|
else
|
|
218 |
|
else
|
219 |
|
{
|
|
219 |
|
{
|
220 |
|
re
turn this.
_el.docume
nt.body.in
nerHTML;
|
|
220 |
|
re
turn this.
_el.docume
nt.body.in
nerHTML;
|
221 |
|
}
|
|
221 |
|
}
|
222 |
|
}
|
|
222 |
|
}
|
223 |
|
|
|
223 |
|
|
224 |
|
BxEditor.p
rototype.s
etText = f
unction (s
)
|
|
224 |
|
BxEditor.p
rototype.s
etText = f
unction (s
)
|
225 |
|
{
|
|
225 |
|
{
|
226 |
|
if (th
is._el.con
tentDocume
nt)
|
|
226 |
|
if (th
is._el.con
tentDocume
nt)
|
227 |
|
{
|
|
227 |
|
{
|
228 |
|
th
is._el.con
tentDocume
nt.body.in
nerHTML =
s;
|
|
228 |
|
th
is._el.con
tentDocume
nt.body.in
nerHTML =
s;
|
229 |
|
}
|
|
229 |
|
}
|
230 |
|
else
|
|
230 |
|
else
|
231 |
|
{
|
|
231 |
|
{
|
232 |
|
if
(this._el
.document
&& this._e
l.document
.body)
|
|
232 |
|
if
(this._el
.document
&& this._e
l.document
.body)
|
233 |
|
this._el
.document.
body.inner
HTML = s;
|
|
233 |
|
this._el
.document.
body.inner
HTML = s;
|
234 |
|
}
|
|
234 |
|
}
|
235 |
|
}
|
|
235 |
|
}
|
236 |
|
|
|
236 |
|
|
237 |
|
// private
functions
---------
----------
----------
----------
----------
----------
|
|
237 |
|
// private
functions
---------
----------
----------
----------
----------
----------
|
238 |
|
|
|
238 |
|
|
239 |
|
|
|
239 |
|
|
240 |
|
BxEditor.p
rototype._
get_select
ion_bounds
= functio
n (editor_
window){
|
|
240 |
|
BxEditor.p
rototype._
get_select
ion_bounds
= functio
n (editor_
window){
|
241 |
|
|
|
241 |
|
|
242 |
|
var ran
ge, root,
start, end
|
|
242 |
|
var ran
ge, root,
start, end
|
243 |
|
|
|
243 |
|
|
244 |
|
if(edit
or_window.
getSelecti
on){ // Ge
cko, Opera
|
|
244 |
|
if(edit
or_window.
getSelecti
on){ // Ge
cko, Opera
|
245 |
|
var
selection
= editor_w
indow.getS
election()
|
|
245 |
|
var
selection
= editor_w
indow.getS
election()
|
246 |
|
|
|
246 |
|
|
247 |
|
rang
e = select
ion.getRan
geAt(0)
|
|
247 |
|
rang
e = select
ion.getRan
geAt(0)
|
248 |
|
|
|
248 |
|
|
249 |
|
star
t = range.
startConta
iner
|
|
249 |
|
star
t = range.
startConta
iner
|
250 |
|
end
= range.en
dContainer
|
|
250 |
|
end
= range.en
dContainer
|
251 |
|
root
= range.c
ommonAnces
torContain
er
|
|
251 |
|
root
= range.c
ommonAnces
torContain
er
|
252 |
|
if(s
tart == en
d) root =
start
|
|
252 |
|
if(s
tart == en
d) root =
start
|
253 |
|
|
|
253 |
|
|
254 |
|
if(s
tart.nodeN
ame.toLowe
rCase() ==
"body") r
eturn null
|
|
254 |
|
if(s
tart.nodeN
ame.toLowe
rCase() ==
"body") r
eturn null
|
255 |
|
|
|
255 |
|
|
256 |
|
if(s
tart.nodeN
ame == "#t
ext") star
t = start.
parentNode
|
|
256 |
|
if(s
tart.nodeN
ame == "#t
ext") star
t = start.
parentNode
|
257 |
|
if(e
nd.nodeNam
e == "#tex
t") end =
end.parent
Node
|
|
257 |
|
if(e
nd.nodeNam
e == "#tex
t") end =
end.parent
Node
|
258 |
|
|
|
258 |
|
|
259 |
|
retu
rn {
|
|
259 |
|
retu
rn {
|
260 |
|
r
oot: root,
|
|
260 |
|
r
oot: root,
|
261 |
|
s
tart: star
t,
|
|
261 |
|
s
tart: star
t,
|
262 |
|
e
nd: end
|
|
262 |
|
e
nd: end
|
263 |
|
}
|
|
263 |
|
}
|
264 |
|
|
|
264 |
|
|
265 |
|
}else i
f(editor_w
indow.docu
ment.selec
tion){ //
MSIE
|
|
265 |
|
}else i
f(editor_w
indow.docu
ment.selec
tion){ //
MSIE
|
266 |
|
rang
e = editor
_window.do
cument.sel
ection.cre
ateRange()
|
|
266 |
|
rang
e = editor
_window.do
cument.sel
ection.cre
ateRange()
|
267 |
|
if(!
range.dupl
icate) ret
urn null
|
|
267 |
|
if(!
range.dupl
icate) ret
urn null
|
268 |
|
|
|
268 |
|
|
269 |
|
var
r1 = range
.duplicate
()
|
|
269 |
|
var
r1 = range
.duplicate
()
|
270 |
|
var
r2 = range
.duplicate
()
|
|
270 |
|
var
r2 = range
.duplicate
()
|
271 |
|
r1.c
ollapse(tr
ue)
|
|
271 |
|
r1.c
ollapse(tr
ue)
|
272 |
|
r2.m
oveToEleme
ntText(r1.
parentElem
ent())
|
|
272 |
|
r2.m
oveToEleme
ntText(r1.
parentElem
ent())
|
273 |
|
r2.s
etEndPoint
("EndToSta
rt", r1)
|
|
273 |
|
r2.s
etEndPoint
("EndToSta
rt", r1)
|
274 |
|
star
t = r1.par
entElement
()
|
|
274 |
|
star
t = r1.par
entElement
()
|
275 |
|
|
|
275 |
|
|
276 |
|
r1 =
range.dup
licate()
|
|
276 |
|
r1 =
range.dup
licate()
|
277 |
|
r2 =
range.dup
licate()
|
|
277 |
|
r2 =
range.dup
licate()
|
278 |
|
r2.c
ollapse(fa
lse)
|
|
278 |
|
r2.c
ollapse(fa
lse)
|
279 |
|
r1.m
oveToEleme
ntText(r2.
parentElem
ent())
|
|
279 |
|
r1.m
oveToEleme
ntText(r2.
parentElem
ent())
|
280 |
|
r1.s
etEndPoint
("StartToE
nd", r2)
|
|
280 |
|
r1.s
etEndPoint
("StartToE
nd", r2)
|
281 |
|
end
= r2.paren
tElement()
|
|
281 |
|
end
= r2.paren
tElement()
|
282 |
|
|
|
282 |
|
|
283 |
|
root
= range.p
arentEleme
nt()
|
|
283 |
|
root
= range.p
arentEleme
nt()
|
284 |
|
if(s
tart == en
d) root =
start
|
|
284 |
|
if(s
tart == en
d) root =
start
|
285 |
|
|
|
285 |
|
|
286 |
|
retu
rn {
|
|
286 |
|
retu
rn {
|
287 |
|
r
oot: root,
|
|
287 |
|
r
oot: root,
|
288 |
|
s
tart: star
t,
|
|
288 |
|
s
tart: star
t,
|
289 |
|
e
nd: end
|
|
289 |
|
e
nd: end
|
290 |
|
}
|
|
290 |
|
}
|
291 |
|
}
|
|
291 |
|
}
|
292 |
|
return
null // br
owser not
supported
|
|
292 |
|
return
null // br
owser not
supported
|
293 |
|
}
|
|
293 |
|
}
|
294 |
|
|
|
294 |
|
|
295 |
|
|
|
295 |
|
|
296 |
|
// bounds
- array [r
oot, start
, end]
|
|
296 |
|
// bounds
- array [r
oot, start
, end]
|
297 |
|
// tag_nam
e - tag na
me
|
|
297 |
|
// tag_nam
e - tag na
me
|
298 |
|
BxEditor.p
rototype._
find_tags_
in_subtree
= functio
n (bounds,
tag_name,
stage, se
cond){
|
|
298 |
|
BxEditor.p
rototype._
find_tags_
in_subtree
= functio
n (bounds,
tag_name,
stage, se
cond){
|
299 |
|
|
|
299 |
|
|
300 |
|
var roo
t = bounds
['root']
|
|
300 |
|
var roo
t = bounds
['root']
|
301 |
|
var sta
rt = bound
s['start']
|
|
301 |
|
var sta
rt = bound
s['start']
|
302 |
|
var end
= bounds[
'end']
|
|
302 |
|
var end
= bounds[
'end']
|
303 |
|
|
|
303 |
|
|
304 |
|
if(star
t == end)
return [st
art]
|
|
304 |
|
if(star
t == end)
return [st
art]
|
305 |
|
|
|
305 |
|
|
306 |
|
if(!sec
ond) this.
_global_st
age=stage
|
|
306 |
|
if(!sec
ond) this.
_global_st
age=stage
|
307 |
|
|
|
307 |
|
|
308 |
|
if(this
._global_s
tage == 2)
return []
|
|
308 |
|
if(this
._global_s
tage == 2)
return []
|
309 |
|
if(!thi
s._global_
stage) thi
s._global_
stage = 0
|
|
309 |
|
if(!thi
s._global_
stage) thi
s._global_
stage = 0
|
310 |
|
|
|
310 |
|
|
311 |
|
tag_nam
e = tag_na
me.toLower
Case()
|
|
311 |
|
tag_nam
e = tag_na
me.toLower
Case()
|
312 |
|
|
|
312 |
|
|
313 |
|
var nod
es=[]
|
|
313 |
|
var nod
es=[]
|
314 |
|
for(var
node = ro
ot.firstCh
ild; node;
node = no
de.nextSib
ling){
|
|
314 |
|
for(var
node = ro
ot.firstCh
ild; node;
node = no
de.nextSib
ling){
|
315 |
|
if(n
ode==start
&& this._
global_sta
ge==0){
|
|
315 |
|
if(n
ode==start
&& this._
global_sta
ge==0){
|
316 |
|
t
his._globa
l_stage =
1
|
|
316 |
|
t
his._globa
l_stage =
1
|
317 |
|
}
|
|
317 |
|
}
|
318 |
|
if(n
ode.nodeNa
me.toLower
Case() ==
tag_name &
& node.nod
eName != '
#text' ||
tag_name =
= ''){
|
|
318 |
|
if(n
ode.nodeNa
me.toLower
Case() ==
tag_name &
& node.nod
eName != '
#text' ||
tag_name =
= ''){
|
319 |
|
i
f(this._gl
obal_stage
== 1){
|
|
319 |
|
i
f(this._gl
obal_stage
== 1){
|
320 |
|
nodes.pu
sh(node)
|
|
320 |
|
nodes.pu
sh(node)
|
321 |
|
}
|
|
321 |
|
}
|
322 |
|
}
|
|
322 |
|
}
|
323 |
|
if(n
ode==end &
& this._gl
obal_stage
==1){
|
|
323 |
|
if(n
ode==end &
& this._gl
obal_stage
==1){
|
324 |
|
t
his._globa
l_stage =
2
|
|
324 |
|
t
his._globa
l_stage =
2
|
325 |
|
}
|
|
325 |
|
}
|
326 |
|
node
s=nodes.co
ncat(this.
_find_tags
_in_subtre
e({root:no
de, start:
start, end
:end}, tag
_name, thi
s._global_
stage, tru
e))
|
|
326 |
|
node
s=nodes.co
ncat(this.
_find_tags
_in_subtre
e({root:no
de, start:
start, end
:end}, tag
_name, thi
s._global_
stage, tru
e))
|
327 |
|
}
|
|
327 |
|
}
|
328 |
|
return
nodes
|
|
328 |
|
return
nodes
|
329 |
|
}
|
|
329 |
|
}
|
330 |
|
|
|
330 |
|
|
331 |
|
|
|
331 |
|
|
332 |
|
BxEditor.p
rototype._
closest_pa
rent_by_ta
g_name = f
unction (n
ode, tag_n
ame) {
|
|
332 |
|
BxEditor.p
rototype._
closest_pa
rent_by_ta
g_name = f
unction (n
ode, tag_n
ame) {
|
333 |
|
|
|
333 |
|
|
334 |
|
tag_nam
e = tag_na
me.toLower
Case()
|
|
334 |
|
tag_nam
e = tag_na
me.toLower
Case()
|
335 |
|
var p =
node
|
|
335 |
|
var p =
node
|
336 |
|
do{
|
|
336 |
|
do{
|
337 |
|
if(t
ag_name ==
'' || p.n
odeName.to
LowerCase(
) == tag_n
ame) retur
n p
|
|
337 |
|
if(t
ag_name ==
'' || p.n
odeName.to
LowerCase(
) == tag_n
ame) retur
n p
|
338 |
|
}while(
p = p.pare
ntNode)
|
|
338 |
|
}while(
p = p.pare
ntNode)
|
339 |
|
|
|
339 |
|
|
340 |
|
return
node
|
|
340 |
|
return
node
|
341 |
|
}
|
|
341 |
|
}
|
342 |
|
|
|
342 |
|
|
343 |
|
BxEditor.p
rototype._
get_select
ed_tags =
function (
editor_win
dow, tag_n
ame){
|
|
343 |
|
BxEditor.p
rototype._
get_select
ed_tags =
function (
editor_win
dow, tag_n
ame){
|
344 |
|
|
|
344 |
|
|
345 |
|
if(tag_
name){
|
|
345 |
|
if(tag_
name){
|
346 |
|
tag_
name = tag
_name.toLo
werCase()
|
|
346 |
|
tag_
name = tag
_name.toLo
werCase()
|
347 |
|
}else{
|
|
347 |
|
}else{
|
348 |
|
tag_
name = ''
|
|
348 |
|
tag_
name = ''
|
349 |
|
}
|
|
349 |
|
}
|
350 |
|
var bou
nds = this
._get_sele
ction_boun
ds(editor_
window)
|
|
350 |
|
var bou
nds = this
._get_sele
ction_boun
ds(editor_
window)
|
351 |
|
if(!bou
nds) retur
n null
|
|
351 |
|
if(!bou
nds) retur
n null
|
352 |
|
|
|
352 |
|
|
353 |
|
bounds[
'start'] =
this._clo
sest_paren
t_by_tag_n
ame(bounds
['start'],
tag_name)
|
|
353 |
|
bounds[
'start'] =
this._clo
sest_paren
t_by_tag_n
ame(bounds
['start'],
tag_name)
|
354 |
|
bounds[
'end'] = t
his._close
st_parent_
by_tag_nam
e(bounds['
end'], tag
_name)
|
|
354 |
|
bounds[
'end'] = t
his._close
st_parent_
by_tag_nam
e(bounds['
end'], tag
_name)
|
355 |
|
return
this._find
_tags_in_s
ubtree(bou
nds, tag_n
ame)
|
|
355 |
|
return
this._find
_tags_in_s
ubtree(bou
nds, tag_n
ame)
|
356 |
|
}
|
|
356 |
|
}
|
357 |
|
|
|
357 |
|
|
358 |
|
BxEditor.p
rototype._
clean_node
s = functi
on (nodes,
class_nam
e){
|
|
358 |
|
BxEditor.p
rototype._
clean_node
s = functi
on (nodes,
class_nam
e){
|
359 |
|
if(!nod
es) return
|
|
359 |
|
if(!nod
es) return
|
360 |
|
var l =
nodes.len
gth - 1
|
|
360 |
|
var l =
nodes.len
gth - 1
|
361 |
|
var p;
|
|
361 |
|
var p;
|
362 |
|
var htm
l = '';
|
|
362 |
|
var htm
l = '';
|
363 |
|
for(var
i = l ; i
>= 0 ; i-
-){
|
|
363 |
|
for(var
i = l ; i
>= 0 ; i-
-){
|
364 |
|
// if
(!class_na
me || node
s[i].class
Name == cl
ass_name){
|
|
364 |
|
// if
(!class_na
me || node
s[i].class
Name == cl
ass_name){
|
365 |
|
h
tml += '<p
>' + nodes
[i].innerH
TML + '</p
>';
|
|
365 |
|
h
tml += '<p
>' + nodes
[i].innerH
TML + '</p
>';
|
366 |
|
p
= nodes[i
].parentNo
de;
|
|
366 |
|
p
= nodes[i
].parentNo
de;
|
367 |
|
p
.removeChi
ld(nodes[i
]);
|
|
367 |
|
p
.removeChi
ld(nodes[i
]);
|
368 |
|
|
|
368 |
|
|
369 |
|
// }
|
|
369 |
|
// }
|
370 |
|
// el
se
|
|
370 |
|
// el
se
|
371 |
|
// {
|
|
371 |
|
// {
|
372 |
|
//
html += n
odes[i].in
nerHTML;
|
|
372 |
|
//
html += n
odes[i].in
nerHTML;
|
373 |
|
// }
|
|
373 |
|
// }
|
374 |
|
}
|
|
374 |
|
}
|
375 |
|
|
|
375 |
|
|
376 |
|
if (p)
p.innerHTM
L = html;
|
|
376 |
|
if (p)
p.innerHTM
L = html;
|
377 |
|
}
|
|
377 |
|
}
|
378 |
|
|
|
378 |
|
|
379 |
|
|
|
379 |
|
|
380 |
|
BxEditor.p
rototype._
format_pre
_moz = fun
ction (){
|
|
380 |
|
BxEditor.p
rototype._
format_pre
_moz = fun
ction (){
|
381 |
|
|
|
381 |
|
|
382 |
|
var if
rame = thi
s._el;
|
|
382 |
|
var if
rame = thi
s._el;
|
383 |
|
var wy
siwyg = th
is._doc;
|
|
383 |
|
var wy
siwyg = th
is._doc;
|
384 |
|
|
|
384 |
|
|
385 |
|
wysiwy
g.execComm
and('Remov
eFormat',
false, tru
e)
|
|
385 |
|
wysiwy
g.execComm
and('Remov
eFormat',
false, tru
e)
|
386 |
|
|
|
386 |
|
|
387 |
|
var no
des=this._
get_select
ed_tags(if
rame.conte
ntWindow,
'blockquot
e')
|
|
387 |
|
var no
des=this._
get_select
ed_tags(if
rame.conte
ntWindow,
'blockquot
e')
|
388 |
|
var ne
w_node
|
|
388 |
|
var ne
w_node
|
389 |
|
for(va
r i=0;i<no
des.length
;i++)
|
|
389 |
|
for(va
r i=0;i<no
des.length
;i++)
|
390 |
|
{
|
|
390 |
|
{
|
391 |
|
ne
w_node = w
ysiwyg.cre
ateElement
('pre')
|
|
391 |
|
ne
w_node = w
ysiwyg.cre
ateElement
('pre')
|
392 |
|
// ne
w_node.cla
ssName = '
code';
|
|
392 |
|
// ne
w_node.cla
ssName = '
code';
|
393 |
|
ne
w_node.inn
erHTML = n
odes[i].in
nerHTML
|
|
393 |
|
ne
w_node.inn
erHTML = n
odes[i].in
nerHTML
|
394 |
|
no
des[i].par
entNode.re
placeChild
(new_node,
nodes[i])
|
|
394 |
|
no
des[i].par
entNode.re
placeChild
(new_node,
nodes[i])
|
395 |
|
}
|
|
395 |
|
}
|
396 |
|
}
|
|
396 |
|
}
|
397 |
|
|
|
397 |
|
|
398 |
|
|
|
398 |
|
|
399 |
|
BxEditor.p
rototype._
format_pre
_ie = func
tion (){
|
|
399 |
|
BxEditor.p
rototype._
format_pre
_ie = func
tion (){
|
400 |
|
|
|
400 |
|
|
401 |
|
var if
rame = thi
s._el;
|
|
401 |
|
var if
rame = thi
s._el;
|
402 |
|
var wy
siwyg = th
is._doc;
|
|
402 |
|
var wy
siwyg = th
is._doc;
|
403 |
|
|
|
403 |
|
|
404 |
|
wysiwy
g.execComm
and('Remov
eFormat',
false, tru
e)
|
|
404 |
|
wysiwy
g.execComm
and('Remov
eFormat',
false, tru
e)
|
405 |
|
|
|
405 |
|
|
406 |
|
this._
clean_node
s(this._ge
t_selected
_tags(ifra
me, 'dd'))
|
|
406 |
|
this._
clean_node
s(this._ge
t_selected
_tags(ifra
me, 'dd'))
|
407 |
|
|
|
407 |
|
|
408 |
|
var no
des=this._
get_select
ed_tags(if
rame, 'dl'
)
|
|
408 |
|
var no
des=this._
get_select
ed_tags(if
rame, 'dl'
)
|
409 |
|
var ne
w_node
|
|
409 |
|
var ne
w_node
|
410 |
|
for(va
r i=0;i<no
des.length
;i++)
|
|
410 |
|
for(va
r i=0;i<no
des.length
;i++)
|
411 |
|
{
|
|
411 |
|
{
|
412 |
|
ne
w_node = w
ysiwyg.cre
ateElement
('pre')
|
|
412 |
|
ne
w_node = w
ysiwyg.cre
ateElement
('pre')
|
413 |
|
// ne
w_node.cla
ssName = '
code';
|
|
413 |
|
// ne
w_node.cla
ssName = '
code';
|
414 |
|
ne
w_node.inn
erHTML = n
odes[i].in
nerHTML
|
|
414 |
|
ne
w_node.inn
erHTML = n
odes[i].in
nerHTML
|
415 |
|
no
des[i].par
entNode.re
placeChild
(new_node,
nodes[i])
|
|
415 |
|
no
des[i].par
entNode.re
placeChild
(new_node,
nodes[i])
|
416 |
|
}
|
|
416 |
|
}
|
417 |
|
}
|
|
417 |
|
}
|
418 |
|
|
|
418 |
|
|
419 |
|
BxEditor.p
rototype._
format_inl
ine = func
tion (tag_
name, clas
s_name){
|
|
419 |
|
BxEditor.p
rototype._
format_inl
ine = func
tion (tag_
name, clas
s_name){
|
420 |
|
|
|
420 |
|
|
421 |
|
this._m
agic_unusu
al_color='
#00f001';
|
|
421 |
|
this._m
agic_unusu
al_color='
#00f001';
|
422 |
|
|
|
422 |
|
|
423 |
|
var ifr
ame = this
._el;//doc
ument.getE
lementById
(iframe_id
)
|
|
423 |
|
var ifr
ame = this
._el;//doc
ument.getE
lementById
(iframe_id
)
|
424 |
|
var wys
iwyg = thi
s._doc;//i
frame.cont
entWindow.
document
|
|
424 |
|
var wys
iwyg = thi
s._doc;//i
frame.cont
entWindow.
document
|
425 |
|
|
|
425 |
|
|
426 |
|
wysiwyg
.execComma
nd('Remove
Format', f
alse, true
)
|
|
426 |
|
wysiwyg
.execComma
nd('Remove
Format', f
alse, true
)
|
427 |
|
|
|
427 |
|
|
428 |
|
this._c
lean_nodes
(this._get
_selected_
tags(ifram
e.contentW
indow, 'sp
an'))
|
|
428 |
|
this._c
lean_nodes
(this._get
_selected_
tags(ifram
e.contentW
indow, 'sp
an'))
|
429 |
|
|
|
429 |
|
|
430 |
|
if(tag_
name!=''){
|
|
430 |
|
if(tag_
name!=''){
|
431 |
|
|
|
431 |
|
|
432 |
|
wy
siwyg.exec
Command('F
oreColor',
false, th
is._magic_
unusual_co
lor)
|
|
432 |
|
wy
siwyg.exec
Command('F
oreColor',
false, th
is._magic_
unusual_co
lor)
|
433 |
|
|
|
433 |
|
|
434 |
|
var
nodes=this
._get_sele
cted_tags(
iframe.con
tentWindow
, 'font')
|
|
434 |
|
var
nodes=this
._get_sele
cted_tags(
iframe.con
tentWindow
, 'font')
|
435 |
|
var
new_node
|
|
435 |
|
var
new_node
|
436 |
|
for(
var i=0;i<
nodes.leng
th;i++){
|
|
436 |
|
for(
var i=0;i<
nodes.leng
th;i++){
|
437 |
|
i
f(nodes[i]
.getAttrib
ute('color
') != this
._magic_un
usual_colo
r) continu
e
|
|
437 |
|
i
f(nodes[i]
.getAttrib
ute('color
') != this
._magic_un
usual_colo
r) continu
e
|
438 |
|
n
ew_node =
wysiwyg.cr
eateElemen
t(tag_name
)
|
|
438 |
|
n
ew_node =
wysiwyg.cr
eateElemen
t(tag_name
)
|
439 |
|
//
if(class_
name) new_
node.class
Name = cla
ss_name
|
|
439 |
|
//
if(class_
name) new_
node.class
Name = cla
ss_name
|
440 |
|
n
ew_node.in
nerHTML =
nodes[i].i
nnerHTML
|
|
440 |
|
n
ew_node.in
nerHTML =
nodes[i].i
nnerHTML
|
441 |
|
n
odes[i].pa
rentNode.r
eplaceChil
d(new_node
, nodes[i]
)
|
|
441 |
|
n
odes[i].pa
rentNode.r
eplaceChil
d(new_node
, nodes[i]
)
|
442 |
|
}
|
|
442 |
|
}
|
443 |
|
}
|
|
443 |
|
}
|
444 |
|
iframe.
focus()
|
|
444 |
|
iframe.
focus()
|
445 |
|
}
|
|
445 |
|
}
|
446 |
|
|
|
446 |
|
|
447 |
|
BxEditor.p
rototype._
wysiwyg_fo
rmat_block
= functio
n (class_n
ame){
|
|
447 |
|
BxEditor.p
rototype._
wysiwyg_fo
rmat_block
= functio
n (class_n
ame){
|
448 |
|
|
|
448 |
|
|
449 |
|
var tag
_name = 'h
1';
|
|
449 |
|
var tag
_name = 'h
1';
|
450 |
|
var ifr
ame = this
._el;//doc
ument.getE
lementById
(iframe_id
)
|
|
450 |
|
var ifr
ame = this
._el;//doc
ument.getE
lementById
(iframe_id
)
|
451 |
|
var wys
iwyg = thi
s._doc;//i
frame.cont
entWindow.
document
|
|
451 |
|
var wys
iwyg = thi
s._doc;//i
frame.cont
entWindow.
document
|
452 |
|
|
|
452 |
|
|
453 |
|
// wysiw
yg.execCom
mand('form
atblock',
false, tag
_name)
|
|
453 |
|
// wysiw
yg.execCom
mand('form
atblock',
false, tag
_name)
|
454 |
|
if (!th
is._doc.ex
ecCommand(
'FormatBlo
ck', false
, tag_name
))
|
|
454 |
|
if (!th
is._doc.ex
ecCommand(
'FormatBlo
ck', false
, tag_name
))
|
455 |
|
this
._doc.exec
Command('F
ormatBlock
', false,
'Heading 1
');
|
|
455 |
|
this
._doc.exec
Command('F
ormatBlock
', false,
'Heading 1
');
|
456 |
|
|
|
456 |
|
|
457 |
|
// asig
n class fo
r tag
|
|
457 |
|
// asig
n class fo
r tag
|
458 |
|
var nod
es = this.
_get_selec
ted_tags(i
frame.cont
entWindow,
tag_name)
|
|
458 |
|
var nod
es = this.
_get_selec
ted_tags(i
frame.cont
entWindow,
tag_name)
|
459 |
|
for(var
i = 0; i
< nodes.le
ngth; i++)
{
|
|
459 |
|
for(var
i = 0; i
< nodes.le
ngth; i++)
{
|
460 |
|
if(c
lass_name)
|
|
460 |
|
if(c
lass_name)
|
461 |
|
{
|
|
461 |
|
{
|
462 |
|
n
odes[i].cl
assName =
class_name
|
|
462 |
|
n
odes[i].cl
assName =
class_name
|
463 |
|
}
|
|
463 |
|
}
|
464 |
|
else
|
|
464 |
|
else
|
465 |
|
{
|
|
465 |
|
{
|
466 |
|
n
odes[i].re
moveAttrib
ute('class
')
|
|
466 |
|
n
odes[i].re
moveAttrib
ute('class
')
|
467 |
|
n
odes[i].re
moveAttrib
ute('class
Name')
|
|
467 |
|
n
odes[i].re
moveAttrib
ute('class
Name')
|
468 |
|
}
|
|
468 |
|
}
|
469 |
|
}
|
|
469 |
|
}
|
470 |
|
iframe.
focus()
|
|
470 |
|
iframe.
focus()
|
471 |
|
}
|
|
471 |
|
}
|