1 |
|
tinyMCE.im
portPlugin
LanguagePa
ck('style'
);var Tiny
MCE_StyleP
lugin={get
Info:funct
ion(){retu
rn{longnam
e:'Style',
author:'Mo
xiecode Sy
stems AB',
authorurl:
'http://ti
nymce.moxi
ecode.com'
,infourl:'
http://wik
i.moxiecod
e.com/inde
x.php/Tiny
MCE:Plugin
s/style',v
ersion:tin
yMCE.major
Version+".
"+tinyMCE.
minorVersi
on}},getCo
ntrolHTML:
function(c
n){switch(
cn){case"s
tyleprops"
:return ti
nyMCE.getB
uttonHTML(
cn,'lang_s
tyle_style
info_desc'
,'{$plugin
url}/image
s/stylepro
ps.gif','m
ceStylePro
ps',true)}
return""},
execComman
d:function
(editor_id
,element,c
ommand,use
r_interfac
e,value){v
ar e,inst;
switch(com
mand){case
"mceStyleP
rops":Tiny
MCE_StyleP
lugin._sty
leProps();
return tru
e;case"mce
SetElement
Style":ins
t=tinyMCE.
getInstanc
eById(edit
or_id);e=i
nst.select
ion.getFoc
usElement(
);if(e){e.
style.cssT
ext=value;
inst.repai
nt()}retur
n true}ret
urn false}
,handleNod
eChange:fu
nction(edi
tor_id,nod
e,undo_ind
ex,undo_le
vels,visua
l_aid,any_
selection)
{if(node.n
odeName=='
BODY')tiny
MCE.switch
Class(edit
or_id+'_st
yleprops',
'mceButton
Disabled')
;else tiny
MCE.switch
Class(edit
or_id+'_st
yleprops',
'mceButton
Normal')},
_styleProp
s:function
(){var e=t
inyMCE.sel
ectedInsta
nce.select
ion.getFoc
usElement(
);if(!e||e
.nodeName=
='BODY')re
turn;tinyM
CE.openWin
dow({file:
'../../plu
gins/style
/props.htm
',width:48
0+tinyMCE.
getLang('l
ang_style_
props_delt
a_width',0
),height:3
20+tinyMCE
.getLang('
lang_style
_props_del
ta_height'
,0)},{edit
or_id:tiny
MCE.select
edInstance
.editorId,
inline:"ye
s",style_t
ext:e.styl
e.cssText}
)}};tinyMC
E.addPlugi
n("style",
TinyMCE_St
ylePlugin)
;
|
|
1 |
|
(function(
){tinymce.
create('ti
nymce.plug
ins.StyleP
lugin',{in
it:functio
n(ed,url){
ed.addComm
and('mceSt
yleProps',
function()
{ed.window
Manager.op
en({file:u
rl+'/props
.htm',widt
h:480+pars
eInt(ed.ge
tLang('sty
le.delta_w
idth',0)),
height:320
+parseInt(
ed.getLang
('style.de
lta_height
',0)),inli
ne:1},{plu
gin_url:ur
l,style_te
xt:ed.sele
ction.getN
ode().styl
e.cssText}
);});ed.ad
dCommand('
mceSetElem
entStyle',
function(u
i,v){if(e=
ed.selecti
on.getNode
()){ed.dom
.setAttrib
(e,'style'
,v);ed.exe
cCommand('
mceRepaint
');}});ed.
addButton(
'styleprop
s',{title:
'style.des
c',cmd:'mc
eStyleProp
s'});},get
Info:funct
ion(){retu
rn{longnam
e:'Style',
author:'Mo
xiecode Sy
stems AB',
authorurl:
'http://ti
nymce.moxi
ecode.com'
,infourl:'
http://wik
i.moxiecod
e.com/inde
x.php/Tiny
MCE:Plugin
s/style',v
ersion:tin
ymce.major
Version+".
"+tinymce.
minorVersi
on};}});ti
nymce.Plug
inManager.
add('style
',tinymce.
plugins.St
ylePlugin)
;})();
|