1 |
|
tinyMCE.im
portPlugin
LanguagePa
ck('advhr'
);var Tiny
MCE_Advanc
edHRPlugin
={getInfo:
function()
{return{lo
ngname:'Ad
vanced HR'
,author:'M
oxiecode S
ystems AB'
,authorurl
:'http://t
inymce.mox
iecode.com
',infourl:
'http://wi
ki.moxieco
de.com/ind
ex.php/Tin
yMCE:Plugi
ns/advhr',
version:ti
nyMCE.majo
rVersion+"
."+tinyMCE
.minorVers
ion}},getC
ontrolHTML
:function(
cn){switch
(cn){case"
advhr":ret
urn tinyMC
E.getButto
nHTML(cn,'
lang_inser
t_advhr_de
sc','{$plu
ginurl}/im
ages/advhr
.gif','mce
AdvancedHr
')}return"
"},execCom
mand:funct
ion(editor
_id,elemen
t,command,
user_inter
face,value
){switch(c
ommand){ca
se"mceAdva
ncedHr":va
r template
=new Array
();templat
e['file']=
'../../plu
gins/advhr
/rule.htm'
;template[
'width']=2
50;templat
e['height'
]=160;temp
late['widt
h']+=tinyM
CE.getLang
('lang_adv
hr_delta_w
idth',0);t
emplate['h
eight']+=t
inyMCE.get
Lang('lang
_advhr_del
ta_height'
,0);var si
ze="",widt
h="",nosha
de="";if(t
inyMCE.sel
ectedEleme
nt!=null&&
tinyMCE.se
lectedElem
ent.nodeNa
me.toLower
Case()=="h
r"){tinyMC
E.hrElemen
t=tinyMCE.
selectedEl
ement;if(t
inyMCE.hrE
lement){si
ze=tinyMCE
.hrElement
.getAttrib
ute('size'
)?tinyMCE.
hrElement.
getAttribu
te('size')
:"";width=
tinyMCE.hr
Element.ge
tAttribute
('width')?
tinyMCE.hr
Element.ge
tAttribute
('width'):
"";noshade
=tinyMCE.h
rElement.g
etAttribut
e('noshade
')?tinyMCE
.hrElement
.getAttrib
ute('nosha
de'):""}ti
nyMCE.open
Window(tem
plate,{edi
tor_id:edi
tor_id,siz
e:size,wid
th:width,n
oshade:nos
hade,mceDo
:'update'}
)}else{if(
tinyMCE.is
MSIE){tiny
MCE.execIn
stanceComm
and(editor
_id,'mceIn
sertConten
t',false,'
<hr />')}e
lse{tinyMC
E.openWind
ow(templat
e,{editor_
id:editor_
id,inline:
"yes",size
:size,widt
h:width,no
shade:nosh
ade,mceDo:
'insert'})
}}return t
rue}return
false},ha
ndleNodeCh
ange:funct
ion(editor
_id,node,u
ndo_index,
undo_level
s,visual_a
id,any_sel
ection){if
(node==nul
l)return;d
o{if(node.
nodeName==
"HR"){tiny
MCE.switch
Class(edit
or_id+'_ad
vhr','mceB
uttonSelec
ted');retu
rn true}}w
hile((node
=node.pare
ntNode));t
inyMCE.swi
tchClass(e
ditor_id+'
_advhr','m
ceButtonNo
rmal');ret
urn true}}
;tinyMCE.a
ddPlugin("
advhr",Tin
yMCE_Advan
cedHRPlugi
n);
|
|
1 |
|
(function(
){tinymce.
create('ti
nymce.plug
ins.Advanc
edHRPlugin
',{init:fu
nction(ed,
url){ed.ad
dCommand('
mceAdvance
dHr',funct
ion(){ed.w
indowManag
er.open({f
ile:url+'/
rule.htm',
width:250+
parseInt(e
d.getLang(
'advhr.del
ta_width',
0)),height
:160+parse
Int(ed.get
Lang('advh
r.delta_he
ight',0)),
inline:1},
{plugin_ur
l:url});})
;ed.addBut
ton('advhr
',{title:'
advhr.advh
r_desc',cm
d:'mceAdva
ncedHr'});
ed.onNodeC
hange.add(
function(e
d,cm,n){cm
.setActive
('advhr',n
.nodeName=
='HR');});
ed.onClick
.add(funct
ion(ed,e){
e=e.target
;if(e.node
Name==='HR
')ed.selec
tion.selec
t(e);});},
getInfo:fu
nction(){r
eturn{long
name:'Adva
nced HR',a
uthor:'Mox
iecode Sys
tems AB',a
uthorurl:'
http://tin
ymce.moxie
code.com',
infourl:'h
ttp://wiki
.moxiecode
.com/index
.php/TinyM
CE:Plugins
/advhr',ve
rsion:tiny
mce.majorV
ersion+"."
+tinymce.m
inorVersio
n};}});tin
ymce.Plugi
nManager.a
dd('advhr'
,tinymce.p
lugins.Adv
ancedHRPlu
gin);})();
|