orbit-basic/public/assets/tinymce/tiny_mce.js

7 lines
196 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},map:function(a,b){var c=[];return e.each(a,function(a){c.push(b(a))}),c},grep:function(a,b){var c=[];return e.each(a,function(a){(!b||b(a))&&c.push(a)}),c},inArray:function(a,b){var c,d;if(a)for(c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},extend:function(a,b){var d,f,g=arguments;for(d=1,f=g.length;d<f;d++)b=g[d],e.each(b,function(b,d){b!==c&&(a[d]=b)});return a},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.d
,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.validate,E="forced_root_block"in k?k.forced_root_block:c.forced_root_block,B=d.getWhiteSpaceElements(),x=/^[ \t\r\n]+/,z=/[ \t\r\n]+$/,A=/[ \t\r\n]+/g,l=new a.html.SaxParser({validate:v,fix_self_closing:!v,cdata:function(a){n.append(G("#cdata",4)).value=a},text:function(a,b){var c;B[n.name]||(a=a.replace(A," "),n.lastChild&&w[n.lastChild.name]&&(a=a.replace(x,""))),a.length!==0&&(c=G("#text",3),c.raw=!!b,n.append(c).value=a)},comment:function(a){n.append(G("#comment",8)).value=a},pi:function(a,b){n.append(G(a,7)).value=b,H(n)},doctype:function(a){var b;b=n.append(G("#doctype",10)),b.value=a,H(n)},start:function(a,b,c){var e,f,h,j,k,l,m,o;h=v?d.getElementRule(a):{};if(h){e=G(h.outputName||a,1),e.attributes=b,e.shortEnded=c,n.append(e),o=C[n.name],o&&C[e.name]&&!o[e.name]&&y.push(e),f=g.length;while(f--)k=g[f].name,k in b.map&&(t=i[k],t?t
.toString,d=!1,e=!0;[0,0].sort(function(){return e=!1,0});var f=function(b,d,e,i){e=e||[],d=d||document;var j=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var l=[],m,n,o,q,r=!0,s=f.isXML(d),t=b,u,v,w,x;do{a.exec(""),m=a.exec(t);if(m){t=m[3],l.push(m[1]);if(m[2]){q=m[3];break}}}while(m);if(l.length>1&&h.exec(b))if(l.length===2&&g.relative[l[0]])n=p(l[0]+l[1],d);else{n=g.relative[l[0]]?[d]:f(l.shift(),d);while(l.length)b=l.shift(),g.relative[b]&&(b+=l.shift()),n=p(b,n)}else{!i&&l.length>1&&d.nodeType===9&&!s&&g.match.ID.test(l[0])&&!g.match.ID.test(l[l.length-1])&&(u=f.find(l.shift(),d,s),d=u.expr?f.filter(u.expr,u.set)[0]:u.set[0]);if(d){u=i?{expr:l.pop(),set:k(i)}:f.find(l.pop(),l.length!==1||l[0]!=="~"&&l[0]!=="+"||!d.parentNode?d:d.parentNode,s),n=u.expr?f.filter(u.expr,u.set):u.set,l.length>0?o=k(n):r=!1;while(l.length)v=l.pop(),w=v,g.relative[v]?w=l.pop():v="",w==null&&(w=d),g.relative[v](o,w,s)}else o=l=[]}o||(o=n),o||f.error(v||b);if(c.call(o)==="[object Array]")if(!r)e.push.apply(e,o);else if(d&&d.nodeType===1)for(x=0;o[x]!=null;x++)o[x]&&(o[x]===!0||o[x].nodeType===1&&f.contains(d,o[x]))&&e.push(n[x]);else for(x=0;o[x]!=null;x++)o[x]&&o[x].nodeType===1&&e.push(n[x]);else k(o,e);return q&&(f(q,j,e,i),f.uniqueSort(e)),e};f.uniqueSort=function(a){if(m){d=e,a.sort(m);if(d)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},f.matches=function(a,b){return f(a,null,null,b)},f.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=g.order.length;e<f;e++){var h=g.order[e],i;if(i=g.leftMatch[h].exec(a)){var j=i[1];i.splice(1,1);if(j.substr(j.length-1)!=="\\"){i[1]=(i[1]||"").replace(/\\/g,""),d=g.find[h](i,b,c);if(d!=null){a=a.replace(g.match[h],"");break}}}}return d||(d=b.getElementsByTagName("*")),{set:d,expr:a}},f.filter=function(a,b,c,d){var e=a,h=[],i=b,j,k,l=b&&b[0]&&f.isXML(b[0]);while(a&&b.length){for(var m in g.filter)if((j=g.leftMatch[m].exec(a))!=null&&j[2]){var n=g.filter[m],o,p,q=j[1];k=!1,j.splice(1,1);if(q.substr(q.length-1)==="\\")continue;i===h&&(h=[]);if(g.preFilter[m]){j=g.preFilter[m](j,i,c,h,d,l);if(!j)k=o=!0;else if(j===!0)continue}if(j)for(var r=0;(p=i[r])!=null;r++)if(p){o=n(p,j,r,i);var s=d^!!o;c&&o!=null?s?k=!0:i[r]=!1:s&&(h.push(p),k=!0)}if(o!==undefined){c||(i=h),a=a.replace(g.match[m],"");if(!k)return[];break}}if(a===e){if(k!=null)break;f.error(a)}e=a}return i},f.error=function(a){throw"Syntax error, unrecognized expression: "+a};var g=f.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!/\W/.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var g=0,h=a.length,i;g<h;g++)if(i=a[g]){while((i=i.previousSibling)&&i.nodeType!==1);a[g]=e||i&&i.nodeName.toLowerCase()===b?i||!1:i===b}e&&f.filter(b,a,!0)},">":function(a,b){var c=typeof b=="string",d,e=0,g=a.length;if(c&&!/\W/.test(b)){b=b.toLowerCase();for(;e<g;e++){d=a[e];if(d){var h=d.parentNode;a[e]=h.nodeName.toLowerCase()===b?h:!1}}}else{for(;e<g;e++)d=a[e],d&&(a[e]=c?d.parentNode:d.parentNode===b);c&&f.filter(b,a,!0)}},"":function(a,c,d){var e=b++,f=o,g;typeof c=="string"&&!/\W/.test(c)&&(c=c.toLowerCase(),g=c,f=n),f("parentNode",c,e,a,g,d)},"~":function(a,c,d){var e=b++,f=o,g;typeof c=="string"&&!/\W/.test(c)&&(c=c.toLowerCase(),g=c,f=n),f("previousSibling",c,e,a,g,d)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElemen
.splitText(b)}var b=a.startContainer,c=a.startOffset,d=a.endContainer,e=a.endOffset;return b==d&&b.nodeType==3?c>0&&c<b.nodeValue.length&&(d=f(b,c),b=d.previousSibling,e>c?(e-=c,b=d=f(d,e).previousSibling,e=d.nodeValue.length,c=0):e=0):(b.nodeType==3&&c>0&&c<b.nodeValue.length&&(b=f(b,c),c=0),d.nodeType==3&&e>0&&e<d.nodeValue.length&&(d=f(d,e).previousSibling,e=d.nodeValue.length)),{startContainer:b,startOffset:c,endContainer:d,endOffset:e}}},a.dom.RangeUtils.compareRanges=function(a,b){if(a&&b){if(!a.item&&!a.duplicate)return a.startContainer==b.startContainer&&a.startOffset==b.startOffset;if(a.item&&b.item&&a.item(0)===b.item(0))return!0;if(a.isEqual&&b.isEqual&&b.isEqual(a))return!0}return!1}}(tinymce),function(a){var b=a.dom.Event,c=a.each;a.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(d,e){var f=this,g=d.root,h=d.items,i=d.enableUpDown,j=d.enableLeftRight||!d.enableUpDown,k=d.excludeFromTabOrder,l,m,n,o,p;e=e||a.DOM,l=function(a){p=a.target.id},m=function(a){e.setAttrib(a.target.id,"tabindex","-1")},o=function(a){var b=e.get(p);e.setAttrib(b,"tabindex","0"),b.focus()},f.focus=function(){e.get(p).focus()},f.destroy=function(){c(h,function(a){e.unbind(e.get(a.id),"focus",l),e.unbind(e.get(a.id),"blur",m)}),e.unbind(e.get(g),"focus",o),e.unbind(e.get(g),"keydown",n),h=e=g=f.focus=l=m=n=o=null,f.destroy=function(){}},f.moveFocus=function(a,g){var i=-1,j=f.controls,k;if(!p)return;c(h,function(a,b){if(a.id===p)return i=b,!1}),i+=a,i<0?i=h.length-1:i>=h.length&&(i=0),k=h[i],e.setAttrib(p,"tabindex","-1"),e.setAttrib(k.id,"tabindex","0"),e.get(k.id).focus(),d.actOnFocus&&d.onAction(k.id),g&&b.cancel(g)},n=function(a){var c=37,e=39,g=38,h=40,k=27,l=14,m=13,n=32;switch(a.keyCode){case c:j&&f.moveFocus(-1);break;case e:j&&f.moveFocus(1);break;case g:i&&f.moveFocus(-1);break;case h:i&&f.moveFocus(1);break;case k:d.onCancel&&(d.onCancel(),b.cancel(a));break;case l:case m:case n:d.onAction&&(d.onAction(p),b.cancel(a))}},c(h,function(a,b){var c;a.id||(a.id=e.uniqueId("_mce_item_")),k?(e.bind(a.id,"blur",m),c="-1"):c=b===0?"0":"-1",e.setAttrib(a.id,"tabindex",c),e.bind(e.get(a.id),"focus",l)}),h[0]&&(p=h[0].id),e.setAttrib(g,"tabindex","-1"),e.bind(e.get(g),"focus",o),e.bind(e.get(g),"keydown",n)}})}(tinymce),function(a){var b=a.DOM,c=a.is;a.create("tinymce.ui.Control",{Control:function(b,c,d){this.id=b,this.settings=c=c||{},this.rendered=!1,this.onRender=new a.util.Dispatcher(this),this.classPrefix="",this.scope=c.scope||this,this.disabled=0,this.active=0,this.editor=d},setAriaProperty:function(a,c){var d=b.get(this.id+"_aria")||b.get(this.id);d&&b.setAttrib(d,"aria-"+a,!!c)},focus:function(){b.get(this.id).focus()},setDisabled:function(a){a!=this.disabled&&(this.setAriaProperty("disabled",a),this.setState("Disabled",a),this.setState("Enabled",!a),this.disabled=a)},isDisabled:function(){return this.disabled},setActive:function(a){a!=this.active&&(this.setState("Active",a),this.active=a,this.setAriaProperty("pressed",a))},isActive:function(){return this.active},setState:function(a,c){var d=b.get(this.id);a=this.classPrefix+a,c?b.addClass(d,a):b.removeClass(d,a)},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(a){b.setHTML(a,this.renderHTML())},postRender:function(){var a=this,b;c(a.disabled)&&(b=a.disabled,a.disabled=-1,a.setDisabled(b)),c(a.active)&&(b=a.active,a.active=-1,a.setActive(b))},remove:function(){b.remove(this.id),this.destroy()},destroy:function(){a.dom.Event.clear(this.id)}})}(tinymce),tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(a,b,c){this.parent(a,b,c),this.controls=[],this.lookup={}},add:function(a){return this.lookup[a.id]=a,this.controls.push(a),a},get:function(a){return this.lookup[a]}}),tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(a,b){this.parent(a,b),this.classPrefix="mceSeparator",this.setDisabled(!0)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}}),function(a){var b=a.is,c=a.DOM,d=
.doc=g.document,a.DOM.win=g,f=new a.Editor(d.element_id,d),f.render();if(a.isIE){function h(){f.destroy(),g.detachEvent("onunload",h),g=g.tinyMCE=g.tinymce=null}g.attachEvent("onunload",h)}return d.page_window=null,!0;case"mceRemoveEditor":case"mceRemoveControl":return f&&f.remove(),!0;case"mceToggleEditor":if(!f)return e.execCommand("mceAddControl",0,d),!0;return f.isHidden()?f.show():f.hide(),!0}return e.activeEditor?e.activeEditor.execCommand(b,c,d):!1},execInstanceCommand:function(a,b,c,d){var e=this.get(a);return e?e.execCommand(b,c,d):!1},triggerSave:function(){b(this.editors,function(a){a.save()})},addI18n:function(c,d){var e,f=this.i18n;a.is(c,"string")?b(d,function(a,b){f[c+"."+b]=a}):b(c,function(a,c){b(a,function(a,d){b(a,function(a,b){d==="common"?f[c+"."+b]=a:f[c+"."+d+"."+b]=a})})})},_setActive:function(a){this.selectedInstance=this.activeEditor=a}})}(tinymce),function(a){var b=a.DOM,c=a.dom.Event,d=a.extend,e=a.util.Dispatcher,f=a.each,g=a.isGecko,h=a.isIE,i=a.isWebKit,j=a.is,k=a.ThemeManager,l=a.PluginManager,m=a.inArray,n=a.grep,o=a.explode,p=a.VK;a.create("tinymce.Editor",{Editor:function(b,c){var g=this;g.id=g.editorId=b,g.execCommands={},g.queryStateCommands={},g.queryValueCommands={},g.isNotDirty=!1,g.plugins={},f(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(a){g[a]=new e(g)}),g.settings=c=d({id:b,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:a.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:a.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",validate:!0,entity_encoding:"named",url_converter:g.convertURL,url_converter_scope:g,ie7_compat:!0},c),g.documentBaseURI=new a.util.URI(c.document_base_url||a.documentBaseURL,{base_uri:tinyMCE.baseURI}),g.baseURI=a.baseURI,g.contentCSS=[],g.execCallback("setup",g)},render:function(d){function j(){g.language&&g.language_load!==!1&&i.add(a.baseURL+"/langs/"+g.language+".js"),g.theme&&g.theme.charAt(0)!="-"&&!k.urls[g.theme]&&k.load(g.theme,"themes/"+g.theme+"/editor_template"+a.suffix+".js"),f(o(g.plugins),function(b){if(b&&!l.urls[b])if(b.charAt(0)=="-"){b=b.substr(1,b.length);var c=l.dependencies(b);f(c,function(b){var c={prefix:"plugins/",resource:b,suffix:"/editor_plugin"+a.suffix+".js"},b=l.createUrl(c,b);l.load(b.resource,b)})}else{if(b=="safari")return;l.load(b,{prefix:"plugins/",resource:b,suffix:"/editor_plugin"+a.suffix+".js"})}}),i.loadQueue(function(){e.removed||e.init()})}var e=this,g=e.settings,h=e.id,i=a.ScriptLoader;if(!c.domLoaded){c.add(document,"init",function(){e.render()});return}tinyMCE.settings=g;if(!e.getElem
.dispatch(h,m),d=m.content,d.indexOf("{$caret}")==-1&&(d+="{$caret}"),d=d.replace(/\{\$caret\}/,t),h.isCollapsed()||f.getDoc().execCommand("Delete",!1,null),j=h.getNode(),m={context:j.nodeName.toLowerCase()},l=e.parse(d,m),r=l.lastChild;if(r.attr("id")=="mce_marker"){n=r;for(r=r.prev;r;r=r.walk(!0))if(r.type==3||!g.isBlock(r.name)){r.parent.insert(n,r,r.name==="br");break}}if(!m.invalid)d=i.serialize(l),r=j.firstChild,s=j.lastChild,!r||r===s&&r.nodeName==="BR"?g.setHTML(j,d):h.setContent(d);else{h.setContent(t),j=f.selection.getNode(),k=f.getBody(),j.nodeType==9?j=r=k:r=j;while(r!==k)j=r,r=r.parentNode;d=j==k?k.innerHTML:g.getOuterHTML(j),d=i.serialize(e.parse(d.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return i.serialize(l)}))),j==k?g.setHTML(k,d):g.setOuterHTML(j,d)}n=g.get("mce_marker"),o=g.getRect(n),p=g.getViewPort(f.getWin());if(o.y+o.h>p.y+p.h||o.y<p.y||o.x>p.x+p.w||o.x<p.x)u=a.isIE?f.getDoc().documentElement:f.getBody(),u.scrollLeft=o.x,u.scrollTop=o.y-p.h+25;q=g.createRng(),r=n.previousSibling,r&&r.nodeType==3?q.setStart(r,r.nodeValue.length):(q.setStartBefore(n),q.setEndBefore(n)),g.remove(n),h.setRng(q),h.onSetContent.dispatch(h,m),f.addVisual()},mceInsertRawHTML:function(a,b,c){h.setContent("tiny_mce_marker"),f.setContent(f.getContent().replace(/tiny_mce_marker/g,function(){return c}))},mceSetContent:function(a,b,c){f.setContent(c)},"Indent,Outdent":function(a){var c,d,e;c=j.indentation,d=/[a-z%]+$/i.exec(c),c=parseInt(c),!n("InsertUnorderedList")&&!n("InsertOrderedList")?b(h.getSelectedBlocks(),function(b){a=="outdent"?(e=Math.max(0,parseInt(b.style.paddingLeft||0)-c),g.setStyle(b,"paddingLeft",e?e+d:"")):g.setStyle(b,"paddingLeft",parseInt(b.style.paddingLeft||0)+c+d)}):q(a)},mceRepaint:function(){var b;if(a.isGecko)try{t(d),h.getSel()&&h.getSel().selectAllChildren(f.getBody()),h.collapse(d),u()}catch(c){}},mceToggleFormat:function(a,b,c){k.toggle(c)},InsertHorizontalRule:function(){f.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){f.hasVisual=!f.hasVisual,f.addVisual()},mceReplaceContent:function(a,b,c){f.execCommand("mceInsertContent",!1,c.replace(/\{\$selection\}/g,h.getContent({format:"text"})))},mceInsertLink:function(a,b,c){var d;typeof c=="string"&&(c={href:c}),d=g.getParent(h.getNode(),"a"),c.href=c.href.replace(" ","%20"),(!d||!c.href)&&k.remove("link"),c.href&&k.apply("link",c,d)},selectAll:function(){var a=g.getRoot(),b=g.createRng();b.setStart(a,0),b.setEnd(a,a.childNodes.length),f.selection.setRng(b)}}),p({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(b){var c="align"+b.substring(7),e=h.isCollapsed()?[h.getNode()]:h.getSelectedBlocks(),f=a.map(e,function(a){return!!k.matchNode(a,c)});return a.inArray(f,d)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(a){return r(a)},mceBlockQuote:function(){return r("blockquote")},Outdent:function(){var a;if(j.inline_styles){if((a=g.getParent(h.getStart(),g.isBlock))&&parseInt(a.style.paddingLeft)>0)return d;if((a=g.getParent(h.getEnd(),g.isBlock))&&parseInt(a.style.paddingLeft)>0)return d}return n("InsertUnorderedList")||n("InsertOrderedList")||!j.inline_styles&&!!g.getParent(h.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(a){return g.getParent(h.getNode(),a=="insertunorderedlist"?"UL":"OL")}},"state"),p({"FontSize,FontName":function(a){var b=0,c;if(c=g.getParent(h.getNode(),"span"))a=="fontsize"?b=c.style.fontSize:b=c.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase();return b}},"value"),j.custom_undo_redo&&p({Undo:function(){f.undoManager.undo()},Redo:function(){f.undoManager.redo()}})}}(tinymce),function(a){var b=a.util.Dispatcher;a.UndoManager=function(c){function h(){return a.trim(c.getContent({format:"raw",no_events:1}))}var d,e=0,f=[],g;return d={typing:!1,onAdd:new b(d),onUndo:new b(d),onRedo:new b(d),beforeChange:function(){g=c.selection.getBookmark(2,!0)},add:function(a){var b,i=c.settings,j;a=a||{},a.content=h(),j=f[e];if(j&&j.content==a.content)return null;f[e]&&(f[e].beforeBookmark=g);if(i.custom_un
g(d,b.getBody())).prev()||d),d}function T(c,d,i){function n(a){var c=e.create("span",{id:k,"data-mce-bogus":!0,style:l?"color:red":""});return a&&c.appendChild(b.getDoc().createTextNode(j)),c}function o(a,b){while(a){if(a.nodeType===3&&a.nodeValue!==j||a.childNodes.length>1)return!1;b&&a.nodeType===1&&b.push(a),a=a.firstChild}return!0}function p(a){while(a){if(a.id===k)return a;a=a.parentNode}}function q(a){var b;if(a){b=new g(a,a);for(a=b.current();a;a=b.next())if(a.nodeType===3)return a}}function r(a,b){var c,d;if(!a){a=p(f.getStart());if(!a)while(a=e.get(k))r(a,!1)}else d=f.getRng(!0),o(a)?(b!==!1&&(d.setStartBefore(a),d.setEndBefore(a)),e.remove(a)):(c=q(a),c.nodeValue.charAt(0)===m&&(c=c.deleteData(0,1)),e.remove(a,1)),f.setRng(d)}function s(){var a,b,c,e,g,k,l;a=f.getRng(!0),e=a.startOffset,k=a.startContainer,l=k.nodeValue,b=p(f.getStart()),b&&(c=q(b)),l&&e>0&&e<l.length&&/\w/.test(l.charAt(e))&&/\w/.test(l.charAt(e-1))?(g=f.getBookmark(),a.collapse(!0),a=L(a,u(d)),a=h.split(a),y(d,i,a),f.moveToBookmark(g)):(!b||c.nodeValue!==j?(b=n(!0),c=b.firstChild,a.insertNode(b),e=1,y(d,i,b)):y(d,i,b),f.setCursorLocation(c,e))}function t(){var a=f.getRng(!0),b,c,g,k,l,m,o=[],p,q;b=a.startContainer,c=a.startOffset,l=b;if(b.nodeType==3){if(c!=b.nodeValue.length||b.nodeValue===j)k=!0;l=l.parentNode}while(l){if(B(l,d,i)){m=l;break}l.nextSibling&&(k=!0),o.push(l),l=l.parentNode}if(!m)return;if(k)g=f.getBookmark(),a.collapse(!0),a=L(a,u(d),!0),a=h.split(a),z(d,i,a),f.moveToBookmark(g);else{q=n(),l=q;for(p=o.length-1;p>=0;p--)l.appendChild(o[p].cloneNode(!1)),l=l.firstChild;l.appendChild(e.doc.createTextNode(j)),l=l.firstChild,e.insertAfter(q,m),f.setCursorLocation(l,1)}}var j,k="_mce_caret",l=b.settings.caret_debug;j=a.isGecko?"":m,self._hasCaretEvents||(b.onBeforeGetContent.addToTop(function(){var a=[],b;if(o(p(f.getStart()),a)){b=a.length;while(b--)e.setAttrib(a[b],"data-mce-bogus","1")}}),a.each("onMouseUp onKeyUp".split(" "),function(a){b[a].addToTop(function(){r()})}),b.onKeyDown.addToTop(function(a,b){var c=b.keyCode;(c==8||c==37||c==39)&&r(p(f.getStart()))}),self._hasCaretEvents=!0),c=="apply"?s():t()}function U(a){var b=a.startContainer,c=a.startOffset,d,h,i,j;b.nodeType==3&&c>=b.nodeValue.length-1&&(b=b.parentNode,c=l(b)+1);if(b.nodeType==1){i=b.childNodes,b=i[Math.min(c,i.length-1)],d=new g(b),c>i.length-1&&d.next();for(h=d.current();h;h=d.next())if(h.nodeType==3&&!J(h)){j=e.create("a",null,m),h.parentNode.insertBefore(j,h),a.setStart(h,0),f.setRng(a),e.remove(j);return}}}var c={},d=a.each,e=b.dom,f=b.selection,g=a.dom.TreeWalker,h=new a.dom.RangeUtils(e),i=b.schema.isValidChild,j=e.isBlock,k=b.settings.forced_root_block,l=e.nodeIndex,m="",n=/^(src|href|style)$/,o=!1,p=!0,q,w=function(a){var c;return b.dom.getParent(a,function(a){return c=b.dom.getStyle(a,"text-decoration"),c&&c!=="none"}),c},x=function(a){var c;a.nodeType===1&&a.parentNode&&a.parentNode.nodeType===1&&(c=w(a.parentNode),b.dom.getStyle(a,"color")&&c?b.dom.setStyle(a,"text-decoration",c):b.dom.getStyle(a,"textdecoration")===c&&b.dom.setStyle(a,"text-decoration",null))};a.extend(this,{get:u,register:v,apply:y,remove:z,toggle:A,match:C,matchAll:D,matchNode:B,canApply:E})}}(tinymce),tinymce.onAddEditor.add(function(a,b){var c,d,e,f=b.settings;if(f.inline_styles){d=a.explode(f.font_size_legacy_values);function g(b,c){a.each(c,function(a,c){a&&e.setStyle(b,c,a)}),e.rename(b,"span")}c={font:function(a,b){g(b,{backgroundColor:b.style.backgroundColor,color:b.color,fontFamily:b.face,fontSize:d[parseInt(b.size)-1]})},u:function(a,b){g(b,{textDecoration:"underline"})},strike:function(a,b){g(b,{textDecoration:"line-through"})}};function h(d,g){e=d.dom,f.convert_fonts_to_spans&&a.each(e.select("font,u,strike",g.node),function(a){c[a.nodeName.toLowerCase()](b.dom,a)})}b.onPreProcess.add(h),b.onSetContent.add(h),b.onInit.add(function(){b.selection.onSetContent.add(h)})}});