Comparing version 2.0.0-beta1 to 2.0.0
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(t){"use strict";function e(t,e){return t.replace(/\{([^}]+)\}/g,function(t,n){var r=!0;return"!"===n.charAt(0)&&(r=!1,n=n.substring(1)),"0"===n&&(r=!1),void 0===e[n]?t:r?f(e[n],!0):e[n]})}function n(t){var e,n,r,i=document.createElement("div");return r=function(t,e){if(!d.hasStyling(t)){if(k||1!==t.childNodes.length||!v(t.firstChild,"br"))for(;n=t.firstChild;)i.insertBefore(n,t);if(e){var r=i.lastChild;t!==r&&v(r,"div")&&t.nextSibling===r&&i.insertBefore(document.createElement("br"),t)}i.removeChild(t)}},p(i,"display","none"),i.innerHTML=t.replace(/<\/div>\n/g,"</div>"),(e=i.firstChild)&&v(e,"div")&&r(e,!0),(e=i.lastChild)&&v(e,"div")&&r(e),i.innerHTML}function r(t){return"function"==typeof t}function i(t){return t?t.replace(/\\(.)/g,"$1").replace(/^(["'])(.*?)\1$/,"$2"):t}function l(){var t=arguments;return t[0].replace(/\{(\d+)\}/g,function(e,n){return void 0!==t[n-0+1]?t[n-0+1]:"{"+n+"}"})}function o(t,e,n,r,i,l){var o=this;o.type=t,o.name=e,o.val=n,o.attrs=r||{},o.children=i||[],o.closing=l||null}function a(t){function n(t,e){var n,r,i,a=/\[([^\]\s=]+)(?:([^\]]+))?\]/,s=/\[\/([^\[\]]+)\]/;return t===S&&(n=e.match(a))&&(i=x(n[1]),n[2]&&(n[2]=n[2].trim())&&(r=l(n[2]))),t===L&&(n=e.match(s))&&(i=x(n[1])),t===q&&(i="#newline"),i&&(t!==S&&t!==L||I[i])||(t=T,i="#"),new o(t,i,e,r)}function l(t){var e,n=/([^\s=]+)=(?:(?:(["'])((?:\\\2|[^\2])*?)\2)|((?:.(?!\s\S+=))*.))/g,r={};if("="===t.charAt(0)&&t.indexOf("=",1)<0)r.defaultattr=i(t.substr(1));else for("="===t.charAt(0)&&(t="defaultattr"+t);e=n.exec(t);)r[x(e[1])]=i(e[3])||e[4];return r}function s(t,e,n){for(var r=n.length;r--;)if(n[r].type===e&&n[r].name===t)return!0;return!1}function u(t,e){var n=(t?I[t.name]:{}).allowedChildren;return!w.opts.fixInvalidChildren||!n||n.indexOf(e.name||"#")>-1}function c(t){for(var e,n,r,i,l,o,a=[],c=[],f=[],h=function(){return y(f)},d=function(t){h()?h().children.push(t):c.push(t)},m=function(t){return h()&&(n=I[h().name])&&n.closedBy&&n.closedBy.indexOf(t)>-1};e=t.shift();)switch(o=t[0],u(h(),e)||e.type===L&&h()&&e.name===h().name||(e.name="#",e.type=T),e.type){case S:m(e.name)&&f.pop(),d(e),(n=I[e.name])&&!n.isSelfClosing&&(n.closedBy||s(e.name,L,t))?f.push(e):n&&n.isSelfClosing||(e.type=T);break;case L:if(h()&&e.name!==h().name&&m("/"+e.name)&&f.pop(),h()&&e.name===h().name)h().closing=e,f.pop();else if(s(e.name,S,f)){for(;r=f.pop();){if(r.name===e.name){r.closing=e;break}i=r.clone(),a.length&&i.children.push(y(a)),a.push(i)}for(o&&o.type===q&&(n=I[e.name])&&!1===n.isInline&&(d(o),t.shift()),d(y(a)),l=a.length;l--;)f.push(a[l]);a.length=0}else e.type=T,d(e);break;case q:h()&&o&&m((o.type===L?"/":"")+o.name)&&(o.type===L&&o.name===h().name||((n=I[h().name])&&n.breakAfter?f.pop():n&&!1===n.isInline&&w.opts.breakAfterBlock&&!1!==n.breakAfter&&f.pop())),d(e);break;default:d(e)}return c}function h(t,e,n){var r,i,l,o,a,s,u,c,f=t.length;e&&(o=I[e.name]);for(var d=f;d--;)if(r=t[d])if(r.type===q){if(i=d>0?t[d-1]:null,l=d<f-1?t[d+1]:null,c=!1,!n&&o&&!0!==o.isSelfClosing&&(i?s||l||(!1===o.isInline&&w.opts.breakEndBlock&&!1!==o.breakEnd&&(c=!0),o.breakEnd&&(c=!0),s=c):(!1===o.isInline&&w.opts.breakStartBlock&&!1!==o.breakStart&&(c=!0),o.breakStart&&(c=!0))),i&&i.type===S&&(a=I[i.name])&&(n?!1===a.isInline&&(c=!0):(!1===a.isInline&&w.opts.breakAfterBlock&&!1!==a.breakAfter&&(c=!0),a.breakAfter&&(c=!0))),!n&&!u&&l&&l.type===S&&(a=I[l.name])&&(!1===a.isInline&&w.opts.breakBeforeBlock&&!1!==a.breakBefore&&(c=!0),a.breakBefore&&(c=!0),u=c,c)){t.splice(d,1);continue}c&&t.splice(d,1),u=!1}else r.type===S&&h(r.children,r,n)}function d(t,e,n,r){var i,l,o,a,s,c,f=function(t){var e=I[t.name];return!e||!1!==e.isInline};for(e=e||[],r=r||t,l=0;l<t.length;l++)if((i=t[l])&&i.type===S){if(n&&!f(i)){if(o=y(e),c=o.splitAt(i),s=e.length>1?e[e.length-2].children:r,u(i,o)){var h=o.clone();h.children=i.children,i.children=[h]}if((a=s.indexOf(o))>-1){c.children.splice(0,1),s.splice(a+1,0,i,c);var m=c.children[0];return void(m&&m.type===q&&(f(i)||(c.children.splice(0,1),s.splice(a+2,0,m))))}}e.push(i),d(i.children,e,n||f(i),r),e.pop(i)}}function m(t){for(var e,n,r=t.length;r--;)(e=t[r])&&e.type===S&&(n=I[e.name],m(e.children),function(t){for(var e=t.length;e--;){var n=t[e].type;if(n===S||n===L)return!1;if(n===T&&/\S|\u00A0/.test(t[e].val))return!1}return!0}(e.children)&&n&&!n.isSelfClosing&&!n.allowsEmpty&&t.splice.apply(t,[r,1].concat(e.children)))}function p(t,n){var i,l,o,a,s,u,c,h,d=[];for(c=function(t){return!1!==(!t||(void 0!==t.isHtmlInline?t.isHtmlInline:t.isInline))};t.length>0;)if(i=t.shift()){if(i.type===S)h=i.children[i.children.length-1]||{},l=I[i.name],s=n&&c(l),o=p(i.children,!1),l&&l.html?(c(l)||!c(I[h.name])||l.isPreFormatted||l.skipLastLineBreak||k||(o+="<br />"),r(l.html)?a=l.html.call(w,i,i.attrs,o):(i.attrs[0]=o,a=e(l.html,i.attrs))):a=i.val+o+(i.closing?i.closing.val:"");else{if(i.type===q){if(!n){d.push("<br />");continue}u||d.push("<div>"),k||d.push("<br />"),t.length||d.push("<br />"),d.push("</div>\n"),u=!1;continue}s=n,a=f(i.val,!0)}s&&!u?(d.push("<div>"),u=!0):!s&&u&&(d.push("</div>\n"),u=!1),d.push(a)}return u&&d.push("</div>\n"),d.join("")}function g(t){for(var e,n,r,i,l,o,a,s,u,c,f=[];t.length>0;)if(e=t.shift())if(r=I[e.name],i=!(!r||!1!==r.isInline),l=r&&r.isSelfClosing,a=i&&w.opts.breakBeforeBlock&&!1!==r.breakBefore||r&&r.breakBefore,s=i&&!l&&w.opts.breakStartBlock&&!1!==r.breakStart||r&&r.breakStart,u=i&&w.opts.breakEndBlock&&!1!==r.breakEnd||r&&r.breakEnd,c=i&&w.opts.breakAfterBlock&&!1!==r.breakAfter||r&&r.breakAfter,o=(r?r.quoteType:null)||w.opts.quoteType||E.auto,r||e.type!==S)if(e.type===S){if(a&&f.push("\n"),f.push("["+e.name),e.attrs){e.attrs.defaultattr&&(f.push("=",v(e.attrs.defaultattr,o,"defaultattr")),delete e.attrs.defaultattr);for(n in e.attrs)e.attrs.hasOwnProperty(n)&&f.push(" ",n,"=",v(e.attrs[n],o,n))}f.push("]"),s&&f.push("\n"),e.children&&f.push(g(e.children)),l||r.excludeClosing||(u&&f.push("\n"),f.push("[/"+e.name+"]")),c&&f.push("\n"),e.closing&&l&&f.push(e.closing.val)}else f.push(e.val);else f.push(e.val),e.children&&f.push(g(e.children)),e.closing&&f.push(e.closing.val);return f.join("")}function v(t,e,n){var i=/\s|=/.test(t);return r(e)?e(t,n):e===E.never||e===E.auto&&!i?t:'"'+t.replace("\\","\\\\").replace('"','\\"')+'"'}function y(t){return t.length?t[t.length-1]:null}function x(t){return t.toLowerCase()}var w=this;w.opts=b({},a.defaults,t),w.tokenize=function(t){var e,r,i,l=[],o=[{type:L,regex:/^\[\/[^\[\]]+\]/},{type:S,regex:/^\[[^\[\]]+\]/},{type:q,regex:/^(\r\n|\r|\n)/},{type:T,regex:/^([^\[\r\n]+|\[)/}];o.reverse();t:for(;t.length;){for(i=o.length;i--;)if(r=o[i].type,(e=t.match(o[i].regex))&&e[0]){l.push(n(r,e[0])),t=t.substr(e[0].length);continue t}t.length&&l.push(n(T,t)),t=""}return l},w.parse=function(t,e){var n=c(w.tokenize(t)),r=w.opts;return r.fixInvalidNesting&&d(n),h(n,null,e),r.removeEmptyTags&&m(n),n},w.toHTML=function(t,e){return p(w.parse(t,e),!0)},w.toBBCode=function(t,e){return g(w.parse(t,e))}}function s(t){return t=parseInt(t,10),isNaN(t)?"00":(t=Math.max(0,Math.min(t,255)).toString(16)).length<2?"0"+t:t}function u(t){var e;return t=t||"#000",(e=t.match(/rgb\((\d{1,3}),\s*?(\d{1,3}),\s*?(\d{1,3})\)/i))?"#"+s(e[1])+s(e[2]-0)+s(e[3]-0):(e=t.match(/#([0-f])([0-f])([0-f])\s*?$/i))?"#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]:t}function c(){function t(){y(I,function(t){var e,n=I[t].tags,r=I[t].styles;n&&y(n,function(n,r){e=!1===I[t].isInline,h[n]=h[n]||{},h[n][e]=h[n][e]||{},h[n][e][t]=r}),r&&y(r,function(n,r){e=!1===I[t].isInline,m[e]=m[e]||{},m[e][n]=m[e][n]||{},m[e][n][t]=r})})}function e(t,e,n){var i,o,a=d.getStyle;return n=!!n,m[n]?(y(m[n],function(n,s){(i=a(t,n))&&a(t.parentNode,n)!==i&&y(s,function(n,a){(!a||a.indexOf(i.toString())>-1)&&(o=I[n].format,e=r(o)?o.call(f,t,e):l(o,e))})}),e):e}function o(t,e,n){var i,o,a=t.nodeName.toLowerCase();n=!!n,h[a]&&h[a][n]&&y(h[a][n],function(n,a){a&&(i=!1,y(a,function(e,n){if(g(t,e)&&!(n&&n.indexOf(g(t,e))<0))return i=!0,!1}),!i)||(o=I[n].format,e=r(o)?o.call(f,t,e):l(o,e))});var s=d.isInline;if(n&&(!s(t,!0)||"br"===a)){for(var u,c,m=t.previousSibling;m&&1===m.nodeType&&!v(m,"br")&&s(m,!0)&&!m.firstChild;)m=m.previousSibling;do{u=(c=t.parentNode).lastChild===t,t=c}while(c&&u&&s(c,!0));(!u||"li"===a||"br"===a&&k)&&(e+="\n"),"br"!==a&&m&&!v(m,"br")&&s(m,!0)&&(e="\n"+e)}return e}function s(t){var n=function(t,r){var i="";return d.traverse(t,function(t){var l="",a=t.nodeType,s=t.nodeName.toLowerCase(),u=x[s],c=t.firstChild,f=!0;if("object"==typeof r&&(f=r.indexOf(s)>-1,v(t,"img")&&g(t,w)&&(f=!0),f||(u=r)),3===a||1===a)if(1===a){if(v(t,".sceditor-nlf")&&(!c||!k&&1===t.childNodes.length&&/br/i.test(c.nodeName)))return;"iframe"!==s&&(l=n(t,u)),f?("code"!==s&&(l=e(t,l=o(t,l=e(t,l)),!0)),i+=o(t,l,!0)):i+=l}else i+=t.nodeValue},!1,!0),i};return n(t)}function u(t,e,r){var i=new a(f.opts.parserOptions).toHTML(f.opts.bbcodeTrim?e.trim():e);return t||r?n(i):i}function c(t,e,n){var r,i,l=(e=e||document).createElement("div"),o=new a(f.opts.parserOptions);for(l.innerHTML=t,p(l,"visibility","hidden"),e.body.appendChild(l),n&&p(l,"whiteSpace",p(n,"whiteSpace")),d.removeWhiteSpace(l),i=l.getElementsByClassName("sceditor-ignore");i.length;)i[0].parentNode.removeChild(i[0]);return r=s(l),e.body.removeChild(l),r=o.toBBCode(r,!0),f.opts.bbcodeTrim&&(r=r.trim()),r}var f=this;f.stripQuotes=i;var h={},m={},x={ul:["li","ol","ul"],ol:["li","ol","ul"],table:["tr"],tr:["td","th"],code:["br","p","div"]};f.init=function(){f.opts=this.opts,f.elementToBbcode=s,t(),this.commands=b(!0,{},C,this.commands),this.toBBCode=f.toSource,this.fromBBCode=f.toHtml},f.toHtml=u.bind(null,!1),f.fragmentToHtml=u.bind(null,!0),f.toSource=c,f.fragmentToSource=c}var f=t.escapeEntities,h=t.escapeUriScheme,d=t.dom,m=t.utils,p=d.css,g=d.attr,v=d.is,b=m.extend,y=m.each,x=t.ie,k=x&&x<11,w="data-sceditor-emoticon",B=t.command.get,E={always:1,never:2,auto:3},C={bold:{txtExec:["[b]","[/b]"]},italic:{txtExec:["[i]","[/i]"]},underline:{txtExec:["[u]","[/u]"]},strike:{txtExec:["[s]","[/s]"]},subscript:{txtExec:["[sub]","[/sub]"]},superscript:{txtExec:["[sup]","[/sup]"]},left:{txtExec:["[left]","[/left]"]},center:{txtExec:["[center]","[/center]"]},right:{txtExec:["[right]","[/right]"]},justify:{txtExec:["[justify]","[/justify]"]},font:{txtExec:function(t){var e=this;B("font")._dropDown(e,t,function(t){e.insertText("[font="+t+"]","[/font]")})}},size:{txtExec:function(t){var e=this;B("size")._dropDown(e,t,function(t){e.insertText("[size="+t+"]","[/size]")})}},color:{txtExec:function(t){var e=this;B("color")._dropDown(e,t,function(t){e.insertText("[color="+t+"]","[/color]")})}},bulletlist:{txtExec:function(t,e){var n="";y(e.split(/\r?\n/),function(){n+=(n?"\n":"")+"[li]"+this+"[/li]"}),this.insertText("[ul]\n"+n+"\n[/ul]")}},orderedlist:{txtExec:function(t,e){var n="";y(e.split(/\r?\n/),function(){n+=(n?"\n":"")+"[li]"+this+"[/li]"}),this.insertText("[ol]\n"+n+"\n[/ol]")}},table:{txtExec:["[table][tr][td]","[/td][/tr][/table]"]},horizontalrule:{txtExec:["[hr]"]},code:{txtExec:["[code]","[/code]"]},image:{txtExec:function(t,e){var n=this;B("image")._dropDown(n,t,e,function(t,e,r){var i="";e&&(i+=" width="+e),r&&(i+=" height="+r),n.insertText("[img"+i+"]"+t+"[/img]")})}},email:{txtExec:function(t,e){var n=this;B("email")._dropDown(n,t,function(t,r){n.insertText("[email="+t+"]"+(r||e||t)+"[/email]")})}},link:{txtExec:function(t,e){var n=this;B("link")._dropDown(n,t,function(t,r){n.insertText("[url="+t+"]"+(r||e||t)+"[/url]")})}},quote:{txtExec:["[quote]","[/quote]"]},youtube:{txtExec:function(t){var e=this;B("youtube")._dropDown(e,t,function(t){e.insertText("[youtube]"+t+"[/youtube]")})}},rtl:{txtExec:["[rtl]","[/rtl]"]},ltr:{txtExec:["[ltr]","[/ltr]"]}},I={b:{tags:{b:null,strong:null},styles:{"font-weight":["bold","bolder","401","700","800","900"]},format:"[b]{0}[/b]",html:"<strong>{0}</strong>"},i:{tags:{i:null,em:null},styles:{"font-style":["italic","oblique"]},format:"[i]{0}[/i]",html:"<em>{0}</em>"},u:{tags:{u:null},styles:{"text-decoration":["underline"]},format:"[u]{0}[/u]",html:"<u>{0}</u>"},s:{tags:{s:null,strike:null},styles:{"text-decoration":["line-through"]},format:"[s]{0}[/s]",html:"<s>{0}</s>"},sub:{tags:{sub:null},format:"[sub]{0}[/sub]",html:"<sub>{0}</sub>"},sup:{tags:{sup:null},format:"[sup]{0}[/sup]",html:"<sup>{0}</sup>"},font:{tags:{font:{face:null}},styles:{"font-family":null},quoteType:E.never,format:function(t,e){var n;return v(t,"font")&&(n=g(t,"face"))||(n=p(t,"font-family")),"[font="+i(n)+"]"+e+"[/font]"},html:'<font face="{defaultattr}">{0}</font>'},size:{tags:{font:{size:null}},styles:{"font-size":null},format:function(t,e){var n=g(t,"size"),r=2;return n||(n=p(t,"fontSize")),n.indexOf("px")>-1?((n=n.replace("px","")-0)<12&&(r=1),n>15&&(r=3),n>17&&(r=4),n>23&&(r=5),n>31&&(r=6),n>47&&(r=7)):r=n,"[size="+r+"]"+e+"[/size]"},html:'<font size="{defaultattr}">{!0}</font>'},color:{tags:{font:{color:null}},styles:{color:null},quoteType:E.never,format:function(t,e){var n;return v(t,"font")&&(n=g(t,"color"))||(n=t.style.color||t.css(t,"color")),"[color="+u(n)+"]"+e+"[/color]"},html:function(t,e,n){return'<font color="'+f(u(e.defaultattr),!0)+'">'+n+"</font>"}},ul:{tags:{ul:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ul]{0}[/ul]",html:"<ul>{0}</ul>"},list:{breakStart:!0,isInline:!1,skipLastLineBreak:!0,html:"<ul>{0}</ul>"},ol:{tags:{ol:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ol]{0}[/ol]",html:"<ol>{0}</ol>"},li:{tags:{li:null},isInline:!1,closedBy:["/ul","/ol","/list","*","li"],format:"[li]{0}[/li]",html:"<li>{0}</li>"},"*":{isInline:!1,closedBy:["/ul","/ol","/list","*","li"],html:"<li>{0}</li>"},table:{tags:{table:null},isInline:!1,isHtmlInline:!0,skipLastLineBreak:!0,format:"[table]{0}[/table]",html:"<table>{0}</table>"},tr:{tags:{tr:null},isInline:!1,skipLastLineBreak:!0,format:"[tr]{0}[/tr]",html:"<tr>{0}</tr>"},th:{tags:{th:null},allowsEmpty:!0,isInline:!1,format:"[th]{0}[/th]",html:"<th>{0}</th>"},td:{tags:{td:null},allowsEmpty:!0,isInline:!1,format:"[td]{0}[/td]",html:"<td>{0}</td>"},emoticon:{allowsEmpty:!0,tags:{img:{src:null,"data-sceditor-emoticon":null}},format:function(t,e){return g(t,w)+e},html:"{0}"},hr:{tags:{hr:null},allowsEmpty:!0,isSelfClosing:!0,isInline:!1,format:"[hr]{0}",html:"<hr />"},img:{allowsEmpty:!0,tags:{img:{src:null}},allowedChildren:["#"],quoteType:E.never,format:function(t,e){var n,r,i="",l=function(e){return t.style?t.style[e]:null};return g(t,w)?e:(n=g(t,"width")||l("width"),r=g(t,"height")||l("height"),(t.complete&&(n||r)||n&&r)&&(i="="+d.width(t)+"x"+d.height(t)),"[img"+i+"]"+g(t,"src")+"[/img]")},html:function(t,e,n){var r,i,l,o="";return r=e.width,i=e.height,e.defaultattr&&(r=(l=e.defaultattr.split(/x/i))[0],i=2===l.length?l[1]:l[0]),void 0!==r&&(o+=' width="'+f(r,!0)+'"'),void 0!==i&&(o+=' height="'+f(i,!0)+'"'),"<img"+o+' src="'+h(n)+'" />'}},url:{allowsEmpty:!0,tags:{a:{href:null}},quoteType:E.never,format:function(t,e){var n=g(t,"href");return"mailto:"===n.substr(0,7)?'[email="'+n.substr(7)+'"]'+e+"[/email]":"[url="+n+"]"+e+"[/url]"},html:function(t,e,n){return e.defaultattr=f(e.defaultattr,!0)||n,'<a href="'+h(e.defaultattr)+'">'+n+"</a>"}},email:{quoteType:E.never,html:function(t,e,n){return'<a href="mailto:'+(f(e.defaultattr,!0)||n)+'">'+n+"</a>"}},quote:{tags:{blockquote:null},isInline:!1,quoteType:E.never,format:function(t,e){for(var n,r="",i=t.children,l=0;!n&&l<i.length;l++)v(i[l],"cite")&&(n=i[l]);return(n||g(t,"data-author"))&&(r=n.textContent||g(t,"data-author"),g(t,"data-author",r),n&&t.removeChild(n),e=this.elementToBbcode(t),r="="+r.replace(/(^\s+|\s+$)/g,""),n&&t.insertBefore(n,t.firstChild)),"[quote"+r+"]"+e+"[/quote]"},html:function(t,e,n){return e.defaultattr&&(n="<cite>"+f(e.defaultattr)+"</cite>"+n),"<blockquote>"+n+"</blockquote>"}},code:{tags:{code:null},isInline:!1,allowedChildren:["#","#newline"],format:"[code]{0}[/code]",html:"<code>{0}</code>"},left:{styles:{"text-align":["left","-webkit-left","-moz-left","-khtml-left"]},isInline:!1,format:"[left]{0}[/left]",html:'<div align="left">{0}</div>'},center:{styles:{"text-align":["center","-webkit-center","-moz-center","-khtml-center"]},isInline:!1,format:"[center]{0}[/center]",html:'<div align="center">{0}</div>'},right:{styles:{"text-align":["right","-webkit-right","-moz-right","-khtml-right"]},isInline:!1,format:"[right]{0}[/right]",html:'<div align="right">{0}</div>'},justify:{styles:{"text-align":["justify","-webkit-justify","-moz-justify","-khtml-justify"]},isInline:!1,format:"[justify]{0}[/justify]",html:'<div align="justify">{0}</div>'},youtube:{allowsEmpty:!0,tags:{iframe:{"data-youtube-id":null}},format:function(t,e){return(t=g(t,"data-youtube-id"))?"[youtube]"+t+"[/youtube]":e},html:'<iframe width="560" height="315" frameborder="0" src="https://www.youtube.com/embed/{0}?wmode=opaque" data-youtube-id="{0}" allowfullscreen></iframe>'},rtl:{styles:{direction:["rtl"]},format:"[rtl]{0}[/rtl]",html:'<div style="direction: rtl">{0}</div>'},ltr:{styles:{direction:["ltr"]},format:"[ltr]{0}[/ltr]",html:'<div style="direction: ltr">{0}</div>'},ignore:{}},S="open",T="content",q="newline",L="close";o.prototype={clone:function(){var t=this;return new o(t.type,t.name,t.val,b({},t.attrs),[],t.closing?t.closing.clone():null)},splitAt:function(t){var e,n=this,r=n.clone(),i=n.children.indexOf(t);return i>-1&&(e=n.children.length-i,r.children=n.children.splice(i,e)),r}},a.QuoteType=E,a.defaults={breakBeforeBlock:!1,breakStartBlock:!1,breakEndBlock:!1,breakAfterBlock:!0,removeEmptyTags:!0,fixInvalidNesting:!0,fixInvalidChildren:!0,quoteType:E.auto},c.get=function(t){return I[t]||null},c.set=function(t,e){return t&&e&&((e=b(I[t]||{},e)).remove=function(){delete I[t]},I[t]=e),this},c.rename=function(t,e){return t in I&&(I[e]=I[t],delete I[t]),this},c.remove=function(t){return t in I&&delete I[t],this},c.formatBBCodeString=e,t.formats.bbcode=c,t.BBCodeParser=a}(sceditor); | ||
!function(t){"use strict";function e(t,e){return t.replace(/\{([^}]+)\}/g,function(t,n){var r=!0;return"!"===n.charAt(0)&&(r=!1,n=n.substring(1)),"0"===n&&(r=!1),void 0===e[n]?t:r?f(e[n],!0):e[n]})}function n(t){var e,n,r,i=document.createElement("div");return r=function(t,e){if(!d.hasStyling(t)){if(k||1!==t.childNodes.length||!v(t.firstChild,"br"))for(;n=t.firstChild;)i.insertBefore(n,t);if(e){var r=i.lastChild;t!==r&&v(r,"div")&&t.nextSibling===r&&i.insertBefore(document.createElement("br"),t)}i.removeChild(t)}},p(i,"display","none"),i.innerHTML=t.replace(/<\/div>\n/g,"</div>"),(e=i.firstChild)&&v(e,"div")&&r(e,!0),(e=i.lastChild)&&v(e,"div")&&r(e),i.innerHTML}function r(t){return"function"==typeof t}function i(t){return t?t.replace(/\\(.)/g,"$1").replace(/^(["'])(.*?)\1$/,"$2"):t}function l(){var t=arguments;return t[0].replace(/\{(\d+)\}/g,function(e,n){return void 0!==t[n-0+1]?t[n-0+1]:"{"+n+"}"})}function o(t,e,n,r,i,l){var o=this;o.type=t,o.name=e,o.val=n,o.attrs=r||{},o.children=i||[],o.closing=l||null}function a(t){function n(t,e){var n,r,i,a=/\[([^\]\s=]+)(?:([^\]]+))?\]/,s=/\[\/([^\[\]]+)\]/;return t===S&&(n=e.match(a))&&(i=x(n[1]),n[2]&&(n[2]=n[2].trim())&&(r=l(n[2]))),t===L&&(n=e.match(s))&&(i=x(n[1])),t===q&&(i="#newline"),i&&(t!==S&&t!==L||I[i])||(t=T,i="#"),new o(t,i,e,r)}function l(t){var e,n=/([^\s=]+)=(?:(?:(["'])((?:\\\2|[^\2])*?)\2)|((?:.(?!\s\S+=))*.))/g,r={};if("="===t.charAt(0)&&t.indexOf("=",1)<0)r.defaultattr=i(t.substr(1));else for("="===t.charAt(0)&&(t="defaultattr"+t);e=n.exec(t);)r[x(e[1])]=i(e[3])||e[4];return r}function s(t,e,n){for(var r=n.length;r--;)if(n[r].type===e&&n[r].name===t)return!0;return!1}function u(t,e){var n=(t?I[t.name]:{}).allowedChildren;return!w.opts.fixInvalidChildren||!n||n.indexOf(e.name||"#")>-1}function c(t){for(var e,n,r,i,l,o,a=[],c=[],f=[],h=function(){return y(f)},d=function(t){h()?h().children.push(t):c.push(t)},m=function(t){return h()&&(n=I[h().name])&&n.closedBy&&n.closedBy.indexOf(t)>-1};e=t.shift();)switch(o=t[0],u(h(),e)||e.type===L&&h()&&e.name===h().name||(e.name="#",e.type=T),e.type){case S:m(e.name)&&f.pop(),d(e),(n=I[e.name])&&!n.isSelfClosing&&(n.closedBy||s(e.name,L,t))?f.push(e):n&&n.isSelfClosing||(e.type=T);break;case L:if(h()&&e.name!==h().name&&m("/"+e.name)&&f.pop(),h()&&e.name===h().name)h().closing=e,f.pop();else if(s(e.name,S,f)){for(;r=f.pop();){if(r.name===e.name){r.closing=e;break}i=r.clone(),a.length&&i.children.push(y(a)),a.push(i)}for(o&&o.type===q&&(n=I[e.name])&&!1===n.isInline&&(d(o),t.shift()),d(y(a)),l=a.length;l--;)f.push(a[l]);a.length=0}else e.type=T,d(e);break;case q:h()&&o&&m((o.type===L?"/":"")+o.name)&&(o.type===L&&o.name===h().name||((n=I[h().name])&&n.breakAfter?f.pop():n&&!1===n.isInline&&w.opts.breakAfterBlock&&!1!==n.breakAfter&&f.pop())),d(e);break;default:d(e)}return c}function h(t,e,n){var r,i,l,o,a,s,u,c,f=t.length;e&&(o=I[e.name]);for(var d=f;d--;)if(r=t[d])if(r.type===q){if(i=d>0?t[d-1]:null,l=d<f-1?t[d+1]:null,c=!1,!n&&o&&!0!==o.isSelfClosing&&(i?s||l||(!1===o.isInline&&w.opts.breakEndBlock&&!1!==o.breakEnd&&(c=!0),o.breakEnd&&(c=!0),s=c):(!1===o.isInline&&w.opts.breakStartBlock&&!1!==o.breakStart&&(c=!0),o.breakStart&&(c=!0))),i&&i.type===S&&(a=I[i.name])&&(n?!1===a.isInline&&(c=!0):(!1===a.isInline&&w.opts.breakAfterBlock&&!1!==a.breakAfter&&(c=!0),a.breakAfter&&(c=!0))),!n&&!u&&l&&l.type===S&&(a=I[l.name])&&(!1===a.isInline&&w.opts.breakBeforeBlock&&!1!==a.breakBefore&&(c=!0),a.breakBefore&&(c=!0),u=c,c)){t.splice(d,1);continue}c&&t.splice(d,1),u=!1}else r.type===S&&h(r.children,r,n)}function d(t,e,n,r){var i,l,o,a,s,c,f=function(t){var e=I[t.name];return!e||!1!==e.isInline};for(e=e||[],r=r||t,l=0;l<t.length;l++)if((i=t[l])&&i.type===S){if(n&&!f(i)){if(o=y(e),c=o.splitAt(i),s=e.length>1?e[e.length-2].children:r,u(i,o)){var h=o.clone();h.children=i.children,i.children=[h]}if((a=s.indexOf(o))>-1){c.children.splice(0,1),s.splice(a+1,0,i,c);var m=c.children[0];return void(m&&m.type===q&&(f(i)||(c.children.splice(0,1),s.splice(a+2,0,m))))}}e.push(i),d(i.children,e,n||f(i),r),e.pop(i)}}function m(t){for(var e,n,r=t.length;r--;)(e=t[r])&&e.type===S&&(n=I[e.name],m(e.children),function(t){for(var e=t.length;e--;){var n=t[e].type;if(n===S||n===L)return!1;if(n===T&&/\S|\u00A0/.test(t[e].val))return!1}return!0}(e.children)&&n&&!n.isSelfClosing&&!n.allowsEmpty&&t.splice.apply(t,[r,1].concat(e.children)))}function p(t,n){var i,l,o,a,s,u,c,h,d=[];for(c=function(t){return!1!==(!t||(void 0!==t.isHtmlInline?t.isHtmlInline:t.isInline))};t.length>0;)if(i=t.shift()){if(i.type===S)h=i.children[i.children.length-1]||{},l=I[i.name],s=n&&c(l),o=p(i.children,!1),l&&l.html?(c(l)||!c(I[h.name])||l.isPreFormatted||l.skipLastLineBreak||k||(o+="<br />"),r(l.html)?a=l.html.call(w,i,i.attrs,o):(i.attrs[0]=o,a=e(l.html,i.attrs))):a=i.val+o+(i.closing?i.closing.val:"");else{if(i.type===q){if(!n){d.push("<br />");continue}u||d.push("<div>"),k||d.push("<br />"),t.length||d.push("<br />"),d.push("</div>\n"),u=!1;continue}s=n,a=f(i.val,!0)}s&&!u?(d.push("<div>"),u=!0):!s&&u&&(d.push("</div>\n"),u=!1),d.push(a)}return u&&d.push("</div>\n"),d.join("")}function g(t){for(var e,n,r,i,l,o,a,s,u,c,f=[];t.length>0;)if(e=t.shift())if(r=I[e.name],i=!(!r||!1!==r.isInline),l=r&&r.isSelfClosing,a=i&&w.opts.breakBeforeBlock&&!1!==r.breakBefore||r&&r.breakBefore,s=i&&!l&&w.opts.breakStartBlock&&!1!==r.breakStart||r&&r.breakStart,u=i&&w.opts.breakEndBlock&&!1!==r.breakEnd||r&&r.breakEnd,c=i&&w.opts.breakAfterBlock&&!1!==r.breakAfter||r&&r.breakAfter,o=(r?r.quoteType:null)||w.opts.quoteType||E.auto,r||e.type!==S)if(e.type===S){if(a&&f.push("\n"),f.push("["+e.name),e.attrs){e.attrs.defaultattr&&(f.push("=",v(e.attrs.defaultattr,o,"defaultattr")),delete e.attrs.defaultattr);for(n in e.attrs)e.attrs.hasOwnProperty(n)&&f.push(" ",n,"=",v(e.attrs[n],o,n))}f.push("]"),s&&f.push("\n"),e.children&&f.push(g(e.children)),l||r.excludeClosing||(u&&f.push("\n"),f.push("[/"+e.name+"]")),c&&f.push("\n"),e.closing&&l&&f.push(e.closing.val)}else f.push(e.val);else f.push(e.val),e.children&&f.push(g(e.children)),e.closing&&f.push(e.closing.val);return f.join("")}function v(t,e,n){var i=/\s|=/.test(t);return r(e)?e(t,n):e===E.never||e===E.auto&&!i?t:'"'+t.replace("\\","\\\\").replace('"','\\"')+'"'}function y(t){return t.length?t[t.length-1]:null}function x(t){return t.toLowerCase()}var w=this;w.opts=b({},a.defaults,t),w.tokenize=function(t){var e,r,i,l=[],o=[{type:L,regex:/^\[\/[^\[\]]+\]/},{type:S,regex:/^\[[^\[\]]+\]/},{type:q,regex:/^(\r\n|\r|\n)/},{type:T,regex:/^([^\[\r\n]+|\[)/}];o.reverse();t:for(;t.length;){for(i=o.length;i--;)if(r=o[i].type,(e=t.match(o[i].regex))&&e[0]){l.push(n(r,e[0])),t=t.substr(e[0].length);continue t}t.length&&l.push(n(T,t)),t=""}return l},w.parse=function(t,e){var n=c(w.tokenize(t)),r=w.opts;return r.fixInvalidNesting&&d(n),h(n,null,e),r.removeEmptyTags&&m(n),n},w.toHTML=function(t,e){return p(w.parse(t,e),!0)},w.toBBCode=function(t,e){return g(w.parse(t,e))}}function s(t){return t=parseInt(t,10),isNaN(t)?"00":(t=Math.max(0,Math.min(t,255)).toString(16)).length<2?"0"+t:t}function u(t){var e;return t=t||"#000",(e=t.match(/rgb\((\d{1,3}),\s*?(\d{1,3}),\s*?(\d{1,3})\)/i))?"#"+s(e[1])+s(e[2]-0)+s(e[3]-0):(e=t.match(/#([0-f])([0-f])([0-f])\s*?$/i))?"#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]:t}function c(){function t(){y(I,function(t){var e,n=I[t].tags,r=I[t].styles;n&&y(n,function(n,r){e=!1===I[t].isInline,h[n]=h[n]||{},h[n][e]=h[n][e]||{},h[n][e][t]=r}),r&&y(r,function(n,r){e=!1===I[t].isInline,m[e]=m[e]||{},m[e][n]=m[e][n]||{},m[e][n][t]=r})})}function e(t,e,n){var i,o,a=d.getStyle;return n=!!n,m[n]?(y(m[n],function(n,s){(i=a(t,n))&&a(t.parentNode,n)!==i&&y(s,function(n,a){(!a||a.indexOf(i.toString())>-1)&&(o=I[n].format,e=r(o)?o.call(f,t,e):l(o,e))})}),e):e}function o(t,e,n){var i,o,a=t.nodeName.toLowerCase();n=!!n,h[a]&&h[a][n]&&y(h[a][n],function(n,a){a&&(i=!1,y(a,function(e,n){if(g(t,e)&&!(n&&n.indexOf(g(t,e))<0))return i=!0,!1}),!i)||(o=I[n].format,e=r(o)?o.call(f,t,e):l(o,e))});var s=d.isInline;if(n&&(!s(t,!0)||"br"===a)){for(var u,c,m=t.previousSibling;m&&1===m.nodeType&&!v(m,"br")&&s(m,!0)&&!m.firstChild;)m=m.previousSibling;do{u=((c=t.parentNode)&&c.lastChild)===t,t=c}while(c&&u&&s(c,!0));(!u||"li"===a||"br"===a&&k)&&(e+="\n"),"br"!==a&&m&&!v(m,"br")&&s(m,!0)&&(e="\n"+e)}return e}function s(t){var n=function(t,r){var i="";return d.traverse(t,function(t){var l="",a=t.nodeType,s=t.nodeName.toLowerCase(),u=x[s],c=t.firstChild,f=!0;if("object"==typeof r&&(f=r.indexOf(s)>-1,v(t,"img")&&g(t,w)&&(f=!0),f||(u=r)),3===a||1===a)if(1===a){if(v(t,".sceditor-nlf")&&(!c||!k&&1===t.childNodes.length&&/br/i.test(c.nodeName)))return;"iframe"!==s&&(l=n(t,u)),f?("code"!==s&&(l=e(t,l=o(t,l=e(t,l)),!0)),i+=o(t,l,!0)):i+=l}else i+=t.nodeValue},!1,!0),i};return n(t)}function u(t,e,r){var i=new a(f.opts.parserOptions).toHTML(f.opts.bbcodeTrim?e.trim():e);return t||r?n(i):i}function c(t,e,n){var r,i,l=(e=e||document).createElement("div"),o=new a(f.opts.parserOptions);for(l.innerHTML=t,p(l,"visibility","hidden"),e.body.appendChild(l),n&&p(l,"whiteSpace",p(n,"whiteSpace")),d.removeWhiteSpace(l),i=l.getElementsByClassName("sceditor-ignore");i.length;)i[0].parentNode.removeChild(i[0]);return r=s(l),e.body.removeChild(l),r=o.toBBCode(r,!0),f.opts.bbcodeTrim&&(r=r.trim()),r}var f=this;f.stripQuotes=i;var h={},m={},x={ul:["li","ol","ul"],ol:["li","ol","ul"],table:["tr"],tr:["td","th"],code:["br","p","div"]};f.init=function(){f.opts=this.opts,f.elementToBbcode=s,t(),this.commands=b(!0,{},C,this.commands),this.toBBCode=f.toSource,this.fromBBCode=f.toHtml},f.toHtml=u.bind(null,!1),f.fragmentToHtml=u.bind(null,!0),f.toSource=c,f.fragmentToSource=c}var f=t.escapeEntities,h=t.escapeUriScheme,d=t.dom,m=t.utils,p=d.css,g=d.attr,v=d.is,b=m.extend,y=m.each,x=t.ie,k=x&&x<11,w="data-sceditor-emoticon",B=t.command.get,E={always:1,never:2,auto:3},C={bold:{txtExec:["[b]","[/b]"]},italic:{txtExec:["[i]","[/i]"]},underline:{txtExec:["[u]","[/u]"]},strike:{txtExec:["[s]","[/s]"]},subscript:{txtExec:["[sub]","[/sub]"]},superscript:{txtExec:["[sup]","[/sup]"]},left:{txtExec:["[left]","[/left]"]},center:{txtExec:["[center]","[/center]"]},right:{txtExec:["[right]","[/right]"]},justify:{txtExec:["[justify]","[/justify]"]},font:{txtExec:function(t){var e=this;B("font")._dropDown(e,t,function(t){e.insertText("[font="+t+"]","[/font]")})}},size:{txtExec:function(t){var e=this;B("size")._dropDown(e,t,function(t){e.insertText("[size="+t+"]","[/size]")})}},color:{txtExec:function(t){var e=this;B("color")._dropDown(e,t,function(t){e.insertText("[color="+t+"]","[/color]")})}},bulletlist:{txtExec:function(t,e){var n="";y(e.split(/\r?\n/),function(){n+=(n?"\n":"")+"[li]"+this+"[/li]"}),this.insertText("[ul]\n"+n+"\n[/ul]")}},orderedlist:{txtExec:function(t,e){var n="";y(e.split(/\r?\n/),function(){n+=(n?"\n":"")+"[li]"+this+"[/li]"}),this.insertText("[ol]\n"+n+"\n[/ol]")}},table:{txtExec:["[table][tr][td]","[/td][/tr][/table]"]},horizontalrule:{txtExec:["[hr]"]},code:{txtExec:["[code]","[/code]"]},image:{txtExec:function(t,e){var n=this;B("image")._dropDown(n,t,e,function(t,e,r){var i="";e&&(i+=" width="+e),r&&(i+=" height="+r),n.insertText("[img"+i+"]"+t+"[/img]")})}},email:{txtExec:function(t,e){var n=this;B("email")._dropDown(n,t,function(t,r){n.insertText("[email="+t+"]"+(r||e||t)+"[/email]")})}},link:{txtExec:function(t,e){var n=this;B("link")._dropDown(n,t,function(t,r){n.insertText("[url="+t+"]"+(r||e||t)+"[/url]")})}},quote:{txtExec:["[quote]","[/quote]"]},youtube:{txtExec:function(t){var e=this;B("youtube")._dropDown(e,t,function(t){e.insertText("[youtube]"+t+"[/youtube]")})}},rtl:{txtExec:["[rtl]","[/rtl]"]},ltr:{txtExec:["[ltr]","[/ltr]"]}},I={b:{tags:{b:null,strong:null},styles:{"font-weight":["bold","bolder","401","700","800","900"]},format:"[b]{0}[/b]",html:"<strong>{0}</strong>"},i:{tags:{i:null,em:null},styles:{"font-style":["italic","oblique"]},format:"[i]{0}[/i]",html:"<em>{0}</em>"},u:{tags:{u:null},styles:{"text-decoration":["underline"]},format:"[u]{0}[/u]",html:"<u>{0}</u>"},s:{tags:{s:null,strike:null},styles:{"text-decoration":["line-through"]},format:"[s]{0}[/s]",html:"<s>{0}</s>"},sub:{tags:{sub:null},format:"[sub]{0}[/sub]",html:"<sub>{0}</sub>"},sup:{tags:{sup:null},format:"[sup]{0}[/sup]",html:"<sup>{0}</sup>"},font:{tags:{font:{face:null}},styles:{"font-family":null},quoteType:E.never,format:function(t,e){var n;return v(t,"font")&&(n=g(t,"face"))||(n=p(t,"font-family")),"[font="+i(n)+"]"+e+"[/font]"},html:'<font face="{defaultattr}">{0}</font>'},size:{tags:{font:{size:null}},styles:{"font-size":null},format:function(t,e){var n=g(t,"size"),r=2;return n||(n=p(t,"fontSize")),n.indexOf("px")>-1?((n=n.replace("px","")-0)<12&&(r=1),n>15&&(r=3),n>17&&(r=4),n>23&&(r=5),n>31&&(r=6),n>47&&(r=7)):r=n,"[size="+r+"]"+e+"[/size]"},html:'<font size="{defaultattr}">{!0}</font>'},color:{tags:{font:{color:null}},styles:{color:null},quoteType:E.never,format:function(t,e){var n;return v(t,"font")&&(n=g(t,"color"))||(n=t.style.color||p(t,"color")),"[color="+u(n)+"]"+e+"[/color]"},html:function(t,e,n){return'<font color="'+f(u(e.defaultattr),!0)+'">'+n+"</font>"}},ul:{tags:{ul:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ul]{0}[/ul]",html:"<ul>{0}</ul>"},list:{breakStart:!0,isInline:!1,skipLastLineBreak:!0,html:"<ul>{0}</ul>"},ol:{tags:{ol:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ol]{0}[/ol]",html:"<ol>{0}</ol>"},li:{tags:{li:null},isInline:!1,closedBy:["/ul","/ol","/list","*","li"],format:"[li]{0}[/li]",html:"<li>{0}</li>"},"*":{isInline:!1,closedBy:["/ul","/ol","/list","*","li"],html:"<li>{0}</li>"},table:{tags:{table:null},isInline:!1,isHtmlInline:!0,skipLastLineBreak:!0,format:"[table]{0}[/table]",html:"<table>{0}</table>"},tr:{tags:{tr:null},isInline:!1,skipLastLineBreak:!0,format:"[tr]{0}[/tr]",html:"<tr>{0}</tr>"},th:{tags:{th:null},allowsEmpty:!0,isInline:!1,format:"[th]{0}[/th]",html:"<th>{0}</th>"},td:{tags:{td:null},allowsEmpty:!0,isInline:!1,format:"[td]{0}[/td]",html:"<td>{0}</td>"},emoticon:{allowsEmpty:!0,tags:{img:{src:null,"data-sceditor-emoticon":null}},format:function(t,e){return g(t,w)+e},html:"{0}"},hr:{tags:{hr:null},allowsEmpty:!0,isSelfClosing:!0,isInline:!1,format:"[hr]{0}",html:"<hr />"},img:{allowsEmpty:!0,tags:{img:{src:null}},allowedChildren:["#"],quoteType:E.never,format:function(t,e){var n,r,i="",l=function(e){return t.style?t.style[e]:null};return g(t,w)?e:(n=g(t,"width")||l("width"),r=g(t,"height")||l("height"),(t.complete&&(n||r)||n&&r)&&(i="="+d.width(t)+"x"+d.height(t)),"[img"+i+"]"+g(t,"src")+"[/img]")},html:function(t,e,n){var r,i,l,o="";return r=e.width,i=e.height,e.defaultattr&&(r=(l=e.defaultattr.split(/x/i))[0],i=2===l.length?l[1]:l[0]),void 0!==r&&(o+=' width="'+f(r,!0)+'"'),void 0!==i&&(o+=' height="'+f(i,!0)+'"'),"<img"+o+' src="'+h(n)+'" />'}},url:{allowsEmpty:!0,tags:{a:{href:null}},quoteType:E.never,format:function(t,e){var n=g(t,"href");return"mailto:"===n.substr(0,7)?'[email="'+n.substr(7)+'"]'+e+"[/email]":"[url="+n+"]"+e+"[/url]"},html:function(t,e,n){return e.defaultattr=f(e.defaultattr,!0)||n,'<a href="'+h(e.defaultattr)+'">'+n+"</a>"}},email:{quoteType:E.never,html:function(t,e,n){return'<a href="mailto:'+(f(e.defaultattr,!0)||n)+'">'+n+"</a>"}},quote:{tags:{blockquote:null},isInline:!1,quoteType:E.never,format:function(t,e){for(var n,r="",i=t.children,l=0;!n&&l<i.length;l++)v(i[l],"cite")&&(n=i[l]);return(n||g(t,"data-author"))&&(r=n&&n.textContent||g(t,"data-author"),g(t,"data-author",r),n&&t.removeChild(n),e=this.elementToBbcode(t),r="="+r.replace(/(^\s+|\s+$)/g,""),n&&t.insertBefore(n,t.firstChild)),"[quote"+r+"]"+e+"[/quote]"},html:function(t,e,n){return e.defaultattr&&(n="<cite>"+f(e.defaultattr)+"</cite>"+n),"<blockquote>"+n+"</blockquote>"}},code:{tags:{code:null},isInline:!1,allowedChildren:["#","#newline"],format:"[code]{0}[/code]",html:"<code>{0}</code>"},left:{styles:{"text-align":["left","-webkit-left","-moz-left","-khtml-left"]},isInline:!1,format:"[left]{0}[/left]",html:'<div align="left">{0}</div>'},center:{styles:{"text-align":["center","-webkit-center","-moz-center","-khtml-center"]},isInline:!1,format:"[center]{0}[/center]",html:'<div align="center">{0}</div>'},right:{styles:{"text-align":["right","-webkit-right","-moz-right","-khtml-right"]},isInline:!1,format:"[right]{0}[/right]",html:'<div align="right">{0}</div>'},justify:{styles:{"text-align":["justify","-webkit-justify","-moz-justify","-khtml-justify"]},isInline:!1,format:"[justify]{0}[/justify]",html:'<div align="justify">{0}</div>'},youtube:{allowsEmpty:!0,tags:{iframe:{"data-youtube-id":null}},format:function(t,e){return(t=g(t,"data-youtube-id"))?"[youtube]"+t+"[/youtube]":e},html:'<iframe width="560" height="315" frameborder="0" src="https://www.youtube.com/embed/{0}?wmode=opaque" data-youtube-id="{0}" allowfullscreen></iframe>'},rtl:{styles:{direction:["rtl"]},format:"[rtl]{0}[/rtl]",html:'<div style="direction: rtl">{0}</div>'},ltr:{styles:{direction:["ltr"]},format:"[ltr]{0}[/ltr]",html:'<div style="direction: ltr">{0}</div>'},ignore:{}},S="open",T="content",q="newline",L="close";o.prototype={clone:function(){var t=this;return new o(t.type,t.name,t.val,b({},t.attrs),[],t.closing?t.closing.clone():null)},splitAt:function(t){var e,n=this,r=n.clone(),i=n.children.indexOf(t);return i>-1&&(e=n.children.length-i,r.children=n.children.splice(i,e)),r}},a.QuoteType=E,a.defaults={breakBeforeBlock:!1,breakStartBlock:!1,breakEndBlock:!1,breakAfterBlock:!0,removeEmptyTags:!0,fixInvalidNesting:!0,fixInvalidChildren:!0,quoteType:E.auto},c.get=function(t){return I[t]||null},c.set=function(t,e){return t&&e&&((e=b(I[t]||{},e)).remove=function(){delete I[t]},I[t]=e),this},c.rename=function(t,e){return t in I&&(I[e]=I[t],delete I[t]),this},c.remove=function(t){return t in I&&delete I[t],this},c.formatBBCodeString=e,t.formats.bbcode=c,t.BBCodeParser=a}(sceditor); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(t){"use strict";function e(){function i(t,e){p[t]&&p[t].forEach(function(n){n.tags[t]?u(n.tags[t],function(t,i){e.getAttributeNode&&(!(t=e.getAttributeNode(t))||i&&i.indexOf(t.value)<0||n.conv.call(h,e))}):n.conv&&n.conv.call(h,e)})}function r(t){n.traverse(t,function(t){var e=t.nodeName.toLowerCase();i("*",t),i(e,t)},!0)}function l(t,i){var o,r=t.childNodes,c=t.nodeName.toLowerCase(),s=t.nodeValue,u=r.length,d=e.allowedEmptyTags||[];if(i&&"br"===c)return!0;if(a(t,".sceditor-ignore"))return!0;if(d.indexOf(c)>-1||"td"===c||!n.canHaveChildren(t))return!1;if(s&&/\S|\u00A0/.test(s))return!1;for(;u--;)if(!l(r[u],i&&!t.previousSibling&&!t.nextSibling))return!1;return!t.getBoundingClientRect||!t.className&&!t.hasAttributes("style")||(!(o=t.getBoundingClientRect()).width||!o.height)}function c(t){n.traverse(t,function(i){var o,r=i.nodeName.toLowerCase(),a=i.parentNode,c=i.nodeType,s=!n.isInline(i),u=i.previousSibling,d=i.nextSibling,f=a===t,g=!u&&!d,v="iframe"!==r&&l(i,f&&g&&"br"!==r),x=i.ownerDocument,h=e.allowedTags,p=e.disallowedTags;if(3!==c&&(4===c?r="!cdata":"!"!==r&&8!==c||(r="!comment"),v?o=!0:h&&h.length?o=h.indexOf(r)<0:p&&p.length&&(o=p.indexOf(r)>-1),o)){if(!v){for(s&&u&&n.isInline(u)&&a.insertBefore(x.createTextNode(" "),i);i.firstChild;)a.insertBefore(i.firstChild,d);s&&d&&n.isInline(d)&&a.insertBefore(x.createTextNode(" "),d)}a.removeChild(i)}},!0)}function f(t,e){var n={};return t&&s(n,t),e?(u(e,function(t,e){Array.isArray(e)?n[t]=(n[t]||[]).concat(e):n[t]||(n[t]=null)}),n):n}function v(t){n.removeWhiteSpace(t);for(var e,i,o=t.firstChild;o;)i=o.nextSibling,n.isInline(o)&&!a(o,".sceditor-ignore")?(e||(e=t.ownerDocument.createElement("p"),o.parentNode.insertBefore(e,o)),e.appendChild(o)):e=null,o=i}function x(t){var i,o,r,a,l,c,s=e.allowedAttribs,u=s&&!d(s),g=e.disallowedAttribs,v=g&&!d(g);m={},n.traverse(t,function(t){if(t.attributes&&(i=t.nodeName.toLowerCase(),a=t.attributes.length))for(m[i]||(m[i]=u?f(s["*"],s[i]):f(g["*"],g[i]));a--;)o=t.attributes[a],r=o.name,l=m[i][r],c=!1,u?c=null!==l&&(!Array.isArray(l)||l.indexOf(o.value)<0):v&&(c=null===l||Array.isArray(l)&&l.indexOf(o.value)>-1),c&&t.removeAttribute(r)})}var h=this,p={},m={};h.init=function(){d(e.converters||{})||u(e.converters,function(t,e){u(e.tags,function(t){p[t]||(p[t]=[]),p[t].push(e)})}),this.commands=s(!0,{},g,this.commands)},h.toSource=function(e,n){var i,a=n.createElement("div");return a.innerHTML=e,o(a,"visibility","hidden"),n.body.appendChild(a),r(a),c(a),x(a),v(a),i=(new t.XHTMLSerializer).serialize(a,!0),n.body.removeChild(a),i},h.fragmentToSource=h.toSource}var n=t.dom,i=t.utils,o=n.css,r=n.attr,a=n.is,l=n.removeAttr,c=n.convertElement,s=i.extend,u=i.each,d=i.isEmptyObject,f=t.command.get,g={bold:{txtExec:["<strong>","</strong>"]},italic:{txtExec:["<em>","</em>"]},underline:{txtExec:['<span style="text-decoration:underline;">',"</span>"]},strike:{txtExec:['<span style="text-decoration:line-through;">',"</span>"]},subscript:{txtExec:["<sub>","</sub>"]},superscript:{txtExec:["<sup>","</sup>"]},left:{txtExec:['<div style="text-align:left;">',"</div>"]},center:{txtExec:['<div style="text-align:center;">',"</div>"]},right:{txtExec:['<div style="text-align:right;">',"</div>"]},justify:{txtExec:['<div style="text-align:justify;">',"</div>"]},font:{txtExec:function(t){var e=this;f("font")._dropDown(e,t,function(t){e.insertText('<span style="font-family:'+t+';">',"</span>")})}},size:{txtExec:function(t){var e=this;f("size")._dropDown(e,t,function(t){e.insertText('<span style="font-size:'+t+';">',"</span>")})}},color:{txtExec:function(t){var e=this;f("color")._dropDown(e,t,function(t){e.insertText('<span style="color:'+t+';">',"</span>")})}},bulletlist:{txtExec:["<ul><li>","</li></ul>"]},orderedlist:{txtExec:["<ol><li>","</li></ol>"]},table:{txtExec:["<table><tr><td>","</td></tr></table>"]},horizontalrule:{txtExec:["<hr />"]},code:{txtExec:["<code>","</code>"]},image:{txtExec:function(t,e){var n=this;f("image")._dropDown(n,t,e,function(t,e,i){var o="";e&&(o+=' width="'+e+'"'),i&&(o+=' height="'+i+'"'),n.insertText("<img"+o+' src="'+t+'" />')})}},email:{txtExec:function(t,e){var n=this;f("email")._dropDown(n,t,function(t,i){n.insertText('<a href="mailto:'+t+'">'+(i||e||t)+"</a>")})}},link:{txtExec:function(t,e){var n=this;f("link")._dropDown(n,t,function(t,i){n.insertText('<a href="'+t+'">'+(i||e||t)+"</a>")})}},quote:{txtExec:["<blockquote>","</blockquote>"]},youtube:{txtExec:function(t){var e=this;f("youtube")._dropDown(e,t,function(t,n){e.insertText('<iframe width="560" height="315" src="https://www.youtube.com/embed/{id}?wmode=opaque&start='+n+'" data-youtube-id="'+t+'" frameborder="0" allowfullscreen></iframe>')})}},rtl:{txtExec:['<div stlye="direction:rtl;">',"</div>"]},ltr:{txtExec:['<div stlye="direction:ltr;">',"</div>"]}};t.XHTMLSerializer=function(){function t(t){var e={"&":"&","<":"<",">":">",'"':"""," ":" "};return t?t.replace(/[&<>"\xa0]/g,function(t){return e[t]||t}):""}function e(t){return t.replace(/[\r\n]/," ").replace(/[^\S|\u00A0]+/g," ")}function i(t,e){switch(t.nodeType){case 1:"!"===t.nodeName.toLowerCase()?s(t):l(t,e);break;case 3:u(t,e);break;case 4:c(t);break;case 8:s(t);break;case 9:case 11:r(t)}}function r(t){for(var e=t.firstChild;e;)i(e),e=e.nextSibling}function l(e,r){var l,c,s,u=e.nodeName.toLowerCase(),g="iframe"===u,v=e.attributes.length,h=e.firstChild,p=r||/pre(?:\-wrap)?$/i.test(o(e,"whiteSpace")),m=!e.firstChild&&!n.canHaveChildren(e)&&!g;if(!a(e,".sceditor-ignore")){for(d("<"+u,!r&&f(e));v--;)s=(c=e.attributes[v]).value,d(" "+c.name.toLowerCase()+'="'+t(s)+'"',!1);for(d(m?" />":">",!1),g||(l=h);l;)x++,i(l,p),l=l.nextSibling,x--;m||d("</"+u+">",!p&&!g&&f(e)&&h&&f(h))}}function c(e){d("<![CDATA["+t(e.nodeValue)+"]]>")}function s(e){d("\x3c!-- "+t(e.nodeValue)+" --\x3e")}function u(n,i){var o=n.nodeValue;i||(o=e(o)),o&&d(t(o),!i&&f(n))}function d(t,e){var n=x;if(!1!==e)for(v.length&&v.push("\n");n--;)v.push(g.indentStr);v.push(t)}function f(t){var e=t.previousSibling;return 1!==t.nodeType&&e?!n.isInline(e):!e&&!n.isInline(t.parentNode)||!n.isInline(t)}var g={indentStr:"\t"},v=[],x=0;this.serialize=function(t,e){if(v=[],e)for(t=t.firstChild;t;)i(t),t=t.nextSibling;else i(t);return v.join("")}},e.converters=[{tags:{"*":{width:null}},conv:function(t){o(t,"width",r(t,"width")),l(t,"width")}},{tags:{"*":{height:null}},conv:function(t){o(t,"height",r(t,"height")),l(t,"height")}},{tags:{li:{value:null}},conv:function(t){l(t,"value")}},{tags:{"*":{text:null}},conv:function(t){o(t,"color",r(t,"text")),l(t,"text")}},{tags:{"*":{color:null}},conv:function(t){o(t,"color",r(t,"color")),l(t,"color")}},{tags:{"*":{face:null}},conv:function(t){o(t,"fontFamily",r(t,"face")),l(t,"face")}},{tags:{"*":{align:null}},conv:function(t){o(t,"textAlign",r(t,"align")),l(t,"align")}},{tags:{"*":{border:null}},conv:function(t){o(t,"borderWidth",r(t,"border")),l(t,"border")}},{tags:{applet:{name:null},img:{name:null},layer:{name:null},map:{name:null},object:{name:null},param:{name:null}},conv:function(t){r(t,"id")||r(t,"id",r(t,"name")),l(t,"name")}},{tags:{"*":{vspace:null}},conv:function(t){o(t,"marginTop",r(t,"vspace")-0),o(t,"marginBottom",r(t,"vspace")-0),l(t,"vspace")}},{tags:{"*":{hspace:null}},conv:function(t){o(t,"marginLeft",r(t,"hspace")-0),o(t,"marginRight",r(t,"hspace")-0),l(t,"hspace")}},{tags:{hr:{noshade:null}},conv:function(t){o(t,"borderStyle","solid"),l(t,"noshade")}},{tags:{"*":{nowrap:null}},conv:function(t){o(t,"whiteSpace","nowrap"),l(t,"nowrap")}},{tags:{big:null},conv:function(t){o(c(t,"span"),"fontSize","larger")}},{tags:{small:null},conv:function(t){o(c(t,"span"),"fontSize","smaller")}},{tags:{b:null},conv:function(t){c(t,"strong")}},{tags:{u:null},conv:function(t){o(c(t,"span"),"textDecoration","underline")}},{tags:{s:null,strike:null},conv:function(t){o(c(t,"span"),"textDecoration","line-through")}},{tags:{dir:null},conv:function(t){c(t,"ul")}},{tags:{center:null},conv:function(t){o(c(t,"div"),"textAlign","center")}},{tags:{font:{size:null}},conv:function(t){o(t,"fontSize",o(t,"fontSize")),l(t,"size")}},{tags:{font:null},conv:function(t){c(t,"span")}},{tags:{"*":{type:["_moz"]}},conv:function(t){l(t,"type")}},{tags:{"*":{_moz_dirty:null}},conv:function(t){l(t,"_moz_dirty")}},{tags:{"*":{_moz_editor_bogus_node:null}},conv:function(t){t.parentNode.removeChild(t)}}],e.allowedAttribs={},e.disallowedAttribs={},e.allowedTags=[],e.disallowedTags=[],e.allowedEmptyTags=[],t.formats.xhtml=e}(sceditor); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(H,V){"use strict";var M=V.dom,L={bold:'<path d="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z" />',bulletlist:'<path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" />',center:'<path d="M3,3H21V5H3V3M7,7H17V9H7V7M3,11H21V13H3V11M7,15H17V17H7V15M3,19H21V21H3V19Z" />',code:'<path d="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z" />',color:'<path d="M9.62,12L12,5.67L14.37,12M11,3L5.5,17H7.75L8.87,14H15.12L16.25,17H18.5L13,3H11Z" /><path class="sce-color" d="M0,24H24V20H0V24Z" />',copy:'<path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" />',cut:'<path d="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z" />',date:'<path d="M7,10H12V15H7M19,19H5V8H19M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3Z" />',email:'<path d="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z" />',emoticon:'<path d="M12,17.5C14.33,17.5 16.3,16.04 17.11,14H6.89C7.69,16.04 9.67,17.5 12,17.5M8.5,11A1.5,1.5 0 0,0 10,9.5A1.5,1.5 0 0,0 8.5,8A1.5,1.5 0 0,0 7,9.5A1.5,1.5 0 0,0 8.5,11M15.5,11A1.5,1.5 0 0,0 17,9.5A1.5,1.5 0 0,0 15.5,8A1.5,1.5 0 0,0 14,9.5A1.5,1.5 0 0,0 15.5,11M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" />',font:'<path d="M17,8H20V20H21V21H17V20H18V17H14L12.5,20H14V21H10V20H11L17,8M18,9L14.5,16H18V9M5,3H10C11.11,3 12,3.89 12,5V16H9V11H6V16H3V5C3,3.89 3.89,3 5,3M6,5V9H9V5H6Z" />',format:'<path d="M18,4V3A1,1 0 0,0 17,2H5A1,1 0 0,0 4,3V7A1,1 0 0,0 5,8H17A1,1 0 0,0 18,7V6H19V10H9V21A1,1 0 0,0 10,22H12A1,1 0 0,0 13,21V12H21V4H18Z" />',grip:'<path d="M22,22H20V20H22V22M22,18H20V16H22V18M18,22H16V20H18V22M18,18H16V16H18V18M14,22H12V20H14V22M22,14H20V12H22V14Z" />',horizontalrule:'<path d="M 3,3 21,3 21,5 3,5 3,3 M 3,7 15,7 15,9 3,9 3,7 m 0,4 18,0 0,4 -18,0 0,-4" />',image:'<path d="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z" />',indent:'<path d="M11,13H21V11H11M11,9H21V7H11M3,3V5H21V3M11,17H21V15H11M3,8V16L7,12M3,21H21V19H3V21Z" />',italic:'<path d="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" />',justify:'<path d="M3,3H21V5H3V3M3,7H21V9H3V7M3,11H21V13H3V11M3,15H21V17H3V15M3,19H21V21H3V19Z" />\t\t',left:'<path d="M3,3H21V5H3V3M3,7H15V9H3V7M3,11H21V13H3V11M3,15H15V17H3V15M3,19H21V21H3V19Z" />\t\t',link:'<path d="M16,6H13V7.9H16C18.26,7.9 20.1,9.73 20.1,12A4.1,4.1 0 0,1 16,16.1H13V18H16A6,6 0 0,0 22,12C22,8.68 19.31,6 16,6M3.9,12C3.9,9.73 5.74,7.9 8,7.9H11V6H8A6,6 0 0,0 2,12A6,6 0 0,0 8,18H11V16.1H8C5.74,16.1 3.9,14.26 3.9,12M8,13H16V11H8V13Z" />',ltr:'<path d="M21,18L17,14V17H5V19H17V22M9,10V15H11V4H13V15H15V4H17V2H9A4,4 0 0,0 5,6A4,4 0 0,0 9,10Z" />',maximize:'<path d="M9.5,13.09L10.91,14.5L6.41,19H10V21H3V14H5V17.59L9.5,13.09M10.91,9.5L9.5,10.91L5,6.41V10H3V3H10V5H6.41L10.91,9.5M14.5,13.09L19,17.59V14H21V21H14V19H17.59L13.09,14.5L14.5,13.09M13.09,9.5L17.59,5H14V3H21V10H19V6.41L14.5,10.91L13.09,9.5Z" />',orderedlist:'<path d="M7,13H21V11H7M7,19H21V17H7M7,7H21V5H7M2,11H3.8L2,13.1V14H5V13H3.2L5,10.9V10H2M3,8H4V4H2V5H3M2,17H4V17.5H3V18.5H4V19H2V20H5V16H2V17Z" />',outdent:'<path d="M11,13H21V11H11M11,9H21V7H11M3,3V5H21V3M3,21H21V19H3M3,12L7,16V8M11,17H21V15H11V17Z" />',paste:'<path d="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z" />',pastetext:'<path d="M19,20H5V4H7V7H17V4H19M12,2A1,1 0 0,1 13,3A1,1 0 0,1 12,4A1,1 0 0,1 11,3A1,1 0 0,1 12,2M19,2H14.82C14.4,0.84 13.3,0 12,0C10.7,0 9.6,0.84 9.18,2H5A2,2 0 0,0 3,4V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V4A2,2 0 0,0 19,2Z" />',print:'<path d="M18,3H6V7H18M19,12A1,1 0 0,1 18,11A1,1 0 0,1 19,10A1,1 0 0,1 20,11A1,1 0 0,1 19,12M16,19H8V14H16M19,8H5A3,3 0 0,0 2,11V17H6V21H18V17H22V11A3,3 0 0,0 19,8Z" />',quote:'<path d="M14,17H17L19,13V7H13V13H16M6,17H9L11,13V7H5V13H8L6,17Z" />',redo:'<path d="M18.4,10.6C16.55,9 14.15,8 11.5,8C6.85,8 2.92,11.03 1.54,15.22L3.9,16C4.95,12.81 7.95,10.5 11.5,10.5C13.45,10.5 15.23,11.22 16.62,12.38L13,16H22V7L18.4,10.6Z" />',removeformat:'<path d="M6,5V5.18L8.82,8H11.22L10.5,9.68L12.6,11.78L14.21,8H20V5H6M3.27,5L2,6.27L8.97,13.24L6.5,19H9.5L11.07,15.34L16.73,21L18,19.73L3.55,5.27L3.27,5Z" />',right:'<path d="M3,3H21V5H3V3M9,7H21V9H9V7M3,11H21V13H3V11M9,15H21V17H9V15M3,19H21V21H3V19Z" />',rtl:'<path d="M8,17V14L4,18L8,22V19H20V17M10,10V15H12V4H14V15H16V4H18V2H10A4,4 0 0,0 6,6A4,4 0 0,0 10,10Z" />',size:'<path d="M3,12H6V19H9V12H12V9H3M9,4V7H14V19H17V7H22V4H9Z" />',source:'<path d="M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z" />',strike:'<path d="M3,14H21V12H3M5,4V7H10V10H14V7H19V4M10,19H14V16H10V19Z" />',subscript:'<path d="M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,21.03H16.97V20.03L17.86,19.23C18.62,18.58 19.18,18.04 19.56,17.6C19.93,17.16 20.12,16.75 20.13,16.36C20.14,16.08 20.05,15.85 19.86,15.66C19.68,15.5 19.39,15.38 19,15.38C18.69,15.38 18.42,15.44 18.16,15.56L17.5,15.94L17.05,14.77C17.32,14.56 17.64,14.38 18.03,14.24C18.42,14.1 18.85,14 19.32,14C20.1,14.04 20.7,14.25 21.1,14.66C21.5,15.07 21.72,15.59 21.72,16.23C21.71,16.79 21.53,17.31 21.18,17.78C20.84,18.25 20.42,18.7 19.91,19.14L19.27,19.66V19.68H21.85V21.03Z" />',superscript:'<path d="M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,9H16.97V8L17.86,7.18C18.62,6.54 19.18,6 19.56,5.55C19.93,5.11 20.12,4.7 20.13,4.32C20.14,4.04 20.05,3.8 19.86,3.62C19.68,3.43 19.39,3.34 19,3.33C18.69,3.34 18.42,3.4 18.16,3.5L17.5,3.89L17.05,2.72C17.32,2.5 17.64,2.33 18.03,2.19C18.42,2.05 18.85,2 19.32,2C20.1,2 20.7,2.2 21.1,2.61C21.5,3 21.72,3.54 21.72,4.18C21.71,4.74 21.53,5.26 21.18,5.73C20.84,6.21 20.42,6.66 19.91,7.09L19.27,7.61V7.63H21.85V9Z" />',table:'<path d="M5,4H19A2,2 0 0,1 21,6V18A2,2 0 0,1 19,20H5A2,2 0 0,1 3,18V6A2,2 0 0,1 5,4M5,8V12H11V8H5M13,8V12H19V8H13M5,14V18H11V14H5M13,14V18H19V14H13Z" />',time:'<path d="M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z" />',underline:'<path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z" />',undo:'<path d="M12.5,8C9.85,8 7.45,9 5.6,10.6L2,7V16H11L7.38,12.38C8.77,11.22 10.54,10.5 12.5,10.5C16.04,10.5 19.05,12.81 20.1,16L22.47,15.22C21.08,11.03 17.15,8 12.5,8Z" />',unlink:'<path d="M2,5.27L3.28,4L20,20.72L18.73,22L14.73,18H13V16.27L9.73,13H8V11.27L5.5,8.76C4.5,9.5 3.9,10.68 3.9,12C3.9,14.26 5.74,16.1 8,16.1H11V18H8A6,6 0 0,1 2,12C2,10.16 2.83,8.5 4.14,7.41L2,5.27M16,6A6,6 0 0,1 22,12C22,14.21 20.8,16.15 19,17.19L17.6,15.77C19.07,15.15 20.1,13.7 20.1,12C20.1,9.73 18.26,7.9 16,7.9H13V6H16M8,6H11V7.9H9.72L7.82,6H8M16,11V13H14.82L12.82,11H16Z" />',youtube:'<path d="M10,16.5V7.5L16,12M20,4.4C19.4,4.2 15.7,4 12,4C8.3,4 4.6,4.19 4,4.38C2.44,4.9 2,8.4 2,12C2,15.59 2.44,19.1 4,19.61C4.6,19.81 8.3,20 12,20C15.7,20 19.4,19.81 20,19.61C21.56,19.1 22,15.59 22,12C22,8.4 21.56,4.91 20,4.4Z" />'};V.icons.material=function(){var H,A={};return{create:function(M){return M in L&&(A[M]=V.dom.parseHTML('<svg xmlns="http://www.w3.org/2000/svg" viewbox="1 1 22 22" unselectable="on">'+L[M]+"</svg>").firstChild,"color"===M&&(H=A[M].querySelector(".sce-color"))),A[M]},update:function(V,L){if(H){var A="inherit";!V&&L&&(A=L.ownerDocument.queryCommandValue("forecolor"),parseInt(A)===A&&(A="#"+("000000"+(A=(255&A)<<16|65280&A|(16711680&A)>>>16).toString(16)).slice(-6))),M.css(H,"fill",A)}},rtl:function(H){var V=A.grip;if(V){var L=H?"scaleX(-1)":"";M.css(V,"transform",L),M.css(V,"msTransform",L),M.css(V,"webkitTransform",L)}}}},V.icons.monocons.icons=L}(document,sceditor); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(h,a){"use strict";var v=a.dom,z={bold:'<text x="50%" y="50%" text-anchor="middle" dy=".5ex" font-family="Dejavu Sans, Helvetica, Arial, sans-serif" font-size="15" font-weight="bold">B</text>',bulletlist:'<path d="M6 2h9v2H6zm0 5h9v2H6zm0 5h9v2H6z"/><circle cx="3" cy="3" r="1.75"/><circle cx="3" cy="8" r="1.75"/><circle cx="3" cy="13" r="1.75"/>',center:'<path d="M1 1h14v2H1zm2 4h10v2H3zM1 9h14v2H1zm2 4h10v2H3z"/>',code:'<path d="M7 6L4 9l3 3v-1.5L5.5 9 7 7.5zm2 0v1.5L10.5 9 9 10.5V12l3-3zM2.406 1A.517.517 0 0 0 2 1.5v13c0 .262.238.5.5.5h11a.52.52 0 0 0 .5-.5V4.375c.002-.102-.13-.193-.156-.219l-3-3A.506.506 0 0 0 10.5 1zM3 2h7v2.5c0 .262.238.5.5.5H13v9H3zm8 .688L12.313 4H11z"/>',color:'<text x="50%" y="8" text-anchor="middle" dy=".5ex" font-family="Dejavu Sans, Helvetica, Arial, sans-serif" font-size="13" font-weight="bold">A</text><path class="sce-color" d="M2 13h12v2H2z"/>',copy:'<path d="M6.404 5.002a.5.5 0 0 0-.406.5v10a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V8.596a.492.492 0 0 0 0-.094.662.662 0 0 0 0-.063v-.063l-.031-.063v-.031a.557.557 0 0 0-.094-.094l-.031-.031-2.875-2.844a.498.498 0 0 0-.125-.156.5.5 0 0 0-.344-.156h-5a.59.59 0 0 0-.094.001c-.239.046.031-.003 0 0zm.594 1h4v2.5a.5.5 0 0 0 .5.5h2.5v6h-7v-9zm5 .687l1.313 1.313h-1.313V6.689zM1.406.002a.517.517 0 0 0-.406.5v10c0 .262.238.5.5.5H7V6l3-.063V3.596a.492.492 0 0 0 0-.094.331.331 0 0 0 0-.063v-.063c-.009-.021-.02-.041-.031-.062v-.031a.597.597 0 0 0-.094-.094l-.031-.031L6.969.314a.484.484 0 0 0-.125-.156A.506.506 0 0 0 6.5.002h-5a.492.492 0 0 0-.094 0c-.229.044.032-.003 0 0zm.594 1h4v2.5c0 .262.238.5.5.5H9v1.029L7 5 6 6v4l-4 .002v-9zm5 .687l1.313 1.313H7V1.689z"/>',cut:'<path d="M3 .5c0 2.936 3.774 7.73 3.938 7.938l-1.813 2.844A2.46 2.46 0 0 0 4 11c-1.375 0-2.5 1.125-2.5 2.5S2.625 16 4 16s2.5-1.125 2.5-2.5c0-.444-.138-.856-.344-1.22L8 9.845l1.844 2.438A2.473 2.473 0 0 0 9.5 13.5c0 1.375 1.125 2.5 2.5 2.5s2.5-1.125 2.5-2.5S13.375 11 12 11a2.46 2.46 0 0 0-1.125.28L9.062 8.439C9.226 8.232 13 3.437 13 .5h-1L8 6.78 4 .5H3zM4 12c.834 0 1.5.666 1.5 1.5S4.834 15 4 15s-1.5-.666-1.5-1.5S3.166 12 4 12zm8 0c.834 0 1.5.666 1.5 1.5S12.834 15 12 15s-1.5-.666-1.5-1.5.666-1.5 1.5-1.5z"/>',date:'<path d="M8.1 7v1h2.7v1H8.094v3H11.7v-1H9v-1h2.7V7zM4.5 7v1h.8v3h-.8v1h2.7v-1h-.9V7zM.9 1v14h14.4V1h-1.8v2h-2.7V1H5.4v2H2.7V1zm.9 4h12.6v9H1.8z"/>',email:'<path d="M1 4.5v8c0 .262.238.5.5.5h13a.52.52 0 0 0 .5-.5V4.594C15 4 15 4 14.5 4H1.563C1 4 1 4 1 4.5zM2 5h12v7H2V5zm-.187-.906l-.625.812 6.5 5 .312.219.313-.219 6.5-5-.625-.813L8 8.844l-6.187-4.75z"/>',emoticon:'<path d="M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm0 1a6 6 0 1 1 0 12A6 6 0 0 1 8 2zM6 5c-.546 0-1 .454-1 1s.454 1 1 1 1-.454 1-1-.454-1-1-1zm4 0c-.547 0-1 .454-1 1s.453 1 1 1c.547 0 1-.454 1-1s-.453-1-1-1zM4.5 9.5s-.002.652.469 1.281C5.44 11.409 6.389 12 8 12c1.611 0 2.561-.591 3.031-1.219.47-.629.469-1.281.469-1.281h-1s-.002.314-.281.688c-.279.374-.83.813-2.219.813-1.389 0-1.94-.44-2.219-.813C5.502 9.814 5.5 9.5 5.5 9.5z"/>',font:'<path d="M7.953 9.75h-4.06l-.395 1.141c-.132.381-.254.752-.368 1.109H.7c.391-1.119.762-2.154 1.113-3.105a104.642 104.642 0 0 1 2.024-5.079 52.23 52.23 0 0 1 1.016-2.212h2.218a80.63 80.63 0 0 1 2.011 4.605c.337.84.105.338.458 1.288s-1.455 2.63-1.587 2.253zM5.912 3.959c-.052.151-.129.357-.229.616-.1.26-.215.56-.343.901-.129.341-.273.716-.431 1.125-.159.409-.32.839-.484 1.288h2.972c-.159-.45-.312-.882-.461-1.292a46.81 46.81 0 0 0-.425-1.127c-.135-.34-.252-.641-.354-.9-.1-.26-.182-.463-.245-.611zm6.949 10.042a36.325 36.325 0 0 0-.35-1.037l-.371-1.063H8.352l-.368 1.064A41.69 41.69 0 0 0 7.64 14H5.373c.365-1.045.711-2.01 1.039-2.896.328-.886.648-1.723.962-2.506.313-.786.623-1.53.927-2.235.305-.705.62-1.393.948-2.065h2.069c.318.672.634 1.36.941 2.065.311.705.621 1.449.936 2.235.314.783.636 1.619.964 2.506.327.888.676 1.853 1.041 2.896l-2.339.001zm-2.625-7.504c-.049.141-.118.333-.213.576-.094.242-.2.521-.319.84-.121.317-.254.668-.402 1.051-.147.382-.299.783-.45 1.201h2.772c-.147-.42-.291-.822-.433-1.205a43.073 43.073 0 0 0-.396-1.053c-.125-.317-.233-.598-.33-.84a13.884 13.884 0 0 0-.229-.57z"/>',format:'<path d="M10.5 2v1.5H12c.235 0 .401-.009.5 0 .008.088 0 .279 0 .5v2H14V3.437c0-.237-.01-.409-.031-.593-.022-.185-.067-.42-.25-.594s-.407-.2-.594-.219A5.693 5.693 0 0 0 12.5 2zm0-2L7.187 2.5 10.5 5zm.5 5.187L13.5 8.5 16 5.187zm-.958-.339h-2.03l-3.234 8.456c-.154.392-.336.994-.854 1.022v.518h2.744v-.518c-.644-.168-.658-.462-.434-1.036l.784-2.086h3.43l.854 2.086c.238.574.308.924-.406 1.036v.518h3.276v-.518c-.434-.056-.546-.364-.686-.728l-3.444-8.75M7.424 10l1.26-3.318L10 10H7.424M4.912.975h-1.63L.686 7.764c-.124.314-.27.798-.686.82V9h2.203v-.416c-.517-.135-.528-.37-.348-.832l.629-1.674h2.754l.685 1.674c.192.461.248.742-.325.832V9c1.73.137 1.837-.002 2.079-1L4.912.975M2.81 5.11l1.012-2.664L4.878 5.11H2.81"/>',grip:'<path d="M14.656 5.156l-10 10 .688.688 10-10-.688-.688zm0 3l-7 7 .688.688 7-7-.688-.688zm0 3l-4 4 .688.688 4-4-.688-.688z"/>',horizontalrule:'<path d="M2 2v1h12V2H2zm0 2v1h9V4H2zm0 2v1h12V6H2zm0 2v2h12V8H2z"/>',image:'<path d="M.5 2.5v11h15v-11H.5zm1 1h13v9h-13v-9z"/><circle cx="4" cy="6" r="1.25"/><path d="M1 11h14v2H1z"/><path d="M5 12l2-4 2 4z"/><path d="M7 12l4-7 4 7z"/>',indent:'<path d="M1 1h14v2H1zm5 4h9v2H6zm0 4h9v2H6zm-5 4h14v2H1zm4-5L1 5v6z"/>',italic:'<text x="50%" y="50%" text-anchor="middle" dy=".5ex" font-family="Dejavu Sans, Helvetica, Arial, sans-serif" font-weight="bold" font-size="15" font-style="italic">i</text>',justify:'<path d="M1 1h14v2H1zm0 4h14v2H1zm0 4h14v2H1zm0 4h14v2H1z"/>',left:'<path d="M1 1h14v2H1zm0 4h10v2H1zm0 4h14v2H1zm0 4h10v2H1z"/>',link:'<path d="M2 4c-.625 0-1.009.438-1.188.75s-.269.63-.344.969c-.15.677-.219 1.476-.219 2.28s.068 1.605.219 2.282c.075.339.165.625.344.938s.563.78 1.188.78h4v-2H2.469c-.022-.065-.042-.06-.063-.155-.1-.447-.156-1.15-.156-1.844s.057-1.396.156-1.844c.02-.088.042-.092.063-.156H6V4H2zm8 0v2h3.531c.021.064.043.068.063.156.1.448.156 1.149.156 1.844s-.057 1.396-.156 1.844c-.021.096-.041.09-.063.156H10v2h4c.625 0 1.009-.47 1.188-.781s.269-.6.344-.938c.15-.678.219-1.476.219-2.281s-.068-1.604-.219-2.281c-.075-.34-.165-.656-.344-.97S14.625 4 14 4h-4zM5.719 7c-.523.074-.949.602-.875 1.125S5.477 9.074 6 9h4c.528.01 1-.472 1-1s-.472-1.007-1-1H6a.593.593 0 0 0-.188 0h-.093z"/>',ltr:'<path d="M10.313 1.937c-.98 0-1.752.284-2.344.813-.592.529-.906 1.228-.906 2.094 0 .811.275 1.467.781 1.969.506.497 1.227.792 2.156.906V14h2V3h1v11h1V1.939zM2 4v8l4-4z"/>',maximize:'<path d="M2 7l1.75-1.75-2-2L0 5V0h5L3.25 1.75l2 2L7 2v5H2zm9 9l1.75-1.75-2-2L9 14V9h5l-1.75 1.75 2 2L16 11v5h-5zm-6 0l-1.75-1.75 2-2L7 14V9H2l1.75 1.75-2 2L0 11v5h5zm6-16l1.75 1.75-2 2L9 2v5h5l-1.75-1.75 2-2L16 5V0h-5z"/>',orderedlist:'<path d="M6 2h9v2H6zm0 5h9v2H6zm0 5h9v2H6zm-2.799.846q.392.1.594.352.205.25.205.636 0 .576-.441.877-.441.298-1.287.298-.298 0-.599-.05-.298-.046-.591-.142v-.77q.28.14.555.212.277.07.545.07.396 0 .607-.137.212-.138.212-.394 0-.265-.218-.4-.215-.137-.638-.137h-.4v-.644h.421q.376 0 .56-.116.185-.12.185-.36 0-.224-.18-.346-.178-.122-.505-.122-.242 0-.488.055-.246.054-.49.16v-.731q.295-.083.586-.125.29-.041.57-.041.756 0 1.13.249.375.246.375.744 0 .34-.179.558-.179.215-.529.304zm-.905-3.609H4v.734H1.186v-.734L2.599 7.99q.19-.172.28-.335.091-.163.091-.34 0-.272-.184-.438-.182-.166-.485-.166-.234 0-.511.101-.278.099-.594.296v-.851q.337-.112.667-.169.329-.06.645-.06.696 0 1.08.307.386.306.386.853 0 .317-.163.592-.164.272-.688.731l-.827.726zM1.228 4.276h.903V1.714l-.927.19V1.21l.922-.191h.971v3.258H4v.706H1.228v-.706z"/>',outdent:'<path d="M1 1h14v2H1zm0 4h9v2H1zm0 4h9v2H1zm0 4h14v2H1zm10-5l4-3v6z"/>',paste:'<path d="M4.406 0A.5.5 0 0 0 4 .5V1H1.5a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5H6v2.5a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V7.594a.492.492 0 0 0 0-.094.436.436 0 0 0 0-.125.916.916 0 0 0-.031-.063v-.031a.749.749 0 0 0-.063-.063.749.749 0 0 0-.063-.063l-2.875-2.844a.498.498 0 0 0-.125-.156A.498.498 0 0 0 11.5 4H10V1.5a.5.5 0 0 0-.5-.5H7V.5a.5.5 0 0 0-.5-.5h-2a.492.492 0 0 0-.094 0c-.239.045.032-.003 0 0zM2 2h1v.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5V2h1v2H6.5a.64.64 0 0 0-.062 0 .493.493 0 0 0-.094.031.474.474 0 0 0-.125.063l-.031.031-.031.031a.916.916 0 0 0-.063.031.47.47 0 0 0-.031.094l-.031.031A.506.506 0 0 0 6 4.5V11H2V2zm5 3h4v2.5a.5.5 0 0 0 .5.5H14v6H7v-2.406a.492.492 0 0 0 0-.094V5zm5 .688L13.313 7H12V5.688zM4.406 0A.5.5 0 0 0 4 .5V1H1.5a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5V5h2.5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5H7V.5a.5.5 0 0 0-.5-.5h-2a.492.492 0 0 0-.094 0c-.239.045.032-.003 0 0zM2 2h1v.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5V2h1v2H6.5a.5.5 0 0 0-.5.5V11H2V2zm4.406 2A.5.5 0 0 0 6 4.5v10a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V7.594a.492.492 0 0 0 0-.094.331.331 0 0 0 0-.063v-.063a.916.916 0 0 0-.031-.063V7.28a.523.523 0 0 0-.094-.094l-.031-.031-2.875-2.844a.498.498 0 0 0-.125-.156A.503.503 0 0 0 11.5 4h-5a.492.492 0 0 0-.094 0c-.239.045.032-.003 0 0zM7 5h4v2.5a.5.5 0 0 0 .5.5H14v6H7V5zm5 .688L13.313 7H12V5.688zM8 12h5v1H8v-1zm0-2h5v1H8v-1zm0-2h5v1H8V8zm0-2h3v1H8V6z"/>',pastetext:'<path d="M4.406 0A.5.5 0 0 0 4 .5V1H1.5a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5H6v2.5a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V7.594a.492.492 0 0 0 0-.094.436.436 0 0 0 0-.125.916.916 0 0 0-.031-.063v-.031a.749.749 0 0 0-.063-.063.749.749 0 0 0-.063-.063l-2.875-2.844a.498.498 0 0 0-.125-.156A.498.498 0 0 0 11.5 4H10V1.5a.5.5 0 0 0-.5-.5H7V.5a.5.5 0 0 0-.5-.5h-2a.492.492 0 0 0-.094 0zM2 2h1v.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5V2h1v2H6.5a.64.64 0 0 0-.062 0 .493.493 0 0 0-.094.031.474.474 0 0 0-.125.063l-.031.031-.031.031a.916.916 0 0 0-.063.031.47.47 0 0 0-.031.094l-.031.031A.506.506 0 0 0 6 4.5V11H2V2zm5 3h4v2.5a.5.5 0 0 0 .5.5H14v6H7v-2.406a.492.492 0 0 0 0-.094V5zm5 .688L13.313 7H12V5.688zM4.406 0A.5.5 0 0 0 4 .5V1H1.5a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5V5h2.5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5H7V.5a.5.5 0 0 0-.5-.5h-2a.492.492 0 0 0-.094 0zM2 2h1v.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5V2h1v2H6.5a.5.5 0 0 0-.5.5V11H2V2zm4.406 2A.5.5 0 0 0 6 4.5v10a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V7.594a.492.492 0 0 0 0-.094.331.331 0 0 0 0-.063v-.062a.916.916 0 0 0-.031-.063v-.031a.523.523 0 0 0-.094-.094l-.031-.031-2.875-2.844a.498.498 0 0 0-.125-.156A.5.5 0 0 0 11.5 4h-5a.492.492 0 0 0-.094 0zM7 5h4v2.5a.5.5 0 0 0 .5.5H14v6H7V5zm5 .688L13.313 7H12V5.688z"/>',print:'<path d="M4 1v3H1v8h2V6h10v6h2V4h-3V1zm1 1h6v2H5zM4 7v8h8V7zm1 1h6v6H5zm1 1v1h4V9zm0 2v1h4v-1z"/><path d="M4 1v3H1v8h2V6h10v6h2V4h-3V1zm1 1h6v2H5zM4 7v8h8V7zm1 1h6v6H5zm1 1v1h4V9zm0 2v1h4v-1z"/>',quote:'<path d="M8 2.013c-1.998 0-3.818.382-5.188 1.125S.499 5.054.499 6.513c0 1.237.926 2.345 2.281 3.156s3.197 1.344 5.219 1.344c.344 0 .563.019.906 0l5.875 2.938c.377.18.854-.32.656-.688l-1.813-3.656c1.242-.79 1.875-2.014 1.875-3.094 0-1.46-.943-2.632-2.313-3.375S9.998 2.013 8 2.013z"/>',redo:'<path d="M9 7l5-5v5z"/><path d="M9.553 2.205c1 .268 1.932.796 2.69 1.553l.706.707-1.414 1.414-.707-.707a3.995 3.995 0 0 0-3.863-1.035 3.995 3.995 0 0 0-2.828 2.828 3.995 3.995 0 0 0 1.035 3.863l.707.707-1.414 1.414-.707-.707a6.003 6.003 0 0 1-1.553-5.795 6.003 6.003 0 0 1 7.348-4.242z"/>',removeformat:'<path d="M8.781 2l-.125.125L3.781 7l-.125.125-3 3-.313.313.25.344 3 4 .156.219h2.47l.125-.156 3-3 .313-.313 4.688-4.688.313-.313-.25-.344-3-4-.156-.188H8.781zm.407 1h.594l-4 4h-.594l4-4zm1.75.25l2.406 3.188-4.281 4.28-2.406-3.187 4.281-4.281z"/>',right:'<path d="M1 1h14v2H1zm4 4h10v2H5zM1 9h14v2H1zm4 4h10v2H5z"/>',rtl:'<path d="M5.344 2.001c-.98 0-1.783.284-2.375.813-.592.529-.875 1.227-.875 2.093 0 .811.244 1.467.75 1.969.506.497 1.227.792 2.156.906V14h2V3.001L8 3v11h1V2zM14 4l-4 4 4 4z"/>',size:'<path d="M12.5.656L10 4h5L12.5.656zM4.594 4.5a49.476 49.476 0 0 0-.875 1.906c-.277.65-.581 1.334-.875 2.063-.286.729-.572 1.52-.875 2.344S1.338 12.53 1 13.5h2.094c.095-.313.2-.64.313-.97.121-.328.262-.64.375-.968h3.5c.113.329.231.64.344.969.121.329.217.656.313.969h2.188c-.338-.971-.666-1.864-.969-2.688s-.611-1.615-.906-2.344a56.045 56.045 0 0 0-.844-2.063c-.286-.66-.581-1.282-.875-1.906H4.594zM10 6l2.5 3.313L15 6h-5zm-4.5.53c.052.13.132.307.219.532.086.225.2.486.313.78.121.296.245.614.375.97s.268.734.406 1.125H4.25c.139-.391.245-.77.375-1.125.139-.355.293-.674.406-.97s.194-.555.281-.78c.087-.224.145-.401.188-.531z"/>',source:'<path d="M4.937 3.939L1 8.499l3.937 4.564L6 12 3 8.499 6 5zm6.126 0L10 5.002l3 3.503-3 3.497 1.063 1.063L15 8.505z"/>',strike:'<text x="50%" y="50%" text-anchor="middle" dy=".5ex" font-family="Dejavu Sans, Helvetica, Arial, sans-serif" font-size="15" font-weight="bold">S</text><path d="M1 7v1h14V7H1z"/>',subscript:'<path d="M11 10v1h3v1h-3v3h4v-1h-3v-1h3v-3zM1 3l3 5-3 5h2l3-5H4l3 5h2L6 8l3-5H7L4 8h2L3 3z"/>',superscript:'<path d="M11 1v1h3v1h-3v3h4V5h-3V4h3V1zM1 3l3 5-3 5h2l3-5H4l3 5h2L6 8l3-5H7L4 8h2L3 3z"/>',table:'<path d="M1 2h14v2H1zm0 2v10h14V4H1zm1 1h3.5v2H2V5zm4.5 0h3v2h-3V5zm4 0H14v2h-3.5V5zM2 8h3.5v2H2V8zm4.5 0h3v2h-3V8zm4 0H14v2h-3.5V8zM2 11h3.5v2H2v-2zm4.5 0h3v2h-3v-2zm4 0H14v2h-3.5v-2z"/>',time:'<path d="M8 0C3 0 0 4 0 8s3 8 8 8 8-4 8-8-3-8-8-8zm0 2c3.461 0 6 2.539 6 6s-2.539 6-6 6c-3.46 0-6-2.539-6-6s2.54-6 6-6zM7 3v6l2.5 2L11 9.5 9 8V3z"/>',underline:'<text x="50%" y="50%" text-anchor="middle" dy=".5ex" font-family="Dejavu Sans, Helvetica, Arial, sans-serif" font-weight="bold" font-size="15" text-decoration="underline">U</text>',undo:'<path d="M2 7h5L2 2z"/><path d="M6.447 2.205c-1 .268-1.932.796-2.69 1.553l-.706.707 1.414 1.414.707-.707a3.995 3.995 0 0 1 3.863-1.035 3.995 3.995 0 0 1 2.828 2.828 3.995 3.995 0 0 1-1.035 3.863l-.707.707 1.414 1.414.707-.707a6.003 6.003 0 0 0 1.553-5.795 6.003 6.003 0 0 0-7.348-4.242z"/>',unlink:'<path d="M2 4c-.625 0-1.009.438-1.188.75s-.269.63-.344.969c-.15.677-.219 1.476-.219 2.28s.068 1.605.219 2.282c.075.339.165.625.344.938s.563.78 1.188.78h4v-2H2.469c-.022-.065-.042-.06-.063-.155-.1-.447-.156-1.15-.156-1.844s.057-1.396.156-1.844c.02-.088.042-.092.063-.156H6V4H2zm8 0v2h3.531c.021.064.043.068.063.156.1.448.156 1.149.156 1.844s-.057 1.396-.156 1.844c-.021.095-.041.09-.063.156H10v2h4c.625 0 1.009-.47 1.188-.781s.269-.6.344-.938c.15-.678.219-1.476.219-2.281s-.068-1.604-.219-2.281c-.075-.34-.165-.656-.344-.97S14.625 4 14 4h-4z"/>',youtube:'<path d="M2 2C1 2 0 3 0 4v8c0 1 1 2 2 2h12c1 0 2-1 2-2V4c0-1-1-2-2-2H2zm4 3l6 3-6 3V5z"/>'};a.icons.monocons=function(){var h,t={};return{create:function(v){return v in z&&(t[v]=a.dom.parseHTML('<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 16 16" unselectable="on">'+z[v]+"</svg>").firstChild,"color"===v&&(h=t[v].querySelector(".sce-color"))),t[v]},update:function(a,z){if(h){var t="inherit";!a&&z&&(t=z.ownerDocument.queryCommandValue("forecolor"),parseInt(t)===t&&(t="#"+("000000"+(t=(255&t)<<16|65280&t|(16711680&t)>>>16).toString(16)).slice(-6))),v.css(h,"fill",t)}},rtl:function(h){var a=t.grip;if(a){var z=h?"scaleX(-1)":"";v.css(a,"transform",z),v.css(a,"msTransform",z),v.css(a,"webkitTransform",z)}}}},a.icons.monocons.icons=z}(document,sceditor); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(e){"use strict";function t(e,t){return typeof t===e}function n(e){return!Object.keys(e).length}function o(e,t){for(var n=e===!!e,i=n?2:1,r=n?t:e,a=!!n&&e;i<arguments.length;i++){var c=arguments[i];for(var l in c){var s=c[l];if(!ce(s)){var u=null!==s&&"object"==typeof s,d=Array.isArray(s);r[l]=a&&(u||d)?o(!0,r[l]||(d?[]:{}),s):s}}}return r}function i(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}function r(e,t){if(Array.isArray(e)||"length"in e&&se(e.length))for(var n=0;n<e.length;n++)t(n,e[n]);else Object.keys(e).forEach(function(n){t(n,e[n])})}function a(e){return e=parseFloat(e),isFinite(e)?e:0}function c(e,t,n){var o=(n||document).createElement(e);return r(t||{},function(e,t){"style"===e?o.style.cssText=t:e in o?o[e]=t:o.setAttribute(e,t)}),o}function l(e,t){for(var n=[],o=e||{};(o=o.parentNode)&&!/(9|11)/.test(o.nodeType);)t&&!k(o,t)||n.push(o);return n}function s(e,t){for(var n=e||{};(n=n.parentNode)&&!/(9|11)/.test(n.nodeType);)if(!t||k(n,t))return n}function u(e,t){return k(e,t)?e:s(e,t)}function d(e){e.parentNode.removeChild(e)}function f(e,t){e.appendChild(t)}function p(e,t){return e.querySelectorAll(t)}function m(e,t,n,o,i){t.split(" ").forEach(function(t){var r;ae(n)?(r=o["_sce-event-"+t+n]||function(t){for(var i=t.target;i&&i!==e;){if(k(i,n))return void o.call(i,t);i=i.parentNode}},o["_sce-event-"+t+n]=r):(r=n,i=o),e.addEventListener(t,r,i||!1)})}function g(e,t,n,o,i){t.split(" ").forEach(function(t){var r;ae(n)?r=o["_sce-event-"+t+n]:(r=n,i=o),e.removeEventListener(t,r,i||!1)})}function h(e,t,n){if(arguments.length<3)return e.getAttribute(t);null==n?v(e,t):e.setAttribute(t,n)}function v(e,t){e.removeAttribute(t)}function y(e){w(e,"display","none")}function b(e){w(e,"display","")}function x(e){O(e)?y(e):b(e)}function w(e,t,n){if(arguments.length<3){if(ae(t))return getComputedStyle(e)[t];r(t,function(t,n){w(e,t,n)})}else{var o=(n||0===n)&&!isNaN(n);e.style[t]=o?n+"px":n}}function C(e,t,n){var o=arguments.length,i={};if(e.nodeType===de){if(1===o)return r(e.attributes,function(e,t){/^data\-/i.test(t.name)&&(i[t.name.substr(5)]=t.value)}),i;if(2===o)return h(e,"data-"+t);h(e,"data-"+t,String(n))}}function k(e,t){var n=!1;if(e&&e.nodeType===de){n=(e.matches||e.msMatchesSelector||e.webkitMatchesSelector).call(e,t)}return n}function E(e,t){return e!==t&&e.contains&&e.contains(t)}function S(e,t){var n=e.previousElementSibling;return t&&n?k(n,t)?n:null:n}function D(e,t){return t.parentNode.insertBefore(e,t)}function T(e){return e.className.trim().split(/\s+/)}function M(e,t){return k(e,"."+t)}function N(e,t){var n=T(e);n.indexOf(t)<0&&n.push(t),e.className=n.join(" ")}function R(e,t){var n=T(e);i(n,t),e.className=n.join(" ")}function F(e,t,n){(n=ce(n)?!M(e,t):n)?N(e,t):R(e,t)}function H(e,t){if(ce(t)){var n=getComputedStyle(e),o=a(n.paddingLeft)+a(n.paddingRight),i=a(n.borderLeftWidth)+a(n.borderRightWidth);return e.offsetWidth-o-i}w(e,"width",t)}function _(e,t){if(ce(t)){var n=getComputedStyle(e),o=a(n.paddingTop)+a(n.paddingBottom),i=a(n.borderTopWidth)+a(n.borderBottomWidth);return e.offsetHeight-o-i}w(e,"height",t)}function z(e,t,n){var o;le(window.CustomEvent)?o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(o=e.ownerDocument.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(o)}function O(e){return!!e.getClientRects().length}function B(e){return e.replace(/^-ms-/,"ms-").replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function A(e,t,n,o,i){for(e=i?e.lastChild:e.firstChild;e;){var r=i?e.previousSibling:e.nextSibling;if(!n&&!1===t(e)||!o&&!1===A(e,t,n,o,i)||n&&!1===t(e))return!1;e=r}}function I(e,t,n,o){A(e,t,n,o,!0)}function L(e,t){var n=(t=t||document).createDocumentFragment(),o=c("div",{},t);for(o.innerHTML=e;o.firstChild;)f(n,o.firstChild);return n}function P(e){return e&&(!k(e,"p,div")||e.className||h(e,"style")||!n(C(e)))}function V(e,t){var n=c(t,{},e.ownerDocument);for(r(e.attributes,function(e,t){try{h(n,t.name,t.value)}catch(e){}});e.firstChild;)f(n,e.firstChild);return e.parentNode.replaceChild(n,e),n}function W(e){return!!/11?|9/.test(e.nodeType)&&"|iframe|area|base|basefont|br|col|frame|hr|img|input|wbr|isindex|link|meta|param|command|embed|keygen|source|track|object|".indexOf("|"+e.nodeName.toLowerCase()+"|")<0}function j(e,t){var n,o=(e||{}).nodeType||fe;return o!==de?o===fe:"code"===(n=e.tagName.toLowerCase())?!t:me.indexOf("|"+n+"|")<0}function q(e,t){t.style.cssText=e.style.cssText+t.style.cssText}function U(e){var t=function(e){for(;j(e.parentNode,!0);)e=e.parentNode;return e};A(e,function(e){var n=!j(e,!0);if(n&&j(e.parentNode,!0)){var o=t(e),i=K(o,e),r=e;q(o,r),D(i,o),D(r,o)}if(n&&k(e,"ul,ol")&&k(e.parentNode,"ul,ol")){var a=S(e,"li");a||D(a=c("li"),e),f(a,e)}})}function $(e,t){return e?(t?e.previousSibling:e.nextSibling)||$(e.parentNode,t):null}function Y(e){var t,n,o,i,r,a,c,l=w(e,"whiteSpace"),s=/line$/i.test(l),u=e.firstChild;if(!/pre(\-wrap)?$/i.test(l))for(;u;){if(a=u.nextSibling,t=u.nodeValue,(n=u.nodeType)===de&&u.firstChild&&Y(u),n===fe){for(o=$(u),i=$(u,!0),c=!1;M(i,"sceditor-ignore");)i=$(i,!0);if(j(u)&&i){for(r=i;r.lastChild;)r=r.lastChild;c=r.nodeType===fe?/[\t\n\r ]$/.test(r.nodeValue):!j(r)}t=t.replace(/\u200B/g,""),i&&j(i)&&!c||(t=t.replace(s?/^[\t ]+/:/^[\t\n\r ]+/,"")),o&&j(o)||(t=t.replace(s?/[\t ]+$/:/[\t\n\r ]+$/,"")),t.length?u.nodeValue=t.replace(s?/[\t ]+/g:/[\t\n\r ]+/g," "):d(u)}u=a}}function K(e,t){var n=e.ownerDocument.createRange();return n.setStartBefore(e),n.setEndAfter(t),n.extractContents()}function X(e){for(var t=0,n=0;e;)t+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:t,top:n}}function Q(e,t){var n,o,i=e.style;if(ue[t]||(ue[t]=B(t)),t=ue[t],o=i[t],"textAlign"===t){if(n=i.direction,o=o||w(e,t),w(e.parentNode,t)===o||"block"!==w(e,"display")||k(e,"hr,th"))return"";if(/right/i.test(o)&&"rtl"===n||/left/i.test(o)&&"ltr"===n)return""}return o}function G(e){return e.replace(/([\-.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function J(e,t){if(!e)return e;var n={"&":"&","<":"<",">":">"," ":" ","\r\n":"<br />","\r":"<br />","\n":"<br />"};return!1!==t&&(n['"']=""",n["'"]="'",n["`"]="`"),e=e.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(e){return n[e]||e})}function Z(e){if("mozHidden"in document)for(var t,n=e.getBody();n;){if((t=n).firstChild)t=t.firstChild;else{for(;t&&!t.nextSibling;)t=t.parentNode;t&&(t=t.nextSibling)}3===n.nodeType&&/[\n\r\t]+/.test(n.nodeValue)&&(/^pre/.test(w(n.parentNode,"whiteSpace"))||d(n)),n=t}}function ee(e){var t=this,n=[],o=function(e){return"signal"+e.charAt(0).toUpperCase()+e.slice(1)},i=function(t,i){t=[].slice.call(t);var r,a,c=o(t.shift());for(r=0;r<n.length;r++)if(c in n[r]&&(a=n[r][c].apply(e,t),i))return a};t.call=function(){i(arguments,!1)},t.callOnlyFirst=function(){return i(arguments,!0)},t.hasHandler=function(e){var t=n.length;for(e=o(e);t--;)if(e in n[t])return!0;return!1},t.exists=function(e){return e in De&&("function"==typeof(e=De[e])&&"object"==typeof e.prototype)},t.isRegistered=function(e){if(t.exists(e))for(var o=n.length;o--;)if(n[o]instanceof De[e])return!0;return!1},t.register=function(o){return!(!t.exists(o)||t.isRegistered(o))&&(o=new De[o],n.push(o),"init"in o&&o.init.call(e),!0)},t.deregister=function(o){var i,r=n.length,a=!1;if(!t.isRegistered(o))return a;for(;r--;)n[r]instanceof De[o]&&(a=!0,"destroy"in(i=n.splice(r,1)[0])&&i.destroy.call(e));return a},t.destroy=function(){for(var t=n.length;t--;)"destroy"in n[t]&&n[t].destroy.call(e);n=[],e=null}}function te(e,t){var n,o,i=t||e.contentDocument||e.document,r="sceditor-start-marker",a="sceditor-end-marker",l=this;l.insertHTML=function(e,t){var n,o;if(!l.selectedRange())return!1;for(t&&(e+=l.selectedHtml()+t),o=c("p",{},i),n=i.createDocumentFragment(),o.innerHTML=e;o.firstChild;)f(n,o.firstChild);l.insertNode(n)},o=function(e,t,o){var s,u=i.createDocumentFragment();if("string"==typeof e?(t&&(e+=l.selectedHtml()+t),u=L(e)):(f(u,e),t&&(f(u,l.selectedRange().extractContents()),f(u,t))),s=u.lastChild){for(;!j(s.lastChild,!0);)s=s.lastChild;if(W(s)?s.lastChild||f(s,document.createTextNode("")):s=u,l.removeMarkers(),f(s,n(r)),f(s,n(a)),o){var d=c("div");return f(d,u),d.innerHTML}return u}},l.insertNode=function(e,t){var n=o(e,t),i=l.selectedRange(),r=i.commonAncestorContainer;if(!n)return!1;i.deleteContents(),r&&3!==r.nodeType&&!W(r)?D(n,r):i.insertNode(n),l.restoreRange()},l.cloneSelected=function(){var e=l.selectedRange();if(e)return e.cloneRange()},l.selectedRange=function(){var t,n,o=e.getSelection();if(o){if(o.getRangeAt&&o.rangeCount<=0){for(n=i.body;n.firstChild;)n=n.firstChild;(t=i.createRange()).setStartBefore(n),o.addRange(t)}return o.rangeCount>0&&(t=o.getRangeAt(0)),t}},l.hasSelection=function(){var t=e.getSelection();return t&&t.rangeCount>0},l.selectedHtml=function(){var e,t=l.selectedRange();return t?(e=c("p",{},i),f(e,t.cloneContents()),e.innerHTML):""},l.parentNode=function(){var e=l.selectedRange();if(e)return e.commonAncestorContainer},l.getFirstBlockParent=function(e){var t=function(e){return j(e,!0)&&(e=e?e.parentNode:null)?t(e):e};return t(e||l.parentNode())},l.insertNodeAt=function(e,t){var n=l.selectedRange(),o=l.cloneSelected();if(!o)return!1;o.collapse(e),o.insertNode(t),l.selectRange(n)},n=function(e){l.removeMarker(e);var t=c("span",{id:e,className:"sceditor-selection sceditor-ignore",style:"display:none;line-height:0"},i);return t.innerHTML=" ",t},l.insertMarkers=function(){var e=l.selectedRange(),t=n(r);l.removeMarkers(),l.insertNodeAt(!0,t),e&&e.collapsed?t.parentNode.insertBefore(n(a),t.nextSibling):l.insertNodeAt(!1,n(a))},l.getMarker=function(e){return i.getElementById(e)},l.removeMarker=function(e){var t=l.getMarker(e);t&&d(t)},l.removeMarkers=function(){l.removeMarker(r),l.removeMarker(a)},l.saveRange=function(){l.insertMarkers()},l.selectRange=function(t){var n,o=e.getSelection(),r=t.endContainer;if(!Te&&t.collapsed&&r&&!j(r,!0)){for(n=r.lastChild;n&&k(n,".sceditor-ignore");)n=n.previousSibling;if(k(n,"br")){var a=i.createRange();a.setEndAfter(n),a.collapse(!1),l.compare(t,a)&&(t.setStartBefore(n),t.collapse(!0))}}o&&(l.clear(),o.addRange(t))},l.restoreRange=function(){var e,t=l.selectedRange(),n=l.getMarker(r),o=l.getMarker(a);if(!n||!o||!t)return!1;e=n.nextSibling===o,(t=i.createRange()).setStartBefore(n),t.setEndAfter(o),e&&t.collapse(!0),l.selectRange(t),l.removeMarkers()},l.selectOuterText=function(e,t){var n,o,i=l.cloneSelected();if(!i)return!1;i.collapse(!1),n=Me(i,!0,e),o=Me(i,!1,t),i.setStart(n.node,n.offset),i.setEnd(o.node,o.offset),l.selectRange(i)},l.getOuterText=function(e,t){var n=l.cloneSelected();return n?(n.collapse(!e),Me(n,e,t).text):""},l.replaceKeyword=function(e,t,n,o,i,r){n||e.sort(function(e,t){return e[0].length-t[0].length});var a,c,s,u,d,f,p,m,g=e.length,h=i?1:0,v=o||e[g-1][0].length;for(i&&v++,r=r||"",d=(a=l.getOuterText(!0,v)).length,a+=r,t&&(a+=l.getOuterText(!1,v));g--;)if(p=e[g][0],m=p.length,u=Math.max(0,d-m-h),s=-1,i?(c=a.substr(u).match(new RegExp("(^|[\\s ])"+G(p)+"(^|[\\s ])")))&&(s=c.index+u+c[1].length):s=a.indexOf(p,u),s>-1&&s<=d&&s+m+h>=d)return f=d-s,l.selectOuterText(f,m-f-(/^\S/.test(r)?1:0)),l.insertHTML(e[g][1]),!0;return!1},l.compare=function(e,t){return t||(t=l.selectedRange()),e&&t?0===e.compareBoundaryPoints(Range.END_TO_END,t)&&0===e.compareBoundaryPoints(Range.START_TO_START,t):!e&&!t},l.clear=function(){var t=e.getSelection();t&&(t.removeAllRanges?t.removeAllRanges():t.empty&&t.empty())}}function ne(e,t){var n=/[^\s\xA0\u2002\u2003\u2009\u00a0]+/,o=e&&p(e,"img[data-sceditor-emoticon]");if(e&&o.length)for(var i=0;i<o.length;i++){var r=o[i],a=r.parentNode,c=r.previousSibling,l=r.nextSibling;if(c&&n.test(c.nodeValue.slice(-1))||l&&n.test((l.nodeValue||"")[0])){var s=t.cloneSelected(),u=-1,f=s.startContainer,m=c.nodeValue;null===m&&(m=c.innerText||""),m+=C(r,"sceditor-emoticon"),f===l&&(u=m.length+s.startOffset),f===e&&e.childNodes[s.startOffset]===l&&(u=m.length),f===c&&(u=s.startOffset),l&&l.nodeType===fe||(l=a.insertBefore(a.ownerDocument.createTextNode(""),l)),l.insertData(0,m),d(c),d(r),u>-1&&(s.setStart(l,u),s.collapse(!0),t.selectRange(s))}}}function oe(e,t,n){var o=e.ownerDocument,i="(^|\\s| | | | |$)",a=[],c={};s(e,"code")||(r(t,function(e){c[e]=new RegExp(i+G(e)+i),a.push(e)}),a.sort(function(e,t){return t.length-e.length}),function e(i){for(i=i.firstChild;i;){if(i.nodeType!==de||k(i,"code")||e(i),i.nodeType===fe)for(var r=0;r<a.length;r++){var l=i.nodeValue,s=a[r],u=n?l.search(c[s]):l.indexOf(s);if(u>-1){var d=l.indexOf(s,u),f=L(t[s],o),p=l.substr(d+s.length);f.appendChild(o.createTextNode(p)),i.nodeValue=l.substr(0,d),i.parentNode.insertBefore(f,i.nextSibling)}}i=i.nextSibling}}(e))}function ie(e,t){var n;A(e,function(e){j(e,!0)?(n||D(n=c("p",{},t),e),e.nodeType===fe&&""===e.nodeValue||f(n,e)):n=null},!1,!0)}function re(e,t){var n,a,l,s,v,E,S,T,B,A,L,q,$,K,Q,G,Z,se,ue,me,he,ve,we,Ce,Ee,De,Te,Me,ze,Oe,Be,Ae,Ie,Le,Pe,Ve,We,je,qe,Ue,$e,Ye,Ke,Xe,Qe,Ge,Je,Ze,et,tt,nt,ot,it,rt,at,ct,lt,st,ut,dt,ft,pt,mt=this,gt=e.get?e.get(0):e,ht={},vt=[],yt=[],bt={},xt={},wt={};mt.commands=o(!0,{},t.commands||Se);var Ct=mt.opts=o(!0,{},ge,t);mt.opts.emoticons=t.emoticons||ge.emoticons,De=function(){gt._sceditor=mt,Ct.locale&&"en"!==Ct.locale&&Ae(),D(a=c("div",{className:"sceditor-container"}),gt),w(a,"z-index",Ct.zIndex),Fe&&N(a,"ie ie"+Fe),ue=gt.required,gt.required=!1;var e=re.formats[Ct.format];"init"in(n=e?new e:{})&&n.init.call(mt),Be(),We(),Ie(),Oe(),Le(),Pe(),xe||mt.toggleSourceMode(),et();var t=function(){g(Ne,"load",t),Ct.autofocus&&rt(),pt(),nt(),K.call("ready"),"onReady"in n&&n.onReady.call(mt)};m(Ne,"load",t),"complete"===Re.readyState&&t()},Be=function(){var e=Ct.plugins;e=e?e.toString().split(","):[],K=new ee(mt),e.forEach(function(e){K.register(e.trim())})},Ae=function(){var e;(q=re.locale[Ct.locale])||(e=Ct.locale.split("-"),q=re.locale[e[0]]),q&&q.dateFormat&&(Ct.dateFormat=q.dateFormat)},Oe=function(){S=c("textarea"),s=c("iframe",{frameborder:0,allowfullscreen:!0}),Ct.startInSourceMode?(N(a,"sourceMode"),y(s)):(N(a,"wysiwygMode"),y(S)),Ct.spellcheck||h(a,"spellcheck","false"),"https:"===Ne.location.protocol&&h(s,"src","javascript:false"),f(a,s),f(a,S),mt.dimensions(Ct.width||H(gt),Ct.height||_(gt));var e=Fe?"ie ie"+Fe:"";e+=be?" ios":"",(E=s.contentDocument).open(),E.write(ke("html",{attrs:' class="'+e+'"',spellcheck:Ct.spellcheck?"":'spellcheck="false"',charset:Ct.charset,style:Ct.style})),E.close(),v=E.body,mt.readOnly(!!Ct.readOnly),(be||ye||Fe)&&(_(v,"100%"),Fe||m(v,"touchend",mt.focus));var t=h(gt,"tabindex");h(S,"tabindex",t),h(s,"tabindex",t),$=new te(s.contentWindow),y(gt),mt.val(gt.value);var n=Ct.placeholder||h(gt,"placeholder");n&&(S.placeholder=n,h(v,"placeholder",n))},Le=function(){Ct.autoUpdate&&(m(v,"blur",ft),m(S,"blur",ft)),null===Ct.rtl&&(Ct.rtl="rtl"===w(S,"direction")),mt.rtl(!!Ct.rtl),Ct.autoExpand&&(m(v,"load",pt,pe),m(E,"input keyup",pt)),Ct.resizeEnabled&&Ve(),h(a,"id",Ct.id),mt.emoticons(Ct.emoticonsEnabled)},Pe=function(){var e=gt.form,t="onselectionchange"in E?"selectionchange":"keyup focus blur contextmenu mouseup touchend click";m(Re,"click",Je),e&&(m(e,"reset",Ke),m(e,"submit",mt.updateOriginal,pe)),m(v,"keypress",Ye),m(v,"keydown",Ue),m(v,"keydown",$e),m(v,"keyup",nt),m(v,"blur",ut),m(v,"keyup",dt),m(v,"paste",je),m(v,"compositionstart compositionend",Qe),m(v,t,ot),m(v,"keydown keyup keypress focus blur contextmenu",Ge),Ct.emoticonsCompat&&Ne.getSelection&&m(v,"keyup",ct),m(v,"blur",function(){mt.val()||N(v,"placeholder")}),m(v,"focus",function(){R(v,"placeholder")}),m(S,"blur",ut),m(S,"keyup",dt),m(S,"keydown",Ue),m(S,"compositionstart compositionend",Qe),m(S,"keydown keyup keypress focus blur contextmenu",Ge),m(E,"mousedown",Xe),m(E,t,ot),m(E,"beforedeactivate keyup mouseup",ze),m(E,"keyup",nt),m(E,"focus",function(){B=null}),m(a,"selectionchanged",it),m(a,"selectionchanged",et),m(a,"selectionchanged valuechanged nodechanged",Ge)},Ie=function(){var e,t=mt.commands,n=(Ct.toolbarExclude||"").split(","),o=Ct.toolbar.split("|");l=c("div",{className:"sceditor-toolbar",unselectable:"on"}),Ct.icons in re.icons&&(Ee=new re.icons[Ct.icons]),r(o,function(o,i){e=c("div",{className:"sceditor-group"}),r(i.split(","),function(o,i){var r,a,c=t[i];!c||n.indexOf(i)>-1||(a=c.shortcut,r=ke("toolbarButton",{name:i,dispName:mt._(c.name||c.tooltip||i)},!0).firstChild,Ee&&Ee.create&&Ee.create(i)&&(D(Ee.create(i),r.firstChild),N(r,"has-icon")),r._sceTxtMode=!!c.txtExec,r._sceWysiwygMode=!!c.exec,F(r,"disabled",!c.exec),m(r,"click",function(e){M(r,"disabled")||Me(r,c),et(),e.preventDefault()}),m(r,"mousedown",function(e){mt.closeDropDown(),e.preventDefault()}),c.tooltip&&h(r,"title",mt._(c.tooltip)+(a?" ("+a+")":"")),a&&mt.addShortcut(a,i),c.state?yt.push({name:i,state:c.state}):ae(c.exec)&&yt.push({name:i,state:c.exec}),f(e,r),xt[i]=r)}),e.firstChild&&f(l,e)}),f(Ct.toolbarContainer||a,l)},Ve=function(){var e,t,n,o,i,r,l=c("div",{className:"sceditor-grip"}),s=c("div",{className:"sceditor-resize-cover"}),u="touchcancel touchend mouseup",d=0,p=0,h=0,v=0,x=0,w=0,C=H(a),k=_(a),E=!1,S=mt.rtl();if(e=Ct.resizeMinHeight||k/1.5,t=Ct.resizeMaxHeight||2.5*k,n=Ct.resizeMinWidth||C/1.25,o=Ct.resizeMaxWidth||1.25*C,i=function(i){"touchmove"===i.type?(i=Ne.event,h=i.changedTouches[0].pageX,v=i.changedTouches[0].pageY):(h=i.pageX,v=i.pageY);var r=w+(v-p),a=S?x-(h-d):x+(h-d);o>0&&a>o&&(a=o),n>0&&a<n&&(a=n),Ct.resizeWidth||(a=!1),t>0&&r>t&&(r=t),e>0&&r<e&&(r=e),Ct.resizeHeight||(r=!1),(a||r)&&mt.dimensions(a,r),i.preventDefault()},r=function(e){E&&(E=!1,y(s),R(a,"resizing"),g(Re,"touchmove mousemove",i),g(Re,u,r),e.preventDefault())},Ee&&Ee.create){var D=Ee.create("grip");D&&(f(l,D),N(l,"has-icon"))}f(a,l),f(a,s),y(s),m(l,"touchstart mousedown",function(e){"touchstart"===e.type?(e=Ne.event,d=e.touches[0].pageX,p=e.touches[0].pageY):(d=e.pageX,p=e.pageY),x=H(a),w=_(a),E=!0,N(a,"resizing"),b(s),m(Re,"touchmove mousemove",i),m(Re,u,r),e.preventDefault()})},We=function(){var e=Ct.emoticons,t=Ct.emoticonsRoot||"";e&&(wt=o({},e.more,e.dropdown,e.hidden)),r(wt,function(e,n){wt[e]=ke("emoticon",{key:e,url:t+(n.url||n),tooltip:n.tooltip||e}),Ct.emoticonsEnabled&&vt.push(c("img",{src:t+(n.url||n)}))})},rt=function(){var e,t,n=v.firstChild,o=!!Ct.autofocusEnd;if(O(a)){if(mt.sourceMode())return t=o?S.value.length:0,void S.setSelectionRange(t,t);if(Y(v),o)for((n=v.lastChild)||(n=c("p",{},E),f(v,n));n.lastChild;)n=n.lastChild,!He&&k(n,"br")&&n.previousSibling&&(n=n.previousSibling);e=E.createRange(),W(n)?e.selectNodeContents(n):(e.setStartBefore(n),o&&e.setStartAfter(n)),e.collapse(!o),$.selectRange(e),Z=e,o&&(v.scrollTop=v.scrollHeight),mt.focus()}},mt.readOnly=function(e){return"boolean"!=typeof e?!S.readonly:(v.contentEditable=!e,S.readonly=!e,Ze(e),mt)},mt.rtl=function(e){var t=e?"rtl":"ltr";return"boolean"!=typeof e?"rtl"===h(S,"dir"):(h(v,"dir",t),h(S,"dir",t),R(a,"rtl"),R(a,"ltr"),N(a,t),Ee&&Ee.rtl&&Ee.rtl(e),mt)},Ze=function(e){var t=mt.inSourceMode()?"_sceTxtMode":"_sceWysiwygMode";r(xt,function(n,o){F(o,"disabled",e||!o[t])})},mt.width=function(e,t){return e||0===e?(mt.dimensions(e,null,t),mt):H(a)},mt.dimensions=function(e,t,n){return e=!(!e&&0!==e)&&e,t=!(!t&&0!==t)&&t,!1===e&&!1===t?{width:mt.width(),height:mt.height()}:(!1!==e&&(!1!==n&&(Ct.width=e),H(a,e)),!1!==t&&(!1!==n&&(Ct.height=t),_(a,t)),mt)},mt.height=function(e,t){return e||0===e?(mt.dimensions(null,e,t),mt):_(a)},mt.maximize=function(e){return ce(e)?M(a,"sceditor-maximize"):((e=!!e)&&(we=Ne.pageYOffset),F(Re.documentElement,"sceditor-maximize",e),F(Re.body,"sceditor-maximize",e),F(a,"sceditor-maximize",e),mt.width(e?"100%":Ct.width,!1),mt.height(e?"100%":Ct.height,!1),e||Ne.scrollTo(0,we),pt(),mt)},pt=function(){Ct.autoExpand&&!ve&&setTimeout(mt.expandToContent,200)},mt.expandToContent=function(e){if(!mt.maximize()){if(ve=!1,!he){var t=Ct.resizeMinHeight||Ct.height||_(gt);he={min:t,max:Ct.resizeMaxHeight||2*t}}var n=Re.createRange();n.selectNodeContents(v);var o=n.getBoundingClientRect(),i=E.documentElement.clientHeight,r=o.bottom-o.top,a=mt.height()+(r-i);e||-1===he.max||(a=Math.min(a,he.max)),mt.height(Math.ceil(Math.max(a,he.min)))}},mt.destroy=function(){if(K){K.destroy(),$=null,B=null,K=null,T&&d(T),g(Re,"click",Je);var e=gt.form;e&&(g(e,"reset",Ke),g(e,"submit",mt.updateOriginal)),d(S),d(l),d(a),delete gt._sceditor,b(gt),gt.required=ue}},mt.createDropDown=function(e,t,n,i){var a,l="sceditor-"+t;mt.closeDropDown(!0),T&&M(T,l)||(!1!==i&&r(p(n,":not(input):not(textarea)"),function(e,t){t.nodeType===de&&h(t,"unselectable","on")}),a=o({top:X(e).top,left:X(e).left,marginTop:e.clientHeight},Ct.dropDownCss),w(T=c("div",{className:"sceditor-dropdown "+l}),a),f(T,n),f(Re.body,T),m(T,"click focusin",function(e){e.stopPropagation()}),setTimeout(function(){if(T){var e=p(T,"input,textarea")[0];e&&e.focus()}}))},Je=function(e){3!==e.which&&T&&!e.defaultPrevented&&(ft(),mt.closeDropDown())},je=function(e){var t=Fe||ye,n=v,o=e.clipboardData;if(o&&!t){var i={},r=o.types,a=o.items;e.preventDefault();for(var c=0;c<r.length;c++){if(Ne.FileReader&&a&&_e.test(a[c].type))return function(e){var t=new FileReader;t.onload=function(e){qe({html:'<img src="'+e.target.result+'" />'})},t.readAsDataURL(e)}(o.items[c].getAsFile());i[r[c]]=o.getData(r[c])}i.text=i["text/plain"],i.html=i["text/html"],qe(i)}else if(!Ce){var l=n.scrollTop;for($.saveRange(),Ce=Re.createDocumentFragment();n.firstChild;)f(Ce,n.firstChild);setTimeout(function(){var e=n.innerHTML;n.innerHTML="",f(n,Ce),n.scrollTop=l,Ce=!1,$.restoreRange(),qe({html:e})},0)}},qe=function(e){var t=c("div",{},E);K.call("pasteRaw",e),e.html?(t.innerHTML=e.html,U(t)):t.innerHTML=J(e.text||"");var o={val:t.innerHTML};"fragmentToSource"in n&&(o.val=n.fragmentToSource(o.val,E,Q)),K.call("paste",o),"fragmentToHtml"in n&&(o.val=n.fragmentToHtml(o.val,Q)),K.call("pasteHtml",o),mt.wysiwygEditorInsertHtml(o.val,null,!0)},mt.closeDropDown=function(e){T&&(d(T),T=null),!0===e&&mt.focus()},mt.wysiwygEditorInsertHtml=function(e,t,n){var o,i,r,a=_(s);mt.focus(),!n&&u(G,"code")||($.insertHTML(e,t),$.saveRange(),Te(),b(o=p(v,"#sceditor-end-marker")[0]),i=v.scrollTop,r=X(o).top+1.5*o.offsetHeight-a,y(o),(r>i||r+a<i)&&(v.scrollTop=r),st(!1),$.restoreRange(),nt())},mt.wysiwygEditorInsertText=function(e,t){mt.wysiwygEditorInsertHtml(J(e),J(t))},mt.insertText=function(e,t){return mt.inSourceMode()?mt.sourceEditorInsertText(e,t):mt.wysiwygEditorInsertText(e,t),mt},mt.sourceEditorInsertText=function(e,t){var n,o,i=S.selectionStart,r=S.selectionEnd;n=S.scrollTop,S.focus(),o=S.value,t&&(e+=o.substring(i,r)+t),S.value=o.substring(0,i)+e+o.substring(r,o.length),S.selectionStart=i+e.length-(t?t.length:0),S.selectionEnd=S.selectionStart,S.scrollTop=n,S.focus(),st()},mt.getRangeHelper=function(){return $},mt.sourceEditorCaret=function(e){return S.focus(),e?(S.selectionStart=e.start,S.selectionEnd=e.end,this):{start:S.selectionStart,end:S.selectionEnd}},mt.val=function(e,t){return ae(e)?(mt.inSourceMode()?mt.setSourceEditorValue(e):(!1!==t&&"toHtml"in n&&(e=n.toHtml(e)),mt.setWysiwygEditorValue(e)),mt):mt.inSourceMode()?mt.getSourceEditorValue(!1):mt.getWysiwygEditorValue(t)},mt.insert=function(e,t,o,i,r){if(mt.inSourceMode())return mt.sourceEditorInsertText(e,t),mt;if(t){var a=$.selectedHtml();!1!==o&&"fragmentToSource"in n&&(a=n.fragmentToSource(a,E,Q)),e+=a+t}return!1!==o&&"fragmentToHtml"in n&&(e=n.fragmentToHtml(e,Q)),!1!==o&&!0===r&&(e=e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")),mt.wysiwygEditorInsertHtml(e),mt},mt.getWysiwygEditorValue=function(e){for(var t,o=c("div",{},E),i=v.childNodes,r=0;r<i.length;r++)f(o,i[r].cloneNode(!0));return f(v,o),U(o),d(o),t=o.innerHTML,!1!==e&&n.hasOwnProperty("toSource")&&(t=n.toSource(t,E)),t},mt.getBody=function(){return v},mt.getContentAreaContainer=function(){return s},mt.getSourceEditorValue=function(e){var t=S.value;return!1!==e&&"toHtml"in n&&(t=n.toHtml(t)),t},mt.setWysiwygEditorValue=function(e){e||(e="<p>"+(Fe?"":"<br />")+"</p>"),v.innerHTML=e,Te(),nt(),st(),pt()},mt.setSourceEditorValue=function(e){S.value=e,st()},mt.updateOriginal=function(){gt.value=mt.val()},Te=function(){Ct.emoticonsEnabled&&oe(v,wt,Ct.emoticonsCompat)},mt.inSourceMode=function(){return M(a,"sourceMode")},mt.sourceMode=function(e){var t=mt.inSourceMode();return"boolean"!=typeof e?t:((t&&!e||!t&&e)&&mt.toggleSourceMode(),mt)},mt.toggleSourceMode=function(){var e=mt.inSourceMode();!xe&&e||(e||($.saveRange(),$.clear()),mt.blur(),e?mt.setWysiwygEditorValue(mt.getSourceEditorValue()):mt.setSourceEditorValue(mt.getWysiwygEditorValue()),B=null,x(S),x(s),F(a,"wysiwygMode",e),F(a,"sourceMode",!e),Ze(),et())},tt=function(){return S.focus(),S.value.substring(S.selectionStart,S.selectionEnd)},Me=function(e,t){mt.inSourceMode()?t.txtExec&&(Array.isArray(t.txtExec)?mt.sourceEditorInsertText.apply(mt,t.txtExec):t.txtExec.call(mt,e,tt())):t.exec&&(le(t.exec)?t.exec.call(mt,e):mt.execCommand(t.exec,t.hasOwnProperty("execParam")?t.execParam:null))},ze=function(){Fe&&(B=$.selectedRange())},mt.execCommand=function(e,t){var n=!1,o=mt.commands[e];if(mt.focus(),!u($.parentNode(),"code")){try{n=E.execCommand(e,!1,t)}catch(e){}!n&&o&&o.errorMessage&&alert(mt._(o.errorMessage)),et()}},ot=function(){function e(){if($&&!$.compare(Z)){if((Z=$.cloneSelected())&&Z.collapsed){var e=Z.startContainer,t=Z.startOffset;for(t&&e.nodeType!==fe&&(e=e.childNodes[t]);e&&e.parentNode!==v;)e=e.parentNode;e&&j(e,!0)&&($.saveRange(),ie(v,E),$.restoreRange())}z(a,"selectionchanged")}se=!1}se||(se=!0,"onselectionchange"in E?e():setTimeout(e,100))},it=function(){var e,t=$.parentNode();Q!==t&&(e=Q,Q=t,G=$.getFirstBlockParent(t),z(a,"nodechanged",{oldNode:e,newNode:Q}))},mt.currentNode=function(){return Q},mt.currentBlockNode=function(){return G},et=function(){var e,t,n=E,o=mt.sourceMode();if(mt.readOnly())r(p(l,"active"),function(e,t){R(t,"active")});else{o||(t=$.parentNode(),e=$.getFirstBlockParent(t));for(var i=0;i<yt.length;i++){var a=0,c=xt[yt[i].name],s=yt[i].state,u=o&&!c._sceTxtMode||!o&&!c._sceWysiwygMode;if(ae(s)){if(!o)try{(a=n.queryCommandEnabled(s)?0:-1)>-1&&(a=n.queryCommandState(s)?1:0)}catch(e){}}else u||(a=s.call(mt,t,e));F(c,"disabled",u||a<0),F(c,"active",a>0)}Ee&&Ee.update&&Ee.update(o,t,e)}},Ye=function(e){if(!e.defaultPrevented&&(mt.closeDropDown(),13===e.which)){if(!k(G,"li,ul,ol")&&P(G)){B=null;var t=c("br",{},E);if($.insertNode(t),!He){var n=t.parentNode,o=n.lastChild;o&&o.nodeType===fe&&""===o.nodeValue&&(d(o),o=n.lastChild),!j(n,!0)&&o===t&&j(t.previousSibling)&&$.insertHTML("<br>")}e.preventDefault()}}},nt=function(){I(v,function(e){if(e.nodeType===de&&!/inline/.test(w(e,"display"))&&!k(e,".sceditor-nlf")&&P(e)){var t=c("p",{},E);return t.className="sceditor-nlf",t.innerHTML=He?"":"<br />",f(v,t),!1}if(3===e.nodeType&&!/^\s*$/.test(e.nodeValue)||k(e,"br"))return!1})},Ke=function(){mt.val(gt.value)},Xe=function(){mt.closeDropDown(),B=null},mt._=function(){var e=arguments;return q&&q[e[0]]&&(e[0]=q[e[0]]),e[0].replace(/\{(\d+)\}/g,function(t,n){return void 0!==e[n-0+1]?e[n-0+1]:"{"+n+"}"})},Ge=function(e){K&&K.call(e.type+"Event",e,mt);var t=(e.target===S?"scesrc":"scewys")+e.type;ht[t]&&ht[t].forEach(function(t){t.call(mt,e)})},mt.bind=function(e,t,n,o){for(var i=(e=e.split(" ")).length;i--;)if(le(t)){var r="scewys"+e[i],a="scesrc"+e[i];n||(ht[r]=ht[r]||[],ht[r].push(t)),o||(ht[a]=ht[a]||[],ht[a].push(t)),"valuechanged"===e[i]&&(st.hasHandler=!0)}return mt},mt.unbind=function(e,t,n,o){for(var r=(e=e.split(" ")).length;r--;)le(t)&&(n||i(ht["scewys"+e[r]]||[],t),o||i(ht["scesrc"+e[r]]||[],t));return mt},mt.blur=function(e,t,n){return le(e)?mt.bind("blur",e,t,n):mt.sourceMode()?S.blur():v.blur(),mt},mt.focus=function(e,t,n){if(le(e))mt.bind("focus",e,t,n);else if(mt.inSourceMode())S.focus();else{if(p(E,":focus").length)return;var o,i=$.selectedRange();Z||rt(),!He&&i&&1===i.endOffset&&i.collapsed&&(o=i.endContainer)&&1===o.childNodes.length&&k(o.firstChild,"br")&&(i.setStartBefore(o.firstChild),i.collapse(!0),$.selectRange(i)),s.contentWindow.focus(),v.focus(),B&&($.selectRange(B),B=null)}return et(),mt},mt.keyDown=function(e,t,n){return mt.bind("keydown",e,t,n)},mt.keyPress=function(e,t,n){return mt.bind("keypress",e,t,n)},mt.keyUp=function(e,t,n){return mt.bind("keyup",e,t,n)},mt.nodeChanged=function(e){return mt.bind("nodechanged",e,!1,!0)},mt.selectionChanged=function(e){return mt.bind("selectionchanged",e,!1,!0)},mt.valueChanged=function(e,t,n){return mt.bind("valuechanged",e,t,n)},at=function(e){var t=0,n=mt.emoticonsCache,o=String.fromCharCode(e.which);u(G,"code")||(n||(n=[],r(wt,function(e,o){n[t++]=[e,o]}),n.sort(function(e,t){return e[0].length-t[0].length}),mt.emoticonsCache=n,mt.longestEmoticonCode=n[n.length-1][0].length),$.replaceKeyword(mt.emoticonsCache,!0,!0,mt.longestEmoticonCode,Ct.emoticonsCompat,o)&&(Ct.emoticonsCompat&&/^\s$/.test(o)||e.preventDefault()))},ct=function(){ne(G,$)},mt.emoticons=function(e){return e||!1===e?(Ct.emoticonsEnabled=e,e?(m(v,"keypress",at),mt.sourceMode()||($.saveRange(),Te(),st(!1),$.restoreRange())):(r(p(v,"img[data-sceditor-emoticon]"),function(e,t){var n=C(t,"sceditor-emoticon"),o=E.createTextNode(n);t.parentNode.replaceChild(o,t)}),g(v,"keypress",at),st()),mt):Ct.emoticonsEnabled},mt.css=function(e){return me||(me=c("style",{id:"inline"},E),f(E.head,me)),ae(e)?(me.styleSheet?me.styleSheet.cssText=e:me.innerHTML=e,mt):me.styleSheet?me.styleSheet.cssText:me.innerHTML},Ue=function(e){var t=[],n={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|","[":"{","]":"}"},o={8:"backspace",9:"tab",13:"enter",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",91:"win",92:"win",93:"select",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={109:"-",110:"del",111:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},r=e.which,a=o[r]||String.fromCharCode(r).toLowerCase();(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&(t.push("shift"),i[r]?a=i[r]:n[a]&&(a=n[a])),a&&(r<16||r>18)&&t.push(a),t=t.join("+"),bt[t]&&!1===bt[t].call(mt)&&(e.stopPropagation(),e.preventDefault())},mt.addShortcut=function(e,t){return e=e.toLowerCase(),ae(t)?bt[e]=function(){return Me(xt[t],mt.commands[t]),!1}:bt[e]=t,mt},mt.removeShortcut=function(e){return delete bt[e.toLowerCase()],mt},$e=function(e){var t,n,o;if(!Ct.disableBlockRemove&&8===e.which&&(n=$.selectedRange())&&(t=n.startContainer,0===n.startOffset&&(o=lt()))){for(;t!==o;){for(;t.previousSibling;)if((t=t.previousSibling).nodeType!==fe||t.nodeValue)return;if(!(t=t.parentNode))return}o&&!k(o,"body")&&(mt.clearBlockFormatting(o),e.preventDefault())}},lt=function(){for(var e=G;!P(e)||j(e,!0);)if(!(e=e.parentNode)||k(e,"body"))return;return e},mt.clearBlockFormatting=function(e){return!(e=e||lt())||k(e,"body")?mt:($.saveRange(),e.className="",B=null,h(e,"style",""),k(e,"p,div,td")||V(e,"p"),$.restoreRange(),mt)},st=function(e){if(K&&(K.hasHandler("valuechangedEvent")||st.hasHandler)){var t,n=mt.sourceMode(),o=!n&&$.hasSelection();A=!1,e=!1!==e&&!E.getElementById("sceditor-start-marker"),L&&(clearTimeout(L),L=!1),o&&e&&$.saveRange(),(t=n?S.value:v.innerHTML)!==st.lastVal&&(st.lastVal=t,z(a,"valuechanged",{rawValue:n?mt.val():t})),o&&e&&$.removeMarkers()}},ut=function(){L&&st()},dt=function(e){var t=e.which,n=dt.lastChar,o=13===n||32===n,i=8===n||46===n;dt.lastChar=t,A||(13===t||32===t?o?dt.triggerNext=!0:st():8===t||46===t?i?dt.triggerNext=!0:st():dt.triggerNext&&(st(),dt.triggerNext=!1),clearTimeout(L),L=setTimeout(function(){A||st()},1500))},Qe=function(e){(A=/start/i.test(e.type))||st()},ft=function(){mt.updateOriginal()},De()}e=e&&e.hasOwnProperty("default")?e.default:e;var ae=t.bind(null,"string"),ce=t.bind(null,"undefined"),le=t.bind(null,"function"),se=t.bind(null,"number"),ue={},de=1,fe=3,pe=!0,me="|body|hr|p|div|h1|h2|h3|h4|h5|h6|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|blockquote|center|",ge={toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,paste,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,image,email,link,unlink|emoticon,youtube,date,time|ltr,rtl|print,maximize,source",toolbarExclude:null,style:"jquery.sceditor.default.css",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",colors:"#000000,#44B8FF,#1E92F7,#0074D9,#005DC2,#00369B,#b3d5f4|#444444,#C3FFFF,#9DF9FF,#7FDBFF,#68C4E8,#419DC1,#d9f4ff|#666666,#72FF84,#4CEA5E,#2ECC40,#17B529,#008E02,#c0f0c6|#888888,#FFFF44,#FFFA1E,#FFDC00,#E8C500,#C19E00,#fff5b3|#aaaaaa,#FFC95F,#FFA339,#FF851B,#E86E04,#C14700,#ffdbbb|#cccccc,#FF857A,#FF5F54,#FF4136,#E82A1F,#C10300,#ffc6c3|#eeeeee,#FF56FF,#FF30DC,#F012BE,#D900A7,#B20080,#fbb8ec|#ffffff,#F551FF,#CF2BE7,#B10DC9,#9A00B2,#9A00B2,#e8b6ef",locale:h(document.documentElement,"lang")||"en",charset:"utf-8",emoticonsCompat:!1,emoticonsEnabled:!0,emoticonsRoot:"",emoticons:{dropdown:{":)":"emoticons/smile.png",":angel:":"emoticons/angel.png",":angry:":"emoticons/angry.png","8-)":"emoticons/cool.png",":'(":"emoticons/cwy.png",":ermm:":"emoticons/ermm.png",":D":"emoticons/grin.png","<3":"emoticons/heart.png",":(":"emoticons/sad.png",":O":"emoticons/shocked.png",":P":"emoticons/tongue.png",";)":"emoticons/wink.png"},more:{":alien:":"emoticons/alien.png",":blink:":"emoticons/blink.png",":blush:":"emoticons/blush.png",":cheerful:":"emoticons/cheerful.png",":devil:":"emoticons/devil.png",":dizzy:":"emoticons/dizzy.png",":getlost:":"emoticons/getlost.png",":happy:":"emoticons/happy.png",":kissing:":"emoticons/kissing.png",":ninja:":"emoticons/ninja.png",":pinch:":"emoticons/pinch.png",":pouty:":"emoticons/pouty.png",":sick:":"emoticons/sick.png",":sideways:":"emoticons/sideways.png",":silly:":"emoticons/silly.png",":sleeping:":"emoticons/sleeping.png",":unsure:":"emoticons/unsure.png",":woot:":"emoticons/w00t.png",":wassat:":"emoticons/wassat.png"},hidden:{":whistling:":"emoticons/whistling.png",":love:":"emoticons/wub.png"}},width:null,height:null,resizeEnabled:!0,resizeMinWidth:null,resizeMinHeight:null,resizeMaxHeight:null,resizeMaxWidth:null,resizeHeight:!0,resizeWidth:!0,dateFormat:"year-month-day",toolbarContainer:null,enablePasteFiltering:!1,disablePasting:!1,readOnly:!1,rtl:!1,autofocus:!1,autofocusEnd:!0,autoExpand:!1,autoUpdate:!1,spellcheck:!0,runWithoutWysiwygSupport:!1,startInSourceMode:!1,id:null,plugins:"",zIndex:null,bbcodeTrim:!1,disableBlockRemove:!1,parserOptions:{},dropDownCss:{}},he=navigator.userAgent,ve=function(){var e=3,t=document,n=t.createElement("div"),o=n.getElementsByTagName("i");do{n.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(o[0]);return t.documentMode&&t.all&&window.atob&&(e=10),4===e&&t.documentMode&&(e=11),e>4?e:void 0}(),ye="-ms-ime-align"in document.documentElement.style,be=/iPhone|iPod|iPad| wosbrowser\//i.test(he),xe=function(){var e,t,n=document.createElement("div");return n.contentEditable=!0,"contentEditable"in document.documentElement&&"true"===n.contentEditable&&(t=/Opera Mobi|Opera Mini/i.test(he),/Android/i.test(he)&&(t=!0,/Safari/.test(he)&&(t=!(e=/Safari\/(\d+)/.exec(he))||!e[1]||e[1]<534)),/ Silk\//i.test(he)&&(t=!(e=/AppleWebKit\/(\d+)/.exec(he))||!e[1]||e[1]<534),be&&(t=/OS [0-4](_\d)+ like Mac/i.test(he)),/Firefox/i.test(he)&&(t=!1),/OneBrowser/i.test(he)&&(t=!1),"UCWEB"===navigator.vendor&&(t=!1),ve<=9&&(t=!0),!t)}(),we=/^(https?|s?ftp|mailto|spotify|skype|ssh|teamspeak|tel):|(\/\/)|data:image\/(png|bmp|gif|p?jpe?g);/i,Ce={html:'<!DOCTYPE html><html{attrs}><head><style>.ie * {min-height: auto !important} .ie table td {height:15px} @supports (-ms-ime-align:auto) { * { min-height: auto !important; } }</style><meta http-equiv="Content-Type" content="text/html;charset={charset}" /><link rel="stylesheet" type="text/css" href="{style}" /></head><body contenteditable="true" {spellcheck}><p></p></body></html>',toolbarButton:'<a class="sceditor-button sceditor-button-{name}" data-sceditor-command="{name}" unselectable="on"><div unselectable="on">{dispName}</div></a>',emoticon:'<img src="{url}" data-sceditor-emoticon="{key}" alt="{key}" title="{tooltip}" />',fontOpt:'<a class="sceditor-font-option" href="#" data-font="{font}"><font face="{font}">{font}</font></a>',sizeOpt:'<a class="sceditor-fontsize-option" data-size="{size}" href="#"><font size="{size}">{size}</font></a>',pastetext:'<div><label for="txt">{label}</label> <textarea cols="20" rows="7" id="txt"></textarea></div><div><input type="button" class="button" value="{insert}" /></div>',table:'<div><label for="rows">{rows}</label><input type="text" id="rows" value="2" /></div><div><label for="cols">{cols}</label><input type="text" id="cols" value="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',image:'<div><label for="link">{url}</label> <input type="text" id="image" placeholder="https://" /></div><div><label for="width">{width}</label> <input type="text" id="width" size="2" /></div><div><label for="height">{height}</label> <input type="text" id="height" size="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',email:'<div><label for="email">{label}</label> <input type="text" id="email" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{insert}" /></div>',link:'<div><label for="link">{url}</label> <input type="text" id="link" placeholder="https://" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{ins}" /></div>',youtubeMenu:'<div><label for="link">{label}</label> <input type="text" id="link" placeholder="https://" /></div><div><input type="button" class="button" value="{insert}" /></div>',youtube:'<iframe width="560" height="315" frameborder="0" allowfullscreensrc="https://www.youtube.com/embed/{id}?wmode=opaque&start={time}" data-youtube-id="{id}"></iframe>'},ke=function(e,t,n){var o=Ce[e];return Object.keys(t).forEach(function(e){o=o.replace(new RegExp(G("{"+e+"}"),"g"),t[e])}),n&&(o=L(o)),o},Ee=ve&&ve<11,Se={bold:{exec:"bold",tooltip:"Bold",shortcut:"Ctrl+B"},italic:{exec:"italic",tooltip:"Italic",shortcut:"Ctrl+I"},underline:{exec:"underline",tooltip:"Underline",shortcut:"Ctrl+U"},strike:{exec:"strikethrough",tooltip:"Strikethrough"},subscript:{exec:"subscript",tooltip:"Subscript"},superscript:{exec:"superscript",tooltip:"Superscript"},left:{exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(e,t,n){var o=c("div");m(o,"click","a",function(t){n(C(this,"font")),e.closeDropDown(!0),t.preventDefault()}),e.opts.fonts.split(",").forEach(function(e){f(o,ke("fontOpt",{font:e},!0))}),e.createDropDown(t,"font-picker",o)},exec:function(e){var t=this;Se.font._dropDown(t,e,function(e){t.execCommand("fontname",e)})},tooltip:"Font Name"},size:{_dropDown:function(e,t,n){var o=c("div");m(o,"click","a",function(t){n(C(this,"size")),e.closeDropDown(!0),t.preventDefault()});for(var i=1;i<=7;i++)f(o,ke("sizeOpt",{size:i},!0));e.createDropDown(t,"fontsize-picker",o)},exec:function(e){var t=this;Se.size._dropDown(t,e,function(e){t.execCommand("fontsize",e)})},tooltip:"Font Size"},color:{_dropDown:function(e,t,n){var o=c("div"),i="",r=Se.color;r._htmlCache||(e.opts.colors.split("|").forEach(function(e){i+='<div class="sceditor-color-column">',e.split(",").forEach(function(e){i+='<a href="#" class="sceditor-color-option" style="background-color: '+e+'" data-color="'+e+'"></a>'}),i+="</div>"}),r._htmlCache=i),f(o,L(r._htmlCache)),m(o,"click","a",function(t){n(C(this,"color")),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"color-picker",o)},exec:function(e){var t=this;Se.color._dropDown(t,e,function(e){t.execCommand("forecolor",e)})},tooltip:"Font Color"},removeformat:{exec:"removeformat",tooltip:"Remove Formatting"},cut:{exec:"cut",tooltip:"Cut",errorMessage:"Your browser does not allow the cut command. Please use the keyboard shortcut Ctrl/Cmd-X"},copy:{exec:"copy",tooltip:"Copy",errorMessage:"Your browser does not allow the copy command. Please use the keyboard shortcut Ctrl/Cmd-C"},paste:{exec:"paste",tooltip:"Paste",errorMessage:"Your browser does not allow the paste command. Please use the keyboard shortcut Ctrl/Cmd-V"},pastetext:{exec:function(e){var t,n=c("div"),o=this;f(n,ke("pastetext",{label:o._("Paste your text inside the following box:"),insert:o._("Insert")},!0)),m(n,"click",".button",function(e){(t=p(n,"#txt")[0].value)&&o.wysiwygEditorInsertText(t),o.closeDropDown(!0),e.preventDefault()}),o.createDropDown(e,"pastetext",n)},tooltip:"Paste Text"},bulletlist:{exec:function(){Z(this),this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){Z(this),this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(e,t){var n,o,i,r=l(t,"ul,ol,menu");return r.length>1&&r[0].children.length>1?0:k(t,"ul,ol,menu")&&(n=this.getRangeHelper().selectedRange(),o=n.startContainer.parentNode,i=n.endContainer.parentNode,o!==o.parentNode.firstElementChild||k(i,"li")&&i!==i.parentNode.lastElementChild)?0:-1},exec:function(){var e=this,t=e.getRangeHelper().getFirstBlockParent();e.focus(),l(t,"ul,ol,menu")&&e.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(e,t){return u(t,"ul,ol,menu")>0?0:-1},exec:function(){l(this.getRangeHelper().getFirstBlockParent(),"ul,ol,menu")&&this.execCommand("outdent")},tooltip:"Remove one indent"},table:{exec:function(e){var t=this,n=c("div");f(n,ke("table",{rows:t._("Rows:"),cols:t._("Cols:"),insert:t._("Insert")},!0)),m(n,"click",".button",function(e){var o=Number(p(n,"#rows")[0].value),i=Number(p(n,"#cols")[0].value),r="<table>";o>0&&i>0&&(r+=Array(o+1).join("<tr>"+Array(i+1).join("<td>"+(Ee?"":"<br />")+"</td>")+"</tr>"),r+="</table>",t.wysiwygEditorInsertHtml(r),t.closeDropDown(!0),e.preventDefault())}),t.createDropDown(e,"inserttable",n)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("<code>",(Ee?"":"<br />")+"</code>")},tooltip:"Code"},image:{_dropDown:function(e,t,n,o){var i=c("div");f(i,ke("image",{url:e._("URL:"),width:e._("Width (optional):"),height:e._("Height (optional):"),insert:e._("Insert")},!0));var r=p(i,"#image")[0];r.value=n,m(i,"click",".button",function(t){r.value&&o(r.value,p(i,"#width")[0].value,p(i,"#height")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertimage",i)},exec:function(e){var t=this;Se.image._dropDown(t,e,"",function(e,n,o){var i="";n&&(i+=' width="'+n+'"'),o&&(i+=' height="'+o+'"'),t.wysiwygEditorInsertHtml("<img"+i+' src="'+e+'" />')})},tooltip:"Insert an image"},email:{_dropDown:function(e,t,n){var o=c("div");f(o,ke("email",{label:e._("E-mail:"),desc:e._("Description (optional):"),insert:e._("Insert")},!0)),m(o,"click",".button",function(t){var i=p(o,"#email")[0].value;i&&n(i,p(o,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertemail",o)},exec:function(e){var t=this;Se.email._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?t.wysiwygEditorInsertHtml('<a href="mailto:'+e+'">'+(n||e)+"</a>"):t.execCommand("createlink","mailto:"+e)})},tooltip:"Insert an email"},link:{_dropDown:function(e,t,n){function o(t){r.value&&n(r.value,p(i,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}var i=c("div");f(i,ke("link",{url:e._("URL:"),desc:e._("Description (optional):"),ins:e._("Insert")},!0));var r=p(i,"#link")[0];m(i,"click",".button",o),m(i,"keypress",function(e){13===e.which&&r.value&&o(e)},pe),e.createDropDown(t,"insertlink",i)},exec:function(e){var t=this;Se.link._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?(n=n||e,t.wysiwygEditorInsertHtml('<a href="'+e+'">'+n+"</a>")):t.execCommand("createlink",e)})},tooltip:"Insert a link"},unlink:{state:function(){return u(this.currentNode(),"a")?0:-1},exec:function(){var e=u(this.currentNode(),"a");if(e){for(;e.firstChild;)D(e.firstChild,e);d(e)}},tooltip:"Unlink"},quote:{exec:function(e,t,n){var o="<blockquote>",i="</blockquote>";t?(o=o+(n=n?"<cite>"+n+"</cite>":"")+t+i,i=null):""===this.getRangeHelper().selectedHtml()&&(i=(Ee?"":"<br />")+i),this.wysiwygEditorInsertHtml(o,i)},tooltip:"Insert a Quote"},emoticon:{exec:function(e){var t=this,n=function(i){var a,l=t.opts.emoticonsCompat,s=t.getRangeHelper(),u=l&&" "!==s.getOuterText(!0,1)?" ":"",d=l&&" "!==s.getOuterText(!1,1)?" ":"",p=c("div"),g=c("div"),v=0,y=o({},t.opts.emoticons.dropdown,i?t.opts.emoticons.more:{});return f(p,g),v=Math.sqrt(Object.keys(y).length),m(p,"click","img",function(e){t.insert(u+h(this,"alt")+d,null,!1).closeDropDown(!0),e.preventDefault()}),r(y,function(e,t){f(g,c("img",{src:t.url||t,alt:e,title:t.tooltip||e})),g.children.length>=v&&(g=c("div"),f(p,g))}),!i&&t.opts.emoticons.more&&(f(a=c("a",{className:"sceditor-more"}),document.createTextNode(t._("More"))),m(a,"click",function(o){t.createDropDown(e,"more-emoticons",n(!0)),o.preventDefault()}),f(p,a)),p};t.createDropDown(e,"emoticons",n(!1))},txtExec:function(e){Se.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(e,t,n){var o=c("div");f(o,ke("youtubeMenu",{label:e._("Video URL:"),insert:e._("Insert")},!0)),m(o,"click",".button",function(t){var i=p(o,"#link")[0].value,a=i.match(/(?:v=|v\/|embed\/|youtu.be\/)(.{11})/),c=i.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/),l=0;c&&r(c[1].split(/[hms]/),function(e,t){""!==t&&(l=60*l+Number(t))}),a&&/^[a-zA-Z0-9_\-]{11}$/.test(a[1])&&n(a[1],l),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertlink",o)},exec:function(e){var t=this;Se.youtube._dropDown(t,e,function(e,n){t.wysiwygEditorInsertHtml(ke("youtube",{id:e,time:n}))})},tooltip:"Insert a YouTube video"},date:{_date:function(e){var t=new Date,n=t.getYear(),o=t.getMonth()+1,i=t.getDate();return n<2e3&&(n=1900+n),o<10&&(o="0"+o),i<10&&(i="0"+i),e.opts.dateFormat.replace(/year/i,n).replace(/month/i,o).replace(/day/i,i)},exec:function(){this.insertText(Se.date._date(this))},txtExec:function(){this.insertText(Se.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var e=new Date,t=e.getHours(),n=e.getMinutes(),o=e.getSeconds();return t<10&&(t="0"+t),n<10&&(n="0"+n),o<10&&(o="0"+o),t+":"+n+":"+o},exec:function(){this.insertText(Se.time._time())},txtExec:function(){this.insertText(Se.time._time())},tooltip:"Insert current time"},ltr:{state:function(e,t){return t&&"ltr"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!k(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!k(n,"body")))&&w(n,"direction","ltr"===w(n,"direction")?"":"ltr")},tooltip:"Left-to-Right"},rtl:{state:function(e,t){return t&&"rtl"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!k(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!k(n,"body")))&&w(n,"direction","rtl"===w(n,"direction")?"":"rtl")},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize())},txtExec:function(){this.maximize(!this.maximize())},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode()},txtExec:function(){this.toggleSourceMode()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}},De={};ee.plugins=De;var Te=ve&&ve<11,Me=function(e,t,n){var o,i,r,a,c,l="",s=e.startContainer,u=e.startOffset;for(s&&3!==s.nodeType&&(s=s.childNodes[u],u=0),r=a=u;n>l.length&&s&&3===s.nodeType;)o=s.nodeValue,i=n-l.length,c&&(a=o.length,r=0),c=s,t?(u=r=Math.max(a-i,0),l=o.substr(r,a-r)+l,s=c.previousSibling):(u=r+(a=Math.min(i,o.length)),l+=o.substr(r,a),s=c.nextSibling);return{node:c||s,offset:u,text:l}},Ne=window,Re=document,Fe=ve,He=Fe&&Fe<11,_e=/^image\/(p?jpe?g|gif|png|bmp)$/i;re.locale={},re.formats={},re.icons={},re.command={get:function(e){return Se[e]||null},set:function(e,t){return!(!e||!t)&&(t=o(Se[e]||{},t),t.remove=function(){re.command.remove(e)},Se[e]=t,this)},remove:function(e){return Se[e]&&delete Se[e],this}},window.sceditor={command:re.command,commands:Se,defaultOptions:ge,ie:ve,ios:be,isWysiwygSupported:xe,regexEscape:G,escapeEntities:J,escapeUriScheme:function(e){var t,n=/^[^\/]*:/i,o=window.location;return e&&n.test(e)&&!we.test(e)?((t=o.pathname.split("/")).pop(),o.protocol+"//"+o.host+t.join("/")+"/"+e):e},dom:{css:w,attr:h,removeAttr:v,is:k,closest:u,width:H,height:_,traverse:A,rTraverse:I,parseHTML:L,hasStyling:P,convertElement:V,blockLevelList:me,canHaveChildren:W,isInline:j,copyCSS:q,fixNesting:U,findCommonAncestor:function(e,t){for(;e=e.parentNode;)if(E(e,t))return e},getSibling:$,removeWhiteSpace:Y,extractContents:K,getOffset:X,getStyle:Q,hasStyle:function(e,t,n){var o=Q(e,t);return!!o&&(!n||o===n||Array.isArray(n)&&n.indexOf(o)>-1)}},locale:re.locale,icons:re.icons,utils:{each:r,isEmptyObject:n,extend:o},plugins:ee.plugins,formats:re.formats,create:function(e,t){t=t||{},s(e,".sceditor-container")||(t.runWithoutWysiwygSupport||xe)&&new re(e,t)},instance:function(e){return e._sceditor}},e.sceditor=window.sceditor,e.fn.sceditor=function(t){var n,o=[];return this.each(function(){n=this._sceditor,"state"===t?o.push(!!n):"instance"===t?o.push(n):n||e.sceditor.create(this,t)}),o.length?1===o.length?o[0]:o:this}}(jQuery); | ||
!function(e){"use strict";function t(e,t){return typeof t===e}function n(e){return!Object.keys(e).length}function o(e,t){for(var n=e===!!e,i=n?2:1,r=n?t:e,a=!!n&&e;i<arguments.length;i++){var c=arguments[i];for(var l in c){var s=c[l];if(!ce(s)){var u=null!==s&&"object"==typeof s,d=Array.isArray(s);r[l]=a&&(u||d)?o(!0,r[l]||(d?[]:{}),s):s}}}return r}function i(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}function r(e,t){if(Array.isArray(e)||"length"in e&&se(e.length))for(var n=0;n<e.length;n++)t(n,e[n]);else Object.keys(e).forEach(function(n){t(n,e[n])})}function a(e){return e=parseFloat(e),isFinite(e)?e:0}function c(e,t,n){var o=(n||document).createElement(e);return r(t||{},function(e,t){"style"===e?o.style.cssText=t:e in o?o[e]=t:o.setAttribute(e,t)}),o}function l(e,t){for(var n=[],o=e||{};(o=o.parentNode)&&!/(9|11)/.test(o.nodeType);)t&&!k(o,t)||n.push(o);return n}function s(e,t){for(var n=e||{};(n=n.parentNode)&&!/(9|11)/.test(n.nodeType);)if(!t||k(n,t))return n}function u(e,t){return k(e,t)?e:s(e,t)}function d(e){e.parentNode.removeChild(e)}function f(e,t){e.appendChild(t)}function p(e,t){return e.querySelectorAll(t)}function m(e,t,n,o,i){t.split(" ").forEach(function(t){var r;ae(n)?(r=o["_sce-event-"+t+n]||function(t){for(var i=t.target;i&&i!==e;){if(k(i,n))return void o.call(i,t);i=i.parentNode}},o["_sce-event-"+t+n]=r):(r=n,i=o),e.addEventListener(t,r,i||!1)})}function g(e,t,n,o,i){t.split(" ").forEach(function(t){var r;ae(n)?r=o["_sce-event-"+t+n]:(r=n,i=o),e.removeEventListener(t,r,i||!1)})}function h(e,t,n){if(arguments.length<3)return e.getAttribute(t);null==n?v(e,t):e.setAttribute(t,n)}function v(e,t){e.removeAttribute(t)}function y(e){w(e,"display","none")}function b(e){w(e,"display","")}function x(e){O(e)?y(e):b(e)}function w(e,t,n){if(arguments.length<3){if(ae(t))return getComputedStyle(e)[t];r(t,function(t,n){w(e,t,n)})}else{var o=(n||0===n)&&!isNaN(n);e.style[t]=o?n+"px":n}}function C(e,t,n){var o=arguments.length,i={};if(e.nodeType===de){if(1===o)return r(e.attributes,function(e,t){/^data\-/i.test(t.name)&&(i[t.name.substr(5)]=t.value)}),i;if(2===o)return h(e,"data-"+t);h(e,"data-"+t,String(n))}}function k(e,t){var n=!1;return e&&e.nodeType===de&&(n=(e.matches||e.msMatchesSelector||e.webkitMatchesSelector).call(e,t)),n}function E(e,t){return e!==t&&e.contains&&e.contains(t)}function S(e,t){var n=e.previousElementSibling;return t&&n?k(n,t)?n:null:n}function D(e,t){return t.parentNode.insertBefore(e,t)}function T(e){return e.className.trim().split(/\s+/)}function M(e,t){return k(e,"."+t)}function N(e,t){var n=T(e);n.indexOf(t)<0&&n.push(t),e.className=n.join(" ")}function R(e,t){var n=T(e);i(n,t),e.className=n.join(" ")}function F(e,t,n){(n=ce(n)?!M(e,t):n)?N(e,t):R(e,t)}function H(e,t){if(ce(t)){var n=getComputedStyle(e),o=a(n.paddingLeft)+a(n.paddingRight),i=a(n.borderLeftWidth)+a(n.borderRightWidth);return e.offsetWidth-o-i}w(e,"width",t)}function _(e,t){if(ce(t)){var n=getComputedStyle(e),o=a(n.paddingTop)+a(n.paddingBottom),i=a(n.borderTopWidth)+a(n.borderBottomWidth);return e.offsetHeight-o-i}w(e,"height",t)}function z(e,t,n){var o;le(window.CustomEvent)?o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(o=e.ownerDocument.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(o)}function O(e){return!!e.getClientRects().length}function B(e){return e.replace(/^-ms-/,"ms-").replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function A(e,t,n,o,i){for(e=i?e.lastChild:e.firstChild;e;){var r=i?e.previousSibling:e.nextSibling;if(!n&&!1===t(e)||!o&&!1===A(e,t,n,o,i)||n&&!1===t(e))return!1;e=r}}function I(e,t,n,o){A(e,t,n,o,!0)}function L(e,t){var n=(t=t||document).createDocumentFragment(),o=c("div",{},t);for(o.innerHTML=e;o.firstChild;)f(n,o.firstChild);return n}function P(e){return e&&(!k(e,"p,div")||e.className||h(e,"style")||!n(C(e)))}function V(e,t){var n=c(t,{},e.ownerDocument);for(r(e.attributes,function(e,t){try{h(n,t.name,t.value)}catch(e){}});e.firstChild;)f(n,e.firstChild);return e.parentNode.replaceChild(n,e),n}function W(e){return!!/11?|9/.test(e.nodeType)&&"|iframe|area|base|basefont|br|col|frame|hr|img|input|wbr|isindex|link|meta|param|command|embed|keygen|source|track|object|".indexOf("|"+e.nodeName.toLowerCase()+"|")<0}function j(e,t){var n,o=(e||{}).nodeType||fe;return o!==de?o===fe:"code"===(n=e.tagName.toLowerCase())?!t:me.indexOf("|"+n+"|")<0}function q(e,t){t.style.cssText=e.style.cssText+t.style.cssText}function U(e){var t=function(e){for(;j(e.parentNode,!0);)e=e.parentNode;return e};A(e,function(e){var n=!j(e,!0);if(n&&j(e.parentNode,!0)){var o=t(e),i=K(o,e),r=e;q(o,r),D(i,o),D(r,o)}if(n&&k(e,"ul,ol")&&k(e.parentNode,"ul,ol")){var a=S(e,"li");a||D(a=c("li"),e),f(a,e)}})}function $(e,t){return e?(t?e.previousSibling:e.nextSibling)||$(e.parentNode,t):null}function Y(e){var t,n,o,i,r,a,c,l=w(e,"whiteSpace"),s=/line$/i.test(l),u=e.firstChild;if(!/pre(\-wrap)?$/i.test(l))for(;u;){if(a=u.nextSibling,t=u.nodeValue,(n=u.nodeType)===de&&u.firstChild&&Y(u),n===fe){for(o=$(u),i=$(u,!0),c=!1;M(i,"sceditor-ignore");)i=$(i,!0);if(j(u)&&i){for(r=i;r.lastChild;)r=r.lastChild;c=r.nodeType===fe?/[\t\n\r ]$/.test(r.nodeValue):!j(r)}t=t.replace(/\u200B/g,""),i&&j(i)&&!c||(t=t.replace(s?/^[\t ]+/:/^[\t\n\r ]+/,"")),o&&j(o)||(t=t.replace(s?/[\t ]+$/:/[\t\n\r ]+$/,"")),t.length?u.nodeValue=t.replace(s?/[\t ]+/g:/[\t\n\r ]+/g," "):d(u)}u=a}}function K(e,t){var n=e.ownerDocument.createRange();return n.setStartBefore(e),n.setEndAfter(t),n.extractContents()}function X(e){for(var t=0,n=0;e;)t+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:t,top:n}}function Q(e,t){var n,o,i=e.style;if(ue[t]||(ue[t]=B(t)),t=ue[t],o=i[t],"textAlign"===t){if(n=i.direction,o=o||w(e,t),w(e.parentNode,t)===o||"block"!==w(e,"display")||k(e,"hr,th"))return"";if(/right/i.test(o)&&"rtl"===n||/left/i.test(o)&&"ltr"===n)return""}return o}function G(e){return e.replace(/([\-.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function J(e,t){if(!e)return e;var n={"&":"&","<":"<",">":">"," ":" ","\r\n":"<br />","\r":"<br />","\n":"<br />"};return!1!==t&&(n['"']=""",n["'"]="'",n["`"]="`"),e=e.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(e){return n[e]||e})}function Z(e){if("mozHidden"in document)for(var t,n=e.getBody();n;){if((t=n).firstChild)t=t.firstChild;else{for(;t&&!t.nextSibling;)t=t.parentNode;t&&(t=t.nextSibling)}3===n.nodeType&&/[\n\r\t]+/.test(n.nodeValue)&&(/^pre/.test(w(n.parentNode,"whiteSpace"))||d(n)),n=t}}function ee(e){var t=this,n=[],o=function(e){return"signal"+e.charAt(0).toUpperCase()+e.slice(1)},i=function(t,i){t=[].slice.call(t);var r,a,c=o(t.shift());for(r=0;r<n.length;r++)if(c in n[r]&&(a=n[r][c].apply(e,t),i))return a};t.call=function(){i(arguments,!1)},t.callOnlyFirst=function(){return i(arguments,!0)},t.hasHandler=function(e){var t=n.length;for(e=o(e);t--;)if(e in n[t])return!0;return!1},t.exists=function(e){return e in De&&("function"==typeof(e=De[e])&&"object"==typeof e.prototype)},t.isRegistered=function(e){if(t.exists(e))for(var o=n.length;o--;)if(n[o]instanceof De[e])return!0;return!1},t.register=function(o){return!(!t.exists(o)||t.isRegistered(o))&&(o=new De[o],n.push(o),"init"in o&&o.init.call(e),!0)},t.deregister=function(o){var i,r=n.length,a=!1;if(!t.isRegistered(o))return a;for(;r--;)n[r]instanceof De[o]&&(a=!0,"destroy"in(i=n.splice(r,1)[0])&&i.destroy.call(e));return a},t.destroy=function(){for(var t=n.length;t--;)"destroy"in n[t]&&n[t].destroy.call(e);n=[],e=null}}function te(e,t){var n,o,i=t||e.contentDocument||e.document,r="sceditor-start-marker",a="sceditor-end-marker",l=this;l.insertHTML=function(e,t){var n,o;if(!l.selectedRange())return!1;for(t&&(e+=l.selectedHtml()+t),o=c("p",{},i),n=i.createDocumentFragment(),o.innerHTML=e;o.firstChild;)f(n,o.firstChild);l.insertNode(n)},o=function(e,t,o){var s,u=i.createDocumentFragment();if("string"==typeof e?(t&&(e+=l.selectedHtml()+t),u=L(e)):(f(u,e),t&&(f(u,l.selectedRange().extractContents()),f(u,t))),s=u.lastChild){for(;!j(s.lastChild,!0);)s=s.lastChild;if(W(s)?s.lastChild||f(s,document.createTextNode("")):s=u,l.removeMarkers(),f(s,n(r)),f(s,n(a)),o){var d=c("div");return f(d,u),d.innerHTML}return u}},l.insertNode=function(e,t){var n=o(e,t),i=l.selectedRange(),r=i.commonAncestorContainer;if(!n)return!1;i.deleteContents(),r&&3!==r.nodeType&&!W(r)?D(n,r):i.insertNode(n),l.restoreRange()},l.cloneSelected=function(){var e=l.selectedRange();if(e)return e.cloneRange()},l.selectedRange=function(){var t,n,o=e.getSelection();if(o){if(o.getRangeAt&&o.rangeCount<=0){for(n=i.body;n.firstChild;)n=n.firstChild;(t=i.createRange()).setStartBefore(n),o.addRange(t)}return o.rangeCount>0&&(t=o.getRangeAt(0)),t}},l.hasSelection=function(){var t=e.getSelection();return t&&t.rangeCount>0},l.selectedHtml=function(){var e,t=l.selectedRange();return t?(e=c("p",{},i),f(e,t.cloneContents()),e.innerHTML):""},l.parentNode=function(){var e=l.selectedRange();if(e)return e.commonAncestorContainer},l.getFirstBlockParent=function(e){var t=function(e){return j(e,!0)&&(e=e?e.parentNode:null)?t(e):e};return t(e||l.parentNode())},l.insertNodeAt=function(e,t){var n=l.selectedRange(),o=l.cloneSelected();if(!o)return!1;o.collapse(e),o.insertNode(t),l.selectRange(n)},n=function(e){l.removeMarker(e);var t=c("span",{id:e,className:"sceditor-selection sceditor-ignore",style:"display:none;line-height:0"},i);return t.innerHTML=" ",t},l.insertMarkers=function(){var e=l.selectedRange(),t=n(r);l.removeMarkers(),l.insertNodeAt(!0,t),e&&e.collapsed?t.parentNode.insertBefore(n(a),t.nextSibling):l.insertNodeAt(!1,n(a))},l.getMarker=function(e){return i.getElementById(e)},l.removeMarker=function(e){var t=l.getMarker(e);t&&d(t)},l.removeMarkers=function(){l.removeMarker(r),l.removeMarker(a)},l.saveRange=function(){l.insertMarkers()},l.selectRange=function(t){var n,o=e.getSelection(),r=t.endContainer;if(!Te&&t.collapsed&&r&&!j(r,!0)){for(n=r.lastChild;n&&k(n,".sceditor-ignore");)n=n.previousSibling;if(k(n,"br")){var a=i.createRange();a.setEndAfter(n),a.collapse(!1),l.compare(t,a)&&(t.setStartBefore(n),t.collapse(!0))}}o&&(l.clear(),o.addRange(t))},l.restoreRange=function(){var e,t=l.selectedRange(),n=l.getMarker(r),o=l.getMarker(a);if(!n||!o||!t)return!1;e=n.nextSibling===o,(t=i.createRange()).setStartBefore(n),t.setEndAfter(o),e&&t.collapse(!0),l.selectRange(t),l.removeMarkers()},l.selectOuterText=function(e,t){var n,o,i=l.cloneSelected();if(!i)return!1;i.collapse(!1),n=Me(i,!0,e),o=Me(i,!1,t),i.setStart(n.node,n.offset),i.setEnd(o.node,o.offset),l.selectRange(i)},l.getOuterText=function(e,t){var n=l.cloneSelected();return n?(n.collapse(!e),Me(n,e,t).text):""},l.replaceKeyword=function(e,t,n,o,i,r){n||e.sort(function(e,t){return e[0].length-t[0].length});var a,c,s,u,d,f,p,m,g=e.length,h=i?1:0,v=o||e[g-1][0].length;for(i&&v++,r=r||"",d=(a=l.getOuterText(!0,v)).length,a+=r,t&&(a+=l.getOuterText(!1,v));g--;)if(p=e[g][0],m=p.length,u=Math.max(0,d-m-h),s=-1,i?(c=a.substr(u).match(new RegExp("(^|[\\s ])"+G(p)+"(^|[\\s ])")))&&(s=c.index+u+c[1].length):s=a.indexOf(p,u),s>-1&&s<=d&&s+m+h>=d)return f=d-s,l.selectOuterText(f,m-f-(/^\S/.test(r)?1:0)),l.insertHTML(e[g][1]),!0;return!1},l.compare=function(e,t){return t||(t=l.selectedRange()),e&&t?0===e.compareBoundaryPoints(Range.END_TO_END,t)&&0===e.compareBoundaryPoints(Range.START_TO_START,t):!e&&!t},l.clear=function(){var t=e.getSelection();t&&(t.removeAllRanges?t.removeAllRanges():t.empty&&t.empty())}}function ne(e,t){var n=/[^\s\xA0\u2002\u2003\u2009\u00a0]+/,o=e&&p(e,"img[data-sceditor-emoticon]");if(e&&o.length)for(var i=0;i<o.length;i++){var r=o[i],a=r.parentNode,c=r.previousSibling,l=r.nextSibling;if(c&&n.test(c.nodeValue.slice(-1))||l&&n.test((l.nodeValue||"")[0])){var s=t.cloneSelected(),u=-1,f=s.startContainer,m=c.nodeValue;null===m&&(m=c.innerText||""),m+=C(r,"sceditor-emoticon"),f===l&&(u=m.length+s.startOffset),f===e&&e.childNodes[s.startOffset]===l&&(u=m.length),f===c&&(u=s.startOffset),l&&l.nodeType===fe||(l=a.insertBefore(a.ownerDocument.createTextNode(""),l)),l.insertData(0,m),d(c),d(r),u>-1&&(s.setStart(l,u),s.collapse(!0),t.selectRange(s))}}}function oe(e,t,n){var o=e.ownerDocument,i="(^|\\s| | | | |$)",a=[],c={};s(e,"code")||(r(t,function(e){c[e]=new RegExp(i+G(e)+i),a.push(e)}),a.sort(function(e,t){return t.length-e.length}),function e(i){for(i=i.firstChild;i;){if(i.nodeType!==de||k(i,"code")||e(i),i.nodeType===fe)for(var r=0;r<a.length;r++){var l=i.nodeValue,s=a[r],u=n?l.search(c[s]):l.indexOf(s);if(u>-1){var d=l.indexOf(s,u),f=L(t[s],o),p=l.substr(d+s.length);f.appendChild(o.createTextNode(p)),i.nodeValue=l.substr(0,d),i.parentNode.insertBefore(f,i.nextSibling)}}i=i.nextSibling}}(e))}function ie(e,t){var n;A(e,function(e){j(e,!0)?(n||D(n=c("p",{},t),e),e.nodeType===fe&&""===e.nodeValue||f(n,e)):n=null},!1,!0)}function re(e,t){var n,a,l,s,v,E,S,T,B,A,L,q,$,K,Q,G,Z,se,ue,me,he,ve,we,Ce,Ee,De,Te,Me,ze,Oe,Be,Ae,Ie,Le,Pe,Ve,We,je,qe,Ue,$e,Ye,Ke,Xe,Qe,Ge,Je,Ze,et,tt,nt,ot,it,rt,at,ct,lt,st,ut,dt,ft,pt,mt=this,gt=e.get?e.get(0):e,ht={},vt=[],yt=[],bt={},xt={},wt={};mt.commands=o(!0,{},t.commands||Se);var Ct=mt.opts=o(!0,{},ge,t);mt.opts.emoticons=t.emoticons||ge.emoticons,De=function(){gt._sceditor=mt,Ct.locale&&"en"!==Ct.locale&&Ae(),D(a=c("div",{className:"sceditor-container"}),gt),w(a,"z-index",Ct.zIndex),Fe&&N(a,"ie ie"+Fe),ue=gt.required,gt.required=!1;var e=re.formats[Ct.format];"init"in(n=e?new e:{})&&n.init.call(mt),Be(),We(),Ie(),Oe(),Le(),Pe(),xe||mt.toggleSourceMode(),et();var t=function(){g(Ne,"load",t),Ct.autofocus&&rt(),pt(),nt(),K.call("ready"),"onReady"in n&&n.onReady.call(mt)};m(Ne,"load",t),"complete"===Re.readyState&&t()},Be=function(){var e=Ct.plugins;e=e?e.toString().split(","):[],K=new ee(mt),e.forEach(function(e){K.register(e.trim())})},Ae=function(){var e;(q=re.locale[Ct.locale])||(e=Ct.locale.split("-"),q=re.locale[e[0]]),q&&q.dateFormat&&(Ct.dateFormat=q.dateFormat)},Oe=function(){S=c("textarea"),s=c("iframe",{frameborder:0,allowfullscreen:!0}),Ct.startInSourceMode?(N(a,"sourceMode"),y(s)):(N(a,"wysiwygMode"),y(S)),Ct.spellcheck||h(a,"spellcheck","false"),"https:"===Ne.location.protocol&&h(s,"src","javascript:false"),f(a,s),f(a,S),mt.dimensions(Ct.width||H(gt),Ct.height||_(gt));var e=Fe?"ie ie"+Fe:"";e+=be?" ios":"",(E=s.contentDocument).open(),E.write(ke("html",{attrs:' class="'+e+'"',spellcheck:Ct.spellcheck?"":'spellcheck="false"',charset:Ct.charset,style:Ct.style})),E.close(),v=E.body,mt.readOnly(!!Ct.readOnly),(be||ye||Fe)&&(_(v,"100%"),Fe||m(v,"touchend",mt.focus));var t=h(gt,"tabindex");h(S,"tabindex",t),h(s,"tabindex",t),$=new te(s.contentWindow),y(gt),mt.val(gt.value);var n=Ct.placeholder||h(gt,"placeholder");n&&(S.placeholder=n,h(v,"placeholder",n))},Le=function(){Ct.autoUpdate&&(m(v,"blur",ft),m(S,"blur",ft)),null===Ct.rtl&&(Ct.rtl="rtl"===w(S,"direction")),mt.rtl(!!Ct.rtl),Ct.autoExpand&&(m(v,"load",pt,pe),m(E,"input keyup",pt)),Ct.resizeEnabled&&Ve(),h(a,"id",Ct.id),mt.emoticons(Ct.emoticonsEnabled)},Pe=function(){var e=gt.form,t="onselectionchange"in E?"selectionchange":"keyup focus blur contextmenu mouseup touchend click";m(Re,"click",Je),e&&(m(e,"reset",Ke),m(e,"submit",mt.updateOriginal,pe)),m(v,"keypress",Ye),m(v,"keydown",Ue),m(v,"keydown",$e),m(v,"keyup",nt),m(v,"blur",ut),m(v,"keyup",dt),m(v,"paste",je),m(v,"compositionstart compositionend",Qe),m(v,t,ot),m(v,"keydown keyup keypress focus blur contextmenu",Ge),Ct.emoticonsCompat&&Ne.getSelection&&m(v,"keyup",ct),m(v,"blur",function(){mt.val()||N(v,"placeholder")}),m(v,"focus",function(){R(v,"placeholder")}),m(S,"blur",ut),m(S,"keyup",dt),m(S,"keydown",Ue),m(S,"compositionstart compositionend",Qe),m(S,"keydown keyup keypress focus blur contextmenu",Ge),m(E,"mousedown",Xe),m(E,t,ot),m(E,"beforedeactivate keyup mouseup",ze),m(E,"keyup",nt),m(E,"focus",function(){B=null}),m(a,"selectionchanged",it),m(a,"selectionchanged",et),m(a,"selectionchanged valuechanged nodechanged",Ge)},Ie=function(){var e,t=mt.commands,n=(Ct.toolbarExclude||"").split(","),o=Ct.toolbar.split("|");l=c("div",{className:"sceditor-toolbar",unselectable:"on"}),Ct.icons in re.icons&&(Ee=new re.icons[Ct.icons]),r(o,function(o,i){e=c("div",{className:"sceditor-group"}),r(i.split(","),function(o,i){var r,a,c=t[i];!c||n.indexOf(i)>-1||(a=c.shortcut,r=ke("toolbarButton",{name:i,dispName:mt._(c.name||c.tooltip||i)},!0).firstChild,Ee&&Ee.create&&Ee.create(i)&&(D(Ee.create(i),r.firstChild),N(r,"has-icon")),r._sceTxtMode=!!c.txtExec,r._sceWysiwygMode=!!c.exec,F(r,"disabled",!c.exec),m(r,"click",function(e){M(r,"disabled")||Me(r,c),et(),e.preventDefault()}),m(r,"mousedown",function(e){mt.closeDropDown(),e.preventDefault()}),c.tooltip&&h(r,"title",mt._(c.tooltip)+(a?" ("+a+")":"")),a&&mt.addShortcut(a,i),c.state?yt.push({name:i,state:c.state}):ae(c.exec)&&yt.push({name:i,state:c.exec}),f(e,r),xt[i]=r)}),e.firstChild&&f(l,e)}),f(Ct.toolbarContainer||a,l)},Ve=function(){var e,t,n,o,i,r,l=c("div",{className:"sceditor-grip"}),s=c("div",{className:"sceditor-resize-cover"}),u="touchcancel touchend mouseup",d=0,p=0,h=0,v=0,x=0,w=0,C=H(a),k=_(a),E=!1,S=mt.rtl();if(e=Ct.resizeMinHeight||k/1.5,t=Ct.resizeMaxHeight||2.5*k,n=Ct.resizeMinWidth||C/1.25,o=Ct.resizeMaxWidth||1.25*C,i=function(i){"touchmove"===i.type?(i=Ne.event,h=i.changedTouches[0].pageX,v=i.changedTouches[0].pageY):(h=i.pageX,v=i.pageY);var r=w+(v-p),a=S?x-(h-d):x+(h-d);o>0&&a>o&&(a=o),n>0&&a<n&&(a=n),Ct.resizeWidth||(a=!1),t>0&&r>t&&(r=t),e>0&&r<e&&(r=e),Ct.resizeHeight||(r=!1),(a||r)&&mt.dimensions(a,r),i.preventDefault()},r=function(e){E&&(E=!1,y(s),R(a,"resizing"),g(Re,"touchmove mousemove",i),g(Re,u,r),e.preventDefault())},Ee&&Ee.create){var D=Ee.create("grip");D&&(f(l,D),N(l,"has-icon"))}f(a,l),f(a,s),y(s),m(l,"touchstart mousedown",function(e){"touchstart"===e.type?(e=Ne.event,d=e.touches[0].pageX,p=e.touches[0].pageY):(d=e.pageX,p=e.pageY),x=H(a),w=_(a),E=!0,N(a,"resizing"),b(s),m(Re,"touchmove mousemove",i),m(Re,u,r),e.preventDefault()})},We=function(){var e=Ct.emoticons,t=Ct.emoticonsRoot||"";e&&(wt=o({},e.more,e.dropdown,e.hidden)),r(wt,function(e,n){wt[e]=ke("emoticon",{key:e,url:t+(n.url||n),tooltip:n.tooltip||e}),Ct.emoticonsEnabled&&vt.push(c("img",{src:t+(n.url||n)}))})},rt=function(){var e,t,n=v.firstChild,o=!!Ct.autofocusEnd;if(O(a)){if(mt.sourceMode())return t=o?S.value.length:0,void S.setSelectionRange(t,t);if(Y(v),o)for((n=v.lastChild)||(n=c("p",{},E),f(v,n));n.lastChild;)n=n.lastChild,!He&&k(n,"br")&&n.previousSibling&&(n=n.previousSibling);e=E.createRange(),W(n)?e.selectNodeContents(n):(e.setStartBefore(n),o&&e.setStartAfter(n)),e.collapse(!o),$.selectRange(e),Z=e,o&&(v.scrollTop=v.scrollHeight),mt.focus()}},mt.readOnly=function(e){return"boolean"!=typeof e?!S.readonly:(v.contentEditable=!e,S.readonly=!e,Ze(e),mt)},mt.rtl=function(e){var t=e?"rtl":"ltr";return"boolean"!=typeof e?"rtl"===h(S,"dir"):(h(v,"dir",t),h(S,"dir",t),R(a,"rtl"),R(a,"ltr"),N(a,t),Ee&&Ee.rtl&&Ee.rtl(e),mt)},Ze=function(e){var t=mt.inSourceMode()?"_sceTxtMode":"_sceWysiwygMode";r(xt,function(n,o){F(o,"disabled",e||!o[t])})},mt.width=function(e,t){return e||0===e?(mt.dimensions(e,null,t),mt):H(a)},mt.dimensions=function(e,t,n){return e=!(!e&&0!==e)&&e,t=!(!t&&0!==t)&&t,!1===e&&!1===t?{width:mt.width(),height:mt.height()}:(!1!==e&&(!1!==n&&(Ct.width=e),H(a,e)),!1!==t&&(!1!==n&&(Ct.height=t),_(a,t)),mt)},mt.height=function(e,t){return e||0===e?(mt.dimensions(null,e,t),mt):_(a)},mt.maximize=function(e){return ce(e)?M(a,"sceditor-maximize"):((e=!!e)&&(we=Ne.pageYOffset),F(Re.documentElement,"sceditor-maximize",e),F(Re.body,"sceditor-maximize",e),F(a,"sceditor-maximize",e),mt.width(e?"100%":Ct.width,!1),mt.height(e?"100%":Ct.height,!1),e||Ne.scrollTo(0,we),pt(),mt)},pt=function(){Ct.autoExpand&&!ve&&setTimeout(mt.expandToContent,200)},mt.expandToContent=function(e){if(!mt.maximize()){if(ve=!1,!he){var t=Ct.resizeMinHeight||Ct.height||_(gt);he={min:t,max:Ct.resizeMaxHeight||2*t}}var n=Re.createRange();n.selectNodeContents(v);var o=n.getBoundingClientRect(),i=E.documentElement.clientHeight,r=o.bottom-o.top,a=mt.height()+(r-i);e||-1===he.max||(a=Math.min(a,he.max)),mt.height(Math.ceil(Math.max(a,he.min)))}},mt.destroy=function(){if(K){K.destroy(),$=null,B=null,K=null,T&&d(T),g(Re,"click",Je);var e=gt.form;e&&(g(e,"reset",Ke),g(e,"submit",mt.updateOriginal)),d(S),d(l),d(a),delete gt._sceditor,b(gt),gt.required=ue}},mt.createDropDown=function(e,t,n,i){var a,l="sceditor-"+t;mt.closeDropDown(!0),T&&M(T,l)||(!1!==i&&r(p(n,":not(input):not(textarea)"),function(e,t){t.nodeType===de&&h(t,"unselectable","on")}),a=o({top:X(e).top,left:X(e).left,marginTop:e.clientHeight},Ct.dropDownCss),w(T=c("div",{className:"sceditor-dropdown "+l}),a),f(T,n),f(Re.body,T),m(T,"click focusin",function(e){e.stopPropagation()}),setTimeout(function(){if(T){var e=p(T,"input,textarea")[0];e&&e.focus()}}))},Je=function(e){3!==e.which&&T&&!e.defaultPrevented&&(ft(),mt.closeDropDown())},je=function(e){var t=Fe||ye,n=v,o=e.clipboardData;if(o&&!t){var i={},r=o.types,a=o.items;e.preventDefault();for(var c=0;c<r.length;c++){if(Ne.FileReader&&a&&_e.test(a[c].type))return function(e){var t=new FileReader;t.onload=function(e){qe({html:'<img src="'+e.target.result+'" />'})},t.readAsDataURL(e)}(o.items[c].getAsFile());i[r[c]]=o.getData(r[c])}i.text=i["text/plain"],i.html=i["text/html"],qe(i)}else if(!Ce){var l=n.scrollTop;for($.saveRange(),Ce=Re.createDocumentFragment();n.firstChild;)f(Ce,n.firstChild);setTimeout(function(){var e=n.innerHTML;n.innerHTML="",f(n,Ce),n.scrollTop=l,Ce=!1,$.restoreRange(),qe({html:e})},0)}},qe=function(e){var t=c("div",{},E);K.call("pasteRaw",e),e.html?(t.innerHTML=e.html,U(t)):t.innerHTML=J(e.text||"");var o={val:t.innerHTML};"fragmentToSource"in n&&(o.val=n.fragmentToSource(o.val,E,Q)),K.call("paste",o),"fragmentToHtml"in n&&(o.val=n.fragmentToHtml(o.val,Q)),K.call("pasteHtml",o),mt.wysiwygEditorInsertHtml(o.val,null,!0)},mt.closeDropDown=function(e){T&&(d(T),T=null),!0===e&&mt.focus()},mt.wysiwygEditorInsertHtml=function(e,t,n){var o,i,r,a=_(s);mt.focus(),!n&&u(G,"code")||($.insertHTML(e,t),$.saveRange(),Te(),b(o=p(v,"#sceditor-end-marker")[0]),i=v.scrollTop,r=X(o).top+1.5*o.offsetHeight-a,y(o),(r>i||r+a<i)&&(v.scrollTop=r),st(!1),$.restoreRange(),nt())},mt.wysiwygEditorInsertText=function(e,t){mt.wysiwygEditorInsertHtml(J(e),J(t))},mt.insertText=function(e,t){return mt.inSourceMode()?mt.sourceEditorInsertText(e,t):mt.wysiwygEditorInsertText(e,t),mt},mt.sourceEditorInsertText=function(e,t){var n,o,i=S.selectionStart,r=S.selectionEnd;n=S.scrollTop,S.focus(),o=S.value,t&&(e+=o.substring(i,r)+t),S.value=o.substring(0,i)+e+o.substring(r,o.length),S.selectionStart=i+e.length-(t?t.length:0),S.selectionEnd=S.selectionStart,S.scrollTop=n,S.focus(),st()},mt.getRangeHelper=function(){return $},mt.sourceEditorCaret=function(e){return S.focus(),e?(S.selectionStart=e.start,S.selectionEnd=e.end,this):{start:S.selectionStart,end:S.selectionEnd}},mt.val=function(e,t){return ae(e)?(mt.inSourceMode()?mt.setSourceEditorValue(e):(!1!==t&&"toHtml"in n&&(e=n.toHtml(e)),mt.setWysiwygEditorValue(e)),mt):mt.inSourceMode()?mt.getSourceEditorValue(!1):mt.getWysiwygEditorValue(t)},mt.insert=function(e,t,o,i,r){if(mt.inSourceMode())return mt.sourceEditorInsertText(e,t),mt;if(t){var a=$.selectedHtml();!1!==o&&"fragmentToSource"in n&&(a=n.fragmentToSource(a,E,Q)),e+=a+t}return!1!==o&&"fragmentToHtml"in n&&(e=n.fragmentToHtml(e,Q)),!1!==o&&!0===r&&(e=e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")),mt.wysiwygEditorInsertHtml(e),mt},mt.getWysiwygEditorValue=function(e){for(var t,o=c("div",{},E),i=v.childNodes,r=0;r<i.length;r++)f(o,i[r].cloneNode(!0));return f(v,o),U(o),d(o),t=o.innerHTML,!1!==e&&n.hasOwnProperty("toSource")&&(t=n.toSource(t,E)),t},mt.getBody=function(){return v},mt.getContentAreaContainer=function(){return s},mt.getSourceEditorValue=function(e){var t=S.value;return!1!==e&&"toHtml"in n&&(t=n.toHtml(t)),t},mt.setWysiwygEditorValue=function(e){e||(e="<p>"+(Fe?"":"<br />")+"</p>"),v.innerHTML=e,Te(),nt(),st(),pt()},mt.setSourceEditorValue=function(e){S.value=e,st()},mt.updateOriginal=function(){gt.value=mt.val()},Te=function(){Ct.emoticonsEnabled&&oe(v,wt,Ct.emoticonsCompat)},mt.inSourceMode=function(){return M(a,"sourceMode")},mt.sourceMode=function(e){var t=mt.inSourceMode();return"boolean"!=typeof e?t:((t&&!e||!t&&e)&&mt.toggleSourceMode(),mt)},mt.toggleSourceMode=function(){var e=mt.inSourceMode();!xe&&e||(e||($.saveRange(),$.clear()),mt.blur(),e?mt.setWysiwygEditorValue(mt.getSourceEditorValue()):mt.setSourceEditorValue(mt.getWysiwygEditorValue()),B=null,x(S),x(s),F(a,"wysiwygMode",e),F(a,"sourceMode",!e),Ze(),et())},tt=function(){return S.focus(),S.value.substring(S.selectionStart,S.selectionEnd)},Me=function(e,t){mt.inSourceMode()?t.txtExec&&(Array.isArray(t.txtExec)?mt.sourceEditorInsertText.apply(mt,t.txtExec):t.txtExec.call(mt,e,tt())):t.exec&&(le(t.exec)?t.exec.call(mt,e):mt.execCommand(t.exec,t.hasOwnProperty("execParam")?t.execParam:null))},ze=function(){Fe&&(B=$.selectedRange())},mt.execCommand=function(e,t){var n=!1,o=mt.commands[e];if(mt.focus(),!u($.parentNode(),"code")){try{n=E.execCommand(e,!1,t)}catch(e){}!n&&o&&o.errorMessage&&alert(mt._(o.errorMessage)),et()}},ot=function(){function e(){if($&&!$.compare(Z)){if((Z=$.cloneSelected())&&Z.collapsed){var e=Z.startContainer,t=Z.startOffset;for(t&&e.nodeType!==fe&&(e=e.childNodes[t]);e&&e.parentNode!==v;)e=e.parentNode;e&&j(e,!0)&&($.saveRange(),ie(v,E),$.restoreRange())}z(a,"selectionchanged")}se=!1}se||(se=!0,"onselectionchange"in E?e():setTimeout(e,100))},it=function(){var e,t=$.parentNode();Q!==t&&(e=Q,Q=t,G=$.getFirstBlockParent(t),z(a,"nodechanged",{oldNode:e,newNode:Q}))},mt.currentNode=function(){return Q},mt.currentBlockNode=function(){return G},et=function(){var e,t,n=E,o=mt.sourceMode();if(mt.readOnly())r(p(l,"active"),function(e,t){R(t,"active")});else{o||(t=$.parentNode(),e=$.getFirstBlockParent(t));for(var i=0;i<yt.length;i++){var a=0,c=xt[yt[i].name],s=yt[i].state,u=o&&!c._sceTxtMode||!o&&!c._sceWysiwygMode;if(ae(s)){if(!o)try{(a=n.queryCommandEnabled(s)?0:-1)>-1&&(a=n.queryCommandState(s)?1:0)}catch(e){}}else u||(a=s.call(mt,t,e));F(c,"disabled",u||a<0),F(c,"active",a>0)}Ee&&Ee.update&&Ee.update(o,t,e)}},Ye=function(e){if(!e.defaultPrevented&&(mt.closeDropDown(),13===e.which)){if(!k(G,"li,ul,ol")&&P(G)){B=null;var t=c("br",{},E);if($.insertNode(t),!He){var n=t.parentNode,o=n.lastChild;o&&o.nodeType===fe&&""===o.nodeValue&&(d(o),o=n.lastChild),!j(n,!0)&&o===t&&j(t.previousSibling)&&$.insertHTML("<br>")}e.preventDefault()}}},nt=function(){I(v,function(e){if(e.nodeType===de&&!/inline/.test(w(e,"display"))&&!k(e,".sceditor-nlf")&&P(e)){var t=c("p",{},E);return t.className="sceditor-nlf",t.innerHTML=He?"":"<br />",f(v,t),!1}if(3===e.nodeType&&!/^\s*$/.test(e.nodeValue)||k(e,"br"))return!1})},Ke=function(){mt.val(gt.value)},Xe=function(){mt.closeDropDown(),B=null},mt._=function(){var e=arguments;return q&&q[e[0]]&&(e[0]=q[e[0]]),e[0].replace(/\{(\d+)\}/g,function(t,n){return void 0!==e[n-0+1]?e[n-0+1]:"{"+n+"}"})},Ge=function(e){K&&K.call(e.type+"Event",e,mt);var t=(e.target===S?"scesrc":"scewys")+e.type;ht[t]&&ht[t].forEach(function(t){t.call(mt,e)})},mt.bind=function(e,t,n,o){for(var i=(e=e.split(" ")).length;i--;)if(le(t)){var r="scewys"+e[i],a="scesrc"+e[i];n||(ht[r]=ht[r]||[],ht[r].push(t)),o||(ht[a]=ht[a]||[],ht[a].push(t)),"valuechanged"===e[i]&&(st.hasHandler=!0)}return mt},mt.unbind=function(e,t,n,o){for(var r=(e=e.split(" ")).length;r--;)le(t)&&(n||i(ht["scewys"+e[r]]||[],t),o||i(ht["scesrc"+e[r]]||[],t));return mt},mt.blur=function(e,t,n){return le(e)?mt.bind("blur",e,t,n):mt.sourceMode()?S.blur():v.blur(),mt},mt.focus=function(e,t,n){if(le(e))mt.bind("focus",e,t,n);else if(mt.inSourceMode())S.focus();else{if(p(E,":focus").length)return;var o,i=$.selectedRange();Z||rt(),!He&&i&&1===i.endOffset&&i.collapsed&&(o=i.endContainer)&&1===o.childNodes.length&&k(o.firstChild,"br")&&(i.setStartBefore(o.firstChild),i.collapse(!0),$.selectRange(i)),s.contentWindow.focus(),v.focus(),B&&($.selectRange(B),B=null)}return et(),mt},mt.keyDown=function(e,t,n){return mt.bind("keydown",e,t,n)},mt.keyPress=function(e,t,n){return mt.bind("keypress",e,t,n)},mt.keyUp=function(e,t,n){return mt.bind("keyup",e,t,n)},mt.nodeChanged=function(e){return mt.bind("nodechanged",e,!1,!0)},mt.selectionChanged=function(e){return mt.bind("selectionchanged",e,!1,!0)},mt.valueChanged=function(e,t,n){return mt.bind("valuechanged",e,t,n)},at=function(e){var t=0,n=mt.emoticonsCache,o=String.fromCharCode(e.which);u(G,"code")||(n||(n=[],r(wt,function(e,o){n[t++]=[e,o]}),n.sort(function(e,t){return e[0].length-t[0].length}),mt.emoticonsCache=n,mt.longestEmoticonCode=n[n.length-1][0].length),$.replaceKeyword(mt.emoticonsCache,!0,!0,mt.longestEmoticonCode,Ct.emoticonsCompat,o)&&(Ct.emoticonsCompat&&/^\s$/.test(o)||e.preventDefault()))},ct=function(){ne(G,$)},mt.emoticons=function(e){return e||!1===e?(Ct.emoticonsEnabled=e,e?(m(v,"keypress",at),mt.sourceMode()||($.saveRange(),Te(),st(!1),$.restoreRange())):(r(p(v,"img[data-sceditor-emoticon]"),function(e,t){var n=C(t,"sceditor-emoticon"),o=E.createTextNode(n);t.parentNode.replaceChild(o,t)}),g(v,"keypress",at),st()),mt):Ct.emoticonsEnabled},mt.css=function(e){return me||(me=c("style",{id:"inline"},E),f(E.head,me)),ae(e)?(me.styleSheet?me.styleSheet.cssText=e:me.innerHTML=e,mt):me.styleSheet?me.styleSheet.cssText:me.innerHTML},Ue=function(e){var t=[],n={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|","[":"{","]":"}"},o={8:"backspace",9:"tab",13:"enter",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",91:"win",92:"win",93:"select",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={109:"-",110:"del",111:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},r=e.which,a=o[r]||String.fromCharCode(r).toLowerCase();(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&(t.push("shift"),i[r]?a=i[r]:n[a]&&(a=n[a])),a&&(r<16||r>18)&&t.push(a),t=t.join("+"),bt[t]&&!1===bt[t].call(mt)&&(e.stopPropagation(),e.preventDefault())},mt.addShortcut=function(e,t){return e=e.toLowerCase(),ae(t)?bt[e]=function(){return Me(xt[t],mt.commands[t]),!1}:bt[e]=t,mt},mt.removeShortcut=function(e){return delete bt[e.toLowerCase()],mt},$e=function(e){var t,n,o;if(!Ct.disableBlockRemove&&8===e.which&&(n=$.selectedRange())&&(t=n.startContainer,0===n.startOffset&&(o=lt())&&!k(o,"body"))){for(;t!==o;){for(;t.previousSibling;)if((t=t.previousSibling).nodeType!==fe||t.nodeValue)return;if(!(t=t.parentNode))return}mt.clearBlockFormatting(o),e.preventDefault()}},lt=function(){for(var e=G;!P(e)||j(e,!0);)if(!(e=e.parentNode)||k(e,"body"))return;return e},mt.clearBlockFormatting=function(e){return!(e=e||lt())||k(e,"body")?mt:($.saveRange(),e.className="",B=null,h(e,"style",""),k(e,"p,div,td")||V(e,"p"),$.restoreRange(),mt)},st=function(e){if(K&&(K.hasHandler("valuechangedEvent")||st.hasHandler)){var t,n=mt.sourceMode(),o=!n&&$.hasSelection();A=!1,e=!1!==e&&!E.getElementById("sceditor-start-marker"),L&&(clearTimeout(L),L=!1),o&&e&&$.saveRange(),(t=n?S.value:v.innerHTML)!==st.lastVal&&(st.lastVal=t,z(a,"valuechanged",{rawValue:n?mt.val():t})),o&&e&&$.removeMarkers()}},ut=function(){L&&st()},dt=function(e){var t=e.which,n=dt.lastChar,o=13===n||32===n,i=8===n||46===n;dt.lastChar=t,A||(13===t||32===t?o?dt.triggerNext=!0:st():8===t||46===t?i?dt.triggerNext=!0:st():dt.triggerNext&&(st(),dt.triggerNext=!1),clearTimeout(L),L=setTimeout(function(){A||st()},1500))},Qe=function(e){(A=/start/i.test(e.type))||st()},ft=function(){mt.updateOriginal()},De()}e=e&&e.hasOwnProperty("default")?e.default:e;var ae=t.bind(null,"string"),ce=t.bind(null,"undefined"),le=t.bind(null,"function"),se=t.bind(null,"number"),ue={},de=1,fe=3,pe=!0,me="|body|hr|p|div|h1|h2|h3|h4|h5|h6|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|blockquote|center|",ge={toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,paste,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,image,email,link,unlink|emoticon,youtube,date,time|ltr,rtl|print,maximize,source",toolbarExclude:null,style:"jquery.sceditor.default.css",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",colors:"#000000,#44B8FF,#1E92F7,#0074D9,#005DC2,#00369B,#b3d5f4|#444444,#C3FFFF,#9DF9FF,#7FDBFF,#68C4E8,#419DC1,#d9f4ff|#666666,#72FF84,#4CEA5E,#2ECC40,#17B529,#008E02,#c0f0c6|#888888,#FFFF44,#FFFA1E,#FFDC00,#E8C500,#C19E00,#fff5b3|#aaaaaa,#FFC95F,#FFA339,#FF851B,#E86E04,#C14700,#ffdbbb|#cccccc,#FF857A,#FF5F54,#FF4136,#E82A1F,#C10300,#ffc6c3|#eeeeee,#FF56FF,#FF30DC,#F012BE,#D900A7,#B20080,#fbb8ec|#ffffff,#F551FF,#CF2BE7,#B10DC9,#9A00B2,#9A00B2,#e8b6ef",locale:h(document.documentElement,"lang")||"en",charset:"utf-8",emoticonsCompat:!1,emoticonsEnabled:!0,emoticonsRoot:"",emoticons:{dropdown:{":)":"emoticons/smile.png",":angel:":"emoticons/angel.png",":angry:":"emoticons/angry.png","8-)":"emoticons/cool.png",":'(":"emoticons/cwy.png",":ermm:":"emoticons/ermm.png",":D":"emoticons/grin.png","<3":"emoticons/heart.png",":(":"emoticons/sad.png",":O":"emoticons/shocked.png",":P":"emoticons/tongue.png",";)":"emoticons/wink.png"},more:{":alien:":"emoticons/alien.png",":blink:":"emoticons/blink.png",":blush:":"emoticons/blush.png",":cheerful:":"emoticons/cheerful.png",":devil:":"emoticons/devil.png",":dizzy:":"emoticons/dizzy.png",":getlost:":"emoticons/getlost.png",":happy:":"emoticons/happy.png",":kissing:":"emoticons/kissing.png",":ninja:":"emoticons/ninja.png",":pinch:":"emoticons/pinch.png",":pouty:":"emoticons/pouty.png",":sick:":"emoticons/sick.png",":sideways:":"emoticons/sideways.png",":silly:":"emoticons/silly.png",":sleeping:":"emoticons/sleeping.png",":unsure:":"emoticons/unsure.png",":woot:":"emoticons/w00t.png",":wassat:":"emoticons/wassat.png"},hidden:{":whistling:":"emoticons/whistling.png",":love:":"emoticons/wub.png"}},width:null,height:null,resizeEnabled:!0,resizeMinWidth:null,resizeMinHeight:null,resizeMaxHeight:null,resizeMaxWidth:null,resizeHeight:!0,resizeWidth:!0,dateFormat:"year-month-day",toolbarContainer:null,enablePasteFiltering:!1,disablePasting:!1,readOnly:!1,rtl:!1,autofocus:!1,autofocusEnd:!0,autoExpand:!1,autoUpdate:!1,spellcheck:!0,runWithoutWysiwygSupport:!1,startInSourceMode:!1,id:null,plugins:"",zIndex:null,bbcodeTrim:!1,disableBlockRemove:!1,parserOptions:{},dropDownCss:{}},he=navigator.userAgent,ve=function(){var e=3,t=document,n=t.createElement("div"),o=n.getElementsByTagName("i");do{n.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(o[0]);return t.documentMode&&t.all&&window.atob&&(e=10),4===e&&t.documentMode&&(e=11),e>4?e:void 0}(),ye="-ms-ime-align"in document.documentElement.style,be=/iPhone|iPod|iPad| wosbrowser\//i.test(he),xe=function(){var e,t,n=document.createElement("div");return n.contentEditable=!0,"contentEditable"in document.documentElement&&"true"===n.contentEditable&&(t=/Opera Mobi|Opera Mini/i.test(he),/Android/i.test(he)&&(t=!0,/Safari/.test(he)&&(t=!(e=/Safari\/(\d+)/.exec(he))||!e[1]||e[1]<534)),/ Silk\//i.test(he)&&(t=!(e=/AppleWebKit\/(\d+)/.exec(he))||!e[1]||e[1]<534),be&&(t=/OS [0-4](_\d)+ like Mac/i.test(he)),/Firefox/i.test(he)&&(t=!1),/OneBrowser/i.test(he)&&(t=!1),"UCWEB"===navigator.vendor&&(t=!1),ve<=9&&(t=!0),!t)}(),we=/^(https?|s?ftp|mailto|spotify|skype|ssh|teamspeak|tel):|(\/\/)|data:image\/(png|bmp|gif|p?jpe?g);/i,Ce={html:'<!DOCTYPE html><html{attrs}><head><style>.ie * {min-height: auto !important} .ie table td {height:15px} @supports (-ms-ime-align:auto) { * { min-height: auto !important; } }</style><meta http-equiv="Content-Type" content="text/html;charset={charset}" /><link rel="stylesheet" type="text/css" href="{style}" /></head><body contenteditable="true" {spellcheck}><p></p></body></html>',toolbarButton:'<a class="sceditor-button sceditor-button-{name}" data-sceditor-command="{name}" unselectable="on"><div unselectable="on">{dispName}</div></a>',emoticon:'<img src="{url}" data-sceditor-emoticon="{key}" alt="{key}" title="{tooltip}" />',fontOpt:'<a class="sceditor-font-option" href="#" data-font="{font}"><font face="{font}">{font}</font></a>',sizeOpt:'<a class="sceditor-fontsize-option" data-size="{size}" href="#"><font size="{size}">{size}</font></a>',pastetext:'<div><label for="txt">{label}</label> <textarea cols="20" rows="7" id="txt"></textarea></div><div><input type="button" class="button" value="{insert}" /></div>',table:'<div><label for="rows">{rows}</label><input type="text" id="rows" value="2" /></div><div><label for="cols">{cols}</label><input type="text" id="cols" value="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',image:'<div><label for="link">{url}</label> <input type="text" id="image" placeholder="https://" /></div><div><label for="width">{width}</label> <input type="text" id="width" size="2" /></div><div><label for="height">{height}</label> <input type="text" id="height" size="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',email:'<div><label for="email">{label}</label> <input type="text" id="email" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{insert}" /></div>',link:'<div><label for="link">{url}</label> <input type="text" id="link" placeholder="https://" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{ins}" /></div>',youtubeMenu:'<div><label for="link">{label}</label> <input type="text" id="link" placeholder="https://" /></div><div><input type="button" class="button" value="{insert}" /></div>',youtube:'<iframe width="560" height="315" frameborder="0" allowfullscreensrc="https://www.youtube.com/embed/{id}?wmode=opaque&start={time}" data-youtube-id="{id}"></iframe>'},ke=function(e,t,n){var o=Ce[e];return Object.keys(t).forEach(function(e){o=o.replace(new RegExp(G("{"+e+"}"),"g"),t[e])}),n&&(o=L(o)),o},Ee=ve&&ve<11,Se={bold:{exec:"bold",tooltip:"Bold",shortcut:"Ctrl+B"},italic:{exec:"italic",tooltip:"Italic",shortcut:"Ctrl+I"},underline:{exec:"underline",tooltip:"Underline",shortcut:"Ctrl+U"},strike:{exec:"strikethrough",tooltip:"Strikethrough"},subscript:{exec:"subscript",tooltip:"Subscript"},superscript:{exec:"superscript",tooltip:"Superscript"},left:{exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(e,t,n){var o=c("div");m(o,"click","a",function(t){n(C(this,"font")),e.closeDropDown(!0),t.preventDefault()}),e.opts.fonts.split(",").forEach(function(e){f(o,ke("fontOpt",{font:e},!0))}),e.createDropDown(t,"font-picker",o)},exec:function(e){var t=this;Se.font._dropDown(t,e,function(e){t.execCommand("fontname",e)})},tooltip:"Font Name"},size:{_dropDown:function(e,t,n){var o=c("div");m(o,"click","a",function(t){n(C(this,"size")),e.closeDropDown(!0),t.preventDefault()});for(var i=1;i<=7;i++)f(o,ke("sizeOpt",{size:i},!0));e.createDropDown(t,"fontsize-picker",o)},exec:function(e){var t=this;Se.size._dropDown(t,e,function(e){t.execCommand("fontsize",e)})},tooltip:"Font Size"},color:{_dropDown:function(e,t,n){var o=c("div"),i="",r=Se.color;r._htmlCache||(e.opts.colors.split("|").forEach(function(e){i+='<div class="sceditor-color-column">',e.split(",").forEach(function(e){i+='<a href="#" class="sceditor-color-option" style="background-color: '+e+'" data-color="'+e+'"></a>'}),i+="</div>"}),r._htmlCache=i),f(o,L(r._htmlCache)),m(o,"click","a",function(t){n(C(this,"color")),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"color-picker",o)},exec:function(e){var t=this;Se.color._dropDown(t,e,function(e){t.execCommand("forecolor",e)})},tooltip:"Font Color"},removeformat:{exec:"removeformat",tooltip:"Remove Formatting"},cut:{exec:"cut",tooltip:"Cut",errorMessage:"Your browser does not allow the cut command. Please use the keyboard shortcut Ctrl/Cmd-X"},copy:{exec:"copy",tooltip:"Copy",errorMessage:"Your browser does not allow the copy command. Please use the keyboard shortcut Ctrl/Cmd-C"},paste:{exec:"paste",tooltip:"Paste",errorMessage:"Your browser does not allow the paste command. Please use the keyboard shortcut Ctrl/Cmd-V"},pastetext:{exec:function(e){var t,n=c("div"),o=this;f(n,ke("pastetext",{label:o._("Paste your text inside the following box:"),insert:o._("Insert")},!0)),m(n,"click",".button",function(e){(t=p(n,"#txt")[0].value)&&o.wysiwygEditorInsertText(t),o.closeDropDown(!0),e.preventDefault()}),o.createDropDown(e,"pastetext",n)},tooltip:"Paste Text"},bulletlist:{exec:function(){Z(this),this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){Z(this),this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(e,t){var n,o,i,r=l(t,"ul,ol,menu");return r.length>1&&r[0].children.length>1?0:k(t,"ul,ol,menu")&&(n=this.getRangeHelper().selectedRange(),o=n.startContainer.parentNode,i=n.endContainer.parentNode,o!==o.parentNode.firstElementChild||k(i,"li")&&i!==i.parentNode.lastElementChild)?0:-1},exec:function(){var e=this,t=e.getRangeHelper().getFirstBlockParent();e.focus(),l(t,"ul,ol,menu")&&e.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(e,t){return u(t,"ul,ol,menu")>0?0:-1},exec:function(){l(this.getRangeHelper().getFirstBlockParent(),"ul,ol,menu")&&this.execCommand("outdent")},tooltip:"Remove one indent"},table:{exec:function(e){var t=this,n=c("div");f(n,ke("table",{rows:t._("Rows:"),cols:t._("Cols:"),insert:t._("Insert")},!0)),m(n,"click",".button",function(e){var o=Number(p(n,"#rows")[0].value),i=Number(p(n,"#cols")[0].value),r="<table>";o>0&&i>0&&(r+=Array(o+1).join("<tr>"+Array(i+1).join("<td>"+(Ee?"":"<br />")+"</td>")+"</tr>"),r+="</table>",t.wysiwygEditorInsertHtml(r),t.closeDropDown(!0),e.preventDefault())}),t.createDropDown(e,"inserttable",n)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("<code>",(Ee?"":"<br />")+"</code>")},tooltip:"Code"},image:{_dropDown:function(e,t,n,o){var i=c("div");f(i,ke("image",{url:e._("URL:"),width:e._("Width (optional):"),height:e._("Height (optional):"),insert:e._("Insert")},!0));var r=p(i,"#image")[0];r.value=n,m(i,"click",".button",function(t){r.value&&o(r.value,p(i,"#width")[0].value,p(i,"#height")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertimage",i)},exec:function(e){var t=this;Se.image._dropDown(t,e,"",function(e,n,o){var i="";n&&(i+=' width="'+n+'"'),o&&(i+=' height="'+o+'"'),t.wysiwygEditorInsertHtml("<img"+i+' src="'+e+'" />')})},tooltip:"Insert an image"},email:{_dropDown:function(e,t,n){var o=c("div");f(o,ke("email",{label:e._("E-mail:"),desc:e._("Description (optional):"),insert:e._("Insert")},!0)),m(o,"click",".button",function(t){var i=p(o,"#email")[0].value;i&&n(i,p(o,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertemail",o)},exec:function(e){var t=this;Se.email._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?t.wysiwygEditorInsertHtml('<a href="mailto:'+e+'">'+(n||e)+"</a>"):t.execCommand("createlink","mailto:"+e)})},tooltip:"Insert an email"},link:{_dropDown:function(e,t,n){function o(t){r.value&&n(r.value,p(i,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}var i=c("div");f(i,ke("link",{url:e._("URL:"),desc:e._("Description (optional):"),ins:e._("Insert")},!0));var r=p(i,"#link")[0];m(i,"click",".button",o),m(i,"keypress",function(e){13===e.which&&r.value&&o(e)},pe),e.createDropDown(t,"insertlink",i)},exec:function(e){var t=this;Se.link._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?(n=n||e,t.wysiwygEditorInsertHtml('<a href="'+e+'">'+n+"</a>")):t.execCommand("createlink",e)})},tooltip:"Insert a link"},unlink:{state:function(){return u(this.currentNode(),"a")?0:-1},exec:function(){var e=u(this.currentNode(),"a");if(e){for(;e.firstChild;)D(e.firstChild,e);d(e)}},tooltip:"Unlink"},quote:{exec:function(e,t,n){var o="<blockquote>",i="</blockquote>";t?(o=o+(n=n?"<cite>"+n+"</cite>":"")+t+i,i=null):""===this.getRangeHelper().selectedHtml()&&(i=(Ee?"":"<br />")+i),this.wysiwygEditorInsertHtml(o,i)},tooltip:"Insert a Quote"},emoticon:{exec:function(e){var t=this,n=function(i){var a,l=t.opts.emoticonsCompat,s=t.getRangeHelper(),u=l&&" "!==s.getOuterText(!0,1)?" ":"",d=l&&" "!==s.getOuterText(!1,1)?" ":"",p=c("div"),g=c("div"),v=0,y=o({},t.opts.emoticons.dropdown,i?t.opts.emoticons.more:{});return f(p,g),v=Math.sqrt(Object.keys(y).length),m(p,"click","img",function(e){t.insert(u+h(this,"alt")+d,null,!1).closeDropDown(!0),e.preventDefault()}),r(y,function(e,t){f(g,c("img",{src:t.url||t,alt:e,title:t.tooltip||e})),g.children.length>=v&&(g=c("div"),f(p,g))}),!i&&t.opts.emoticons.more&&(f(a=c("a",{className:"sceditor-more"}),document.createTextNode(t._("More"))),m(a,"click",function(o){t.createDropDown(e,"more-emoticons",n(!0)),o.preventDefault()}),f(p,a)),p};t.createDropDown(e,"emoticons",n(!1))},txtExec:function(e){Se.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(e,t,n){var o=c("div");f(o,ke("youtubeMenu",{label:e._("Video URL:"),insert:e._("Insert")},!0)),m(o,"click",".button",function(t){var i=p(o,"#link")[0].value,a=i.match(/(?:v=|v\/|embed\/|youtu.be\/)(.{11})/),c=i.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/),l=0;c&&r(c[1].split(/[hms]/),function(e,t){""!==t&&(l=60*l+Number(t))}),a&&/^[a-zA-Z0-9_\-]{11}$/.test(a[1])&&n(a[1],l),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertlink",o)},exec:function(e){var t=this;Se.youtube._dropDown(t,e,function(e,n){t.wysiwygEditorInsertHtml(ke("youtube",{id:e,time:n}))})},tooltip:"Insert a YouTube video"},date:{_date:function(e){var t=new Date,n=t.getYear(),o=t.getMonth()+1,i=t.getDate();return n<2e3&&(n=1900+n),o<10&&(o="0"+o),i<10&&(i="0"+i),e.opts.dateFormat.replace(/year/i,n).replace(/month/i,o).replace(/day/i,i)},exec:function(){this.insertText(Se.date._date(this))},txtExec:function(){this.insertText(Se.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var e=new Date,t=e.getHours(),n=e.getMinutes(),o=e.getSeconds();return t<10&&(t="0"+t),n<10&&(n="0"+n),o<10&&(o="0"+o),t+":"+n+":"+o},exec:function(){this.insertText(Se.time._time())},txtExec:function(){this.insertText(Se.time._time())},tooltip:"Insert current time"},ltr:{state:function(e,t){return t&&"ltr"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!k(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!k(n,"body")))&&w(n,"direction","ltr"===w(n,"direction")?"":"ltr")},tooltip:"Left-to-Right"},rtl:{state:function(e,t){return t&&"rtl"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!k(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!k(n,"body")))&&w(n,"direction","rtl"===w(n,"direction")?"":"rtl")},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize())},txtExec:function(){this.maximize(!this.maximize())},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode()},txtExec:function(){this.toggleSourceMode()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}},De={};ee.plugins=De;var Te=ve&&ve<11,Me=function(e,t,n){var o,i,r,a,c,l="",s=e.startContainer,u=e.startOffset;for(s&&3!==s.nodeType&&(s=s.childNodes[u],u=0),r=a=u;n>l.length&&s&&3===s.nodeType;)o=s.nodeValue,i=n-l.length,c&&(a=o.length,r=0),c=s,t?(u=r=Math.max(a-i,0),l=o.substr(r,a-r)+l,s=c.previousSibling):(u=r+(a=Math.min(i,o.length)),l+=o.substr(r,a),s=c.nextSibling);return{node:c||s,offset:u,text:l}},Ne=window,Re=document,Fe=ve,He=Fe&&Fe<11,_e=/^image\/(p?jpe?g|gif|png|bmp)$/i;re.locale={},re.formats={},re.icons={},re.command={get:function(e){return Se[e]||null},set:function(e,t){return!(!e||!t)&&(t=o(Se[e]||{},t),t.remove=function(){re.command.remove(e)},Se[e]=t,this)},remove:function(e){return Se[e]&&delete Se[e],this}},window.sceditor={command:re.command,commands:Se,defaultOptions:ge,ie:ve,ios:be,isWysiwygSupported:xe,regexEscape:G,escapeEntities:J,escapeUriScheme:function(e){var t,n=/^[^\/]*:/i,o=window.location;return e&&n.test(e)&&!we.test(e)?((t=o.pathname.split("/")).pop(),o.protocol+"//"+o.host+t.join("/")+"/"+e):e},dom:{css:w,attr:h,removeAttr:v,is:k,closest:u,width:H,height:_,traverse:A,rTraverse:I,parseHTML:L,hasStyling:P,convertElement:V,blockLevelList:me,canHaveChildren:W,isInline:j,copyCSS:q,fixNesting:U,findCommonAncestor:function(e,t){for(;e=e.parentNode;)if(E(e,t))return e},getSibling:$,removeWhiteSpace:Y,extractContents:K,getOffset:X,getStyle:Q,hasStyle:function(e,t,n){var o=Q(e,t);return!!o&&(!n||o===n||Array.isArray(n)&&n.indexOf(o)>-1)}},locale:re.locale,icons:re.icons,utils:{each:r,isEmptyObject:n,extend:o},plugins:ee.plugins,formats:re.formats,create:function(e,t){t=t||{},s(e,".sceditor-container")||(t.runWithoutWysiwygSupport||xe)&&new re(e,t)},instance:function(e){return e._sceditor}},e.sceditor=window.sceditor,e.fn.sceditor=function(t){var n,o=[];return this.each(function(){n=this._sceditor,"state"===t?o.push(!!n):"instance"===t?o.push(n):n||e.sceditor.create(this,t)}),o.length?1===o.length?o[0]:o:this}}(jQuery); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(e){"use strict";function t(e,t){return typeof t===e}function n(e){return!Object.keys(e).length}function o(e,t){for(var n=e===!!e,i=n?2:1,r=n?t:e,a=!!n&&e;i<arguments.length;i++){var l=arguments[i];for(var c in l){var s=l[c];if(!le(s)){var u=null!==s&&"object"==typeof s,d=Array.isArray(s);r[c]=a&&(u||d)?o(!0,r[c]||(d?[]:{}),s):s}}}return r}function i(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}function r(e,t){if(Array.isArray(e)||"length"in e&&se(e.length))for(var n=0;n<e.length;n++)t(n,e[n]);else Object.keys(e).forEach(function(n){t(n,e[n])})}function a(e){return e=parseFloat(e),isFinite(e)?e:0}function l(e,t,n){var o=(n||document).createElement(e);return r(t||{},function(e,t){"style"===e?o.style.cssText=t:e in o?o[e]=t:o.setAttribute(e,t)}),o}function c(e,t){for(var n=[],o=e||{};(o=o.parentNode)&&!/(9|11)/.test(o.nodeType);)t&&!E(o,t)||n.push(o);return n}function s(e,t){for(var n=e||{};(n=n.parentNode)&&!/(9|11)/.test(n.nodeType);)if(!t||E(n,t))return n}function u(e,t){return E(e,t)?e:s(e,t)}function d(e){e.parentNode.removeChild(e)}function f(e,t){e.appendChild(t)}function p(e,t){return e.querySelectorAll(t)}function m(e,t,n,o,i){t.split(" ").forEach(function(t){var r;ae(n)?(r=o["_sce-event-"+t+n]||function(t){for(var i=t.target;i&&i!==e;){if(E(i,n))return void o.call(i,t);i=i.parentNode}},o["_sce-event-"+t+n]=r):(r=n,i=o),e.addEventListener(t,r,i||!1)})}function g(e,t,n,o,i){t.split(" ").forEach(function(t){var r;ae(n)?r=o["_sce-event-"+t+n]:(r=n,i=o),e.removeEventListener(t,r,i||!1)})}function h(e,t,n){if(arguments.length<3)return e.getAttribute(t);null==n?v(e,t):e.setAttribute(t,n)}function v(e,t){e.removeAttribute(t)}function y(e){w(e,"display","none")}function b(e){w(e,"display","")}function x(e){A(e)?y(e):b(e)}function w(e,t,n){if(arguments.length<3){if(ae(t))return getComputedStyle(e)[t];r(t,function(t,n){w(e,t,n)})}else{var o=(n||0===n)&&!isNaN(n);e.style[t]=o?n+"px":n}}function C(e,t,n){var o=arguments.length,i={};if(e.nodeType===de){if(1===o)return r(e.attributes,function(e,t){/^data\-/i.test(t.name)&&(i[t.name.substr(5)]=t.value)}),i;if(2===o)return h(e,"data-"+t);h(e,"data-"+t,String(n))}}function E(e,t){var n=!1;return e&&e.nodeType===de&&(n=(e.matches||e.msMatchesSelector||e.webkitMatchesSelector).call(e,t)),n}function k(e,t){return e!==t&&e.contains&&e.contains(t)}function S(e,t){var n=e.previousElementSibling;return t&&n?E(n,t)?n:null:n}function T(e,t){return t.parentNode.insertBefore(e,t)}function D(e){return e.className.trim().split(/\s+/)}function M(e,t){return E(e,"."+t)}function N(e,t){var n=D(e);n.indexOf(t)<0&&n.push(t),e.className=n.join(" ")}function R(e,t){var n=D(e);i(n,t),e.className=n.join(" ")}function H(e,t,n){(n=le(n)?!M(e,t):n)?N(e,t):R(e,t)}function F(e,t){if(le(t)){var n=getComputedStyle(e),o=a(n.paddingLeft)+a(n.paddingRight),i=a(n.borderLeftWidth)+a(n.borderRightWidth);return e.offsetWidth-o-i}w(e,"width",t)}function z(e,t){if(le(t)){var n=getComputedStyle(e),o=a(n.paddingTop)+a(n.paddingBottom),i=a(n.borderTopWidth)+a(n.borderBottomWidth);return e.offsetHeight-o-i}w(e,"height",t)}function _(e,t,n){var o;ce(window.CustomEvent)?o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(o=e.ownerDocument.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(o)}function A(e){return!!e.getClientRects().length}function O(e){return e.replace(/^-ms-/,"ms-").replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function B(e,t,n,o,i){for(e=i?e.lastChild:e.firstChild;e;){var r=i?e.previousSibling:e.nextSibling;if(!n&&!1===t(e)||!o&&!1===B(e,t,n,o,i)||n&&!1===t(e))return!1;e=r}}function I(e,t,n,o){B(e,t,n,o,!0)}function L(e,t){var n=(t=t||document).createDocumentFragment(),o=l("div",{},t);for(o.innerHTML=e;o.firstChild;)f(n,o.firstChild);return n}function V(e){return e&&(!E(e,"p,div")||e.className||h(e,"style")||!n(C(e)))}function P(e,t){var n=l(t,{},e.ownerDocument);for(r(e.attributes,function(e,t){try{h(n,t.name,t.value)}catch(e){}});e.firstChild;)f(n,e.firstChild);return e.parentNode.replaceChild(n,e),n}function W(e){return!!/11?|9/.test(e.nodeType)&&"|iframe|area|base|basefont|br|col|frame|hr|img|input|wbr|isindex|link|meta|param|command|embed|keygen|source|track|object|".indexOf("|"+e.nodeName.toLowerCase()+"|")<0}function j(e,t){var n,o=(e||{}).nodeType||fe;return o!==de?o===fe:"code"===(n=e.tagName.toLowerCase())?!t:me.indexOf("|"+n+"|")<0}function q(e,t){t.style.cssText=e.style.cssText+t.style.cssText}function U(e){var t=function(e){for(;j(e.parentNode,!0);)e=e.parentNode;return e};B(e,function(e){var n=!j(e,!0);if(n&&j(e.parentNode,!0)){var o=t(e),i=K(o,e),r=e;q(o,r),T(i,o),T(r,o)}if(n&&E(e,"ul,ol")&&E(e.parentNode,"ul,ol")){var a=S(e,"li");a||T(a=l("li"),e),f(a,e)}})}function $(e,t){return e?(t?e.previousSibling:e.nextSibling)||$(e.parentNode,t):null}function Y(e){var t,n,o,i,r,a,l,c=w(e,"whiteSpace"),s=/line$/i.test(c),u=e.firstChild;if(!/pre(\-wrap)?$/i.test(c))for(;u;){if(a=u.nextSibling,t=u.nodeValue,(n=u.nodeType)===de&&u.firstChild&&Y(u),n===fe){for(o=$(u),i=$(u,!0),l=!1;M(i,"sceditor-ignore");)i=$(i,!0);if(j(u)&&i){for(r=i;r.lastChild;)r=r.lastChild;l=r.nodeType===fe?/[\t\n\r ]$/.test(r.nodeValue):!j(r)}t=t.replace(/\u200B/g,""),i&&j(i)&&!l||(t=t.replace(s?/^[\t ]+/:/^[\t\n\r ]+/,"")),o&&j(o)||(t=t.replace(s?/[\t ]+$/:/[\t\n\r ]+$/,"")),t.length?u.nodeValue=t.replace(s?/[\t ]+/g:/[\t\n\r ]+/g," "):d(u)}u=a}}function K(e,t){var n=e.ownerDocument.createRange();return n.setStartBefore(e),n.setEndAfter(t),n.extractContents()}function X(e){for(var t=0,n=0;e;)t+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:t,top:n}}function Q(e,t){var n,o,i=e.style;if(ue[t]||(ue[t]=O(t)),t=ue[t],o=i[t],"textAlign"===t){if(n=i.direction,o=o||w(e,t),w(e.parentNode,t)===o||"block"!==w(e,"display")||E(e,"hr,th"))return"";if(/right/i.test(o)&&"rtl"===n||/left/i.test(o)&&"ltr"===n)return""}return o}function G(e){return e.replace(/([\-.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function J(e,t){if(!e)return e;var n={"&":"&","<":"<",">":">"," ":" ","\r\n":"<br />","\r":"<br />","\n":"<br />"};return!1!==t&&(n['"']=""",n["'"]="'",n["`"]="`"),e=e.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(e){return n[e]||e})}function Z(e){if("mozHidden"in document)for(var t,n=e.getBody();n;){if((t=n).firstChild)t=t.firstChild;else{for(;t&&!t.nextSibling;)t=t.parentNode;t&&(t=t.nextSibling)}3===n.nodeType&&/[\n\r\t]+/.test(n.nodeValue)&&(/^pre/.test(w(n.parentNode,"whiteSpace"))||d(n)),n=t}}function ee(e){var t=this,n=[],o=function(e){return"signal"+e.charAt(0).toUpperCase()+e.slice(1)},i=function(t,i){t=[].slice.call(t);var r,a,l=o(t.shift());for(r=0;r<n.length;r++)if(l in n[r]&&(a=n[r][l].apply(e,t),i))return a};t.call=function(){i(arguments,!1)},t.callOnlyFirst=function(){return i(arguments,!0)},t.hasHandler=function(e){var t=n.length;for(e=o(e);t--;)if(e in n[t])return!0;return!1},t.exists=function(e){return e in Te&&"function"==typeof(e=Te[e])&&"object"==typeof e.prototype},t.isRegistered=function(e){if(t.exists(e))for(var o=n.length;o--;)if(n[o]instanceof Te[e])return!0;return!1},t.register=function(o){return!(!t.exists(o)||t.isRegistered(o)||(o=new Te[o],n.push(o),"init"in o&&o.init.call(e),0))},t.deregister=function(o){var i,r=n.length,a=!1;if(!t.isRegistered(o))return a;for(;r--;)n[r]instanceof Te[o]&&(a=!0,"destroy"in(i=n.splice(r,1)[0])&&i.destroy.call(e));return a},t.destroy=function(){for(var t=n.length;t--;)"destroy"in n[t]&&n[t].destroy.call(e);n=[],e=null}}function te(e,t){var n,o,i=t||e.contentDocument||e.document,r="sceditor-start-marker",a="sceditor-end-marker",c=this;c.insertHTML=function(e,t){var n,o;if(!c.selectedRange())return!1;for(t&&(e+=c.selectedHtml()+t),o=l("p",{},i),n=i.createDocumentFragment(),o.innerHTML=e;o.firstChild;)f(n,o.firstChild);c.insertNode(n)},o=function(e,t,o){var s,u=i.createDocumentFragment();if("string"==typeof e?(t&&(e+=c.selectedHtml()+t),u=L(e)):(f(u,e),t&&(f(u,c.selectedRange().extractContents()),f(u,t))),s=u.lastChild){for(;!j(s.lastChild,!0);)s=s.lastChild;if(W(s)?s.lastChild||f(s,document.createTextNode("")):s=u,c.removeMarkers(),f(s,n(r)),f(s,n(a)),o){var d=l("div");return f(d,u),d.innerHTML}return u}},c.insertNode=function(e,t){var n=o(e,t),i=c.selectedRange(),r=i.commonAncestorContainer;if(!n)return!1;i.deleteContents(),r&&3!==r.nodeType&&!W(r)?T(n,r):i.insertNode(n),c.restoreRange()},c.cloneSelected=function(){var e=c.selectedRange();if(e)return e.cloneRange()},c.selectedRange=function(){var t,n,o=e.getSelection();if(o){if(o.getRangeAt&&o.rangeCount<=0){for(n=i.body;n.firstChild;)n=n.firstChild;(t=i.createRange()).setStartBefore(n),o.addRange(t)}return o.rangeCount>0&&(t=o.getRangeAt(0)),t}},c.hasSelection=function(){var t=e.getSelection();return t&&t.rangeCount>0},c.selectedHtml=function(){var e,t=c.selectedRange();return t?(e=l("p",{},i),f(e,t.cloneContents()),e.innerHTML):""},c.parentNode=function(){var e=c.selectedRange();if(e)return e.commonAncestorContainer},c.getFirstBlockParent=function(e){var t=function(e){return j(e,!0)&&(e=e?e.parentNode:null)?t(e):e};return t(e||c.parentNode())},c.insertNodeAt=function(e,t){var n=c.selectedRange(),o=c.cloneSelected();if(!o)return!1;o.collapse(e),o.insertNode(t),c.selectRange(n)},n=function(e){c.removeMarker(e);var t=l("span",{id:e,className:"sceditor-selection sceditor-ignore",style:"display:none;line-height:0"},i);return t.innerHTML=" ",t},c.insertMarkers=function(){var e=c.selectedRange(),t=n(r);c.removeMarkers(),c.insertNodeAt(!0,t),e&&e.collapsed?t.parentNode.insertBefore(n(a),t.nextSibling):c.insertNodeAt(!1,n(a))},c.getMarker=function(e){return i.getElementById(e)},c.removeMarker=function(e){var t=c.getMarker(e);t&&d(t)},c.removeMarkers=function(){c.removeMarker(r),c.removeMarker(a)},c.saveRange=function(){c.insertMarkers()},c.selectRange=function(t){var n,o=e.getSelection(),r=t.endContainer;if(!De&&t.collapsed&&r&&!j(r,!0)){for(n=r.lastChild;n&&E(n,".sceditor-ignore");)n=n.previousSibling;if(E(n,"br")){var a=i.createRange();a.setEndAfter(n),a.collapse(!1),c.compare(t,a)&&(t.setStartBefore(n),t.collapse(!0))}}o&&(c.clear(),o.addRange(t))},c.restoreRange=function(){var e,t=c.selectedRange(),n=c.getMarker(r),o=c.getMarker(a);if(!n||!o||!t)return!1;e=n.nextSibling===o,(t=i.createRange()).setStartBefore(n),t.setEndAfter(o),e&&t.collapse(!0),c.selectRange(t),c.removeMarkers()},c.selectOuterText=function(e,t){var n,o,i=c.cloneSelected();if(!i)return!1;i.collapse(!1),n=Me(i,!0,e),o=Me(i,!1,t),i.setStart(n.node,n.offset),i.setEnd(o.node,o.offset),c.selectRange(i)},c.getOuterText=function(e,t){var n=c.cloneSelected();return n?(n.collapse(!e),Me(n,e,t).text):""},c.replaceKeyword=function(e,t,n,o,i,r){n||e.sort(function(e,t){return e[0].length-t[0].length});var a,l,s,u,d,f,p,m,g=e.length,h=i?1:0,v=o||e[g-1][0].length;for(i&&v++,r=r||"",d=(a=c.getOuterText(!0,v)).length,a+=r,t&&(a+=c.getOuterText(!1,v));g--;)if(p=e[g][0],m=p.length,u=Math.max(0,d-m-h),s=-1,i?(l=a.substr(u).match(new RegExp("(^|[\\s ])"+G(p)+"(^|[\\s ])")))&&(s=l.index+u+l[1].length):s=a.indexOf(p,u),s>-1&&s<=d&&s+m+h>=d)return f=d-s,c.selectOuterText(f,m-f-(/^\S/.test(r)?1:0)),c.insertHTML(e[g][1]),!0;return!1},c.compare=function(e,t){return t||(t=c.selectedRange()),e&&t?0===e.compareBoundaryPoints(Range.END_TO_END,t)&&0===e.compareBoundaryPoints(Range.START_TO_START,t):!e&&!t},c.clear=function(){var t=e.getSelection();t&&(t.removeAllRanges?t.removeAllRanges():t.empty&&t.empty())}}function ne(e,t){var n=/[^\s\xA0\u2002\u2003\u2009\u00a0]+/,o=e&&p(e,"img[data-sceditor-emoticon]");if(e&&o.length)for(var i=0;i<o.length;i++){var r=o[i],a=r.parentNode,l=r.previousSibling,c=r.nextSibling;if(l&&n.test(l.nodeValue.slice(-1))||c&&n.test((c.nodeValue||"")[0])){var s=t.cloneSelected(),u=-1,f=s.startContainer,m=l.nodeValue;null===m&&(m=l.innerText||""),m+=C(r,"sceditor-emoticon"),f===c&&(u=m.length+s.startOffset),f===e&&e.childNodes[s.startOffset]===c&&(u=m.length),f===l&&(u=s.startOffset),c&&c.nodeType===fe||(c=a.insertBefore(a.ownerDocument.createTextNode(""),c)),c.insertData(0,m),d(l),d(r),u>-1&&(s.setStart(c,u),s.collapse(!0),t.selectRange(s))}}}function oe(e,t,n){var o=e.ownerDocument,i="(^|\\s| | | | |$)",a=[],l={};s(e,"code")||(r(t,function(e){l[e]=new RegExp(i+G(e)+i),a.push(e)}),a.sort(function(e,t){return t.length-e.length}),function e(i){for(i=i.firstChild;i;){if(i.nodeType!==de||E(i,"code")||e(i),i.nodeType===fe)for(var r=0;r<a.length;r++){var c=i.nodeValue,s=a[r],u=n?c.search(l[s]):c.indexOf(s);if(u>-1){var d=c.indexOf(s,u),f=L(t[s],o),p=c.substr(d+s.length);f.appendChild(o.createTextNode(p)),i.nodeValue=c.substr(0,d),i.parentNode.insertBefore(f,i.nextSibling)}}i=i.nextSibling}}(e))}function ie(e,t){var n;B(e,function(e){j(e,!0)?(n||T(n=l("p",{},t),e),e.nodeType===fe&&""===e.nodeValue||f(n,e)):n=null},!1,!0)}function re(e,t){var n,a,c,s,v,k,S,D,O,B,L,q,$,K,Q,G,Z,se,ue,me,he,ve,we,Ce,ke,Te,De,Me,_e,Ae,Oe,Be,Ie,Le,Ve,Pe,We,je,qe,Ue,$e,Ye,Ke,Xe,Qe,Ge,Je,Ze,et,tt,nt,ot,it,rt,at,lt,ct,st,ut,dt,ft,pt,mt=this,gt=e.get?e.get(0):e,ht={},vt=[],yt=[],bt={},xt={},wt={};mt.commands=o(!0,{},t.commands||Se);var Ct=mt.opts=o(!0,{},ge,t);mt.opts.emoticons=t.emoticons||ge.emoticons,Te=function(){gt._sceditor=mt,Ct.locale&&"en"!==Ct.locale&&Be(),T(a=l("div",{className:"sceditor-container"}),gt),w(a,"z-index",Ct.zIndex),He&&N(a,"ie ie"+He),ue=gt.required,gt.required=!1;var e=re.formats[Ct.format];"init"in(n=e?new e:{})&&n.init.call(mt),Oe(),We(),Ie(),Ae(),Le(),Ve(),xe||mt.toggleSourceMode(),et();var t=function(){g(Ne,"load",t),Ct.autofocus&&rt(),pt(),nt(),K.call("ready"),"onReady"in n&&n.onReady.call(mt)};m(Ne,"load",t),"complete"===Re.readyState&&t()},Oe=function(){var e=Ct.plugins;e=e?e.toString().split(","):[],K=new ee(mt),e.forEach(function(e){K.register(e.trim())})},Be=function(){var e;(q=re.locale[Ct.locale])||(e=Ct.locale.split("-"),q=re.locale[e[0]]),q&&q.dateFormat&&(Ct.dateFormat=q.dateFormat)},Ae=function(){S=l("textarea"),s=l("iframe",{frameborder:0,allowfullscreen:!0}),Ct.startInSourceMode?(N(a,"sourceMode"),y(s)):(N(a,"wysiwygMode"),y(S)),Ct.spellcheck||h(a,"spellcheck","false"),"https:"===Ne.location.protocol&&h(s,"src","javascript:false"),f(a,s),f(a,S),mt.dimensions(Ct.width||F(gt),Ct.height||z(gt));var e=He?"ie ie"+He:"";e+=be?" ios":"",(k=s.contentDocument).open(),k.write(Ee("html",{attrs:' class="'+e+'"',spellcheck:Ct.spellcheck?"":'spellcheck="false"',charset:Ct.charset,style:Ct.style})),k.close(),v=k.body,mt.readOnly(!!Ct.readOnly),(be||ye||He)&&(z(v,"100%"),He||m(v,"touchend",mt.focus));var t=h(gt,"tabindex");h(S,"tabindex",t),h(s,"tabindex",t),$=new te(s.contentWindow),y(gt),mt.val(gt.value);var n=Ct.placeholder||h(gt,"placeholder");n&&(S.placeholder=n,h(v,"placeholder",n))},Le=function(){Ct.autoUpdate&&(m(v,"blur",ft),m(S,"blur",ft)),null===Ct.rtl&&(Ct.rtl="rtl"===w(S,"direction")),mt.rtl(!!Ct.rtl),Ct.autoExpand&&(m(v,"load",pt,pe),m(k,"input keyup",pt)),Ct.resizeEnabled&&Pe(),h(a,"id",Ct.id),mt.emoticons(Ct.emoticonsEnabled)},Ve=function(){var e=gt.form,t="onselectionchange"in k?"selectionchange":"keyup focus blur contextmenu mouseup touchend click";m(Re,"click",Je),e&&(m(e,"reset",Ke),m(e,"submit",mt.updateOriginal,pe)),m(v,"keypress",Ye),m(v,"keydown",Ue),m(v,"keydown",$e),m(v,"keyup",nt),m(v,"blur",ut),m(v,"keyup",dt),m(v,"paste",je),m(v,"compositionstart compositionend",Qe),m(v,t,ot),m(v,"keydown keyup keypress focus blur contextmenu",Ge),Ct.emoticonsCompat&&Ne.getSelection&&m(v,"keyup",lt),m(v,"blur",function(){mt.val()||N(v,"placeholder")}),m(v,"focus",function(){R(v,"placeholder")}),m(S,"blur",ut),m(S,"keyup",dt),m(S,"keydown",Ue),m(S,"compositionstart compositionend",Qe),m(S,"keydown keyup keypress focus blur contextmenu",Ge),m(k,"mousedown",Xe),m(k,t,ot),m(k,"beforedeactivate keyup mouseup",_e),m(k,"keyup",nt),m(k,"focus",function(){O=null}),m(a,"selectionchanged",it),m(a,"selectionchanged",et),m(a,"selectionchanged valuechanged nodechanged",Ge)},Ie=function(){var e,t=mt.commands,n=(Ct.toolbarExclude||"").split(","),o=Ct.toolbar.split("|");c=l("div",{className:"sceditor-toolbar",unselectable:"on"}),Ct.icons in re.icons&&(ke=new re.icons[Ct.icons]),r(o,function(o,i){e=l("div",{className:"sceditor-group"}),r(i.split(","),function(o,i){var r,a,l=t[i];!l||n.indexOf(i)>-1||(a=l.shortcut,r=Ee("toolbarButton",{name:i,dispName:mt._(l.name||l.tooltip||i)},!0).firstChild,ke&&ke.create&&ke.create(i)&&(T(ke.create(i),r.firstChild),N(r,"has-icon")),r._sceTxtMode=!!l.txtExec,r._sceWysiwygMode=!!l.exec,H(r,"disabled",!l.exec),m(r,"click",function(e){M(r,"disabled")||Me(r,l),et(),e.preventDefault()}),m(r,"mousedown",function(e){mt.closeDropDown(),e.preventDefault()}),l.tooltip&&h(r,"title",mt._(l.tooltip)+(a?" ("+a+")":"")),a&&mt.addShortcut(a,i),l.state?yt.push({name:i,state:l.state}):ae(l.exec)&&yt.push({name:i,state:l.exec}),f(e,r),xt[i]=r)}),e.firstChild&&f(c,e)}),f(Ct.toolbarContainer||a,c)},Pe=function(){var e,t,n,o,i,r,c=l("div",{className:"sceditor-grip"}),s=l("div",{className:"sceditor-resize-cover"}),u="touchcancel touchend mouseup",d=0,p=0,h=0,v=0,x=0,w=0,C=F(a),E=z(a),k=!1,S=mt.rtl();if(e=Ct.resizeMinHeight||E/1.5,t=Ct.resizeMaxHeight||2.5*E,n=Ct.resizeMinWidth||C/1.25,o=Ct.resizeMaxWidth||1.25*C,i=function(i){"touchmove"===i.type?(i=Ne.event,h=i.changedTouches[0].pageX,v=i.changedTouches[0].pageY):(h=i.pageX,v=i.pageY);var r=w+(v-p),a=S?x-(h-d):x+(h-d);o>0&&a>o&&(a=o),n>0&&a<n&&(a=n),Ct.resizeWidth||(a=!1),t>0&&r>t&&(r=t),e>0&&r<e&&(r=e),Ct.resizeHeight||(r=!1),(a||r)&&mt.dimensions(a,r),i.preventDefault()},r=function(e){k&&(k=!1,y(s),R(a,"resizing"),g(Re,"touchmove mousemove",i),g(Re,u,r),e.preventDefault())},ke&&ke.create){var T=ke.create("grip");T&&(f(c,T),N(c,"has-icon"))}f(a,c),f(a,s),y(s),m(c,"touchstart mousedown",function(e){"touchstart"===e.type?(e=Ne.event,d=e.touches[0].pageX,p=e.touches[0].pageY):(d=e.pageX,p=e.pageY),x=F(a),w=z(a),k=!0,N(a,"resizing"),b(s),m(Re,"touchmove mousemove",i),m(Re,u,r),e.preventDefault()})},We=function(){var e=Ct.emoticons,t=Ct.emoticonsRoot||"";e&&(wt=o({},e.more,e.dropdown,e.hidden)),r(wt,function(e,n){wt[e]=Ee("emoticon",{key:e,url:t+(n.url||n),tooltip:n.tooltip||e}),Ct.emoticonsEnabled&&vt.push(l("img",{src:t+(n.url||n)}))})},rt=function(){var e,t,n=v.firstChild,o=!!Ct.autofocusEnd;if(A(a)){if(mt.sourceMode())return t=o?S.value.length:0,void S.setSelectionRange(t,t);if(Y(v),o)for((n=v.lastChild)||(n=l("p",{},k),f(v,n));n.lastChild;)n=n.lastChild,!Fe&&E(n,"br")&&n.previousSibling&&(n=n.previousSibling);e=k.createRange(),W(n)?e.selectNodeContents(n):(e.setStartBefore(n),o&&e.setStartAfter(n)),e.collapse(!o),$.selectRange(e),Z=e,o&&(v.scrollTop=v.scrollHeight),mt.focus()}},mt.readOnly=function(e){return"boolean"!=typeof e?!S.readonly:(v.contentEditable=!e,S.readonly=!e,Ze(e),mt)},mt.rtl=function(e){var t=e?"rtl":"ltr";return"boolean"!=typeof e?"rtl"===h(S,"dir"):(h(v,"dir",t),h(S,"dir",t),R(a,"rtl"),R(a,"ltr"),N(a,t),ke&&ke.rtl&&ke.rtl(e),mt)},Ze=function(e){var t=mt.inSourceMode()?"_sceTxtMode":"_sceWysiwygMode";r(xt,function(n,o){H(o,"disabled",e||!o[t])})},mt.width=function(e,t){return e||0===e?(mt.dimensions(e,null,t),mt):F(a)},mt.dimensions=function(e,t,n){return e=!(!e&&0!==e)&&e,t=!(!t&&0!==t)&&t,!1===e&&!1===t?{width:mt.width(),height:mt.height()}:(!1!==e&&(!1!==n&&(Ct.width=e),F(a,e)),!1!==t&&(!1!==n&&(Ct.height=t),z(a,t)),mt)},mt.height=function(e,t){return e||0===e?(mt.dimensions(null,e,t),mt):z(a)},mt.maximize=function(e){return le(e)?M(a,"sceditor-maximize"):((e=!!e)&&(we=Ne.pageYOffset),H(Re.documentElement,"sceditor-maximize",e),H(Re.body,"sceditor-maximize",e),H(a,"sceditor-maximize",e),mt.width(e?"100%":Ct.width,!1),mt.height(e?"100%":Ct.height,!1),e||Ne.scrollTo(0,we),pt(),mt)},pt=function(){Ct.autoExpand&&!ve&&setTimeout(mt.expandToContent,200)},mt.expandToContent=function(e){if(!mt.maximize()){if(ve=!1,!he){var t=Ct.resizeMinHeight||Ct.height||z(gt);he={min:t,max:Ct.resizeMaxHeight||2*t}}var n=Re.createRange();n.selectNodeContents(v);var o=n.getBoundingClientRect(),i=k.documentElement.clientHeight,r=o.bottom-o.top,a=mt.height()+(r-i);e||-1===he.max||(a=Math.min(a,he.max)),mt.height(Math.ceil(Math.max(a,he.min)))}},mt.destroy=function(){if(K){K.destroy(),$=null,O=null,K=null,D&&d(D),g(Re,"click",Je);var e=gt.form;e&&(g(e,"reset",Ke),g(e,"submit",mt.updateOriginal)),d(S),d(c),d(a),delete gt._sceditor,b(gt),gt.required=ue}},mt.createDropDown=function(e,t,n,i){var a,c="sceditor-"+t;mt.closeDropDown(!0),D&&M(D,c)||(!1!==i&&r(p(n,":not(input):not(textarea)"),function(e,t){t.nodeType===de&&h(t,"unselectable","on")}),a=o({top:X(e).top,left:X(e).left,marginTop:e.clientHeight},Ct.dropDownCss),w(D=l("div",{className:"sceditor-dropdown "+c}),a),f(D,n),f(Re.body,D),m(D,"click focusin",function(e){e.stopPropagation()}),setTimeout(function(){if(D){var e=p(D,"input,textarea")[0];e&&e.focus()}}))},Je=function(e){3!==e.which&&D&&!e.defaultPrevented&&(ft(),mt.closeDropDown())},je=function(e){var t=He||ye,n=v,o=e.clipboardData;if(o&&!t){var i={},r=o.types,a=o.items;e.preventDefault();for(var l=0;l<r.length;l++){if(Ne.FileReader&&a&&ze.test(a[l].type))return function(e){var t=new FileReader;t.onload=function(e){qe({html:'<img src="'+e.target.result+'" />'})},t.readAsDataURL(e)}(o.items[l].getAsFile());i[r[l]]=o.getData(r[l])}i.text=i["text/plain"],i.html=i["text/html"],qe(i)}else if(!Ce){var c=n.scrollTop;for($.saveRange(),Ce=Re.createDocumentFragment();n.firstChild;)f(Ce,n.firstChild);setTimeout(function(){var e=n.innerHTML;n.innerHTML="",f(n,Ce),n.scrollTop=c,Ce=!1,$.restoreRange(),qe({html:e})},0)}},qe=function(e){var t=l("div",{},k);K.call("pasteRaw",e),e.html?(t.innerHTML=e.html,U(t)):t.innerHTML=J(e.text||"");var o={val:t.innerHTML};"fragmentToSource"in n&&(o.val=n.fragmentToSource(o.val,k,Q)),K.call("paste",o),"fragmentToHtml"in n&&(o.val=n.fragmentToHtml(o.val,Q)),K.call("pasteHtml",o),mt.wysiwygEditorInsertHtml(o.val,null,!0)},mt.closeDropDown=function(e){D&&(d(D),D=null),!0===e&&mt.focus()},mt.wysiwygEditorInsertHtml=function(e,t,n){var o,i,r,a=z(s);mt.focus(),!n&&u(G,"code")||($.insertHTML(e,t),$.saveRange(),De(),b(o=p(v,"#sceditor-end-marker")[0]),i=v.scrollTop,r=X(o).top+1.5*o.offsetHeight-a,y(o),(r>i||r+a<i)&&(v.scrollTop=r),st(!1),$.restoreRange(),nt())},mt.wysiwygEditorInsertText=function(e,t){mt.wysiwygEditorInsertHtml(J(e),J(t))},mt.insertText=function(e,t){return mt.inSourceMode()?mt.sourceEditorInsertText(e,t):mt.wysiwygEditorInsertText(e,t),mt},mt.sourceEditorInsertText=function(e,t){var n,o,i=S.selectionStart,r=S.selectionEnd;n=S.scrollTop,S.focus(),o=S.value,t&&(e+=o.substring(i,r)+t),S.value=o.substring(0,i)+e+o.substring(r,o.length),S.selectionStart=i+e.length-(t?t.length:0),S.selectionEnd=S.selectionStart,S.scrollTop=n,S.focus(),st()},mt.getRangeHelper=function(){return $},mt.sourceEditorCaret=function(e){return S.focus(),e?(S.selectionStart=e.start,S.selectionEnd=e.end,this):{start:S.selectionStart,end:S.selectionEnd}},mt.val=function(e,t){return ae(e)?(mt.inSourceMode()?mt.setSourceEditorValue(e):(!1!==t&&"toHtml"in n&&(e=n.toHtml(e)),mt.setWysiwygEditorValue(e)),mt):mt.inSourceMode()?mt.getSourceEditorValue(!1):mt.getWysiwygEditorValue(t)},mt.insert=function(e,t,o,i,r){if(mt.inSourceMode())return mt.sourceEditorInsertText(e,t),mt;if(t){var a=$.selectedHtml();!1!==o&&"fragmentToSource"in n&&(a=n.fragmentToSource(a,k,Q)),e+=a+t}return!1!==o&&"fragmentToHtml"in n&&(e=n.fragmentToHtml(e,Q)),!1!==o&&!0===r&&(e=e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")),mt.wysiwygEditorInsertHtml(e),mt},mt.getWysiwygEditorValue=function(e){for(var t,o=l("div",{},k),i=v.childNodes,r=0;r<i.length;r++)f(o,i[r].cloneNode(!0));return f(v,o),U(o),d(o),t=o.innerHTML,!1!==e&&n.hasOwnProperty("toSource")&&(t=n.toSource(t,k)),t},mt.getBody=function(){return v},mt.getContentAreaContainer=function(){return s},mt.getSourceEditorValue=function(e){var t=S.value;return!1!==e&&"toHtml"in n&&(t=n.toHtml(t)),t},mt.setWysiwygEditorValue=function(e){e||(e="<p>"+(He?"":"<br />")+"</p>"),v.innerHTML=e,De(),nt(),st(),pt()},mt.setSourceEditorValue=function(e){S.value=e,st()},mt.updateOriginal=function(){gt.value=mt.val()},De=function(){Ct.emoticonsEnabled&&oe(v,wt,Ct.emoticonsCompat)},mt.inSourceMode=function(){return M(a,"sourceMode")},mt.sourceMode=function(e){var t=mt.inSourceMode();return"boolean"!=typeof e?t:((t&&!e||!t&&e)&&mt.toggleSourceMode(),mt)},mt.toggleSourceMode=function(){var e=mt.inSourceMode();!xe&&e||(e||($.saveRange(),$.clear()),mt.blur(),e?mt.setWysiwygEditorValue(mt.getSourceEditorValue()):mt.setSourceEditorValue(mt.getWysiwygEditorValue()),O=null,x(S),x(s),H(a,"wysiwygMode",e),H(a,"sourceMode",!e),Ze(),et())},tt=function(){return S.focus(),S.value.substring(S.selectionStart,S.selectionEnd)},Me=function(e,t){mt.inSourceMode()?t.txtExec&&(Array.isArray(t.txtExec)?mt.sourceEditorInsertText.apply(mt,t.txtExec):t.txtExec.call(mt,e,tt())):t.exec&&(ce(t.exec)?t.exec.call(mt,e):mt.execCommand(t.exec,t.hasOwnProperty("execParam")?t.execParam:null))},_e=function(){He&&(O=$.selectedRange())},mt.execCommand=function(e,t){var n=!1,o=mt.commands[e];if(mt.focus(),!u($.parentNode(),"code")){try{n=k.execCommand(e,!1,t)}catch(e){}!n&&o&&o.errorMessage&&alert(mt._(o.errorMessage)),et()}},ot=function(){function e(){if($&&!$.compare(Z)){if((Z=$.cloneSelected())&&Z.collapsed){var e=Z.startContainer,t=Z.startOffset;for(t&&e.nodeType!==fe&&(e=e.childNodes[t]);e&&e.parentNode!==v;)e=e.parentNode;e&&j(e,!0)&&($.saveRange(),ie(v,k),$.restoreRange())}_(a,"selectionchanged")}se=!1}se||(se=!0,"onselectionchange"in k?e():setTimeout(e,100))},it=function(){var e,t=$.parentNode();Q!==t&&(e=Q,Q=t,G=$.getFirstBlockParent(t),_(a,"nodechanged",{oldNode:e,newNode:Q}))},mt.currentNode=function(){return Q},mt.currentBlockNode=function(){return G},et=function(){var e,t,n=k,o=mt.sourceMode();if(mt.readOnly())r(p(c,"active"),function(e,t){R(t,"active")});else{o||(t=$.parentNode(),e=$.getFirstBlockParent(t));for(var i=0;i<yt.length;i++){var a=0,l=xt[yt[i].name],s=yt[i].state,u=o&&!l._sceTxtMode||!o&&!l._sceWysiwygMode;if(ae(s)){if(!o)try{(a=n.queryCommandEnabled(s)?0:-1)>-1&&(a=n.queryCommandState(s)?1:0)}catch(e){}}else u||(a=s.call(mt,t,e));H(l,"disabled",u||a<0),H(l,"active",a>0)}ke&&ke.update&&ke.update(o,t,e)}},Ye=function(e){if(!e.defaultPrevented&&(mt.closeDropDown(),13===e.which)&&!E(G,"li,ul,ol")&&V(G)){O=null;var t=l("br",{},k);if($.insertNode(t),!Fe){var n=t.parentNode,o=n.lastChild;o&&o.nodeType===fe&&""===o.nodeValue&&(d(o),o=n.lastChild),!j(n,!0)&&o===t&&j(t.previousSibling)&&$.insertHTML("<br>")}e.preventDefault()}},nt=function(){I(v,function(e){if(e.nodeType===de&&!/inline/.test(w(e,"display"))&&!E(e,".sceditor-nlf")&&V(e)){var t=l("p",{},k);return t.className="sceditor-nlf",t.innerHTML=Fe?"":"<br />",f(v,t),!1}if(3===e.nodeType&&!/^\s*$/.test(e.nodeValue)||E(e,"br"))return!1})},Ke=function(){mt.val(gt.value)},Xe=function(){mt.closeDropDown(),O=null},mt._=function(){var e=arguments;return q&&q[e[0]]&&(e[0]=q[e[0]]),e[0].replace(/\{(\d+)\}/g,function(t,n){return void 0!==e[n-0+1]?e[n-0+1]:"{"+n+"}"})},Ge=function(e){K&&K.call(e.type+"Event",e,mt);var t=(e.target===S?"scesrc":"scewys")+e.type;ht[t]&&ht[t].forEach(function(t){t.call(mt,e)})},mt.bind=function(e,t,n,o){for(var i=(e=e.split(" ")).length;i--;)if(ce(t)){var r="scewys"+e[i],a="scesrc"+e[i];n||(ht[r]=ht[r]||[],ht[r].push(t)),o||(ht[a]=ht[a]||[],ht[a].push(t)),"valuechanged"===e[i]&&(st.hasHandler=!0)}return mt},mt.unbind=function(e,t,n,o){for(var r=(e=e.split(" ")).length;r--;)ce(t)&&(n||i(ht["scewys"+e[r]]||[],t),o||i(ht["scesrc"+e[r]]||[],t));return mt},mt.blur=function(e,t,n){return ce(e)?mt.bind("blur",e,t,n):mt.sourceMode()?S.blur():v.blur(),mt},mt.focus=function(e,t,n){if(ce(e))mt.bind("focus",e,t,n);else if(mt.inSourceMode())S.focus();else{if(p(k,":focus").length)return;var o,i=$.selectedRange();Z||rt(),!Fe&&i&&1===i.endOffset&&i.collapsed&&(o=i.endContainer)&&1===o.childNodes.length&&E(o.firstChild,"br")&&(i.setStartBefore(o.firstChild),i.collapse(!0),$.selectRange(i)),s.contentWindow.focus(),v.focus(),O&&($.selectRange(O),O=null)}return et(),mt},mt.keyDown=function(e,t,n){return mt.bind("keydown",e,t,n)},mt.keyPress=function(e,t,n){return mt.bind("keypress",e,t,n)},mt.keyUp=function(e,t,n){return mt.bind("keyup",e,t,n)},mt.nodeChanged=function(e){return mt.bind("nodechanged",e,!1,!0)},mt.selectionChanged=function(e){return mt.bind("selectionchanged",e,!1,!0)},mt.valueChanged=function(e,t,n){return mt.bind("valuechanged",e,t,n)},at=function(e){var t=0,n=mt.emoticonsCache,o=String.fromCharCode(e.which);u(G,"code")||(n||(n=[],r(wt,function(e,o){n[t++]=[e,o]}),n.sort(function(e,t){return e[0].length-t[0].length}),mt.emoticonsCache=n,mt.longestEmoticonCode=n[n.length-1][0].length),$.replaceKeyword(mt.emoticonsCache,!0,!0,mt.longestEmoticonCode,Ct.emoticonsCompat,o)&&(Ct.emoticonsCompat&&/^\s$/.test(o)||e.preventDefault()))},lt=function(){ne(G,$)},mt.emoticons=function(e){return e||!1===e?(Ct.emoticonsEnabled=e,e?(m(v,"keypress",at),mt.sourceMode()||($.saveRange(),De(),st(!1),$.restoreRange())):(r(p(v,"img[data-sceditor-emoticon]"),function(e,t){var n=C(t,"sceditor-emoticon"),o=k.createTextNode(n);t.parentNode.replaceChild(o,t)}),g(v,"keypress",at),st()),mt):Ct.emoticonsEnabled},mt.css=function(e){return me||(me=l("style",{id:"inline"},k),f(k.head,me)),ae(e)?(me.styleSheet?me.styleSheet.cssText=e:me.innerHTML=e,mt):me.styleSheet?me.styleSheet.cssText:me.innerHTML},Ue=function(e){var t=[],n={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|","[":"{","]":"}"},o={8:"backspace",9:"tab",13:"enter",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",91:"win",92:"win",93:"select",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={109:"-",110:"del",111:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},r=e.which,a=o[r]||String.fromCharCode(r).toLowerCase();(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&(t.push("shift"),i[r]?a=i[r]:n[a]&&(a=n[a])),a&&(r<16||r>18)&&t.push(a),t=t.join("+"),bt[t]&&!1===bt[t].call(mt)&&(e.stopPropagation(),e.preventDefault())},mt.addShortcut=function(e,t){return e=e.toLowerCase(),ae(t)?bt[e]=function(){return Me(xt[t],mt.commands[t]),!1}:bt[e]=t,mt},mt.removeShortcut=function(e){return delete bt[e.toLowerCase()],mt},$e=function(e){var t,n,o;if(!Ct.disableBlockRemove&&8===e.which&&(n=$.selectedRange())&&(t=n.startContainer,0===n.startOffset&&(o=ct()))){for(;t!==o;){for(;t.previousSibling;)if((t=t.previousSibling).nodeType!==fe||t.nodeValue)return;if(!(t=t.parentNode))return}o&&!E(o,"body")&&(mt.clearBlockFormatting(o),e.preventDefault())}},ct=function(){for(var e=G;!V(e)||j(e,!0);)if(!(e=e.parentNode)||E(e,"body"))return;return e},mt.clearBlockFormatting=function(e){return!(e=e||ct())||E(e,"body")?mt:($.saveRange(),e.className="",O=null,h(e,"style",""),E(e,"p,div,td")||P(e,"p"),$.restoreRange(),mt)},st=function(e){if(K&&(K.hasHandler("valuechangedEvent")||st.hasHandler)){var t,n=mt.sourceMode(),o=!n&&$.hasSelection();B=!1,e=!1!==e&&!k.getElementById("sceditor-start-marker"),L&&(clearTimeout(L),L=!1),o&&e&&$.saveRange(),(t=n?S.value:v.innerHTML)!==st.lastVal&&(st.lastVal=t,_(a,"valuechanged",{rawValue:n?mt.val():t})),o&&e&&$.removeMarkers()}},ut=function(){L&&st()},dt=function(e){var t=e.which,n=dt.lastChar,o=13===n||32===n,i=8===n||46===n;dt.lastChar=t,B||(13===t||32===t?o?dt.triggerNext=!0:st():8===t||46===t?i?dt.triggerNext=!0:st():dt.triggerNext&&(st(),dt.triggerNext=!1),clearTimeout(L),L=setTimeout(function(){B||st()},1500))},Qe=function(e){(B=/start/i.test(e.type))||st()},ft=function(){mt.updateOriginal()},Te()}e=e&&e.hasOwnProperty("default")?e.default:e;var ae=t.bind(null,"string"),le=t.bind(null,"undefined"),ce=t.bind(null,"function"),se=t.bind(null,"number"),ue={},de=1,fe=3,pe=!0,me="|body|hr|p|div|h1|h2|h3|h4|h5|h6|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|blockquote|center|",ge={toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,paste,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,image,email,link,unlink|emoticon,youtube,date,time|ltr,rtl|print,maximize,source",toolbarExclude:null,style:"jquery.sceditor.default.css",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",colors:"#000000,#44B8FF,#1E92F7,#0074D9,#005DC2,#00369B,#b3d5f4|#444444,#C3FFFF,#9DF9FF,#7FDBFF,#68C4E8,#419DC1,#d9f4ff|#666666,#72FF84,#4CEA5E,#2ECC40,#17B529,#008E02,#c0f0c6|#888888,#FFFF44,#FFFA1E,#FFDC00,#E8C500,#C19E00,#fff5b3|#aaaaaa,#FFC95F,#FFA339,#FF851B,#E86E04,#C14700,#ffdbbb|#cccccc,#FF857A,#FF5F54,#FF4136,#E82A1F,#C10300,#ffc6c3|#eeeeee,#FF56FF,#FF30DC,#F012BE,#D900A7,#B20080,#fbb8ec|#ffffff,#F551FF,#CF2BE7,#B10DC9,#9A00B2,#9A00B2,#e8b6ef",locale:h(document.documentElement,"lang")||"en",charset:"utf-8",emoticonsCompat:!1,emoticonsEnabled:!0,emoticonsRoot:"",emoticons:{dropdown:{":)":"emoticons/smile.png",":angel:":"emoticons/angel.png",":angry:":"emoticons/angry.png","8-)":"emoticons/cool.png",":'(":"emoticons/cwy.png",":ermm:":"emoticons/ermm.png",":D":"emoticons/grin.png","<3":"emoticons/heart.png",":(":"emoticons/sad.png",":O":"emoticons/shocked.png",":P":"emoticons/tongue.png",";)":"emoticons/wink.png"},more:{":alien:":"emoticons/alien.png",":blink:":"emoticons/blink.png",":blush:":"emoticons/blush.png",":cheerful:":"emoticons/cheerful.png",":devil:":"emoticons/devil.png",":dizzy:":"emoticons/dizzy.png",":getlost:":"emoticons/getlost.png",":happy:":"emoticons/happy.png",":kissing:":"emoticons/kissing.png",":ninja:":"emoticons/ninja.png",":pinch:":"emoticons/pinch.png",":pouty:":"emoticons/pouty.png",":sick:":"emoticons/sick.png",":sideways:":"emoticons/sideways.png",":silly:":"emoticons/silly.png",":sleeping:":"emoticons/sleeping.png",":unsure:":"emoticons/unsure.png",":woot:":"emoticons/w00t.png",":wassat:":"emoticons/wassat.png"},hidden:{":whistling:":"emoticons/whistling.png",":love:":"emoticons/wub.png"}},width:null,height:null,resizeEnabled:!0,resizeMinWidth:null,resizeMinHeight:null,resizeMaxHeight:null,resizeMaxWidth:null,resizeHeight:!0,resizeWidth:!0,dateFormat:"year-month-day",toolbarContainer:null,enablePasteFiltering:!1,disablePasting:!1,readOnly:!1,rtl:!1,autofocus:!1,autofocusEnd:!0,autoExpand:!1,autoUpdate:!1,spellcheck:!0,runWithoutWysiwygSupport:!1,startInSourceMode:!1,id:null,plugins:"",zIndex:null,bbcodeTrim:!1,disableBlockRemove:!1,parserOptions:{},dropDownCss:{}},he=navigator.userAgent,ve=function(){var e=3,t=document,n=t.createElement("div"),o=n.getElementsByTagName("i");do{n.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(o[0]);return t.documentMode&&t.all&&window.atob&&(e=10),4===e&&t.documentMode&&(e=11),e>4?e:void 0}(),ye="-ms-ime-align"in document.documentElement.style,be=/iPhone|iPod|iPad| wosbrowser\//i.test(he),xe=function(){var e,t,n=document.createElement("div");return n.contentEditable=!0,"contentEditable"in document.documentElement&&"true"===n.contentEditable&&(t=/Opera Mobi|Opera Mini/i.test(he),/Android/i.test(he)&&(t=!0,/Safari/.test(he)&&(t=!(e=/Safari\/(\d+)/.exec(he))||!e[1]||e[1]<534)),/ Silk\//i.test(he)&&(t=!(e=/AppleWebKit\/(\d+)/.exec(he))||!e[1]||e[1]<534),be&&(t=/OS [0-4](_\d)+ like Mac/i.test(he)),/Firefox/i.test(he)&&(t=!1),/OneBrowser/i.test(he)&&(t=!1),"UCWEB"===navigator.vendor&&(t=!1),ve<=9&&(t=!0),!t)}(),we=/^(https?|s?ftp|mailto|spotify|skype|ssh|teamspeak|tel):|(\/\/)|data:image\/(png|bmp|gif|p?jpe?g);/i,Ce={html:'<!DOCTYPE html><html{attrs}><head><style>.ie * {min-height: auto !important} .ie table td {height:15px} @supports (-ms-ime-align:auto) { * { min-height: auto !important; } }</style><meta http-equiv="Content-Type" content="text/html;charset={charset}" /><link rel="stylesheet" type="text/css" href="{style}" /></head><body contenteditable="true" {spellcheck}><p></p></body></html>',toolbarButton:'<a class="sceditor-button sceditor-button-{name}" data-sceditor-command="{name}" unselectable="on"><div unselectable="on">{dispName}</div></a>',emoticon:'<img src="{url}" data-sceditor-emoticon="{key}" alt="{key}" title="{tooltip}" />',fontOpt:'<a class="sceditor-font-option" href="#" data-font="{font}"><font face="{font}">{font}</font></a>',sizeOpt:'<a class="sceditor-fontsize-option" data-size="{size}" href="#"><font size="{size}">{size}</font></a>',pastetext:'<div><label for="txt">{label}</label> <textarea cols="20" rows="7" id="txt"></textarea></div><div><input type="button" class="button" value="{insert}" /></div>',table:'<div><label for="rows">{rows}</label><input type="text" id="rows" value="2" /></div><div><label for="cols">{cols}</label><input type="text" id="cols" value="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',image:'<div><label for="link">{url}</label> <input type="text" id="image" placeholder="https://" /></div><div><label for="width">{width}</label> <input type="text" id="width" size="2" /></div><div><label for="height">{height}</label> <input type="text" id="height" size="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',email:'<div><label for="email">{label}</label> <input type="text" id="email" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{insert}" /></div>',link:'<div><label for="link">{url}</label> <input type="text" id="link" placeholder="https://" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{ins}" /></div>',youtubeMenu:'<div><label for="link">{label}</label> <input type="text" id="link" placeholder="https://" /></div><div><input type="button" class="button" value="{insert}" /></div>',youtube:'<iframe width="560" height="315" frameborder="0" allowfullscreensrc="https://www.youtube.com/embed/{id}?wmode=opaque&start={time}" data-youtube-id="{id}"></iframe>'},Ee=function(e,t,n){var o=Ce[e];return Object.keys(t).forEach(function(e){o=o.replace(new RegExp(G("{"+e+"}"),"g"),t[e])}),n&&(o=L(o)),o},ke=ve&&ve<11,Se={bold:{exec:"bold",tooltip:"Bold",shortcut:"Ctrl+B"},italic:{exec:"italic",tooltip:"Italic",shortcut:"Ctrl+I"},underline:{exec:"underline",tooltip:"Underline",shortcut:"Ctrl+U"},strike:{exec:"strikethrough",tooltip:"Strikethrough"},subscript:{exec:"subscript",tooltip:"Subscript"},superscript:{exec:"superscript",tooltip:"Superscript"},left:{exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(e,t,n){var o=l("div");m(o,"click","a",function(t){n(C(this,"font")),e.closeDropDown(!0),t.preventDefault()}),e.opts.fonts.split(",").forEach(function(e){f(o,Ee("fontOpt",{font:e},!0))}),e.createDropDown(t,"font-picker",o)},exec:function(e){var t=this;Se.font._dropDown(t,e,function(e){t.execCommand("fontname",e)})},tooltip:"Font Name"},size:{_dropDown:function(e,t,n){var o=l("div");m(o,"click","a",function(t){n(C(this,"size")),e.closeDropDown(!0),t.preventDefault()});for(var i=1;i<=7;i++)f(o,Ee("sizeOpt",{size:i},!0));e.createDropDown(t,"fontsize-picker",o)},exec:function(e){var t=this;Se.size._dropDown(t,e,function(e){t.execCommand("fontsize",e)})},tooltip:"Font Size"},color:{_dropDown:function(e,t,n){var o=l("div"),i="",r=Se.color;r._htmlCache||(e.opts.colors.split("|").forEach(function(e){i+='<div class="sceditor-color-column">',e.split(",").forEach(function(e){i+='<a href="#" class="sceditor-color-option" style="background-color: '+e+'" data-color="'+e+'"></a>'}),i+="</div>"}),r._htmlCache=i),f(o,L(r._htmlCache)),m(o,"click","a",function(t){n(C(this,"color")),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"color-picker",o)},exec:function(e){var t=this;Se.color._dropDown(t,e,function(e){t.execCommand("forecolor",e)})},tooltip:"Font Color"},removeformat:{exec:"removeformat",tooltip:"Remove Formatting"},cut:{exec:"cut",tooltip:"Cut",errorMessage:"Your browser does not allow the cut command. Please use the keyboard shortcut Ctrl/Cmd-X"},copy:{exec:"copy",tooltip:"Copy",errorMessage:"Your browser does not allow the copy command. Please use the keyboard shortcut Ctrl/Cmd-C"},paste:{exec:"paste",tooltip:"Paste",errorMessage:"Your browser does not allow the paste command. Please use the keyboard shortcut Ctrl/Cmd-V"},pastetext:{exec:function(e){var t,n=l("div"),o=this;f(n,Ee("pastetext",{label:o._("Paste your text inside the following box:"),insert:o._("Insert")},!0)),m(n,"click",".button",function(e){(t=p(n,"#txt")[0].value)&&o.wysiwygEditorInsertText(t),o.closeDropDown(!0),e.preventDefault()}),o.createDropDown(e,"pastetext",n)},tooltip:"Paste Text"},bulletlist:{exec:function(){Z(this),this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){Z(this),this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(e,t){var n,o,i,r=c(t,"ul,ol,menu");return r.length>1&&r[0].children.length>1?0:E(t,"ul,ol,menu")&&(n=this.getRangeHelper().selectedRange(),o=n.startContainer.parentNode,i=n.endContainer.parentNode,o!==o.parentNode.firstElementChild||E(i,"li")&&i!==i.parentNode.lastElementChild)?0:-1},exec:function(){var e=this,t=e.getRangeHelper().getFirstBlockParent();e.focus(),c(t,"ul,ol,menu")&&e.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(e,t){return u(t,"ul,ol,menu")>0?0:-1},exec:function(){c(this.getRangeHelper().getFirstBlockParent(),"ul,ol,menu")&&this.execCommand("outdent")},tooltip:"Remove one indent"},table:{exec:function(e){var t=this,n=l("div");f(n,Ee("table",{rows:t._("Rows:"),cols:t._("Cols:"),insert:t._("Insert")},!0)),m(n,"click",".button",function(e){var o=Number(p(n,"#rows")[0].value),i=Number(p(n,"#cols")[0].value),r="<table>";o>0&&i>0&&(r+=Array(o+1).join("<tr>"+Array(i+1).join("<td>"+(ke?"":"<br />")+"</td>")+"</tr>"),r+="</table>",t.wysiwygEditorInsertHtml(r),t.closeDropDown(!0),e.preventDefault())}),t.createDropDown(e,"inserttable",n)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("<code>",(ke?"":"<br />")+"</code>")},tooltip:"Code"},image:{_dropDown:function(e,t,n,o){var i=l("div");f(i,Ee("image",{url:e._("URL:"),width:e._("Width (optional):"),height:e._("Height (optional):"),insert:e._("Insert")},!0));var r=p(i,"#image")[0];r.value=n,m(i,"click",".button",function(t){r.value&&o(r.value,p(i,"#width")[0].value,p(i,"#height")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertimage",i)},exec:function(e){var t=this;Se.image._dropDown(t,e,"",function(e,n,o){var i="";n&&(i+=' width="'+n+'"'),o&&(i+=' height="'+o+'"'),t.wysiwygEditorInsertHtml("<img"+i+' src="'+e+'" />')})},tooltip:"Insert an image"},email:{_dropDown:function(e,t,n){var o=l("div");f(o,Ee("email",{label:e._("E-mail:"),desc:e._("Description (optional):"),insert:e._("Insert")},!0)),m(o,"click",".button",function(t){var i=p(o,"#email")[0].value;i&&n(i,p(o,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertemail",o)},exec:function(e){var t=this;Se.email._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?t.wysiwygEditorInsertHtml('<a href="mailto:'+e+'">'+(n||e)+"</a>"):t.execCommand("createlink","mailto:"+e)})},tooltip:"Insert an email"},link:{_dropDown:function(e,t,n){function o(t){r.value&&n(r.value,p(i,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}var i=l("div");f(i,Ee("link",{url:e._("URL:"),desc:e._("Description (optional):"),ins:e._("Insert")},!0));var r=p(i,"#link")[0];m(i,"click",".button",o),m(i,"keypress",function(e){13===e.which&&r.value&&o(e)},pe),e.createDropDown(t,"insertlink",i)},exec:function(e){var t=this;Se.link._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?(n=n||e,t.wysiwygEditorInsertHtml('<a href="'+e+'">'+n+"</a>")):t.execCommand("createlink",e)})},tooltip:"Insert a link"},unlink:{state:function(){return u(this.currentNode(),"a")?0:-1},exec:function(){var e=u(this.currentNode(),"a");if(e){for(;e.firstChild;)T(e.firstChild,e);d(e)}},tooltip:"Unlink"},quote:{exec:function(e,t,n){var o="<blockquote>",i="</blockquote>";t?(o=o+(n=n?"<cite>"+n+"</cite>":"")+t+i,i=null):""===this.getRangeHelper().selectedHtml()&&(i=(ke?"":"<br />")+i),this.wysiwygEditorInsertHtml(o,i)},tooltip:"Insert a Quote"},emoticon:{exec:function(e){var t=this,n=function(i){var a,c=t.opts.emoticonsCompat,s=t.getRangeHelper(),u=c&&" "!==s.getOuterText(!0,1)?" ":"",d=c&&" "!==s.getOuterText(!1,1)?" ":"",p=l("div"),g=l("div"),v=0,y=o({},t.opts.emoticons.dropdown,i?t.opts.emoticons.more:{});return f(p,g),v=Math.sqrt(Object.keys(y).length),m(p,"click","img",function(e){t.insert(u+h(this,"alt")+d,null,!1).closeDropDown(!0),e.preventDefault()}),r(y,function(e,t){f(g,l("img",{src:t.url||t,alt:e,title:t.tooltip||e})),g.children.length>=v&&(g=l("div"),f(p,g))}),!i&&t.opts.emoticons.more&&(f(a=l("a",{className:"sceditor-more"}),document.createTextNode(t._("More"))),m(a,"click",function(o){t.createDropDown(e,"more-emoticons",n(!0)),o.preventDefault()}),f(p,a)),p};t.createDropDown(e,"emoticons",n(!1))},txtExec:function(e){Se.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(e,t,n){var o=l("div");f(o,Ee("youtubeMenu",{label:e._("Video URL:"),insert:e._("Insert")},!0)),m(o,"click",".button",function(t){var i=p(o,"#link")[0].value,a=i.match(/(?:v=|v\/|embed\/|youtu.be\/)(.{11})/),l=i.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/),c=0;l&&r(l[1].split(/[hms]/),function(e,t){""!==t&&(c=60*c+Number(t))}),a&&/^[a-zA-Z0-9_\-]{11}$/.test(a[1])&&n(a[1],c),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertlink",o)},exec:function(e){var t=this;Se.youtube._dropDown(t,e,function(e,n){t.wysiwygEditorInsertHtml(Ee("youtube",{id:e,time:n}))})},tooltip:"Insert a YouTube video"},date:{_date:function(e){var t=new Date,n=t.getYear(),o=t.getMonth()+1,i=t.getDate();return n<2e3&&(n=1900+n),o<10&&(o="0"+o),i<10&&(i="0"+i),e.opts.dateFormat.replace(/year/i,n).replace(/month/i,o).replace(/day/i,i)},exec:function(){this.insertText(Se.date._date(this))},txtExec:function(){this.insertText(Se.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var e=new Date,t=e.getHours(),n=e.getMinutes(),o=e.getSeconds();return t<10&&(t="0"+t),n<10&&(n="0"+n),o<10&&(o="0"+o),t+":"+n+":"+o},exec:function(){this.insertText(Se.time._time())},txtExec:function(){this.insertText(Se.time._time())},tooltip:"Insert current time"},ltr:{state:function(e,t){return t&&"ltr"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!E(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!E(n,"body")))&&w(n,"direction","ltr"===w(n,"direction")?"":"ltr")},tooltip:"Left-to-Right"},rtl:{state:function(e,t){return t&&"rtl"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!E(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!E(n,"body")))&&w(n,"direction","rtl"===w(n,"direction")?"":"rtl")},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize())},txtExec:function(){this.maximize(!this.maximize())},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode()},txtExec:function(){this.toggleSourceMode()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}},Te={};ee.plugins=Te;var De=ve&&ve<11,Me=function(e,t,n){var o,i,r,a,l,c="",s=e.startContainer,u=e.startOffset;for(s&&3!==s.nodeType&&(s=s.childNodes[u],u=0),r=a=u;n>c.length&&s&&3===s.nodeType;)o=s.nodeValue,i=n-c.length,l&&(a=o.length,r=0),l=s,t?(u=r=Math.max(a-i,0),c=o.substr(r,a-r)+c,s=l.previousSibling):(u=r+(a=Math.min(i,o.length)),c+=o.substr(r,a),s=l.nextSibling);return{node:l||s,offset:u,text:c}},Ne=window,Re=document,He=ve,Fe=He&&He<11,ze=/^image\/(p?jpe?g|gif|png|bmp)$/i;re.locale={},re.formats={},re.icons={},re.command={get:function(e){return Se[e]||null},set:function(e,t){return!(!e||!t)&&(t=o(Se[e]||{},t),t.remove=function(){re.command.remove(e)},Se[e]=t,this)},remove:function(e){return Se[e]&&delete Se[e],this}},window.sceditor={command:re.command,commands:Se,defaultOptions:ge,ie:ve,ios:be,isWysiwygSupported:xe,regexEscape:G,escapeEntities:J,escapeUriScheme:function(e){var t,n=/^[^\/]*:/i,o=window.location;return e&&n.test(e)&&!we.test(e)?((t=o.pathname.split("/")).pop(),o.protocol+"//"+o.host+t.join("/")+"/"+e):e},dom:{css:w,attr:h,removeAttr:v,is:E,closest:u,width:F,height:z,traverse:B,rTraverse:I,parseHTML:L,hasStyling:V,convertElement:P,blockLevelList:me,canHaveChildren:W,isInline:j,copyCSS:q,fixNesting:U,findCommonAncestor:function(e,t){for(;e=e.parentNode;)if(k(e,t))return e},getSibling:$,removeWhiteSpace:Y,extractContents:K,getOffset:X,getStyle:Q,hasStyle:function(e,t,n){var o=Q(e,t);return!!o&&(!n||o===n||Array.isArray(n)&&n.indexOf(o)>-1)}},locale:re.locale,icons:re.icons,utils:{each:r,isEmptyObject:n,extend:o},plugins:ee.plugins,formats:re.formats,create:function(e,t){t=t||{},s(e,".sceditor-container")||(t.runWithoutWysiwygSupport||xe)&&new re(e,t)},instance:function(e){return e._sceditor}},e.sceditor=window.sceditor,e.fn.sceditor=function(t){var n,o=[];return this.each(function(){n=this._sceditor,"state"===t?o.push(!!n):"instance"===t?o.push(n):n||e.sceditor.create(this,t)}),o.length?1===o.length?o[0]:o:this}}(jQuery),function(e){"use strict";function t(){function o(e,t){v[e]&&v[e].forEach(function(n){n.tags[e]?u(n.tags[e],function(e,o){t.getAttributeNode&&(!(e=t.getAttributeNode(e))||o&&o.indexOf(e.value)<0||n.conv.call(h,t))}):n.conv&&n.conv.call(h,t)})}function r(e){n.traverse(e,function(e){var t=e.nodeName.toLowerCase();o("*",e),o(t,e)},!0)}function l(e,o){var i,r=e.childNodes,c=e.nodeName.toLowerCase(),s=e.nodeValue,u=r.length,d=t.allowedEmptyTags||[];if(o&&"br"===c)return!0;if(a(e,".sceditor-ignore"))return!0;if(d.indexOf(c)>-1||"td"===c||!n.canHaveChildren(e))return!1;if(s&&/\S|\u00A0/.test(s))return!1;for(;u--;)if(!l(r[u],o&&!e.previousSibling&&!e.nextSibling))return!1;return!e.getBoundingClientRect||!e.className&&!e.hasAttributes("style")||(!(i=e.getBoundingClientRect()).width||!i.height)}function c(e){n.traverse(e,function(o){var i,r=o.nodeName.toLowerCase(),a=o.parentNode,c=o.nodeType,s=!n.isInline(o),u=o.previousSibling,d=o.nextSibling,f=a===e,p=!u&&!d,m="iframe"!==r&&l(o,f&&p&&"br"!==r),g=o.ownerDocument,h=t.allowedTags,v=t.disallowedTags;if(3!==c&&(4===c?r="!cdata":"!"!==r&&8!==c||(r="!comment"),m?i=!0:h&&h.length?i=h.indexOf(r)<0:v&&v.length&&(i=v.indexOf(r)>-1),i)){if(!m){for(s&&u&&n.isInline(u)&&a.insertBefore(g.createTextNode(" "),o);o.firstChild;)a.insertBefore(o.firstChild,d);s&&d&&n.isInline(d)&&a.insertBefore(g.createTextNode(" "),d)}a.removeChild(o)}},!0)}function f(e,t){var n={};return e&&s(n,e),t?(u(t,function(e,t){Array.isArray(t)?n[e]=(n[e]||[]).concat(t):n[e]||(n[e]=null)}),n):n}function m(e){n.removeWhiteSpace(e);for(var t,o,i=e.firstChild;i;)o=i.nextSibling,n.isInline(i)&&!a(i,".sceditor-ignore")?(t||(t=e.ownerDocument.createElement("p"),i.parentNode.insertBefore(t,i)),t.appendChild(i)):t=null,i=o}function g(e){var o,i,r,a,l,c,s=t.allowedAttribs,u=s&&!d(s),p=t.disallowedAttribs,m=p&&!d(p);y={},n.traverse(e,function(e){if(e.attributes&&(o=e.nodeName.toLowerCase(),a=e.attributes.length))for(y[o]||(y[o]=u?f(s["*"],s[o]):f(p["*"],p[o]));a--;)i=e.attributes[a],r=i.name,l=y[o][r],c=!1,u?c=null!==l&&(!Array.isArray(l)||l.indexOf(i.value)<0):m&&(c=null===l||Array.isArray(l)&&l.indexOf(i.value)>-1),c&&e.removeAttribute(r)})}var h=this,v={},y={};h.init=function(){d(t.converters||{})||u(t.converters,function(e,t){u(t.tags,function(e){v[e]||(v[e]=[]),v[e].push(t)})}),this.commands=s(!0,{},p,this.commands)},h.toSource=function(t,n){var o,a=n.createElement("div");return a.innerHTML=t,i(a,"visibility","hidden"),n.body.appendChild(a),r(a),c(a),g(a),m(a),o=(new e.XHTMLSerializer).serialize(a,!0),n.body.removeChild(a),o},h.fragmentToSource=h.toSource}var n=e.dom,o=e.utils,i=n.css,r=n.attr,a=n.is,l=n.removeAttr,c=n.convertElement,s=o.extend,u=o.each,d=o.isEmptyObject,f=e.command.get,p={bold:{txtExec:["<strong>","</strong>"]},italic:{txtExec:["<em>","</em>"]},underline:{txtExec:['<span style="text-decoration:underline;">',"</span>"]},strike:{txtExec:['<span style="text-decoration:line-through;">',"</span>"]},subscript:{txtExec:["<sub>","</sub>"]},superscript:{txtExec:["<sup>","</sup>"]},left:{txtExec:['<div style="text-align:left;">',"</div>"]},center:{txtExec:['<div style="text-align:center;">',"</div>"]},right:{txtExec:['<div style="text-align:right;">',"</div>"]},justify:{txtExec:['<div style="text-align:justify;">',"</div>"]},font:{txtExec:function(e){var t=this;f("font")._dropDown(t,e,function(e){t.insertText('<span style="font-family:'+e+';">',"</span>")})}},size:{txtExec:function(e){var t=this;f("size")._dropDown(t,e,function(e){t.insertText('<span style="font-size:'+e+';">',"</span>")})}},color:{txtExec:function(e){var t=this;f("color")._dropDown(t,e,function(e){t.insertText('<span style="color:'+e+';">',"</span>")})}},bulletlist:{txtExec:["<ul><li>","</li></ul>"]},orderedlist:{txtExec:["<ol><li>","</li></ol>"]},table:{txtExec:["<table><tr><td>","</td></tr></table>"]},horizontalrule:{txtExec:["<hr />"]},code:{txtExec:["<code>","</code>"]},image:{txtExec:function(e,t){var n=this;f("image")._dropDown(n,e,t,function(e,t,o){var i="";t&&(i+=' width="'+t+'"'),o&&(i+=' height="'+o+'"'),n.insertText("<img"+i+' src="'+e+'" />')})}},email:{txtExec:function(e,t){var n=this;f("email")._dropDown(n,e,function(e,o){n.insertText('<a href="mailto:'+e+'">'+(o||t||e)+"</a>")})}},link:{txtExec:function(e,t){var n=this;f("link")._dropDown(n,e,function(e,o){n.insertText('<a href="'+e+'">'+(o||t||e)+"</a>")})}},quote:{txtExec:["<blockquote>","</blockquote>"]},youtube:{txtExec:function(e){var t=this;f("youtube")._dropDown(t,e,function(e,n){t.insertText('<iframe width="560" height="315" src="https://www.youtube.com/embed/{id}?wmode=opaque&start='+n+'" data-youtube-id="'+e+'" frameborder="0" allowfullscreen></iframe>')})}},rtl:{txtExec:['<div stlye="direction:rtl;">',"</div>"]},ltr:{txtExec:['<div stlye="direction:ltr;">',"</div>"]}};e.XHTMLSerializer=function(){function e(e){var t={"&":"&","<":"<",">":">",'"':"""," ":" "};return e?e.replace(/[&<>"\xa0]/g,function(e){return t[e]||e}):""}function t(e){return e.replace(/[\r\n]/," ").replace(/[^\S|\u00A0]+/g," ")}function o(e,t){switch(e.nodeType){case 1:"!"===e.nodeName.toLowerCase()?s(e):l(e,t);break;case 3:u(e,t);break;case 4:c(e);break;case 8:s(e);break;case 9:case 11:r(e)}}function r(e){for(var t=e.firstChild;t;)o(t),t=t.nextSibling}function l(t,r){var l,c,s,u=t.nodeName.toLowerCase(),p="iframe"===u,m=t.attributes.length,h=t.firstChild,v=r||/pre(?:\-wrap)?$/i.test(i(t,"whiteSpace")),y=!t.firstChild&&!n.canHaveChildren(t)&&!p;if(!a(t,".sceditor-ignore")){for(d("<"+u,!r&&f(t));m--;)s=(c=t.attributes[m]).value,d(" "+c.name.toLowerCase()+'="'+e(s)+'"',!1);for(d(y?" />":">",!1),p||(l=h);l;)g++,o(l,v),l=l.nextSibling,g--;y||d("</"+u+">",!v&&!p&&f(t)&&h&&f(h))}}function c(t){d("<![CDATA["+e(t.nodeValue)+"]]>")}function s(t){d("\x3c!-- "+e(t.nodeValue)+" --\x3e")}function u(n,o){var i=n.nodeValue;o||(i=t(i)),i&&d(e(i),!o&&f(n))}function d(e,t){var n=g;if(!1!==t)for(m.length&&m.push("\n");n--;)m.push(p.indentStr);m.push(e)}function f(e){var t=e.previousSibling;return 1!==e.nodeType&&t?!n.isInline(t):!t&&!n.isInline(e.parentNode)||!n.isInline(e)}var p={indentStr:"\t"},m=[],g=0;this.serialize=function(e,t){if(m=[],t)for(e=e.firstChild;e;)o(e),e=e.nextSibling;else o(e);return m.join("")}},t.converters=[{tags:{"*":{width:null}},conv:function(e){i(e,"width",r(e,"width")),l(e,"width")}},{tags:{"*":{height:null}},conv:function(e){i(e,"height",r(e,"height")),l(e,"height")}},{tags:{li:{value:null}},conv:function(e){l(e,"value")}},{tags:{"*":{text:null}},conv:function(e){i(e,"color",r(e,"text")),l(e,"text")}},{tags:{"*":{color:null}},conv:function(e){i(e,"color",r(e,"color")),l(e,"color")}},{tags:{"*":{face:null}},conv:function(e){i(e,"fontFamily",r(e,"face")),l(e,"face")}},{tags:{"*":{align:null}},conv:function(e){i(e,"textAlign",r(e,"align")),l(e,"align")}},{tags:{"*":{border:null}},conv:function(e){i(e,"borderWidth",r(e,"border")),l(e,"border")}},{tags:{applet:{name:null},img:{name:null},layer:{name:null},map:{name:null},object:{name:null},param:{name:null}},conv:function(e){r(e,"id")||r(e,"id",r(e,"name")),l(e,"name")}},{tags:{"*":{vspace:null}},conv:function(e){i(e,"marginTop",r(e,"vspace")-0),i(e,"marginBottom",r(e,"vspace")-0),l(e,"vspace")}},{tags:{"*":{hspace:null}},conv:function(e){i(e,"marginLeft",r(e,"hspace")-0),i(e,"marginRight",r(e,"hspace")-0),l(e,"hspace")}},{tags:{hr:{noshade:null}},conv:function(e){i(e,"borderStyle","solid"),l(e,"noshade")}},{tags:{"*":{nowrap:null}},conv:function(e){i(e,"whiteSpace","nowrap"),l(e,"nowrap")}},{tags:{big:null},conv:function(e){i(c(e,"span"),"fontSize","larger")}},{tags:{small:null},conv:function(e){i(c(e,"span"),"fontSize","smaller")}},{tags:{b:null},conv:function(e){c(e,"strong")}},{tags:{u:null},conv:function(e){i(c(e,"span"),"textDecoration","underline")}},{tags:{s:null,strike:null},conv:function(e){i(c(e,"span"),"textDecoration","line-through")}},{tags:{dir:null},conv:function(e){c(e,"ul")}},{tags:{center:null},conv:function(e){i(c(e,"div"),"textAlign","center")}},{tags:{font:{size:null}},conv:function(e){i(e,"fontSize",i(e,"fontSize")),l(e,"size")}},{tags:{font:null},conv:function(e){c(e,"span")}},{tags:{"*":{type:["_moz"]}},conv:function(e){l(e,"type")}},{tags:{"*":{_moz_dirty:null}},conv:function(e){l(e,"_moz_dirty")}},{tags:{"*":{_moz_editor_bogus_node:null}},conv:function(e){e.parentNode.removeChild(e)}}],t.allowedAttribs={},t.disallowedAttribs={},t.allowedTags=[],t.disallowedTags=[],t.allowedEmptyTags=[],e.formats.xhtml=t}(sceditor); | ||
!function(e){"use strict";function t(e,t){return typeof t===e}function n(e){return!Object.keys(e).length}function o(e,t){for(var n=e===!!e,i=n?2:1,r=n?t:e,a=!!n&&e;i<arguments.length;i++){var l=arguments[i];for(var c in l){var s=l[c];if(!le(s)){var u=null!==s&&"object"==typeof s,d=Array.isArray(s);r[c]=a&&(u||d)?o(!0,r[c]||(d?[]:{}),s):s}}}return r}function i(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}function r(e,t){if(Array.isArray(e)||"length"in e&&se(e.length))for(var n=0;n<e.length;n++)t(n,e[n]);else Object.keys(e).forEach(function(n){t(n,e[n])})}function a(e){return e=parseFloat(e),isFinite(e)?e:0}function l(e,t,n){var o=(n||document).createElement(e);return r(t||{},function(e,t){"style"===e?o.style.cssText=t:e in o?o[e]=t:o.setAttribute(e,t)}),o}function c(e,t){for(var n=[],o=e||{};(o=o.parentNode)&&!/(9|11)/.test(o.nodeType);)t&&!E(o,t)||n.push(o);return n}function s(e,t){for(var n=e||{};(n=n.parentNode)&&!/(9|11)/.test(n.nodeType);)if(!t||E(n,t))return n}function u(e,t){return E(e,t)?e:s(e,t)}function d(e){e.parentNode.removeChild(e)}function f(e,t){e.appendChild(t)}function p(e,t){return e.querySelectorAll(t)}function m(e,t,n,o,i){t.split(" ").forEach(function(t){var r;ae(n)?(r=o["_sce-event-"+t+n]||function(t){for(var i=t.target;i&&i!==e;){if(E(i,n))return void o.call(i,t);i=i.parentNode}},o["_sce-event-"+t+n]=r):(r=n,i=o),e.addEventListener(t,r,i||!1)})}function g(e,t,n,o,i){t.split(" ").forEach(function(t){var r;ae(n)?r=o["_sce-event-"+t+n]:(r=n,i=o),e.removeEventListener(t,r,i||!1)})}function h(e,t,n){if(arguments.length<3)return e.getAttribute(t);null==n?v(e,t):e.setAttribute(t,n)}function v(e,t){e.removeAttribute(t)}function y(e){w(e,"display","none")}function b(e){w(e,"display","")}function x(e){A(e)?y(e):b(e)}function w(e,t,n){if(arguments.length<3){if(ae(t))return getComputedStyle(e)[t];r(t,function(t,n){w(e,t,n)})}else{var o=(n||0===n)&&!isNaN(n);e.style[t]=o?n+"px":n}}function C(e,t,n){var o=arguments.length,i={};if(e.nodeType===de){if(1===o)return r(e.attributes,function(e,t){/^data\-/i.test(t.name)&&(i[t.name.substr(5)]=t.value)}),i;if(2===o)return h(e,"data-"+t);h(e,"data-"+t,String(n))}}function E(e,t){var n=!1;return e&&e.nodeType===de&&(n=(e.matches||e.msMatchesSelector||e.webkitMatchesSelector).call(e,t)),n}function k(e,t){return e!==t&&e.contains&&e.contains(t)}function S(e,t){var n=e.previousElementSibling;return t&&n?E(n,t)?n:null:n}function T(e,t){return t.parentNode.insertBefore(e,t)}function D(e){return e.className.trim().split(/\s+/)}function M(e,t){return E(e,"."+t)}function N(e,t){var n=D(e);n.indexOf(t)<0&&n.push(t),e.className=n.join(" ")}function R(e,t){var n=D(e);i(n,t),e.className=n.join(" ")}function H(e,t,n){(n=le(n)?!M(e,t):n)?N(e,t):R(e,t)}function F(e,t){if(le(t)){var n=getComputedStyle(e),o=a(n.paddingLeft)+a(n.paddingRight),i=a(n.borderLeftWidth)+a(n.borderRightWidth);return e.offsetWidth-o-i}w(e,"width",t)}function z(e,t){if(le(t)){var n=getComputedStyle(e),o=a(n.paddingTop)+a(n.paddingBottom),i=a(n.borderTopWidth)+a(n.borderBottomWidth);return e.offsetHeight-o-i}w(e,"height",t)}function _(e,t,n){var o;ce(window.CustomEvent)?o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(o=e.ownerDocument.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(o)}function A(e){return!!e.getClientRects().length}function O(e){return e.replace(/^-ms-/,"ms-").replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function B(e,t,n,o,i){for(e=i?e.lastChild:e.firstChild;e;){var r=i?e.previousSibling:e.nextSibling;if(!n&&!1===t(e)||!o&&!1===B(e,t,n,o,i)||n&&!1===t(e))return!1;e=r}}function I(e,t,n,o){B(e,t,n,o,!0)}function L(e,t){var n=(t=t||document).createDocumentFragment(),o=l("div",{},t);for(o.innerHTML=e;o.firstChild;)f(n,o.firstChild);return n}function V(e){return e&&(!E(e,"p,div")||e.className||h(e,"style")||!n(C(e)))}function P(e,t){var n=l(t,{},e.ownerDocument);for(r(e.attributes,function(e,t){try{h(n,t.name,t.value)}catch(e){}});e.firstChild;)f(n,e.firstChild);return e.parentNode.replaceChild(n,e),n}function W(e){return!!/11?|9/.test(e.nodeType)&&"|iframe|area|base|basefont|br|col|frame|hr|img|input|wbr|isindex|link|meta|param|command|embed|keygen|source|track|object|".indexOf("|"+e.nodeName.toLowerCase()+"|")<0}function j(e,t){var n,o=(e||{}).nodeType||fe;return o!==de?o===fe:"code"===(n=e.tagName.toLowerCase())?!t:me.indexOf("|"+n+"|")<0}function q(e,t){t.style.cssText=e.style.cssText+t.style.cssText}function U(e){var t=function(e){for(;j(e.parentNode,!0);)e=e.parentNode;return e};B(e,function(e){var n=!j(e,!0);if(n&&j(e.parentNode,!0)){var o=t(e),i=K(o,e),r=e;q(o,r),T(i,o),T(r,o)}if(n&&E(e,"ul,ol")&&E(e.parentNode,"ul,ol")){var a=S(e,"li");a||T(a=l("li"),e),f(a,e)}})}function $(e,t){return e?(t?e.previousSibling:e.nextSibling)||$(e.parentNode,t):null}function Y(e){var t,n,o,i,r,a,l,c=w(e,"whiteSpace"),s=/line$/i.test(c),u=e.firstChild;if(!/pre(\-wrap)?$/i.test(c))for(;u;){if(a=u.nextSibling,t=u.nodeValue,(n=u.nodeType)===de&&u.firstChild&&Y(u),n===fe){for(o=$(u),i=$(u,!0),l=!1;M(i,"sceditor-ignore");)i=$(i,!0);if(j(u)&&i){for(r=i;r.lastChild;)r=r.lastChild;l=r.nodeType===fe?/[\t\n\r ]$/.test(r.nodeValue):!j(r)}t=t.replace(/\u200B/g,""),i&&j(i)&&!l||(t=t.replace(s?/^[\t ]+/:/^[\t\n\r ]+/,"")),o&&j(o)||(t=t.replace(s?/[\t ]+$/:/[\t\n\r ]+$/,"")),t.length?u.nodeValue=t.replace(s?/[\t ]+/g:/[\t\n\r ]+/g," "):d(u)}u=a}}function K(e,t){var n=e.ownerDocument.createRange();return n.setStartBefore(e),n.setEndAfter(t),n.extractContents()}function X(e){for(var t=0,n=0;e;)t+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:t,top:n}}function Q(e,t){var n,o,i=e.style;if(ue[t]||(ue[t]=O(t)),t=ue[t],o=i[t],"textAlign"===t){if(n=i.direction,o=o||w(e,t),w(e.parentNode,t)===o||"block"!==w(e,"display")||E(e,"hr,th"))return"";if(/right/i.test(o)&&"rtl"===n||/left/i.test(o)&&"ltr"===n)return""}return o}function G(e){return e.replace(/([\-.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function J(e,t){if(!e)return e;var n={"&":"&","<":"<",">":">"," ":" ","\r\n":"<br />","\r":"<br />","\n":"<br />"};return!1!==t&&(n['"']=""",n["'"]="'",n["`"]="`"),e=e.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(e){return n[e]||e})}function Z(e){if("mozHidden"in document)for(var t,n=e.getBody();n;){if((t=n).firstChild)t=t.firstChild;else{for(;t&&!t.nextSibling;)t=t.parentNode;t&&(t=t.nextSibling)}3===n.nodeType&&/[\n\r\t]+/.test(n.nodeValue)&&(/^pre/.test(w(n.parentNode,"whiteSpace"))||d(n)),n=t}}function ee(e){var t=this,n=[],o=function(e){return"signal"+e.charAt(0).toUpperCase()+e.slice(1)},i=function(t,i){t=[].slice.call(t);var r,a,l=o(t.shift());for(r=0;r<n.length;r++)if(l in n[r]&&(a=n[r][l].apply(e,t),i))return a};t.call=function(){i(arguments,!1)},t.callOnlyFirst=function(){return i(arguments,!0)},t.hasHandler=function(e){var t=n.length;for(e=o(e);t--;)if(e in n[t])return!0;return!1},t.exists=function(e){return e in Te&&"function"==typeof(e=Te[e])&&"object"==typeof e.prototype},t.isRegistered=function(e){if(t.exists(e))for(var o=n.length;o--;)if(n[o]instanceof Te[e])return!0;return!1},t.register=function(o){return!(!t.exists(o)||t.isRegistered(o)||(o=new Te[o],n.push(o),"init"in o&&o.init.call(e),0))},t.deregister=function(o){var i,r=n.length,a=!1;if(!t.isRegistered(o))return a;for(;r--;)n[r]instanceof Te[o]&&(a=!0,"destroy"in(i=n.splice(r,1)[0])&&i.destroy.call(e));return a},t.destroy=function(){for(var t=n.length;t--;)"destroy"in n[t]&&n[t].destroy.call(e);n=[],e=null}}function te(e,t){var n,o,i=t||e.contentDocument||e.document,r="sceditor-start-marker",a="sceditor-end-marker",c=this;c.insertHTML=function(e,t){var n,o;if(!c.selectedRange())return!1;for(t&&(e+=c.selectedHtml()+t),o=l("p",{},i),n=i.createDocumentFragment(),o.innerHTML=e;o.firstChild;)f(n,o.firstChild);c.insertNode(n)},o=function(e,t,o){var s,u=i.createDocumentFragment();if("string"==typeof e?(t&&(e+=c.selectedHtml()+t),u=L(e)):(f(u,e),t&&(f(u,c.selectedRange().extractContents()),f(u,t))),s=u.lastChild){for(;!j(s.lastChild,!0);)s=s.lastChild;if(W(s)?s.lastChild||f(s,document.createTextNode("")):s=u,c.removeMarkers(),f(s,n(r)),f(s,n(a)),o){var d=l("div");return f(d,u),d.innerHTML}return u}},c.insertNode=function(e,t){var n=o(e,t),i=c.selectedRange(),r=i.commonAncestorContainer;if(!n)return!1;i.deleteContents(),r&&3!==r.nodeType&&!W(r)?T(n,r):i.insertNode(n),c.restoreRange()},c.cloneSelected=function(){var e=c.selectedRange();if(e)return e.cloneRange()},c.selectedRange=function(){var t,n,o=e.getSelection();if(o){if(o.getRangeAt&&o.rangeCount<=0){for(n=i.body;n.firstChild;)n=n.firstChild;(t=i.createRange()).setStartBefore(n),o.addRange(t)}return o.rangeCount>0&&(t=o.getRangeAt(0)),t}},c.hasSelection=function(){var t=e.getSelection();return t&&t.rangeCount>0},c.selectedHtml=function(){var e,t=c.selectedRange();return t?(e=l("p",{},i),f(e,t.cloneContents()),e.innerHTML):""},c.parentNode=function(){var e=c.selectedRange();if(e)return e.commonAncestorContainer},c.getFirstBlockParent=function(e){var t=function(e){return j(e,!0)&&(e=e?e.parentNode:null)?t(e):e};return t(e||c.parentNode())},c.insertNodeAt=function(e,t){var n=c.selectedRange(),o=c.cloneSelected();if(!o)return!1;o.collapse(e),o.insertNode(t),c.selectRange(n)},n=function(e){c.removeMarker(e);var t=l("span",{id:e,className:"sceditor-selection sceditor-ignore",style:"display:none;line-height:0"},i);return t.innerHTML=" ",t},c.insertMarkers=function(){var e=c.selectedRange(),t=n(r);c.removeMarkers(),c.insertNodeAt(!0,t),e&&e.collapsed?t.parentNode.insertBefore(n(a),t.nextSibling):c.insertNodeAt(!1,n(a))},c.getMarker=function(e){return i.getElementById(e)},c.removeMarker=function(e){var t=c.getMarker(e);t&&d(t)},c.removeMarkers=function(){c.removeMarker(r),c.removeMarker(a)},c.saveRange=function(){c.insertMarkers()},c.selectRange=function(t){var n,o=e.getSelection(),r=t.endContainer;if(!De&&t.collapsed&&r&&!j(r,!0)){for(n=r.lastChild;n&&E(n,".sceditor-ignore");)n=n.previousSibling;if(E(n,"br")){var a=i.createRange();a.setEndAfter(n),a.collapse(!1),c.compare(t,a)&&(t.setStartBefore(n),t.collapse(!0))}}o&&(c.clear(),o.addRange(t))},c.restoreRange=function(){var e,t=c.selectedRange(),n=c.getMarker(r),o=c.getMarker(a);if(!n||!o||!t)return!1;e=n.nextSibling===o,(t=i.createRange()).setStartBefore(n),t.setEndAfter(o),e&&t.collapse(!0),c.selectRange(t),c.removeMarkers()},c.selectOuterText=function(e,t){var n,o,i=c.cloneSelected();if(!i)return!1;i.collapse(!1),n=Me(i,!0,e),o=Me(i,!1,t),i.setStart(n.node,n.offset),i.setEnd(o.node,o.offset),c.selectRange(i)},c.getOuterText=function(e,t){var n=c.cloneSelected();return n?(n.collapse(!e),Me(n,e,t).text):""},c.replaceKeyword=function(e,t,n,o,i,r){n||e.sort(function(e,t){return e[0].length-t[0].length});var a,l,s,u,d,f,p,m,g=e.length,h=i?1:0,v=o||e[g-1][0].length;for(i&&v++,r=r||"",d=(a=c.getOuterText(!0,v)).length,a+=r,t&&(a+=c.getOuterText(!1,v));g--;)if(p=e[g][0],m=p.length,u=Math.max(0,d-m-h),s=-1,i?(l=a.substr(u).match(new RegExp("(^|[\\s ])"+G(p)+"(^|[\\s ])")))&&(s=l.index+u+l[1].length):s=a.indexOf(p,u),s>-1&&s<=d&&s+m+h>=d)return f=d-s,c.selectOuterText(f,m-f-(/^\S/.test(r)?1:0)),c.insertHTML(e[g][1]),!0;return!1},c.compare=function(e,t){return t||(t=c.selectedRange()),e&&t?0===e.compareBoundaryPoints(Range.END_TO_END,t)&&0===e.compareBoundaryPoints(Range.START_TO_START,t):!e&&!t},c.clear=function(){var t=e.getSelection();t&&(t.removeAllRanges?t.removeAllRanges():t.empty&&t.empty())}}function ne(e,t){var n=/[^\s\xA0\u2002\u2003\u2009\u00a0]+/,o=e&&p(e,"img[data-sceditor-emoticon]");if(e&&o.length)for(var i=0;i<o.length;i++){var r=o[i],a=r.parentNode,l=r.previousSibling,c=r.nextSibling;if(l&&n.test(l.nodeValue.slice(-1))||c&&n.test((c.nodeValue||"")[0])){var s=t.cloneSelected(),u=-1,f=s.startContainer,m=l.nodeValue;null===m&&(m=l.innerText||""),m+=C(r,"sceditor-emoticon"),f===c&&(u=m.length+s.startOffset),f===e&&e.childNodes[s.startOffset]===c&&(u=m.length),f===l&&(u=s.startOffset),c&&c.nodeType===fe||(c=a.insertBefore(a.ownerDocument.createTextNode(""),c)),c.insertData(0,m),d(l),d(r),u>-1&&(s.setStart(c,u),s.collapse(!0),t.selectRange(s))}}}function oe(e,t,n){var o=e.ownerDocument,i="(^|\\s| | | | |$)",a=[],l={};s(e,"code")||(r(t,function(e){l[e]=new RegExp(i+G(e)+i),a.push(e)}),a.sort(function(e,t){return t.length-e.length}),function e(i){for(i=i.firstChild;i;){if(i.nodeType!==de||E(i,"code")||e(i),i.nodeType===fe)for(var r=0;r<a.length;r++){var c=i.nodeValue,s=a[r],u=n?c.search(l[s]):c.indexOf(s);if(u>-1){var d=c.indexOf(s,u),f=L(t[s],o),p=c.substr(d+s.length);f.appendChild(o.createTextNode(p)),i.nodeValue=c.substr(0,d),i.parentNode.insertBefore(f,i.nextSibling)}}i=i.nextSibling}}(e))}function ie(e,t){var n;B(e,function(e){j(e,!0)?(n||T(n=l("p",{},t),e),e.nodeType===fe&&""===e.nodeValue||f(n,e)):n=null},!1,!0)}function re(e,t){var n,a,c,s,v,k,S,D,O,B,L,q,$,K,Q,G,Z,se,ue,me,he,ve,we,Ce,ke,Te,De,Me,_e,Ae,Oe,Be,Ie,Le,Ve,Pe,We,je,qe,Ue,$e,Ye,Ke,Xe,Qe,Ge,Je,Ze,et,tt,nt,ot,it,rt,at,lt,ct,st,ut,dt,ft,pt,mt=this,gt=e.get?e.get(0):e,ht={},vt=[],yt=[],bt={},xt={},wt={};mt.commands=o(!0,{},t.commands||Se);var Ct=mt.opts=o(!0,{},ge,t);mt.opts.emoticons=t.emoticons||ge.emoticons,Te=function(){gt._sceditor=mt,Ct.locale&&"en"!==Ct.locale&&Be(),T(a=l("div",{className:"sceditor-container"}),gt),w(a,"z-index",Ct.zIndex),He&&N(a,"ie ie"+He),ue=gt.required,gt.required=!1;var e=re.formats[Ct.format];"init"in(n=e?new e:{})&&n.init.call(mt),Oe(),We(),Ie(),Ae(),Le(),Ve(),xe||mt.toggleSourceMode(),et();var t=function(){g(Ne,"load",t),Ct.autofocus&&rt(),pt(),nt(),K.call("ready"),"onReady"in n&&n.onReady.call(mt)};m(Ne,"load",t),"complete"===Re.readyState&&t()},Oe=function(){var e=Ct.plugins;e=e?e.toString().split(","):[],K=new ee(mt),e.forEach(function(e){K.register(e.trim())})},Be=function(){var e;(q=re.locale[Ct.locale])||(e=Ct.locale.split("-"),q=re.locale[e[0]]),q&&q.dateFormat&&(Ct.dateFormat=q.dateFormat)},Ae=function(){S=l("textarea"),s=l("iframe",{frameborder:0,allowfullscreen:!0}),Ct.startInSourceMode?(N(a,"sourceMode"),y(s)):(N(a,"wysiwygMode"),y(S)),Ct.spellcheck||h(a,"spellcheck","false"),"https:"===Ne.location.protocol&&h(s,"src","javascript:false"),f(a,s),f(a,S),mt.dimensions(Ct.width||F(gt),Ct.height||z(gt));var e=He?"ie ie"+He:"";e+=be?" ios":"",(k=s.contentDocument).open(),k.write(Ee("html",{attrs:' class="'+e+'"',spellcheck:Ct.spellcheck?"":'spellcheck="false"',charset:Ct.charset,style:Ct.style})),k.close(),v=k.body,mt.readOnly(!!Ct.readOnly),(be||ye||He)&&(z(v,"100%"),He||m(v,"touchend",mt.focus));var t=h(gt,"tabindex");h(S,"tabindex",t),h(s,"tabindex",t),$=new te(s.contentWindow),y(gt),mt.val(gt.value);var n=Ct.placeholder||h(gt,"placeholder");n&&(S.placeholder=n,h(v,"placeholder",n))},Le=function(){Ct.autoUpdate&&(m(v,"blur",ft),m(S,"blur",ft)),null===Ct.rtl&&(Ct.rtl="rtl"===w(S,"direction")),mt.rtl(!!Ct.rtl),Ct.autoExpand&&(m(v,"load",pt,pe),m(k,"input keyup",pt)),Ct.resizeEnabled&&Pe(),h(a,"id",Ct.id),mt.emoticons(Ct.emoticonsEnabled)},Ve=function(){var e=gt.form,t="onselectionchange"in k?"selectionchange":"keyup focus blur contextmenu mouseup touchend click";m(Re,"click",Je),e&&(m(e,"reset",Ke),m(e,"submit",mt.updateOriginal,pe)),m(v,"keypress",Ye),m(v,"keydown",Ue),m(v,"keydown",$e),m(v,"keyup",nt),m(v,"blur",ut),m(v,"keyup",dt),m(v,"paste",je),m(v,"compositionstart compositionend",Qe),m(v,t,ot),m(v,"keydown keyup keypress focus blur contextmenu",Ge),Ct.emoticonsCompat&&Ne.getSelection&&m(v,"keyup",lt),m(v,"blur",function(){mt.val()||N(v,"placeholder")}),m(v,"focus",function(){R(v,"placeholder")}),m(S,"blur",ut),m(S,"keyup",dt),m(S,"keydown",Ue),m(S,"compositionstart compositionend",Qe),m(S,"keydown keyup keypress focus blur contextmenu",Ge),m(k,"mousedown",Xe),m(k,t,ot),m(k,"beforedeactivate keyup mouseup",_e),m(k,"keyup",nt),m(k,"focus",function(){O=null}),m(a,"selectionchanged",it),m(a,"selectionchanged",et),m(a,"selectionchanged valuechanged nodechanged",Ge)},Ie=function(){var e,t=mt.commands,n=(Ct.toolbarExclude||"").split(","),o=Ct.toolbar.split("|");c=l("div",{className:"sceditor-toolbar",unselectable:"on"}),Ct.icons in re.icons&&(ke=new re.icons[Ct.icons]),r(o,function(o,i){e=l("div",{className:"sceditor-group"}),r(i.split(","),function(o,i){var r,a,l=t[i];!l||n.indexOf(i)>-1||(a=l.shortcut,r=Ee("toolbarButton",{name:i,dispName:mt._(l.name||l.tooltip||i)},!0).firstChild,ke&&ke.create&&ke.create(i)&&(T(ke.create(i),r.firstChild),N(r,"has-icon")),r._sceTxtMode=!!l.txtExec,r._sceWysiwygMode=!!l.exec,H(r,"disabled",!l.exec),m(r,"click",function(e){M(r,"disabled")||Me(r,l),et(),e.preventDefault()}),m(r,"mousedown",function(e){mt.closeDropDown(),e.preventDefault()}),l.tooltip&&h(r,"title",mt._(l.tooltip)+(a?" ("+a+")":"")),a&&mt.addShortcut(a,i),l.state?yt.push({name:i,state:l.state}):ae(l.exec)&&yt.push({name:i,state:l.exec}),f(e,r),xt[i]=r)}),e.firstChild&&f(c,e)}),f(Ct.toolbarContainer||a,c)},Pe=function(){var e,t,n,o,i,r,c=l("div",{className:"sceditor-grip"}),s=l("div",{className:"sceditor-resize-cover"}),u="touchcancel touchend mouseup",d=0,p=0,h=0,v=0,x=0,w=0,C=F(a),E=z(a),k=!1,S=mt.rtl();if(e=Ct.resizeMinHeight||E/1.5,t=Ct.resizeMaxHeight||2.5*E,n=Ct.resizeMinWidth||C/1.25,o=Ct.resizeMaxWidth||1.25*C,i=function(i){"touchmove"===i.type?(i=Ne.event,h=i.changedTouches[0].pageX,v=i.changedTouches[0].pageY):(h=i.pageX,v=i.pageY);var r=w+(v-p),a=S?x-(h-d):x+(h-d);o>0&&a>o&&(a=o),n>0&&a<n&&(a=n),Ct.resizeWidth||(a=!1),t>0&&r>t&&(r=t),e>0&&r<e&&(r=e),Ct.resizeHeight||(r=!1),(a||r)&&mt.dimensions(a,r),i.preventDefault()},r=function(e){k&&(k=!1,y(s),R(a,"resizing"),g(Re,"touchmove mousemove",i),g(Re,u,r),e.preventDefault())},ke&&ke.create){var T=ke.create("grip");T&&(f(c,T),N(c,"has-icon"))}f(a,c),f(a,s),y(s),m(c,"touchstart mousedown",function(e){"touchstart"===e.type?(e=Ne.event,d=e.touches[0].pageX,p=e.touches[0].pageY):(d=e.pageX,p=e.pageY),x=F(a),w=z(a),k=!0,N(a,"resizing"),b(s),m(Re,"touchmove mousemove",i),m(Re,u,r),e.preventDefault()})},We=function(){var e=Ct.emoticons,t=Ct.emoticonsRoot||"";e&&(wt=o({},e.more,e.dropdown,e.hidden)),r(wt,function(e,n){wt[e]=Ee("emoticon",{key:e,url:t+(n.url||n),tooltip:n.tooltip||e}),Ct.emoticonsEnabled&&vt.push(l("img",{src:t+(n.url||n)}))})},rt=function(){var e,t,n=v.firstChild,o=!!Ct.autofocusEnd;if(A(a)){if(mt.sourceMode())return t=o?S.value.length:0,void S.setSelectionRange(t,t);if(Y(v),o)for((n=v.lastChild)||(n=l("p",{},k),f(v,n));n.lastChild;)n=n.lastChild,!Fe&&E(n,"br")&&n.previousSibling&&(n=n.previousSibling);e=k.createRange(),W(n)?e.selectNodeContents(n):(e.setStartBefore(n),o&&e.setStartAfter(n)),e.collapse(!o),$.selectRange(e),Z=e,o&&(v.scrollTop=v.scrollHeight),mt.focus()}},mt.readOnly=function(e){return"boolean"!=typeof e?!S.readonly:(v.contentEditable=!e,S.readonly=!e,Ze(e),mt)},mt.rtl=function(e){var t=e?"rtl":"ltr";return"boolean"!=typeof e?"rtl"===h(S,"dir"):(h(v,"dir",t),h(S,"dir",t),R(a,"rtl"),R(a,"ltr"),N(a,t),ke&&ke.rtl&&ke.rtl(e),mt)},Ze=function(e){var t=mt.inSourceMode()?"_sceTxtMode":"_sceWysiwygMode";r(xt,function(n,o){H(o,"disabled",e||!o[t])})},mt.width=function(e,t){return e||0===e?(mt.dimensions(e,null,t),mt):F(a)},mt.dimensions=function(e,t,n){return e=!(!e&&0!==e)&&e,t=!(!t&&0!==t)&&t,!1===e&&!1===t?{width:mt.width(),height:mt.height()}:(!1!==e&&(!1!==n&&(Ct.width=e),F(a,e)),!1!==t&&(!1!==n&&(Ct.height=t),z(a,t)),mt)},mt.height=function(e,t){return e||0===e?(mt.dimensions(null,e,t),mt):z(a)},mt.maximize=function(e){return le(e)?M(a,"sceditor-maximize"):((e=!!e)&&(we=Ne.pageYOffset),H(Re.documentElement,"sceditor-maximize",e),H(Re.body,"sceditor-maximize",e),H(a,"sceditor-maximize",e),mt.width(e?"100%":Ct.width,!1),mt.height(e?"100%":Ct.height,!1),e||Ne.scrollTo(0,we),pt(),mt)},pt=function(){Ct.autoExpand&&!ve&&setTimeout(mt.expandToContent,200)},mt.expandToContent=function(e){if(!mt.maximize()){if(ve=!1,!he){var t=Ct.resizeMinHeight||Ct.height||z(gt);he={min:t,max:Ct.resizeMaxHeight||2*t}}var n=Re.createRange();n.selectNodeContents(v);var o=n.getBoundingClientRect(),i=k.documentElement.clientHeight,r=o.bottom-o.top,a=mt.height()+(r-i);e||-1===he.max||(a=Math.min(a,he.max)),mt.height(Math.ceil(Math.max(a,he.min)))}},mt.destroy=function(){if(K){K.destroy(),$=null,O=null,K=null,D&&d(D),g(Re,"click",Je);var e=gt.form;e&&(g(e,"reset",Ke),g(e,"submit",mt.updateOriginal)),d(S),d(c),d(a),delete gt._sceditor,b(gt),gt.required=ue}},mt.createDropDown=function(e,t,n,i){var a,c="sceditor-"+t;mt.closeDropDown(!0),D&&M(D,c)||(!1!==i&&r(p(n,":not(input):not(textarea)"),function(e,t){t.nodeType===de&&h(t,"unselectable","on")}),a=o({top:X(e).top,left:X(e).left,marginTop:e.clientHeight},Ct.dropDownCss),w(D=l("div",{className:"sceditor-dropdown "+c}),a),f(D,n),f(Re.body,D),m(D,"click focusin",function(e){e.stopPropagation()}),setTimeout(function(){if(D){var e=p(D,"input,textarea")[0];e&&e.focus()}}))},Je=function(e){3!==e.which&&D&&!e.defaultPrevented&&(ft(),mt.closeDropDown())},je=function(e){var t=He||ye,n=v,o=e.clipboardData;if(o&&!t){var i={},r=o.types,a=o.items;e.preventDefault();for(var l=0;l<r.length;l++){if(Ne.FileReader&&a&&ze.test(a[l].type))return function(e){var t=new FileReader;t.onload=function(e){qe({html:'<img src="'+e.target.result+'" />'})},t.readAsDataURL(e)}(o.items[l].getAsFile());i[r[l]]=o.getData(r[l])}i.text=i["text/plain"],i.html=i["text/html"],qe(i)}else if(!Ce){var c=n.scrollTop;for($.saveRange(),Ce=Re.createDocumentFragment();n.firstChild;)f(Ce,n.firstChild);setTimeout(function(){var e=n.innerHTML;n.innerHTML="",f(n,Ce),n.scrollTop=c,Ce=!1,$.restoreRange(),qe({html:e})},0)}},qe=function(e){var t=l("div",{},k);K.call("pasteRaw",e),e.html?(t.innerHTML=e.html,U(t)):t.innerHTML=J(e.text||"");var o={val:t.innerHTML};"fragmentToSource"in n&&(o.val=n.fragmentToSource(o.val,k,Q)),K.call("paste",o),"fragmentToHtml"in n&&(o.val=n.fragmentToHtml(o.val,Q)),K.call("pasteHtml",o),mt.wysiwygEditorInsertHtml(o.val,null,!0)},mt.closeDropDown=function(e){D&&(d(D),D=null),!0===e&&mt.focus()},mt.wysiwygEditorInsertHtml=function(e,t,n){var o,i,r,a=z(s);mt.focus(),!n&&u(G,"code")||($.insertHTML(e,t),$.saveRange(),De(),b(o=p(v,"#sceditor-end-marker")[0]),i=v.scrollTop,r=X(o).top+1.5*o.offsetHeight-a,y(o),(r>i||r+a<i)&&(v.scrollTop=r),st(!1),$.restoreRange(),nt())},mt.wysiwygEditorInsertText=function(e,t){mt.wysiwygEditorInsertHtml(J(e),J(t))},mt.insertText=function(e,t){return mt.inSourceMode()?mt.sourceEditorInsertText(e,t):mt.wysiwygEditorInsertText(e,t),mt},mt.sourceEditorInsertText=function(e,t){var n,o,i=S.selectionStart,r=S.selectionEnd;n=S.scrollTop,S.focus(),o=S.value,t&&(e+=o.substring(i,r)+t),S.value=o.substring(0,i)+e+o.substring(r,o.length),S.selectionStart=i+e.length-(t?t.length:0),S.selectionEnd=S.selectionStart,S.scrollTop=n,S.focus(),st()},mt.getRangeHelper=function(){return $},mt.sourceEditorCaret=function(e){return S.focus(),e?(S.selectionStart=e.start,S.selectionEnd=e.end,this):{start:S.selectionStart,end:S.selectionEnd}},mt.val=function(e,t){return ae(e)?(mt.inSourceMode()?mt.setSourceEditorValue(e):(!1!==t&&"toHtml"in n&&(e=n.toHtml(e)),mt.setWysiwygEditorValue(e)),mt):mt.inSourceMode()?mt.getSourceEditorValue(!1):mt.getWysiwygEditorValue(t)},mt.insert=function(e,t,o,i,r){if(mt.inSourceMode())return mt.sourceEditorInsertText(e,t),mt;if(t){var a=$.selectedHtml();!1!==o&&"fragmentToSource"in n&&(a=n.fragmentToSource(a,k,Q)),e+=a+t}return!1!==o&&"fragmentToHtml"in n&&(e=n.fragmentToHtml(e,Q)),!1!==o&&!0===r&&(e=e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")),mt.wysiwygEditorInsertHtml(e),mt},mt.getWysiwygEditorValue=function(e){for(var t,o=l("div",{},k),i=v.childNodes,r=0;r<i.length;r++)f(o,i[r].cloneNode(!0));return f(v,o),U(o),d(o),t=o.innerHTML,!1!==e&&n.hasOwnProperty("toSource")&&(t=n.toSource(t,k)),t},mt.getBody=function(){return v},mt.getContentAreaContainer=function(){return s},mt.getSourceEditorValue=function(e){var t=S.value;return!1!==e&&"toHtml"in n&&(t=n.toHtml(t)),t},mt.setWysiwygEditorValue=function(e){e||(e="<p>"+(He?"":"<br />")+"</p>"),v.innerHTML=e,De(),nt(),st(),pt()},mt.setSourceEditorValue=function(e){S.value=e,st()},mt.updateOriginal=function(){gt.value=mt.val()},De=function(){Ct.emoticonsEnabled&&oe(v,wt,Ct.emoticonsCompat)},mt.inSourceMode=function(){return M(a,"sourceMode")},mt.sourceMode=function(e){var t=mt.inSourceMode();return"boolean"!=typeof e?t:((t&&!e||!t&&e)&&mt.toggleSourceMode(),mt)},mt.toggleSourceMode=function(){var e=mt.inSourceMode();!xe&&e||(e||($.saveRange(),$.clear()),mt.blur(),e?mt.setWysiwygEditorValue(mt.getSourceEditorValue()):mt.setSourceEditorValue(mt.getWysiwygEditorValue()),O=null,x(S),x(s),H(a,"wysiwygMode",e),H(a,"sourceMode",!e),Ze(),et())},tt=function(){return S.focus(),S.value.substring(S.selectionStart,S.selectionEnd)},Me=function(e,t){mt.inSourceMode()?t.txtExec&&(Array.isArray(t.txtExec)?mt.sourceEditorInsertText.apply(mt,t.txtExec):t.txtExec.call(mt,e,tt())):t.exec&&(ce(t.exec)?t.exec.call(mt,e):mt.execCommand(t.exec,t.hasOwnProperty("execParam")?t.execParam:null))},_e=function(){He&&(O=$.selectedRange())},mt.execCommand=function(e,t){var n=!1,o=mt.commands[e];if(mt.focus(),!u($.parentNode(),"code")){try{n=k.execCommand(e,!1,t)}catch(e){}!n&&o&&o.errorMessage&&alert(mt._(o.errorMessage)),et()}},ot=function(){function e(){if($&&!$.compare(Z)){if((Z=$.cloneSelected())&&Z.collapsed){var e=Z.startContainer,t=Z.startOffset;for(t&&e.nodeType!==fe&&(e=e.childNodes[t]);e&&e.parentNode!==v;)e=e.parentNode;e&&j(e,!0)&&($.saveRange(),ie(v,k),$.restoreRange())}_(a,"selectionchanged")}se=!1}se||(se=!0,"onselectionchange"in k?e():setTimeout(e,100))},it=function(){var e,t=$.parentNode();Q!==t&&(e=Q,Q=t,G=$.getFirstBlockParent(t),_(a,"nodechanged",{oldNode:e,newNode:Q}))},mt.currentNode=function(){return Q},mt.currentBlockNode=function(){return G},et=function(){var e,t,n=k,o=mt.sourceMode();if(mt.readOnly())r(p(c,"active"),function(e,t){R(t,"active")});else{o||(t=$.parentNode(),e=$.getFirstBlockParent(t));for(var i=0;i<yt.length;i++){var a=0,l=xt[yt[i].name],s=yt[i].state,u=o&&!l._sceTxtMode||!o&&!l._sceWysiwygMode;if(ae(s)){if(!o)try{(a=n.queryCommandEnabled(s)?0:-1)>-1&&(a=n.queryCommandState(s)?1:0)}catch(e){}}else u||(a=s.call(mt,t,e));H(l,"disabled",u||a<0),H(l,"active",a>0)}ke&&ke.update&&ke.update(o,t,e)}},Ye=function(e){if(!e.defaultPrevented&&(mt.closeDropDown(),13===e.which)&&!E(G,"li,ul,ol")&&V(G)){O=null;var t=l("br",{},k);if($.insertNode(t),!Fe){var n=t.parentNode,o=n.lastChild;o&&o.nodeType===fe&&""===o.nodeValue&&(d(o),o=n.lastChild),!j(n,!0)&&o===t&&j(t.previousSibling)&&$.insertHTML("<br>")}e.preventDefault()}},nt=function(){I(v,function(e){if(e.nodeType===de&&!/inline/.test(w(e,"display"))&&!E(e,".sceditor-nlf")&&V(e)){var t=l("p",{},k);return t.className="sceditor-nlf",t.innerHTML=Fe?"":"<br />",f(v,t),!1}if(3===e.nodeType&&!/^\s*$/.test(e.nodeValue)||E(e,"br"))return!1})},Ke=function(){mt.val(gt.value)},Xe=function(){mt.closeDropDown(),O=null},mt._=function(){var e=arguments;return q&&q[e[0]]&&(e[0]=q[e[0]]),e[0].replace(/\{(\d+)\}/g,function(t,n){return void 0!==e[n-0+1]?e[n-0+1]:"{"+n+"}"})},Ge=function(e){K&&K.call(e.type+"Event",e,mt);var t=(e.target===S?"scesrc":"scewys")+e.type;ht[t]&&ht[t].forEach(function(t){t.call(mt,e)})},mt.bind=function(e,t,n,o){for(var i=(e=e.split(" ")).length;i--;)if(ce(t)){var r="scewys"+e[i],a="scesrc"+e[i];n||(ht[r]=ht[r]||[],ht[r].push(t)),o||(ht[a]=ht[a]||[],ht[a].push(t)),"valuechanged"===e[i]&&(st.hasHandler=!0)}return mt},mt.unbind=function(e,t,n,o){for(var r=(e=e.split(" ")).length;r--;)ce(t)&&(n||i(ht["scewys"+e[r]]||[],t),o||i(ht["scesrc"+e[r]]||[],t));return mt},mt.blur=function(e,t,n){return ce(e)?mt.bind("blur",e,t,n):mt.sourceMode()?S.blur():v.blur(),mt},mt.focus=function(e,t,n){if(ce(e))mt.bind("focus",e,t,n);else if(mt.inSourceMode())S.focus();else{if(p(k,":focus").length)return;var o,i=$.selectedRange();Z||rt(),!Fe&&i&&1===i.endOffset&&i.collapsed&&(o=i.endContainer)&&1===o.childNodes.length&&E(o.firstChild,"br")&&(i.setStartBefore(o.firstChild),i.collapse(!0),$.selectRange(i)),s.contentWindow.focus(),v.focus(),O&&($.selectRange(O),O=null)}return et(),mt},mt.keyDown=function(e,t,n){return mt.bind("keydown",e,t,n)},mt.keyPress=function(e,t,n){return mt.bind("keypress",e,t,n)},mt.keyUp=function(e,t,n){return mt.bind("keyup",e,t,n)},mt.nodeChanged=function(e){return mt.bind("nodechanged",e,!1,!0)},mt.selectionChanged=function(e){return mt.bind("selectionchanged",e,!1,!0)},mt.valueChanged=function(e,t,n){return mt.bind("valuechanged",e,t,n)},at=function(e){var t=0,n=mt.emoticonsCache,o=String.fromCharCode(e.which);u(G,"code")||(n||(n=[],r(wt,function(e,o){n[t++]=[e,o]}),n.sort(function(e,t){return e[0].length-t[0].length}),mt.emoticonsCache=n,mt.longestEmoticonCode=n[n.length-1][0].length),$.replaceKeyword(mt.emoticonsCache,!0,!0,mt.longestEmoticonCode,Ct.emoticonsCompat,o)&&(Ct.emoticonsCompat&&/^\s$/.test(o)||e.preventDefault()))},lt=function(){ne(G,$)},mt.emoticons=function(e){return e||!1===e?(Ct.emoticonsEnabled=e,e?(m(v,"keypress",at),mt.sourceMode()||($.saveRange(),De(),st(!1),$.restoreRange())):(r(p(v,"img[data-sceditor-emoticon]"),function(e,t){var n=C(t,"sceditor-emoticon"),o=k.createTextNode(n);t.parentNode.replaceChild(o,t)}),g(v,"keypress",at),st()),mt):Ct.emoticonsEnabled},mt.css=function(e){return me||(me=l("style",{id:"inline"},k),f(k.head,me)),ae(e)?(me.styleSheet?me.styleSheet.cssText=e:me.innerHTML=e,mt):me.styleSheet?me.styleSheet.cssText:me.innerHTML},Ue=function(e){var t=[],n={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|","[":"{","]":"}"},o={8:"backspace",9:"tab",13:"enter",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",91:"win",92:"win",93:"select",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={109:"-",110:"del",111:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},r=e.which,a=o[r]||String.fromCharCode(r).toLowerCase();(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&(t.push("shift"),i[r]?a=i[r]:n[a]&&(a=n[a])),a&&(r<16||r>18)&&t.push(a),t=t.join("+"),bt[t]&&!1===bt[t].call(mt)&&(e.stopPropagation(),e.preventDefault())},mt.addShortcut=function(e,t){return e=e.toLowerCase(),ae(t)?bt[e]=function(){return Me(xt[t],mt.commands[t]),!1}:bt[e]=t,mt},mt.removeShortcut=function(e){return delete bt[e.toLowerCase()],mt},$e=function(e){var t,n,o;if(!Ct.disableBlockRemove&&8===e.which&&(n=$.selectedRange())&&(t=n.startContainer,0===n.startOffset&&(o=ct())&&!E(o,"body"))){for(;t!==o;){for(;t.previousSibling;)if((t=t.previousSibling).nodeType!==fe||t.nodeValue)return;if(!(t=t.parentNode))return}mt.clearBlockFormatting(o),e.preventDefault()}},ct=function(){for(var e=G;!V(e)||j(e,!0);)if(!(e=e.parentNode)||E(e,"body"))return;return e},mt.clearBlockFormatting=function(e){return!(e=e||ct())||E(e,"body")?mt:($.saveRange(),e.className="",O=null,h(e,"style",""),E(e,"p,div,td")||P(e,"p"),$.restoreRange(),mt)},st=function(e){if(K&&(K.hasHandler("valuechangedEvent")||st.hasHandler)){var t,n=mt.sourceMode(),o=!n&&$.hasSelection();B=!1,e=!1!==e&&!k.getElementById("sceditor-start-marker"),L&&(clearTimeout(L),L=!1),o&&e&&$.saveRange(),(t=n?S.value:v.innerHTML)!==st.lastVal&&(st.lastVal=t,_(a,"valuechanged",{rawValue:n?mt.val():t})),o&&e&&$.removeMarkers()}},ut=function(){L&&st()},dt=function(e){var t=e.which,n=dt.lastChar,o=13===n||32===n,i=8===n||46===n;dt.lastChar=t,B||(13===t||32===t?o?dt.triggerNext=!0:st():8===t||46===t?i?dt.triggerNext=!0:st():dt.triggerNext&&(st(),dt.triggerNext=!1),clearTimeout(L),L=setTimeout(function(){B||st()},1500))},Qe=function(e){(B=/start/i.test(e.type))||st()},ft=function(){mt.updateOriginal()},Te()}e=e&&e.hasOwnProperty("default")?e.default:e;var ae=t.bind(null,"string"),le=t.bind(null,"undefined"),ce=t.bind(null,"function"),se=t.bind(null,"number"),ue={},de=1,fe=3,pe=!0,me="|body|hr|p|div|h1|h2|h3|h4|h5|h6|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|blockquote|center|",ge={toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,paste,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,image,email,link,unlink|emoticon,youtube,date,time|ltr,rtl|print,maximize,source",toolbarExclude:null,style:"jquery.sceditor.default.css",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",colors:"#000000,#44B8FF,#1E92F7,#0074D9,#005DC2,#00369B,#b3d5f4|#444444,#C3FFFF,#9DF9FF,#7FDBFF,#68C4E8,#419DC1,#d9f4ff|#666666,#72FF84,#4CEA5E,#2ECC40,#17B529,#008E02,#c0f0c6|#888888,#FFFF44,#FFFA1E,#FFDC00,#E8C500,#C19E00,#fff5b3|#aaaaaa,#FFC95F,#FFA339,#FF851B,#E86E04,#C14700,#ffdbbb|#cccccc,#FF857A,#FF5F54,#FF4136,#E82A1F,#C10300,#ffc6c3|#eeeeee,#FF56FF,#FF30DC,#F012BE,#D900A7,#B20080,#fbb8ec|#ffffff,#F551FF,#CF2BE7,#B10DC9,#9A00B2,#9A00B2,#e8b6ef",locale:h(document.documentElement,"lang")||"en",charset:"utf-8",emoticonsCompat:!1,emoticonsEnabled:!0,emoticonsRoot:"",emoticons:{dropdown:{":)":"emoticons/smile.png",":angel:":"emoticons/angel.png",":angry:":"emoticons/angry.png","8-)":"emoticons/cool.png",":'(":"emoticons/cwy.png",":ermm:":"emoticons/ermm.png",":D":"emoticons/grin.png","<3":"emoticons/heart.png",":(":"emoticons/sad.png",":O":"emoticons/shocked.png",":P":"emoticons/tongue.png",";)":"emoticons/wink.png"},more:{":alien:":"emoticons/alien.png",":blink:":"emoticons/blink.png",":blush:":"emoticons/blush.png",":cheerful:":"emoticons/cheerful.png",":devil:":"emoticons/devil.png",":dizzy:":"emoticons/dizzy.png",":getlost:":"emoticons/getlost.png",":happy:":"emoticons/happy.png",":kissing:":"emoticons/kissing.png",":ninja:":"emoticons/ninja.png",":pinch:":"emoticons/pinch.png",":pouty:":"emoticons/pouty.png",":sick:":"emoticons/sick.png",":sideways:":"emoticons/sideways.png",":silly:":"emoticons/silly.png",":sleeping:":"emoticons/sleeping.png",":unsure:":"emoticons/unsure.png",":woot:":"emoticons/w00t.png",":wassat:":"emoticons/wassat.png"},hidden:{":whistling:":"emoticons/whistling.png",":love:":"emoticons/wub.png"}},width:null,height:null,resizeEnabled:!0,resizeMinWidth:null,resizeMinHeight:null,resizeMaxHeight:null,resizeMaxWidth:null,resizeHeight:!0,resizeWidth:!0,dateFormat:"year-month-day",toolbarContainer:null,enablePasteFiltering:!1,disablePasting:!1,readOnly:!1,rtl:!1,autofocus:!1,autofocusEnd:!0,autoExpand:!1,autoUpdate:!1,spellcheck:!0,runWithoutWysiwygSupport:!1,startInSourceMode:!1,id:null,plugins:"",zIndex:null,bbcodeTrim:!1,disableBlockRemove:!1,parserOptions:{},dropDownCss:{}},he=navigator.userAgent,ve=function(){var e=3,t=document,n=t.createElement("div"),o=n.getElementsByTagName("i");do{n.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(o[0]);return t.documentMode&&t.all&&window.atob&&(e=10),4===e&&t.documentMode&&(e=11),e>4?e:void 0}(),ye="-ms-ime-align"in document.documentElement.style,be=/iPhone|iPod|iPad| wosbrowser\//i.test(he),xe=function(){var e,t,n=document.createElement("div");return n.contentEditable=!0,"contentEditable"in document.documentElement&&"true"===n.contentEditable&&(t=/Opera Mobi|Opera Mini/i.test(he),/Android/i.test(he)&&(t=!0,/Safari/.test(he)&&(t=!(e=/Safari\/(\d+)/.exec(he))||!e[1]||e[1]<534)),/ Silk\//i.test(he)&&(t=!(e=/AppleWebKit\/(\d+)/.exec(he))||!e[1]||e[1]<534),be&&(t=/OS [0-4](_\d)+ like Mac/i.test(he)),/Firefox/i.test(he)&&(t=!1),/OneBrowser/i.test(he)&&(t=!1),"UCWEB"===navigator.vendor&&(t=!1),ve<=9&&(t=!0),!t)}(),we=/^(https?|s?ftp|mailto|spotify|skype|ssh|teamspeak|tel):|(\/\/)|data:image\/(png|bmp|gif|p?jpe?g);/i,Ce={html:'<!DOCTYPE html><html{attrs}><head><style>.ie * {min-height: auto !important} .ie table td {height:15px} @supports (-ms-ime-align:auto) { * { min-height: auto !important; } }</style><meta http-equiv="Content-Type" content="text/html;charset={charset}" /><link rel="stylesheet" type="text/css" href="{style}" /></head><body contenteditable="true" {spellcheck}><p></p></body></html>',toolbarButton:'<a class="sceditor-button sceditor-button-{name}" data-sceditor-command="{name}" unselectable="on"><div unselectable="on">{dispName}</div></a>',emoticon:'<img src="{url}" data-sceditor-emoticon="{key}" alt="{key}" title="{tooltip}" />',fontOpt:'<a class="sceditor-font-option" href="#" data-font="{font}"><font face="{font}">{font}</font></a>',sizeOpt:'<a class="sceditor-fontsize-option" data-size="{size}" href="#"><font size="{size}">{size}</font></a>',pastetext:'<div><label for="txt">{label}</label> <textarea cols="20" rows="7" id="txt"></textarea></div><div><input type="button" class="button" value="{insert}" /></div>',table:'<div><label for="rows">{rows}</label><input type="text" id="rows" value="2" /></div><div><label for="cols">{cols}</label><input type="text" id="cols" value="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',image:'<div><label for="link">{url}</label> <input type="text" id="image" placeholder="https://" /></div><div><label for="width">{width}</label> <input type="text" id="width" size="2" /></div><div><label for="height">{height}</label> <input type="text" id="height" size="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',email:'<div><label for="email">{label}</label> <input type="text" id="email" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{insert}" /></div>',link:'<div><label for="link">{url}</label> <input type="text" id="link" placeholder="https://" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{ins}" /></div>',youtubeMenu:'<div><label for="link">{label}</label> <input type="text" id="link" placeholder="https://" /></div><div><input type="button" class="button" value="{insert}" /></div>',youtube:'<iframe width="560" height="315" frameborder="0" allowfullscreensrc="https://www.youtube.com/embed/{id}?wmode=opaque&start={time}" data-youtube-id="{id}"></iframe>'},Ee=function(e,t,n){var o=Ce[e];return Object.keys(t).forEach(function(e){o=o.replace(new RegExp(G("{"+e+"}"),"g"),t[e])}),n&&(o=L(o)),o},ke=ve&&ve<11,Se={bold:{exec:"bold",tooltip:"Bold",shortcut:"Ctrl+B"},italic:{exec:"italic",tooltip:"Italic",shortcut:"Ctrl+I"},underline:{exec:"underline",tooltip:"Underline",shortcut:"Ctrl+U"},strike:{exec:"strikethrough",tooltip:"Strikethrough"},subscript:{exec:"subscript",tooltip:"Subscript"},superscript:{exec:"superscript",tooltip:"Superscript"},left:{exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(e,t,n){var o=l("div");m(o,"click","a",function(t){n(C(this,"font")),e.closeDropDown(!0),t.preventDefault()}),e.opts.fonts.split(",").forEach(function(e){f(o,Ee("fontOpt",{font:e},!0))}),e.createDropDown(t,"font-picker",o)},exec:function(e){var t=this;Se.font._dropDown(t,e,function(e){t.execCommand("fontname",e)})},tooltip:"Font Name"},size:{_dropDown:function(e,t,n){var o=l("div");m(o,"click","a",function(t){n(C(this,"size")),e.closeDropDown(!0),t.preventDefault()});for(var i=1;i<=7;i++)f(o,Ee("sizeOpt",{size:i},!0));e.createDropDown(t,"fontsize-picker",o)},exec:function(e){var t=this;Se.size._dropDown(t,e,function(e){t.execCommand("fontsize",e)})},tooltip:"Font Size"},color:{_dropDown:function(e,t,n){var o=l("div"),i="",r=Se.color;r._htmlCache||(e.opts.colors.split("|").forEach(function(e){i+='<div class="sceditor-color-column">',e.split(",").forEach(function(e){i+='<a href="#" class="sceditor-color-option" style="background-color: '+e+'" data-color="'+e+'"></a>'}),i+="</div>"}),r._htmlCache=i),f(o,L(r._htmlCache)),m(o,"click","a",function(t){n(C(this,"color")),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"color-picker",o)},exec:function(e){var t=this;Se.color._dropDown(t,e,function(e){t.execCommand("forecolor",e)})},tooltip:"Font Color"},removeformat:{exec:"removeformat",tooltip:"Remove Formatting"},cut:{exec:"cut",tooltip:"Cut",errorMessage:"Your browser does not allow the cut command. Please use the keyboard shortcut Ctrl/Cmd-X"},copy:{exec:"copy",tooltip:"Copy",errorMessage:"Your browser does not allow the copy command. Please use the keyboard shortcut Ctrl/Cmd-C"},paste:{exec:"paste",tooltip:"Paste",errorMessage:"Your browser does not allow the paste command. Please use the keyboard shortcut Ctrl/Cmd-V"},pastetext:{exec:function(e){var t,n=l("div"),o=this;f(n,Ee("pastetext",{label:o._("Paste your text inside the following box:"),insert:o._("Insert")},!0)),m(n,"click",".button",function(e){(t=p(n,"#txt")[0].value)&&o.wysiwygEditorInsertText(t),o.closeDropDown(!0),e.preventDefault()}),o.createDropDown(e,"pastetext",n)},tooltip:"Paste Text"},bulletlist:{exec:function(){Z(this),this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){Z(this),this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(e,t){var n,o,i,r=c(t,"ul,ol,menu");return r.length>1&&r[0].children.length>1?0:E(t,"ul,ol,menu")&&(n=this.getRangeHelper().selectedRange(),o=n.startContainer.parentNode,i=n.endContainer.parentNode,o!==o.parentNode.firstElementChild||E(i,"li")&&i!==i.parentNode.lastElementChild)?0:-1},exec:function(){var e=this,t=e.getRangeHelper().getFirstBlockParent();e.focus(),c(t,"ul,ol,menu")&&e.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(e,t){return u(t,"ul,ol,menu")>0?0:-1},exec:function(){c(this.getRangeHelper().getFirstBlockParent(),"ul,ol,menu")&&this.execCommand("outdent")},tooltip:"Remove one indent"},table:{exec:function(e){var t=this,n=l("div");f(n,Ee("table",{rows:t._("Rows:"),cols:t._("Cols:"),insert:t._("Insert")},!0)),m(n,"click",".button",function(e){var o=Number(p(n,"#rows")[0].value),i=Number(p(n,"#cols")[0].value),r="<table>";o>0&&i>0&&(r+=Array(o+1).join("<tr>"+Array(i+1).join("<td>"+(ke?"":"<br />")+"</td>")+"</tr>"),r+="</table>",t.wysiwygEditorInsertHtml(r),t.closeDropDown(!0),e.preventDefault())}),t.createDropDown(e,"inserttable",n)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("<code>",(ke?"":"<br />")+"</code>")},tooltip:"Code"},image:{_dropDown:function(e,t,n,o){var i=l("div");f(i,Ee("image",{url:e._("URL:"),width:e._("Width (optional):"),height:e._("Height (optional):"),insert:e._("Insert")},!0));var r=p(i,"#image")[0];r.value=n,m(i,"click",".button",function(t){r.value&&o(r.value,p(i,"#width")[0].value,p(i,"#height")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertimage",i)},exec:function(e){var t=this;Se.image._dropDown(t,e,"",function(e,n,o){var i="";n&&(i+=' width="'+n+'"'),o&&(i+=' height="'+o+'"'),t.wysiwygEditorInsertHtml("<img"+i+' src="'+e+'" />')})},tooltip:"Insert an image"},email:{_dropDown:function(e,t,n){var o=l("div");f(o,Ee("email",{label:e._("E-mail:"),desc:e._("Description (optional):"),insert:e._("Insert")},!0)),m(o,"click",".button",function(t){var i=p(o,"#email")[0].value;i&&n(i,p(o,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertemail",o)},exec:function(e){var t=this;Se.email._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?t.wysiwygEditorInsertHtml('<a href="mailto:'+e+'">'+(n||e)+"</a>"):t.execCommand("createlink","mailto:"+e)})},tooltip:"Insert an email"},link:{_dropDown:function(e,t,n){function o(t){r.value&&n(r.value,p(i,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}var i=l("div");f(i,Ee("link",{url:e._("URL:"),desc:e._("Description (optional):"),ins:e._("Insert")},!0));var r=p(i,"#link")[0];m(i,"click",".button",o),m(i,"keypress",function(e){13===e.which&&r.value&&o(e)},pe),e.createDropDown(t,"insertlink",i)},exec:function(e){var t=this;Se.link._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?(n=n||e,t.wysiwygEditorInsertHtml('<a href="'+e+'">'+n+"</a>")):t.execCommand("createlink",e)})},tooltip:"Insert a link"},unlink:{state:function(){return u(this.currentNode(),"a")?0:-1},exec:function(){var e=u(this.currentNode(),"a");if(e){for(;e.firstChild;)T(e.firstChild,e);d(e)}},tooltip:"Unlink"},quote:{exec:function(e,t,n){var o="<blockquote>",i="</blockquote>";t?(o=o+(n=n?"<cite>"+n+"</cite>":"")+t+i,i=null):""===this.getRangeHelper().selectedHtml()&&(i=(ke?"":"<br />")+i),this.wysiwygEditorInsertHtml(o,i)},tooltip:"Insert a Quote"},emoticon:{exec:function(e){var t=this,n=function(i){var a,c=t.opts.emoticonsCompat,s=t.getRangeHelper(),u=c&&" "!==s.getOuterText(!0,1)?" ":"",d=c&&" "!==s.getOuterText(!1,1)?" ":"",p=l("div"),g=l("div"),v=0,y=o({},t.opts.emoticons.dropdown,i?t.opts.emoticons.more:{});return f(p,g),v=Math.sqrt(Object.keys(y).length),m(p,"click","img",function(e){t.insert(u+h(this,"alt")+d,null,!1).closeDropDown(!0),e.preventDefault()}),r(y,function(e,t){f(g,l("img",{src:t.url||t,alt:e,title:t.tooltip||e})),g.children.length>=v&&(g=l("div"),f(p,g))}),!i&&t.opts.emoticons.more&&(f(a=l("a",{className:"sceditor-more"}),document.createTextNode(t._("More"))),m(a,"click",function(o){t.createDropDown(e,"more-emoticons",n(!0)),o.preventDefault()}),f(p,a)),p};t.createDropDown(e,"emoticons",n(!1))},txtExec:function(e){Se.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(e,t,n){var o=l("div");f(o,Ee("youtubeMenu",{label:e._("Video URL:"),insert:e._("Insert")},!0)),m(o,"click",".button",function(t){var i=p(o,"#link")[0].value,a=i.match(/(?:v=|v\/|embed\/|youtu.be\/)(.{11})/),l=i.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/),c=0;l&&r(l[1].split(/[hms]/),function(e,t){""!==t&&(c=60*c+Number(t))}),a&&/^[a-zA-Z0-9_\-]{11}$/.test(a[1])&&n(a[1],c),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertlink",o)},exec:function(e){var t=this;Se.youtube._dropDown(t,e,function(e,n){t.wysiwygEditorInsertHtml(Ee("youtube",{id:e,time:n}))})},tooltip:"Insert a YouTube video"},date:{_date:function(e){var t=new Date,n=t.getYear(),o=t.getMonth()+1,i=t.getDate();return n<2e3&&(n=1900+n),o<10&&(o="0"+o),i<10&&(i="0"+i),e.opts.dateFormat.replace(/year/i,n).replace(/month/i,o).replace(/day/i,i)},exec:function(){this.insertText(Se.date._date(this))},txtExec:function(){this.insertText(Se.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var e=new Date,t=e.getHours(),n=e.getMinutes(),o=e.getSeconds();return t<10&&(t="0"+t),n<10&&(n="0"+n),o<10&&(o="0"+o),t+":"+n+":"+o},exec:function(){this.insertText(Se.time._time())},txtExec:function(){this.insertText(Se.time._time())},tooltip:"Insert current time"},ltr:{state:function(e,t){return t&&"ltr"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!E(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!E(n,"body")))&&w(n,"direction","ltr"===w(n,"direction")?"":"ltr")},tooltip:"Left-to-Right"},rtl:{state:function(e,t){return t&&"rtl"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!E(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!E(n,"body")))&&w(n,"direction","rtl"===w(n,"direction")?"":"rtl")},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize())},txtExec:function(){this.maximize(!this.maximize())},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode()},txtExec:function(){this.toggleSourceMode()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}},Te={};ee.plugins=Te;var De=ve&&ve<11,Me=function(e,t,n){var o,i,r,a,l,c="",s=e.startContainer,u=e.startOffset;for(s&&3!==s.nodeType&&(s=s.childNodes[u],u=0),r=a=u;n>c.length&&s&&3===s.nodeType;)o=s.nodeValue,i=n-c.length,l&&(a=o.length,r=0),l=s,t?(u=r=Math.max(a-i,0),c=o.substr(r,a-r)+c,s=l.previousSibling):(u=r+(a=Math.min(i,o.length)),c+=o.substr(r,a),s=l.nextSibling);return{node:l||s,offset:u,text:c}},Ne=window,Re=document,He=ve,Fe=He&&He<11,ze=/^image\/(p?jpe?g|gif|png|bmp)$/i;re.locale={},re.formats={},re.icons={},re.command={get:function(e){return Se[e]||null},set:function(e,t){return!(!e||!t)&&(t=o(Se[e]||{},t),t.remove=function(){re.command.remove(e)},Se[e]=t,this)},remove:function(e){return Se[e]&&delete Se[e],this}},window.sceditor={command:re.command,commands:Se,defaultOptions:ge,ie:ve,ios:be,isWysiwygSupported:xe,regexEscape:G,escapeEntities:J,escapeUriScheme:function(e){var t,n=/^[^\/]*:/i,o=window.location;return e&&n.test(e)&&!we.test(e)?((t=o.pathname.split("/")).pop(),o.protocol+"//"+o.host+t.join("/")+"/"+e):e},dom:{css:w,attr:h,removeAttr:v,is:E,closest:u,width:F,height:z,traverse:B,rTraverse:I,parseHTML:L,hasStyling:V,convertElement:P,blockLevelList:me,canHaveChildren:W,isInline:j,copyCSS:q,fixNesting:U,findCommonAncestor:function(e,t){for(;e=e.parentNode;)if(k(e,t))return e},getSibling:$,removeWhiteSpace:Y,extractContents:K,getOffset:X,getStyle:Q,hasStyle:function(e,t,n){var o=Q(e,t);return!!o&&(!n||o===n||Array.isArray(n)&&n.indexOf(o)>-1)}},locale:re.locale,icons:re.icons,utils:{each:r,isEmptyObject:n,extend:o},plugins:ee.plugins,formats:re.formats,create:function(e,t){t=t||{},s(e,".sceditor-container")||(t.runWithoutWysiwygSupport||xe)&&new re(e,t)},instance:function(e){return e._sceditor}},e.sceditor=window.sceditor,e.fn.sceditor=function(t){var n,o=[];return this.each(function(){n=this._sceditor,"state"===t?o.push(!!n):"instance"===t?o.push(n):n||e.sceditor.create(this,t)}),o.length?1===o.length?o[0]:o:this}}(jQuery),function(e){"use strict";function t(){function o(e,t){v[e]&&v[e].forEach(function(n){n.tags[e]?u(n.tags[e],function(e,o){t.getAttributeNode&&(!(e=t.getAttributeNode(e))||o&&o.indexOf(e.value)<0||n.conv.call(h,t))}):n.conv&&n.conv.call(h,t)})}function r(e){n.traverse(e,function(e){var t=e.nodeName.toLowerCase();o("*",e),o(t,e)},!0)}function l(e,o){var i,r=e.childNodes,c=e.nodeName.toLowerCase(),s=e.nodeValue,u=r.length,d=t.allowedEmptyTags||[];if(o&&"br"===c)return!0;if(a(e,".sceditor-ignore"))return!0;if(d.indexOf(c)>-1||"td"===c||!n.canHaveChildren(e))return!1;if(s&&/\S|\u00A0/.test(s))return!1;for(;u--;)if(!l(r[u],o&&!e.previousSibling&&!e.nextSibling))return!1;return!e.getBoundingClientRect||!e.className&&!e.hasAttributes("style")||(!(i=e.getBoundingClientRect()).width||!i.height)}function c(e){n.traverse(e,function(o){var i,r=o.nodeName.toLowerCase(),a=o.parentNode,c=o.nodeType,s=!n.isInline(o),u=o.previousSibling,d=o.nextSibling,f=a===e,p=!u&&!d,m="iframe"!==r&&l(o,f&&p&&"br"!==r),g=o.ownerDocument,h=t.allowedTags,v=t.disallowedTags;if(3!==c&&(4===c?r="!cdata":"!"!==r&&8!==c||(r="!comment"),m?i=!0:h&&h.length?i=h.indexOf(r)<0:v&&v.length&&(i=v.indexOf(r)>-1),i)){if(!m){for(s&&u&&n.isInline(u)&&a.insertBefore(g.createTextNode(" "),o);o.firstChild;)a.insertBefore(o.firstChild,d);s&&d&&n.isInline(d)&&a.insertBefore(g.createTextNode(" "),d)}a.removeChild(o)}},!0)}function f(e,t){var n={};return e&&s(n,e),t?(u(t,function(e,t){Array.isArray(t)?n[e]=(n[e]||[]).concat(t):n[e]||(n[e]=null)}),n):n}function m(e){n.removeWhiteSpace(e);for(var t,o,i=e.firstChild;i;)o=i.nextSibling,n.isInline(i)&&!a(i,".sceditor-ignore")?(t||(t=e.ownerDocument.createElement("p"),i.parentNode.insertBefore(t,i)),t.appendChild(i)):t=null,i=o}function g(e){var o,i,r,a,l,c,s=t.allowedAttribs,u=s&&!d(s),p=t.disallowedAttribs,m=p&&!d(p);y={},n.traverse(e,function(e){if(e.attributes&&(o=e.nodeName.toLowerCase(),a=e.attributes.length))for(y[o]||(y[o]=u?f(s["*"],s[o]):f(p["*"],p[o]));a--;)i=e.attributes[a],r=i.name,l=y[o][r],c=!1,u?c=null!==l&&(!Array.isArray(l)||l.indexOf(i.value)<0):m&&(c=null===l||Array.isArray(l)&&l.indexOf(i.value)>-1),c&&e.removeAttribute(r)})}var h=this,v={},y={};h.init=function(){d(t.converters||{})||u(t.converters,function(e,t){u(t.tags,function(e){v[e]||(v[e]=[]),v[e].push(t)})}),this.commands=s(!0,{},p,this.commands)},h.toSource=function(t,n){var o,a=n.createElement("div");return a.innerHTML=t,i(a,"visibility","hidden"),n.body.appendChild(a),r(a),c(a),g(a),m(a),o=(new e.XHTMLSerializer).serialize(a,!0),n.body.removeChild(a),o},h.fragmentToSource=h.toSource}var n=e.dom,o=e.utils,i=n.css,r=n.attr,a=n.is,l=n.removeAttr,c=n.convertElement,s=o.extend,u=o.each,d=o.isEmptyObject,f=e.command.get,p={bold:{txtExec:["<strong>","</strong>"]},italic:{txtExec:["<em>","</em>"]},underline:{txtExec:['<span style="text-decoration:underline;">',"</span>"]},strike:{txtExec:['<span style="text-decoration:line-through;">',"</span>"]},subscript:{txtExec:["<sub>","</sub>"]},superscript:{txtExec:["<sup>","</sup>"]},left:{txtExec:['<div style="text-align:left;">',"</div>"]},center:{txtExec:['<div style="text-align:center;">',"</div>"]},right:{txtExec:['<div style="text-align:right;">',"</div>"]},justify:{txtExec:['<div style="text-align:justify;">',"</div>"]},font:{txtExec:function(e){var t=this;f("font")._dropDown(t,e,function(e){t.insertText('<span style="font-family:'+e+';">',"</span>")})}},size:{txtExec:function(e){var t=this;f("size")._dropDown(t,e,function(e){t.insertText('<span style="font-size:'+e+';">',"</span>")})}},color:{txtExec:function(e){var t=this;f("color")._dropDown(t,e,function(e){t.insertText('<span style="color:'+e+';">',"</span>")})}},bulletlist:{txtExec:["<ul><li>","</li></ul>"]},orderedlist:{txtExec:["<ol><li>","</li></ol>"]},table:{txtExec:["<table><tr><td>","</td></tr></table>"]},horizontalrule:{txtExec:["<hr />"]},code:{txtExec:["<code>","</code>"]},image:{txtExec:function(e,t){var n=this;f("image")._dropDown(n,e,t,function(e,t,o){var i="";t&&(i+=' width="'+t+'"'),o&&(i+=' height="'+o+'"'),n.insertText("<img"+i+' src="'+e+'" />')})}},email:{txtExec:function(e,t){var n=this;f("email")._dropDown(n,e,function(e,o){n.insertText('<a href="mailto:'+e+'">'+(o||t||e)+"</a>")})}},link:{txtExec:function(e,t){var n=this;f("link")._dropDown(n,e,function(e,o){n.insertText('<a href="'+e+'">'+(o||t||e)+"</a>")})}},quote:{txtExec:["<blockquote>","</blockquote>"]},youtube:{txtExec:function(e){var t=this;f("youtube")._dropDown(t,e,function(e,n){t.insertText('<iframe width="560" height="315" src="https://www.youtube.com/embed/{id}?wmode=opaque&start='+n+'" data-youtube-id="'+e+'" frameborder="0" allowfullscreen></iframe>')})}},rtl:{txtExec:['<div stlye="direction:rtl;">',"</div>"]},ltr:{txtExec:['<div stlye="direction:ltr;">',"</div>"]}};e.XHTMLSerializer=function(){function e(e){var t={"&":"&","<":"<",">":">",'"':"""," ":" "};return e?e.replace(/[&<>"\xa0]/g,function(e){return t[e]||e}):""}function t(e){return e.replace(/[\r\n]/," ").replace(/[^\S|\u00A0]+/g," ")}function o(e,t){switch(e.nodeType){case 1:"!"===e.nodeName.toLowerCase()?s(e):l(e,t);break;case 3:u(e,t);break;case 4:c(e);break;case 8:s(e);break;case 9:case 11:r(e)}}function r(e){for(var t=e.firstChild;t;)o(t),t=t.nextSibling}function l(t,r){var l,c,s,u=t.nodeName.toLowerCase(),p="iframe"===u,m=t.attributes.length,h=t.firstChild,v=r||/pre(?:\-wrap)?$/i.test(i(t,"whiteSpace")),y=!t.firstChild&&!n.canHaveChildren(t)&&!p;if(!a(t,".sceditor-ignore")){for(d("<"+u,!r&&f(t));m--;)s=(c=t.attributes[m]).value,d(" "+c.name.toLowerCase()+'="'+e(s)+'"',!1);for(d(y?" />":">",!1),p||(l=h);l;)g++,o(l,v),l=l.nextSibling,g--;y||d("</"+u+">",!v&&!p&&f(t)&&h&&f(h))}}function c(t){d("<![CDATA["+e(t.nodeValue)+"]]>")}function s(t){d("\x3c!-- "+e(t.nodeValue)+" --\x3e")}function u(n,o){var i=n.nodeValue;o||(i=t(i)),i&&d(e(i),!o&&f(n))}function d(e,t){var n=g;if(!1!==t)for(m.length&&m.push("\n");n--;)m.push(p.indentStr);m.push(e)}function f(e){var t=e.previousSibling;return 1!==e.nodeType&&t?!n.isInline(t):!t&&!n.isInline(e.parentNode)||!n.isInline(e)}var p={indentStr:"\t"},m=[],g=0;this.serialize=function(e,t){if(m=[],t)for(e=e.firstChild;e;)o(e),e=e.nextSibling;else o(e);return m.join("")}},t.converters=[{tags:{"*":{width:null}},conv:function(e){i(e,"width",r(e,"width")),l(e,"width")}},{tags:{"*":{height:null}},conv:function(e){i(e,"height",r(e,"height")),l(e,"height")}},{tags:{li:{value:null}},conv:function(e){l(e,"value")}},{tags:{"*":{text:null}},conv:function(e){i(e,"color",r(e,"text")),l(e,"text")}},{tags:{"*":{color:null}},conv:function(e){i(e,"color",r(e,"color")),l(e,"color")}},{tags:{"*":{face:null}},conv:function(e){i(e,"fontFamily",r(e,"face")),l(e,"face")}},{tags:{"*":{align:null}},conv:function(e){i(e,"textAlign",r(e,"align")),l(e,"align")}},{tags:{"*":{border:null}},conv:function(e){i(e,"borderWidth",r(e,"border")),l(e,"border")}},{tags:{applet:{name:null},img:{name:null},layer:{name:null},map:{name:null},object:{name:null},param:{name:null}},conv:function(e){r(e,"id")||r(e,"id",r(e,"name")),l(e,"name")}},{tags:{"*":{vspace:null}},conv:function(e){i(e,"marginTop",r(e,"vspace")-0),i(e,"marginBottom",r(e,"vspace")-0),l(e,"vspace")}},{tags:{"*":{hspace:null}},conv:function(e){i(e,"marginLeft",r(e,"hspace")-0),i(e,"marginRight",r(e,"hspace")-0),l(e,"hspace")}},{tags:{hr:{noshade:null}},conv:function(e){i(e,"borderStyle","solid"),l(e,"noshade")}},{tags:{"*":{nowrap:null}},conv:function(e){i(e,"whiteSpace","nowrap"),l(e,"nowrap")}},{tags:{big:null},conv:function(e){i(c(e,"span"),"fontSize","larger")}},{tags:{small:null},conv:function(e){i(c(e,"span"),"fontSize","smaller")}},{tags:{b:null},conv:function(e){c(e,"strong")}},{tags:{u:null},conv:function(e){i(c(e,"span"),"textDecoration","underline")}},{tags:{s:null,strike:null},conv:function(e){i(c(e,"span"),"textDecoration","line-through")}},{tags:{dir:null},conv:function(e){c(e,"ul")}},{tags:{center:null},conv:function(e){i(c(e,"div"),"textAlign","center")}},{tags:{font:{size:null}},conv:function(e){i(e,"fontSize",i(e,"fontSize")),l(e,"size")}},{tags:{font:null},conv:function(e){c(e,"span")}},{tags:{"*":{type:["_moz"]}},conv:function(e){l(e,"type")}},{tags:{"*":{_moz_dirty:null}},conv:function(e){l(e,"_moz_dirty")}},{tags:{"*":{_moz_editor_bogus_node:null}},conv:function(e){e.parentNode.removeChild(e)}}],t.allowedAttribs={},t.disallowedAttribs={},t.allowedTags=[],t.disallowedTags=[],t.allowedEmptyTags=[],e.formats.xhtml=t}(sceditor); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(e,t){"use strict";function n(e){return'<iframe width="560" height="315" frameborder="0" src="https://www.youtube-nocookie.com/embed/'+e+'" data-youtube-id="'+e+'" allowfullscreen></iframe>'}function o(t){for(var s=t.firstChild;s;){if(3===s.nodeType){var u=s.nodeValue,a=s.parentNode,c=u.match(r);c&&(a.insertBefore(e.createTextNode(u.substr(0,c.index)+c[1]),s),a.insertBefore(i.parseHTML(n(c[2])),s),s.nodeValue=c[3]+u.substr(c.index+c[0].length))}else i.is(s,"code")||o(s);s=s.nextSibling}}var i=t.dom,r=/(^|\s)(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/watch\?v=)([^"&?\/ ]{11})(?:\&[\&_\?0-9a-z\#]+)?(\s|$)/i;t.plugins.autoyoutube=function(){this.signalPasteRaw=function(t){if(!i.closest(this.currentNode(),"code")&&(t.html||t.text)){var n=e.createElement("div");t.html?n.innerHTML=t.html:n.textContent=t.text,o(n),t.html=n.innerHTML}}}}(document,sceditor); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(e){"use strict";function n(e){for(var n=e.substr(5,e.indexOf(";")-5),t=atob(e.substr(e.indexOf(",")+1)),r=new Uint8Array(t.length),i=0;i<t.length;i++)r[i]=t[i].charCodeAt(0);try{return new Blob([r],{type:n})}catch(e){return null}}var t="data:image/gif;base64,R0lGODlhlgBkAPABAH19ffb29iH5BAAKAAAAIf4aQ3JlYXRlZCB3aXRoIGFqYXhsb2FkLmluZm8AIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAlgBkAAAC1YyPqcvtD6OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofEovGITCqXzKbzCY1Kp9Sq9YrNarfcrvcLDovH5LL5jE6r1+y2+w2Py+f0uv2OvwD2fP6iD/gH6Pc2GIhg2JeQSNjGuLf4GMlYKIloefAIUEl52ZmJyaY5mUhqyFnqmQr6KRoaMKp66hbLumpQ69oK+5qrOyg4a6qYV2x8jJysvMzc7PwMHS09TV1tfY2drb3N3e39DR4uPk5ebn6Onq6+zt7u/g4fL99UAAAh+QQACgAAACwAAAAAlgBkAIEAAAB9fX329vYAAAAC3JSPqcvtD6OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofEovGITCqXzKbzCY1Kp9Sq9YrNarfcrvcLDovH5LL5jE6r1+y2+w2Py+f0uv2OvwD2fP4iABgY+CcoCNeHuJdQyLjIaOiWiOj4CEhZ+SbZd/nI2RipqYhQOThKGpAZCuBZyArZprpqSupaCqtaazmLCRqai7rb2av5W5wqSShcm8fc7PwMHS09TV1tfY2drb3N3e39DR4uPk5ebn6Onq6+zt7u/g4fLz9PX29/j5/vVAAAIfkEAAoAAAAsAAAAAJYAZACBAAAAfX199vb2AAAAAuCUj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9jr8E9nz+AgAYGLjQVwhXiJgguAiYgGjo9tinyCjoKLn3hpmJUGmJsBmguUnpCXCJOZraaXoKShoJe9DqehCqKlnqiZobuzrbyvuIO8xqKpxIPKlwrPCbBx0tPU1dbX2Nna29zd3t/Q0eLj5OXm5+jp6uvs7e7v4OHy8/T19vf4+fr7/P379UAAAh+QQACgAAACwAAAAAlgBkAIEAAAB9fX329vYAAAAC4JSPqcvtD6OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofEovGITCqXzKbzCY1Kp9Sq9YrNarfcrvcLDovH5LL5jE6r1+y2+w2Py+f0uv2OvwT2fP6iD7gAMEhICAeImIAYiFDoOPi22KcouZfw6BhZGUBZeYlp6LbJiTD6CQqg6Vm6eQqqKtkZ24iaKtrKunpQa9tmmju7Wwu7KFtMi3oYDMzompkHHS09TV1tfY2drb3N3e39DR4uPk5ebn6Onq6+zt7u/g4fLz9PX29/j5+vv8/f31QAADs=",r=void 0!==window.FileReader,i=/data:[^;]+;base64,/i;e.plugins.dragdrop=function(){function a(){g.style.display="none",u.className=u.className.replace(/(^| )dnd( |$)/g,"")}function A(){"none"===g.style.display&&(g.style.display="block",u.className+=" dnd")}function o(e){return!("application/x-moz-file"!==e.type&&f.allowedTypes&&f.allowedTypes.indexOf(e.type)<0)&&(!f.isAllowed||f.isAllowed(e))}function d(e){function n(e){var n=v.getBody().ownerDocument.getElementById(r.id);n&&("string"==typeof e&&n.insertAdjacentHTML("afterend",e),n.parentNode.removeChild(n))}var r=document.createElement("img");return r.src=t,r.className="sceditor-ignore",r.id="sce-dragdrop-"+m++,function(){return e?e.parentNode.replaceChild(r,e):v.wysiwygEditorInsertHtml(r.outerHTML),{insert:function(e){n(e)},cancel:n}}}function s(e){for(var n=e.dataTransfer,t=n.files.length||!n.items?n.files:n.items,r=0;r<t.length;r++)if("string"===t[r].kind)return;A(),e.preventDefault()}function l(e){var n=e.dataTransfer,t=n.files.length||!n.items?n.files:n.items;a();for(var r=0;r<t.length;r++){if("string"===t[r].kind)return;o(t[r])&&c(t[r],d())}e.preventDefault()}if(r){var f,v,c,u,g,p=this,m=0;p.signalReady=function(){f=(v=this).opts.dragdrop||{},c=f.handleFile,u=v.getContentAreaContainer().parentNode,g=u.appendChild(e.dom.parseHTML('<div class="sceditor-dnd-cover" style="display: none"><p>'+v._("Drop files here")+"</p></div>").firstChild),u.addEventListener("dragover",s),u.addEventListener("dragleave",a),u.addEventListener("dragend",a),u.addEventListener("drop",l),v.getBody().addEventListener("dragover",s),v.getBody().addEventListener("drop",a)},p.signalPasteHtml=function(e){if(!("handlePaste"in f)||f.handlePaste){var t=document.createElement("div");t.innerHTML=e.val;for(var r=t.querySelectorAll("img"),a=0;a<r.length;a++){var A=r[a];if(i.test(A.src)){var s=n(A.src);s&&o(s)?c(s,d(A)):A.parentNode.removeChild(A)}}e.val=t.innerHTML}}}}}(sceditor); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(e){"use strict";e.plugins.format=function(){var t,a,o={p:"Paragraph",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",address:"Address",pre:"Preformatted Text"};this.init=function(){var t=this.opts,n=t.paragraphformat;t.plugins&&t.plugins.indexOf("bbcode")>-1||(n&&(n.tags&&(o=n.tags),n.excludeTags&&n.excludeTags.forEach(function(e){delete o[e]})),this.commands.format||(this.commands.format={exec:a,txtExec:a,tooltip:"Format Paragraph"}),t.toolbar===e.defaultOptions.toolbar&&(t.toolbar=t.toolbar.replace(",color,",",color,format,")))},t=function(e,t){e.sourceMode()?e.insert("<"+t+">","</"+t+">"):e.execCommand("formatblock","<"+t+">")},a=function(a){var n=this,r=document.createElement("div");e.utils.each(o,function(e,a){var o=document.createElement("a");o.className="sceditor-option",o.textContent=a.name||a,o.addEventListener("click",function(o){n.closeDropDown(!0),a.exec?a.exec(n):t(n,e),o.preventDefault()}),r.appendChild(o)}),n.createDropDown(a,"format",r)}}}(sceditor); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(t){"use strict";var n=t.utils.extend;t.plugins.plaintext=function(){var t=!0;this.init=function(){var e=this.commands,i=this.opts;i&&i.plaintext&&i.plaintext.addButton&&(t=i.plaintext.enabled,e.pastetext=n(e.pastetext||{},{state:function(){return t?1:0},exec:function(){t=!t}}))},this.signalPasteRaw=function(n){if(t){if(n.html&&!n.text){var e=document.createElement("div");e.innerHTML=n.html,n.text=e.innerText}n.html=null}}}}(sceditor); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(e){"use strict";e.plugins.undo=function(){var e,t,r=this,o=0,u=50,a=[],n=[],c=!1,s=function(r){c=!0,t=r.value,e.sourceMode(r.sourceMode),e.val(r.value,!1),e.focus(),r.sourceMode?e.sourceEditorCaret(r.caret):e.getRangeHelper().restoreRange(),c=!1},l=function(e,t){var r,o,u,a,n=e.length,c=t.length,s=Math.max(n,c);for(r=0;r<s&&e.charAt(r)===t.charAt(r);r++);for(u=n<c?c-n:0,a=c<n?n-c:0,o=s-1;o>=0&&e.charAt(o-u)===t.charAt(o-a);o--);return o-r+1};r.init=function(){u=(e=this).undoLimit||u,e.addShortcut("ctrl+z",r.undo),e.addShortcut("ctrl+shift+z",r.redo),e.addShortcut("ctrl+y",r.redo)},r.undo=function(){var t=n.pop(),r=e.val(null,!1);return t&&!a.length&&r===t.value&&(t=n.pop()),t&&(a.length||a.push({caret:e.sourceEditorCaret(),sourceMode:e.sourceMode(),value:r}),a.push(t),s(t)),!1},r.redo=function(){var e=a.pop();return n.length||(n.push(e),e=a.pop()),e&&(n.push(e),s(e)),!1},r.signalReady=function(){var r=e.val(null,!1);t=r,n.push({caret:this.sourceEditorCaret(),sourceMode:this.sourceMode(),value:r})},r.signalValuechangedEvent=function(r){var s=r.detail.rawValue;u>0&&n.length>u&&n.shift(),!c&&t&&t!==s&&(a.length=0,(o+=l(t,s))<20||o<50&&!/\s$/g.test(r.rawValue)||(n.push({caret:e.sourceEditorCaret(),sourceMode:e.sourceMode(),value:s}),o=0,t=s))}}}(sceditor); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(t,e){"use strict";function n(t){if(t._scePatched)return t;var n=function(){for(var n=[],c=0;c<arguments.length;c++){var r=arguments[c];r&&r.nodeType?n.push(e(r)):n.push(r)}return t.apply(this,n)};return n._scePatched=!0,n}function c(t){if(t._scePatched)return t;var n=function(){return e(t.apply(this,arguments))};return n._scePatched=!0,n}var r=t.plugins,o=t.command.set;if(t.command.set=function(t,e){return e&&"function"==typeof e.exec&&(e.exec=n(e.exec)),e&&"function"==typeof e.txtExec&&(e.txtExec=n(e.txtExec)),o.call(this,t,e)},r.bbcode){var a=r.bbcode.bbcode.set;r.bbcode.bbcode.set=function(t,e){return e&&"function"==typeof e.format&&(e.format=n(e.format)),a.call(this,t,e)}}var i=t.create;t.create=function(t,e){if(i.call(this,t,e),t&&t._sceditor){var n=t._sceditor;n.getBody=c(n.getBody),n.getContentAreaContainer=c(n.getContentAreaContainer)}}}(sceditor,jQuery); |
@@ -1,3 +0,3 @@ | ||
/* SCEditor v2.0.0-beta1 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
/* SCEditor v2.0.0 | (C) 2017, Sam Clarke | sceditor.com/license */ | ||
!function(){"use strict";function e(e,t){return typeof t===e}function t(e){return!Object.keys(e).length}function n(e,t){for(var o=e===!!e,i=o?2:1,r=o?t:e,a=!!o&&e;i<arguments.length;i++){var l=arguments[i];for(var c in l){var s=l[c];if(!ae(s)){var u=null!==s&&"object"==typeof s,d=Array.isArray(s);r[c]=a&&(u||d)?n(!0,r[c]||(d?[]:{}),s):s}}}return r}function o(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}function i(e,t){if(Array.isArray(e)||"length"in e&&ce(e.length))for(var n=0;n<e.length;n++)t(n,e[n]);else Object.keys(e).forEach(function(n){t(n,e[n])})}function r(e){return e=parseFloat(e),isFinite(e)?e:0}function a(e,t,n){var o=(n||document).createElement(e);return i(t||{},function(e,t){"style"===e?o.style.cssText=t:e in o?o[e]=t:o.setAttribute(e,t)}),o}function l(e,t){for(var n=[],o=e||{};(o=o.parentNode)&&!/(9|11)/.test(o.nodeType);)t&&!C(o,t)||n.push(o);return n}function c(e,t){for(var n=e||{};(n=n.parentNode)&&!/(9|11)/.test(n.nodeType);)if(!t||C(n,t))return n}function s(e,t){return C(e,t)?e:c(e,t)}function u(e){e.parentNode.removeChild(e)}function d(e,t){e.appendChild(t)}function f(e,t){return e.querySelectorAll(t)}function p(e,t,n,o,i){t.split(" ").forEach(function(t){var r;re(n)?(r=o["_sce-event-"+t+n]||function(t){for(var i=t.target;i&&i!==e;){if(C(i,n))return void o.call(i,t);i=i.parentNode}},o["_sce-event-"+t+n]=r):(r=n,i=o),e.addEventListener(t,r,i||!1)})}function m(e,t,n,o,i){t.split(" ").forEach(function(t){var r;re(n)?r=o["_sce-event-"+t+n]:(r=n,i=o),e.removeEventListener(t,r,i||!1)})}function g(e,t,n){if(arguments.length<3)return e.getAttribute(t);null==n?h(e,t):e.setAttribute(t,n)}function h(e,t){e.removeAttribute(t)}function v(e){x(e,"display","none")}function y(e){x(e,"display","")}function b(e){_(e)?v(e):y(e)}function x(e,t,n){if(arguments.length<3){if(re(t))return getComputedStyle(e)[t];i(t,function(t,n){x(e,t,n)})}else{var o=(n||0===n)&&!isNaN(n);e.style[t]=o?n+"px":n}}function w(e,t,n){var o=arguments.length,r={};if(e.nodeType===ue){if(1===o)return i(e.attributes,function(e,t){/^data\-/i.test(t.name)&&(r[t.name.substr(5)]=t.value)}),r;if(2===o)return g(e,"data-"+t);g(e,"data-"+t,String(n))}}function C(e,t){var n=!1;if(e&&e.nodeType===ue){n=(e.matches||e.msMatchesSelector||e.webkitMatchesSelector).call(e,t)}return n}function k(e,t){return e!==t&&e.contains&&e.contains(t)}function E(e,t){var n=e.previousElementSibling;return t&&n?C(n,t)?n:null:n}function S(e,t){return t.parentNode.insertBefore(e,t)}function D(e){return e.className.trim().split(/\s+/)}function T(e,t){return C(e,"."+t)}function M(e,t){var n=D(e);n.indexOf(t)<0&&n.push(t),e.className=n.join(" ")}function N(e,t){var n=D(e);o(n,t),e.className=n.join(" ")}function R(e,t,n){(n=ae(n)?!T(e,t):n)?M(e,t):N(e,t)}function F(e,t){if(ae(t)){var n=getComputedStyle(e),o=r(n.paddingLeft)+r(n.paddingRight),i=r(n.borderLeftWidth)+r(n.borderRightWidth);return e.offsetWidth-o-i}x(e,"width",t)}function H(e,t){if(ae(t)){var n=getComputedStyle(e),o=r(n.paddingTop)+r(n.paddingBottom),i=r(n.borderTopWidth)+r(n.borderBottomWidth);return e.offsetHeight-o-i}x(e,"height",t)}function z(e,t,n){var o;le(window.CustomEvent)?o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(o=e.ownerDocument.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(o)}function _(e){return!!e.getClientRects().length}function B(e){return e.replace(/^-ms-/,"ms-").replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function O(e,t,n,o,i){for(e=i?e.lastChild:e.firstChild;e;){var r=i?e.previousSibling:e.nextSibling;if(!n&&!1===t(e)||!o&&!1===O(e,t,n,o,i)||n&&!1===t(e))return!1;e=r}}function A(e,t,n,o){O(e,t,n,o,!0)}function I(e,t){var n=(t=t||document).createDocumentFragment(),o=a("div",{},t);for(o.innerHTML=e;o.firstChild;)d(n,o.firstChild);return n}function L(e){return e&&(!C(e,"p,div")||e.className||g(e,"style")||!t(w(e)))}function P(e,t){var n=a(t,{},e.ownerDocument);for(i(e.attributes,function(e,t){try{g(n,t.name,t.value)}catch(e){}});e.firstChild;)d(n,e.firstChild);return e.parentNode.replaceChild(n,e),n}function V(e){return!!/11?|9/.test(e.nodeType)&&"|iframe|area|base|basefont|br|col|frame|hr|img|input|wbr|isindex|link|meta|param|command|embed|keygen|source|track|object|".indexOf("|"+e.nodeName.toLowerCase()+"|")<0}function W(e,t){var n,o=(e||{}).nodeType||de;return o!==ue?o===de:"code"===(n=e.tagName.toLowerCase())?!t:pe.indexOf("|"+n+"|")<0}function j(e,t){t.style.cssText=e.style.cssText+t.style.cssText}function q(e){var t=function(e){for(;W(e.parentNode,!0);)e=e.parentNode;return e};O(e,function(e){var n=!W(e,!0);if(n&&W(e.parentNode,!0)){var o=t(e),i=Y(o,e),r=e;j(o,r),S(i,o),S(r,o)}if(n&&C(e,"ul,ol")&&C(e.parentNode,"ul,ol")){var l=E(e,"li");l||S(l=a("li"),e),d(l,e)}})}function U(e,t){return e?(t?e.previousSibling:e.nextSibling)||U(e.parentNode,t):null}function $(e){var t,n,o,i,r,a,l,c=x(e,"whiteSpace"),s=/line$/i.test(c),d=e.firstChild;if(!/pre(\-wrap)?$/i.test(c))for(;d;){if(a=d.nextSibling,t=d.nodeValue,(n=d.nodeType)===ue&&d.firstChild&&$(d),n===de){for(o=U(d),i=U(d,!0),l=!1;T(i,"sceditor-ignore");)i=U(i,!0);if(W(d)&&i){for(r=i;r.lastChild;)r=r.lastChild;l=r.nodeType===de?/[\t\n\r ]$/.test(r.nodeValue):!W(r)}t=t.replace(/\u200B/g,""),i&&W(i)&&!l||(t=t.replace(s?/^[\t ]+/:/^[\t\n\r ]+/,"")),o&&W(o)||(t=t.replace(s?/[\t ]+$/:/[\t\n\r ]+$/,"")),t.length?d.nodeValue=t.replace(s?/[\t ]+/g:/[\t\n\r ]+/g," "):u(d)}d=a}}function Y(e,t){var n=e.ownerDocument.createRange();return n.setStartBefore(e),n.setEndAfter(t),n.extractContents()}function K(e){for(var t=0,n=0;e;)t+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:t,top:n}}function X(e,t){var n,o,i=e.style;if(se[t]||(se[t]=B(t)),t=se[t],o=i[t],"textAlign"===t){if(n=i.direction,o=o||x(e,t),x(e.parentNode,t)===o||"block"!==x(e,"display")||C(e,"hr,th"))return"";if(/right/i.test(o)&&"rtl"===n||/left/i.test(o)&&"ltr"===n)return""}return o}function G(e){return e.replace(/([\-.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function J(e,t){if(!e)return e;var n={"&":"&","<":"<",">":">"," ":" ","\r\n":"<br />","\r":"<br />","\n":"<br />"};return!1!==t&&(n['"']=""",n["'"]="'",n["`"]="`"),e=e.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(e){return n[e]||e})}function Q(e){if("mozHidden"in document)for(var t,n=e.getBody();n;){if((t=n).firstChild)t=t.firstChild;else{for(;t&&!t.nextSibling;)t=t.parentNode;t&&(t=t.nextSibling)}3===n.nodeType&&/[\n\r\t]+/.test(n.nodeValue)&&(/^pre/.test(x(n.parentNode,"whiteSpace"))||u(n)),n=t}}function Z(e){var t=this,n=[],o=function(e){return"signal"+e.charAt(0).toUpperCase()+e.slice(1)},i=function(t,i){t=[].slice.call(t);var r,a,l=o(t.shift());for(r=0;r<n.length;r++)if(l in n[r]&&(a=n[r][l].apply(e,t),i))return a};t.call=function(){i(arguments,!1)},t.callOnlyFirst=function(){return i(arguments,!0)},t.hasHandler=function(e){var t=n.length;for(e=o(e);t--;)if(e in n[t])return!0;return!1},t.exists=function(e){return e in Se&&("function"==typeof(e=Se[e])&&"object"==typeof e.prototype)},t.isRegistered=function(e){if(t.exists(e))for(var o=n.length;o--;)if(n[o]instanceof Se[e])return!0;return!1},t.register=function(o){return!(!t.exists(o)||t.isRegistered(o))&&(o=new Se[o],n.push(o),"init"in o&&o.init.call(e),!0)},t.deregister=function(o){var i,r=n.length,a=!1;if(!t.isRegistered(o))return a;for(;r--;)n[r]instanceof Se[o]&&(a=!0,"destroy"in(i=n.splice(r,1)[0])&&i.destroy.call(e));return a},t.destroy=function(){for(var t=n.length;t--;)"destroy"in n[t]&&n[t].destroy.call(e);n=[],e=null}}function ee(e,t){var n,o,i=t||e.contentDocument||e.document,r="sceditor-start-marker",l="sceditor-end-marker",c=this;c.insertHTML=function(e,t){var n,o;if(!c.selectedRange())return!1;for(t&&(e+=c.selectedHtml()+t),o=a("p",{},i),n=i.createDocumentFragment(),o.innerHTML=e;o.firstChild;)d(n,o.firstChild);c.insertNode(n)},o=function(e,t,o){var s,u=i.createDocumentFragment();if("string"==typeof e?(t&&(e+=c.selectedHtml()+t),u=I(e)):(d(u,e),t&&(d(u,c.selectedRange().extractContents()),d(u,t))),s=u.lastChild){for(;!W(s.lastChild,!0);)s=s.lastChild;if(V(s)?s.lastChild||d(s,document.createTextNode("")):s=u,c.removeMarkers(),d(s,n(r)),d(s,n(l)),o){var f=a("div");return d(f,u),f.innerHTML}return u}},c.insertNode=function(e,t){var n=o(e,t),i=c.selectedRange(),r=i.commonAncestorContainer;if(!n)return!1;i.deleteContents(),r&&3!==r.nodeType&&!V(r)?S(n,r):i.insertNode(n),c.restoreRange()},c.cloneSelected=function(){var e=c.selectedRange();if(e)return e.cloneRange()},c.selectedRange=function(){var t,n,o=e.getSelection();if(o){if(o.getRangeAt&&o.rangeCount<=0){for(n=i.body;n.firstChild;)n=n.firstChild;(t=i.createRange()).setStartBefore(n),o.addRange(t)}return o.rangeCount>0&&(t=o.getRangeAt(0)),t}},c.hasSelection=function(){var t=e.getSelection();return t&&t.rangeCount>0},c.selectedHtml=function(){var e,t=c.selectedRange();return t?(e=a("p",{},i),d(e,t.cloneContents()),e.innerHTML):""},c.parentNode=function(){var e=c.selectedRange();if(e)return e.commonAncestorContainer},c.getFirstBlockParent=function(e){var t=function(e){return W(e,!0)&&(e=e?e.parentNode:null)?t(e):e};return t(e||c.parentNode())},c.insertNodeAt=function(e,t){var n=c.selectedRange(),o=c.cloneSelected();if(!o)return!1;o.collapse(e),o.insertNode(t),c.selectRange(n)},n=function(e){c.removeMarker(e);var t=a("span",{id:e,className:"sceditor-selection sceditor-ignore",style:"display:none;line-height:0"},i);return t.innerHTML=" ",t},c.insertMarkers=function(){var e=c.selectedRange(),t=n(r);c.removeMarkers(),c.insertNodeAt(!0,t),e&&e.collapsed?t.parentNode.insertBefore(n(l),t.nextSibling):c.insertNodeAt(!1,n(l))},c.getMarker=function(e){return i.getElementById(e)},c.removeMarker=function(e){var t=c.getMarker(e);t&&u(t)},c.removeMarkers=function(){c.removeMarker(r),c.removeMarker(l)},c.saveRange=function(){c.insertMarkers()},c.selectRange=function(t){var n,o=e.getSelection(),r=t.endContainer;if(!De&&t.collapsed&&r&&!W(r,!0)){for(n=r.lastChild;n&&C(n,".sceditor-ignore");)n=n.previousSibling;if(C(n,"br")){var a=i.createRange();a.setEndAfter(n),a.collapse(!1),c.compare(t,a)&&(t.setStartBefore(n),t.collapse(!0))}}o&&(c.clear(),o.addRange(t))},c.restoreRange=function(){var e,t=c.selectedRange(),n=c.getMarker(r),o=c.getMarker(l);if(!n||!o||!t)return!1;e=n.nextSibling===o,(t=i.createRange()).setStartBefore(n),t.setEndAfter(o),e&&t.collapse(!0),c.selectRange(t),c.removeMarkers()},c.selectOuterText=function(e,t){var n,o,i=c.cloneSelected();if(!i)return!1;i.collapse(!1),n=Te(i,!0,e),o=Te(i,!1,t),i.setStart(n.node,n.offset),i.setEnd(o.node,o.offset),c.selectRange(i)},c.getOuterText=function(e,t){var n=c.cloneSelected();return n?(n.collapse(!e),Te(n,e,t).text):""},c.replaceKeyword=function(e,t,n,o,i,r){n||e.sort(function(e,t){return e[0].length-t[0].length});var a,l,s,u,d,f,p,m,g=e.length,h=i?1:0,v=o||e[g-1][0].length;for(i&&v++,r=r||"",d=(a=c.getOuterText(!0,v)).length,a+=r,t&&(a+=c.getOuterText(!1,v));g--;)if(p=e[g][0],m=p.length,u=Math.max(0,d-m-h),s=-1,i?(l=a.substr(u).match(new RegExp("(^|[\\s ])"+G(p)+"(^|[\\s ])")))&&(s=l.index+u+l[1].length):s=a.indexOf(p,u),s>-1&&s<=d&&s+m+h>=d)return f=d-s,c.selectOuterText(f,m-f-(/^\S/.test(r)?1:0)),c.insertHTML(e[g][1]),!0;return!1},c.compare=function(e,t){return t||(t=c.selectedRange()),e&&t?0===e.compareBoundaryPoints(Range.END_TO_END,t)&&0===e.compareBoundaryPoints(Range.START_TO_START,t):!e&&!t},c.clear=function(){var t=e.getSelection();t&&(t.removeAllRanges?t.removeAllRanges():t.empty&&t.empty())}}function te(e,t){var n=/[^\s\xA0\u2002\u2003\u2009\u00a0]+/,o=e&&f(e,"img[data-sceditor-emoticon]");if(e&&o.length)for(var i=0;i<o.length;i++){var r=o[i],a=r.parentNode,l=r.previousSibling,c=r.nextSibling;if(l&&n.test(l.nodeValue.slice(-1))||c&&n.test((c.nodeValue||"")[0])){var s=t.cloneSelected(),d=-1,p=s.startContainer,m=l.nodeValue;null===m&&(m=l.innerText||""),m+=w(r,"sceditor-emoticon"),p===c&&(d=m.length+s.startOffset),p===e&&e.childNodes[s.startOffset]===c&&(d=m.length),p===l&&(d=s.startOffset),c&&c.nodeType===de||(c=a.insertBefore(a.ownerDocument.createTextNode(""),c)),c.insertData(0,m),u(l),u(r),d>-1&&(s.setStart(c,d),s.collapse(!0),t.selectRange(s))}}}function ne(e,t,n){var o=e.ownerDocument,r="(^|\\s| | | | |$)",a=[],l={};c(e,"code")||(i(t,function(e){l[e]=new RegExp(r+G(e)+r),a.push(e)}),a.sort(function(e,t){return t.length-e.length}),function e(i){for(i=i.firstChild;i;){if(i.nodeType!==ue||C(i,"code")||e(i),i.nodeType===de)for(var r=0;r<a.length;r++){var c=i.nodeValue,s=a[r],u=n?c.search(l[s]):c.indexOf(s);if(u>-1){var d=c.indexOf(s,u),f=I(t[s],o),p=c.substr(d+s.length);f.appendChild(o.createTextNode(p)),i.nodeValue=c.substr(0,d),i.parentNode.insertBefore(f,i.nextSibling)}}i=i.nextSibling}}(e))}function oe(e,t){var n;O(e,function(e){W(e,!0)?(n||S(n=a("p",{},t),e),e.nodeType===de&&""===e.nodeValue||d(n,e)):n=null},!1,!0)}function ie(e,t){var r,l,c,h,k,E,D,B,O,I,j,U,Y,X,G,Q,ce,se,pe,ge,he,xe,we,ke,Se,De,Te,ze,_e,Be,Oe,Ae,Ie,Le,Pe,Ve,We,je,qe,Ue,$e,Ye,Ke,Xe,Ge,Je,Qe,Ze,et,tt,nt,ot,it,rt,at,lt,ct,st,ut,dt,ft,pt,mt=this,gt=e.get?e.get(0):e,ht={},vt=[],yt=[],bt={},xt={},wt={};mt.commands=n(!0,{},t.commands||Ee);var Ct=mt.opts=n(!0,{},me,t);mt.opts.emoticons=t.emoticons||me.emoticons,De=function(){gt._sceditor=mt,Ct.locale&&"en"!==Ct.locale&&Ae(),S(l=a("div",{className:"sceditor-container"}),gt),x(l,"z-index",Ct.zIndex),Re&&M(l,"ie ie"+Re),pe=gt.required,gt.required=!1;var e=ie.formats[Ct.format];"init"in(r=e?new e:{})&&r.init.call(mt),Oe(),We(),Ie(),Be(),Le(),Pe(),be||mt.toggleSourceMode(),et();var t=function(){m(Me,"load",t),Ct.autofocus&&rt(),pt(),nt(),X.call("ready"),"onReady"in r&&r.onReady.call(mt)};p(Me,"load",t),"complete"===Ne.readyState&&t()},Oe=function(){var e=Ct.plugins;e=e?e.toString().split(","):[],X=new Z(mt),e.forEach(function(e){X.register(e.trim())})},Ae=function(){var e;(U=ie.locale[Ct.locale])||(e=Ct.locale.split("-"),U=ie.locale[e[0]]),U&&U.dateFormat&&(Ct.dateFormat=U.dateFormat)},Be=function(){D=a("textarea"),h=a("iframe",{frameborder:0,allowfullscreen:!0}),Ct.startInSourceMode?(M(l,"sourceMode"),v(h)):(M(l,"wysiwygMode"),v(D)),Ct.spellcheck||g(l,"spellcheck","false"),"https:"===Me.location.protocol&&g(h,"src","javascript:false"),d(l,h),d(l,D),mt.dimensions(Ct.width||F(gt),Ct.height||H(gt));var e=Re?"ie ie"+Re:"";e+=ye?" ios":"",(E=h.contentDocument).open(),E.write(Ce("html",{attrs:' class="'+e+'"',spellcheck:Ct.spellcheck?"":'spellcheck="false"',charset:Ct.charset,style:Ct.style})),E.close(),k=E.body,mt.readOnly(!!Ct.readOnly),(ye||ve||Re)&&(H(k,"100%"),Re||p(k,"touchend",mt.focus));var t=g(gt,"tabindex");g(D,"tabindex",t),g(h,"tabindex",t),Y=new ee(h.contentWindow),v(gt),mt.val(gt.value);var n=Ct.placeholder||g(gt,"placeholder");n&&(D.placeholder=n,g(k,"placeholder",n))},Le=function(){Ct.autoUpdate&&(p(k,"blur",ft),p(D,"blur",ft)),null===Ct.rtl&&(Ct.rtl="rtl"===x(D,"direction")),mt.rtl(!!Ct.rtl),Ct.autoExpand&&(p(k,"load",pt,fe),p(E,"input keyup",pt)),Ct.resizeEnabled&&Ve(),g(l,"id",Ct.id),mt.emoticons(Ct.emoticonsEnabled)},Pe=function(){var e=gt.form,t="onselectionchange"in E?"selectionchange":"keyup focus blur contextmenu mouseup touchend click";p(Ne,"click",Qe),e&&(p(e,"reset",Ke),p(e,"submit",mt.updateOriginal,fe)),p(k,"keypress",Ye),p(k,"keydown",Ue),p(k,"keydown",$e),p(k,"keyup",nt),p(k,"blur",ut),p(k,"keyup",dt),p(k,"paste",je),p(k,"compositionstart compositionend",Ge),p(k,t,ot),p(k,"keydown keyup keypress focus blur contextmenu",Je),Ct.emoticonsCompat&&Me.getSelection&&p(k,"keyup",lt),p(k,"blur",function(){mt.val()||M(k,"placeholder")}),p(k,"focus",function(){N(k,"placeholder")}),p(D,"blur",ut),p(D,"keyup",dt),p(D,"keydown",Ue),p(D,"compositionstart compositionend",Ge),p(D,"keydown keyup keypress focus blur contextmenu",Je),p(E,"mousedown",Xe),p(E,t,ot),p(E,"beforedeactivate keyup mouseup",_e),p(E,"keyup",nt),p(E,"focus",function(){O=null}),p(l,"selectionchanged",it),p(l,"selectionchanged",et),p(l,"selectionchanged valuechanged nodechanged",Je)},Ie=function(){var e,t=mt.commands,n=(Ct.toolbarExclude||"").split(","),o=Ct.toolbar.split("|");c=a("div",{className:"sceditor-toolbar",unselectable:"on"}),Ct.icons in ie.icons&&(Se=new ie.icons[Ct.icons]),i(o,function(o,r){e=a("div",{className:"sceditor-group"}),i(r.split(","),function(o,i){var r,a,l=t[i];!l||n.indexOf(i)>-1||(a=l.shortcut,r=Ce("toolbarButton",{name:i,dispName:mt._(l.name||l.tooltip||i)},!0).firstChild,Se&&Se.create&&Se.create(i)&&(S(Se.create(i),r.firstChild),M(r,"has-icon")),r._sceTxtMode=!!l.txtExec,r._sceWysiwygMode=!!l.exec,R(r,"disabled",!l.exec),p(r,"click",function(e){T(r,"disabled")||ze(r,l),et(),e.preventDefault()}),p(r,"mousedown",function(e){mt.closeDropDown(),e.preventDefault()}),l.tooltip&&g(r,"title",mt._(l.tooltip)+(a?" ("+a+")":"")),a&&mt.addShortcut(a,i),l.state?yt.push({name:i,state:l.state}):re(l.exec)&&yt.push({name:i,state:l.exec}),d(e,r),xt[i]=r)}),e.firstChild&&d(c,e)}),d(Ct.toolbarContainer||l,c)},Ve=function(){var e,t,n,o,i,r,c=a("div",{className:"sceditor-grip"}),s=a("div",{className:"sceditor-resize-cover"}),u="touchcancel touchend mouseup",f=0,g=0,h=0,b=0,x=0,w=0,C=F(l),k=H(l),E=!1,S=mt.rtl();if(e=Ct.resizeMinHeight||k/1.5,t=Ct.resizeMaxHeight||2.5*k,n=Ct.resizeMinWidth||C/1.25,o=Ct.resizeMaxWidth||1.25*C,i=function(i){"touchmove"===i.type?(i=Me.event,h=i.changedTouches[0].pageX,b=i.changedTouches[0].pageY):(h=i.pageX,b=i.pageY);var r=w+(b-g),a=S?x-(h-f):x+(h-f);o>0&&a>o&&(a=o),n>0&&a<n&&(a=n),Ct.resizeWidth||(a=!1),t>0&&r>t&&(r=t),e>0&&r<e&&(r=e),Ct.resizeHeight||(r=!1),(a||r)&&mt.dimensions(a,r),i.preventDefault()},r=function(e){E&&(E=!1,v(s),N(l,"resizing"),m(Ne,"touchmove mousemove",i),m(Ne,u,r),e.preventDefault())},Se&&Se.create){var D=Se.create("grip");D&&(d(c,D),M(c,"has-icon"))}d(l,c),d(l,s),v(s),p(c,"touchstart mousedown",function(e){"touchstart"===e.type?(e=Me.event,f=e.touches[0].pageX,g=e.touches[0].pageY):(f=e.pageX,g=e.pageY),x=F(l),w=H(l),E=!0,M(l,"resizing"),y(s),p(Ne,"touchmove mousemove",i),p(Ne,u,r),e.preventDefault()})},We=function(){var e=Ct.emoticons,t=Ct.emoticonsRoot||"";e&&(wt=n({},e.more,e.dropdown,e.hidden)),i(wt,function(e,n){wt[e]=Ce("emoticon",{key:e,url:t+(n.url||n),tooltip:n.tooltip||e}),Ct.emoticonsEnabled&&vt.push(a("img",{src:t+(n.url||n)}))})},rt=function(){var e,t,n=k.firstChild,o=!!Ct.autofocusEnd;if(_(l)){if(mt.sourceMode())return t=o?D.value.length:0,void D.setSelectionRange(t,t);if($(k),o)for((n=k.lastChild)||(n=a("p",{},E),d(k,n));n.lastChild;)n=n.lastChild,!Fe&&C(n,"br")&&n.previousSibling&&(n=n.previousSibling);e=E.createRange(),V(n)?e.selectNodeContents(n):(e.setStartBefore(n),o&&e.setStartAfter(n)),e.collapse(!o),Y.selectRange(e),ce=e,o&&(k.scrollTop=k.scrollHeight),mt.focus()}},mt.readOnly=function(e){return"boolean"!=typeof e?!D.readonly:(k.contentEditable=!e,D.readonly=!e,Ze(e),mt)},mt.rtl=function(e){var t=e?"rtl":"ltr";return"boolean"!=typeof e?"rtl"===g(D,"dir"):(g(k,"dir",t),g(D,"dir",t),N(l,"rtl"),N(l,"ltr"),M(l,t),Se&&Se.rtl&&Se.rtl(e),mt)},Ze=function(e){var t=mt.inSourceMode()?"_sceTxtMode":"_sceWysiwygMode";i(xt,function(n,o){R(o,"disabled",e||!o[t])})},mt.width=function(e,t){return e||0===e?(mt.dimensions(e,null,t),mt):F(l)},mt.dimensions=function(e,t,n){return e=!(!e&&0!==e)&&e,t=!(!t&&0!==t)&&t,!1===e&&!1===t?{width:mt.width(),height:mt.height()}:(!1!==e&&(!1!==n&&(Ct.width=e),F(l,e)),!1!==t&&(!1!==n&&(Ct.height=t),H(l,t)),mt)},mt.height=function(e,t){return e||0===e?(mt.dimensions(null,e,t),mt):H(l)},mt.maximize=function(e){return ae(e)?T(l,"sceditor-maximize"):((e=!!e)&&(we=Me.pageYOffset),R(Ne.documentElement,"sceditor-maximize",e),R(Ne.body,"sceditor-maximize",e),R(l,"sceditor-maximize",e),mt.width(e?"100%":Ct.width,!1),mt.height(e?"100%":Ct.height,!1),e||Me.scrollTo(0,we),pt(),mt)},pt=function(){Ct.autoExpand&&!xe&&setTimeout(mt.expandToContent,200)},mt.expandToContent=function(e){if(!mt.maximize()){if(xe=!1,!he){var t=Ct.resizeMinHeight||Ct.height||H(gt);he={min:t,max:Ct.resizeMaxHeight||2*t}}var n=Ne.createRange();n.selectNodeContents(k);var o=n.getBoundingClientRect(),i=E.documentElement.clientHeight,r=o.bottom-o.top,a=mt.height()+(r-i);e||-1===he.max||(a=Math.min(a,he.max)),mt.height(Math.ceil(Math.max(a,he.min)))}},mt.destroy=function(){if(X){X.destroy(),Y=null,O=null,X=null,B&&u(B),m(Ne,"click",Qe);var e=gt.form;e&&(m(e,"reset",Ke),m(e,"submit",mt.updateOriginal)),u(D),u(c),u(l),delete gt._sceditor,y(gt),gt.required=pe}},mt.createDropDown=function(e,t,o,r){var l,c="sceditor-"+t;mt.closeDropDown(!0),B&&T(B,c)||(!1!==r&&i(f(o,":not(input):not(textarea)"),function(e,t){t.nodeType===ue&&g(t,"unselectable","on")}),l=n({top:K(e).top,left:K(e).left,marginTop:e.clientHeight},Ct.dropDownCss),x(B=a("div",{className:"sceditor-dropdown "+c}),l),d(B,o),d(Ne.body,B),p(B,"click focusin",function(e){e.stopPropagation()}),setTimeout(function(){if(B){var e=f(B,"input,textarea")[0];e&&e.focus()}}))},Qe=function(e){3!==e.which&&B&&!e.defaultPrevented&&(ft(),mt.closeDropDown())},je=function(e){var t=Re||ve,n=k,o=e.clipboardData;if(o&&!t){var i={},r=o.types,a=o.items;e.preventDefault();for(var l=0;l<r.length;l++){if(Me.FileReader&&a&&He.test(a[l].type))return function(e){var t=new FileReader;t.onload=function(e){qe({html:'<img src="'+e.target.result+'" />'})},t.readAsDataURL(e)}(o.items[l].getAsFile());i[r[l]]=o.getData(r[l])}i.text=i["text/plain"],i.html=i["text/html"],qe(i)}else if(!ke){var c=n.scrollTop;for(Y.saveRange(),ke=Ne.createDocumentFragment();n.firstChild;)d(ke,n.firstChild);setTimeout(function(){var e=n.innerHTML;n.innerHTML="",d(n,ke),n.scrollTop=c,ke=!1,Y.restoreRange(),qe({html:e})},0)}},qe=function(e){var t=a("div",{},E);X.call("pasteRaw",e),e.html?(t.innerHTML=e.html,q(t)):t.innerHTML=J(e.text||"");var n={val:t.innerHTML};"fragmentToSource"in r&&(n.val=r.fragmentToSource(n.val,E,G)),X.call("paste",n),"fragmentToHtml"in r&&(n.val=r.fragmentToHtml(n.val,G)),X.call("pasteHtml",n),mt.wysiwygEditorInsertHtml(n.val,null,!0)},mt.closeDropDown=function(e){B&&(u(B),B=null),!0===e&&mt.focus()},mt.wysiwygEditorInsertHtml=function(e,t,n){var o,i,r,a=H(h);mt.focus(),!n&&s(Q,"code")||(Y.insertHTML(e,t),Y.saveRange(),Te(),y(o=f(k,"#sceditor-end-marker")[0]),i=k.scrollTop,r=K(o).top+1.5*o.offsetHeight-a,v(o),(r>i||r+a<i)&&(k.scrollTop=r),st(!1),Y.restoreRange(),nt())},mt.wysiwygEditorInsertText=function(e,t){mt.wysiwygEditorInsertHtml(J(e),J(t))},mt.insertText=function(e,t){return mt.inSourceMode()?mt.sourceEditorInsertText(e,t):mt.wysiwygEditorInsertText(e,t),mt},mt.sourceEditorInsertText=function(e,t){var n,o,i=D.selectionStart,r=D.selectionEnd;n=D.scrollTop,D.focus(),o=D.value,t&&(e+=o.substring(i,r)+t),D.value=o.substring(0,i)+e+o.substring(r,o.length),D.selectionStart=i+e.length-(t?t.length:0),D.selectionEnd=D.selectionStart,D.scrollTop=n,D.focus(),st()},mt.getRangeHelper=function(){return Y},mt.sourceEditorCaret=function(e){return D.focus(),e?(D.selectionStart=e.start,D.selectionEnd=e.end,this):{start:D.selectionStart,end:D.selectionEnd}},mt.val=function(e,t){return re(e)?(mt.inSourceMode()?mt.setSourceEditorValue(e):(!1!==t&&"toHtml"in r&&(e=r.toHtml(e)),mt.setWysiwygEditorValue(e)),mt):mt.inSourceMode()?mt.getSourceEditorValue(!1):mt.getWysiwygEditorValue(t)},mt.insert=function(e,t,n,o,i){if(mt.inSourceMode())return mt.sourceEditorInsertText(e,t),mt;if(t){var a=Y.selectedHtml();!1!==n&&"fragmentToSource"in r&&(a=r.fragmentToSource(a,E,G)),e+=a+t}return!1!==n&&"fragmentToHtml"in r&&(e=r.fragmentToHtml(e,G)),!1!==n&&!0===i&&(e=e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")),mt.wysiwygEditorInsertHtml(e),mt},mt.getWysiwygEditorValue=function(e){for(var t,n=a("div",{},E),o=k.childNodes,i=0;i<o.length;i++)d(n,o[i].cloneNode(!0));return d(k,n),q(n),u(n),t=n.innerHTML,!1!==e&&r.hasOwnProperty("toSource")&&(t=r.toSource(t,E)),t},mt.getBody=function(){return k},mt.getContentAreaContainer=function(){return h},mt.getSourceEditorValue=function(e){var t=D.value;return!1!==e&&"toHtml"in r&&(t=r.toHtml(t)),t},mt.setWysiwygEditorValue=function(e){e||(e="<p>"+(Re?"":"<br />")+"</p>"),k.innerHTML=e,Te(),nt(),st(),pt()},mt.setSourceEditorValue=function(e){D.value=e,st()},mt.updateOriginal=function(){gt.value=mt.val()},Te=function(){Ct.emoticonsEnabled&&ne(k,wt,Ct.emoticonsCompat)},mt.inSourceMode=function(){return T(l,"sourceMode")},mt.sourceMode=function(e){var t=mt.inSourceMode();return"boolean"!=typeof e?t:((t&&!e||!t&&e)&&mt.toggleSourceMode(),mt)},mt.toggleSourceMode=function(){var e=mt.inSourceMode();!be&&e||(e||(Y.saveRange(),Y.clear()),mt.blur(),e?mt.setWysiwygEditorValue(mt.getSourceEditorValue()):mt.setSourceEditorValue(mt.getWysiwygEditorValue()),O=null,b(D),b(h),R(l,"wysiwygMode",e),R(l,"sourceMode",!e),Ze(),et())},tt=function(){return D.focus(),D.value.substring(D.selectionStart,D.selectionEnd)},ze=function(e,t){mt.inSourceMode()?t.txtExec&&(Array.isArray(t.txtExec)?mt.sourceEditorInsertText.apply(mt,t.txtExec):t.txtExec.call(mt,e,tt())):t.exec&&(le(t.exec)?t.exec.call(mt,e):mt.execCommand(t.exec,t.hasOwnProperty("execParam")?t.execParam:null))},_e=function(){Re&&(O=Y.selectedRange())},mt.execCommand=function(e,t){var n=!1,o=mt.commands[e];if(mt.focus(),!s(Y.parentNode(),"code")){try{n=E.execCommand(e,!1,t)}catch(e){}!n&&o&&o.errorMessage&&alert(mt._(o.errorMessage)),et()}},ot=function(){function e(){if(Y&&!Y.compare(ce)){if((ce=Y.cloneSelected())&&ce.collapsed){var e=ce.startContainer,t=ce.startOffset;for(t&&e.nodeType!==de&&(e=e.childNodes[t]);e&&e.parentNode!==k;)e=e.parentNode;e&&W(e,!0)&&(Y.saveRange(),oe(k,E),Y.restoreRange())}z(l,"selectionchanged")}se=!1}se||(se=!0,"onselectionchange"in E?e():setTimeout(e,100))},it=function(){var e,t=Y.parentNode();G!==t&&(e=G,G=t,Q=Y.getFirstBlockParent(t),z(l,"nodechanged",{oldNode:e,newNode:G}))},mt.currentNode=function(){return G},mt.currentBlockNode=function(){return Q},et=function(){var e,t,n=E,o=mt.sourceMode();if(mt.readOnly())i(f(c,"active"),function(e,t){N(t,"active")});else{o||(t=Y.parentNode(),e=Y.getFirstBlockParent(t));for(var r=0;r<yt.length;r++){var a=0,l=xt[yt[r].name],s=yt[r].state,u=o&&!l._sceTxtMode||!o&&!l._sceWysiwygMode;if(re(s)){if(!o)try{(a=n.queryCommandEnabled(s)?0:-1)>-1&&(a=n.queryCommandState(s)?1:0)}catch(e){}}else u||(a=s.call(mt,t,e));R(l,"disabled",u||a<0),R(l,"active",a>0)}Se&&Se.update&&Se.update(o,t,e)}},Ye=function(e){if(!e.defaultPrevented&&(mt.closeDropDown(),13===e.which)){if(!C(Q,"li,ul,ol")&&L(Q)){O=null;var t=a("br",{},E);if(Y.insertNode(t),!Fe){var n=t.parentNode,o=n.lastChild;o&&o.nodeType===de&&""===o.nodeValue&&(u(o),o=n.lastChild),!W(n,!0)&&o===t&&W(t.previousSibling)&&Y.insertHTML("<br>")}e.preventDefault()}}},nt=function(){A(k,function(e){if(e.nodeType===ue&&!/inline/.test(x(e,"display"))&&!C(e,".sceditor-nlf")&&L(e)){var t=a("p",{},E);return t.className="sceditor-nlf",t.innerHTML=Fe?"":"<br />",d(k,t),!1}if(3===e.nodeType&&!/^\s*$/.test(e.nodeValue)||C(e,"br"))return!1})},Ke=function(){mt.val(gt.value)},Xe=function(){mt.closeDropDown(),O=null},mt._=function(){var e=arguments;return U&&U[e[0]]&&(e[0]=U[e[0]]),e[0].replace(/\{(\d+)\}/g,function(t,n){return void 0!==e[n-0+1]?e[n-0+1]:"{"+n+"}"})},Je=function(e){X&&X.call(e.type+"Event",e,mt);var t=(e.target===D?"scesrc":"scewys")+e.type;ht[t]&&ht[t].forEach(function(t){t.call(mt,e)})},mt.bind=function(e,t,n,o){for(var i=(e=e.split(" ")).length;i--;)if(le(t)){var r="scewys"+e[i],a="scesrc"+e[i];n||(ht[r]=ht[r]||[],ht[r].push(t)),o||(ht[a]=ht[a]||[],ht[a].push(t)),"valuechanged"===e[i]&&(st.hasHandler=!0)}return mt},mt.unbind=function(e,t,n,i){for(var r=(e=e.split(" ")).length;r--;)le(t)&&(n||o(ht["scewys"+e[r]]||[],t),i||o(ht["scesrc"+e[r]]||[],t));return mt},mt.blur=function(e,t,n){return le(e)?mt.bind("blur",e,t,n):mt.sourceMode()?D.blur():k.blur(),mt},mt.focus=function(e,t,n){if(le(e))mt.bind("focus",e,t,n);else if(mt.inSourceMode())D.focus();else{if(f(E,":focus").length)return;var o,i=Y.selectedRange();ce||rt(),!Fe&&i&&1===i.endOffset&&i.collapsed&&(o=i.endContainer)&&1===o.childNodes.length&&C(o.firstChild,"br")&&(i.setStartBefore(o.firstChild),i.collapse(!0),Y.selectRange(i)),h.contentWindow.focus(),k.focus(),O&&(Y.selectRange(O),O=null)}return et(),mt},mt.keyDown=function(e,t,n){return mt.bind("keydown",e,t,n)},mt.keyPress=function(e,t,n){return mt.bind("keypress",e,t,n)},mt.keyUp=function(e,t,n){return mt.bind("keyup",e,t,n)},mt.nodeChanged=function(e){return mt.bind("nodechanged",e,!1,!0)},mt.selectionChanged=function(e){return mt.bind("selectionchanged",e,!1,!0)},mt.valueChanged=function(e,t,n){return mt.bind("valuechanged",e,t,n)},at=function(e){var t=0,n=mt.emoticonsCache,o=String.fromCharCode(e.which);s(Q,"code")||(n||(n=[],i(wt,function(e,o){n[t++]=[e,o]}),n.sort(function(e,t){return e[0].length-t[0].length}),mt.emoticonsCache=n,mt.longestEmoticonCode=n[n.length-1][0].length),Y.replaceKeyword(mt.emoticonsCache,!0,!0,mt.longestEmoticonCode,Ct.emoticonsCompat,o)&&(Ct.emoticonsCompat&&/^\s$/.test(o)||e.preventDefault()))},lt=function(){te(Q,Y)},mt.emoticons=function(e){return e||!1===e?(Ct.emoticonsEnabled=e,e?(p(k,"keypress",at),mt.sourceMode()||(Y.saveRange(),Te(),st(!1),Y.restoreRange())):(i(f(k,"img[data-sceditor-emoticon]"),function(e,t){var n=w(t,"sceditor-emoticon"),o=E.createTextNode(n);t.parentNode.replaceChild(o,t)}),m(k,"keypress",at),st()),mt):Ct.emoticonsEnabled},mt.css=function(e){return ge||(ge=a("style",{id:"inline"},E),d(E.head,ge)),re(e)?(ge.styleSheet?ge.styleSheet.cssText=e:ge.innerHTML=e,mt):ge.styleSheet?ge.styleSheet.cssText:ge.innerHTML},Ue=function(e){var t=[],n={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|","[":"{","]":"}"},o={8:"backspace",9:"tab",13:"enter",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",91:"win",92:"win",93:"select",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={109:"-",110:"del",111:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},r=e.which,a=o[r]||String.fromCharCode(r).toLowerCase();(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&(t.push("shift"),i[r]?a=i[r]:n[a]&&(a=n[a])),a&&(r<16||r>18)&&t.push(a),t=t.join("+"),bt[t]&&!1===bt[t].call(mt)&&(e.stopPropagation(),e.preventDefault())},mt.addShortcut=function(e,t){return e=e.toLowerCase(),re(t)?bt[e]=function(){return ze(xt[t],mt.commands[t]),!1}:bt[e]=t,mt},mt.removeShortcut=function(e){return delete bt[e.toLowerCase()],mt},$e=function(e){var t,n,o;if(!Ct.disableBlockRemove&&8===e.which&&(n=Y.selectedRange())&&(t=n.startContainer,0===n.startOffset&&(o=ct()))){for(;t!==o;){for(;t.previousSibling;)if((t=t.previousSibling).nodeType!==de||t.nodeValue)return;if(!(t=t.parentNode))return}o&&!C(o,"body")&&(mt.clearBlockFormatting(o),e.preventDefault())}},ct=function(){for(var e=Q;!L(e)||W(e,!0);)if(!(e=e.parentNode)||C(e,"body"))return;return e},mt.clearBlockFormatting=function(e){return!(e=e||ct())||C(e,"body")?mt:(Y.saveRange(),e.className="",O=null,g(e,"style",""),C(e,"p,div,td")||P(e,"p"),Y.restoreRange(),mt)},st=function(e){if(X&&(X.hasHandler("valuechangedEvent")||st.hasHandler)){var t,n=mt.sourceMode(),o=!n&&Y.hasSelection();I=!1,e=!1!==e&&!E.getElementById("sceditor-start-marker"),j&&(clearTimeout(j),j=!1),o&&e&&Y.saveRange(),(t=n?D.value:k.innerHTML)!==st.lastVal&&(st.lastVal=t,z(l,"valuechanged",{rawValue:n?mt.val():t})),o&&e&&Y.removeMarkers()}},ut=function(){j&&st()},dt=function(e){var t=e.which,n=dt.lastChar,o=13===n||32===n,i=8===n||46===n;dt.lastChar=t,I||(13===t||32===t?o?dt.triggerNext=!0:st():8===t||46===t?i?dt.triggerNext=!0:st():dt.triggerNext&&(st(),dt.triggerNext=!1),clearTimeout(j),j=setTimeout(function(){I||st()},1500))},Ge=function(e){(I=/start/i.test(e.type))||st()},ft=function(){mt.updateOriginal()},De()}var re=e.bind(null,"string"),ae=e.bind(null,"undefined"),le=e.bind(null,"function"),ce=e.bind(null,"number"),se={},ue=1,de=3,fe=!0,pe="|body|hr|p|div|h1|h2|h3|h4|h5|h6|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|blockquote|center|",me={toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,paste,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,image,email,link,unlink|emoticon,youtube,date,time|ltr,rtl|print,maximize,source",toolbarExclude:null,style:"jquery.sceditor.default.css",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",colors:"#000000,#44B8FF,#1E92F7,#0074D9,#005DC2,#00369B,#b3d5f4|#444444,#C3FFFF,#9DF9FF,#7FDBFF,#68C4E8,#419DC1,#d9f4ff|#666666,#72FF84,#4CEA5E,#2ECC40,#17B529,#008E02,#c0f0c6|#888888,#FFFF44,#FFFA1E,#FFDC00,#E8C500,#C19E00,#fff5b3|#aaaaaa,#FFC95F,#FFA339,#FF851B,#E86E04,#C14700,#ffdbbb|#cccccc,#FF857A,#FF5F54,#FF4136,#E82A1F,#C10300,#ffc6c3|#eeeeee,#FF56FF,#FF30DC,#F012BE,#D900A7,#B20080,#fbb8ec|#ffffff,#F551FF,#CF2BE7,#B10DC9,#9A00B2,#9A00B2,#e8b6ef",locale:g(document.documentElement,"lang")||"en",charset:"utf-8",emoticonsCompat:!1,emoticonsEnabled:!0,emoticonsRoot:"",emoticons:{dropdown:{":)":"emoticons/smile.png",":angel:":"emoticons/angel.png",":angry:":"emoticons/angry.png","8-)":"emoticons/cool.png",":'(":"emoticons/cwy.png",":ermm:":"emoticons/ermm.png",":D":"emoticons/grin.png","<3":"emoticons/heart.png",":(":"emoticons/sad.png",":O":"emoticons/shocked.png",":P":"emoticons/tongue.png",";)":"emoticons/wink.png"},more:{":alien:":"emoticons/alien.png",":blink:":"emoticons/blink.png",":blush:":"emoticons/blush.png",":cheerful:":"emoticons/cheerful.png",":devil:":"emoticons/devil.png",":dizzy:":"emoticons/dizzy.png",":getlost:":"emoticons/getlost.png",":happy:":"emoticons/happy.png",":kissing:":"emoticons/kissing.png",":ninja:":"emoticons/ninja.png",":pinch:":"emoticons/pinch.png",":pouty:":"emoticons/pouty.png",":sick:":"emoticons/sick.png",":sideways:":"emoticons/sideways.png",":silly:":"emoticons/silly.png",":sleeping:":"emoticons/sleeping.png",":unsure:":"emoticons/unsure.png",":woot:":"emoticons/w00t.png",":wassat:":"emoticons/wassat.png"},hidden:{":whistling:":"emoticons/whistling.png",":love:":"emoticons/wub.png"}},width:null,height:null,resizeEnabled:!0,resizeMinWidth:null,resizeMinHeight:null,resizeMaxHeight:null,resizeMaxWidth:null,resizeHeight:!0,resizeWidth:!0,dateFormat:"year-month-day",toolbarContainer:null,enablePasteFiltering:!1,disablePasting:!1,readOnly:!1,rtl:!1,autofocus:!1,autofocusEnd:!0,autoExpand:!1,autoUpdate:!1,spellcheck:!0,runWithoutWysiwygSupport:!1,startInSourceMode:!1,id:null,plugins:"",zIndex:null,bbcodeTrim:!1,disableBlockRemove:!1,parserOptions:{},dropDownCss:{}},ge=navigator.userAgent,he=function(){var e=3,t=document,n=t.createElement("div"),o=n.getElementsByTagName("i");do{n.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(o[0]);return t.documentMode&&t.all&&window.atob&&(e=10),4===e&&t.documentMode&&(e=11),e>4?e:void 0}(),ve="-ms-ime-align"in document.documentElement.style,ye=/iPhone|iPod|iPad| wosbrowser\//i.test(ge),be=function(){var e,t,n=document.createElement("div");return n.contentEditable=!0,"contentEditable"in document.documentElement&&"true"===n.contentEditable&&(t=/Opera Mobi|Opera Mini/i.test(ge),/Android/i.test(ge)&&(t=!0,/Safari/.test(ge)&&(t=!(e=/Safari\/(\d+)/.exec(ge))||!e[1]||e[1]<534)),/ Silk\//i.test(ge)&&(t=!(e=/AppleWebKit\/(\d+)/.exec(ge))||!e[1]||e[1]<534),ye&&(t=/OS [0-4](_\d)+ like Mac/i.test(ge)),/Firefox/i.test(ge)&&(t=!1),/OneBrowser/i.test(ge)&&(t=!1),"UCWEB"===navigator.vendor&&(t=!1),he<=9&&(t=!0),!t)}(),xe=/^(https?|s?ftp|mailto|spotify|skype|ssh|teamspeak|tel):|(\/\/)|data:image\/(png|bmp|gif|p?jpe?g);/i,we={html:'<!DOCTYPE html><html{attrs}><head><style>.ie * {min-height: auto !important} .ie table td {height:15px} @supports (-ms-ime-align:auto) { * { min-height: auto !important; } }</style><meta http-equiv="Content-Type" content="text/html;charset={charset}" /><link rel="stylesheet" type="text/css" href="{style}" /></head><body contenteditable="true" {spellcheck}><p></p></body></html>',toolbarButton:'<a class="sceditor-button sceditor-button-{name}" data-sceditor-command="{name}" unselectable="on"><div unselectable="on">{dispName}</div></a>',emoticon:'<img src="{url}" data-sceditor-emoticon="{key}" alt="{key}" title="{tooltip}" />',fontOpt:'<a class="sceditor-font-option" href="#" data-font="{font}"><font face="{font}">{font}</font></a>',sizeOpt:'<a class="sceditor-fontsize-option" data-size="{size}" href="#"><font size="{size}">{size}</font></a>',pastetext:'<div><label for="txt">{label}</label> <textarea cols="20" rows="7" id="txt"></textarea></div><div><input type="button" class="button" value="{insert}" /></div>',table:'<div><label for="rows">{rows}</label><input type="text" id="rows" value="2" /></div><div><label for="cols">{cols}</label><input type="text" id="cols" value="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',image:'<div><label for="link">{url}</label> <input type="text" id="image" placeholder="https://" /></div><div><label for="width">{width}</label> <input type="text" id="width" size="2" /></div><div><label for="height">{height}</label> <input type="text" id="height" size="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',email:'<div><label for="email">{label}</label> <input type="text" id="email" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{insert}" /></div>',link:'<div><label for="link">{url}</label> <input type="text" id="link" placeholder="https://" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{ins}" /></div>',youtubeMenu:'<div><label for="link">{label}</label> <input type="text" id="link" placeholder="https://" /></div><div><input type="button" class="button" value="{insert}" /></div>',youtube:'<iframe width="560" height="315" frameborder="0" allowfullscreensrc="https://www.youtube.com/embed/{id}?wmode=opaque&start={time}" data-youtube-id="{id}"></iframe>'},Ce=function(e,t,n){var o=we[e];return Object.keys(t).forEach(function(e){o=o.replace(new RegExp(G("{"+e+"}"),"g"),t[e])}),n&&(o=I(o)),o},ke=he&&he<11,Ee={bold:{exec:"bold",tooltip:"Bold",shortcut:"Ctrl+B"},italic:{exec:"italic",tooltip:"Italic",shortcut:"Ctrl+I"},underline:{exec:"underline",tooltip:"Underline",shortcut:"Ctrl+U"},strike:{exec:"strikethrough",tooltip:"Strikethrough"},subscript:{exec:"subscript",tooltip:"Subscript"},superscript:{exec:"superscript",tooltip:"Superscript"},left:{exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(e,t,n){var o=a("div");p(o,"click","a",function(t){n(w(this,"font")),e.closeDropDown(!0),t.preventDefault()}),e.opts.fonts.split(",").forEach(function(e){d(o,Ce("fontOpt",{font:e},!0))}),e.createDropDown(t,"font-picker",o)},exec:function(e){var t=this;Ee.font._dropDown(t,e,function(e){t.execCommand("fontname",e)})},tooltip:"Font Name"},size:{_dropDown:function(e,t,n){var o=a("div");p(o,"click","a",function(t){n(w(this,"size")),e.closeDropDown(!0),t.preventDefault()});for(var i=1;i<=7;i++)d(o,Ce("sizeOpt",{size:i},!0));e.createDropDown(t,"fontsize-picker",o)},exec:function(e){var t=this;Ee.size._dropDown(t,e,function(e){t.execCommand("fontsize",e)})},tooltip:"Font Size"},color:{_dropDown:function(e,t,n){var o=a("div"),i="",r=Ee.color;r._htmlCache||(e.opts.colors.split("|").forEach(function(e){i+='<div class="sceditor-color-column">',e.split(",").forEach(function(e){i+='<a href="#" class="sceditor-color-option" style="background-color: '+e+'" data-color="'+e+'"></a>'}),i+="</div>"}),r._htmlCache=i),d(o,I(r._htmlCache)),p(o,"click","a",function(t){n(w(this,"color")),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"color-picker",o)},exec:function(e){var t=this;Ee.color._dropDown(t,e,function(e){t.execCommand("forecolor",e)})},tooltip:"Font Color"},removeformat:{exec:"removeformat",tooltip:"Remove Formatting"},cut:{exec:"cut",tooltip:"Cut",errorMessage:"Your browser does not allow the cut command. Please use the keyboard shortcut Ctrl/Cmd-X"},copy:{exec:"copy",tooltip:"Copy",errorMessage:"Your browser does not allow the copy command. Please use the keyboard shortcut Ctrl/Cmd-C"},paste:{exec:"paste",tooltip:"Paste",errorMessage:"Your browser does not allow the paste command. Please use the keyboard shortcut Ctrl/Cmd-V"},pastetext:{exec:function(e){var t,n=a("div"),o=this;d(n,Ce("pastetext",{label:o._("Paste your text inside the following box:"),insert:o._("Insert")},!0)),p(n,"click",".button",function(e){(t=f(n,"#txt")[0].value)&&o.wysiwygEditorInsertText(t),o.closeDropDown(!0),e.preventDefault()}),o.createDropDown(e,"pastetext",n)},tooltip:"Paste Text"},bulletlist:{exec:function(){Q(this),this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){Q(this),this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(e,t){var n,o,i,r=l(t,"ul,ol,menu");return r.length>1&&r[0].children.length>1?0:C(t,"ul,ol,menu")&&(n=this.getRangeHelper().selectedRange(),o=n.startContainer.parentNode,i=n.endContainer.parentNode,o!==o.parentNode.firstElementChild||C(i,"li")&&i!==i.parentNode.lastElementChild)?0:-1},exec:function(){var e=this,t=e.getRangeHelper().getFirstBlockParent();e.focus(),l(t,"ul,ol,menu")&&e.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(e,t){return s(t,"ul,ol,menu")>0?0:-1},exec:function(){l(this.getRangeHelper().getFirstBlockParent(),"ul,ol,menu")&&this.execCommand("outdent")},tooltip:"Remove one indent"},table:{exec:function(e){var t=this,n=a("div");d(n,Ce("table",{rows:t._("Rows:"),cols:t._("Cols:"),insert:t._("Insert")},!0)),p(n,"click",".button",function(e){var o=Number(f(n,"#rows")[0].value),i=Number(f(n,"#cols")[0].value),r="<table>";o>0&&i>0&&(r+=Array(o+1).join("<tr>"+Array(i+1).join("<td>"+(ke?"":"<br />")+"</td>")+"</tr>"),r+="</table>",t.wysiwygEditorInsertHtml(r),t.closeDropDown(!0),e.preventDefault())}),t.createDropDown(e,"inserttable",n)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("<code>",(ke?"":"<br />")+"</code>")},tooltip:"Code"},image:{_dropDown:function(e,t,n,o){var i=a("div");d(i,Ce("image",{url:e._("URL:"),width:e._("Width (optional):"),height:e._("Height (optional):"),insert:e._("Insert")},!0));var r=f(i,"#image")[0];r.value=n,p(i,"click",".button",function(t){r.value&&o(r.value,f(i,"#width")[0].value,f(i,"#height")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertimage",i)},exec:function(e){var t=this;Ee.image._dropDown(t,e,"",function(e,n,o){var i="";n&&(i+=' width="'+n+'"'),o&&(i+=' height="'+o+'"'),t.wysiwygEditorInsertHtml("<img"+i+' src="'+e+'" />')})},tooltip:"Insert an image"},email:{_dropDown:function(e,t,n){var o=a("div");d(o,Ce("email",{label:e._("E-mail:"),desc:e._("Description (optional):"),insert:e._("Insert")},!0)),p(o,"click",".button",function(t){var i=f(o,"#email")[0].value;i&&n(i,f(o,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertemail",o)},exec:function(e){var t=this;Ee.email._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?t.wysiwygEditorInsertHtml('<a href="mailto:'+e+'">'+(n||e)+"</a>"):t.execCommand("createlink","mailto:"+e)})},tooltip:"Insert an email"},link:{_dropDown:function(e,t,n){function o(t){r.value&&n(r.value,f(i,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}var i=a("div");d(i,Ce("link",{url:e._("URL:"),desc:e._("Description (optional):"),ins:e._("Insert")},!0));var r=f(i,"#link")[0];p(i,"click",".button",o),p(i,"keypress",function(e){13===e.which&&r.value&&o(e)},fe),e.createDropDown(t,"insertlink",i)},exec:function(e){var t=this;Ee.link._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?(n=n||e,t.wysiwygEditorInsertHtml('<a href="'+e+'">'+n+"</a>")):t.execCommand("createlink",e)})},tooltip:"Insert a link"},unlink:{state:function(){return s(this.currentNode(),"a")?0:-1},exec:function(){var e=s(this.currentNode(),"a");if(e){for(;e.firstChild;)S(e.firstChild,e);u(e)}},tooltip:"Unlink"},quote:{exec:function(e,t,n){var o="<blockquote>",i="</blockquote>";t?(o=o+(n=n?"<cite>"+n+"</cite>":"")+t+i,i=null):""===this.getRangeHelper().selectedHtml()&&(i=(ke?"":"<br />")+i),this.wysiwygEditorInsertHtml(o,i)},tooltip:"Insert a Quote"},emoticon:{exec:function(e){var t=this,o=function(r){var l,c=t.opts.emoticonsCompat,s=t.getRangeHelper(),u=c&&" "!==s.getOuterText(!0,1)?" ":"",f=c&&" "!==s.getOuterText(!1,1)?" ":"",m=a("div"),h=a("div"),v=0,y=n({},t.opts.emoticons.dropdown,r?t.opts.emoticons.more:{});return d(m,h),v=Math.sqrt(Object.keys(y).length),p(m,"click","img",function(e){t.insert(u+g(this,"alt")+f,null,!1).closeDropDown(!0),e.preventDefault()}),i(y,function(e,t){d(h,a("img",{src:t.url||t,alt:e,title:t.tooltip||e})),h.children.length>=v&&(h=a("div"),d(m,h))}),!r&&t.opts.emoticons.more&&(d(l=a("a",{className:"sceditor-more"}),document.createTextNode(t._("More"))),p(l,"click",function(n){t.createDropDown(e,"more-emoticons",o(!0)),n.preventDefault()}),d(m,l)),m};t.createDropDown(e,"emoticons",o(!1))},txtExec:function(e){Ee.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(e,t,n){var o=a("div");d(o,Ce("youtubeMenu",{label:e._("Video URL:"),insert:e._("Insert")},!0)),p(o,"click",".button",function(t){var r=f(o,"#link")[0].value,a=r.match(/(?:v=|v\/|embed\/|youtu.be\/)(.{11})/),l=r.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/),c=0;l&&i(l[1].split(/[hms]/),function(e,t){""!==t&&(c=60*c+Number(t))}),a&&/^[a-zA-Z0-9_\-]{11}$/.test(a[1])&&n(a[1],c),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertlink",o)},exec:function(e){var t=this;Ee.youtube._dropDown(t,e,function(e,n){t.wysiwygEditorInsertHtml(Ce("youtube",{id:e,time:n}))})},tooltip:"Insert a YouTube video"},date:{_date:function(e){var t=new Date,n=t.getYear(),o=t.getMonth()+1,i=t.getDate();return n<2e3&&(n=1900+n),o<10&&(o="0"+o),i<10&&(i="0"+i),e.opts.dateFormat.replace(/year/i,n).replace(/month/i,o).replace(/day/i,i)},exec:function(){this.insertText(Ee.date._date(this))},txtExec:function(){this.insertText(Ee.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var e=new Date,t=e.getHours(),n=e.getMinutes(),o=e.getSeconds();return t<10&&(t="0"+t),n<10&&(n="0"+n),o<10&&(o="0"+o),t+":"+n+":"+o},exec:function(){this.insertText(Ee.time._time())},txtExec:function(){this.insertText(Ee.time._time())},tooltip:"Insert current time"},ltr:{state:function(e,t){return t&&"ltr"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!C(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!C(n,"body")))&&x(n,"direction","ltr"===x(n,"direction")?"":"ltr")},tooltip:"Left-to-Right"},rtl:{state:function(e,t){return t&&"rtl"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!C(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!C(n,"body")))&&x(n,"direction","rtl"===x(n,"direction")?"":"rtl")},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize())},txtExec:function(){this.maximize(!this.maximize())},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode()},txtExec:function(){this.toggleSourceMode()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}},Se={};Z.plugins=Se;var De=he&&he<11,Te=function(e,t,n){var o,i,r,a,l,c="",s=e.startContainer,u=e.startOffset;for(s&&3!==s.nodeType&&(s=s.childNodes[u],u=0),r=a=u;n>c.length&&s&&3===s.nodeType;)o=s.nodeValue,i=n-c.length,l&&(a=o.length,r=0),l=s,t?(u=r=Math.max(a-i,0),c=o.substr(r,a-r)+c,s=l.previousSibling):(u=r+(a=Math.min(i,o.length)),c+=o.substr(r,a),s=l.nextSibling);return{node:l||s,offset:u,text:c}},Me=window,Ne=document,Re=he,Fe=Re&&Re<11,He=/^image\/(p?jpe?g|gif|png|bmp)$/i;ie.locale={},ie.formats={},ie.icons={},ie.command={get:function(e){return Ee[e]||null},set:function(e,t){return!(!e||!t)&&(t=n(Ee[e]||{},t),t.remove=function(){ie.command.remove(e)},Ee[e]=t,this)},remove:function(e){return Ee[e]&&delete Ee[e],this}},window.sceditor={command:ie.command,commands:Ee,defaultOptions:me,ie:he,ios:ye,isWysiwygSupported:be,regexEscape:G,escapeEntities:J,escapeUriScheme:function(e){var t,n=/^[^\/]*:/i,o=window.location;return e&&n.test(e)&&!xe.test(e)?((t=o.pathname.split("/")).pop(),o.protocol+"//"+o.host+t.join("/")+"/"+e):e},dom:{css:x,attr:g,removeAttr:h,is:C,closest:s,width:F,height:H,traverse:O,rTraverse:A,parseHTML:I,hasStyling:L,convertElement:P,blockLevelList:pe,canHaveChildren:V,isInline:W,copyCSS:j,fixNesting:q,findCommonAncestor:function(e,t){for(;e=e.parentNode;)if(k(e,t))return e},getSibling:U,removeWhiteSpace:$,extractContents:Y,getOffset:K,getStyle:X,hasStyle:function(e,t,n){var o=X(e,t);return!!o&&(!n||o===n||Array.isArray(n)&&n.indexOf(o)>-1)}},locale:ie.locale,icons:ie.icons,utils:{each:i,isEmptyObject:t,extend:n},plugins:Z.plugins,formats:ie.formats,create:function(e,t){t=t||{},c(e,".sceditor-container")||(t.runWithoutWysiwygSupport||be)&&new ie(e,t)},instance:function(e){return e._sceditor}}}(); | ||
!function(){"use strict";function e(e,t){return typeof t===e}function t(e){return!Object.keys(e).length}function n(e,t){for(var o=e===!!e,i=o?2:1,r=o?t:e,a=!!o&&e;i<arguments.length;i++){var l=arguments[i];for(var c in l){var s=l[c];if(!ae(s)){var u=null!==s&&"object"==typeof s,d=Array.isArray(s);r[c]=a&&(u||d)?n(!0,r[c]||(d?[]:{}),s):s}}}return r}function o(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}function i(e,t){if(Array.isArray(e)||"length"in e&&ce(e.length))for(var n=0;n<e.length;n++)t(n,e[n]);else Object.keys(e).forEach(function(n){t(n,e[n])})}function r(e){return e=parseFloat(e),isFinite(e)?e:0}function a(e,t,n){var o=(n||document).createElement(e);return i(t||{},function(e,t){"style"===e?o.style.cssText=t:e in o?o[e]=t:o.setAttribute(e,t)}),o}function l(e,t){for(var n=[],o=e||{};(o=o.parentNode)&&!/(9|11)/.test(o.nodeType);)t&&!C(o,t)||n.push(o);return n}function c(e,t){for(var n=e||{};(n=n.parentNode)&&!/(9|11)/.test(n.nodeType);)if(!t||C(n,t))return n}function s(e,t){return C(e,t)?e:c(e,t)}function u(e){e.parentNode.removeChild(e)}function d(e,t){e.appendChild(t)}function f(e,t){return e.querySelectorAll(t)}function p(e,t,n,o,i){t.split(" ").forEach(function(t){var r;re(n)?(r=o["_sce-event-"+t+n]||function(t){for(var i=t.target;i&&i!==e;){if(C(i,n))return void o.call(i,t);i=i.parentNode}},o["_sce-event-"+t+n]=r):(r=n,i=o),e.addEventListener(t,r,i||!1)})}function m(e,t,n,o,i){t.split(" ").forEach(function(t){var r;re(n)?r=o["_sce-event-"+t+n]:(r=n,i=o),e.removeEventListener(t,r,i||!1)})}function g(e,t,n){if(arguments.length<3)return e.getAttribute(t);null==n?h(e,t):e.setAttribute(t,n)}function h(e,t){e.removeAttribute(t)}function v(e){x(e,"display","none")}function y(e){x(e,"display","")}function b(e){_(e)?v(e):y(e)}function x(e,t,n){if(arguments.length<3){if(re(t))return getComputedStyle(e)[t];i(t,function(t,n){x(e,t,n)})}else{var o=(n||0===n)&&!isNaN(n);e.style[t]=o?n+"px":n}}function w(e,t,n){var o=arguments.length,r={};if(e.nodeType===ue){if(1===o)return i(e.attributes,function(e,t){/^data\-/i.test(t.name)&&(r[t.name.substr(5)]=t.value)}),r;if(2===o)return g(e,"data-"+t);g(e,"data-"+t,String(n))}}function C(e,t){var n=!1;return e&&e.nodeType===ue&&(n=(e.matches||e.msMatchesSelector||e.webkitMatchesSelector).call(e,t)),n}function k(e,t){return e!==t&&e.contains&&e.contains(t)}function E(e,t){var n=e.previousElementSibling;return t&&n?C(n,t)?n:null:n}function S(e,t){return t.parentNode.insertBefore(e,t)}function D(e){return e.className.trim().split(/\s+/)}function T(e,t){return C(e,"."+t)}function M(e,t){var n=D(e);n.indexOf(t)<0&&n.push(t),e.className=n.join(" ")}function N(e,t){var n=D(e);o(n,t),e.className=n.join(" ")}function R(e,t,n){(n=ae(n)?!T(e,t):n)?M(e,t):N(e,t)}function F(e,t){if(ae(t)){var n=getComputedStyle(e),o=r(n.paddingLeft)+r(n.paddingRight),i=r(n.borderLeftWidth)+r(n.borderRightWidth);return e.offsetWidth-o-i}x(e,"width",t)}function H(e,t){if(ae(t)){var n=getComputedStyle(e),o=r(n.paddingTop)+r(n.paddingBottom),i=r(n.borderTopWidth)+r(n.borderBottomWidth);return e.offsetHeight-o-i}x(e,"height",t)}function z(e,t,n){var o;le(window.CustomEvent)?o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n}):(o=e.ownerDocument.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(o)}function _(e){return!!e.getClientRects().length}function B(e){return e.replace(/^-ms-/,"ms-").replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function O(e,t,n,o,i){for(e=i?e.lastChild:e.firstChild;e;){var r=i?e.previousSibling:e.nextSibling;if(!n&&!1===t(e)||!o&&!1===O(e,t,n,o,i)||n&&!1===t(e))return!1;e=r}}function A(e,t,n,o){O(e,t,n,o,!0)}function I(e,t){var n=(t=t||document).createDocumentFragment(),o=a("div",{},t);for(o.innerHTML=e;o.firstChild;)d(n,o.firstChild);return n}function L(e){return e&&(!C(e,"p,div")||e.className||g(e,"style")||!t(w(e)))}function P(e,t){var n=a(t,{},e.ownerDocument);for(i(e.attributes,function(e,t){try{g(n,t.name,t.value)}catch(e){}});e.firstChild;)d(n,e.firstChild);return e.parentNode.replaceChild(n,e),n}function V(e){return!!/11?|9/.test(e.nodeType)&&"|iframe|area|base|basefont|br|col|frame|hr|img|input|wbr|isindex|link|meta|param|command|embed|keygen|source|track|object|".indexOf("|"+e.nodeName.toLowerCase()+"|")<0}function W(e,t){var n,o=(e||{}).nodeType||de;return o!==ue?o===de:"code"===(n=e.tagName.toLowerCase())?!t:pe.indexOf("|"+n+"|")<0}function j(e,t){t.style.cssText=e.style.cssText+t.style.cssText}function q(e){var t=function(e){for(;W(e.parentNode,!0);)e=e.parentNode;return e};O(e,function(e){var n=!W(e,!0);if(n&&W(e.parentNode,!0)){var o=t(e),i=Y(o,e),r=e;j(o,r),S(i,o),S(r,o)}if(n&&C(e,"ul,ol")&&C(e.parentNode,"ul,ol")){var l=E(e,"li");l||S(l=a("li"),e),d(l,e)}})}function U(e,t){return e?(t?e.previousSibling:e.nextSibling)||U(e.parentNode,t):null}function $(e){var t,n,o,i,r,a,l,c=x(e,"whiteSpace"),s=/line$/i.test(c),d=e.firstChild;if(!/pre(\-wrap)?$/i.test(c))for(;d;){if(a=d.nextSibling,t=d.nodeValue,(n=d.nodeType)===ue&&d.firstChild&&$(d),n===de){for(o=U(d),i=U(d,!0),l=!1;T(i,"sceditor-ignore");)i=U(i,!0);if(W(d)&&i){for(r=i;r.lastChild;)r=r.lastChild;l=r.nodeType===de?/[\t\n\r ]$/.test(r.nodeValue):!W(r)}t=t.replace(/\u200B/g,""),i&&W(i)&&!l||(t=t.replace(s?/^[\t ]+/:/^[\t\n\r ]+/,"")),o&&W(o)||(t=t.replace(s?/[\t ]+$/:/[\t\n\r ]+$/,"")),t.length?d.nodeValue=t.replace(s?/[\t ]+/g:/[\t\n\r ]+/g," "):u(d)}d=a}}function Y(e,t){var n=e.ownerDocument.createRange();return n.setStartBefore(e),n.setEndAfter(t),n.extractContents()}function K(e){for(var t=0,n=0;e;)t+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:t,top:n}}function X(e,t){var n,o,i=e.style;if(se[t]||(se[t]=B(t)),t=se[t],o=i[t],"textAlign"===t){if(n=i.direction,o=o||x(e,t),x(e.parentNode,t)===o||"block"!==x(e,"display")||C(e,"hr,th"))return"";if(/right/i.test(o)&&"rtl"===n||/left/i.test(o)&&"ltr"===n)return""}return o}function G(e){return e.replace(/([\-.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function J(e,t){if(!e)return e;var n={"&":"&","<":"<",">":">"," ":" ","\r\n":"<br />","\r":"<br />","\n":"<br />"};return!1!==t&&(n['"']=""",n["'"]="'",n["`"]="`"),e=e.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(e){return n[e]||e})}function Q(e){if("mozHidden"in document)for(var t,n=e.getBody();n;){if((t=n).firstChild)t=t.firstChild;else{for(;t&&!t.nextSibling;)t=t.parentNode;t&&(t=t.nextSibling)}3===n.nodeType&&/[\n\r\t]+/.test(n.nodeValue)&&(/^pre/.test(x(n.parentNode,"whiteSpace"))||u(n)),n=t}}function Z(e){var t=this,n=[],o=function(e){return"signal"+e.charAt(0).toUpperCase()+e.slice(1)},i=function(t,i){t=[].slice.call(t);var r,a,l=o(t.shift());for(r=0;r<n.length;r++)if(l in n[r]&&(a=n[r][l].apply(e,t),i))return a};t.call=function(){i(arguments,!1)},t.callOnlyFirst=function(){return i(arguments,!0)},t.hasHandler=function(e){var t=n.length;for(e=o(e);t--;)if(e in n[t])return!0;return!1},t.exists=function(e){return e in Se&&("function"==typeof(e=Se[e])&&"object"==typeof e.prototype)},t.isRegistered=function(e){if(t.exists(e))for(var o=n.length;o--;)if(n[o]instanceof Se[e])return!0;return!1},t.register=function(o){return!(!t.exists(o)||t.isRegistered(o))&&(o=new Se[o],n.push(o),"init"in o&&o.init.call(e),!0)},t.deregister=function(o){var i,r=n.length,a=!1;if(!t.isRegistered(o))return a;for(;r--;)n[r]instanceof Se[o]&&(a=!0,"destroy"in(i=n.splice(r,1)[0])&&i.destroy.call(e));return a},t.destroy=function(){for(var t=n.length;t--;)"destroy"in n[t]&&n[t].destroy.call(e);n=[],e=null}}function ee(e,t){var n,o,i=t||e.contentDocument||e.document,r="sceditor-start-marker",l="sceditor-end-marker",c=this;c.insertHTML=function(e,t){var n,o;if(!c.selectedRange())return!1;for(t&&(e+=c.selectedHtml()+t),o=a("p",{},i),n=i.createDocumentFragment(),o.innerHTML=e;o.firstChild;)d(n,o.firstChild);c.insertNode(n)},o=function(e,t,o){var s,u=i.createDocumentFragment();if("string"==typeof e?(t&&(e+=c.selectedHtml()+t),u=I(e)):(d(u,e),t&&(d(u,c.selectedRange().extractContents()),d(u,t))),s=u.lastChild){for(;!W(s.lastChild,!0);)s=s.lastChild;if(V(s)?s.lastChild||d(s,document.createTextNode("")):s=u,c.removeMarkers(),d(s,n(r)),d(s,n(l)),o){var f=a("div");return d(f,u),f.innerHTML}return u}},c.insertNode=function(e,t){var n=o(e,t),i=c.selectedRange(),r=i.commonAncestorContainer;if(!n)return!1;i.deleteContents(),r&&3!==r.nodeType&&!V(r)?S(n,r):i.insertNode(n),c.restoreRange()},c.cloneSelected=function(){var e=c.selectedRange();if(e)return e.cloneRange()},c.selectedRange=function(){var t,n,o=e.getSelection();if(o){if(o.getRangeAt&&o.rangeCount<=0){for(n=i.body;n.firstChild;)n=n.firstChild;(t=i.createRange()).setStartBefore(n),o.addRange(t)}return o.rangeCount>0&&(t=o.getRangeAt(0)),t}},c.hasSelection=function(){var t=e.getSelection();return t&&t.rangeCount>0},c.selectedHtml=function(){var e,t=c.selectedRange();return t?(e=a("p",{},i),d(e,t.cloneContents()),e.innerHTML):""},c.parentNode=function(){var e=c.selectedRange();if(e)return e.commonAncestorContainer},c.getFirstBlockParent=function(e){var t=function(e){return W(e,!0)&&(e=e?e.parentNode:null)?t(e):e};return t(e||c.parentNode())},c.insertNodeAt=function(e,t){var n=c.selectedRange(),o=c.cloneSelected();if(!o)return!1;o.collapse(e),o.insertNode(t),c.selectRange(n)},n=function(e){c.removeMarker(e);var t=a("span",{id:e,className:"sceditor-selection sceditor-ignore",style:"display:none;line-height:0"},i);return t.innerHTML=" ",t},c.insertMarkers=function(){var e=c.selectedRange(),t=n(r);c.removeMarkers(),c.insertNodeAt(!0,t),e&&e.collapsed?t.parentNode.insertBefore(n(l),t.nextSibling):c.insertNodeAt(!1,n(l))},c.getMarker=function(e){return i.getElementById(e)},c.removeMarker=function(e){var t=c.getMarker(e);t&&u(t)},c.removeMarkers=function(){c.removeMarker(r),c.removeMarker(l)},c.saveRange=function(){c.insertMarkers()},c.selectRange=function(t){var n,o=e.getSelection(),r=t.endContainer;if(!De&&t.collapsed&&r&&!W(r,!0)){for(n=r.lastChild;n&&C(n,".sceditor-ignore");)n=n.previousSibling;if(C(n,"br")){var a=i.createRange();a.setEndAfter(n),a.collapse(!1),c.compare(t,a)&&(t.setStartBefore(n),t.collapse(!0))}}o&&(c.clear(),o.addRange(t))},c.restoreRange=function(){var e,t=c.selectedRange(),n=c.getMarker(r),o=c.getMarker(l);if(!n||!o||!t)return!1;e=n.nextSibling===o,(t=i.createRange()).setStartBefore(n),t.setEndAfter(o),e&&t.collapse(!0),c.selectRange(t),c.removeMarkers()},c.selectOuterText=function(e,t){var n,o,i=c.cloneSelected();if(!i)return!1;i.collapse(!1),n=Te(i,!0,e),o=Te(i,!1,t),i.setStart(n.node,n.offset),i.setEnd(o.node,o.offset),c.selectRange(i)},c.getOuterText=function(e,t){var n=c.cloneSelected();return n?(n.collapse(!e),Te(n,e,t).text):""},c.replaceKeyword=function(e,t,n,o,i,r){n||e.sort(function(e,t){return e[0].length-t[0].length});var a,l,s,u,d,f,p,m,g=e.length,h=i?1:0,v=o||e[g-1][0].length;for(i&&v++,r=r||"",d=(a=c.getOuterText(!0,v)).length,a+=r,t&&(a+=c.getOuterText(!1,v));g--;)if(p=e[g][0],m=p.length,u=Math.max(0,d-m-h),s=-1,i?(l=a.substr(u).match(new RegExp("(^|[\\s ])"+G(p)+"(^|[\\s ])")))&&(s=l.index+u+l[1].length):s=a.indexOf(p,u),s>-1&&s<=d&&s+m+h>=d)return f=d-s,c.selectOuterText(f,m-f-(/^\S/.test(r)?1:0)),c.insertHTML(e[g][1]),!0;return!1},c.compare=function(e,t){return t||(t=c.selectedRange()),e&&t?0===e.compareBoundaryPoints(Range.END_TO_END,t)&&0===e.compareBoundaryPoints(Range.START_TO_START,t):!e&&!t},c.clear=function(){var t=e.getSelection();t&&(t.removeAllRanges?t.removeAllRanges():t.empty&&t.empty())}}function te(e,t){var n=/[^\s\xA0\u2002\u2003\u2009\u00a0]+/,o=e&&f(e,"img[data-sceditor-emoticon]");if(e&&o.length)for(var i=0;i<o.length;i++){var r=o[i],a=r.parentNode,l=r.previousSibling,c=r.nextSibling;if(l&&n.test(l.nodeValue.slice(-1))||c&&n.test((c.nodeValue||"")[0])){var s=t.cloneSelected(),d=-1,p=s.startContainer,m=l.nodeValue;null===m&&(m=l.innerText||""),m+=w(r,"sceditor-emoticon"),p===c&&(d=m.length+s.startOffset),p===e&&e.childNodes[s.startOffset]===c&&(d=m.length),p===l&&(d=s.startOffset),c&&c.nodeType===de||(c=a.insertBefore(a.ownerDocument.createTextNode(""),c)),c.insertData(0,m),u(l),u(r),d>-1&&(s.setStart(c,d),s.collapse(!0),t.selectRange(s))}}}function ne(e,t,n){var o=e.ownerDocument,r="(^|\\s| | | | |$)",a=[],l={};c(e,"code")||(i(t,function(e){l[e]=new RegExp(r+G(e)+r),a.push(e)}),a.sort(function(e,t){return t.length-e.length}),function e(i){for(i=i.firstChild;i;){if(i.nodeType!==ue||C(i,"code")||e(i),i.nodeType===de)for(var r=0;r<a.length;r++){var c=i.nodeValue,s=a[r],u=n?c.search(l[s]):c.indexOf(s);if(u>-1){var d=c.indexOf(s,u),f=I(t[s],o),p=c.substr(d+s.length);f.appendChild(o.createTextNode(p)),i.nodeValue=c.substr(0,d),i.parentNode.insertBefore(f,i.nextSibling)}}i=i.nextSibling}}(e))}function oe(e,t){var n;O(e,function(e){W(e,!0)?(n||S(n=a("p",{},t),e),e.nodeType===de&&""===e.nodeValue||d(n,e)):n=null},!1,!0)}function ie(e,t){var r,l,c,h,k,E,D,B,O,I,j,U,Y,X,G,Q,ce,se,pe,ge,he,xe,we,ke,Se,De,Te,ze,_e,Be,Oe,Ae,Ie,Le,Pe,Ve,We,je,qe,Ue,$e,Ye,Ke,Xe,Ge,Je,Qe,Ze,et,tt,nt,ot,it,rt,at,lt,ct,st,ut,dt,ft,pt,mt=this,gt=e.get?e.get(0):e,ht={},vt=[],yt=[],bt={},xt={},wt={};mt.commands=n(!0,{},t.commands||Ee);var Ct=mt.opts=n(!0,{},me,t);mt.opts.emoticons=t.emoticons||me.emoticons,De=function(){gt._sceditor=mt,Ct.locale&&"en"!==Ct.locale&&Ae(),S(l=a("div",{className:"sceditor-container"}),gt),x(l,"z-index",Ct.zIndex),Re&&M(l,"ie ie"+Re),pe=gt.required,gt.required=!1;var e=ie.formats[Ct.format];"init"in(r=e?new e:{})&&r.init.call(mt),Oe(),We(),Ie(),Be(),Le(),Pe(),be||mt.toggleSourceMode(),et();var t=function(){m(Me,"load",t),Ct.autofocus&&rt(),pt(),nt(),X.call("ready"),"onReady"in r&&r.onReady.call(mt)};p(Me,"load",t),"complete"===Ne.readyState&&t()},Oe=function(){var e=Ct.plugins;e=e?e.toString().split(","):[],X=new Z(mt),e.forEach(function(e){X.register(e.trim())})},Ae=function(){var e;(U=ie.locale[Ct.locale])||(e=Ct.locale.split("-"),U=ie.locale[e[0]]),U&&U.dateFormat&&(Ct.dateFormat=U.dateFormat)},Be=function(){D=a("textarea"),h=a("iframe",{frameborder:0,allowfullscreen:!0}),Ct.startInSourceMode?(M(l,"sourceMode"),v(h)):(M(l,"wysiwygMode"),v(D)),Ct.spellcheck||g(l,"spellcheck","false"),"https:"===Me.location.protocol&&g(h,"src","javascript:false"),d(l,h),d(l,D),mt.dimensions(Ct.width||F(gt),Ct.height||H(gt));var e=Re?"ie ie"+Re:"";e+=ye?" ios":"",(E=h.contentDocument).open(),E.write(Ce("html",{attrs:' class="'+e+'"',spellcheck:Ct.spellcheck?"":'spellcheck="false"',charset:Ct.charset,style:Ct.style})),E.close(),k=E.body,mt.readOnly(!!Ct.readOnly),(ye||ve||Re)&&(H(k,"100%"),Re||p(k,"touchend",mt.focus));var t=g(gt,"tabindex");g(D,"tabindex",t),g(h,"tabindex",t),Y=new ee(h.contentWindow),v(gt),mt.val(gt.value);var n=Ct.placeholder||g(gt,"placeholder");n&&(D.placeholder=n,g(k,"placeholder",n))},Le=function(){Ct.autoUpdate&&(p(k,"blur",ft),p(D,"blur",ft)),null===Ct.rtl&&(Ct.rtl="rtl"===x(D,"direction")),mt.rtl(!!Ct.rtl),Ct.autoExpand&&(p(k,"load",pt,fe),p(E,"input keyup",pt)),Ct.resizeEnabled&&Ve(),g(l,"id",Ct.id),mt.emoticons(Ct.emoticonsEnabled)},Pe=function(){var e=gt.form,t="onselectionchange"in E?"selectionchange":"keyup focus blur contextmenu mouseup touchend click";p(Ne,"click",Qe),e&&(p(e,"reset",Ke),p(e,"submit",mt.updateOriginal,fe)),p(k,"keypress",Ye),p(k,"keydown",Ue),p(k,"keydown",$e),p(k,"keyup",nt),p(k,"blur",ut),p(k,"keyup",dt),p(k,"paste",je),p(k,"compositionstart compositionend",Ge),p(k,t,ot),p(k,"keydown keyup keypress focus blur contextmenu",Je),Ct.emoticonsCompat&&Me.getSelection&&p(k,"keyup",lt),p(k,"blur",function(){mt.val()||M(k,"placeholder")}),p(k,"focus",function(){N(k,"placeholder")}),p(D,"blur",ut),p(D,"keyup",dt),p(D,"keydown",Ue),p(D,"compositionstart compositionend",Ge),p(D,"keydown keyup keypress focus blur contextmenu",Je),p(E,"mousedown",Xe),p(E,t,ot),p(E,"beforedeactivate keyup mouseup",_e),p(E,"keyup",nt),p(E,"focus",function(){O=null}),p(l,"selectionchanged",it),p(l,"selectionchanged",et),p(l,"selectionchanged valuechanged nodechanged",Je)},Ie=function(){var e,t=mt.commands,n=(Ct.toolbarExclude||"").split(","),o=Ct.toolbar.split("|");c=a("div",{className:"sceditor-toolbar",unselectable:"on"}),Ct.icons in ie.icons&&(Se=new ie.icons[Ct.icons]),i(o,function(o,r){e=a("div",{className:"sceditor-group"}),i(r.split(","),function(o,i){var r,a,l=t[i];!l||n.indexOf(i)>-1||(a=l.shortcut,r=Ce("toolbarButton",{name:i,dispName:mt._(l.name||l.tooltip||i)},!0).firstChild,Se&&Se.create&&Se.create(i)&&(S(Se.create(i),r.firstChild),M(r,"has-icon")),r._sceTxtMode=!!l.txtExec,r._sceWysiwygMode=!!l.exec,R(r,"disabled",!l.exec),p(r,"click",function(e){T(r,"disabled")||ze(r,l),et(),e.preventDefault()}),p(r,"mousedown",function(e){mt.closeDropDown(),e.preventDefault()}),l.tooltip&&g(r,"title",mt._(l.tooltip)+(a?" ("+a+")":"")),a&&mt.addShortcut(a,i),l.state?yt.push({name:i,state:l.state}):re(l.exec)&&yt.push({name:i,state:l.exec}),d(e,r),xt[i]=r)}),e.firstChild&&d(c,e)}),d(Ct.toolbarContainer||l,c)},Ve=function(){var e,t,n,o,i,r,c=a("div",{className:"sceditor-grip"}),s=a("div",{className:"sceditor-resize-cover"}),u="touchcancel touchend mouseup",f=0,g=0,h=0,b=0,x=0,w=0,C=F(l),k=H(l),E=!1,S=mt.rtl();if(e=Ct.resizeMinHeight||k/1.5,t=Ct.resizeMaxHeight||2.5*k,n=Ct.resizeMinWidth||C/1.25,o=Ct.resizeMaxWidth||1.25*C,i=function(i){"touchmove"===i.type?(i=Me.event,h=i.changedTouches[0].pageX,b=i.changedTouches[0].pageY):(h=i.pageX,b=i.pageY);var r=w+(b-g),a=S?x-(h-f):x+(h-f);o>0&&a>o&&(a=o),n>0&&a<n&&(a=n),Ct.resizeWidth||(a=!1),t>0&&r>t&&(r=t),e>0&&r<e&&(r=e),Ct.resizeHeight||(r=!1),(a||r)&&mt.dimensions(a,r),i.preventDefault()},r=function(e){E&&(E=!1,v(s),N(l,"resizing"),m(Ne,"touchmove mousemove",i),m(Ne,u,r),e.preventDefault())},Se&&Se.create){var D=Se.create("grip");D&&(d(c,D),M(c,"has-icon"))}d(l,c),d(l,s),v(s),p(c,"touchstart mousedown",function(e){"touchstart"===e.type?(e=Me.event,f=e.touches[0].pageX,g=e.touches[0].pageY):(f=e.pageX,g=e.pageY),x=F(l),w=H(l),E=!0,M(l,"resizing"),y(s),p(Ne,"touchmove mousemove",i),p(Ne,u,r),e.preventDefault()})},We=function(){var e=Ct.emoticons,t=Ct.emoticonsRoot||"";e&&(wt=n({},e.more,e.dropdown,e.hidden)),i(wt,function(e,n){wt[e]=Ce("emoticon",{key:e,url:t+(n.url||n),tooltip:n.tooltip||e}),Ct.emoticonsEnabled&&vt.push(a("img",{src:t+(n.url||n)}))})},rt=function(){var e,t,n=k.firstChild,o=!!Ct.autofocusEnd;if(_(l)){if(mt.sourceMode())return t=o?D.value.length:0,void D.setSelectionRange(t,t);if($(k),o)for((n=k.lastChild)||(n=a("p",{},E),d(k,n));n.lastChild;)n=n.lastChild,!Fe&&C(n,"br")&&n.previousSibling&&(n=n.previousSibling);e=E.createRange(),V(n)?e.selectNodeContents(n):(e.setStartBefore(n),o&&e.setStartAfter(n)),e.collapse(!o),Y.selectRange(e),ce=e,o&&(k.scrollTop=k.scrollHeight),mt.focus()}},mt.readOnly=function(e){return"boolean"!=typeof e?!D.readonly:(k.contentEditable=!e,D.readonly=!e,Ze(e),mt)},mt.rtl=function(e){var t=e?"rtl":"ltr";return"boolean"!=typeof e?"rtl"===g(D,"dir"):(g(k,"dir",t),g(D,"dir",t),N(l,"rtl"),N(l,"ltr"),M(l,t),Se&&Se.rtl&&Se.rtl(e),mt)},Ze=function(e){var t=mt.inSourceMode()?"_sceTxtMode":"_sceWysiwygMode";i(xt,function(n,o){R(o,"disabled",e||!o[t])})},mt.width=function(e,t){return e||0===e?(mt.dimensions(e,null,t),mt):F(l)},mt.dimensions=function(e,t,n){return e=!(!e&&0!==e)&&e,t=!(!t&&0!==t)&&t,!1===e&&!1===t?{width:mt.width(),height:mt.height()}:(!1!==e&&(!1!==n&&(Ct.width=e),F(l,e)),!1!==t&&(!1!==n&&(Ct.height=t),H(l,t)),mt)},mt.height=function(e,t){return e||0===e?(mt.dimensions(null,e,t),mt):H(l)},mt.maximize=function(e){return ae(e)?T(l,"sceditor-maximize"):((e=!!e)&&(we=Me.pageYOffset),R(Ne.documentElement,"sceditor-maximize",e),R(Ne.body,"sceditor-maximize",e),R(l,"sceditor-maximize",e),mt.width(e?"100%":Ct.width,!1),mt.height(e?"100%":Ct.height,!1),e||Me.scrollTo(0,we),pt(),mt)},pt=function(){Ct.autoExpand&&!xe&&setTimeout(mt.expandToContent,200)},mt.expandToContent=function(e){if(!mt.maximize()){if(xe=!1,!he){var t=Ct.resizeMinHeight||Ct.height||H(gt);he={min:t,max:Ct.resizeMaxHeight||2*t}}var n=Ne.createRange();n.selectNodeContents(k);var o=n.getBoundingClientRect(),i=E.documentElement.clientHeight,r=o.bottom-o.top,a=mt.height()+(r-i);e||-1===he.max||(a=Math.min(a,he.max)),mt.height(Math.ceil(Math.max(a,he.min)))}},mt.destroy=function(){if(X){X.destroy(),Y=null,O=null,X=null,B&&u(B),m(Ne,"click",Qe);var e=gt.form;e&&(m(e,"reset",Ke),m(e,"submit",mt.updateOriginal)),u(D),u(c),u(l),delete gt._sceditor,y(gt),gt.required=pe}},mt.createDropDown=function(e,t,o,r){var l,c="sceditor-"+t;mt.closeDropDown(!0),B&&T(B,c)||(!1!==r&&i(f(o,":not(input):not(textarea)"),function(e,t){t.nodeType===ue&&g(t,"unselectable","on")}),l=n({top:K(e).top,left:K(e).left,marginTop:e.clientHeight},Ct.dropDownCss),x(B=a("div",{className:"sceditor-dropdown "+c}),l),d(B,o),d(Ne.body,B),p(B,"click focusin",function(e){e.stopPropagation()}),setTimeout(function(){if(B){var e=f(B,"input,textarea")[0];e&&e.focus()}}))},Qe=function(e){3!==e.which&&B&&!e.defaultPrevented&&(ft(),mt.closeDropDown())},je=function(e){var t=Re||ve,n=k,o=e.clipboardData;if(o&&!t){var i={},r=o.types,a=o.items;e.preventDefault();for(var l=0;l<r.length;l++){if(Me.FileReader&&a&&He.test(a[l].type))return function(e){var t=new FileReader;t.onload=function(e){qe({html:'<img src="'+e.target.result+'" />'})},t.readAsDataURL(e)}(o.items[l].getAsFile());i[r[l]]=o.getData(r[l])}i.text=i["text/plain"],i.html=i["text/html"],qe(i)}else if(!ke){var c=n.scrollTop;for(Y.saveRange(),ke=Ne.createDocumentFragment();n.firstChild;)d(ke,n.firstChild);setTimeout(function(){var e=n.innerHTML;n.innerHTML="",d(n,ke),n.scrollTop=c,ke=!1,Y.restoreRange(),qe({html:e})},0)}},qe=function(e){var t=a("div",{},E);X.call("pasteRaw",e),e.html?(t.innerHTML=e.html,q(t)):t.innerHTML=J(e.text||"");var n={val:t.innerHTML};"fragmentToSource"in r&&(n.val=r.fragmentToSource(n.val,E,G)),X.call("paste",n),"fragmentToHtml"in r&&(n.val=r.fragmentToHtml(n.val,G)),X.call("pasteHtml",n),mt.wysiwygEditorInsertHtml(n.val,null,!0)},mt.closeDropDown=function(e){B&&(u(B),B=null),!0===e&&mt.focus()},mt.wysiwygEditorInsertHtml=function(e,t,n){var o,i,r,a=H(h);mt.focus(),!n&&s(Q,"code")||(Y.insertHTML(e,t),Y.saveRange(),Te(),y(o=f(k,"#sceditor-end-marker")[0]),i=k.scrollTop,r=K(o).top+1.5*o.offsetHeight-a,v(o),(r>i||r+a<i)&&(k.scrollTop=r),st(!1),Y.restoreRange(),nt())},mt.wysiwygEditorInsertText=function(e,t){mt.wysiwygEditorInsertHtml(J(e),J(t))},mt.insertText=function(e,t){return mt.inSourceMode()?mt.sourceEditorInsertText(e,t):mt.wysiwygEditorInsertText(e,t),mt},mt.sourceEditorInsertText=function(e,t){var n,o,i=D.selectionStart,r=D.selectionEnd;n=D.scrollTop,D.focus(),o=D.value,t&&(e+=o.substring(i,r)+t),D.value=o.substring(0,i)+e+o.substring(r,o.length),D.selectionStart=i+e.length-(t?t.length:0),D.selectionEnd=D.selectionStart,D.scrollTop=n,D.focus(),st()},mt.getRangeHelper=function(){return Y},mt.sourceEditorCaret=function(e){return D.focus(),e?(D.selectionStart=e.start,D.selectionEnd=e.end,this):{start:D.selectionStart,end:D.selectionEnd}},mt.val=function(e,t){return re(e)?(mt.inSourceMode()?mt.setSourceEditorValue(e):(!1!==t&&"toHtml"in r&&(e=r.toHtml(e)),mt.setWysiwygEditorValue(e)),mt):mt.inSourceMode()?mt.getSourceEditorValue(!1):mt.getWysiwygEditorValue(t)},mt.insert=function(e,t,n,o,i){if(mt.inSourceMode())return mt.sourceEditorInsertText(e,t),mt;if(t){var a=Y.selectedHtml();!1!==n&&"fragmentToSource"in r&&(a=r.fragmentToSource(a,E,G)),e+=a+t}return!1!==n&&"fragmentToHtml"in r&&(e=r.fragmentToHtml(e,G)),!1!==n&&!0===i&&(e=e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")),mt.wysiwygEditorInsertHtml(e),mt},mt.getWysiwygEditorValue=function(e){for(var t,n=a("div",{},E),o=k.childNodes,i=0;i<o.length;i++)d(n,o[i].cloneNode(!0));return d(k,n),q(n),u(n),t=n.innerHTML,!1!==e&&r.hasOwnProperty("toSource")&&(t=r.toSource(t,E)),t},mt.getBody=function(){return k},mt.getContentAreaContainer=function(){return h},mt.getSourceEditorValue=function(e){var t=D.value;return!1!==e&&"toHtml"in r&&(t=r.toHtml(t)),t},mt.setWysiwygEditorValue=function(e){e||(e="<p>"+(Re?"":"<br />")+"</p>"),k.innerHTML=e,Te(),nt(),st(),pt()},mt.setSourceEditorValue=function(e){D.value=e,st()},mt.updateOriginal=function(){gt.value=mt.val()},Te=function(){Ct.emoticonsEnabled&&ne(k,wt,Ct.emoticonsCompat)},mt.inSourceMode=function(){return T(l,"sourceMode")},mt.sourceMode=function(e){var t=mt.inSourceMode();return"boolean"!=typeof e?t:((t&&!e||!t&&e)&&mt.toggleSourceMode(),mt)},mt.toggleSourceMode=function(){var e=mt.inSourceMode();!be&&e||(e||(Y.saveRange(),Y.clear()),mt.blur(),e?mt.setWysiwygEditorValue(mt.getSourceEditorValue()):mt.setSourceEditorValue(mt.getWysiwygEditorValue()),O=null,b(D),b(h),R(l,"wysiwygMode",e),R(l,"sourceMode",!e),Ze(),et())},tt=function(){return D.focus(),D.value.substring(D.selectionStart,D.selectionEnd)},ze=function(e,t){mt.inSourceMode()?t.txtExec&&(Array.isArray(t.txtExec)?mt.sourceEditorInsertText.apply(mt,t.txtExec):t.txtExec.call(mt,e,tt())):t.exec&&(le(t.exec)?t.exec.call(mt,e):mt.execCommand(t.exec,t.hasOwnProperty("execParam")?t.execParam:null))},_e=function(){Re&&(O=Y.selectedRange())},mt.execCommand=function(e,t){var n=!1,o=mt.commands[e];if(mt.focus(),!s(Y.parentNode(),"code")){try{n=E.execCommand(e,!1,t)}catch(e){}!n&&o&&o.errorMessage&&alert(mt._(o.errorMessage)),et()}},ot=function(){function e(){if(Y&&!Y.compare(ce)){if((ce=Y.cloneSelected())&&ce.collapsed){var e=ce.startContainer,t=ce.startOffset;for(t&&e.nodeType!==de&&(e=e.childNodes[t]);e&&e.parentNode!==k;)e=e.parentNode;e&&W(e,!0)&&(Y.saveRange(),oe(k,E),Y.restoreRange())}z(l,"selectionchanged")}se=!1}se||(se=!0,"onselectionchange"in E?e():setTimeout(e,100))},it=function(){var e,t=Y.parentNode();G!==t&&(e=G,G=t,Q=Y.getFirstBlockParent(t),z(l,"nodechanged",{oldNode:e,newNode:G}))},mt.currentNode=function(){return G},mt.currentBlockNode=function(){return Q},et=function(){var e,t,n=E,o=mt.sourceMode();if(mt.readOnly())i(f(c,"active"),function(e,t){N(t,"active")});else{o||(t=Y.parentNode(),e=Y.getFirstBlockParent(t));for(var r=0;r<yt.length;r++){var a=0,l=xt[yt[r].name],s=yt[r].state,u=o&&!l._sceTxtMode||!o&&!l._sceWysiwygMode;if(re(s)){if(!o)try{(a=n.queryCommandEnabled(s)?0:-1)>-1&&(a=n.queryCommandState(s)?1:0)}catch(e){}}else u||(a=s.call(mt,t,e));R(l,"disabled",u||a<0),R(l,"active",a>0)}Se&&Se.update&&Se.update(o,t,e)}},Ye=function(e){if(!e.defaultPrevented&&(mt.closeDropDown(),13===e.which)){if(!C(Q,"li,ul,ol")&&L(Q)){O=null;var t=a("br",{},E);if(Y.insertNode(t),!Fe){var n=t.parentNode,o=n.lastChild;o&&o.nodeType===de&&""===o.nodeValue&&(u(o),o=n.lastChild),!W(n,!0)&&o===t&&W(t.previousSibling)&&Y.insertHTML("<br>")}e.preventDefault()}}},nt=function(){A(k,function(e){if(e.nodeType===ue&&!/inline/.test(x(e,"display"))&&!C(e,".sceditor-nlf")&&L(e)){var t=a("p",{},E);return t.className="sceditor-nlf",t.innerHTML=Fe?"":"<br />",d(k,t),!1}if(3===e.nodeType&&!/^\s*$/.test(e.nodeValue)||C(e,"br"))return!1})},Ke=function(){mt.val(gt.value)},Xe=function(){mt.closeDropDown(),O=null},mt._=function(){var e=arguments;return U&&U[e[0]]&&(e[0]=U[e[0]]),e[0].replace(/\{(\d+)\}/g,function(t,n){return void 0!==e[n-0+1]?e[n-0+1]:"{"+n+"}"})},Je=function(e){X&&X.call(e.type+"Event",e,mt);var t=(e.target===D?"scesrc":"scewys")+e.type;ht[t]&&ht[t].forEach(function(t){t.call(mt,e)})},mt.bind=function(e,t,n,o){for(var i=(e=e.split(" ")).length;i--;)if(le(t)){var r="scewys"+e[i],a="scesrc"+e[i];n||(ht[r]=ht[r]||[],ht[r].push(t)),o||(ht[a]=ht[a]||[],ht[a].push(t)),"valuechanged"===e[i]&&(st.hasHandler=!0)}return mt},mt.unbind=function(e,t,n,i){for(var r=(e=e.split(" ")).length;r--;)le(t)&&(n||o(ht["scewys"+e[r]]||[],t),i||o(ht["scesrc"+e[r]]||[],t));return mt},mt.blur=function(e,t,n){return le(e)?mt.bind("blur",e,t,n):mt.sourceMode()?D.blur():k.blur(),mt},mt.focus=function(e,t,n){if(le(e))mt.bind("focus",e,t,n);else if(mt.inSourceMode())D.focus();else{if(f(E,":focus").length)return;var o,i=Y.selectedRange();ce||rt(),!Fe&&i&&1===i.endOffset&&i.collapsed&&(o=i.endContainer)&&1===o.childNodes.length&&C(o.firstChild,"br")&&(i.setStartBefore(o.firstChild),i.collapse(!0),Y.selectRange(i)),h.contentWindow.focus(),k.focus(),O&&(Y.selectRange(O),O=null)}return et(),mt},mt.keyDown=function(e,t,n){return mt.bind("keydown",e,t,n)},mt.keyPress=function(e,t,n){return mt.bind("keypress",e,t,n)},mt.keyUp=function(e,t,n){return mt.bind("keyup",e,t,n)},mt.nodeChanged=function(e){return mt.bind("nodechanged",e,!1,!0)},mt.selectionChanged=function(e){return mt.bind("selectionchanged",e,!1,!0)},mt.valueChanged=function(e,t,n){return mt.bind("valuechanged",e,t,n)},at=function(e){var t=0,n=mt.emoticonsCache,o=String.fromCharCode(e.which);s(Q,"code")||(n||(n=[],i(wt,function(e,o){n[t++]=[e,o]}),n.sort(function(e,t){return e[0].length-t[0].length}),mt.emoticonsCache=n,mt.longestEmoticonCode=n[n.length-1][0].length),Y.replaceKeyword(mt.emoticonsCache,!0,!0,mt.longestEmoticonCode,Ct.emoticonsCompat,o)&&(Ct.emoticonsCompat&&/^\s$/.test(o)||e.preventDefault()))},lt=function(){te(Q,Y)},mt.emoticons=function(e){return e||!1===e?(Ct.emoticonsEnabled=e,e?(p(k,"keypress",at),mt.sourceMode()||(Y.saveRange(),Te(),st(!1),Y.restoreRange())):(i(f(k,"img[data-sceditor-emoticon]"),function(e,t){var n=w(t,"sceditor-emoticon"),o=E.createTextNode(n);t.parentNode.replaceChild(o,t)}),m(k,"keypress",at),st()),mt):Ct.emoticonsEnabled},mt.css=function(e){return ge||(ge=a("style",{id:"inline"},E),d(E.head,ge)),re(e)?(ge.styleSheet?ge.styleSheet.cssText=e:ge.innerHTML=e,mt):ge.styleSheet?ge.styleSheet.cssText:ge.innerHTML},Ue=function(e){var t=[],n={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|","[":"{","]":"}"},o={8:"backspace",9:"tab",13:"enter",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",91:"win",92:"win",93:"select",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={109:"-",110:"del",111:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},r=e.which,a=o[r]||String.fromCharCode(r).toLowerCase();(e.ctrlKey||e.metaKey)&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&(t.push("shift"),i[r]?a=i[r]:n[a]&&(a=n[a])),a&&(r<16||r>18)&&t.push(a),t=t.join("+"),bt[t]&&!1===bt[t].call(mt)&&(e.stopPropagation(),e.preventDefault())},mt.addShortcut=function(e,t){return e=e.toLowerCase(),re(t)?bt[e]=function(){return ze(xt[t],mt.commands[t]),!1}:bt[e]=t,mt},mt.removeShortcut=function(e){return delete bt[e.toLowerCase()],mt},$e=function(e){var t,n,o;if(!Ct.disableBlockRemove&&8===e.which&&(n=Y.selectedRange())&&(t=n.startContainer,0===n.startOffset&&(o=ct())&&!C(o,"body"))){for(;t!==o;){for(;t.previousSibling;)if((t=t.previousSibling).nodeType!==de||t.nodeValue)return;if(!(t=t.parentNode))return}mt.clearBlockFormatting(o),e.preventDefault()}},ct=function(){for(var e=Q;!L(e)||W(e,!0);)if(!(e=e.parentNode)||C(e,"body"))return;return e},mt.clearBlockFormatting=function(e){return!(e=e||ct())||C(e,"body")?mt:(Y.saveRange(),e.className="",O=null,g(e,"style",""),C(e,"p,div,td")||P(e,"p"),Y.restoreRange(),mt)},st=function(e){if(X&&(X.hasHandler("valuechangedEvent")||st.hasHandler)){var t,n=mt.sourceMode(),o=!n&&Y.hasSelection();I=!1,e=!1!==e&&!E.getElementById("sceditor-start-marker"),j&&(clearTimeout(j),j=!1),o&&e&&Y.saveRange(),(t=n?D.value:k.innerHTML)!==st.lastVal&&(st.lastVal=t,z(l,"valuechanged",{rawValue:n?mt.val():t})),o&&e&&Y.removeMarkers()}},ut=function(){j&&st()},dt=function(e){var t=e.which,n=dt.lastChar,o=13===n||32===n,i=8===n||46===n;dt.lastChar=t,I||(13===t||32===t?o?dt.triggerNext=!0:st():8===t||46===t?i?dt.triggerNext=!0:st():dt.triggerNext&&(st(),dt.triggerNext=!1),clearTimeout(j),j=setTimeout(function(){I||st()},1500))},Ge=function(e){(I=/start/i.test(e.type))||st()},ft=function(){mt.updateOriginal()},De()}var re=e.bind(null,"string"),ae=e.bind(null,"undefined"),le=e.bind(null,"function"),ce=e.bind(null,"number"),se={},ue=1,de=3,fe=!0,pe="|body|hr|p|div|h1|h2|h3|h4|h5|h6|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|blockquote|center|",me={toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,paste,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,image,email,link,unlink|emoticon,youtube,date,time|ltr,rtl|print,maximize,source",toolbarExclude:null,style:"jquery.sceditor.default.css",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",colors:"#000000,#44B8FF,#1E92F7,#0074D9,#005DC2,#00369B,#b3d5f4|#444444,#C3FFFF,#9DF9FF,#7FDBFF,#68C4E8,#419DC1,#d9f4ff|#666666,#72FF84,#4CEA5E,#2ECC40,#17B529,#008E02,#c0f0c6|#888888,#FFFF44,#FFFA1E,#FFDC00,#E8C500,#C19E00,#fff5b3|#aaaaaa,#FFC95F,#FFA339,#FF851B,#E86E04,#C14700,#ffdbbb|#cccccc,#FF857A,#FF5F54,#FF4136,#E82A1F,#C10300,#ffc6c3|#eeeeee,#FF56FF,#FF30DC,#F012BE,#D900A7,#B20080,#fbb8ec|#ffffff,#F551FF,#CF2BE7,#B10DC9,#9A00B2,#9A00B2,#e8b6ef",locale:g(document.documentElement,"lang")||"en",charset:"utf-8",emoticonsCompat:!1,emoticonsEnabled:!0,emoticonsRoot:"",emoticons:{dropdown:{":)":"emoticons/smile.png",":angel:":"emoticons/angel.png",":angry:":"emoticons/angry.png","8-)":"emoticons/cool.png",":'(":"emoticons/cwy.png",":ermm:":"emoticons/ermm.png",":D":"emoticons/grin.png","<3":"emoticons/heart.png",":(":"emoticons/sad.png",":O":"emoticons/shocked.png",":P":"emoticons/tongue.png",";)":"emoticons/wink.png"},more:{":alien:":"emoticons/alien.png",":blink:":"emoticons/blink.png",":blush:":"emoticons/blush.png",":cheerful:":"emoticons/cheerful.png",":devil:":"emoticons/devil.png",":dizzy:":"emoticons/dizzy.png",":getlost:":"emoticons/getlost.png",":happy:":"emoticons/happy.png",":kissing:":"emoticons/kissing.png",":ninja:":"emoticons/ninja.png",":pinch:":"emoticons/pinch.png",":pouty:":"emoticons/pouty.png",":sick:":"emoticons/sick.png",":sideways:":"emoticons/sideways.png",":silly:":"emoticons/silly.png",":sleeping:":"emoticons/sleeping.png",":unsure:":"emoticons/unsure.png",":woot:":"emoticons/w00t.png",":wassat:":"emoticons/wassat.png"},hidden:{":whistling:":"emoticons/whistling.png",":love:":"emoticons/wub.png"}},width:null,height:null,resizeEnabled:!0,resizeMinWidth:null,resizeMinHeight:null,resizeMaxHeight:null,resizeMaxWidth:null,resizeHeight:!0,resizeWidth:!0,dateFormat:"year-month-day",toolbarContainer:null,enablePasteFiltering:!1,disablePasting:!1,readOnly:!1,rtl:!1,autofocus:!1,autofocusEnd:!0,autoExpand:!1,autoUpdate:!1,spellcheck:!0,runWithoutWysiwygSupport:!1,startInSourceMode:!1,id:null,plugins:"",zIndex:null,bbcodeTrim:!1,disableBlockRemove:!1,parserOptions:{},dropDownCss:{}},ge=navigator.userAgent,he=function(){var e=3,t=document,n=t.createElement("div"),o=n.getElementsByTagName("i");do{n.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(o[0]);return t.documentMode&&t.all&&window.atob&&(e=10),4===e&&t.documentMode&&(e=11),e>4?e:void 0}(),ve="-ms-ime-align"in document.documentElement.style,ye=/iPhone|iPod|iPad| wosbrowser\//i.test(ge),be=function(){var e,t,n=document.createElement("div");return n.contentEditable=!0,"contentEditable"in document.documentElement&&"true"===n.contentEditable&&(t=/Opera Mobi|Opera Mini/i.test(ge),/Android/i.test(ge)&&(t=!0,/Safari/.test(ge)&&(t=!(e=/Safari\/(\d+)/.exec(ge))||!e[1]||e[1]<534)),/ Silk\//i.test(ge)&&(t=!(e=/AppleWebKit\/(\d+)/.exec(ge))||!e[1]||e[1]<534),ye&&(t=/OS [0-4](_\d)+ like Mac/i.test(ge)),/Firefox/i.test(ge)&&(t=!1),/OneBrowser/i.test(ge)&&(t=!1),"UCWEB"===navigator.vendor&&(t=!1),he<=9&&(t=!0),!t)}(),xe=/^(https?|s?ftp|mailto|spotify|skype|ssh|teamspeak|tel):|(\/\/)|data:image\/(png|bmp|gif|p?jpe?g);/i,we={html:'<!DOCTYPE html><html{attrs}><head><style>.ie * {min-height: auto !important} .ie table td {height:15px} @supports (-ms-ime-align:auto) { * { min-height: auto !important; } }</style><meta http-equiv="Content-Type" content="text/html;charset={charset}" /><link rel="stylesheet" type="text/css" href="{style}" /></head><body contenteditable="true" {spellcheck}><p></p></body></html>',toolbarButton:'<a class="sceditor-button sceditor-button-{name}" data-sceditor-command="{name}" unselectable="on"><div unselectable="on">{dispName}</div></a>',emoticon:'<img src="{url}" data-sceditor-emoticon="{key}" alt="{key}" title="{tooltip}" />',fontOpt:'<a class="sceditor-font-option" href="#" data-font="{font}"><font face="{font}">{font}</font></a>',sizeOpt:'<a class="sceditor-fontsize-option" data-size="{size}" href="#"><font size="{size}">{size}</font></a>',pastetext:'<div><label for="txt">{label}</label> <textarea cols="20" rows="7" id="txt"></textarea></div><div><input type="button" class="button" value="{insert}" /></div>',table:'<div><label for="rows">{rows}</label><input type="text" id="rows" value="2" /></div><div><label for="cols">{cols}</label><input type="text" id="cols" value="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',image:'<div><label for="link">{url}</label> <input type="text" id="image" placeholder="https://" /></div><div><label for="width">{width}</label> <input type="text" id="width" size="2" /></div><div><label for="height">{height}</label> <input type="text" id="height" size="2" /></div><div><input type="button" class="button" value="{insert}" /></div>',email:'<div><label for="email">{label}</label> <input type="text" id="email" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{insert}" /></div>',link:'<div><label for="link">{url}</label> <input type="text" id="link" placeholder="https://" /></div><div><label for="des">{desc}</label> <input type="text" id="des" /></div><div><input type="button" class="button" value="{ins}" /></div>',youtubeMenu:'<div><label for="link">{label}</label> <input type="text" id="link" placeholder="https://" /></div><div><input type="button" class="button" value="{insert}" /></div>',youtube:'<iframe width="560" height="315" frameborder="0" allowfullscreensrc="https://www.youtube.com/embed/{id}?wmode=opaque&start={time}" data-youtube-id="{id}"></iframe>'},Ce=function(e,t,n){var o=we[e];return Object.keys(t).forEach(function(e){o=o.replace(new RegExp(G("{"+e+"}"),"g"),t[e])}),n&&(o=I(o)),o},ke=he&&he<11,Ee={bold:{exec:"bold",tooltip:"Bold",shortcut:"Ctrl+B"},italic:{exec:"italic",tooltip:"Italic",shortcut:"Ctrl+I"},underline:{exec:"underline",tooltip:"Underline",shortcut:"Ctrl+U"},strike:{exec:"strikethrough",tooltip:"Strikethrough"},subscript:{exec:"subscript",tooltip:"Subscript"},superscript:{exec:"superscript",tooltip:"Superscript"},left:{exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(e,t,n){var o=a("div");p(o,"click","a",function(t){n(w(this,"font")),e.closeDropDown(!0),t.preventDefault()}),e.opts.fonts.split(",").forEach(function(e){d(o,Ce("fontOpt",{font:e},!0))}),e.createDropDown(t,"font-picker",o)},exec:function(e){var t=this;Ee.font._dropDown(t,e,function(e){t.execCommand("fontname",e)})},tooltip:"Font Name"},size:{_dropDown:function(e,t,n){var o=a("div");p(o,"click","a",function(t){n(w(this,"size")),e.closeDropDown(!0),t.preventDefault()});for(var i=1;i<=7;i++)d(o,Ce("sizeOpt",{size:i},!0));e.createDropDown(t,"fontsize-picker",o)},exec:function(e){var t=this;Ee.size._dropDown(t,e,function(e){t.execCommand("fontsize",e)})},tooltip:"Font Size"},color:{_dropDown:function(e,t,n){var o=a("div"),i="",r=Ee.color;r._htmlCache||(e.opts.colors.split("|").forEach(function(e){i+='<div class="sceditor-color-column">',e.split(",").forEach(function(e){i+='<a href="#" class="sceditor-color-option" style="background-color: '+e+'" data-color="'+e+'"></a>'}),i+="</div>"}),r._htmlCache=i),d(o,I(r._htmlCache)),p(o,"click","a",function(t){n(w(this,"color")),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"color-picker",o)},exec:function(e){var t=this;Ee.color._dropDown(t,e,function(e){t.execCommand("forecolor",e)})},tooltip:"Font Color"},removeformat:{exec:"removeformat",tooltip:"Remove Formatting"},cut:{exec:"cut",tooltip:"Cut",errorMessage:"Your browser does not allow the cut command. Please use the keyboard shortcut Ctrl/Cmd-X"},copy:{exec:"copy",tooltip:"Copy",errorMessage:"Your browser does not allow the copy command. Please use the keyboard shortcut Ctrl/Cmd-C"},paste:{exec:"paste",tooltip:"Paste",errorMessage:"Your browser does not allow the paste command. Please use the keyboard shortcut Ctrl/Cmd-V"},pastetext:{exec:function(e){var t,n=a("div"),o=this;d(n,Ce("pastetext",{label:o._("Paste your text inside the following box:"),insert:o._("Insert")},!0)),p(n,"click",".button",function(e){(t=f(n,"#txt")[0].value)&&o.wysiwygEditorInsertText(t),o.closeDropDown(!0),e.preventDefault()}),o.createDropDown(e,"pastetext",n)},tooltip:"Paste Text"},bulletlist:{exec:function(){Q(this),this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){Q(this),this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(e,t){var n,o,i,r=l(t,"ul,ol,menu");return r.length>1&&r[0].children.length>1?0:C(t,"ul,ol,menu")&&(n=this.getRangeHelper().selectedRange(),o=n.startContainer.parentNode,i=n.endContainer.parentNode,o!==o.parentNode.firstElementChild||C(i,"li")&&i!==i.parentNode.lastElementChild)?0:-1},exec:function(){var e=this,t=e.getRangeHelper().getFirstBlockParent();e.focus(),l(t,"ul,ol,menu")&&e.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(e,t){return s(t,"ul,ol,menu")>0?0:-1},exec:function(){l(this.getRangeHelper().getFirstBlockParent(),"ul,ol,menu")&&this.execCommand("outdent")},tooltip:"Remove one indent"},table:{exec:function(e){var t=this,n=a("div");d(n,Ce("table",{rows:t._("Rows:"),cols:t._("Cols:"),insert:t._("Insert")},!0)),p(n,"click",".button",function(e){var o=Number(f(n,"#rows")[0].value),i=Number(f(n,"#cols")[0].value),r="<table>";o>0&&i>0&&(r+=Array(o+1).join("<tr>"+Array(i+1).join("<td>"+(ke?"":"<br />")+"</td>")+"</tr>"),r+="</table>",t.wysiwygEditorInsertHtml(r),t.closeDropDown(!0),e.preventDefault())}),t.createDropDown(e,"inserttable",n)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("<code>",(ke?"":"<br />")+"</code>")},tooltip:"Code"},image:{_dropDown:function(e,t,n,o){var i=a("div");d(i,Ce("image",{url:e._("URL:"),width:e._("Width (optional):"),height:e._("Height (optional):"),insert:e._("Insert")},!0));var r=f(i,"#image")[0];r.value=n,p(i,"click",".button",function(t){r.value&&o(r.value,f(i,"#width")[0].value,f(i,"#height")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertimage",i)},exec:function(e){var t=this;Ee.image._dropDown(t,e,"",function(e,n,o){var i="";n&&(i+=' width="'+n+'"'),o&&(i+=' height="'+o+'"'),t.wysiwygEditorInsertHtml("<img"+i+' src="'+e+'" />')})},tooltip:"Insert an image"},email:{_dropDown:function(e,t,n){var o=a("div");d(o,Ce("email",{label:e._("E-mail:"),desc:e._("Description (optional):"),insert:e._("Insert")},!0)),p(o,"click",".button",function(t){var i=f(o,"#email")[0].value;i&&n(i,f(o,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertemail",o)},exec:function(e){var t=this;Ee.email._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?t.wysiwygEditorInsertHtml('<a href="mailto:'+e+'">'+(n||e)+"</a>"):t.execCommand("createlink","mailto:"+e)})},tooltip:"Insert an email"},link:{_dropDown:function(e,t,n){function o(t){r.value&&n(r.value,f(i,"#des")[0].value),e.closeDropDown(!0),t.preventDefault()}var i=a("div");d(i,Ce("link",{url:e._("URL:"),desc:e._("Description (optional):"),ins:e._("Insert")},!0));var r=f(i,"#link")[0];p(i,"click",".button",o),p(i,"keypress",function(e){13===e.which&&r.value&&o(e)},fe),e.createDropDown(t,"insertlink",i)},exec:function(e){var t=this;Ee.link._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?(n=n||e,t.wysiwygEditorInsertHtml('<a href="'+e+'">'+n+"</a>")):t.execCommand("createlink",e)})},tooltip:"Insert a link"},unlink:{state:function(){return s(this.currentNode(),"a")?0:-1},exec:function(){var e=s(this.currentNode(),"a");if(e){for(;e.firstChild;)S(e.firstChild,e);u(e)}},tooltip:"Unlink"},quote:{exec:function(e,t,n){var o="<blockquote>",i="</blockquote>";t?(o=o+(n=n?"<cite>"+n+"</cite>":"")+t+i,i=null):""===this.getRangeHelper().selectedHtml()&&(i=(ke?"":"<br />")+i),this.wysiwygEditorInsertHtml(o,i)},tooltip:"Insert a Quote"},emoticon:{exec:function(e){var t=this,o=function(r){var l,c=t.opts.emoticonsCompat,s=t.getRangeHelper(),u=c&&" "!==s.getOuterText(!0,1)?" ":"",f=c&&" "!==s.getOuterText(!1,1)?" ":"",m=a("div"),h=a("div"),v=0,y=n({},t.opts.emoticons.dropdown,r?t.opts.emoticons.more:{});return d(m,h),v=Math.sqrt(Object.keys(y).length),p(m,"click","img",function(e){t.insert(u+g(this,"alt")+f,null,!1).closeDropDown(!0),e.preventDefault()}),i(y,function(e,t){d(h,a("img",{src:t.url||t,alt:e,title:t.tooltip||e})),h.children.length>=v&&(h=a("div"),d(m,h))}),!r&&t.opts.emoticons.more&&(d(l=a("a",{className:"sceditor-more"}),document.createTextNode(t._("More"))),p(l,"click",function(n){t.createDropDown(e,"more-emoticons",o(!0)),n.preventDefault()}),d(m,l)),m};t.createDropDown(e,"emoticons",o(!1))},txtExec:function(e){Ee.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(e,t,n){var o=a("div");d(o,Ce("youtubeMenu",{label:e._("Video URL:"),insert:e._("Insert")},!0)),p(o,"click",".button",function(t){var r=f(o,"#link")[0].value,a=r.match(/(?:v=|v\/|embed\/|youtu.be\/)(.{11})/),l=r.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/),c=0;l&&i(l[1].split(/[hms]/),function(e,t){""!==t&&(c=60*c+Number(t))}),a&&/^[a-zA-Z0-9_\-]{11}$/.test(a[1])&&n(a[1],c),e.closeDropDown(!0),t.preventDefault()}),e.createDropDown(t,"insertlink",o)},exec:function(e){var t=this;Ee.youtube._dropDown(t,e,function(e,n){t.wysiwygEditorInsertHtml(Ce("youtube",{id:e,time:n}))})},tooltip:"Insert a YouTube video"},date:{_date:function(e){var t=new Date,n=t.getYear(),o=t.getMonth()+1,i=t.getDate();return n<2e3&&(n=1900+n),o<10&&(o="0"+o),i<10&&(i="0"+i),e.opts.dateFormat.replace(/year/i,n).replace(/month/i,o).replace(/day/i,i)},exec:function(){this.insertText(Ee.date._date(this))},txtExec:function(){this.insertText(Ee.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var e=new Date,t=e.getHours(),n=e.getMinutes(),o=e.getSeconds();return t<10&&(t="0"+t),n<10&&(n="0"+n),o<10&&(o="0"+o),t+":"+n+":"+o},exec:function(){this.insertText(Ee.time._time())},txtExec:function(){this.insertText(Ee.time._time())},tooltip:"Insert current time"},ltr:{state:function(e,t){return t&&"ltr"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!C(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!C(n,"body")))&&x(n,"direction","ltr"===x(n,"direction")?"":"ltr")},tooltip:"Left-to-Right"},rtl:{state:function(e,t){return t&&"rtl"===t.style.direction},exec:function(){var e=this,t=e.getRangeHelper(),n=t.getFirstBlockParent();e.focus(),(n&&!C(n,"body")||(e.execCommand("formatBlock","p"),(n=t.getFirstBlockParent())&&!C(n,"body")))&&x(n,"direction","rtl"===x(n,"direction")?"":"rtl")},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize())},txtExec:function(){this.maximize(!this.maximize())},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode()},txtExec:function(){this.toggleSourceMode()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}},Se={};Z.plugins=Se;var De=he&&he<11,Te=function(e,t,n){var o,i,r,a,l,c="",s=e.startContainer,u=e.startOffset;for(s&&3!==s.nodeType&&(s=s.childNodes[u],u=0),r=a=u;n>c.length&&s&&3===s.nodeType;)o=s.nodeValue,i=n-c.length,l&&(a=o.length,r=0),l=s,t?(u=r=Math.max(a-i,0),c=o.substr(r,a-r)+c,s=l.previousSibling):(u=r+(a=Math.min(i,o.length)),c+=o.substr(r,a),s=l.nextSibling);return{node:l||s,offset:u,text:c}},Me=window,Ne=document,Re=he,Fe=Re&&Re<11,He=/^image\/(p?jpe?g|gif|png|bmp)$/i;ie.locale={},ie.formats={},ie.icons={},ie.command={get:function(e){return Ee[e]||null},set:function(e,t){return!(!e||!t)&&(t=n(Ee[e]||{},t),t.remove=function(){ie.command.remove(e)},Ee[e]=t,this)},remove:function(e){return Ee[e]&&delete Ee[e],this}},window.sceditor={command:ie.command,commands:Ee,defaultOptions:me,ie:he,ios:ye,isWysiwygSupported:be,regexEscape:G,escapeEntities:J,escapeUriScheme:function(e){var t,n=/^[^\/]*:/i,o=window.location;return e&&n.test(e)&&!xe.test(e)?((t=o.pathname.split("/")).pop(),o.protocol+"//"+o.host+t.join("/")+"/"+e):e},dom:{css:x,attr:g,removeAttr:h,is:C,closest:s,width:F,height:H,traverse:O,rTraverse:A,parseHTML:I,hasStyling:L,convertElement:P,blockLevelList:pe,canHaveChildren:V,isInline:W,copyCSS:j,fixNesting:q,findCommonAncestor:function(e,t){for(;e=e.parentNode;)if(k(e,t))return e},getSibling:U,removeWhiteSpace:$,extractContents:Y,getOffset:K,getStyle:X,hasStyle:function(e,t,n){var o=X(e,t);return!!o&&(!n||o===n||Array.isArray(n)&&n.indexOf(o)>-1)}},locale:ie.locale,icons:ie.icons,utils:{each:i,isEmptyObject:t,extend:n},plugins:Z.plugins,formats:ie.formats,create:function(e,t){t=t||{},c(e,".sceditor-container")||(t.runWithoutWysiwygSupport||be)&&new ie(e,t)},instance:function(e){return e._sceditor}}}(); |
{ | ||
"name": "sceditor", | ||
"version": "2.0.0-beta1", | ||
"version": "2.0.0", | ||
"description": "A lightweight HTML and BBCode WYSIWYG editor.", | ||
@@ -14,2 +14,3 @@ "homepage": "http://www.sceditor.com/", | ||
], | ||
"jsdelivr": "minified/", | ||
"files": [ | ||
@@ -16,0 +17,0 @@ "emoticons/", |
@@ -1,2 +0,2 @@ | ||
# [SCEditor](http://www.sceditor.com/) v1.5.2 | ||
# [SCEditor](http://www.sceditor.com/) v2.0.0 | ||
@@ -10,2 +10,4 @@ [![Build Status](http://img.shields.io/travis/samclarke/SCEditor/master.svg?style=flat-square)](https://travis-ci.org/samclarke/SCEditor) | ||
![SCEditor demo](/demo.gif) | ||
For more information visit [sceditor.com](http://www.sceditor.com/) | ||
@@ -19,14 +21,16 @@ | ||
```html | ||
<link rel="stylesheet" href="minified/jquery.sceditor.min.css" /> | ||
<script src="minified/jquery.sceditor.bbcode.min.js"></script> | ||
<link rel="stylesheet" href="minified/themes/default.min.css" /> | ||
<script src="minified/sceditor.min.js"></script> | ||
<script src="minified/plugins/bbcode.js"></script> | ||
<script src="minified/plugins/xhtml.js"></script> | ||
``` | ||
Then to change all textareas to WYSIWYG editors, simply do: | ||
Then to convert a textarea into SCEditor, simply do: | ||
```js | ||
$(function() { | ||
$('textarea').sceditor({ | ||
plugins: 'xhtml', | ||
style: 'minified/jquery.sceditor.default.min.css' | ||
}); | ||
var textarea = document.getElementById('id-of-textarea'); | ||
sceditor.create(textarea, { | ||
plugins: 'xhtml', | ||
style: 'minified/themes/content/default.min.css' | ||
}); | ||
@@ -38,7 +42,7 @@ ``` | ||
```js | ||
$(function() { | ||
$('textarea').sceditor({ | ||
plugins: 'bbcode', | ||
style: 'minified/jquery.sceditor.default.min.css' | ||
}); | ||
var textarea = document.getElementById('id-of-textarea'); | ||
sceditor.create(textarea, { | ||
plugins: 'bbcode', | ||
style: 'minified/themes/content/default.min.css' | ||
}); | ||
@@ -110,6 +114,6 @@ ``` | ||
SCEditor is licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php) license: | ||
SCEditor is licensed under the [MIT](/LICENSE.md) license: | ||
Copyright (C) 2011 - 2015 Sam Clarke and contributors – sceditor.com | ||
Copyright (C) 2011 - 2017 Sam Clarke and contributors – sceditor.com | ||
@@ -132,2 +136,2 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
Mark James (http://www.famfamfam.com/lab/icons/silk/) | ||
Licensed under the [Creative Commons CC-BY license](http://creativecommons.org/licenses/by/3.0/). | ||
Licensed under the [Creative Commons CC-BY license](http://creativecommons.org/licenses/by/3.0/). |
@@ -423,3 +423,3 @@ /** | ||
if (!is(elm, 'font') || !(color = attr(elm, 'color'))) { | ||
color = elm.style.color || elm.css(elm, 'color'); | ||
color = elm.style.color || css(elm, 'color'); | ||
} | ||
@@ -677,3 +677,4 @@ | ||
if (cite || attr(element, authorAttr)) { | ||
author = cite.textContent || attr(element, authorAttr); | ||
author = cite && cite.textContent || | ||
attr(element, authorAttr); | ||
@@ -2409,3 +2410,3 @@ attr(element, authorAttr, author); | ||
parent = element.parentNode; | ||
parentLastChild = parent.lastChild; | ||
parentLastChild = parent && parent.lastChild; | ||
@@ -2412,0 +2413,0 @@ isLastBlockChild = parentLastChild === element; |
@@ -382,15 +382,4 @@ import * as utils from './utils.js'; | ||
if (node && node.nodeType === ELEMENT_NODE) { | ||
var parent, nextSibling, isAppended; | ||
result = (node.matches || node.msMatchesSelector || | ||
node.webkitMatchesSelector).call(node, selector); | ||
// Put node back where it came from after IE 9 fix | ||
if (isAppended) { | ||
remove(node); | ||
if (parent) { | ||
parent.insertBefore(node, nextSibling); | ||
} | ||
} | ||
} | ||
@@ -397,0 +386,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
133
862172
12904