orbit-basic/public/assets/tinymce/tiny_mce_jquery-d449dd25bbf...

6 lines
184 KiB
JavaScript
Raw Normal View History

2012-03-20 06:38:01 +00:00
(function(a){var b=/^\s*|\s*$/g,c,d="B".replace(/A(.)|B/,"$1")==="$1",e={majorVersion:"3",minorVersion:"4.8",releaseDate:"2012-02-02",_init:function(){function l(a){return a.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(a.src)?(/_(src|dev)\.js/g.test(a.src)&&(b.suffix="_src"),(j=a.src.indexOf("?"))!=-1&&(b.query=a.src.substring(j+1)),b.baseURL=a.src.substring(0,a.src.lastIndexOf("/")),i&&b.baseURL.indexOf("://")==-1&&b.baseURL.indexOf("/")!==0&&(b.baseURL=i+b.baseURL),b.baseURL):null}var b=this,c=document,d=navigator,e=d.userAgent,f,g,h,i,j,k;b.isOpera=a.opera&&opera.buildNumber,b.isWebKit=/WebKit/.test(e),b.isIE=!b.isWebKit&&!b.isOpera&&/MSIE/gi.test(e)&&/Explorer/gi.test(d.appName),b.isIE6=b.isIE&&/MSIE [56]/.test(e),b.isIE7=b.isIE&&/MSIE [7]/.test(e),b.isIE8=b.isIE&&/MSIE [8]/.test(e),b.isIE9=b.isIE&&/MSIE [9]/.test(e),b.isGecko=!b.isWebKit&&/Gecko/.test(e),b.isMac=e.indexOf("Mac")!=-1,b.isAir=/adobeair/i.test(e),b.isIDevice=/(iPad|iPhone)/.test(e),b.isIOS5=b.isIDevice&&e.match(/AppleWebKit\/(\d*)/)[1]>=534;if(a.tinyMCEPreInit){b.suffix=tinyMCEPreInit.suffix,b.baseURL=tinyMCEPreInit.base,b.query=tinyMCEPreInit.query;return}b.suffix="",g=c.getElementsByTagName("base");for(f=0;f<g.length;f++)if(k=g[f].href)/^https?:\/\/[^\/]+$/.test(k)&&(k+="/"),i=k?k.match(/.*\//)[0]:"";g=c.getElementsByTagName("script");for(f=0;f<g.length;f++)if(l(g[f]))return;h=c.getElementsByTagName("head")[0];if(h){g=h.getElementsByTagName("script");for(f=0;f<g.length;f++)if(l(g[f]))return}return},is:function(a,b){return b?b=="array"&&a.hasOwnProperty&&a instanceof Array?!0:typeof a==b:a!==c},makeMap:function(a,b,c){var d;a=a||[],b=b||",",typeof a=="string"&&(a=a.split(b)),c=c||{},d=a.length;while(d--)c[a[d]]={};return c},each:function(a,b,d){var e,f;if(!a)return 0;d=d||a;if(a.length!==c){for(e=0,f=a.length;e<f;e++)if(b.call(d,a[e],e,a)===!1)return 0}else for(e in a)if(a.hasOwnProperty(e)&&b.call(d,a[e],e,a)===!1)return 0;return 1},trim:function(a){return(a?""+a:"").replace(b,"")},create:function(a,b,c){var d=this,e,f,g,h,i,j=0;a=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(a),g=a[3].match(/(^|\.)(\w+)$/i)[2],f=d.createNS(a[3].replace(/\.\w+$/,""),c);if(f[g])return;if(a[2]=="static"){f[g]=b,this.onCreate&&this.onCreate(a[2],a[3],f[g]);return}b[g]||(b[g]=function(){},j=1),f[g]=b[g],d.extend(f[g].prototype,b),a[5]&&(e=d.resolve(a[5]).prototype,h=a[5].match(/\.(\w+)$/i)[1],i=f[g],j?f[g]=function(){return e[h].apply(this,arguments)}:f[g]=function(){return this.parent=e[h],i.apply(this,arguments)},f[g].prototype[g]=f[g],d.each(e,function(a,b){f[g].prototype[b]=e[b]}),d.each(b,function(a,b){e[b]?f[g].prototype[b]=function(){return this.parent=e[b],a.apply(this,arguments)}:b!=g&&(f[g].prototype[b]=a)})),d.each(b["static"],function(a,b){f[g][b]=a}),this.onCreate&&this.onCreate(a[2],a[3],f[g].prototype)},walk:function(a,b,c,d){d=d||this,a&&(c&&(a=a[c]),e.each(a,function(a,g){if(b.call(d,a,g,c)===!1)return!1;e.walk(a,b,c,d)}))},createNS:function(b,c){var d,e;c=c||a,b=b.split(".");for(d=0;d<b.length;d++)e=b[d],c[e]||(c[e]={}),c=c[e];return c},resolve:function(b,c){var d,e;c=c||a,b=b.split(".");for(d=0,e=b.length;d<e;d++){c=c[b[d]];if(!c)break}return c},addUnload:function(b,c){var d=this;b={func:b,scope:c||this};if(!d.unloads){function e(){var b=d.unloads,c,g;if(b){for(g in b)c=b[g],c&&c.func&&c.func.call(c.scope,1);a.detachEvent?(a.detachEvent("onbeforeunload",f),a.detachEvent("onunload",e)):a.removeEventListener&&a.removeEventListener("unload",e,!1),d.unloads=c=b=w=e=0,a.CollectGarbage&&CollectGarbage()}}function f(){var b=document;if(b.readyState=="interactive"){function c(){b.detachEvent("onstop",c),e&&e(),b=0}b&&b.attachEvent("onstop",c),a.setTimeout(function(){b&&b.detachEvent("onstop",c)},0)}}a.attachEvent?(a.attachEvent("onunload",e),a.attachEvent("onbeforeunload",f)):a.addEventListener&&a.addEventListener("unload",e,!1),d.unloads=[b]}else d.unloads.push(b);return b},removeUnload:function(a){var b=this.unloads,c=null;return e.each(b,function(d,e){if(d&&d.func==a)return b.splice(e,1),c=a,!1}),c},explode:function(a,b){return a?e.map(a
f.length;c<d;c++)g=f[c],g.name!=="id"&&(h[h.length]={name:g.name,value:g.value},h.map[g.name]=g.value);b.attributes=h}return b.value=a.value,b.shortEnded=a.shortEnded,b},wrap:function(a){var b=this;return b.parent.insert(a,b),a.append(b),b},unwrap:function(){var a=this,b,c;for(b=a.firstChild;b;)c=b.next,a.insert(b,a,!0),b=c;a.remove()},remove:function(){var a=this,b=a.parent,c=a.next,d=a.prev;return b&&(b.firstChild===a?(b.firstChild=c,c&&(c.prev=null)):d.next=c,b.lastChild===a?(b.lastChild=d,d&&(d.next=null)):c.prev=d,a.parent=a.next=a.prev=null),a},append:function(a){var b=this,c;return a.parent&&a.remove(),c=b.lastChild,c?(c.next=a,a.prev=c,b.lastChild=a):b.lastChild=b.firstChild=a,a.parent=b,a},insert:function(a,b,c){var d;return a.parent&&a.remove(),d=b.parent||this,c?(b===d.firstChild?d.firstChild=a:b.prev.next=a,a.prev=b.prev,a.next=b,b.prev=a):(b===d.lastChild?d.lastChild=a:b.next.prev=a,a.next=b.next,a.prev=b,b.next=a),a.parent=d,a},getAll:function(a){var b=this,c,e=[];for(c=b.firstChild;c;c=d(c,b))c.name===a&&e.push(c);return e},empty:function(){var a=this,b,c,e;if(a.firstChild){b=[];for(e=a.firstChild;e;e=d(e,a))b.push(e);c=b.length;while(c--)e=b[c],e.parent=e.firstChild=e.lastChild=e.next=e.prev=null}return a.firstChild=a.lastChild=null,a},isEmpty:function(a){var c=this,e=c.firstChild,f,g;if(e)do{if(e.type===1){if(e.attributes.map["data-mce-bogus"])continue;if(a[e.name])return!1;f=e.attributes.length;while(f--){g=e.attributes[f].name;if(g==="name"||g.indexOf("data-")===0)return!1}}if(e.type===3&&!b.test(e.value))return!1}while(e=d(e,c));return!0},walk:function(a){return d(this,null,a)}}),a.extend(e,{create:function(a,b){var d,f;d=new e(a,c[a]||1);if(b)for(f in b)d.attr(f,b[f]);return d}}),a.html.Node=e}(tinymce),function(a){var b=a.html.Node;a.html.DomParser=function(c,d){function j(c){var f,g,h,i,j,k,l,m,n,o,p,q,r,s;q=a.makeMap("tr,td,th,tbody,thead,tfoot,table"),p=d.getNonEmptyElements();for(f=0;f<c.length;f++){g=c[f];if(!g.parent)continue;i=[g];for(h=g.parent;h&&!d.isValidChild(h.name,g.name)&&!q[h.name];h=h.parent)i.push(h);if(h&&i.length>1){i.reverse(),j=k=e.filterNode(i[0].clone());for(n=0;n<i.length-1;n++){d.isValidChild(k.name,i[n].name)?(l=e.filterNode(i[n].clone()),k.append(l)):l=k;for(m=i[n].firstChild;m&&m!=i[n+1];)s=m.next,l.append(m),m=s;k=l}j.isEmpty(p)?h.insert(g,i[0],!0):(h.insert(j,i[0],!0),h.insert(g,j)),h=i[0],(h.isEmpty(p)||h.firstChild===h.lastChild&&h.firstChild.name==="br")&&h.empty().remove()}else if(g.parent){if(g.name==="li"){r=g.prev;if(!r||r.name!=="ul"&&r.name!=="ul"){r=g.next;if(!r||r.name!=="ul"&&r.name!=="ul"){g.wrap(e.filterNode(new b("ul",1)));continue}r.insert(g,r.firstChild,!0);continue}r.append(g);continue}d.isValidChild(g.parent.name,"div")&&d.isValidChild("div",g.name)?g.wrap(e.filterNode(new b("div",1))):g.name==="style"||g.name==="script"?g.empty().remove():g.unwrap()}}}var e=this,f={},g=[],h={},i={};c=c||{},c.validate="validate"in c?c.validate:!0,c.root_name=c.root_name||"body",e.schema=d=d||new a.html.Schema,e.filterNode=function(a){var b,c,d;c in f&&(d=h[c],d?d.push(a):h[c]=[a]),b=g.length;while(b--)c=g[b].name,c in a.attributes.map&&(d=i[c],d?d.push(a):i[c]=[a]);return a},e.addNodeFilter=function(b,c){a.each(a.explode(b),function(a){var b=f[a];b||(f[a]=b=[]),b.push(c)})},e.addAttributeFilter=function(b,c){a.each(a.explode(b),function(a){var b;for(b=0;b<g.length;b++)if(g[b].name===a){g[b].callbacks.push(c);return}g.push({name:a,callbacks:[c]})})},e.parse=function(e,k){function F(){var a=m.firstChild,b,c;while(a)b=a.next,a.type==3||a.type==1&&a.name!=="p"&&!w[a.name]&&!a.attr("data-mce-type")?c?c.append(a):(c=G(E,1),m.insert(c,a),c.append(a)):c=null,a=b}function G(a,c){var d=new b(a,c),e;return a in f&&(e=h[a],e?e.push(d):h[a]=[d]),d}function H(a){var b,c,d;for(b=a.prev;b&&b.type===3;)c=b.value.replace(z,""),c.length>0?(b.value=c,b=b.prev):(d=b.prev,b.remove(),b=d)}var l,m,n,o,p,q,r,s,t,u,v,w,x,y=[],z,A,B,C,D,E;k=k||{},h={},i={},w=a.extend(a.makeMap("script,style,head,html,body,title,meta,param"),d.getBlockElements()),D=d.getNonEmptyElements(),C=d.children,v=c.vali
a){l.push(j.add(e,a,g,h))}),l;if(e&&e.hasOwnProperty&&e instanceof Array)return l=[],b(e,function(a){a=c.get(a),l.push(j.add(a,f,g,h))}),l;e=c.get(e);if(!e)return;return i=function(b){if(j.disabled)return;return b=b||window.event,b&&d&&(b.target||(b.target=b.srcElement),a.extend(b,j._stoppers)),h?g.call(h,b):g(b)},f=="unload"?(a.unloads.unshift({func:i}),i):f=="init"?(j.domLoaded?i():j.inits.push(i),i):(k.push({obj:e,name:f,func:g,cfunc:i,scope:h}),j._add(e,f,i),g)},remove:function(a,d,e){var f=this,g=f.events,h=!1,i;return a&&a.hasOwnProperty&&a instanceof Array?(i=[],b(a,function(a){a=c.get(a),i.push(f.remove(a,d,e))}),i):(a=c.get(a),b(g,function(b,c){if(b.obj==a&&b.name==d&&(!e||b.func==e||b.cfunc==e))return g.splice(c,1),f._remove(a,d,b.cfunc),h=!0,!1}),h)},clear:function(a){var b=this,d=b.events,e,f;if(a){a=c.get(a);for(e=d.length-1;e>=0;e--)f=d[e],f.obj===a&&(b._remove(f.obj,f.name,f.cfunc),f.obj=f.cfunc=null,d.splice(e,1))}},cancel:function(a){return a?(this.stop(a),this.prevent(a)):!1},stop:function(a){return a.stopPropagation?a.stopPropagation():a.cancelBubble=!0,!1},prevent:function(a){return a.preventDefault?a.preventDefault():a.returnValue=!1,!1},destroy:function(){var a=this;b(a.events,function(b,c){a._remove(b.obj,b.name,b.cfunc),b.obj=b.cfunc=null}),a.events=[],a=null},_add:function(a,b,c){a.attachEvent?a.attachEvent("on"+b,c):a.addEventListener?a.addEventListener(b,c,!1):a["on"+b]=c},_remove:function(a,b,c){if(a)try{a.detachEvent?a.detachEvent("on"+b,c):a.removeEventListener?a.removeEventListener(b,c,!1):a["on"+b]=null}catch(d){}},_pageInit:function(a){var c=this;if(c.domLoaded)return;c.domLoaded=!0,b(c.inits,function(a){a()}),c.inits=[]},_wait:function(a){var b=this,c=a.document;if(a.tinyMCE_GZ&&tinyMCE_GZ.loaded){b.domLoaded=1;return}c.attachEvent?(c.attachEvent("onreadystatechange",function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",arguments.callee),b._pageInit(a))}),c.documentElement.doScroll&&a==a.top&&function(){if(b.domLoaded)return;try{c.documentElement.doScroll("left")}catch(d){setTimeout(arguments.callee,0);return}b._pageInit(a)}()):c.addEventListener&&b._add(a,"DOMContentLoaded",function(){b._pageInit(a)}),b._add(a,"load",function(){b._pageInit(a)})},_stoppers:{preventDefault:function(){this.returnValue=!1},stopPropagation:function(){this.cancelBubble=!0}}}),f=a.dom.Event=new a.dom.EventUtils,f._wait(window),a.addUnload(function(){f.destroy()})}(tinymce),function(a){a.dom.Element=function(b,c){var d=this,e,f;d.settings=c=c||{},d.id=b,d.dom=e=c.dom||a.DOM,a.isIE||(f=e.get(d.id)),a.each("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get".split(/,/),function(a){d[a]=function(){var c=[b],f;for(f=0;f<arguments.length;f++)c.push(arguments[f]);return c=e[a].apply(e,c),d.update(a),c}}),a.extend(d,{on:function(b,c,e){return a.dom.Event.add(d.id,b,c,e)},getXY:function(){return{x:parseInt(d.getStyle("left")),y:parseInt(d.getStyle("top"))}},getSize:function(){var a=e.get(d.id);return{w:parseInt(d.getStyle("width")||a.clientWidth),h:parseInt(d.getStyle("height")||a.clientHeight)}},moveTo:function(a,b){d.setStyles({left:a,top:b})},moveBy:function(a,b){var c=d.getXY();d.moveTo(c.x+a,c.y+b)},resizeTo:function(a,b){d.setStyles({width:a,height:b})},resizeBy:function(a,b){var c=d.getSize();d.resizeTo(c.w+a,c.h+b)},update:function(b){var f;if(a.isIE6&&c.blocker){b=b||"";if(b.indexOf("get")===0||b.indexOf("has")===0||b.indexOf("is")===0)return;if(b=="remove"){e.remove(d.blocker);return}d.blocker?f=e.get(d.blocker):(d.blocker=e.uniqueId(),f=e.add(c.container||e.getRoot(),"iframe",{id:d.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'}),e.setStyle(f,"opacity",0)),e.setStyles(f,{left:d.getStyle("left",1),top:d.getStyle("top",1),width:d.getStyle("width",1),height:d.getStyle("height",1),display:d.getStyle("display",1),zIndex:parseInt(d.getStyle("zIndex",1)||0)-1})}}})}}(tinymce),function(a){function b(a){return a.replace(/[\n\r]+/g,"")}var c=a.is,
this.editor.forcedHighContrastMode)?d+='<img class="mceIcon" src="'+c.image+'" alt="'+b.encode(c.title)+'" />'+e:d+='<span class="mceIcon '+c["class"]+'"></span>'+(e?'<span class="'+a+'Label">'+e+"</span>":""),d+='<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="'+this.id+'_voice">'+c.title+"</span>",d+="</a>",d},postRender:function(){var b=this,c=b.settings,d;a.isIE&&b.editor&&a.dom.Event.add(b.id,"mousedown",function(a){d=b.editor.selection.getBookmark()}),a.dom.Event.add(b.id,"click",function(e){if(!b.isDisabled())return a.isIE&&b.editor&&d&&a.activeEditor.selection.moveToBookmark(d),c.onclick.call(c.scope,e)}),a.dom.Event.add(b.id,"keyup",function(d){if(!b.isDisabled()&&d.keyCode==a.VK.SPACEBAR)return c.onclick.call(c.scope,d)})}})}(tinymce),function(a){var b=a.DOM,c=a.dom.Event,d=a.each,e=a.util.Dispatcher;a.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(b,c,d){var f=this;f.parent(b,c,d),f.items=[],f.onChange=new e(f),f.onPostRender=new e(f),f.onAdd=new e(f),f.onRenderMenu=new a.util.Dispatcher(this),f.classPrefix="mceListBox"},select:function(a){var b=this,c,e;if(a==undefined)return b.selectByIndex(-1);a&&a.call?e=a:e=function(b){return b==a},a!=b.selectedValue&&(d(b.items,function(a,d){if(e(a.value))return c=1,b.selectByIndex(d),!1}),c||b.selectByIndex(-1))},selectByIndex:function(a){var c=this,d,e,f;a!=c.selectedIndex&&(d=b.get(c.id+"_text"),f=b.get(c.id+"_voiceDesc"),e=c.items[a],e?(c.selectedValue=e.value,c.selectedIndex=a,b.setHTML(d,b.encode(e.title)),b.setHTML(f,c.settings.title+" - "+e.title),b.removeClass(d,"mceTitle"),b.setAttrib(c.id,"aria-valuenow",e.title)):(b.setHTML(d,b.encode(c.settings.title)),b.setHTML(f,b.encode(c.settings.title)),b.addClass(d,"mceTitle"),c.selectedValue=c.selectedIndex=null,b.setAttrib(c.id,"aria-valuenow",c.settings.title)),d=0)},add:function(b,c,d){var e=this;d=d||{},d=a.extend(d,{title:b,value:c}),e.items.push(d),e.onAdd.dispatch(e,d)},getLength:function(){return this.items.length},renderHTML:function(){var a="",c=this,d=c.settings,e=c.classPrefix;return a='<span role="listbox" aria-haspopup="true" aria-labelledby="'+c.id+'_voiceDesc" aria-describedby="'+c.id+'_voiceDesc"><table role="presentation" tabindex="0" id="'+c.id+'" cellpadding="0" cellspacing="0" class="'+e+" "+e+"Enabled"+(d["class"]?" "+d["class"]:"")+'"><tbody><tr>',a+="<td>"+b.createHTML("span",{id:c.id+"_voiceDesc","class":"voiceLabel",style:"display:none;"},c.settings.title),a+=b.createHTML("a",{id:c.id+"_text",tabindex:-1,href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},b.encode(c.settings.title))+"</td>",a+="<td>"+b.createHTML("a",{id:c.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},'<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">▼</span></span>')+"</td>",a+="</tr></tbody></table></span>",a},showMenu:function(){var e=this,f,g=b.get(this.id),h;if(e.isDisabled()||e.items.length==0)return;if(e.menu&&e.menu.isMenuVisible)return e.hideMenu();e.isMenuRendered||(e.renderMenu(),e.isMenuRendered=!0),f=b.getPos(g),h=e.menu,h.settings.offset_x=f.x,h.settings.offset_y=f.y,h.settings.keyboard_focus=!a.isOpera,e.oldID&&h.items[e.oldID].setSelected(0),d(e.items,function(a){a.value===e.selectedValue&&(h.items[a.id].setSelected(1),e.oldID=a.id)}),h.showMenu(0,g.clientHeight),c.add(b.doc,"mousedown",e.hideMenu,e),b.addClass(e.id,e.classPrefix+"Selected")},hideMenu:function(a){var d=this;if(d.menu&&d.menu.isMenuVisible){b.removeClass(d.id,d.classPrefix+"Selected");if(!(!a||a.type!="mousedown"||a.target.id!=d.id+"_text"&&a.target.id!=d.id+"_open"))return;if(!a||!b.getParent(a.target,".mceMenu"))b.removeClass(d.id,d.classPrefix+"Selected"),c.remove(b.doc,"mousedown",d.hideMenu,d),d.menu.hideMenu()}},renderMenu:function(){var a=this,c;c=a.settings.control_manager.createDropMenu(a.id+"_menu",{menu_line:1,"class":a.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150}),c.onHideMenu.add(function(){a.hideMenu(),a.focus()}),c.add({title:a.settings.title,"cla
d.dom.setAttrib(a,c,b)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),f("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(a){d.formatter.register(a,{block:a,remove:"all"})}),d.formatter.register(d.settings.formats),d.undoManager=new a.UndoManager(d),d.undoManager.onAdd.add(function(a,b){if(a.hasUndo())return d.onChange.dispatch(d,b,a)}),d.undoManager.onUndo.add(function(a,b){return d.onUndo.dispatch(d,b,a)}),d.undoManager.onRedo.add(function(a,b){return d.onRedo.dispatch(d,b,a)}),d.forceBlocks=new a.ForceBlocks(d,{forced_root_block:e.forced_root_block}),d.editorCommands=new a.EditorCommands(d),d.serializer.onPreProcess.add(function(a,b){return d.onPreProcess.dispatch(d,b,a)}),d.serializer.onPostProcess.add(function(a,b){return d.onPostProcess.dispatch(d,b,a)}),d.onPreInit.dispatch(d),e.gecko_spellcheck||(d.getBody().spellcheck=0),e.readonly||d._addEvents(),d.controlManager.onPostRender.dispatch(d,d.controlManager),d.onPostRender.dispatch(d),d.quirks=new a.util.Quirks(this),e.directionality&&(d.getBody().dir=e.directionality),e.nowrap&&(d.getBody().style.whiteSpace="nowrap"),e.handle_node_change_callback&&d.onNodeChange.add(function(a,b,c){d.execCallback("handle_node_change_callback",d.id,c,-1,-1,!0,d.selection.isCollapsed())}),e.save_callback&&d.onSaveContent.add(function(a,b){var c=d.execCallback("save_callback",d.id,b.content,d.getBody());c&&(b.content=c)}),e.onchange_callback&&d.onChange.add(function(a,b){d.execCallback("onchange_callback",d,b)}),e.protect&&d.onBeforeSetContent.add(function(a,b){e.protect&&f(e.protect,function(a){b.content=b.content.replace(a,function(a){return"<!--mce:protected "+escape(a)+"-->"})})}),e.convert_newlines_to_brs&&d.onBeforeSetContent.add(function(a,b){b.initial&&(b.content=b.content.replace(/\r?\n/g,"<br />"))}),e.preformatted&&d.onPostProcess.add(function(a,b){b.content=b.content.replace(/^\s*<pre.*?>/,""),b.content=b.content.replace(/<\/pre>\s*$/,""),b.set&&(b.content='<pre class="mceItemHidden">'+b.content+"</pre>")}),e.verify_css_classes&&(d.serializer.attribValueFilter=function(a,b){var c,e;return a=="class"?(d.classesRE||(e=d.dom.getClasses(),e.length>0&&(c="",f(e,function(a){c+=(c?"|":"")+a["class"]}),d.classesRE=new RegExp("("+c+")","gi"))),!d.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(b)||d.classesRE.test(b)?b:""):b}),e.cleanup_callback&&(d.onBeforeSetContent.add(function(a,b){b.content=d.execCallback("cleanup_callback","insert_to_editor",b.content,b)}),d.onPreProcess.add(function(a,b){b.set&&d.execCallback("cleanup_callback","insert_to_editor_dom",b.node,b),b.get&&d.execCallback("cleanup_callback","get_from_editor_dom",b.node,b)}),d.onPostProcess.add(function(a,b){b.set&&(b.content=d.execCallback("cleanup_callback","insert_to_editor",b.content,b)),b.get&&(b.content=d.execCallback("cleanup_callback","get_from_editor",b.content,b))})),e.save_callback&&d.onGetContent.add(function(a,b){b.save&&(b.content=d.execCallback("save_callback",d.id,b.content,d.getBody()))}),e.handle_event_callback&&d.onEvent.add(function(a,b,e){d.execCallback("handle_event_callback",b,a,e)===!1&&c.cancel(b)}),d.onSetContent.add(function(){d.addVisual(d.getBody())}),e.padd_empty_editor&&d.onPostProcess.add(function(a,b){b.content=b.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")});if(g){function m(a,b){f(a.dom.select("a"),function(b){var c=b.parentNode;a.dom.isBlock(c)&&c.lastChild===b&&a.dom.add(c,"br",{"data-mce-bogus":1})})}d.onExecCommand.add(function(a,b){b==="CreateLink"&&m(a)}),d.onSetContent.add(d.selection.onSetContent.add(m))}d.load({initial:!0,format:"html"}),d.startContent=d.getContent({format:"raw"}),d.undoManager.add(),d.initialized=!0,d.onInit.dispatch(d),d.execCallback("setupcontent_callback",d.id,d.getBody(),d.getDoc()),d.execCallback("init_instance_callback",d),d.focus(!0),d.nodeChange
innerHTML=y.firstChild.innerHTML),z.firstChild&&z.firstChild.nodeName==x&&(z.innerHTML=z.firstChild.innerHTML),d.isEmpty(y)&&I(y,r),d.isEmpty(z)&&(G=I(z,t)),e&&parseFloat(opera.version())<9.5?(m.insertNode(y),m.insertNode(z)):(m.insertNode(z),m.insertNode(y)),z.normalize(),y.normalize(),c.selection.select(z,!0),c.selection.collapse(!0),E=c.dom.getPos(z).y,(E<D.y||E+25>D.y+D.h)&&c.getWin().scrollTo(0,E<D.y?E:E-D.h+25),c.undoManager.add(),i},backspaceDelete:function(c,d){var e=this,f=e.editor,g=f.getBody(),h=f.dom,j,k=f.selection,l=k.getRng(),m=l.startContainer,j,n,o,p;if(!d&&l.collapsed&&m.nodeType==1&&l.startOffset==m.childNodes.length){p=new a.dom.TreeWalker(m.lastChild,m);for(j=m.lastChild;j;j=p.prev())if(j.nodeType==3){l.setStart(j,j.nodeValue.length),l.collapse(!0),k.setRng(l);return}}if(m&&f.dom.isBlock(m)&&!/^(TD|TH)$/.test(m.nodeName)&&d)if(m.childNodes.length==0||m.childNodes.length==1&&m.firstChild.nodeName=="BR"){j=m;while((j=j.previousSibling)&&!f.dom.isBlock(j));if(j){if(m!=g.firstChild){n=f.dom.doc.createTreeWalker(j,NodeFilter.SHOW_TEXT,null,i);while(o=n.nextNode())j=o;l=f.getDoc().createRange(),l.setStart(j,j.nodeValue?j.nodeValue.length:0),l.setEnd(j,j.nodeValue?j.nodeValue.length:0),k.setRng(l),f.dom.remove(m)}return b.cancel(c)}}}})}(tinymce),function(a){var b=a.DOM,c=a.dom.Event,d=a.each,e=a.extend;a.create("tinymce.ControlManager",{ControlManager:function(b,c){var e=this,f;c=c||{},e.editor=b,e.controls={},e.onAdd=new a.util.Dispatcher(e),e.onPostRender=new a.util.Dispatcher(e),e.prefix=c.prefix||b.id+"_",e._cls={},e.onPostRender.add(function(){d(e.controls,function(a){a.postRender()})})},get:function(a){return this.controls[this.prefix+a]||this.controls[a]},setActive:function(a,b){var c=null;return(c=this.get(a))&&c.setActive(b),c},setDisabled:function(a,b){var c=null;return(c=this.get(a))&&c.setDisabled(b),c},add:function(a){var b=this;return a&&(b.controls[a.id]=a,b.onAdd.dispatch(a,b)),a},createControl:function(a){var b,c=this,e=c.editor;d(e.plugins,function(d){if(d.createControl){b=d.createControl(a,c);if(b)return!1}});switch(a){case"|":case"separator":return c.createSeparator()}return!b&&e.buttons&&(b=e.buttons[a])?c.createButton(a,b):c.add(b)},createDropMenu:function(b,c,d){var f=this,g=f.editor,h,i,j,k;c=e({"class":"mceDropDown",constrain:g.settings.constrain_menus},c),c["class"]=c["class"]+" "+g.getParam("skin")+"Skin";if(j=g.getParam("skin_variant"))c["class"]+=" "+g.getParam("skin")+"Skin"+j.substring(0,1).toUpperCase()+j.substring(1);return b=f.prefix+b,k=d||f._cls.dropmenu||a.ui.DropMenu,h=f.controls[b]=new k(b,c),h.onAddItem.add(function(a,b){var c=b.settings;c.title=g.getLang(c.title,c.title),c.onclick||(c.onclick=function(a){c.cmd&&g.execCommand(c.cmd,c.ui||!1,c.value)})}),g.onRemove.add(function(){h.destroy()}),a.isIE&&(h.onShowMenu.add(function(){g.focus(),i=g.selection.getBookmark(1)}),h.onHideMenu.add(function(){i&&(g.selection.moveToBookmark(i),i=0)})),f.add(h)},createListBox:function(b,d,f){function l(b){return b.settings.use_accessible_selects&&!a.isGecko}var g=this,h=g.editor,i,j,k;return g.get(b)?null:(d.title=h.translate(d.title),d.scope=d.scope||h,d.onselect||(d.onselect=function(a){h.execCommand(d.cmd,d.ui||!1,a||d.value)}),d=e({title:d.title,"class":"mce_"+b,scope:d.scope,control_manager:g},d),b=g.prefix+b,h.settings.use_native_selects||l(h)?j=new a.ui.NativeListBox(b,d):(k=f||g._cls.listbox||a.ui.ListBox,j=new k(b,d,h)),g.controls[b]=j,a.isWebKit&&j.onPostRender.add(function(a,b){c.add(b,"mousedown",function(){h.bookmark=h.selection.getBookmark(1)}),c.add(b,"focus",function(){h.selection.moveToBookmark(h.bookmark),h.bookmark=null})}),j.hideMenu&&h.onMouseDown.add(j.hideMenu,j),g.add(j))},createButton:function(b,c,d){var f=this,g=f.editor,h,i,j;return f.get(b)?null:(c.title=g.translate(c.title),c.label=g.translate(c.label),c.scope=c.scope||g,!c.onclick&&!c.menu_button&&(c.onclick=function(){g.execCommand(c.cmd,c.ui||!1,c.value)}),c=e({title:c.title,"class":"mce_"+b,unavailable_prefix:g.getLang("unavailable",""),scope:c.scope,control_manager:f},c),b=f.prefix+b,c.menu_button