No regular expressions were active.
1 |
|
/**
|
|
1 |
|
/**
|
2 |
|
*
$Id:
editor_tem
plate_src.
js
1
6
2
200
7
-0
1
-
03
16:
1
6
:5
2
Z
spocke
$
|
|
2 |
|
*
$Id:
editor_tem
plate_src.
js
6
37
200
8
-0
2
-
25
1
4
:5
9:07
Z
spocke
$
|
|
|
3 |
|
*
|
|
|
4 |
|
* This fi
le is mean
t to showc
ase how to
create a
simple the
me. The ad
vanced
|
|
|
5 |
|
* theme i
s more sui
table for
production
use.
|
3 |
|
*
|
|
6 |
|
*
|
4 |
|
* @author
Moxiecode
|
|
7 |
|
* @author
Moxiecode
|
5 |
|
*
@copyright
Copyright
©
2004-200
7
,
Moxiecode
Systems
AB,
All
rights
reserved.
|
|
8 |
|
*
@copyright
Copyright
©
2004-200
8
,
Moxiecode
Systems
AB,
All
rights
reserved.
|
6 |
|
*/
|
|
9 |
|
*/
|
7 |
|
|
|
10 |
|
|
8 |
|
var TinyMC
E_SimpleTh
eme = {
|
|
11 |
|
(function(
) {
|
9 |
|
// Lis
t of butto
n ids in t
ile map
|
|
12 |
|
var DO
M = tinymc
e.DOM;
|
10 |
|
_butto
nMap : 'bo
ld,bullist
,cleanup,i
talic,numl
ist,redo,s
trikethrou
gh,underli
ne,undo',
|
|
|
11 |
|
|
|
13 |
|
|
12 |
|
getEdi
torTemplat
e : functi
on() {
|
|
14 |
|
// Tel
l it to lo
ad theme s
pecific la
nguage pac
k(s)
|
13 |
|
va
r html = '
';
|
|
15 |
|
tinymc
e.ThemeMan
ager.requi
reLangPack
('simple')
;
|
14 |
|
|
|
16 |
|
|
15 |
|
ht
ml += '<ta
ble class=
"mceEditor
" border="
0" cellpad
ding="0" c
ellspacing
="0" width
="{$width}
" height="
{$height}"
>';
|
|
17 |
|
tinymc
e.create('
tinymce.th
emes.Simpl
eTheme', {
|
16 |
|
ht
ml += '<tr
><td align
="center">
';
|
|
18 |
|
in
it : funct
ion(ed, ur
l) {
|
17 |
|
ht
ml += '<sp
an id="{$e
ditor_id}"
>IFRAME</s
pan>';
|
|
19 |
|
var t =
this, stat
es = ['Bol
d', 'Itali
c', 'Under
line', 'St
rikethroug
h', 'Inser
tUnordered
List', 'In
sertOrdere
dList'], s
= ed.sett
ings;
|
18 |
|
ht
ml += '</t
d></tr>';
|
|
|
19 |
|
ht
ml += '<tr
><td class
="mceToolb
ar" align=
"center" h
eight="1">
';
|
|
|
20 |
|
ht
ml += tiny
MCE.getBut
tonHTML('b
old', 'lan
g_bold_des
c', '{$the
meurl}/ima
ges/{$lang
_bold_img}
', 'Bold')
;
|
|
|
21 |
|
ht
ml += tiny
MCE.getBut
tonHTML('i
talic', 'l
ang_italic
_desc', '{
$themeurl}
/images/{$
lang_itali
c_img}', '
Italic');
|
|
|
22 |
|
ht
ml += tiny
MCE.getBut
tonHTML('u
nderline',
'lang_und
erline_des
c', '{$the
meurl}/ima
ges/{$lang
_underline
_img}', 'U
nderline')
;
|
|
|
23 |
|
ht
ml += tiny
MCE.getBut
tonHTML('s
trikethrou
gh', 'lang
_striketro
ugh_desc',
'{$themeu
rl}/images
/strikethr
ough.gif',
'Striketh
rough');
|
|
|
24 |
|
ht
ml += '<im
g src="{$t
hemeurl}/i
mages/sepa
rator.gif"
width="2"
height="2
0" class="
mceSeparat
orLine" />
';
|
|
|
25 |
|
ht
ml += tiny
MCE.getBut
tonHTML('u
ndo', 'lan
g_undo_des
c', '{$the
meurl}/ima
ges/undo.g
if', 'Undo
');
|
|
|
26 |
|
ht
ml += tiny
MCE.getBut
tonHTML('r
edo', 'lan
g_redo_des
c', '{$the
meurl}/ima
ges/redo.g
if', 'Redo
');
|
|
|
27 |
|
ht
ml += '<im
g src="{$t
hemeurl}/i
mages/sepa
rator.gif"
width="2"
height="2
0" class="
mceSeparat
orLine" />
';
|
|
|
28 |
|
ht
ml += tiny
MCE.getBut
tonHTML('c
leanup', '
lang_clean
up_desc',
'{$themeur
l}/images/
cleanup.gi
f', 'mceCl
eanup');
|
|
|
29 |
|
ht
ml += '<im
g src="{$t
hemeurl}/i
mages/sepa
rator.gif"
width="2"
height="2
0" class="
mceSeparat
orLine" />
';
|
|
|
30 |
|
ht
ml += tiny
MCE.getBut
tonHTML('b
ullist', '
lang_bulli
st_desc',
'{$themeur
l}/images/
bullist.gi
f', 'Inser
tUnordered
List');
|
|
|
31 |
|
ht
ml += tiny
MCE.getBut
tonHTML('n
umlist', '
lang_numli
st_desc',
'{$themeur
l}/images/
numlist.gi
f', 'Inser
tOrderedLi
st');
|
|
|
32 |
|
ht
ml += '</t
d></tr></t
able>';
|
|
|
33 |
|
|
|
20 |
|
|
34 |
|
re
turn {
|
|
21 |
|
t.editor
= ed;
|
35 |
|
delta_wi
dth : 0,
|
|
22 |
|
|
36 |
|
delta_he
ight : 20,
|
|
23 |
|
ed.onIni
t.add(func
tion() {
|
37 |
|
html : h
tml
|
|
24 |
|
ed.o
nNodeChang
e.add(func
tion(ed, c
m) {
|
38 |
|
};
|
|
25 |
|
tinymce.ea
ch(states,
function(
c) {
|
|
|
26 |
|
cm.get
(c.toLower
Case()).se
tActive(ed
.queryComm
andState(c
));
|
|
|
27 |
|
});
|
|
|
28 |
|
});
|
|
|
29 |
|
|
|
|
30 |
|
ed.d
om.loadCSS
(url + "/s
kins/" + s
.skin + "/
content.cs
s");
|
|
|
31 |
|
});
|
|
|
32 |
|
|
|
|
33 |
|
DOM.load
CSS(url +
"/skins/"
+ s.skin +
"/ui.css"
);
|
39 |
|
},
|
|
34 |
|
},
|
40 |
|
|
|
35 |
|
|
41 |
|
handleNod
e
Cha
n
g
e
:
function(
edit
o
r_id,
node
)
{
|
|
36 |
|
r
e
n
d
e
rUI
:
function(
o
)
{
|
42 |
|
//
Reset old
states
|
|
37 |
|
var t =
this, n =
o.targetNo
de, ic, tb
, ed = t.e
ditor, cf
= ed.contr
olManager,
sc;
|
43 |
|
ti
nyMCE.swit
chClass(ed
itor_id +
'_bold', '
mceButtonN
ormal');
|
|
|
44 |
|
ti
nyMCE.swit
chClass(ed
itor_id +
'_italic',
'mceButto
nNormal');
|
|
|
45 |
|
ti
nyMCE.swit
chClass(ed
itor_id +
'_underlin
e', 'mceBu
ttonNormal
');
|
|
|
46 |
|
ti
nyMCE.swit
chClass(ed
itor_id +
'_striketh
rough', 'm
ceButtonNo
rmal');
|
|
|
47 |
|
ti
nyMCE.swit
chClass(ed
itor_id +
'_bullist'
, 'mceButt
onNormal')
;
|
|
|
48 |
|
ti
nyMCE.swit
chClass(ed
itor_id +
'_numlist'
, 'mceButt
onNormal')
;
|
|
|
49 |
|
|
|
38 |
|
|
50 |
|
//
Handle el
ements
|
|
39 |
|
n = DOM.
insertAfte
r(DOM.crea
te('span',
{id : ed.
id + '_con
tainer', '
class' : '
mceEditor
' + ed.set
tings.skin
+ 'Simple
Skin'}), n
);
|
51 |
|
do
{
|
|
40 |
|
n = sc =
DOM.add(n
, 'table',
{cellPadd
ing : 0, c
ellSpacing
: 0, 'cla
ss' : 'mce
Layout'});
|
52 |
|
switch (
node.nodeN
ame.toLowe
rCase()) {
|
|
41 |
|
n = tb =
DOM.add(n
, 'tbody')
;
|
53 |
|
case
"b":
|
|
|
54 |
|
case
"strong":
|
|
|
55 |
|
tinyMCE.sw
itchClass(
editor_id
+ '_bold',
'mceButto
nSelected'
);
|
|
|
56 |
|
brea
k;
|
|
|
57 |
|
|
|
42 |
|
|
58 |
|
case
"i":
|
|
43 |
|
// Creat
e iframe c
ontainer
|
59 |
|
case
"em":
|
|
44 |
|
n = DOM.
add(tb, 't
r');
|
60 |
|
tinyMCE.sw
itchClass(
editor_id
+ '_italic
', 'mceBut
tonSelecte
d');
|
|
45 |
|
n = ic =
DOM.add(D
OM.add(n,
'td'), 'di
v', {'clas
s' : 'mceI
frameConta
iner'});
|
61 |
|
brea
k;
|
|
|
62 |
|
|
|
46 |
|
|
63 |
|
case
"u":
|
|
47 |
|
// Creat
e toolbar
container
|
64 |
|
tinyMCE.sw
itchClass(
editor_id
+ '_underl
ine', 'mce
ButtonSele
cted');
|
|
48 |
|
n = DOM.
add(DOM.ad
d(tb, 'tr'
, {'class'
: 'last'}
), 'td', {
'class' :
'mceToolba
r mceLast'
, align :
'center'})
;
|
65 |
|
brea
k;
|
|
|
66 |
|
|
|
49 |
|
|
67 |
|
case
"strike":
|
|
50 |
|
// Creat
e toolbar
|
68 |
|
tinyMCE.sw
itchClass(
editor_id
+ '_strike
through',
'mceButton
Selected')
;
|
|
51 |
|
tb = t.t
oolbar = c
f.createTo
olbar("too
ls1");
|
69 |
|
brea
k;
|
|
52 |
|
tb.add(c
f.createBu
tton('bold
', {title
: 'simple.
bold_desc'
, cmd : 'B
old'}));
|
|
|
53 |
|
tb.add(c
f.createBu
tton('ital
ic', {titl
e : 'simpl
e.italic_d
esc', cmd
: 'Italic'
}));
|
|
|
54 |
|
tb.add(c
f.createBu
tton('unde
rline', {t
itle : 'si
mple.under
line_desc'
, cmd : 'U
nderline'}
));
|
|
|
55 |
|
tb.add(c
f.createBu
tton('stri
kethrough'
, {title :
'simple.s
triketroug
h_desc', c
md : 'Stri
kethrough'
}));
|
|
|
56 |
|
tb.add(c
f.createSe
parator())
;
|
|
|
57 |
|
tb.add(c
f.createBu
tton('undo
', {title
: 'simple.
undo_desc'
, cmd : 'U
ndo'}));
|
|
|
58 |
|
tb.add(c
f.createBu
tton('redo
', {title
: 'simple.
redo_desc'
, cmd : 'R
edo'}));
|
|
|
59 |
|
tb.add(c
f.createSe
parator())
;
|
|
|
60 |
|
tb.add(c
f.createBu
tton('clea
nup', {tit
le : 'simp
le.cleanup
_desc', cm
d : 'mceCl
eanup'}));
|
|
|
61 |
|
tb.add(c
f.createSe
parator())
;
|
|
|
62 |
|
tb.add(c
f.createBu
tton('inse
rtunordere
dlist', {t
itle : 'si
mple.bulli
st_desc',
cmd : 'Ins
ertUnorder
edList'}))
;
|
|
|
63 |
|
tb.add(c
f.createBu
tton('inse
rtorderedl
ist', {tit
le : 'simp
le.numlist
_desc', cm
d : 'Inser
tOrderedLi
st'}));
|
|
|
64 |
|
tb.rende
rTo(n);
|
70 |
|
|
|
65 |
|
|
71 |
|
case
"ul":
|
|
66 |
|
return {
|
72 |
|
tinyMCE.sw
itchClass(
editor_id
+ '_bullis
t', 'mceBu
ttonSelect
ed');
|
|
67 |
|
ifra
meContaine
r : ic,
|
73 |
|
break
;
|
|
68 |
|
edit
orContaine
r : ed.id
+ '_contai
ner',
|
|
|
69 |
|
size
Container
: sc,
|
|
|
70 |
|
delt
aHeight :
-20
|
|
|
71 |
|
}
;
|
|
|
72 |
|
},
|
74 |
|
|
|
73 |
|
|
75 |
|
case
"ol":
|
|
74 |
|
ge
tInfo : fu
nction() {
|
76 |
|
tinyMCE.sw
itchClass(
editor_id
+ '_numlis
t', 'mceBu
ttonSelect
ed');
|
|
75 |
|
return {
|
77 |
|
brea
k;
|
|
76 |
|
long
name : 'Si
mple theme
',
|
|
|
77 |
|
auth
or : 'Moxi
ecode Syst
ems AB',
|
|
|
78 |
|
auth
orurl : 'h
ttp://tiny
mce.moxiec
ode.com',
|
|
|
79 |
|
vers
ion : tiny
mce.majorV
ersion + "
." + tinym
ce.minorVe
rsion
|
78 |
|
}
|
|
80 |
|
}
|
79 |
|
}
while ((no
de = node.
parentNode
) != null)
;
|
|
|
80 |
|
}
|
|
81 |
|
}
|
81 |
|
}
;
|
|
82 |
|
}
)
;
|
82 |
|
|
|
83 |
|
|
83 |
|
tiny
MCE
.
add
Theme
(
"
simple
"
,
T
iny
MCE_
SimpleThem
e);
|
|
84 |
|
tiny
mce
.
Theme
Manager.ad
d
(
'
simple
'
,
t
iny
mce.themes
.
SimpleThem
e);
|
84 |
|
tinyMCE.ad
dButtonMap
(TinyMCE_S
impleTheme
._buttonMa
p);
|
|
85 |
|
})();
|