"}),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;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=l("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=c(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(),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,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="
";o>0&&i>0&&(r+=Array(o+1).join("
"+Array(i+1).join("
"+(Se?"":" ")+"
")+"
"),r+="
",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("",(Se?"":" ")+"")},tooltip:"Code"},image:{_dropDown:function(e,t,n,o){var i=l("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;Ee.image._dropDown(t,e,"",function(e,n,o){var i="";n&&(i+=' width="'+n+'"'),o&&(i+=' height="'+o+'"'),t.wysiwygEditorInsertHtml("')})},tooltip:"Insert an image"},email:{_dropDown:function(e,t,n){var o=l("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;Ee.email._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?t.wysiwygEditorInsertHtml(''+(n||e)+""):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,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;Ee.link._dropDown(t,e,function(e,n){t.focus(),!t.getRangeHelper().selectedHtml()||n?(n=n||e,t.wysiwygEditorInsertHtml(''+n+"")):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="
",i="
";t?(o=o+(n=n?""+n+"":"")+t+i,i=null):""===this.getRangeHelper().selectedHtml()&&(i=(Se?"":" ")+i),this.wysiwygEditorInsertHtml(o,i)},tooltip:"Insert a Quote"},emoticon:{exec:function(e){var t=this,n=function(i){var a,c=t.opts,s=c.emoticonsRoot||"",u=c.emoticonsCompat,d=t.getRangeHelper(),p=u&&" "!==d.getOuterText(!0,1)?" ":"",g=u&&" "!==d.getOuterText(!1,1)?" ":"",v=l("div"),y=l("div"),b=0,x=o({},c.emoticons.dropdown,i?c.emoticons.more:{});return f(v,y),b=Math.sqrt(Object.keys(x).length),m(v,"click","img",function(e){t.insert(p+h(this,"alt")+g,null,!1).closeDropDown(!0),e.preventDefault()}),r(x,function(e,t){f(y,l("img",{src:s+(t.url||t),alt:e,title:t.tooltip||e})),y.children.length>=b&&(y=l("div"),f(v,y))}),!i&&c.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(v,a)),v};t.createDropDown(e,"emoticons",n(!1))},txtExec:function(e){Ee.emoticon.exec.call(this,e)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(e,t,n){var o=l("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})/),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;Ee.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(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&&!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,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,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 Ee[e]||null},set:function(e,t){return!(!e||!t)&&(t=o(Ee[e]||{},t),t.remove=function(){re.command.remove(e)},Ee[e]=t,this)},remove:function(e){return Ee[e]&&delete Ee[e],this}},window.sceditor={command:re.command,commands:Ee,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(S(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);