No regular expressions were active.
1 |
|
/**
|
|
1 |
|
/**
|
2 |
|
*
$Id:
editor_plu
gin_src.js
20
1
200
7
-0
2-
1
2
1
5:5
6:
56
Z
spocke
$
|
|
2 |
|
*
$Id:
editor_plu
gin_src.js
5
20
200
8
-0
1
-07
1
6:
30:32
Z
spocke
$
|
3 |
|
*
|
|
3 |
|
*
|
4 |
|
* @author
Moxiecode
|
|
4 |
|
* @author
Moxiecode
|
5 |
|
*
@copyright
Copyright
©
2004-200
7
,
Moxiecode
Systems
AB,
All
rights
reserved.
|
|
5 |
|
*
@copyright
Copyright
©
2004-200
8
,
Moxiecode
Systems
AB,
All
rights
reserved.
|
6 |
|
*/
|
|
6 |
|
*/
|
7 |
|
|
|
7 |
|
|
8 |
|
/* Import
plugin spe
cific lang
uage pack
*/
|
|
8 |
|
(function(
) {
|
9 |
|
tinyMCE.im
portPlugin
LanguagePa
ck('autosa
ve');
|
|
9 |
|
tinymc
e.create('
tinymce.pl
ugins.Auto
SavePlugin
', {
|
|
|
10 |
|
in
it : funct
ion(ed, ur
l) {
|
|
|
11 |
|
var t =
this;
|
|
|
12 |
|
|
|
|
13 |
|
t.editor
= ed;
|
|
|
14 |
|
|
|
|
15 |
|
window.o
nbeforeunl
oad = tiny
mce.plugin
s.AutoSave
Plugin._be
foreUnload
Handler;
|
|
|
16 |
|
},
|
10 |
|
|
|
17 |
|
|
11 |
|
var TinyMC
E_AutoSave
Plugin = {
|
|
|
12 |
|
getInf
o : functi
on() {
|
|
18 |
|
ge
tInfo : fu
nction() {
|
13 |
|
re
turn {
|
|
19 |
|
return {
|
14 |
|
longname
: 'Auto s
ave',
|
|
20 |
|
long
name : 'Au
to save',
|
15 |
|
author :
'Moxiecod
e Systems
AB',
|
|
21 |
|
auth
or : 'Moxi
ecode Syst
ems AB',
|
16 |
|
authorur
l : 'http:
//tinymce.
moxiecode.
com',
|
|
22 |
|
auth
orurl : 'h
ttp://tiny
mce.moxiec
ode.com',
|
17 |
|
infourl
: 'http://
wiki.moxie
code.com/i
ndex.php/T
inyMCE:Plu
gins/autos
ave',
|
|
23 |
|
info
url : 'htt
p://wiki.m
oxiecode.c
om/index.p
hp/TinyMCE
:Plugins/a
utosave',
|
18 |
|
version
:
tiny
MCE
.majorVers
ion
+
"."
+
tiny
MCE
.minorVers
ion
|
|
24 |
|
version
:
tiny
mce
.majorVers
ion
+
"."
+
tiny
mce
.minorVers
ion
|
19 |
|
};
|
|
25 |
|
};
|
20 |
|
},
|
|
26 |
|
},
|
21 |
|
|
|
27 |
|
|
22 |
|
// Pri
vate plugi
n internal
methods
|
|
28 |
|
//
Private p
lugin inte
rnal metho
ds
|
23 |
|
|
|
29 |
|
|
|
|
30 |
|
's
tatic' : {
|
24 |
|
_befor
eUnloadHan
dler : fun
ction() {
|
|
31 |
|
_beforeU
nloadHandl
er : funct
ion() {
|
25 |
|
va
r n, inst,
anyDirty
= false, m
sg = tinyM
CE.getLang
("lang_aut
osave_unlo
ad_msg");
|
|
32 |
|
var
msg;
|
26 |
|
|
|
33 |
|
|
27 |
|
if
(
tinyMCE
.getParam(
"fullscree
n_is_enabl
ed"))
|
|
34 |
|
tiny
mce.each(t
inyMCE.edi
tors, func
tion(ed) {
|
|
|
35 |
|
if
(
ed
.getParam(
"fullscree
n_is_enabl
ed"))
|
28 |
|
return;
|
|
36 |
|
return
;
|
29 |
|
|
|
37 |
|
|
30 |
|
fo
r (n in ti
nyMCE.inst
ances) {
|
|
38 |
|
if (ed.isD
irty()) {
|
31 |
|
inst = t
inyMCE.ins
tances[n];
|
|
39 |
|
msg =
ed.getLang
("autosave
.unload_ms
g");
|
32 |
|
|
|
40 |
|
return
false;
|
33 |
|
if (!tin
yMCE.isIns
tance(inst
))
|
|
41 |
|
}
|
34 |
|
continue
;
|
|
42 |
|
})
;
|
35 |
|
|
|
43 |
|
|
36 |
|
if (inst
.isDirty()
)
|
|
|
37 |
|
retu
rn msg;
|
|
44 |
|
retu
rn msg;
|
38 |
|
}
|
|
45 |
|
}
|
39 |
|
|
|
|
40 |
|
re
turn;
|
|
|
41 |
|
}
|
|
46 |
|
}
|
42 |
|
}
;
|
|
47 |
|
}
)
;
|
43 |
|
|
|
|
44 |
|
window.onb
eforeunloa
d = TinyMC
E_AutoSave
Plugin._be
foreUnload
Handler;
|
|
|
45 |
|
|
|
48 |
|
|
46 |
|
tiny
MCE
.
add
Plugin
(
"
autosave
"
,
T
iny
MCE_
AutoSavePl
ugin);
|
|
49 |
|
// Reg
ister plug
in
|
|
|
50 |
|
tiny
mce
.
Plugin
Manager.ad
d
(
'
autosave
'
,
t
iny
mce.plugin
s.
AutoSavePl
ugin);
|
|
|
51 |
|
})();
|