AEOS Calvarium v0.1.1a
This commit is contained in:
parent
37d5452518
commit
b1cb9e9582
1 changed files with 214 additions and 257 deletions
|
|
@ -1,257 +1,214 @@
|
||||||
TINY={};
|
TINY={};
|
||||||
|
|
||||||
function T$(i)
|
function T$(i){return document.getElementById(i)}
|
||||||
{
|
function T$$$(){return document.all?1:0}
|
||||||
return document.getElementById(i)
|
|
||||||
}
|
TINY.editor=function(){
|
||||||
|
var c=[], offset=-30;
|
||||||
function T$$$()
|
c['cut']=[1,'Cut','a','cut',1];
|
||||||
{
|
c['copy']=[2,'Copy','a','copy',1];
|
||||||
return document.all?1:0
|
c['paste']=[3,'Paste','a','paste',1];
|
||||||
}
|
c['bold']=[4,'Bold','a','bold'];
|
||||||
|
c['italic']=[5,'Italic','a','italic'];
|
||||||
TINY.editor=function()
|
c['underline']=[6,'Underline','a','underline'];
|
||||||
{
|
c['strikethrough']=[7,'Strikethrough','a','strikethrough'];
|
||||||
var c=[],offset=-30;
|
c['subscript']=[8,'Subscript','a','subscript'];
|
||||||
c['cut']=[1,'Couper','a','cut',1];
|
c['superscript']=[9,'Superscript','a','superscript'];
|
||||||
c['copy']=[2,'Copier','a','copy',1];
|
c['orderedlist']=[10,'Insert Ordered List','a','insertorderedlist'];
|
||||||
c['paste']=[3,'Coller','a','paste',1];
|
c['unorderedlist']=[11,'Insert Unordered List','a','insertunorderedlist'];
|
||||||
c['bold']=[4,'Gras','a','bold'];
|
c['outdent']=[12,'Outdent','a','outdent'];
|
||||||
c['italic']=[5,'Italique','a','italic'];
|
c['indent']=[13,'Indent','a','indent'];
|
||||||
c['underline']=[6,'Souligner','a','underline'];
|
c['leftalign']=[14,'Left Align','a','justifyleft'];
|
||||||
c['strikethrough']=[7,'Rayer','a','strikethrough'];
|
c['centeralign']=[15,'Center Align','a','justifycenter'];
|
||||||
c['subscript']=[8,'Indice','a','subscript'];
|
c['rightalign']=[16,'Right Align','a','justifyright'];
|
||||||
c['superscript']=[9,'Exposant','a','superscript'];
|
c['blockjustify']=[17,'Block Justify','a','justifyfull'];
|
||||||
c['orderedlist']=[10,'Numérotation','a','insertorderedlist'];
|
c['undo']=[18,'Undo','a','undo'];
|
||||||
c['unorderedlist']=[11,'Puce','a','insertunorderedlist'];
|
c['redo']=[19,'Redo','a','redo'];
|
||||||
c['outdent']=[12,'Diminuer retrait','a','outdent'];
|
c['image']=[20,'Insert Image','i','insertimage','Enter Image URL:','http://'];
|
||||||
c['indent']=[13,'Augmenter retrait','a','indent'];
|
c['hr']=[21,'Insert Horizontal Rule','a','inserthorizontalrule'];
|
||||||
c['leftalign']=[14,'Alignement gauche','a','justifyleft'];
|
c['link']=[22,'Insert Hyperlink','i','createlink','Enter URL:','http://'];
|
||||||
c['centeralign']=[15,'Alignement centre','a','justifycenter'];
|
c['unlink']=[23,'Remove Hyperlink','a','unlink'];
|
||||||
c['rightalign']=[16,'Alignement droite','a','justifyright'];
|
c['unformat']=[24,'Remove Formatting','a','removeformat'];
|
||||||
c['blockjustify']=[17,'Justification','a','justifyfull'];
|
c['print']=[25,'Print','a','print'];
|
||||||
c['undo']=[18,'Annuler','a','undo'];
|
function edit(n,obj){
|
||||||
c['redo']=[19,'Rétablir','a','redo'];
|
this.n=n; window[n]=this; this.t=T$(obj.id); this.obj=obj; this.xhtml=obj.xhtml;
|
||||||
c['image']=[20,'Inserer une image','i','insertimage','Enter Image URL:','http://'];
|
var p=document.createElement('div'), w=document.createElement('div'), h=document.createElement('div'),
|
||||||
c['hr']=[21,'Inserer une barre horizontale','a','inserthorizontalrule'];
|
l=obj.controls.length, i=0;
|
||||||
c['link']=[22,'Inserer un lien','i','createlink','Enter URL:','http://'];
|
this.i=document.createElement('iframe'); this.i.frameBorder=0;
|
||||||
c['unlink']=[23,'Retirer un lien','a','unlink'];
|
this.i.width=obj.width||'500'; this.i.height=obj.height||'250'; this.ie=T$$$();
|
||||||
c['unformat']=[24,'Retirer la mise en page','a','removeformat'];
|
h.className=obj.rowclass||'teheader'; p.className=obj.cssclass||'te'; p.style.width=this.i.width+'px'; p.appendChild(h);
|
||||||
c['print']=[25,'Imprimer','a','print'];
|
for(i;i<l;i++){
|
||||||
//c['color']=[26,'Color','a','color'];
|
var id=obj.controls[i];
|
||||||
|
if(id=='n'){
|
||||||
function edit(n,a)
|
h=document.createElement('div'); h.className=obj.rowclass||'teheader'; p.appendChild(h)
|
||||||
{
|
}else if(id=='|'){
|
||||||
this.n=n;
|
var d=document.createElement('div'); d.className=obj.dividerclass||'tedivider'; h.appendChild(d)
|
||||||
window[n]=this;
|
}else if(id=='font'){
|
||||||
this.t=T$(a.id);
|
var sel=document.createElement('select'), fonts=obj.fonts||['Verdana','Arial','Georgia'], fl=fonts.length, x=0;
|
||||||
this.obj=a;
|
sel.className='tefont'; sel.onchange=new Function(this.n+'.ddaction(this,"fontname")');
|
||||||
this.xhtml=a.xhtml;
|
sel.options[0]=new Option('Font','');
|
||||||
var p=document.createElement('div'),w=document.createElement('div'),h=document.createElement('div'),l=a.controls.length,i=0;
|
for(x;x<fl;x++){
|
||||||
this.i=document.createElement('iframe');
|
var font=fonts[x];
|
||||||
this.i.frameBorder=0;
|
sel.options[x+1]=new Option(font,font)
|
||||||
this.i.width=a.width||'500';
|
}
|
||||||
this.i.height=a.height||'250';
|
h.appendChild(sel)
|
||||||
this.ie=T$$$();
|
}else if(id=='size'){
|
||||||
h.className='teheader';
|
var sel=document.createElement('select'), sizes=obj.sizes||[1,2,3,4,5,6,7], sl=sizes.length, x=0;
|
||||||
p.className=a.cssclass||'te';
|
sel.className='tesize'; sel.onchange=new Function(this.n+'.ddaction(this,"fontsize")');
|
||||||
p.style.width=this.i.width+'px';
|
for(x;x<sl;x++){
|
||||||
p.appendChild(h);
|
var size=sizes[x];
|
||||||
|
sel.options[x]=new Option(size,size)
|
||||||
for(i;i<l;i++)
|
}
|
||||||
{
|
h.appendChild(sel)
|
||||||
var b=a.controls[i];
|
}else if(id=='style'){
|
||||||
if(b=='n')
|
var sel=document.createElement('select'),
|
||||||
{
|
styles=obj.styles||[['Style',''],['Paragraph','<p>'],['Header 1','<h1>'],['Header 2','<h2>'],['Header 3','<h3>'],['Header 4','<h4>'],['Header 5','<h5>'],['Header 6','<h6>']],
|
||||||
h=document.createElement('div');
|
sl=styles.length, x=0;
|
||||||
h.className=a.rowclass||'teheader';
|
sel.className='testyle'; sel.onchange=new Function(this.n+'.ddaction(this,"formatblock")');
|
||||||
p.appendChild(h)
|
for(x;x<sl;x++){
|
||||||
}
|
var style=styles[x];
|
||||||
else if(b=='|')
|
sel.options[x]=new Option(style[0],style[1])
|
||||||
{
|
}
|
||||||
var d=document.createElement('div');
|
h.appendChild(sel)
|
||||||
d.className=a.dividerclass||'tedivider';
|
}else if(c[id]){
|
||||||
h.appendChild(d)
|
var div=document.createElement('div'), x=c[id], func=x[2], ex, pos=x[0]*offset;
|
||||||
}
|
div.className=obj.controlclass;
|
||||||
else if(b=='font')
|
div.style.backgroundPosition='0px '+pos+'px';
|
||||||
{
|
div.title=x[1];
|
||||||
var g=document.createElement('select'),fonts=a.fonts||['Verdana','Arial','Georgia'],fl=fonts.length,x=0;
|
ex=func=='a'?'.action("'+x[3]+'",0,'+(x[4]||0)+')':'.insert("'+x[4]+'","'+x[5]+'","'+x[3]+'")';
|
||||||
g.className='tefont';
|
div.onclick=new Function(this.n+(id=='print'?'.print()':ex));
|
||||||
g.onchange=new Function(this.n+'.ddaction(this,"fontname")');
|
div.onmouseover=new Function(this.n+'.hover(this,'+pos+',1)');
|
||||||
g.options[0]=new Option('Font','');
|
div.onmouseout=new Function(this.n+'.hover(this,'+pos+',0)');
|
||||||
|
h.appendChild(div);
|
||||||
for(x;x<fl;x++)
|
if(this.ie){div.unselectable='on'}
|
||||||
{
|
}
|
||||||
var j=fonts[x];
|
}
|
||||||
g.options[x+1]=new Option(j,j)
|
this.t.parentNode.insertBefore(p,this.t); this.t.style.width=this.i.width+'px';
|
||||||
}
|
w.appendChild(this.t); w.appendChild(this.i); p.appendChild(w); this.t.style.display='none';
|
||||||
h.appendChild(g)
|
if(obj.footer){
|
||||||
}
|
var f=document.createElement('div'); f.className=obj.footerclass||'tefooter';
|
||||||
|
if(obj.toggle){
|
||||||
else if(b=='size')
|
var to=obj.toggle, ts=document.createElement('div');
|
||||||
{
|
ts.className=to.cssclass||'toggle'; ts.innerHTML=obj.toggletext||'source';
|
||||||
var g=document.createElement('select'),sizes=a.sizes||[1,2,3,4,5,6,7],sl=sizes.length,x=0;
|
ts.onclick=new Function(this.n+'.toggle(0,this);return false');
|
||||||
g.className='tesize';
|
f.appendChild(ts)
|
||||||
g.onchange=new Function(this.n+'.ddaction(this,"fontsize")');
|
}
|
||||||
|
if(obj.resize){
|
||||||
for(x;x<sl;x++)
|
var ro=obj.resize, rs=document.createElement('div'); rs.className=ro.cssclass||'resize';
|
||||||
{
|
rs.onmousedown=new Function('event',this.n+'.resize(event);return false');
|
||||||
var k=sizes[x];
|
rs.onselectstart=function(){return false};
|
||||||
g.options[x]=new Option(k,k)
|
f.appendChild(rs)
|
||||||
}
|
}
|
||||||
h.appendChild(g)
|
p.appendChild(f)
|
||||||
}
|
}
|
||||||
else if(b=='style')
|
this.e=this.i.contentWindow.document; this.e.open();
|
||||||
{
|
var m='<html><head>', bodyid=obj.bodyid?" id=\""+obj.bodyid+"\"":"";
|
||||||
var g=document.createElement('select'),styles=a.styles||[['Style',''],['Paragraph','<p>'],['Header 1','<h1>'],['Header 2','<h2>'],['Header 3','<h3>'],['Header 4','<h4>'],['Header 5','<h5>'],['Header 6','<h6>']],sl=styles.length,x=0;
|
if(obj.cssfile){m+='<link rel="stylesheet" href="'+obj.cssfile+'" />'}
|
||||||
g.className='testyle';
|
if(obj.css){m+='<style type="text/css">'+obj.css+'</style>'}
|
||||||
g.onchange=new Function(this.n+'.ddaction(this,"formatblock")');
|
m+='</head><body'+bodyid+'>'+(obj.content||this.t.value);
|
||||||
|
m+='</body></html>';
|
||||||
for(x;x<sl;x++)
|
this.e.write(m);
|
||||||
{
|
this.e.close(); this.e.designMode='on'; this.d=1;
|
||||||
var o=styles[x];
|
if(this.xhtml){
|
||||||
g.options[x]=new Option(o[0],o[1])
|
try{this.e.execCommand("styleWithCSS",0,0)}
|
||||||
}
|
catch(e){try{this.e.execCommand("useCSS",0,1)}catch(e){}}
|
||||||
h.appendChild(g)
|
}
|
||||||
}
|
};
|
||||||
|
edit.prototype.print=function(){
|
||||||
else if(c[b])
|
this.i.contentWindow.print()
|
||||||
{
|
},
|
||||||
var q=document.createElement('div'),x=c[b],func=x[2],ex,pos=x[0]*offset;
|
edit.prototype.hover=function(div,pos,dir){
|
||||||
q.className=a.controlclass;q.style.backgroundPosition='0px '+pos+'px';
|
div.style.backgroundPosition=(dir?'34px ':'0px ')+(pos)+'px'
|
||||||
q.title=x[1];
|
},
|
||||||
ex=func=='a'?'.action("'+x[3]+'",0,'+(x[4]||0)+')':'.insert("'+x[4]+'","'+x[5]+'","'+x[3]+'")';
|
edit.prototype.ddaction=function(dd,a){
|
||||||
q.onclick=new Function(this.n+(b=='print'?'.print()':ex));
|
var i=dd.selectedIndex, v=dd.options[i].value;
|
||||||
q.onmouseover=new Function(this.n+'.hover(this,'+pos+',1)');
|
this.action(a,v)
|
||||||
q.onmouseout=new Function(this.n+'.hover(this,'+pos+',0)');
|
},
|
||||||
h.appendChild(q);
|
edit.prototype.action=function(cmd,val,ie){
|
||||||
if(this.ie)
|
if(ie&&!this.ie){
|
||||||
{
|
alert('Your browser does not support this function.')
|
||||||
q.unselectable='on'
|
}else{
|
||||||
}
|
this.e.execCommand(cmd,0,val||null)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
this.t.parentNode.insertBefore(p,this.t);
|
edit.prototype.insert=function(pro,msg,cmd){
|
||||||
this.t.style.width=this.i.width+'px';
|
var val=prompt(pro,msg);
|
||||||
w.appendChild(this.t);
|
if(val!=null&&val!=''){this.e.execCommand(cmd,0,val)}
|
||||||
w.appendChild(this.i);
|
},
|
||||||
p.appendChild(w);
|
edit.prototype.setfont=function(){
|
||||||
this.t.style.display='none';
|
execCommand('formatblock',0,hType)
|
||||||
if(a.footer)
|
},
|
||||||
{
|
edit.prototype.resize=function(e){
|
||||||
var f=document.createElement('div');
|
if(this.mv){this.freeze()}
|
||||||
f.className=a.footerclass||'tefooter';
|
this.i.bcs=TINY.cursor.top(e);
|
||||||
if(a.toggle)
|
this.mv=new Function('event',this.n+'.move(event)');
|
||||||
{
|
this.sr=new Function(this.n+'.freeze()');
|
||||||
var r=a.toggle,ts=document.createElement('div');
|
if(this.ie){
|
||||||
ts.className=r.cssclass||'toggle';
|
document.attachEvent('onmousemove',this.mv); document.attachEvent('onmouseup',this.sr)
|
||||||
ts.innerHTML=a.toggletext||'source';
|
}else{
|
||||||
ts.onclick=new Function(this.n+'.toggle(0,this);return false');
|
document.addEventListener('mousemove',this.mv,1); document.addEventListener('mouseup',this.sr,1)
|
||||||
f.appendChild(ts)
|
}
|
||||||
}
|
},
|
||||||
if(a.resize)
|
edit.prototype.move=function(e){
|
||||||
{
|
var pos=TINY.cursor.top(e);
|
||||||
var s=a.resize,rs=document.createElement('div');
|
this.i.height=parseInt(this.i.height)+pos-this.i.bcs;
|
||||||
rs.className=s.cssclass||'resize';
|
this.i.bcs=pos
|
||||||
rs.onmousedown=new Function('event',this.n+'.resize(event);return false');
|
},
|
||||||
rs.onselectstart=function(){return false};
|
edit.prototype.freeze=function(){
|
||||||
f.appendChild(rs)
|
if(this.ie){
|
||||||
}
|
document.detachEvent('onmousemove',this.mv); document.detachEvent('onmouseup',this.sr)
|
||||||
p.appendChild(f)
|
}else{
|
||||||
}
|
document.removeEventListener('mousemove',this.mv,1); document.removeEventListener('mouseup',this.sr,1)
|
||||||
this.e=this.i.contentWindow.document;
|
}
|
||||||
this.e.open();
|
},
|
||||||
var m='<html><head>',bodyid=a.bodyid?" id=\""+a.bodyid+"\"":"";
|
edit.prototype.toggle=function(post,div){
|
||||||
if(a.cssfile)
|
if(!this.d){
|
||||||
{
|
var v=this.t.value;
|
||||||
m+='<link rel="stylesheet" href="'+a.cssfile+'" />'
|
if(div){div.innerHTML=this.obj.toggletext||'source'}
|
||||||
}
|
if(this.xhtml&&!this.ie){
|
||||||
if(a.css)
|
v=v.replace(/<strong>(.*)<\/strong>/gi,'<span style="font-weight: bold;">$1</span>');
|
||||||
{
|
v=v.replace(/<em>(.*)<\/em>/gi,'<span style="font-weight: italic;">$1</span>')
|
||||||
m+='<style type="text/css">'+a.css+'</style>'
|
}
|
||||||
}
|
this.e.body.innerHTML=v;
|
||||||
m+='</head><body'+bodyid+'>'+(a.content||this.t.value);
|
this.t.style.display='none'; this.i.style.display='block'; this.d=1
|
||||||
m+='</body></html>';this.e.write(m);
|
}else{
|
||||||
this.e.close();
|
var v=this.e.body.innerHTML;
|
||||||
this.e.designMode='on';
|
if(this.xhtml){
|
||||||
this.d=1;
|
v=v.replace(/<span class="apple-style-span">(.*)<\/span>/gi,'$1');
|
||||||
if(this.xhtml)
|
v=v.replace(/ class="apple-style-span"/gi,'');
|
||||||
{
|
v=v.replace(/<span style="">/gi,'');
|
||||||
try
|
v=v.replace(/<br>/gi,'<br />');
|
||||||
{
|
v=v.replace(/<br ?\/?>$/gi,'');
|
||||||
this.e.execCommand("styleWithCSS",0,0)
|
v=v.replace(/^<br ?\/?>/gi,'');
|
||||||
}
|
v=v.replace(/(<img [^>]+[^\/])>/gi,'$1 />');
|
||||||
catch(e)
|
v=v.replace(/<b\b[^>]*>(.*?)<\/b[^>]*>/gi,'<strong>$1</strong>');
|
||||||
{
|
v=v.replace(/<i\b[^>]*>(.*?)<\/i[^>]*>/gi,'<em>$1</em>');
|
||||||
try
|
v=v.replace(/<u\b[^>]*>(.*?)<\/u[^>]*>/gi,'<span style="text-decoration:underline">$1</span>');
|
||||||
{
|
v=v.replace(/<(b|strong|em|i|u) style="font-weight: normal;?">(.*)<\/(b|strong|em|i|u)>/gi,'$2');
|
||||||
this.e.execCommand("useCSS",0,1)
|
v=v.replace(/<(b|strong|em|i|u) style="(.*)">(.*)<\/(b|strong|em|i|u)>/gi,'<span style="$2"><$4>$3</$4></span>');
|
||||||
}
|
v=v.replace(/<span style="font-weight: normal;?">(.*)<\/span>/gi,'$1');
|
||||||
catch(e){}
|
v=v.replace(/<span style="font-weight: bold;?">(.*)<\/span>/gi,'<strong>$1</strong>');
|
||||||
}
|
v=v.replace(/<span style="font-style: italic;?">(.*)<\/span>/gi,'<em>$1</em>');
|
||||||
}
|
v=v.replace(/<span style="font-weight: bold;?">(.*)<\/span>|<b\b[^>]*>(.*?)<\/b[^>]*>/gi,'<strong>$1</strong>')
|
||||||
};
|
}
|
||||||
edit.prototype.print=function()
|
if(div){div.innerHTML=this.obj.toggletext||'wysiwyg'}
|
||||||
{
|
this.t.value=v;
|
||||||
this.i.contentWindow.print()},edit.prototype.hover=function(a,b,c){a.style.backgroundPosition=(c?'34px ':'0px ')+(b)+'px'},edit.prototype.ddaction=function(b,a){var i=b.selectedIndex,v=b.options[i].value;
|
if(!post){
|
||||||
this.action(a,v)},edit.prototype.action=function(a,b,c){if(c&&!this.ie){alert('Your browser does not support this function.')}else{this.e.execCommand(a,0,b||null)}},edit.prototype.insert=function(a,b,c){var d=prompt(a,b);
|
this.t.style.height=this.i.height+'px';
|
||||||
if(d!=null&&d!=''){this.e.execCommand(c,0,d)}},edit.prototype.setfont=function(){execCommand('formatblock',0,hType)},edit.prototype.resize=function(e){if(this.mv){this.freeze()}this.i.bcs=TINY.cursor.top(e);
|
this.i.style.display='none'; this.t.style.display='block'; this.d=0
|
||||||
this.mv=new Function('event',this.n+'.move(event)');
|
}
|
||||||
this.sr=new Function(this.n+'.freeze()');
|
}
|
||||||
if(this.ie){document.attachEvent('onmousemove',this.mv);
|
},
|
||||||
document.attachEvent('onmouseup',this.sr)}else{document.addEventListener('mousemove',this.mv,1);
|
edit.prototype.post=function(){
|
||||||
document.addEventListener('mouseup',this.sr,1)}},edit.prototype.move=function(e){var a=TINY.cursor.top(e);
|
if(this.d){this.toggle(1)}
|
||||||
this.i.height=parseInt(this.i.height)+a-this.i.bcs;this.i.bcs=a},edit.prototype.freeze=function(){if(this.ie){document.detachEvent('onmousemove',this.mv);
|
};
|
||||||
document.detachEvent('onmouseup',this.sr)}else{document.removeEventListener('mousemove',this.mv,1);
|
return{edit:edit}
|
||||||
document.removeEventListener('mouseup',this.sr,1)}},edit.prototype.toggle=function(b,c){if(!this.d){var v=this.t.value;if(c){c.innerHTML=this.obj.toggletext||'source'}if(this.xhtml&&!this.ie){v=v.replace(/<strong>(.*)<\/strong>/gi,'<span style="font-weight: bold;">$1</span>');
|
}();
|
||||||
v=v.replace(/<em>(.*)<\/em>/gi,'<span style="font-weight: italic;">$1</span>')}this.e.body.innerHTML=v;
|
|
||||||
this.t.style.display='none';
|
TINY.cursor=function(){
|
||||||
this.i.style.display='block';
|
return{
|
||||||
this.d=1}
|
top:function(e){
|
||||||
else{
|
return T$$$()?window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop:e.clientY+window.scrollY
|
||||||
var v=this.e.body.innerHTML;
|
}
|
||||||
if(this.xhtml)
|
}
|
||||||
{
|
}();
|
||||||
v=v.replace(/<[^>]*>/g,function(a){return a.toLowerCase()});
|
|
||||||
v=v.replace(/<span class="apple-style-span">(.*)<\/span>/g,'$1');
|
|
||||||
v=v.replace(/ class="apple-style-span"/g,'');
|
|
||||||
v=v.replace(/<span style="">/g,'');
|
|
||||||
v=v.replace(/<br>/g,'<br />');
|
|
||||||
v=v.replace(/<br ?\/?>$/g,'');
|
|
||||||
v=v.replace(/^<br ?\/?>/g,'');
|
|
||||||
v=v.replace(/(<img [^>]+[^\/])>/gi,'$1 />');
|
|
||||||
v=v.replace(/<b\b[^>]*>(.*?)<\/b[^>]*>/g,'<strong>$1</strong>');
|
|
||||||
v=v.replace(/<i\b[^>]*>(.*?)<\/i[^>]*>/g,'<em>$1</em>');
|
|
||||||
v=v.replace(/<u\b[^>]*>(.*?)<\/u[^>]*>/g,'<span style="text-decoration:underline">$1</span>');
|
|
||||||
v=v.replace(/<(b|strong|em|i|u) style="font-weight: normal;?">(.*)<\/(b|strong|em|i|u)>/g,'$2');
|
|
||||||
v=v.replace(/<(b|strong|em|i|u) style="(.*)">(.*)<\/(b|strong|em|i|u)>/g,'<span style="$2"><$4>$3</$4></span>');
|
|
||||||
v=v.replace(/<span style="font-weight: normal;?">(.*)<\/span>/g,'$1');
|
|
||||||
v=v.replace(/<span style="font-weight: bold;?">(.*)<\/span>/g,'<strong>$1</strong>');
|
|
||||||
v=v.replace(/<span style="font-style: italic;?">(.*)<\/span>/g,'<em>$1</em>');
|
|
||||||
v=v.replace(/<span style="font-weight: bold;?">(.*)<\/span>|<b\b[^>]*>(.*?)<\/b[^>]*>/g,'<strong>$1</strong>')
|
|
||||||
}
|
|
||||||
|
|
||||||
if(c)
|
|
||||||
{
|
|
||||||
c.innerHTML=this.obj.toggletext||'wysiwyg'
|
|
||||||
}
|
|
||||||
this.t.value=v;
|
|
||||||
|
|
||||||
if(!b)
|
|
||||||
{
|
|
||||||
this.t.style.height=this.i.height+'px';
|
|
||||||
this.i.style.display='none';
|
|
||||||
this.t.style.display='block';
|
|
||||||
this.d=0
|
|
||||||
}}},edit.prototype.post=function(){if(this.d){this.toggle(1)}};
|
|
||||||
return{edit:edit}}();
|
|
||||||
TINY.cursor=function()
|
|
||||||
{
|
|
||||||
return
|
|
||||||
{
|
|
||||||
top:function(e)
|
|
||||||
{
|
|
||||||
return T$$$()?window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop:e.clientY+window.scrollY
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue