1 |
|
tiny
MCE
.
i
m
p
ortP
lugin
Lang
u
a
g
eP
ack(
'
a
u
t
o
sav
e
'
)
;
var
T
iny
MCE_
AutoSavePl
ugin
={
getInfo:fu
nction(){r
eturn{long
name:'Auto
save',auth
or:'Moxiec
ode
Systems
AB',author
url:'http:
//tinymce.
moxiecode.
com',infou
rl:'http:/
/wiki.moxi
ecode.com/
index.php/
TinyMCE:Pl
ugins/auto
save',vers
ion:tiny
MCE
.majorVers
ion+"."+ti
ny
MCE
.minorVers
ion}
},
_beforeUnl
oadHandler
:function(
){var
n,in
s
t
,anyD
i
rt
y
=false,
m
sg=
tinyMCE.
g
e
tLang("lan
g_au
to
s
ave_
un
l
o
a
d
_msg"
)
;
if(
tinyMCE
.getParam(
"fullscree
n_is_enabl
ed"))retur
n;
f
or
(
n
in
tinyMCE
.i
n
s
t
ances
){
in
s
t
=
tinyMCE
.
ins
t
an
ces[n];if
(
!
t
inyMCE.isI
n
s
t
a
nc
e
(inst))con
tin
u
e;if(i
n
s
t.isDirty(
)
)
return
m
s
g
}
return
}}
;
window.onb
eforeunloa
d=T
iny
MCE_AutoSa
v
e
Plugin
._beforeUn
loadH
an
dl
er
;tinyMCE
.add
Plugin
(
"
autosave
"
,
T
iny
MCE_
AutoSavePl
ugin);
|
|
1 |
|
(function(
){
tiny
mce
.
create('t
i
ny
m
ce.
p
lugin
s.A
u
toS
a
v
eP
lugin
'
,{init:f
u
nc
t
i
o
n(
e
d,url
)
{
var
t=this;t.e
ditor=ed;w
indow.onbe
foreunload
=t
iny
mce.plugin
s.
AutoSavePl
ugin
._beforeUn
loadHandle
r;},
getInfo:fu
nction(){r
eturn{long
name:'Auto
save',auth
or:'Moxiec
ode
Systems
AB',author
url:'http:
//tinymce.
moxiecode.
com',infou
rl:'http:/
/wiki.moxi
ecode.com/
index.php/
TinyMCE:Pl
ugins/auto
save',vers
ion:tiny
mce
.majorVers
ion+"."+ti
ny
mce
.minorVers
ion}
;
},
'static':{
_beforeUnl
oadHandler
:function(
){var
m
s
g;
t
i
n
y
m
ce.each(
tinyMCE.
e
di
to
r
s
,f
un
cti
o
n(e
d
)
{
if(
ed
.getParam(
"fullscree
n_is_enabl
ed"))retur
n;
i
f
(
ed
.i
s
Dir
t
y()
){
m
s
g
=
ed
.
ge
t
L
an
g
(
"au
t
o
s
a
v
e
.
u
n
load_m
s
g"
)
;
return
fal
s
e;}
}
);
return
msg;
}}
})
;
t
iny
mc
e
.
Plugin
M
an
ag
er
.add
(
'
autosave
'
,
t
iny
mce.plugin
s.
AutoSavePl
ugin);
})();
|