diff --git a/admin/tinyeditor/packed.js b/admin/tinyeditor/packed.js new file mode 100644 index 0000000..ab0d066 --- /dev/null +++ b/admin/tinyeditor/packed.js @@ -0,0 +1,257 @@ +TINY={}; + +function T$(i) +{ + return document.getElementById(i) +} + +function T$$$() +{ + return document.all?1:0 +} + +TINY.editor=function() +{ + var c=[],offset=-30; + c['cut']=[1,'Couper','a','cut',1]; + c['copy']=[2,'Copier','a','copy',1]; + c['paste']=[3,'Coller','a','paste',1]; + c['bold']=[4,'Gras','a','bold']; + c['italic']=[5,'Italique','a','italic']; + c['underline']=[6,'Souligner','a','underline']; + c['strikethrough']=[7,'Rayer','a','strikethrough']; + c['subscript']=[8,'Indice','a','subscript']; + c['superscript']=[9,'Exposant','a','superscript']; + c['orderedlist']=[10,'Numérotation','a','insertorderedlist']; + c['unorderedlist']=[11,'Puce','a','insertunorderedlist']; + c['outdent']=[12,'Diminuer retrait','a','outdent']; + c['indent']=[13,'Augmenter retrait','a','indent']; + c['leftalign']=[14,'Alignement gauche','a','justifyleft']; + c['centeralign']=[15,'Alignement centre','a','justifycenter']; + c['rightalign']=[16,'Alignement droite','a','justifyright']; + c['blockjustify']=[17,'Justification','a','justifyfull']; + c['undo']=[18,'Annuler','a','undo']; + c['redo']=[19,'Rétablir','a','redo']; + c['image']=[20,'Inserer une image','i','insertimage','Enter Image URL:','http://']; + c['hr']=[21,'Inserer une barre horizontale','a','inserthorizontalrule']; + c['link']=[22,'Inserer un lien','i','createlink','Enter URL:','http://']; + c['unlink']=[23,'Retirer un lien','a','unlink']; + c['unformat']=[24,'Retirer la mise en page','a','removeformat']; + c['print']=[25,'Imprimer','a','print']; + //c['color']=[26,'Color','a','color']; + + function edit(n,a) + { + this.n=n; + window[n]=this; + this.t=T$(a.id); + this.obj=a; + this.xhtml=a.xhtml; + var p=document.createElement('div'),w=document.createElement('div'),h=document.createElement('div'),l=a.controls.length,i=0; + this.i=document.createElement('iframe'); + this.i.frameBorder=0; + this.i.width=a.width||'500'; + this.i.height=a.height||'250'; + this.ie=T$$$(); + h.className='teheader'; + p.className=a.cssclass||'te'; + p.style.width=this.i.width+'px'; + p.appendChild(h); + + for(i;i'],['Header 1','

'],['Header 2','

'],['Header 3','

'],['Header 4','

'],['Header 5','

'],['Header 6','
']],sl=styles.length,x=0; + g.className='testyle'; + g.onchange=new Function(this.n+'.ddaction(this,"formatblock")'); + + for(x;x' + } + if(a.css) + { + m+='' + } + m+=''+(a.content||this.t.value); + m+='';this.e.write(m); + this.e.close(); + this.e.designMode='on'; + this.d=1; + if(this.xhtml) + { + try + { + this.e.execCommand("styleWithCSS",0,0) + } + catch(e) + { + try + { + this.e.execCommand("useCSS",0,1) + } + catch(e){} + } + } + }; + edit.prototype.print=function() + { + 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; + 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); + 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.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); + document.addEventListener('mouseup',this.sr,1)}},edit.prototype.move=function(e){var a=TINY.cursor.top(e); + 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); + 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>/gi,'$1'); + v=v.replace(/(.*)<\/em>/gi,'$1')}this.e.body.innerHTML=v; + this.t.style.display='none'; + this.i.style.display='block'; + this.d=1} + else{ + var v=this.e.body.innerHTML; + if(this.xhtml) + { + v=v.replace(/<[^>]*>/g,function(a){return a.toLowerCase()}); + v=v.replace(/(.*)<\/span>/g,'$1'); + v=v.replace(/ class="apple-style-span"/g,''); + v=v.replace(//g,''); + v=v.replace(/
/g,'
'); + v=v.replace(/
$/g,''); + v=v.replace(/^
/g,''); + v=v.replace(/(]+[^\/])>/gi,'$1 />'); + v=v.replace(/]*>(.*?)<\/b[^>]*>/g,'$1'); + v=v.replace(/]*>(.*?)<\/i[^>]*>/g,'$1'); + v=v.replace(/]*>(.*?)<\/u[^>]*>/g,'$1'); + 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,'<$4>$3'); + v=v.replace(/(.*)<\/span>/g,'$1'); + v=v.replace(/(.*)<\/span>/g,'$1'); + v=v.replace(/(.*)<\/span>/g,'$1'); + v=v.replace(/(.*)<\/span>|]*>(.*?)<\/b[^>]*>/g,'$1') + } + + 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 + } + } + }(); \ No newline at end of file diff --git a/admin/tinyeditor/style.css b/admin/tinyeditor/style.css new file mode 100644 index 0000000..aaad868 --- /dev/null +++ b/admin/tinyeditor/style.css @@ -0,0 +1,22 @@ +#input {border:none; margin:0; padding:0; font:10px 'Courier New',Verdana; border:0} +.te select{ +padding: 1px; +} + +.te {border:1px solid #5EB2DC; padding:0 1px 1px; font:12px Verdana,Arial} +.te iframe {border:none} +.teheader {height:31px; border-bottom:1px solid #5EB2DC; background:url(images/header-bg.gif) repeat-x; padding-top:1px} +.teheader select {float:left; margin-top:5px} +.tefont {margin-left:12px} +.tesize {margin:0 3px} +.testyle {margin-right:12px} +.tecolor {margin:0 3px} +.tedivider {float:left; width:1px; height:30px; background:#ccc} +.tecontrol {float:left; width:34px; height:30px; cursor:pointer; background-image:url(images/icons.png)} +.tecontrol:hover {background-color:#fff; background-position:30px 0} +.tefooter {height:32px; border-top:1px solid #5EB2DC; background:#f5f5f5} +.toggle {float:left; background:url(images/icons.png) -34px 2px no-repeat; padding:9px 13px 0 31px; height:23px; border-right:1px solid #ccc; cursor:pointer; color:#666} +.toggle:hover {background-color:#fff} +.resize {float:right; height:32px; width:32px; background:url(images/resize.gif) 15px 15px no-repeat; } + +#editor {cursor:text;} \ No newline at end of file