No regular expressions were active.
|
|
1 |
|
tinyMCEPop
up.require
LangPack()
;
|
|
|
2 |
|
|
|
|
3 |
|
var Anchor
Dialog = {
|
|
|
4 |
|
init :
function(
ed) {
|
|
|
5 |
|
va
r action,
elm, f = d
ocument.fo
rms[0];
|
|
|
6 |
|
|
|
|
7 |
|
th
is.editor
= ed;
|
|
|
8 |
|
el
m = ed.dom
.getParent
(ed.select
ion.getNod
e(), 'A,IM
G');
|
|
|
9 |
|
v
= ed.dom.g
etAttrib(e
lm, 'name'
);
|
|
|
10 |
|
|
|
|
11 |
|
if
(v)
|
|
|
12 |
|
f.anchor
Name.value
= v;
|
|
|
13 |
|
|
|
|
14 |
|
f.
insert.val
ue = ed.ge
tLang(elm
? 'update'
: 'insert
');
|
|
|
15 |
|
},
|
|
|
16 |
|
|
|
|
17 |
|
update
: functio
n() {
|
|
|
18 |
|
va
r ed = thi
s.editor;
|
|
|
19 |
|
|
|
|
20 |
|
ti
nyMCEPopup
.restoreSe
lection();
|
|
|
21 |
|
ed
.selection
.collapse(
1);
|
|
|
22 |
|
|
|
|
23 |
|
//
Webkit ac
ts weird i
f empty in
line eleme
nt is inse
rted so we
need to u
se a image
instead
|
|
|
24 |
|
if
(tinymce.
isWebKit)
|
|
|
25 |
|
ed.execC
ommand('mc
eInsertCon
tent', 0,
ed.dom.cre
ateHTML('i
mg', {mce_
name : 'a'
, name : d
ocument.fo
rms[0].anc
horName.va
lue, 'clas
s' : 'mceI
temAnchor'
}));
|
|
|
26 |
|
el
se
|
|
|
27 |
|
ed.execC
ommand('mc
eInsertCon
tent', 0,
ed.dom.cre
ateHTML('a
', {name :
document.
forms[0].a
nchorName.
value, 'cl
ass' : 'mc
eItemAncho
r'}, ''));
|
|
|
28 |
|
|
|
|
29 |
|
ti
nyMCEPopup
.close();
|
|
|
30 |
|
}
|
|
|
31 |
|
};
|
|
|
32 |
|
|
|
|
33 |
|
tinyMCEPop
up.onInit.
add(Anchor
Dialog.ini
t, AnchorD
ialog);
|