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('emotio
ns');
|
|
9 |
|
tinymc
e.create('
tinymce.pl
ugins.Emot
ionsPlugin
', {
|
|
|
10 |
|
in
it : funct
ion(ed, ur
l) {
|
|
|
11 |
|
// Regis
ter comman
ds
|
|
|
12 |
|
ed.addCo
mmand('mce
Emotion',
function()
{
|
|
|
13 |
|
ed.w
indowManag
er.open({
|
|
|
14 |
|
file : url
+ '/emoti
ons.htm',
|
|
|
15 |
|
width : 25
0 + parseI
nt(ed.getL
ang('emoti
ons.delta_
width', 0)
),
|
|
|
16 |
|
height : 1
60 + parse
Int(ed.get
Lang('emot
ions.delta
_height',
0)),
|
|
|
17 |
|
inline : 1
|
|
|
18 |
|
}, {
|
|
|
19 |
|
plugin_url
: url
|
|
|
20 |
|
});
|
|
|
21 |
|
});
|
|
|
22 |
|
|
|
|
23 |
|
// Regis
ter button
s
|
|
|
24 |
|
ed.addBu
tton('emot
ions', {ti
tle : 'emo
tions.emot
ions_desc'
, cmd : 'm
ceEmotion'
});
|
|
|
25 |
|
},
|
10 |
|
|
|
26 |
|
|
11 |
|
// Plucin
static cla
ss
|
|
|
12 |
|
var TinyMC
E_Emotions
Plugin = {
|
|
|
13 |
|
getInf
o : functi
on() {
|
|
27 |
|
ge
tInfo : fu
nction() {
|
14 |
|
re
turn {
|
|
28 |
|
return {
|
15 |
|
longname
: 'Emotio
ns',
|
|
29 |
|
long
name : 'Em
otions',
|
16 |
|
author :
'Moxiecod
e Systems
AB',
|
|
30 |
|
auth
or : 'Moxi
ecode Syst
ems AB',
|
17 |
|
authorur
l : 'http:
//tinymce.
moxiecode.
com',
|
|
31 |
|
auth
orurl : 'h
ttp://tiny
mce.moxiec
ode.com',
|
18 |
|
infourl
: 'http://
wiki.moxie
code.com/i
ndex.php/T
inyMCE:Plu
gins/emoti
ons',
|
|
32 |
|
info
url : 'htt
p://wiki.m
oxiecode.c
om/index.p
hp/TinyMCE
:Plugins/e
motions',
|
19 |
|
version
:
tiny
MCE
.majorVers
ion
+
"."
+
tiny
MCE
.minorVers
ion
|
|
33 |
|
version
:
tiny
mce
.majorVers
ion
+
"."
+
tiny
mce
.minorVers
ion
|
20 |
|
};
|
|
34 |
|
};
|
21 |
|
},
|
|
|
22 |
|
|
|
|
23 |
|
/**
|
|
|
24 |
|
* Ret
urns the H
TML conten
ts of the
emotions c
ontrol.
|
|
|
25 |
|
*/
|
|
|
26 |
|
getCon
trolHTML :
function(
cn) {
|
|
|
27 |
|
sw
itch (cn)
{
|
|
|
28 |
|
case "em
otions":
|
|
|
29 |
|
retu
rn tinyMCE
.getButton
HTML(cn, '
lang_emoti
ons_desc',
'{$plugin
url}/image
s/emotions
.gif', 'mc
eEmotion')
;
|
|
|
30 |
|
}
|
|
35 |
|
}
|
31 |
|
|
|
36 |
|
}
)
;
|
32 |
|
re
turn "";
|
|
|
33 |
|
},
|
|
|
34 |
|
|
|
|
35 |
|
/**
|
|
|
36 |
|
* Exe
cutes the
mceEmotion
command.
|
|
|
37 |
|
*/
|
|
|
38 |
|
execCo
mmand : fu
nction(edi
tor_id, el
ement, com
mand, user
_interface
, value) {
|
|
|
39 |
|
//
Handle co
mmands
|
|
|
40 |
|
sw
itch (comm
and) {
|
|
|
41 |
|
case "mc
eEmotion":
|
|
|
42 |
|
var
template =
new Array
();
|
|
|
43 |
|
|
|
|
44 |
|
temp
late['file
'] = '../.
./plugins/
emotions/e
motions.ht
m'; // Rel
ative to t
heme
|
|
|
45 |
|
temp
late['widt
h'] = 250;
|
|
|
46 |
|
temp
late['heig
ht'] = 160
;
|
|
|
47 |
|
|
|
|
48 |
|
// L
anguage sp
ecific wid
th and hei
ght addons
|
|
|
49 |
|
temp
late['widt
h'] += tin
yMCE.getLa
ng('lang_e
motions_de
lta_width'
, 0);
|
|
|
50 |
|
temp
late['heig
ht'] += ti
nyMCE.getL
ang('lang_
emotions_d
elta_heigh
t', 0);
|
|
|
51 |
|
|
|
|
52 |
|
tiny
MCE.openWi
ndow(templ
ate, {edit
or_id : ed
itor_id, i
nline : "y
es"});
|
|
|
53 |
|
|
|
|
54 |
|
retu
rn true;
|
|
|
55 |
|
}
|
|
|
56 |
|
|
|
|
57 |
|
//
Pass to n
ext handle
r in chain
|
|
|
58 |
|
re
turn false
;
|
|
|
59 |
|
}
|
|
|
60 |
|
}
;
|
|
|
61 |
|
|
|
37 |
|
|
62 |
|
// Registe
r plugin
|
|
38 |
|
// Reg
ister plug
in
|
63 |
|
tiny
MCE
.
add
Plugin
('emotions
',
T
iny
MCE_
EmotionsPl
ugin);
|
|
39 |
|
tiny
mce
.
Plugin
Manager.ad
d
('emotions
',
t
iny
mce.plugin
s.
EmotionsPl
ugin);
|
|
|
40 |
|
})();
|