HtmlToText
");$bk("__ie_onload").onreadystatechange=function(){if(this.readystate=="complete"){bklib.domloaded()}}}}window.onload=bklib.domloaded}};function $bk(a){if(typeof (a)=="string"){a=document.getelementbyid(a)}return(a&&!a.appendto)?bkextend(a,bkelement.prototype):a}var bkevent={addevent:function(a,b){if(b){this.eventlist=this.eventlist||{};this.eventlist[a]=this.eventlist[a]||[];this.eventlist[a].push(b)}return this},fireevent:function(){var a=bklib.toarray(arguments),c=a.shift();if(this.eventlist&&this.eventlist[c]){for(var b=0;b ")}this.instancedoc=document.defaultview;this.elm.addevent("mousedown",this.selected.closurelistener(this)).addevent("keypress",this.keydown.closurelistener(this)).addevent("focus",this.selected.closure(this)).addevent("blur",this.blur.closure(this)).addevent("keyup",this.selected.closure(this));this.ne.fireevent("add",this)},remove:function(){this.savecontent();if(this.copyelm||this.options.haspanel){this.editorcontain.remove();this.e.setstyle({display:"block"});this.ne.removepanel()}this.disable();this.ne.fireevent("remove",this)},disable:function(){this.elm.setattribute("contenteditable","false")},getsel:function(){return(window.getselection)?window.getselection():document.selection},getrng:function(){var a=this.getsel();if(!a||a.rangecount===0){return }return(a.rangecount 0)?a.getrangeat(0):a.createrange()},selrng:function(a,b){if(window.getselection){b.removeallranges();b.addrange(a)}else{a.select()}},selelm:function(){var c=this.getrng();if(!c){return }if(c.startcontainer){var d=c.startcontainer;if(c.clonecontents().childnodes.length==1){for(var b=0;b ":b;this.initialcontent=b;this.elmframe=new bkelement("iframe").setattributes({src:"javascript:;",frameborder:0,allowtransparency:"true",scrolling:"no"}).setstyle({height:"100px",width:"100%"}).addclass("frame").appendto(this.elm);if(this.copyelm){this.elmframe.setstyle({width:(this.elm.offsetwidth-4)+"px"})}var a=["font-size","font-family","font-weight","color"];for(itm in a){this.savedstyles[bklib.camelize(itm)]=this.elm.getstyle(itm)}settimeout(this.initframe.closure(this),50)},disable:function(){this.elm.innerhtml=this.getcontent()},initframe:function(){var b=$bk(this.elmframe.contentwindow.document);b.designmode="on";b.open();var a=this.ne.options.externalcss;b.write(" "+((a)?' ':"")+' '+this.initialcontent+" ");b.close();this.framedoc=b;this.framewin=$bk(this.elmframe.contentwindow);this.framecontent=$bk(this.framewin.document.body).setstyle(this.savedstyles);this.instancedoc=this.framewin.document.defaultview;this.heightupdate();this.framedoc.addevent("mousedown",this.selected.closurelistener(this)).addevent("keyup",this.heightupdate.closurelistener(this)).addevent("keydown",this.keydown.closurelistener(this)).addevent("keyup",this.selected.closure(this));this.ne.fireevent("add",this)},getelm:function(){return this.framecontent},setcontent:function(a){this.content=a;this.ne.fireevent("set",this);this.framecontent.innerhtml=this.content;this.heightupdate()},getsel:function(){return(this.framewin)?this.framewin.getselection():this.framedoc.selection},heightupdate:function(){this.elmframe.style.height=math.max(this.framecontent.offsetheight,this.initialheight)+"px"},niccommand:function(b,a){this.framedoc.execcommand(b,false,a);settimeout(this.heightupdate.closure(this),100)}}); var niceditorpanel=bkclass.extend({construct:function(e,b,a){this.elm=e;this.options=b;this.ne=a;this.panelbuttons=new array();this.buttonlist=bkextend([],this.ne.options.buttonlist);this.panelcontain=new bkelement("div").setstyle({overflow:"hidden",width:"100%",border:"1px solid #cccccc",backgroundcolor:"#efefef"}).addclass("panelcontain");this.panelelm=new bkelement("div").setstyle({margin:"2px",margintop:"0px",zoom:1,overflow:"hidden"}).addclass("panel").appendto(this.panelcontain);this.panelcontain.appendto(e);var c=this.ne.options;var d=c.buttons;for(button in d){this.addbutton(button,c,true)}this.reorder();e.noselect()},addbutton:function(buttonname,options,noorder){var button=options.buttons[buttonname];var type=(button.type)?eval("(typeof("+button.type+') == "undefined") ? null : '+button.type+";"):niceditorbutton;var hasbutton=bklib.inarray(this.buttonlist,buttonname);if(type&&(hasbutton||this.ne.options.fullpanel)){this.panelbuttons.push(new type(this.panelelm,buttonname,options,this.ne));if(!hasbutton){this.buttonlist.push(buttonname)}}},findbutton:function(b){for(var a=0;a '+this.sel[itm]+" ")}}});var niceditorfontfamilyselect=niceditorselect.extend({sel:{"oregano":"oregano",arial:"arial","roboto slab":"roboto slab",serif:"serif"},init:function(){this.setdisplay("font family...");for(itm in this.sel){this.add(itm,' '+this.sel[itm]+" ")}}});var niceditorfontformatselect=niceditorselect.extend({sel:{p:"paragraph",pre:"pre",h6:"heading 6",h5:"heading 5",h4:"heading 4",h3:"heading 3",h2:"heading 2",h1:"heading 1"},init:function(){this.setdisplay("font format...");for(itm in this.sel){var a=itm.touppercase();this.add(" "," '+this.sel[itm]+" ")}}});niceditors.registerplugin(nicplugin,nicselectoptions); var nicbuttontips=bkclass.extend({construct:function(a){this.ne=a;a.addevent("buttonover",this.show.closure(this)).addevent("buttonout",this.hide.closure(this))},show:function(a){this.timer=settimeout(this.create.closure(this,a),400)},create:function(a){this.timer=null;if(!this.pane){this.pane=new niceditorpane(a.button,this.ne,{fontsize:"12px",margintop:"5px"});this.pane.setcontent(a.options.name)}},hide:function(a){if(this.timer){cleartimeout(this.timer)}if(this.pane){this.pane=this.pane.remove()}}});niceditors.registerplugin(nicbuttontips); var niceditoradvancedbutton=niceditorbutton.extend({init:function(){this.ne.addevent("selected",this.removepane.closure(this)).addevent("blur",/*this.removepane.closure(this)*/function(){})},mouseclick:function(){if(!this.isdisabled){if(this.pane&&this.pane.pane){this.removepane()}else{this.pane=new niceditorpane(this.contain,this.ne,{width:(this.width||"400px"),backgroundcolor:"#fff"},this);this.addpane();this.ne.selectedinstance.saverng()}}},addform:function(c,g){this.form=new bkelement("form").addevent("submit",this.submit.closurelistener(this));this.pane.append(this.form);this.inputs={};for(itm in c){var d=c[itm];var f="";if(g){f=g.getattribute(itm)}if(!f){f=d.value||""}var a=c[itm].type;if(a=="title"){new bkelement("div").setcontent(d.txt).setstyle({fontsize:"14px",fontweight:"bold",padding:"0px",margin:"2px 0"}).appendto(this.form)}else{var b=new bkelement("div").setstyle({overflow:"hidden",clear:"both"}).appendto(this.form);if(d.txt){new bkelement("label").setattributes({"for":itm}).setcontent(d.txt).setstyle({margin:"2px 4px",fontsize:"13px",width:"100px",lineheight:"20px",textalign:"left","float":"left"}).appendto(b)}switch(a){case"text":this.inputs[itm]=new bkelement("input").setattributes({id:itm,value:f,type:"text"}).setstyle({margin:"2px 0",fontsize:"13px","float":"left",height:"20px",border:"1px solid #ccc",overflow:"hidden"}).setstyle(d.style).appendto(b);break;case"select":this.inputs[itm]=new bkelement("select").setattributes({id:itm}).setstyle({border:"1px solid #ccc","float":"left",margin:"2px 0"}).appendto(b);for(opt in d.options){var e=new bkelement("option").setattributes({value:opt,selected:(opt==f)?"selected":""}).setcontent(d.options[opt]).appendto(this.inputs[itm])}break;case"content":this.inputs[itm]=new bkelement("textarea").setattributes({id:itm}).setstyle({border:"1px solid #ccc","float":"left"}).setstyle(d.style).appendto(b);this.inputs[itm].value=f}}}new bkelement("input").setattributes({type:"submit"}).setstyle({border:"1px solid #ccc",margin:"10px 158px","float":"left",clear:"both"}).appendto(this.form);var monformualire = this.form ;$(monformualire).attr('id','monformulaire');this.form.onsubmit=bklib.cancelevent},submit:function(){},findelm:function(b,a,e){var d=this.ne.selectedinstance.getelm().getelementsbytagname(b);for(var c=0;c "}if(o==""&&q=="span"){a=false}if(a){g+=" "}