Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/fileman/html_editor/ |
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/fileman/html_editor/html-controls.min.js |
(function(){function t(){var t=window.BXHtmlEditor.Button,e=window.BXHtmlEditor.Dialog;function i(t,e,i){this.editor=t;this.params=i||{};this.className="bxhtmled-top-bar-btn bxhtmled-top-bar-color";this.activeClassName="bxhtmled-top-bar-btn-active";this.disabledClassName="bxhtmled-top-bar-btn-disabled";this.bCreated=false;this.zIndex=3009;this.disabledForTextarea=true;this.posOffset={top:6,left:0};this.id="color";this.title=BX.message("BXEdForeColor");this.actionColor="foreColor";this.actionBg="backgroundColor";this.showBgMode=!this.editor.bbCode;this.disabledForTextarea=!t.bbCode;this.Create();if(e){e.appendChild(this.GetCont())}}i.prototype={Create:function(){this.pCont=BX.create("SPAN",{props:{className:this.className,title:this.title||""}});this.pContLetter=this.pCont.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-top-bar-btn-text"},html:"A"}));this.pContStrip=this.pCont.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-top-bar-color-strip"}}));this.currentAction=this.actionColor;BX.bind(this.pCont,"click",BX.delegate(this.OnClick,this));BX.bind(this.pCont,"mousedown",BX.delegate(this.OnMouseDown,this));if(this.params.registerActions!==false){this.editor.RegisterCheckableAction(this.actionColor,{action:this.actionColor,control:this,value:this.value});this.editor.RegisterCheckableAction(this.actionBg,{action:this.actionBg,control:this,value:this.value})}},GetCont:function(){return this.pCont},Check:function(t){if(t!=this.checked&&!this.disabled){this.checked=t;if(this.checked){BX.addClass(this.pCont,"bxhtmled-top-bar-btn-active")}else{BX.removeClass(this.pCont,"bxhtmled-top-bar-btn-active")}}},Disable:function(t){if(t!=this.disabled){this.disabled=!!t;if(t){BX.addClass(this.pCont,"bxhtmled-top-bar-btn-disabled")}else{BX.removeClass(this.pCont,"bxhtmled-top-bar-btn-disabled")}}},GetValue:function(){return!!this.checked},SetValue:function(t,e,i){if(e&&e[0]){var s=i==this.actionColor?e[0].style.color:e[0].style.backgroundColor;this.SelectColor(s,i)}else{this.SelectColor(null,i)}},OnClick:function(){if(this.disabled){return false}if(this.bOpened){return this.Close()}this.Open()},OnMouseUp:function(){this.editor.selection.RestoreBookmark();if(!this.checked){BX.removeClass(this.pCont,this.activeClassName)}BX.unbind(document,"mouseup",BX.proxy(this.OnMouseUp,this));BX.removeCustomEvent(this.editor,"OnIframeMouseUp",BX.proxy(this.OnMouseUp,this))},OnMouseDown:function(){if(!this.disabled){if(this.disabledForTextarea||!this.editor.synchro.IsFocusedOnTextarea()){this.editor.selection.SaveBookmark()}BX.addClass(this.pCont,this.activeClassName);BX.bind(document,"mouseup",BX.proxy(this.OnMouseUp,this));BX.addCustomEvent(this.editor,"OnIframeMouseUp",BX.proxy(this.OnMouseUp,this))}},Close:function(){var t=this;this.popupShownTimeout=setTimeout((function(){t.editor.popupShown=false}),300);this.pValuesCont.style.display="none";BX.removeClass(this.pCont,this.activeClassName);this.editor.overlay.Hide();BX.unbind(window,"keydown",BX.proxy(this.OnKeyDown,this));BX.unbind(document,"mousedown",BX.proxy(this.CheckClose,this));this.bOpened=false},CheckClose:function(t){if(!this.bOpened){return BX.unbind(document,"mousedown",BX.proxy(this.CheckClose,this))}var e;if(t.target)e=t.target;else if(t.srcElement)e=t.srcElement;if(e.nodeType==3)e=e.parentNode;if(e!==this.custInp&&!BX.findParent(e,{className:"lhe-colpick-cont"})){this.Close()}},Open:function(){this.editor.popupShown=true;if(this.popupShownTimeout){this.popupShownTimeout=clearTimeout(this.popupShownTimeout)}var t=this;if(!this.bCreated){this.pValuesCont=document.body.appendChild(BX.create("DIV",{props:{className:"bxhtmled-popup bxhtmled-color-cont"},style:{zIndex:this.zIndex},html:'<div class="bxhtmled-popup-corner"></div>'}));BX.ZIndexManager.register(this.pValuesCont);if(this.showBgMode){this.pTextColorLink=this.pValuesCont.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-color-link bxhtmled-color-link-active"},text:this.params.ForeColorMess||BX.message("BXEdForeColor")}));this.pTextColorLink.setAttribute("data-bx-type","changeColorAction");this.pTextColorLink.setAttribute("data-bx-value",this.actionColor);this.pBgColorLink=this.pValuesCont.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-color-link"},text:this.params.BgColorMess||BX.message("BXEdBackColor")}));this.pBgColorLink.setAttribute("data-bx-type","changeColorAction");this.pBgColorLink.setAttribute("data-bx-value",this.actionBg)}this.pValuesContWrap=this.pValuesCont.appendChild(BX.create("DIV",{props:{className:"bxhtmled-color-wrap"}}));BX.bind(this.pValuesCont,"mousedown",(function(e){var i=e.target||e.srcElement,s;if(i!=t.pValuesCont){s=i&&i.getAttribute?i.getAttribute("data-bx-type"):null;if(!s){i=BX.findParent(i,(function(e){return e==t.pValuesCont||e.getAttribute&&e.getAttribute("data-bx-type")}),t.pValuesCont);s=i&&i.getAttribute?i.getAttribute("data-bx-type"):null}if(s=="customColorAction"){var a=i.getAttribute("data-bx-value");if(a=="link"){t.ShowCustomColor(true,t.colorCell.style.backgroundColor);BX.PreventDefault(e)}if(a=="button"){t.SelectColor(t.custInp.value);if(t.params.checkAction!==false&&t.editor.action.IsSupported(t.currentAction)){t.editor.action.Exec(t.currentAction,t.custInp.value)}}}else if(s=="changeColorAction"){if(t.showBgMode){t.SetMode(i.getAttribute("data-bx-value"));BX.PreventDefault(e)}}else if(i&&s){i.setAttribute("data-bx-action",t.currentAction);if(t.params.checkAction!==false){t.editor.CheckCommand(i)}t.SelectColor(i.getAttribute("data-bx-value"))}}}));var e=["#FF0000","#FFFF00","#00FF00","#00FFFF","#0000FF","#FF00FF","#FFFFFF","#EBEBEB","#E1E1E1","#D7D7D7","#CCCCCC","#C2C2C2","#B7B7B7","#ACACAC","#A0A0A0","#959595","#EE1D24","#FFF100","#00A650","#00AEEF","#2F3192","#ED008C","#898989","#7D7D7D","#707070","#626262","#555555","#464646","#363636","#262626","#111111","#000000","#F7977A","#FBAD82","#FDC68C","#FFF799","#C6DF9C","#A4D49D","#81CA9D","#7BCDC9","#6CCFF7","#7CA6D8","#8293CA","#8881BE","#A286BD","#BC8CBF","#F49BC1","#F5999D","#F16C4D","#F68E54","#FBAF5A","#FFF467","#ACD372","#7DC473","#39B778","#16BCB4","#00BFF3","#438CCB","#5573B7","#5E5CA7","#855FA8","#A763A9","#EF6EA8","#F16D7E","#EE1D24","#F16522","#F7941D","#FFF100","#8FC63D","#37B44A","#00A650","#00A99E","#00AEEF","#0072BC","#0054A5","#2F3192","#652C91","#91278F","#ED008C","#EE105A","#9D0A0F","#A1410D","#A36209","#ABA000","#588528","#197B30","#007236","#00736A","#0076A4","#004A80","#003370","#1D1363","#450E61","#62055F","#9E005C","#9D0039","#790000","#7B3000","#7C4900","#827A00","#3E6617","#045F20","#005824","#005951","#005B7E","#003562","#002056","#0C004B","#30004A","#4B0048","#7A0045","#7A0026"];var i,s,a,l=BX.create("TABLE",{props:{className:"bxhtmled-color-tbl"}}),o,n=e.length;this.pDefValueRow=l.insertRow(-1);s=this.pDefValueRow.insertCell(-1);s.colSpan=5;var h=s.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-color-def-but"}}));h.innerHTML=BX.message("BXEdDefaultColor");h.setAttribute("data-bx-type","action");h.setAttribute("data-bx-action",this.action);h.setAttribute("data-bx-value","");a=this.pDefValueRow.insertCell(-1);a.colSpan=5;a.className="bxhtmled-color-inp-cell";a.style.backgroundColor=e[38];this.colorCell=a;s=this.pDefValueRow.insertCell(-1);s.colSpan=6;this.custLink=s.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-color-custom"},html:BX.message("BXEdColorOther")}));this.custLink.setAttribute("data-bx-type","customColorAction");this.custLink.setAttribute("data-bx-value","link");this.custInp=s.appendChild(BX.create("INPUT",{props:{type:"text",className:"bxhtmled-color-custom-inp"},style:{display:"none"}}));this.custInp.setAttribute("data-bx-type","customColorAction");this.custInp.setAttribute("data-bx-value","input");this.custBut=s.appendChild(BX.create("INPUT",{props:{type:"button",className:"bxhtmled-color-custom-but",value:"ok"},style:{display:"none"}}));this.custBut.setAttribute("data-bx-type","customColorAction");this.custBut.setAttribute("data-bx-value","button");for(o=0;o<n;o++){if(Math.round(o/16)==o/16){i=l.insertRow(-1)}s=i.insertCell(-1);s.innerHTML=" ";s.className="bxhtmled-color-col-cell";s.style.backgroundColor=e[o];s.id="bx_color_id__"+o;s.setAttribute("data-bx-type","action");s.setAttribute("data-bx-action",this.action);s.setAttribute("data-bx-value",e[o]);s.onmouseover=function(t){this.className="bxhtmled-color-col-cell bxhtmled-color-col-cell-over";a.style.backgroundColor=e[this.id.substring("bx_color_id__".length)]};s.onmouseout=function(t){this.className="bxhtmled-color-col-cell"};s.onclick=function(i){t.Select(e[this.id.substring("bx_color_id__".length)])}}this.pValuesContWrap.appendChild(l);this.bCreated=true}document.body.appendChild(this.pValuesCont);this.pDefValueRow.style.display=t.editor.synchro.IsFocusedOnTextarea()?"none":"";this.pValuesCont.style.display="block";var r=BX.ZIndexManager.bringToFront(this.pValuesCont);var d=r.getZIndex();var p=this.editor.overlay.Show({zIndex:d-1}),c=BX.pos(this.pCont),u=c.left-this.pValuesCont.offsetWidth/2+this.pCont.offsetWidth/2+this.posOffset.left,m=c.bottom+this.posOffset.top;if(u<0){var f=this.pValuesCont.getElementsByClassName("bxhtmled-popup-corner")[0];f.style.transform="translateX("+u+"px)";u=0}BX.bind(window,"keydown",BX.proxy(this.OnKeyDown,this));BX.addClass(this.pCont,this.activeClassName);p.onclick=function(){t.Close()};this.pValuesCont.style.left=u+"px";this.pValuesCont.style.top=m+"px";this.bOpened=true;setTimeout((function(){BX.bind(document,"mousedown",BX.proxy(t.CheckClose,t))}),100);this.ShowCustomColor(false,"")},SetMode:function(t){this.currentAction=t;var e="bxhtmled-color-link-active";if(t==this.actionColor){BX.addClass(this.pTextColorLink,e);BX.removeClass(this.pBgColorLink,e)}else{BX.addClass(this.pBgColorLink,e);BX.removeClass(this.pTextColorLink,e)}},SelectColor:function(t,e){if(!e){e=this.currentAction}if(this.params.callback&&typeof this.params.callback=="function"){this.params.callback(e,this.editor.util.RgbToHex(t))}if(e==this.actionColor){this.pContLetter.style.color=t||"#525C69";this.pContStrip.style.backgroundColor=t||"#525C69"}else{this.pContLetter.style.backgroundColor=t||"transparent"}},ShowCustomColor:function(t,e){if(t!==false){this.custInp.style.display="";this.custBut.style.display="";this.custLink.style.display="none"}else{this.custInp.style.display="none";this.custBut.style.display="none";this.custLink.style.display=""}if(e)e=this.editor.util.RgbToHex(e);this.custInp.value=e.toUpperCase()||""}};function s(t,e){s.superclass.constructor.apply(this,arguments);this.id="search";this.title=BX.message("ButtonSearch");this.className+=" bxhtmled-button-search";this.Create();this.bInited=false;if(e)e.appendChild(this.GetCont())}BX.extend(s,t);s.prototype.OnClick=function(){if(this.disabled)return;if(!this.bInited){var t=this;this.pSearchCont=BX("bx-html-editor-search-cnt-"+this.editor.id);this.pSearchWrap=this.pSearchCont.appendChild(BX.create("DIV",{props:{className:"bxhtmled-search-cnt-search"}}));this.pReplaceWrap=this.pSearchCont.appendChild(BX.create("DIV",{props:{className:"bxhtmled-search-cnt-replace"}}));this.pSearchInput=this.pSearchWrap.appendChild(BX.create("INPUT",{props:{className:"bxhtmled-top-search-inp",type:"text"}}));this.pShowReplace=this.pSearchWrap.appendChild(BX.create("INPUT",{props:{type:"checkbox",value:"Y"}}));this.pReplaceInput=this.pReplaceWrap.appendChild(BX.create("INPUT",{props:{type:"text"}}));BX.bind(this.pShowReplace,"click",(function(){t.ShowReplace(!!this.checked)}));this.animation=null;this.animationStartHeight=0;this.animationEndHeight=0;this.height0=0;this.height1=37;this.height2=66;this.bInited=true;this.bReplaceOpened=false}if(!this.bOpened)this.OpenPanel();else this.ClosePanel()};s.prototype.SetPanelHeight=function(t,e){this.pSearchCont.style.height=t+"px";this.pSearchCont.style.opacity=e/100;this.editor.SetAreaContSize(this.origAreaWidth,this.origAreaHeight-t,{areaContTop:this.editor.toolbar.GetHeight()+t})};s.prototype.OpenPanel=function(t){this.pSearchCont.style.display="block";if(this.animation)this.animation.stop();if(t){this.animationStartHeight=this.height1;this.animationEndHeight=this.height2}else{this.origAreaHeight=parseInt(this.editor.dom.areaCont.style.height,10);this.origAreaWidth=parseInt(this.editor.dom.areaCont.style.width,10);this.pShowReplace.checked=false;this.pSearchCont.style.opacity=0;this.animationStartHeight=this.height0;this.animationEndHeight=this.height1}var e=this;this.animation=new BX.easing({duration:300,start:{height:this.animationStartHeight,opacity:t?100:0},finish:{height:this.animationEndHeight,opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(t){e.SetPanelHeight(t.height,t.opacity)},complete:BX.proxy((function(){this.animation=null}),this)});this.animation.animate();this.bOpened=true};s.prototype.ClosePanel=function(t){if(this.animation)this.animation.stop();this.pSearchCont.style.opacity=1;if(t){this.animationStartHeight=this.height2;this.animationEndHeight=this.height1}else{this.animationStartHeight=this.bReplaceOpened?this.height2:this.height1;this.animationEndHeight=this.height0}var e=this;this.animation=new BX.easing({duration:200,start:{height:this.animationStartHeight,opacity:t?100:0},finish:{height:this.animationEndHeight,opacity:100},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(t){e.SetPanelHeight(t.height,t.opacity)},complete:BX.proxy((function(){if(!t)this.pSearchCont.style.display="none";this.animation=null}),this)});this.animation.animate();if(!t)this.bOpened=false};s.prototype.ShowReplace=function(t){if(t){this.OpenPanel(true);this.bReplaceOpened=true}else{this.ClosePanel(true);this.bReplaceOpened=false}};function a(t,e){a.superclass.constructor.apply(this,arguments);this.id="change_view";this.title=BX.message("ButtonViewMode");this._className=this.className;this.activeClassName="bxhtmled-top-bar-btn-active bxhtmled-top-bar-dd-active";this.topClassName="bxhtmled-top-bar-dd";this.arValues=[{id:"view_wysiwyg",title:BX.message("ViewWysiwyg"),className:this.className+" bxhtmled-button-viewmode-wysiwyg",action:"changeView",value:"wysiwyg"},{id:"view_code",title:BX.message("ViewCode"),className:this.className+" bxhtmled-button-viewmode-code",action:"changeView",value:"code"}];if(!t.bbCode){this.arValues.push({id:"view_split_hor",title:BX.message("ViewSplitHor"),className:this.className+" bxhtmled-button-viewmode-split-hor",action:"splitMode",value:"0"});this.arValues.push({id:"view_split_ver",title:BX.message("ViewSplitVer"),className:this.className+" bxhtmled-button-viewmode-split-ver",action:"splitMode",value:"1"})}this.className+=" bxhtmled-top-bar-dd";this.disabledForTextarea=false;this.Create();if(e)e.appendChild(this.GetCont());var i=this;BX.addCustomEvent(this.editor,"OnSetViewAfter",(function(){var t="view_"+i.editor.currentViewName;if(i.editor.currentViewName=="split"){t+="_"+(i.editor.GetSplitMode()?"ver":"hor")}if(t!==i.currentValueId){i.SelectItem(t)}}))}BX.extend(a,window.BXHtmlEditor.DropDown);a.prototype.Open=function(){var t=this.editor.IsExpanded();if(!t){var e=BX.pos(this.editor.dom.cont);if(e.left<45)t=true}this.posOffset.left=t?40:-4;a.superclass.Open.apply(this,arguments);this.pValuesCont.firstChild.style.left=t?"20px":""};a.prototype.SelectItem=function(t,e){e=a.superclass.SelectItem.apply(this,[t,e]);if(e){this.pCont.className=this.topClassName+" "+e.className}else{this.pCont.className=this.topClassName+" "+this.className}this.currentValueId=t};function l(t,e){l.superclass.constructor.apply(this,arguments);this.id="bbcode";this.title=this.editor.bbCode?BX.message("BXEdBbCode"):BX.message("BXEdHtmlCode");this.className+=this.editor.bbCode?" bxhtmled-button-bbcode":" bxhtmled-button-htmlcode";this.disabledForTextarea=false;this.Create();var i=this;BX.addCustomEvent(this.editor,"OnSetViewAfter",(function(){i.Check(i.editor.GetViewMode()=="code")}));if(e)e.appendChild(this.GetCont())}BX.extend(l,t);l.prototype.OnClick=function(){if(this.disabled)return;if(this.editor.GetViewMode()=="wysiwyg"){this.editor.SetView("code",true);this.Check(true)}else{this.editor.SetView("wysiwyg",true);this.Check(false)}};function o(t,e){o.superclass.constructor.apply(this,arguments);this.id="undo";this.title=BX.message("Undo");this.className+=" bxhtmled-button-undo";this.action="doUndo";this.Create();if(e)e.appendChild(this.GetCont());var i=this;this.Disable(true);this._disabled=true;BX.addCustomEvent(this.editor,"OnEnableUndo",(function(t){i._disabled=!t;i.Disable(!t)}))}BX.extend(o,t);o.prototype.Disable=function(t){t=t||this._disabled;if(t!=this.disabled){this.disabled=!!t;if(t)BX.addClass(this.pCont,"bxhtmled-top-bar-btn-disabled");else BX.removeClass(this.pCont,"bxhtmled-top-bar-btn-disabled")}};function n(t,e){n.superclass.constructor.apply(this,arguments);this.id="redo";this.title=BX.message("Redo");this.className+=" bxhtmled-button-redo";this.action="doRedo";this.Create();if(e)e.appendChild(this.GetCont());var i=this;this.Disable(true);this._disabled=true;BX.addCustomEvent(this.editor,"OnEnableRedo",(function(t){i._disabled=!t;i.Disable(!t)}))}BX.extend(n,t);n.prototype.Disable=function(t){t=t||this._disabled;if(t!=this.disabled){this.disabled=!!t;if(t)BX.addClass(this.pCont,"bxhtmled-top-bar-btn-disabled");else BX.removeClass(this.pCont,"bxhtmled-top-bar-btn-disabled")}};function h(t,e){h.superclass.constructor.apply(this,arguments);this.id="style_selector";this.title=BX.message("StyleSelectorTitle");this.className+=" ";this.action="formatStyle";this.itemClassNameGroup="bxhtmled-dd-list-item-gr";this.OPEN_DELAY=800;this.checkedClasses=[];this.checkedTags=this.editor.GetBlockTags();this.arValues=this.GetStyleListValues();this.Create();if(e)e.appendChild(this.GetCont());BX.addCustomEvent(this.editor,"OnApplySiteTemplate",BX.proxy(this.OnTemplateChanged,this))}BX.extend(h,window.BXHtmlEditor.DropDownList);h.prototype.OnTemplateChanged=function(){if(this.bOpened)this.Close();this.arValues=this.GetStyleListValues();this.Create()};h.prototype.GetStyleListValues=function(){this.arValues=[{id:"",name:BX.message("StyleNormal"),topName:BX.message("StyleSelectorName"),tagName:false,action:"formatStyle",value:"",defaultValue:true},{name:BX.message("StyleH2"),className:"bxhtmled-style-h2",tagName:"H2",action:"formatStyle",value:"H2"},{name:BX.message("StyleH3"),className:"bxhtmled-style-h3",tagName:"H3",action:"formatStyle",value:"H3"},{id:"headingsMore",name:BX.message("HeadingMore"),className:"bxhtmled-style-heading-more",items:[{name:BX.message("StyleH1"),className:"bxhtmled-style-h1",tagName:"H1",action:"formatStyle",value:"H1"},{name:BX.message("StyleH4"),className:"bxhtmled-style-h4",tagName:"H4",action:"formatStyle",value:"H4"},{name:BX.message("StyleH5"),className:"bxhtmled-style-h5",tagName:"H5",action:"formatStyle",value:"H5"},{name:BX.message("StyleH6"),className:"bxhtmled-style-h6",tagName:"H6",action:"formatStyle",value:"H6"}]}];var t=this.editor.GetStylesDescription();this.metaClasses=this.GetMetaClassSections();var e,i,s=[],a={},l,o,n;for(e in t){if(t.hasOwnProperty(e)&&typeof t[e]=="object"){i=t[e];if(t[e].section){if(typeof a[i.section]=="undefined"){a[i.section]=s.length;s.push({id:this.metaClasses[i.section].id,name:this.metaClasses[i.section].name,defaultValue:false,items:[]})}s[a[i.section]].items.push({id:e,name:i.title||e,action:"formatStyle",value:{className:e,tag:i.tag||false},html:i.html||false,defaultValue:false})}else{s.push({id:e,name:i.title||e,action:"formatStyle",value:{className:e,tag:i.tag||false},html:i.html||false,defaultValue:false})}this.checkedClasses.push(e);if(i.tag){l=i.tag.indexOf(",")===-1?[i.tag]:i.tag.split(",");for(n=0;n<l.length;n++){o=BX.util.trim(l[n]).toUpperCase();if(!BX.util.in_array(o,this.checkedTags))this.checkedTags.push(o)}}}}if(s.length>0){this.arValues=this.arValues.concat(["separator"],s)}this.arValues.push("separator");this.arValues.push({id:"P",name:BX.message("StyleParagraph"),action:"formatStyle",value:"P"});this.arValues.push({id:"DIV",name:BX.message("StyleDiv"),action:"formatStyle",value:"DIV"});this.editor.On("GetStyleList",[this.styleList]);return this.arValues};h.prototype.GetMetaClassSections=function(){var t={quote:{id:"quote",name:BX.message("BXEdMetaClass_quote")},text:{id:"text",name:BX.message("BXEdMetaClass_text")},block:{id:"block",name:BX.message("BXEdMetaClass_block")},block_icon:{id:"block_icon",name:BX.message("BXEdMetaClass_block_icon")},list:{id:"list",name:BX.message("BXEdMetaClass_list"),activateNodes:["OL","UL"]}};return t};h.prototype.SetValue=function(t,e){this.FilterMetaClasses();var i=false,s,a;if(t){if(e&&e.nodeName){this.FilterMetaClasses(e.nodeName);if(e.className&&e.className!==""){a=e.className;if(e.nodeName=="UL"){var l=this.editor.action.actions.insertUnorderedList.getCustomBullitClass(e);if(l)a=e.className+"~~"+l}for(s in this.valueIndex){if(this.valueIndex.hasOwnProperty(s)&&s.indexOf(a)!==-1){this.SelectItem(s,false,false);i=true;break}}}}if(!i){var o=e.nodeName.toUpperCase();this.SelectItem(o,false,false);i=true}}if(!t||!i){this.SelectItem("",false,false)}};h.prototype.FilterMetaClasses=function(t){for(var e in this.metaClasses){if(this.metaClasses.hasOwnProperty(e)&&this.metaClasses[e].activateNodes&&this.metaClasses[e].itemNode){if(!t){this.metaClasses[e].itemNode.style.display="none"}else if(BX.util.in_array(t.toUpperCase(),this.metaClasses[e].activateNodes)){this.metaClasses[e].itemNode.style.display=""}}}};h.prototype.Create=function(){if(!this.pCont){this.pCont=BX.create("SPAN",{props:{className:this.className,title:this.title},attrs:{unselectable:"on"},text:""});if(this.width)this.pCont.style.width=this.width+"px";BX.bind(this.pCont,"click",BX.proxy(this.OnClick,this))}if(!this.pValuesCont){this.pValuesCont=BX.create("DIV",{props:{className:"bxhtmled-popup bxhtmled-dropdown-list-cont"},html:'<div class="bxhtmled-popup-corner"></div>'});this.pValuesContWrap=this.pValuesCont.appendChild(BX.create("DIV",{props:{className:"bxhtmled-dd-list-wrap"}}))}else{BX.cleanNode(this.pValuesContWrap)}this.valueIndex={};this.itemIndex={};if(this.zIndex){this.pValuesCont.style.zIndex=this.zIndex}var t,e;for(e=0;e<this.arValues.length;e++){t=this.arValues[e];if(t.items&&t.items.length>0){this.CreateSubmenuItem(t,this.pValuesContWrap,e)}else if(!t.items){this.CreateItem(t,this.pValuesContWrap,e)}}if(this.action&&this.checkableAction){this.editor.RegisterCheckableAction(this.action,{action:this.action,control:this})}};h.prototype.CreateItem=function(t,e,i){if(t=="separator"){e.appendChild(BX.create("I",{props:{className:"bxhtmled-dd-list-sep"}}))}else{if(t.tagName){t.tagName=t.tagName.toUpperCase();if(!t.id)t.id=t.tagName}var s=this,a=this.itemClassName+(t.className?" "+t.className:"");if(!t.html){t.html=t.tagName?"<"+t.tagName+">"+t.name+"</"+t.tagName+">":t.name}var l=e.appendChild(BX.create("SPAN",{props:{title:t.title||t.name,className:a},html:t.html,style:t.style}));l.setAttribute("data-bx-dropdown-value",t.id);this.valueIndex[t.id]=i;this.itemIndex[t.id]=t;if(t.defaultValue){this.SelectItem(null,t)}BX.bind(l,"mousedown",(function(e){s.SelectItem(this.getAttribute("data-bx-dropdown-value"));if(t.action&&s.editor.action.IsSupported(t.action)){s.editor.action.Exec(t.action,t.value||false)}}));this.arValues[i].listCont=l}};h.prototype.CreateSubmenuItem=function(t,e,i){var s=this,a=this.itemClassName+" "+this.itemClassNameGroup+(t.className?" "+t.className:""),l=e.appendChild(BX.create("SPAN",{props:{title:t.title||t.name,className:a},html:t.name+'<i class="bxed-arrow"></i>',style:t.style||""}));l.setAttribute("data-bx-dropdown-value",t.id);this.valueIndex[t.id]=i;this.itemIndex[t.id]=t;this.arValues[i].listCont=l;var o,n=false;var h=this.valueIndex[t.id];var r,d;for(r=0;r<t.items.length;r++){if(t.items[r].tagName){t.items[r].tagName=t.items[r].tagName.toUpperCase();if(!t.items[r].id)t.items[r].id=t.items[r].tagName}d=h+"_"+r;if(!this.arValues[d])this.arValues[d]=t.items[r];this.valueIndex[t.items[r].id]=d;t.items[r].listSubmenuCont=l}BX.bind(l,"mouseover",(function(e){n=true;if(o)clearTimeout(o);o=setTimeout((function(){if(n){s.OpenSubmenu(t)}}),s.OPEN_DELAY)}));BX.bind(l,"mouseout",(function(t){n=false;if(o)o=clearTimeout(o)}));if(this.metaClasses&&this.metaClasses[t.id]){this.metaClasses[t.id].itemNode=l}};h.prototype.OpenSubmenu=function(t){if(t.id=="list")BX.loadCSS(["/bitrix/css/main/font-awesome.css"]);if(!this.pSubmenuCont){this.pSubmenuCont=BX.create("DIV",{props:{className:"bxhtmled-popup bxhtmled-popup-left bxhtmled-dropdown-list-cont bxhtmled-dropdown-list-cont-submenu"},html:'<div class="bxhtmled-popup-corner"></div>'});this.pSubmenuContWrap=this.pSubmenuCont.appendChild(BX.create("DIV",{props:{className:"bxhtmled-dd-list-wrap"}}));BX.ZIndexManager.getStack(document.body).register(this.pSubmenuCont)}else{BX.cleanNode(this.pSubmenuContWrap)}document.body.appendChild(this.pSubmenuCont);this.pSubmenuCont.style.display="block";BX.ZIndexManager.bringToFront(this.pSubmenuCont);if(this.curSubmenuItem){BX.removeClass(this.curSubmenuItem,"bxhtmled-dd-list-item-selected")}this.curSubmenuItem=t.listCont;BX.addClass(this.curSubmenuItem,"bxhtmled-dd-list-item-selected");var e=this,i=BX.pos(this.curSubmenuItem),s=i.right+17,a=i.top-9;this.pSubmenuCont.style.top=a+"px";this.pSubmenuCont.style.left=s+"px";var l=this.valueIndex[t.id];var o,n;for(o=0;o<t.items.length;o++){n=l+"_"+o;if(!this.arValues[n])this.arValues[n]=t.items[o];this.CreateItem(t.items[o],this.pSubmenuContWrap,n)}BX.onCustomEvent(this.curSubmenuItem,"OnStyleListSubmenuOpened",[])};h.prototype.CloseSubmenu=function(){if(this.pSubmenuCont&&this.pSubmenuContWrap){BX.cleanNode(this.pSubmenuContWrap);this.pSubmenuCont.style.display="none"}if(this.curSubmenuItem){BX.removeClass(this.curSubmenuItem,"bxhtmled-dd-list-item-selected")}};h.prototype.SelectItem=function(t,e,i){var s=this;i=i!==false;if(!e){e=this.arValues[this.valueIndex[t]];if(!e&&this.valueIndex[t.toUpperCase()]){e=this.arValues[this.valueIndex[t.toUpperCase()]]}if(!e&&this.valueIndex[t.toLowerCase()]){e=this.arValues[this.valueIndex[t.toLowerCase()]]}}if(this.lastActiveSubmenuItem)BX.removeClass(this.lastActiveSubmenuItem,this.activeListClassName);if(this.lastActiveItem)BX.removeClass(this.lastActiveItem,this.activeListClassName);if(e){this.pCont.innerHTML=BX.util.htmlspecialchars(e.topName||e.name||e.id);this.pCont.title=this.title+": "+(e.title||e.name);if(e.listSubmenuCont&&BX.isNodeInDom(e.listSubmenuCont)){this.lastActiveSubmenuItem=e.listSubmenuCont;BX.addClass(e.listSubmenuCont,this.activeListClassName)}if(e.listCont&&BX.isNodeInDom(e.listCont)){this.lastActiveItem=e.listCont;BX.addClass(e.listCont,this.activeListClassName)}else{function a(){if(e.listCont&&BX.isNodeInDom(e.listCont)){if(s.lastActiveItem)BX.removeClass(s.lastActiveItem,s.activeListClassName);s.lastActiveItem=e.listCont;BX.addClass(e.listCont,s.activeListClassName)}BX.removeCustomEvent(e.listSubmenuCont,"OnStyleListSubmenuOpened",a)}if(e.listSubmenuCont){BX.addCustomEvent(e.listSubmenuCont,"OnStyleListSubmenuOpened",a)}}}if(this.bOpened&&i){this.Close()}};h.prototype.Open=function(){h.superclass.Open.apply(this,arguments)};h.prototype.Close=function(){this.CloseSubmenu();h.superclass.Close.apply(this,arguments)};function r(t,e){r.superclass.constructor.apply(this,arguments);this.id="font_selector";this.title=BX.message("FontSelectorTitle");this.action="fontFamily";this.zIndex=3008;var i=this.editor.GetFontFamilyList();this.disabledForTextarea=!t.bbCode;this.arValues=[{id:"",name:BX.message("NoFontTitle"),topName:BX.message("FontSelectorTitle"),title:BX.message("NoFontTitle"),className:"",style:"",action:"fontFamily",value:"",defaultValue:true}];var s,a,l,o;for(s in i){if(i.hasOwnProperty(s)){l=i[s].value;if(typeof l!="object")l=[l];a=i[s].name;o=i[s].arStyle||{fontFamily:l.join(",")};this.arValues.push({id:a,name:a,title:a,className:i[s].className||"",style:i[s].arStyle||{fontFamily:l.join(",")},action:"fontFamily",value:l.join(",")})}}this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(r,window.BXHtmlEditor.DropDownList);r.prototype.SetValue=function(t,e){if(t){var i,s,a,l,o=this.arValues.length,n=e[0],h=BX.util.trim(BX.style(n,"fontFamily"));if(h!==""&&BX.type.isString(h)){a=h.split(",");for(i in a){l=false;if(a.hasOwnProperty(i)){for(s=0;s<o;s++){a[i]=a[i].replace(/'|"/gi,"");if(this.arValues[s].value.indexOf(a[i])!==-1){l=this.arValues[s].id;break}}if(l!==false){break}}}this.SelectItem(l,false,false)}else{this.SelectItem("",false,false)}}else{this.SelectItem("",false,false)}};function d(t,e){d.superclass.constructor.apply(this,arguments);this.id="font_size";this.title=BX.message("FontSizeTitle");this.className+=" bxhtmled-button-fontsize";this.activeClassName="bxhtmled-top-bar-btn-active bxhtmled-button-fontsize-active";this.disabledClassName="bxhtmled-top-bar-btn-disabled bxhtmled-button-fontsize-disabled";this.action="fontSize";this.zIndex=3007;this.disabledForTextarea=!t.bbCode;var i=[6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,36,48,72];this.arValues=[{id:"font-size-0",className:"bxhtmled-top-bar-btn bxhtmled-button-remove-fontsize",action:this.action,value:"<i></i>"}];var s,a;for(s in i){if(i.hasOwnProperty(s)){a=i[s];this.arValues.push({id:"font-size-"+a,action:this.action,value:a})}}this.Create();if(e)e.appendChild(this.pCont_);BX.addCustomEvent(this,"OnPopupClose",BX.proxy(this.OnPopupClose,this))}BX.extend(d,window.BXHtmlEditor.DropDown);d.prototype.Create=function(){this.pCont_=BX.create("SPAN",{props:{className:"bxhtmled-button-fontsize-wrap",title:this.title}});this.pCont=this.pButCont=this.pCont_.appendChild(BX.create("SPAN",{props:{className:this.className},html:"<i></i>"}));this.pListCont=this.pCont_.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-top-bar-select",title:this.title},attrs:{unselectable:"on"},text:"",style:{display:"none"}}));this.pValuesCont=BX.create("DIV",{props:{className:"bxhtmled-popup bxhtmled-dropdown-cont"},html:'<div class="bxhtmled-popup-corner"></div>'});this.pValuesCont.style.zIndex=this.zIndex;this.pValuesContWrap=this.pValuesCont.appendChild(BX.create("DIV",{props:{className:"bxhtmled-dropdown-cont bxhtmled-font-size-popup"}}));this.valueIndex={};var t,e,i=this,s,a="bxhtmled-dd-list-item";for(s=0;s<this.arValues.length;s++){e=this.arValues[s];t=this.pValuesContWrap.appendChild(BX.create("SPAN",{props:{className:e.className||a},html:e.value,style:e.style||{}}));t.setAttribute("data-bx-dropdown-value",e.id);this.valueIndex[e.id]=s;if(e.action){t.setAttribute("data-bx-type","action");t.setAttribute("data-bx-action",e.action);if(e.value)t.setAttribute("data-bx-value",e.value)}BX.bind(t,"mousedown",(function(t){i.SelectItem(this.getAttribute("data-bx-dropdown-value"));i.editor.CheckCommand(this);i.Close()}))}this.editor.RegisterCheckableAction(this.action,{action:this.action,control:this});BX.bind(this.pCont_,"click",BX.proxy(this.OnClick,this));BX.bind(this.pCont,"mousedown",BX.delegate(this.OnMouseDown,this))};d.prototype.SetValue=function(t,e){if(e&&e[0]){var i=e[0];var s=i.style.fontSize;this.SelectItem(false,{value:parseInt(s,10),title:s})}else{this.SelectItem(false,{value:0})}};d.prototype.SelectItem=function(t,e){if(!e)e=this.arValues[this.valueIndex[t]];if(e.value){this.pListCont.innerHTML=e.value;this.pListCont.title=this.title+": "+(e.title||e.value);this.pListCont.style.display="";this.pButCont.style.display="none"}else{this.pListCont.title=this.title;this.pButCont.style.display="";this.pListCont.style.display="none"}};d.prototype.GetPopupBindCont=function(){return this.pCont_};d.prototype.Open=function(){d.superclass.Open.apply(this,arguments);this.pValuesContWrap.firstChild.style.display=this.editor.bbCode&&this.editor.synchro.IsFocusedOnTextarea()?"none":"";BX.addClass(this.pListCont,"bxhtmled-top-bar-btn-active")};d.prototype.Close=function(){d.superclass.Close.apply(this,arguments);BX.removeClass(this.pListCont,"bxhtmled-top-bar-btn-active")};d.prototype.OnPopupClose=function(){var t=this.editor.toolbar.controls.More;setTimeout((function(){if(t&&t.bOpened){t.CheckOverlay()}}),100)};function p(t,e){p.superclass.constructor.apply(this,arguments);this.id="bold";this.title=BX.message("Bold");this.className+=" bxhtmled-button-bold";this.action="bold";this.disabledForTextarea=!t.bbCode;this.Create();if(e)e.appendChild(this.GetCont())}BX.extend(p,t);function c(t,e){c.superclass.constructor.apply(this,arguments);this.id="italic";this.title=BX.message("Italic");this.className+=" bxhtmled-button-italic";this.action="italic";this.disabledForTextarea=!t.bbCode;this.Create();if(e)e.appendChild(this.GetCont())}BX.extend(c,t);function u(t,e){u.superclass.constructor.apply(this,arguments);this.id="underline";this.title=BX.message("Underline");this.className+=" bxhtmled-button-underline";this.action="underline";this.disabledForTextarea=!t.bbCode;this.Create();if(e)e.appendChild(this.GetCont())}BX.extend(u,t);function m(t,e){m.superclass.constructor.apply(this,arguments);this.id="strike";this.title=BX.message("Strike");this.className+=" bxhtmled-button-strike";this.action="strikeout";this.disabledForTextarea=!t.bbCode;this.Create();if(e)e.appendChild(this.GetCont())}BX.extend(m,t);function f(t,e){f.superclass.constructor.apply(this,arguments);this.id="remove_format";this.title=BX.message("RemoveFormat");this.className+=" bxhtmled-button-remove-format";this.action="removeFormat";this.checkableAction=false;this.Create();if(e)e.appendChild(this.GetCont())}BX.extend(f,t);function C(t,e){C.superclass.constructor.apply(this,arguments);this.id="template_selector";this.title=BX.message("TemplateSelectorTitle");this.className+=" ";this.width=85;this.zIndex=3007;this.arValues=[];var i=this.editor.GetTemplateId(),s=this.editor.config.templates,a,l;for(a in s){if(s.hasOwnProperty(a)){l=s[a];this.arValues.push({id:l.value,name:l.name,title:l.name,className:"bxhtmled-button-viewmode-wysiwyg",action:"changeTemplate",value:l.value,defaultValue:l.value==i})}}this.Create();if(e)e.appendChild(this.GetCont());this.SelectItem(i)}BX.extend(C,window.BXHtmlEditor.DropDownList);function b(t,e){b.superclass.constructor.apply(this,arguments);this.id="ordered-list";this.title=BX.message("OrderedList");this.className+=" bxhtmled-button-ordered-list";this.action="insertOrderedList";this.disabledForTextarea=!t.bbCode;this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(b,t);b.prototype.OnClick=function(){if(!this.disabled){if(!this.editor.bbCode||!this.editor.synchro.IsFocusedOnTextarea()){b.superclass.OnClick.apply(this,arguments)}else{this.editor.GetDialog("InsertList").Show({type:"ol"})}}};function g(t,e){g.superclass.constructor.apply(this,arguments);this.id="unordered-list";this.title=BX.message("UnorderedList");this.className+=" bxhtmled-button-unordered-list";this.action="insertUnorderedList";this.disabledForTextarea=!t.bbCode;this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(g,t);g.prototype.OnClick=function(){if(!this.disabled){if(!this.editor.bbCode||!this.editor.synchro.IsFocusedOnTextarea()){b.superclass.OnClick.apply(this,arguments)}else{this.editor.GetDialog("InsertList").Show({type:"ul"})}}};function B(t,e){B.superclass.constructor.apply(this,arguments);this.id="indent";this.title=BX.message("Indent");this.className+=" bxhtmled-button-indent";this.action="indent";this.checkableAction=false;this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(B,t);function X(t,e){X.superclass.constructor.apply(this,arguments);this.id="outdent";this.title=BX.message("Outdent");this.className+=" bxhtmled-button-outdent";this.action="outdent";this.checkableAction=false;this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(X,t);function x(t,e){x.superclass.constructor.apply(this,arguments);this.id="align-list";this.title=BX.message("BXEdTextAlign");this.posOffset.left=0;this.action="align";var i=this.className;this.className+=" bxhtmled-button-align-left";this.disabledForTextarea=!t.bbCode;this.arValues=[{id:"align_left",title:BX.message("AlignLeft"),className:i+" bxhtmled-button-align-left",action:"align",value:"left"},{id:"align_center",title:BX.message("AlignCenter"),className:i+" bxhtmled-button-align-center",action:"align",value:"center"},{id:"align_right",title:BX.message("AlignRight"),className:i+" bxhtmled-button-align-right",action:"align",value:"right"},{id:"align_justify",title:BX.message("AlignJustify"),className:i+" bxhtmled-button-align-justify",action:"align",value:"justify"}];this.Create();if(e)e.appendChild(this.GetCont())}BX.extend(x,window.BXHtmlEditor.DropDown);x.prototype.SetValue=function(t,e){if(this.disabled){this.SelectItem(null)}else{if(e&&e.value){this.SelectItem("align_"+e.value)}else{this.SelectItem(null)}}};function y(t,e){y.superclass.constructor.apply(this,arguments);this.id="insert-link";this.title=BX.message("InsertLink");this.className+=" bxhtmled-button-link";this.posOffset={top:6,left:0};this.disabledForTextarea=!t.bbCode;this.arValues=[{id:"edit_link",title:BX.message("EditLink"),className:this.className+" bxhtmled-button-link"},{id:"remove_link",title:BX.message("RemoveLink"),className:this.className+" bxhtmled-button-remove-link",action:"removeLink"}];this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(y,window.BXHtmlEditor.DropDown);y.prototype.OnClick=function(){if(this.disabled)return;if(!this.editor.bbCode||!this.editor.synchro.IsFocusedOnTextarea()){var t,e,i,s=0,a=this.editor.action.CheckState("formatInline",{},"a");if(a){for(t=0;t<a.length;t++){e=a[t];if(e){i=e;s++}if(s>1){break}}}if(s===1&&i){if(this.bOpened){this.Close()}else{this.Open()}}else{this.editor.GetDialog("Link").Show(a,this.savedRange)}}else{this.editor.GetDialog("Link").Show(false,false)}};y.prototype.SelectItem=function(t){if(t=="edit_link"){this.editor.GetDialog("Link").Show(false,this.savedRange)}};function v(t,e){v.superclass.constructor.apply(this,arguments);this.id="image";this.title=BX.message("InsertImage");this.className+=" bxhtmled-button-image";this.disabledForTextarea=!t.bbCode;this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(v,t);v.prototype.OnClick=function(){if(!this.disabled){this.editor.GetDialog("Image").Show(false,this.savedRange)}};function S(t,e){S.superclass.constructor.apply(this,arguments);this.id="video";this.title=BX.message("BXEdInsertVideo");this.className+=" bxhtmled-button-video";this.disabledForTextarea=!t.bbCode;this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(S,t);S.prototype.OnClick=function(){if(!this.disabled){this.editor.GetDialog("Video").Show(false,this.savedRange)}};function w(t,e){w.superclass.constructor.apply(this,arguments);this.id="insert-anchor";this.title=BX.message("BXEdAnchor");this.className+=" bxhtmled-button-anchor";this.action="insertAnchor";this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(w,t);w.prototype.OnClick=function(t){var e=this;if(this.disabled)return;if(!this.pPopup){this.pPopup=new BX.PopupWindow(this.id+"-popup",this.GetCont(),{zIndex:3005,lightShadow:true,offsetTop:4,overlay:{opacity:1},offsetLeft:-128,autoHide:true,closeByEsc:true,className:"bxhtmled-popup",content:""});this.pPopupCont=BX(this.id+"-popup");this.pPopupCont.className="bxhtmled-popup";this.pPopupCont.innerHTML='<div class="bxhtmled-popup-corner"></div>';this.pPopupContWrap=this.pPopupCont.appendChild(BX.create("DIV"));this.pPopupContInput=this.pPopupContWrap.appendChild(BX.create("INPUT",{props:{type:"text",placeholder:BX.message("BXEdAnchorName")+"...",title:BX.message("BXEdAnchorInsertTitle")},style:{width:"150px"}}));this.pPopupContBut=this.pPopupContWrap.appendChild(BX.create("INPUT",{props:{type:"button",value:BX.message("BXEdInsert")},style:{marginLeft:"6px"}}));BX.bind(this.pPopupContInput,"keyup",BX.proxy(this.OnKeyUp,this));BX.bind(this.pPopupContBut,"click",BX.proxy(this.Save,this));BX.addCustomEvent(this.pPopup,"onPopupClose",(function(){e.pPopup.destroy();e.pPopup=null}))}this.pPopupContInput.value="";this.pPopup.show();BX.focus(this.pPopupContInput)};w.prototype.Save=function(){var t=BX.util.trim(this.pPopupContInput.value);if(t!==""){t=t.replace(/[^ a-z0-9_\-]/gi,"");if(this.savedRange){this.editor.selection.SetBookmark(this.savedRange)}var e=this.editor.phpParser.GetSurrogateNode("anchor",BX.message("BXEdAnchor")+": #"+t,null,{html:"",name:t});this.editor.selection.InsertNode(e);var i=this.editor.util.CheckSurrogateNode(e.parentNode);if(i){this.editor.util.InsertAfter(e,i)}this.editor.selection.SetInvisibleTextAfterNode(e);this.editor.synchro.StartSync(100);if(this.editor.toolbar.controls.More){this.editor.toolbar.controls.More.Close()}}this.pPopup.close()};w.prototype.OnKeyUp=function(t){if(t.keyCode===this.editor.KEY_CODES["enter"]){this.Save()}};function N(t,e){N.superclass.constructor.apply(this,arguments);this.id="insert-table";this.title=BX.message("BXEdTable");this.className+=" bxhtmled-button-table";this.itemClassName="bxhtmled-dd-list-item";this.action="insertTable";this.disabledForTextarea=!t.bbCode;this.PATTERN_ROWS=10;this.PATTERN_COLS=10;this.zIndex=3007;this.posOffset={top:6,left:0};this.Create();if(e){e.appendChild(this.GetCont())}BX.addCustomEvent(this,"OnPopupClose",BX.proxy(this.OnPopupClose,this))}BX.extend(N,window.BXHtmlEditor.DropDown);N.prototype.Create=function(){this.pCont=BX.create("SPAN",{props:{className:this.className,title:this.title},html:"<i></i>"});this.pValuesCont=BX.create("DIV",{props:{className:"bxhtmled-popup bxhtmled-dropdown-cont"},html:'<div class="bxhtmled-popup-corner"></div>'});this.pValuesCont.style.zIndex=this.zIndex;this.valueIndex={};this.pPatternWrap=this.pValuesCont.appendChild(BX.create("DIV"));this.pValuesContWrap=this.pValuesCont.appendChild(BX.create("DIV"));var t=this,e,i,s,a,l=false,o=this.PATTERN_ROWS*this.PATTERN_COLS,n;this.pPatternTbl=this.pPatternWrap.appendChild(BX.create("TABLE",{props:{className:"bxhtmled-pattern-tbl"}}));function h(e,i){var s,a,l;for(s=0;s<t.PATTERN_ROWS;s++){for(a=0;a<t.PATTERN_COLS;a++){l=t.pPatternTbl.rows[s].cells[a];l.className=s<=e&&a<=i?"bxhtmled-td-selected":""}}}BX.bind(this.pPatternTbl,"mousemove",(function(t){var e=t.target||t.srcElement;if(a!==e){a=e;if(e.nodeName=="TD"){l=true;h(e.parentNode.rowIndex,e.cellIndex)}else if(e.nodeName=="TABLE"){l=false;h(-1,-1)}}}));BX.bind(this.pPatternWrap,"mouseout",(function(t){l=false;setTimeout((function(){if(!l){h(-1,-1)}}),300)}));BX.bind(this.pPatternTbl,"click",(function(e){var i=e.target||e.srcElement;if(i.nodeName=="TD"){if(t.editor.action.IsSupported(t.action)){if(t.savedRange){t.editor.selection.SetBookmark(t.savedRange)}t.editor.action.Exec(t.action,{rows:i.parentNode.rowIndex+1,cols:i.cellIndex+1,border:1,cellPadding:1,cellSpacing:1})}if(t.editor.toolbar.controls.More){t.editor.toolbar.controls.More.Close()}t.Close()}}));for(e=0;e<o;e++){if(e%this.PATTERN_COLS==0){i=this.pPatternTbl.insertRow(-1)}s=i.insertCell(-1);s.innerHTML=" ";s.title=s.cellIndex+1+"x"+(i.rowIndex+1)}n=this.pValuesContWrap.appendChild(BX.create("SPAN",{props:{title:BX.message("BXEdInsertTableTitle"),className:this.itemClassName},html:BX.message("BXEdInsertTable")}));BX.bind(n,"mousedown",(function(e){t.editor.GetDialog("Table").Show(false,t.savedRange);if(t.editor.toolbar.controls.More){t.editor.toolbar.controls.More.Close()}t.Close()}));BX.bind(this.pCont,"click",BX.proxy(this.OnClick,this));BX.bind(this.pCont,"mousedown",BX.delegate(this.OnMouseDown,this))};N.prototype.OnPopupClose=function(){var t=this.editor.toolbar.controls.More;setTimeout((function(){if(t&&t.bOpened){t.CheckOverlay()}}),100)};function I(t,e){I.superclass.constructor.apply(this,arguments);this.id="specialchar";this.title=BX.message("BXEdSpecialchar");this.className+=" bxhtmled-button-specialchar";this.itemClassName="bxhtmled-dd-list-item";this.CELLS_COUNT=10;this.posOffset={top:6,left:0};this.zIndex=3007;this.Create();if(e){e.appendChild(this.GetCont())}BX.addCustomEvent(this,"OnPopupClose",BX.proxy(this.OnPopupClose,this))}BX.extend(I,window.BXHtmlEditor.DropDown);I.prototype.Create=function(){this.pCont=BX.create("SPAN",{props:{className:this.className,title:this.title},html:"<i></i>"});this.pValuesCont=BX.create("DIV",{props:{className:"bxhtmled-popup bxhtmled-dropdown-cont"},html:'<div class="bxhtmled-popup-corner"></div>'});this.pValuesCont.style.zIndex=this.zIndex;this.valueIndex={};this.pPatternWrap=this.pValuesCont.appendChild(BX.create("DIV"));this.pValuesContWrap=this.pValuesCont.appendChild(BX.create("DIV"));var t=this.editor.GetLastSpecialchars(),e=this,i,s,a,l=t.length,o;this.pLastChars=this.pPatternWrap.appendChild(BX.create("TABLE",{props:{className:"bxhtmled-last-chars"}}));for(i=0;i<l;i++){if(i%this.CELLS_COUNT==0){s=this.pLastChars.insertRow(-1)}a=s.insertCell(-1)}BX.bind(this.pLastChars,"click",(function(t){var i,s=t.target||t.srcElement;if(s.nodeType==3){s=s.parentNode}if(s&&s.getAttribute&&s.getAttribute("data-bx-specialchar")&&e.editor.action.IsSupported("insertHTML")){if(e.savedRange){e.editor.selection.SetBookmark(e.savedRange)}i=s.getAttribute("data-bx-specialchar");e.editor.On("OnSpecialcharInserted",[i]);e.editor.action.Exec("insertHTML",i)}if(e.editor.toolbar.controls.More){e.editor.toolbar.controls.More.Close()}e.Close()}));o=this.pValuesContWrap.appendChild(BX.create("SPAN",{props:{title:BX.message("BXEdSpecialcharMoreTitle"),className:this.itemClassName},html:BX.message("BXEdSpecialcharMore")}));BX.bind(o,"mousedown",(function(){e.editor.GetDialog("Specialchar").Show(e.savedRange);if(e.editor.toolbar.controls.More){e.editor.toolbar.controls.More.Close()}e.Close()}));BX.bind(this.pCont,"click",BX.proxy(this.OnClick,this));BX.bind(this.pCont,"mousedown",BX.delegate(this.OnMouseDown,this))};I.prototype.OnClick=function(){if(this.disabled)return;var t=this.editor.GetLastSpecialchars(),e,i=-1,s=-1,a,l=t.length;for(e=0;e<l;e++){if(e%this.CELLS_COUNT==0){i++;s=-1}s++;a=this.pLastChars.rows[i].cells[s];if(a){a.innerHTML=t[e];a.setAttribute("data-bx-specialchar",t[e]);a.title=BX.message("BXEdSpecialchar")+": "+t[e].substr(1,t[e].length-2)}}I.superclass.OnClick.apply(this,arguments)};I.prototype.OnPopupClose=function(){var t=this.editor.toolbar.controls.More;setTimeout((function(){if(t&&t.bOpened){t.CheckOverlay()}}),100)};function T(t,e){T.superclass.constructor.apply(this,arguments);this.id="print_break";this.title=BX.message("BXEdPrintBreak");this.className+=" bxhtmled-button-print-break";this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(T,t);T.prototype.OnClick=function(){if(this.disabled)return;if(this.editor.action.IsSupported("insertHTML")){if(this.savedRange){this.editor.selection.SetBookmark(this.savedRange)}var t=this.editor.GetIframeDoc(),e=this.editor.SetBxTag(false,{tag:"printbreak",params:{innerHTML:'<span style="display: none"> </span>'},name:BX.message("BXEdPrintBreakName"),title:BX.message("BXEdPrintBreakTitle")}),i=BX.create("IMG",{props:{src:this.editor.EMPTY_IMAGE_SRC,id:e,className:"bxhtmled-printbreak",title:BX.message("BXEdPrintBreakTitle")}},t);this.editor.selection.InsertNode(i);var s=this.editor.util.CheckSurrogateNode(i.parentNode);if(s){this.editor.util.InsertAfter(i,s)}this.editor.selection.SetAfter(i);this.editor.Focus();this.editor.synchro.StartSync(100)}if(this.editor.toolbar.controls.More){this.editor.toolbar.controls.More.Close()}};function E(t,e){E.superclass.constructor.apply(this,arguments);this.id="page_break";this.title=BX.message("BXEdPageBreak");this.className+=" bxhtmled-button-page-break";this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(E,t);E.prototype.OnClick=function(){if(this.savedRange)this.editor.selection.SetBookmark(this.savedRange);var t=this.editor.phpParser.GetSurrogateNode("pagebreak",BX.message("BXEdPageBreakSur"),BX.message("BXEdPageBreakSurTitle"));this.editor.selection.InsertNode(t);var e=this.editor.util.CheckSurrogateNode(t.parentNode);if(e){this.editor.util.InsertAfter(t,e)}this.editor.selection.SelectNode(t);this.NormilizeBreakElement(t);this.editor.selection.SetInvisibleTextAfterNode(t);this.editor.synchro.StartSync(100);if(this.editor.toolbar.controls.More){this.editor.toolbar.controls.More.Close()}};E.prototype.NormilizeBreakElement=function(t){if(t.parentNode&&t.parentNode.nodeName!=="BODY"){var e=this.editor.util.GetNextNotEmptySibling(t),i=this.editor.util.GetPreviousNotEmptySibling(t);if(!e||!i){if(!e)this.editor.util.InsertAfter(t,t.parentNode);if(!i)t.parentNode.parentNode.insertBefore(t,t.parentNode);return this.NormilizeBreakElement(t)}}};function A(t,e){A.superclass.constructor.apply(this,arguments);this.id="hr";this.title=BX.message("BXEdInsertHr");this.className+=" bxhtmled-button-hr";this.action="insertHr";this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(A,t);function k(t,e){k.superclass.constructor.apply(this,arguments);this.id="spellcheck";this.title=BX.message("BXEdSpellcheck");this.className+=" bxhtmled-button-spell";this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(k,t);k.prototype.OnClick=function(){if(this.disabled)return;if(this.editor.config.usePspell!=="Y"){alert(BX.message("BXEdNoPspellWarning"))}else{var t=this;if(!window.BXHtmlEditor.Spellchecker)return BX.loadScript(this.editor.config.spellcheck_path,BX.proxy(this.OnClick,this));if(!this.editor.Spellchecker){this.editor.Spellchecker=new window.BXHtmlEditor.Spellchecker(this.editor)}this.editor.GetDialog("Spell").Show(this.savedRange);this.editor.Spellchecker.CheckDocument()}};function P(t,e){P.superclass.constructor.apply(this,arguments);this.id="settings";this.title=BX.message("BXEdSettings");this.className+=" bxhtmled-button-settings";this.disabledForTextarea=false;this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(P,t);P.prototype.OnClick=function(){this.editor.GetDialog("Settings").Show()};function L(t,e){L.superclass.constructor.apply(this,arguments);this.id="sub";this.title=BX.message("BXEdSub");this.className+=" bxhtmled-button-sub";this.action="sub";this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(L,t);function O(t,e){O.superclass.constructor.apply(this,arguments);this.id="sup";this.title=BX.message("BXEdSup");this.className+=" bxhtmled-button-sup";this.action="sup";this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(O,t);function V(t,e){V.superclass.constructor.apply(this,arguments);this.id="fullscreen";this.title=BX.message("BXEdFullscreen");this.className+=" bxhtmled-button-fullscreen";this.action="fullscreen";this.disabledForTextarea=false;this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(V,t);V.prototype.Check=function(t){this.GetCont().title=t?BX.message("BXEdFullscreenBack"):BX.message("BXEdFullscreen");V.superclass.Check.apply(this,arguments)};function H(t,e){H.superclass.constructor.apply(this,arguments);this.id="smile";this.title=BX.message("BXEdSmile");this.className+=" bxhtmled-button-smile";this.checkableAction=false;this.zIndex=3007;this.smileSizeDef=20;this.posOffset={top:6,left:0};this.smiles=t.config.smiles||[];this.smileSets=t.config.smileSets||[];this.disabledForTextarea=!t.bbCode;this.Create();if(e&&this.smiles.length>0){e.appendChild(this.GetCont())}BX.addCustomEvent(this,"OnPopupClose",BX.proxy(this.OnPopupClose,this))}BX.extend(H,window.BXHtmlEditor.DropDown);H.prototype.CheckBeforeShow=function(){return this.editor.config.smiles&&this.editor.config.smiles.length>0};H.prototype.Create=function(){this.pCont=BX.create("SPAN",{props:{className:this.className,title:this.title},html:"<i></i>"});this.pValuesCont=BX.create("DIV",{props:{className:"bxhtmled-popup bxhtmled-dropdown-cont bxhtmled-smile-cont"},html:'<div class="bxhtmled-popup-corner"></div>'});this.pValuesCont.style.zIndex=this.zIndex;this.valueIndex={};var t=this,e,i,s,a=this.smileSets.length,l=Math.round(100/a)+"%",o=100*a+"%";if(a>1){this.smileSetsIndex={};this.smileTabsWrap=this.pValuesCont.appendChild(BX.create("DIV",{props:{className:"bxhtmled-smile-tabs-wrap"}}));this.smileSliderWrap=this.pValuesCont.appendChild(BX.create("DIV",{props:{className:"bxhtmled-smile-slider-wrap"}}));this.smileSlider=this.smileSliderWrap.appendChild(BX.create("DIV",{props:{className:"bxhtmled-smile-slider"},style:{width:o}}));for(e=0;e<this.smileSets.length;e++){if(!this.smileSets[e].ID&&this.smileSets[e].id)this.smileSets[e].ID=this.smileSets[e].id;this.smileSetsIndex[this.smileSets[e].ID]=e;this.smileSets[e].butWrap=this.smileTabsWrap.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-smile-tab"}}));this.smileSets[e].butWrap.setAttribute("data-bx-smile-set",this.smileSets[e].ID);this.smileSets[e].butWrapImage=false;this.smileSets[e].smilesBlock=this.smileSlider.appendChild(BX.create("DIV",{props:{className:"bxhtmled-smiles-wrap"},style:{width:l}}));if(e==0){BX.addClass(this.smileSets[e].butWrap,"bxhtmled-smile-tab-active");this.currentTab=this.smileSets[e].butWrap}}}for(e=0;e<this.smiles.length;e++){i=BX.create("IMG",{props:{className:"bxhtmled-smile-img",src:this.smiles[e].path,title:this.smiles[e].name||this.smiles[e].code}});if(this.smiles[e].width){i.style.width=parseInt(this.smiles[e].width)+"px"}if(this.smiles[e].height){i.style.height=parseInt(this.smiles[e].height)+"px"}BX.bind(i,"error",(function(){BX.remove(this)}));if(this.smiles[e].set_id&&this.smileSetsIndex&&this.smileSetsIndex[this.smiles[e].set_id]!==undefined){s=this.smileSetsIndex[this.smiles[e].set_id];this.smileSets[s].smilesBlock.appendChild(i);if(!this.smileSets[s].butWrapImage){this.smileSets[s].butWrapImage=i.cloneNode();this.smileSets[s].butWrapImage.style.cssText="";this.smileSets[s].butWrapImage.className="";this.smileSets[s].butWrapImage.title="";this.smileSets[s].butWrap.appendChild(this.smileSets[s].butWrapImage);var n=this.smiles[e].height;if(n<this.smileSizeDef){this.smileSets[s].butWrapImage.style.marginTop=Math.round((this.smileSizeDef-n)/2)+"px"}}}else{this.pValuesCont.appendChild(i)}i.setAttribute("data-bx-type","action");i.setAttribute("data-bx-action","insertSmile");i.setAttribute("data-bx-value",this.smiles[e].code)}BX.bind(this.pCont,"click",BX.proxy(this.OnClick,this));BX.bind(this.pCont,"mousedown",BX.delegate(this.OnMouseDown,this));BX.bind(this.pValuesCont,"mousedown",(function(e){var i=e.target||e.srcElement;if(i&&i.getAttribute("data-bx-smile-set")!==null){return t.ShowSetTab(i.getAttribute("data-bx-smile-set"))}else if(i&&i.parentNode&&i.parentNode.getAttribute("data-bx-smile-set")!==null){return t.ShowSetTab(i.parentNode.getAttribute("data-bx-smile-set"))}t.editor.CheckCommand(e.target||e.srcElement);t.Close()}))};H.prototype.ShowSetTab=function(t){if(this.smileSetsIndex[t]!==undefined){var e=this,i=this.smileSets[this.smileSetsIndex[t]],s=parseInt(this.smileSlider.style.marginLeft)||0,a=-parseInt(this.smileSetsIndex[t]*100);if(this.currentTab)BX.removeClass(this.currentTab,"bxhtmled-smile-tab-active");BX.addClass(i.butWrap,"bxhtmled-smile-tab-active");this.currentTab=i.butWrap;this.ani=new BX.easing({duration:300,start:{marginLeft:s},finish:{marginLeft:a},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(t){if(e.smileSlider)e.smileSlider.style.marginLeft=t.marginLeft+"%"},complete:function(){if(e.smileSlider)e.smileSlider.style.marginLeft="-"+a+"%";e.ani=null}});this.ani.animate()}return false};N.prototype.OnPopupClose=function(){var t=this.editor.toolbar.controls.More;setTimeout((function(){if(t&&t.bOpened){t.CheckOverlay()}}),100)};function D(t,e){D.superclass.constructor.apply(this,arguments);this.id="quote";this.title=BX.message("BXEdQuote");this.className+=" bxhtmled-button-quote";this.action="quote";this.disabledForTextarea=!t.bbCode;this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(D,t);D.prototype.OnMouseDown=function(){this.editor.action.actions.quote.setExternalSelection(false);this.editor.action.actions.quote.setRange(false);var t=this.editor.selection.GetRange(this.editor.selection.GetSelection(document));if(!this.editor.synchro.IsFocusedOnTextarea()&&this.editor.iframeView.isFocused){this.savedRange=this.editor.selection.SaveBookmark();this.editor.action.actions.quote.setRange(this.savedRange)}if((this.editor.synchro.IsFocusedOnTextarea()||!this.editor.iframeView.isFocused||this.savedRange.collapsed)&&t&&!t.collapsed){this.editor.action.actions.quote.setExternalSelectionFromRange(t)}D.superclass.OnMouseDown.apply(this,arguments)};function R(t,e){R.superclass.constructor.apply(this,arguments);this.id="code";this.title=BX.message("BXEdCode");this.className+=" bxhtmled-button-code";this.action="code";this.disabledForTextarea=!t.bbCode;this.lastStatus=null;this.allowedControls=["SearchButton","ChangeView","Undo","Redo","RemoveFormat","TemplateSelector","InsertChar","Settings","Fullscreen","Spellcheck","Code","More","BbCode"];this.Create();if(e){e.appendChild(this.GetCont())}}BX.extend(R,t);R.prototype.SetValue=function(t,e,i){if(this.lastStatus!==t){var s=this.editor.toolbar;for(var a in s.controls){if(s.controls.hasOwnProperty(a)&&typeof s.controls[a].Disable=="function"&&!BX.util.in_array(a,this.allowedControls)){s.controls[a].Disable(t)}}}this.lastStatus=t;this.Check(t)};function F(t,e){F.superclass.constructor.apply(this,arguments);this.id="more";this.title=BX.message("BXEdMore");this.className+=" bxhtmled-button-more";this.Create();this.posOffset.left=-8;BX.addClass(this.pValuesContWrap,"bxhtmled-more-cnt");this.disabledForTextarea=false;if(e){e.appendChild(this.GetCont())}var i=this;BX.bind(this.pValuesContWrap,"click",(function(t){var e=t.target||t.srcElement,s=e&&e.getAttribute?e.getAttribute("data-bx-type"):false;i.editor.CheckCommand(e)}))}BX.extend(F,window.BXHtmlEditor.DropDown);F.prototype.Open=function(){this.pValuesCont.style.width="";F.superclass.Open.apply(this,arguments);const t=this.GetPopupBindCont();const e=BX.pos(t);let i=Math.round(e.left-this.pValuesCont.offsetWidth/2+t.offsetWidth/2+this.posOffset.left);const s=i+this.pValuesCont.offsetWidth;if(s>window.innerWidth){i=window.innerWidth-20-this.pValuesCont.offsetWidth}this.pValuesCont.style.width=this.pValuesCont.offsetWidth+"px";this.pValuesCont.style.left=i+"px"};F.prototype.GetPopupCont=function(){return this.pValuesContWrap};F.prototype.CheckClose=function(t){if(!this.bOpened){return BX.unbind(document,"mousedown",BX.proxy(this.CheckClose,this))}var e;if(t.target)e=t.target;else if(t.srcElement)e=t.srcElement;if(e.nodeType==3)e=e.parentNode;var i=BX.ZIndexManager.getComponent(this.pValuesCont);var s=i?i.getZIndex():this.pValuesCont.style.zIndex;if(e.style.zIndex>s){this.CheckOverlay()}else if(!BX.findParent(e,{className:"bxhtmled-popup"})){this.Close()}};F.prototype.CheckOverlay=function(){var t=this;this.editor.overlay.Show({zIndex:this.pValuesCont.style.zIndex-1}).onclick=function(){t.Close()}};function _(t,e){e={id:"bx_image",width:700,resizable:false,className:"bxhtmled-img-dialog"};this.id="image";this.action="insertImage";this.loremIpsum=BX.message("BXEdLoremIpsum")+"\n"+BX.message("BXEdLoremIpsum");_.superclass.constructor.apply(this,[t,e]);this.readyToShow=false;if(!this.editor.fileDialogsLoaded){var i=this;this.editor.LoadFileDialogs((function(){i.SetContent(i.Build());i.readyToShow=true}))}else{this.SetContent(this.Build());this.readyToShow=true}BX.addCustomEvent(this,"OnDialogSave",BX.proxy(this.Save,this))}BX.extend(_,e);_.prototype.Build=function(){function t(t,e,i){var s,a,l;s=t.insertRow(-1);if(i){s.className="bxhtmled-add-row"}a=s.insertCell(-1);a.className="bxhtmled-left-c";if(e&&e.label){a.appendChild(BX.create("LABEL",{props:{className:e.required?"bxhtmled-req":""},text:e.label})).setAttribute("for",e.id)}l=s.insertCell(-1);l.className="bxhtmled-right-c";return{row:s,leftCell:a,rightCell:l}}var e=this,i,s;this.pCont=BX.create("DIV",{props:{className:"bxhtmled-img-dialog-cnt"}});var a=BX.create("TABLE",{props:{className:"bxhtmled-dialog-tbl bxhtmled-img-dialog-tbl"}});i=a.insertRow(-1);i.className="bxhtmled-img-preview-row";s=BX.adjust(i.insertCell(-1),{props:{colSpan:2,className:"bxhtmled-img-prev-c"}});this.pPreview=s.appendChild(BX.create("DIV",{props:{className:"bxhtmled-img-preview"+(this.editor.bbCode?" bxhtmled-img-preview-bb":""),id:this.id+"-preview"},html:this.editor.bbCode?"":this.loremIpsum}));this.pPreviewRow=i;i=t(a,{label:BX.message("BXEdImgSrc")+":",id:this.id+"-src",required:true});this.pSrc=i.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-src",className:"bxhtmled-80-input"}}));this.pSrc.placeholder=BX.message("BXEdImgSrcRequired");BX.bind(this.pSrc,"blur",BX.proxy(this.SrcOnChange,this));BX.bind(this.pSrc,"change",BX.proxy(this.SrcOnChange,this));BX.bind(this.pSrc,"keyup",BX.proxy(this.SrcOnChange,this));this.firstFocus=this.pSrc;if(!this.editor.bbCode){var l=BX("bx-open-file-medialib-but-"+this.editor.id);if(l){i.rightCell.appendChild(l)}else{var o=BX("bx_open_file_medialib_button_"+this.editor.id);if(o){i.rightCell.appendChild(o);BX.bind(o,"click",window["BxOpenFileBrowserImgFile"+this.editor.id])}else{var n=BX("bx_ml_bx_open_file_medialib_button_"+this.editor.id);if(n){i.rightCell.appendChild(n)}}}}else{l=BX("bx-open-file-medialib-but-"+this.editor.id);o=BX("bx_open_file_medialib_button_"+this.editor.id);if(l){l.style.display="none"}if(o){o.style.display="none"}}i=t(a,{label:BX.message("BXEdImgSize")+":",id:this.id+"-size"});i.rightCell.appendChild(this.GetSizeControl());BX.addClass(i.leftCell,"bxhtmled-left-c-top");i.leftCell.style.paddingTop="12px";this.pSizeRow=i.row;if(!this.editor.bbCode){i=t(a,{label:BX.message("BXEdImgTitle")+":",id:this.id+"-title"});this.pTitle=i.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-title",className:"bxhtmled-90-input"}}))}i=a.insertRow(-1);var h=i.insertCell(-1);BX.adjust(h,{props:{className:"bxhtmled-title-cell bxhtmled-title-cell-foldable",colSpan:2},text:BX.message("BXEdLinkAdditionalTitle")});h.onclick=function(){e.ShowRows(["align","style","alt","link"],true,!e.bAdditional);e.bAdditional=!e.bAdditional};if(!this.editor.bbCode){i=t(a,{label:BX.message("BXEdImgAlign")+":",id:this.id+"-align"});this.pAlign=i.rightCell.appendChild(BX.create("SELECT",{props:{id:this.id+"-align"}}));this.pAlign.options.add(new Option(BX.message("BXEdImgAlignNone"),"",true,true));this.pAlign.options.add(new Option(BX.message("BXEdImgAlignTop"),"top",true,true));this.pAlign.options.add(new Option(BX.message("BXEdImgAlignLeft"),"left",true,true));this.pAlign.options.add(new Option(BX.message("BXEdImgAlignRight"),"right",true,true));this.pAlign.options.add(new Option(BX.message("BXEdImgAlignBottom"),"bottom",true,true));this.pAlign.options.add(new Option(BX.message("BXEdImgAlignMiddle"),"middle",true,true));BX.bind(this.pAlign,"change",BX.delegate(this.ShowPreview,this));this.pAlignRow=i.row}if(!this.editor.bbCode){i=t(a,{label:BX.message("BXEdImgAlt")+":",id:this.id+"-alt"});this.pAlt=i.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-alt",className:"bxhtmled-90-input"}}));this.pAltRow=i.row}if(!this.editor.bbCode){i=t(a,{label:BX.message("BXEdCssClass")+":",id:this.id+"-style"},true);this.pClass=i.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-style"}}));this.pStyleRow=i.row}i=t(a,{label:BX.message("BXEdImgLinkOnImage")+":",id:this.id+"-link"});this.pLink=i.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-link",className:"bxhtmled-80-input"}}));this.pEditLinkBut=i.rightCell.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-top-bar-btn bxhtmled-button-link",title:BX.message("EditLink")},html:"<i></i>"}));BX.bind(this.pEditLinkBut,"click",(function(){if(BX.util.trim(e.pSrc.value)==""){BX.focus(e.pSrc)}else{var t=e.pLink.value;e.pLink.value="bx-temp-link-href";e.Save();e.oDialog.Close();var i,s,a=e.editor.GetIframeDoc().getElementsByTagName("A");for(i=0;i<a.length;i++){var l=a[i].getAttribute("href");if(l=="bx-temp-link-href"){s=a[i];s.setAttribute("href",t);e.editor.selection.SelectNode(s);e.editor.GetDialog("Link").Show([s]);break}}}}));this.pCont.appendChild(a);this.pLinkRow=i.row;if(!this.editor.bbCode){window["OnFileDialogImgSelect"+this.editor.id]=function(t,i,s){var a;if(typeof t=="object"){a=t.src;if(e.pTitle)e.pTitle.value=t.description||t.name;if(e.pAlt)e.pAlt.value=t.description||t.name}else{a=(i=="/"?"":i)+"/"+t}e.pSrc.value=a;BX.focus(e.pSrc);e.pSrc.select();e.SrcOnChange()}}this.rows={preview:{cont:this.pPreviewRow,height:200},size:{cont:this.pSizeRow,height:68},align:{cont:this.pAlignRow,height:36},style:{cont:this.pStyleRow,height:36},alt:{cont:this.pAltRow,height:36},link:{cont:this.pLinkRow,height:36}};return this.pCont};_.prototype.GetSizeControl=function(){var t,e,i=this,s,a,l=[100,90,80,70,60,50,40,30,20],o=BX.create("DIV"),n=o.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-size-perc"}}));this.percVals=l;this.pPercWrap=n;this.pSizeCont=o;this.oSize={};BX.bind(n,"click",(function(t){var e=t.target||t.srcElement;if(e){var s=parseInt(e.getAttribute("data-bx-size-val"),10);if(s){i.SetPercentSize(s,true)}}}));function h(t){var e=0,s,a=t.target||t.srcElement;if(a!==n){a=BX.findParent(a,(function(t){e++;return t==n||e>3}),n)}if(a!==n){i.SetPercentSize(i.savedPerc,false);if(i.sizeControlChecker){BX.unbind(document,"mousemove",h);i.sizeControlChecker=false}}}BX.bind(n,"mouseover",(function(t){var e,a=t.target||t.srcElement;if(!i.sizeControlChecker){BX.bind(document,"mousemove",h);i.sizeControlChecker=true}e=parseInt(a.getAttribute("data-bx-size-val"),10);i.overPerc=e>0;if(i.overPerc){i.SetPercentSize(e,false)}else{if(s){clearTimeout(s)}s=setTimeout((function(){if(!i.overPerc){i.SetPercentSize(i.savedPerc,false);if(i.sizeControlChecker){BX.unbind(document,"mousemove",h);i.sizeControlChecker=false}}}),200)}}));BX.bind(n,"mouseout",(function(t){var e,a=t.target||t.srcElement;if(s){clearTimeout(s)}s=setTimeout((function(){if(!i.overPerc){i.SetPercentSize(i.savedPerc,false);if(i.sizeControlChecker){BX.unbind(document,"mousemove",h);i.sizeControlChecker=false}}}),200)}));function r(){var e=parseInt(i.pWidth.value);if(!isNaN(e)&&t!=e){if(!i.sizeRatio&&i.originalWidth&&i.originalHeight){i.sizeRatio=i.originalWidth/i.originalHeight}if(i.sizeRatio){i.pHeight.value=Math.round(e/i.sizeRatio);t=e;i.ShowPreview()}}}function d(){var t=parseInt(i.pHeight.value);if(!isNaN(t)&&e!=t){if(!i.sizeRatio&&i.originalWidth&&i.originalHeight){i.sizeRatio=i.originalWidth/i.originalHeight}if(i.sizeRatio){i.pWidth.value=parseInt(t*i.sizeRatio);e=t;i.ShowPreview()}}}o.appendChild(BX.create("LABEL",{text:BX.message("BXEdImgWidth")+": "})).setAttribute("for",this.id+"-width");this.pWidth=o.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-width"},style:{width:"40px",marginBottom:"4px"}}));o.appendChild(BX.create("LABEL",{style:{marginLeft:"20px"},text:BX.message("BXEdImgHeight")+": "})).setAttribute("for",this.id+"-height");this.pHeight=o.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-height"},style:{width:"40px",marginBottom:"4px"}}));this.pNoSize=o.appendChild(BX.create("INPUT",{props:{type:"checkbox",id:this.id+"-no-size",className:"bxhtmled-img-no-size-ch"}}));o.appendChild(BX.create("LABEL",{props:{className:"bxhtmled-img-no-size-lbl"},text:BX.message("BXEdImgNoSize")})).setAttribute("for",this.id+"-no-size");BX.bind(this.pNoSize,"click",BX.proxy(this.NoSizeCheck,this));BX.bind(this.pWidth,"blur",r);BX.bind(this.pWidth,"change",r);BX.bind(this.pWidth,"keyup",r);BX.bind(this.pHeight,"blur",d);BX.bind(this.pHeight,"change",d);BX.bind(this.pHeight,"keyup",d);for(a=0;a<l.length;a++){n.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-size-perc-i"},attrs:{"data-bx-size-val":l[a]},html:l[a]+"%"}))}return o};_.prototype.NoSizeCheck=function(){if(this.pNoSize.checked){BX.addClass(this.pSizeCont,"bxhtmled-img-no-size-cont");this.pSizeRow.cells[0].style.height=this.pSizeRow.cells[1].style.height=""}else{BX.removeClass(this.pSizeCont,"bxhtmled-img-no-size-cont")}this.ShowPreview()};_.prototype.SetPercentSize=function(t,e){var i,s,a="bxhtmled-size-perc-i-active";if(e){for(s=0;s<this.pPercWrap.childNodes.length;s++){i=this.pPercWrap.childNodes[s];if(t&&i.getAttribute("data-bx-size-val")==t){BX.addClass(i,a)}else{BX.removeClass(i,a)}}}if(t!==false){t=t/100;this.pWidth.value=Math.round(this.originalWidth*t)||"";this.pHeight.value=Math.round(this.originalHeight*t)||""}else if(this.savedWidth&&this.savedHeight){this.pWidth.value=this.savedWidth;this.pHeight.value=this.savedHeight}this.ShowPreview();if(e){this.savedWidth=this.pWidth.value;this.savedHeight=this.pHeight.value;this.savedPerc=t!==false?(t||1)*100:false}};_.prototype.SrcOnChange=function(t){var e,i,s,a,l,o=this,n=this.pSrc.value;t=t!==false;if(this.lastSrc!==n){this.lastSrc=n;if(!this.pInvisCont){this.pInvisCont=this.pCont.appendChild(BX.create("DIV",{props:{className:"bxhtmled-invis-cnt"}}))}else{BX.cleanNode(this.pInvisCont)}this.dummyImg=this.pInvisCont.appendChild(BX.create("IMG"));BX.bind(this.dummyImg,"load",(function(){setTimeout((function(){o.originalWidth=o.dummyImg.offsetWidth;o.originalHeight=o.dummyImg.offsetHeight;if(t){o.pWidth.value=o.originalWidth;o.pHeight.value=o.originalHeight;i=100}else{i=false;a=Math.round(1e4*parseInt(o.pWidth.value)/parseInt(o.originalWidth))/100;l=Math.round(1e4*parseInt(o.pHeight.value)/parseInt(o.originalHeight))/100;if(Math.abs(a-l)<=.1){s=(a+l)/2;for(e=0;e<o.percVals.length;e++){if(Math.abs(o.percVals[e]-s)<=.1){i=o.percVals[e];break}}}}o.sizeRatio=o.originalWidth/o.originalHeight;o.SetPercentSize(i,true);if(o.bEmptySrcRowsHidden){o.ShowRows(o.bAdditional?["preview","size","align","style","alt"]:["preview","size"],true,true);o.bEmptySrcRowsHidden=false}o.ShowPreview()}),100)}));BX.bind(this.dummyImg,"error",(function(){o.pWidth.value="";o.pHeight.value=""}));this.dummyImg.src=n}};_.prototype.ShowPreview=function(){if(!this.pPreviewImg){this.pPreviewImg=BX.create("IMG");if(this.pAlign){this.pPreview.insertBefore(this.pPreviewImg,this.pPreview.firstChild)}else{this.pPreview.appendChild(this.pPreviewImg)}}if(this.pPreviewImg.src!=this.pSrc.value){this.pPreviewImg.src=this.pSrc.value}if(this.pNoSize.checked){this.pPreviewImg.style.width="";this.pPreviewImg.style.height=""}else{this.pPreviewImg.style.width=this.pWidth.value+"px";this.pPreviewImg.style.height=this.pHeight.value+"px"}if(this.pAlign){var t=this.pAlign.value;if(t!=this.pPreviewImg.align){if(t==""){this.pPreviewImg.removeAttribute("align")}else{this.pPreviewImg.align=t}}}};_.prototype.SetValues=function(t){if(!t){t={}}var e,i,s=["preview","size","align","style","alt"];this.lastSrc="";this.bEmptySrcRowsHidden=this.bNewImage;if(this.bNewImage){for(e=0;e<s.length;e++){i=this.rows[s[e]];if(i&&i.cont){i.cont.style.display="none";this.SetRowHeight(i.cont,0,0)}}}else{for(e=0;e<s.length;e++){i=this.rows[s[e]];if(i&&i.cont){i.cont.style.display="";this.SetRowHeight(i.cont,i.height,100)}}}this.pSrc.value=this.editor.util.spaceUrlDecode(t.src||"");if(this.pTitle)this.pTitle.value=t.title||"";if(this.pAlt)this.pAlt.value=t.alt||"";this.savedWidth=this.pWidth.value=t.width||"";this.savedHeight=this.pHeight.value=t.height||"";if(this.pAlign)this.pAlign.value=t.align||"";if(this.pClass)this.pClass.value=t.className||"";this.pLink.value=t.link||"";this.pNoSize.checked=t.noWidth&&t.noHeight;this.NoSizeCheck();this.ShowRows(["align","style","alt","link"],false,false);this.bAdditional=false;this.SrcOnChange(!t.width||!t.height);if(this.pClass){if(!this.oClass){this.oClass=new window.BXHtmlEditor.ClassSelector(this.editor,{id:this.id+"-class-selector",input:this.pClass,filterTag:"IMG",value:this.pClass.value});var a=this;BX.addCustomEvent(this.oClass,"OnComboPopupClose",(function(){a.closeByEnter=true}));BX.addCustomEvent(this.oClass,"OnComboPopupOpen",(function(){a.closeByEnter=false}))}else{this.oClass.OnChange()}}};_.prototype.GetValues=function(){var t={src:this.pSrc.value,width:this.pNoSize.checked?"":this.pWidth.value,height:this.pNoSize.checked?"":this.pHeight.value,link:this.pLink.value||"",image:this.image||false};if(this.pTitle)t.title=this.pTitle.value;if(this.pAlt)t.alt=this.pAlt.value;if(this.pAlign)t.align=this.pAlign.value;if(this.pClass)t.className=this.pClass.value||"";return t};_.prototype.Show=function(t,e){var i=this,s,a={},l,o,n=false;if(!this.readyToShow){return setTimeout((function(){i.Show(t,e)}),100)}this.savedRange=e;if(!this.editor.bbCode||!this.editor.synchro.IsFocusedOnTextarea()){if(!this.editor.iframeView.IsFocused()){this.editor.iframeView.Focus()}if(this.savedRange){this.editor.selection.SetBookmark(this.savedRange)}if(!t){s=this.editor.selection.GetRange();t=s.getNodes([1])}}if(t){for(o=0;o<t.length;o++){n=t[o];l=this.editor.GetBxTag(n);if(l.tag||!n.nodeName||n.nodeName!="IMG"){n=false}else{break}}}this.bNewImage=!n;this.image=n;if(n){a.src=n.getAttribute("src");if(n.style.width){a.width=n.style.width}if(!a.width&&n.getAttribute("width")){a.width=n.getAttribute("width")}if(!a.width){a.width=n.offsetWidth;a.noWidth=true}if(n.style.height){a.height=n.style.height}if(!a.height&&n.getAttribute("height")){a.height=n.getAttribute("height")}if(!a.height){a.height=n.offsetHeight;a.noHeight=true}var h=n.getAttribute("data-bx-clean-attribute");if(h){n.removeAttribute(h);n.removeAttribute("data-bx-clean-attribute")}a.alt=n.alt||"";a.title=n.title||"";a.title=n.title||"";a.className=n.className;a.align=n.align||"";var r=n.parentNode.nodeName=="A"?n.parentNode:null;if(r&&r.href){a.link=r.getAttribute("href")}}if(!this.editor.bbCode){window["OnFileDialogSelect"+this.editor.id]=window["OnFileDialogImgSelect"+this.editor.id]=function(t,e,s){var a;if(typeof t=="object"){a=t.src;if(i.pTitle)i.pTitle.value=t.description||t.name;if(i.pAlt)i.pAlt.value=t.description||t.name}else{a=(e=="/"?"":e)+"/"+t}i.pSrc.value=a;BX.focus(i.pSrc);i.pSrc.select();i.SrcOnChange()}}this.SetValues(a);this.SetTitle(BX.message("InsertImage"));_.superclass.Show.apply(this,arguments)};_.prototype.SetPanelHeight=function(t,e){this.pSearchCont.style.height=t+"px";this.pSearchCont.style.opacity=e/100;this.editor.SetAreaContSize(this.origAreaWidth,this.origAreaHeight-t,{areaContTop:this.editor.toolbar.GetHeight()+t})};_.prototype.ShowRows=function(t,e,i){var s=this,a,l,o,n,h,r;if(e){for(h=0;h<t.length;h++){r=this.rows[t[h]];if(r&&r.cont){if(r.animation)r.animation.stop();r.cont.style.display="";if(i){a=0;l=r.height;o=0;n=100}else{a=r.height;l=0;o=100;n=0}r.animation=new BX.easing({_row:r,duration:300,start:{height:a,opacity:o},finish:{height:l,opacity:n},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function(t){s.SetRowHeight(this._row.cont,t.height,t.opacity)},complete:function(){s.CheckSize();this._row.animation=null}});r.animation.animate()}}}else{for(h=0;h<t.length;h++){r=this.rows[t[h]];if(r&&r.cont){if(i){r.cont.style.display="";this.SetRowHeight(r.cont,r.height,100)}else{r.cont.style.display="none";this.SetRowHeight(r.cont,0,0)}}}this.CheckSize()}};_.prototype.SetRowHeight=function(t,e,i){if(t&&t.cells){if(e==0||i==0){t.style.display="none"}else{t.style.display=""}t.style.opacity=i/100;for(var s=0;s<t.cells.length;s++){t.cells[s].style.height=e+"px"}}};function z(t,e){e={id:"bx_link",width:600,resizable:false,className:"bxhtmled-link-dialog"};z.superclass.constructor.apply(this,[t,e]);this.id="link"+this.editor.id;this.action="createLink";this.selectFirstFocus=true;this.readyToShow=false;if(!this.editor.fileDialogsLoaded){var i=this;this.editor.LoadFileDialogs((function(){i.SetContent(i.Build());i.readyToShow=true}))}else{this.SetContent(this.Build());this.readyToShow=true}BX.addCustomEvent(this,"OnDialogSave",BX.proxy(this.Save,this))}BX.extend(z,e);z.prototype.Build=function(){function t(t,e,i){var s,a,l;s=t.insertRow(-1);if(i){s.className="bxhtmled-add-row"}a=s.insertCell(-1);a.className="bxhtmled-left-c";if(e&&e.label){a.appendChild(BX.create("LABEL",{text:e.label})).setAttribute("for",e.id)}l=s.insertCell(-1);l.className="bxhtmled-right-c";return{row:s,leftCell:a,rightCell:l}}var e,i=BX.create("DIV");var s=BX.create("TABLE",{props:{className:"bxhtmled-dialog-tbl bxhtmled-dialog-tbl-collapsed"}});if(!this.editor.bbCode){e=t(s,{label:BX.message("BXEdLinkType")+":",id:this.id+"-type"});this.pType=e.rightCell.appendChild(BX.create("SELECT",{props:{id:this.id+"-type"}}));this.pType.options.add(new Option(BX.message("BXEdLinkTypeInner"),"internal",true,true));this.pType.options.add(new Option(BX.message("BXEdLinkTypeOuter"),"external",false,false));this.pType.options.add(new Option(BX.message("BXEdLinkTypeAnchor"),"anchor",false,false));this.pType.options.add(new Option(BX.message("BXEdLinkTypeEmail"),"email",false,false));BX.bind(this.pType,"change",BX.delegate(this.ChangeType,this))}e=t(s,{label:BX.message("BXEdLinkText")+":",id:this.id+"-text"});this.pText=e.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-text",placeholder:BX.message("BXEdLinkTextPh")}}));this.pTextCont=e.row;e=t(s,{label:BX.message("BXEdLinkInnerHtml")+":",id:this.id+"-innerhtml"});this.pInnerHtml=e.rightCell.appendChild(BX.create("DIV",{props:{className:"bxhtmled-ld-html-wrap"}}));this.pInnerHtmlCont=e.row;this.firstFocus=this.pText;e=t(s,{label:BX.message("BXEdLinkHref")+":",id:this.id+"-href"});this.pHrefIn=e.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-href",placeholder:BX.message("BXEdLinkHrefPh")}}));if(!this.editor.bbCode){this.pHrefIn.style.minWidth="80%";var a=BX("bx-open-file-link-medialib-but-"+this.editor.id);if(a){e.rightCell.appendChild(a)}else{var l=BX("bx_open_file_link_medialib_button_"+this.editor.id);if(l){e.rightCell.appendChild(l);BX.bind(l,"click",window["BxOpenFileBrowserImgFile"+this.editor.id])}else{var o=BX("bx_ml_bx_open_file_link_medialib_button_"+this.editor.id);if(o){e.rightCell.appendChild(o)}}}}else{a=BX("bx-open-file-link-medialib-but-"+this.editor.id);l=BX("bx_open_file_link_medialib_button_"+this.editor.id);if(a){a.style.display="none"}if(l){l.style.display="none"}}this.pHrefIntCont=e.row;e=t(s,{label:BX.message("BXEdLinkHref")+":",id:this.id+"-href-ext"});this.pHrefType=e.rightCell.appendChild(BX.create("SELECT",{props:{id:this.id+"-href-type"}}));this.pHrefType.options.add(new Option("http://","http://",false,false));this.pHrefType.options.add(new Option("https://","https://",false,false));this.pHrefType.options.add(new Option("ftp://","ftp://",false,false));this.pHrefType.options.add(new Option("","",false,false));this.pHrefExt=e.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-href-ext",placeholder:BX.message("BXEdLinkHrefExtPh")},style:{minWidth:"250px"}}));this.pHrefExtCont=e.row;e=t(s,{label:BX.message("BXEdLinkHrefAnch")+":",id:this.id+"-href-anch"});this.pHrefAnchor=e.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-href-anchor",placeholder:BX.message("BXEdLinkSelectAnchor")}}));this.pHrefAnchCont=e.row;e=t(s,{label:BX.message("BXEdLinkHrefEmail")+":",id:this.id+"-href-email"});var n=BX.browser.IsIE()||BX.browser.IsIE9()?"text":"email";this.pHrefEmail=e.rightCell.appendChild(BX.create("INPUT",{props:{type:n,id:this.id+"-href-email"}}));this.pHrefEmailCont=e.row;if(!this.editor.bbCode){e=s.insertRow(-1);var h=e.insertCell(-1);BX.adjust(h,{props:{className:"bxhtmled-title-cell bxhtmled-title-cell-foldable",colSpan:2},text:BX.message("BXEdLinkAdditionalTitle")});h.onclick=function(){BX.toggleClass(s,"bxhtmled-dialog-tbl-collapsed")};e=t(s,{label:BX.message("BXEdLinkTitle")+":",id:this.id+"-title"},true);this.pTitle=e.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-title"}}));e=t(s,{label:BX.message("BXEdCssClass")+":",id:this.id+"-style"},true);this.pClass=e.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-style"}}));e=t(s,{label:BX.message("BXEdLinkTarget")+":",id:this.id+"-target"},true);this.pTarget=e.rightCell.appendChild(BX.create("SELECT",{props:{id:this.id+"-target"}}));this.pTarget.options.add(new Option(BX.message("BXEdLinkTargetBlank"),"_blank",false,false));this.pTarget.options.add(new Option(BX.message("BXEdLinkTargetParent"),"_parent",false,false));this.pTarget.options.add(new Option(BX.message("BXEdLinkTargetSelf"),"_self",true,true));this.pTarget.options.add(new Option(BX.message("BXEdLinkTargetTop"),"_top",false,false));e=t(s,false,true);this.pNoindex=e.leftCell.appendChild(BX.create("INPUT",{props:{type:"checkbox",id:this.id+"-noindex"}}));e.rightCell.appendChild(BX.create("LABEL",{text:BX.message("BXEdLinkNoindex")})).setAttribute("for",this.id+"-noindex");BX.bind(this.pNoindex,"click",BX.delegate(this.CheckNoindex,this));e=t(s,{label:BX.message("BXEdLinkId")+":",id:this.id+"-id"},true);this.pId=e.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-id"}}));e=t(s,{label:BX.message("BXEdLinkRel")+":",id:this.id+"-rel"},true);this.pRel=e.rightCell.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-rel"}}))}i.appendChild(s);return i};z.prototype.OpenFileDialog=function(){var t=window["BxOpenFileBrowserWindFile"+this.editor.id];if(t&&typeof t=="function"){var e=this;window["OnFileDialogSelect"+this.editor.id]=function(t,i,s){e.pHrefIn.value=(i=="/"?"":i)+"/"+t;e.pHrefIn.focus();e.pHrefIn.select();window["OnFileDialogSelect"+e.editor.id]=null};t()}};z.prototype.ChangeType=function(){var t=this.pType?this.pType.value:this.editor.config.linkDialogType||"internal";this.pHrefIntCont.style.display="none";this.pHrefExtCont.style.display="none";this.pHrefAnchCont.style.display="none";this.pHrefEmailCont.style.display="none";if(t=="internal"){this.pHrefIntCont.style.display=""}else if(t=="external"){this.pHrefExtCont.style.display=""}else if(t=="anchor"){this.pHrefAnchCont.style.display=""}else if(t=="email"){this.pHrefEmailCont.style.display=""}this.editor.config.linkDialogType=t;this.editor.SaveOption("link_dialog_type",this.editor.config.linkDialogType)};z.prototype.CheckNoindex=function(){if(this.pNoindex.checked){this.pRel.value="nofollow";this.pRel.disabled=true}else{this.pRel.value=this.pRel.value=="nofollow"?"":this.pRel.value;this.pRel.disabled=false}};z.prototype.SetValues=function(t){this.pHrefAnchor.value="";if(!t){t={}}else{var e=this.editor.util.spaceUrlDecode(t.href||"");if(this.editor.bbCode){t.type="internal";this.pHrefIn.value=e||"";this.firstFocus=this.pHrefIn}else if(e!=""){if(e.substring(0,"mailto:".length).toLowerCase()=="mailto:"){t.type="email";this.pHrefEmail.value=e.substring("mailto:".length)}else if(e.substr(0,1)=="#"){t.type="anchor";this.pHrefAnchor.value=e;this.firstFocus=this.pHrefAnchor}else if(e.indexOf("://")!==-1||e.substr(0,"www.".length)=="www."||e.indexOf("&goto=")!==-1){t.type="external";if(e.substr(0,"www.".length)=="www.")e="http://"+e;var i=e.substr(0,e.indexOf("://")+3);this.pHrefType.value=i;if(this.pHrefType.value!=i)this.pHrefType.value="";this.pHrefExt.value=e.substring(e.indexOf("://")+3);this.firstFocus=this.pHrefExt}else{t.type="internal";this.pHrefIn.value=e||"";this.firstFocus=this.pHrefIn}}if(!t.type){if(t.text&&t.text.match(this.editor.autolinkEmailRegExp)){this.pHrefEmail.value=t.text;t.type="email";this.firstFocus=this.pHrefEmail}else{if(this.editor.config.linkDialogType&&BX.util.in_array(this.editor.config.linkDialogType,["internal","external","anchor","email"])){t.type=this.editor.config.linkDialogType;if(t.type=="email"){this.pHrefEmail.value="";this.firstFocus=this.pHrefEmail}else if(t.type=="anchor"){this.pHrefAnchor.value="";this.firstFocus=this.pHrefAnchor}else if(t.type=="internal"){this.pHrefIn.value="";this.firstFocus=this.pHrefIn}else{this.pHrefExt.value="";this.firstFocus=this.pHrefExt}}else{t.type="internal";this.pHrefIn.value=e||"";this.firstFocus=this.pHrefIn}}}if(this.pType){this.pType.value=t.type}this.pInnerHtmlCont.style.display="none";this.pTextCont.style.display="none";if(t.bTextContent){this.pText.value=t.text||"";this.pTextCont.style.display=""}else{if(!t.text&&t.innerHtml){this.pInnerHtml.innerHTML=t.innerHtml;this.pInnerHtmlCont.style.display=""}else{this.pText.value=t.text||"";this.pTextCont.style.display=""}this._originalText=t.text}}if(!this.editor.bbCode){this.pTitle.value=t.title||"";this.pTarget.value=t.target||"_self";this.pClass.value=t.className||"";this.pId.value=t.id||"";this.pRel.value=t.rel||"";this.pNoindex.checked=t.noindex}this.ChangeType();if(!this.editor.bbCode){this.CheckNoindex();if(!this.oClass){this.oClass=new window.BXHtmlEditor.ClassSelector(this.editor,{id:this.id+"-class-selector",input:this.pClass,filterTag:"A",value:this.pClass.value});var s=this;BX.addCustomEvent(this.oClass,"OnComboPopupClose",(function(){s.closeByEnter=true}));BX.addCustomEvent(this.oClass,"OnComboPopupOpen",(function(){s.closeByEnter=false}))}else{this.oClass.OnChange()}}};z.prototype.GetValues=function(){var t=this.pType?this.pType.value:"internal",e={text:this.pText.value};if(!this.editor.bbCode){e.className="";e.title=this.pTitle.value;e.id=this.pId.value;e.rel=this.pRel.value;e.noindex=!!this.pNoindex.checked}if(t=="internal"){e.href=this.pHrefIn.value}else if(t=="external"){e.href=this.pHrefExt.value;if(this.pHrefType.value&&e.href.indexOf("://")==-1){e.href=this.pHrefType.value+e.href}}else if(t=="anchor"){e.href=this.pHrefAnchor.value}else if(t=="email"){e.href="mailto:"+this.pHrefEmail.value}if(this.pTarget&&this.pTarget.value!=="_self"){e.target=this.pTarget.value}if(this.pClass&&this.pClass.value){e.className=this.pClass.value}e.node=this.lastLink||false;return e};z.prototype.Show=function(t,e){var i=this,s={},a,l,o,n,h=0;this.lastLink=false;if(!this.readyToShow){return setTimeout((function(){i.Show(t,e)}),100)}this.savedRange=e;if(!this.editor.bbCode||!this.editor.synchro.IsFocusedOnTextarea()){if(!t){t=this.editor.action.CheckState("formatInline",{},"a")}if(t){for(a=0;a<t.length;a++){o=t[a];if(o){n=o;h++}if(h>1){break}}if(h===1&&n&&n.querySelector){if(!n.querySelector("*")){s.text=this.editor.util.GetTextContent(n);s.bTextContent=true}else{s.text=this.editor.util.GetTextContent(n);if(BX.util.trim(s.text)==""){s.innerHtml=n.innerHTML}s.bTextContent=false}var r=n.getAttribute("data-bx-clean-attribute");if(r){n.removeAttribute(r);n.removeAttribute("data-bx-clean-attribute")}s.noindex=n.getAttribute("data-bx-noindex")=="Y";s.href=n.getAttribute("href");s.title=n.title;s.id=n.id;s.rel=n.getAttribute("rel");s.target=n.target;s.className=n.className;this.lastLink=n}}else{this.savedRange=this.editor.selection.TrimRange();const t=this.editor.selection.GetText();if(t&&t!=this.editor.INVISIBLE_SPACE){s.text=t}}this.bNewLink=t&&h>0;var d=[],p;if(document.querySelectorAll){var c=this.editor.sandbox.GetDocument().querySelectorAll(".bxhtmled-surrogate");l=c.length;for(a=0;a<l;a++){p=this.editor.GetBxTag(c[a]);if(p.tag=="anchor"){d.push({NAME:"#"+p.params.name,DESCRIPTION:BX.message("BXEdLinkHrefAnch")+": #"+p.params.name,CLASS_NAME:"bxhtmled-inp-popup-item"})}}}if(d.length>0){this.oHrefAnchor=new BXInputPopup({id:this.id+"-href-anchor-cntrl"+Math.round(Math.random()*1e9),values:d,input:this.pHrefAnchor,className:"bxhtmled-inp-popup"});BX.addCustomEvent(this.oHrefAnchor,"onInputPopupShow",(function(t){if(t&&t.oPopup&&t.oPopup.popupContainer){if(d.length>20){t.oPopup.popupContainer.style.overflow="auto";t.oPopup.popupContainer.style.paddingRight="20px";t.oPopup.popupContainer.style.maxHeight="300px"}}}))}}else{s.text=this.editor.textareaView.GetTextSelection()}if(!this.editor.bbCode){window["OnFileDialogImgSelect"+this.editor.id]=window["OnFileDialogSelect"+this.editor.id]=function(t,e,s){var a;if(typeof t=="object"){a=t.src;if(i.pTitle)i.pTitle.value=t.description||t.name;if(i.pAlt)i.pAlt.value=t.description||t.name}else{a=(e=="/"?"":e)+"/"+t}i.pHrefIn.value=a;i.pHrefIn.focus();i.pHrefIn.select()}}this.SetValues(s);this.SetTitle(BX.message("InsertLink"));z.superclass.Show.apply(this,arguments)};function W(t,e){e={id:"bx_video",width:600,className:"bxhtmled-video-dialog"};this.sizes=[{key:"560x315",width:560,height:315},{key:"640x360",width:640,height:360},{key:"853x480",width:853,height:480},{key:"1280x720",width:1280,height:720}];W.superclass.constructor.apply(this,[t,e]);this.id="video_"+this.editor.id;this.waitCounter=false;this.SetContent(this.Build());BX.addCustomEvent(this,"OnDialogSave",BX.proxy(this.Save,this))}BX.extend(W,e);W.prototype.Build=function(){this.pCont=BX.create("DIV",{props:{className:"bxhtmled-video-dialog-cnt bxhtmled-video-cnt bxhtmled-video-empty"}});var t=this,e,i,s=BX.create("TABLE",{props:{className:"bxhtmled-dialog-tbl bxhtmled-video-dialog-tbl"}});e=this.AddTableRow(s,{label:BX.message("BXEdVideoSource")+":",id:this.id+"-source"});this.pSource=e.rightCell.appendChild(BX.create("INPUT",{props:{id:this.id+"-source",type:"text",className:"bxhtmled-90-input",placeholder:BX.message("BXEdVideoSourcePlaceholder")}}));BX.bind(this.pSource,"change",BX.delegate(this.VideoSourceChanged,this));BX.bind(this.pSource,"mouseup",BX.delegate(this.VideoSourceChanged,this));BX.bind(this.pSource,"keyup",BX.delegate(this.VideoSourceChanged,this));this.pErrorRow=s.insertRow(-1);this.pErrorRow.style.display="none";i=BX.adjust(this.pErrorRow.insertCell(-1),{props:{className:"bxhtmled-video-error-cell"},attrs:{colSpan:2}});this.pError=i.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-video-error"}}));e=s.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-video-params-wrap"},attrs:{colSpan:2}});var a=i.appendChild(BX.create("TABLE",{props:{className:"bxhtmled-dialog-tbl bxhtmled-video-dialog-tbl"}}));e=this.AddTableRow(a,{label:BX.message("BXEdVideoInfoTitle")+":",id:this.id+"-title"});this.pTitle=e.rightCell.appendChild(BX.create("INPUT",{props:{id:this.id+"-title",type:"text",className:"bxhtmled-90-input",disabled:!!this.editor.bbCode}}));BX.addClass(e.row,"bxhtmled-video-ext-row bxhtmled-video-ext-loc-row");e=this.AddTableRow(a,{label:BX.message("BXEdVideoSize")+":",id:this.id+"-size"});this.pSize=e.rightCell.appendChild(BX.create("SELECT",{props:{id:this.id+"-size"}}));BX.addClass(e.row,"bxhtmled-video-ext-row");this.pUserSizeCnt=e.rightCell.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-user-size"},style:{display:"none"}}));this.pUserSizeCnt.appendChild(BX.create("LABEL",{props:{className:"bxhtmled-width-lbl"},text:BX.message("BXEdImgWidth")+": ",attrs:{for:this.id+"-width"}}));this.pWidth=this.pUserSizeCnt.appendChild(BX.create("INPUT",{props:{id:this.id+"-width",type:"text"}}));this.pUserSizeCnt.appendChild(BX.create("LABEL",{props:{className:"bxhtmled-width-lbl"},text:BX.message("BXEdImgHeight")+": ",attrs:{for:this.id+"-height"}}));this.pHeight=this.pUserSizeCnt.appendChild(BX.create("INPUT",{props:{id:this.id+"-height",type:"text"}}));BX.bind(this.pSize,"change",(function(){t.pUserSizeCnt.style.display=t.pSize.value==""?"":"none"}));this.pPreviewCont=a.insertRow(-1);i=BX.adjust(this.pPreviewCont.insertCell(-1),{props:{title:BX.message("BXEdVideoPreview")},attrs:{colSpan:2}});this.pPreview=i.appendChild(BX.create("DIV",{props:{className:"bxhtmled-video-preview-cnt"}}));BX.addClass(this.pPreviewCont,"bxhtmled-video-ext-row bxhtmled-video-ext-loc-row");this.pCont.appendChild(s);return this.pCont};W.prototype.VideoSourceChanged=function(){var t=BX.util.trim(this.pSource.value);if(t!==this.lastSourceValue){this.lastSourceValue=t;if(this.editor.bbCode&&this.bEdit&&t.toLowerCase().indexOf("[/video]")!==-1)return;this.AnalyzeVideoSource(t)}};W.prototype.AnalyzeVideoSource=function(t){var e=this;if(t.match(/<iframe([\s\S]*?)\/iframe>/gi)){var i=this.editor.phpParser.CheckForVideo(t);if(i){var s=this.editor.phpParser.FetchVideoIframeParams(t,i.provider)||{};this.ShowVideoParams({html:t,provider:i.provider||false,title:s.origTitle||"",width:s.width||false,height:s.height||false})}}else{this.StartWaiting();BX.ajax.runAction("fileman.api.htmleditorajax.getVideoOembed",{data:{video_source:t}}).then(function(t){this.StopWaiting();if(t.data.result){this.ShowVideoParams(t.data.data)}else{if(t.data.error!==""){this.ShowVideoParams(false,t.data.error)}}}.bind(this),function(t){this.StopWaiting();this.ShowVideoParams(false)}.bind(this))}};W.prototype.StartWaiting=function(){var t="",e=this;this.waitCounter=this.waitCounter===false||this.waitCounter>3?0:this.waitCounter;if(e.waitCounter==1)t=".";else if(e.waitCounter==2)t="..";else if(e.waitCounter==3)t="...";e.SetTitle(BX.message("BXEdVideoTitle")+t);this.StopWaiting(false);this.waitingTimeout=setTimeout((function(){e.waitCounter++;e.StartWaiting()}),250)};W.prototype.StopWaiting=function(t){if(this.waitingTimeout){clearTimeout(this.waitingTimeout);this.waitingTimeout=null}if(t!==false){this.waitCounter=false;this.SetTitle(t||BX.message("BXEdVideoTitle"))}};W.prototype.ShowVideoParams=function(t,e){this.data=t||{};this.pErrorRow.style.display="none";this.pPreviewCont.style.display="none";this.pPreview.innerHTML="";BX.removeClass(this.pCont,"bxhtmled-video-local");if(t===false||typeof t!="object"){BX.addClass(this.pCont,"bxhtmled-video-empty");if(e){this.pErrorRow.style.display="";this.pError.innerHTML=BX.util.htmlspecialchars(e)}}else if(t.remote&&!this.bEdit){BX.removeClass(this.pCont,"bxhtmled-video-empty");this.pTitle.value=t.title||"";if(t.width&&t.height){this.SetSize(t.width,t.height)}else{this.SetSize(400,300)}}else if(t.local&&!this.bEdit){this.SetSize(400,300);BX.removeClass(this.pCont,"bxhtmled-video-empty");BX.addClass(this.pCont,"bxhtmled-video-local")}else{BX.removeClass(this.pCont,"bxhtmled-video-empty");if(t.provider){this.SetTitle(BX.message("BXEdVideoTitleProvider").replace("#PROVIDER_NAME#",BX.util.htmlspecialchars(t.provider)))}this.pTitle.value=t.title||"";this.SetSize(t.width,t.height);if(t.html){var i=Math.min(t.width,560),s=Math.min(t.height,315),a=t.html;a=this.UpdateHtml(a,i,s);this.pPreview.innerHTML=a;this.pPreviewCont.style.display=""}else{this.pPreviewCont.style.display="none"}}};W.prototype.SetSize=function(t,e){var i=t+"x"+e;if(!this.sizeIndex[i]){this.ClearSizeControl([{key:i,width:t,height:e,title:BX.message("BXEdVideoSizeAuto")+" ("+t+" x "+e+")"}].concat(this.sizes))}this.pSize.value=i};W.prototype.ClearSizeControl=function(t){t=t||this.sizes;this.pSize.options.length=0;this.sizeIndex={};for(var e=0;e<t.length;e++){this.sizeIndex[t[e].key]=true;this.pSize.options.add(new Option(t[e].title||t[e].width+" x "+t[e].height,t[e].key,false,false))}this.pSize.options.add(new Option(BX.message("BXEdVideoSizeCustom"),"",false,false))};W.prototype.UpdateHtml=function(t,e,i,s){var a=false;if(s){s=BX.util.htmlspecialchars(s)}t=t.replace(/((?:title)|(?:width)|(?:height))\s*=\s*("|')([\s\S]*?)(\2)/gi,(function(t,l,o,n){l=l.toLowerCase();if(l=="width"&&e){return l+'="'+e+'"'}else if(l=="height"&&i){return l+'="'+i+'"'}else if(l=="title"&&s){a=true;return l+'="'+s+'"'}return""}));if(!a&&s){t=t.replace(/<iframe\s*/i,(function(t){return t+' title="'+s+'" '}))}return t};W.prototype.Show=function(t,e){this.savedRange=e;if(this.savedRange){this.editor.selection.SetBookmark(this.savedRange)}this.SetTitle(BX.message("BXEdVideoTitle"));this.ClearSizeControl();this.bEdit=t&&t.tag=="video";this.bxTag=t;if(this.bEdit){this.pSource.value=this.lastSourceValue=t.params.value;if(!this.editor.bbCode)this.AnalyzeVideoSource(t.params.value)}else{this.ShowVideoParams(false);this.pSource.value=""}W.superclass.Show.apply(this,arguments)};W.prototype.Save=function(){var t=this,e=this.pTitle.value,i=parseInt(this.pWidth.value)||100,s=parseInt(this.pHeight.value)||100,a=this.data?.mimeType||"";if(this.pSize.value!==""){var l=this.pSize.value.split("x");if(l&&l.length==2){i=parseInt(l[0]);s=parseInt(l[1])}}if(this.data&&this.data.html)this.data.html=this.UpdateHtml(this.data.html,i,s,e);var o="",n="";if(this.bEdit){if(this.bxTag&&this.editor.bbCode&&!this.data){this.bxTag.params.value=this.pSource.value}else if(this.data&&this.editor.action.IsSupported("insertHTML")){var h=this.editor.GetIframeElement(this.bxTag.id);if(h){this.editor.selection.SelectNode(h);BX.remove(h)}n=this.data.html}}else if(this.data){if(this.editor.bbCode&&this.data.local){o=this.data.html="[VIDEO width="+i+" height="+s+"]"+this.data.path+"[/VIDEO]";n=this.editor.bbParser.GetVideoSourse(this.data.path,{type:false,width:i,height:s,html:this.data.html},this.data.html)}else if(this.editor.bbCode&&this.data.remote){o="[VIDEO ";if(a){o+="mimetype='"+a+"' "}o+="width="+i+" height="+s+"]"+this.data.path+"[/VIDEO]";this.data.html=o;n=this.editor.bbParser.GetVideoSourse(this.data.path,{type:false,width:i,height:s,html:this.data.html,title:this.data.title},this.data.html)}else if(this.data.html){if(this.savedRange){this.editor.selection.SetBookmark(this.savedRange)}if(t.editor.synchro.IsFocusedOnTextarea()){var r=this.editor.phpParser.FetchVideoIframeParams(this.data.html);o="[VIDEO TYPE="+this.data.provider.toUpperCase()+" WIDTH="+this.data.width+" HEIGHT="+this.data.height+"]"+r.src+"[/VIDEO]"}n=this.data.html}}if(t.editor.synchro.IsFocusedOnTextarea()){if(o!=="")this.editor.textareaView.WrapWith(false,false,o);t.editor.synchro.Sync()}else{if(n!==""&&this.editor.action.IsSupported("insertHTML")){this.editor.action.Exec("insertHTML",n)}setTimeout((function(){t.editor.synchro.FullSyncFromIframe()}),50)}};function M(t,e){e={id:"bx_source",height:400,width:700,resizable:true,className:"bxhtmled-source-dialog"};M.superclass.constructor.apply(this,[t,e]);this.id="source_"+this.editor.id;this.SetContent(this.Build());BX.addCustomEvent(this,"OnDialogSave",BX.proxy(this.Save,this))}BX.extend(M,e);M.prototype.Build=function(){this.pValue=BX.create("TEXTAREA",{props:{className:"bxhtmled-source-value",id:this.id+"-value"}});return this.pValue};M.prototype.OnResize=function(){var t=this.oDialog.PARTS.CONTENT_DATA.offsetWidth,e=this.oDialog.PARTS.CONTENT_DATA.offsetHeight;this.pValue.style.width=t-30+"px";this.pValue.style.height=e-30+"px"};M.prototype.OnResizeFinished=function(){};M.prototype.Save=function(){this.bxTag.params.value=this.pValue.value;this.editor.SetBxTag(false,this.bxTag);var t=this;setTimeout((function(){t.editor.synchro.FullSyncFromIframe()}),50)};M.prototype.Show=function(t){this.bxTag=t;if(t&&t.tag){this.SetTitle(t.name);this.pValue.value=t.params.value;M.superclass.Show.apply(this,arguments);this.OnResize();BX.focus(this.pValue)}};function G(t,e){e={id:"bx_anchor",width:300,resizable:false,className:"bxhtmled-anchor-dialog"};G.superclass.constructor.apply(this,[t,e]);this.id="anchor_"+this.editor.id;this.SetContent(this.Build());BX.addCustomEvent(this,"OnDialogSave",BX.proxy(this.Save,this))}BX.extend(G,e);G.prototype.Build=function(){var t=BX.create("DIV");t.appendChild(BX.create("LABEL",{text:BX.message("BXEdAnchorName")+": "})).setAttribute("for",this.id+"-value");this.pValue=t.appendChild(BX.create("INPUT",{props:{className:"",id:this.id+"-value"}}));return t};G.prototype.Save=function(){this.bxTag.params.name=BX.util.trim(this.pValue.value.replace(/[^ a-z0-9_\-]/gi,""));this.editor.SetBxTag(false,this.bxTag);var t=this;setTimeout((function(){t.editor.synchro.FullSyncFromIframe()}),50)};G.prototype.Show=function(t){this.bxTag=t;if(t&&t.tag){this.SetTitle(BX.message("BXEdAnchor"));this.pValue.value=t.params.name;G.superclass.Show.apply(this,arguments);BX.focus(this.pValue);this.pValue.select()}};function U(t,e){e={id:"bx_table",width:t.bbCode?300:600,resizable:false,className:"bxhtmled-table-dialog"};z.superclass.constructor.apply(this,[t,e]);this.id="table"+this.editor.id;this.action="insertTable";this.SetContent(this.Build());BX.addCustomEvent(this,"OnDialogSave",BX.proxy(this.Save,this))}BX.extend(U,e);U.prototype.Build=function(){var t,e,i,s=BX.create("DIV");var a=BX.create("TABLE",{props:{className:"bxhtmled-dialog-tbl bxhtmled-dialog-tbl-hide-additional"}});e=a.insertRow(-1);i=BX.adjust(e.insertCell(-1),{attrs:{colSpan:4}});t=i.appendChild(BX.create("TABLE",{props:{className:"bxhtmled-dialog-tbl"}}));e=t.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableRows")+":",attrs:{for:this.id+"-rows"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-val-cell"}});this.pRows=i.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-rows"}}));if(!this.editor.bbCode){i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableWidth")+":",attrs:{for:this.id+"-width"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-val-cell"}});this.pWidth=i.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-width"}}))}e=t.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableCols")+":",attrs:{for:this.id+"-cols"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-val-cell"}});this.pCols=i.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-cols"}}));if(!this.editor.bbCode){i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableHeight")+":",attrs:{for:this.id+"-height"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-val-cell"}});this.pHeight=i.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-height"}}))}if(!this.editor.bbCode){e=a.insertRow(-1);var l=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-title-cell bxhtmled-title-cell-foldable",colSpan:4},text:BX.message("BXEdLinkAdditionalTitle")});BX.bind(l,"click",(function(){BX.toggleClass(a,"bxhtmled-dialog-tbl-hide-additional")}));var o=a.appendChild(BX.create("TBODY",{props:{className:"bxhtmled-additional-tbody"}}));e=o.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableHeads")+":",attrs:{for:this.id+"-th"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-val-cell"}});this.pHeaders=i.appendChild(BX.create("SELECT",{props:{id:this.id+"-th"},style:{width:"130px"}}));this.pHeaders.options.add(new Option(BX.message("BXEdThNone"),"",true,true));this.pHeaders.options.add(new Option(BX.message("BXEdThTop"),"top",false,false));this.pHeaders.options.add(new Option(BX.message("BXEdThLeft"),"left",false,false));this.pHeaders.options.add(BX.adjust(new Option(BX.message("BXEdThTopLeft"),"topleft",false,false),{props:{title:BX.message("BXEdThTopLeftTitle")}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableCellSpacing")+":",attrs:{for:this.id+"-cell-spacing"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-val-cell"}});this.pCellSpacing=i.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-cell-spacing"}}));e=o.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableBorder")+":",attrs:{for:this.id+"-border"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-val-cell"}});this.pBorder=i.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-border"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableCellPadding")+":",attrs:{for:this.id+"-cell-padding"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-val-cell"}});this.pCellPadding=i.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-cell-padding"}}));e=o.insertRow(-1);i=BX.adjust(e.insertCell(-1),{attrs:{colSpan:4}});t=i.appendChild(BX.create("TABLE",{props:{className:"bxhtmled-dialog-inner-tbl"}}));e=t.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-inner-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableAlign")+":",attrs:{for:this.id+"-align"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-inner-val-cell"}});this.pAlign=i.appendChild(BX.create("SELECT",{props:{id:this.id+"-align"},style:{width:"130px"}}));this.pAlign.options.add(new Option(BX.message("BXEdTableAlignLeft"),"left",true,true));this.pAlign.options.add(new Option(BX.message("BXEdTableAlignCenter"),"center",false,false));this.pAlign.options.add(new Option(BX.message("BXEdTableAlignRight"),"right",false,false));e=t.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-inner-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableCaption")+":",attrs:{for:this.id+"-caption"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-inner-val-cell"}});this.pCaption=i.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-caption"}}));e=t.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-inner-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdCssClass")+":",attrs:{for:this.id+"-class"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-inner-val-cell"}});this.pClass=i.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-class"}}));e=t.insertRow(-1);i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-inner-lbl-cell"}});i.appendChild(BX.create("LABEL",{text:BX.message("BXEdTableId")+":",attrs:{for:this.id+"-id"}}));i=BX.adjust(e.insertCell(-1),{props:{className:"bxhtmled-inner-val-cell"}});this.pId=i.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-id"}}))}s.appendChild(a);return s};U.prototype.SetValues=function(t){this.pRows.value=t.rows||3;this.pCols.value=t.cols||4;if(!this.editor.bbCode){this.pWidth.value=t.width||"";this.pHeight.value=t.height||"";this.pId.value=t.id||"";this.pCaption.value=t.caption||"";this.pCellPadding.value=t.cellPadding||"";this.pCellSpacing.value=t.cellSpacing||"";this.pBorder.value=t.border||"";this.pClass.value=t.className||"";this.pHeaders.value=t.headers||"";this.pRows.disabled=this.pCols.disabled=!!this.currentTable;this.pAlign.value=t.align||"left";if(!this.oClass){this.oClass=new window.BXHtmlEditor.ClassSelector(this.editor,{id:this.id+"-class-selector",input:this.pClass,filterTag:"TABLE",value:this.pClass.value});var e=this;BX.addCustomEvent(this.oClass,"OnComboPopupClose",(function(){e.closeByEnter=true}));BX.addCustomEvent(this.oClass,"OnComboPopupOpen",(function(){e.closeByEnter=false}))}else{this.oClass.OnChange()}}};U.prototype.GetValues=function(){var t={table:this.currentTable||false,rows:parseInt(this.pRows.value)||1,cols:parseInt(this.pCols.value)||1};if(!this.editor.bbCode){t.width=BX.util.trim(this.pWidth.value);t.height=BX.util.trim(this.pHeight.value);t.id=BX.util.trim(this.pId.value);t.caption=BX.util.trim(this.pCaption.value);t.cellPadding=isNaN(parseInt(this.pCellPadding.value))?"":parseInt(this.pCellPadding.value);t.cellSpacing=isNaN(parseInt(this.pCellSpacing.value))?"":parseInt(this.pCellSpacing.value);t.border=isNaN(parseInt(this.pBorder.value))?"":parseInt(this.pBorder.value);t.headers=this.pHeaders.value;t.className=this.pClass.value;t.align=this.pAlign.value}return t};U.prototype.Show=function(t,e){var i,s={};this.savedRange=e;if(this.savedRange){this.editor.selection.SetBookmark(this.savedRange)}if(!t){t=this.editor.action.CheckState("insertTable")}if(t&&t.nodeName){i=t}else if(t&&t[0]&&t[0].nodeName){i=t[0]}this.currentTable=false;if(i){this.currentTable=i;s.rows=i.rows.length;s.cols=i.rows[0].cells.length;if(i.style.width){s.width=i.style.width}if(!s.width&&i.width){s.width=i.width}if(i.style.height){s.height=i.style.height}if(!s.height&&i.height){s.height=i.height}s.cellPadding=i.getAttribute("cellPadding")||"";s.cellSpacing=i.getAttribute("cellSpacing")||"";s.border=i.getAttribute("border")||0;s.id=i.getAttribute("id")||"";var a=BX.findChild(i,{tag:"CAPTION"},false);s.caption=a?BX.util.htmlspecialcharsback(a.innerHTML):"";s.className=i.className||"";var l,o,n,h=true,r=true;for(l=0;l<i.rows.length;l++){for(o=0;o<i.rows[l].cells.length;o++){n=i.rows[l].cells[o];if(l==0){h=n.nodeName=="TH"&&h}if(o==0){r=n.nodeName=="TH"&&r}}}if(!h&&!r){s.headers=""}else if(h&&r){s.headers="topleft"}else if(h){s.headers="top"}else{s.headers="left"}s.align=i.getAttribute("align")}this.SetValues(s);this.SetTitle(BX.message("BXEdTable"));U.superclass.Show.apply(this,arguments)};function j(t,e){e={id:"bx_settings",width:600,resizable:false};this.id="settings";q.superclass.constructor.apply(this,[t,e]);this.SetContent(this.Build());BX.addCustomEvent(this,"OnDialogSave",BX.proxy(this.Save,this))}BX.extend(j,e);j.prototype.Build=function(){this.pCont=BX.create("DIV",{props:{className:"bxhtmled-settings-dialog-cnt"}});var t,e,i=BX.create("TABLE",{props:{className:"bxhtmled-dialog-tbl"}});t=this.AddTableRow(i);this.pCleanSpans=t.leftCell.appendChild(BX.create("INPUT",{props:{id:this.id+"-clean-spans",type:"checkbox"}}));t.rightCell.appendChild(BX.create("LABEL",{html:BX.message("BXEdSettingsCleanSpans")})).setAttribute("for",this.id+"-clean-spans");t=i.insertRow(-1);e=t.insertCell(-1);BX.adjust(e,{props:{className:"bxhtmled-title-cell",colSpan:2},text:BX.message("BXEdPasteSettings")});t=this.AddTableRow(i);this.pPasteSetColors=t.leftCell.appendChild(BX.create("INPUT",{props:{id:this.id+"-ps-colors",type:"checkbox"}}));t.rightCell.appendChild(BX.create("LABEL",{html:BX.message("BXEdPasteSetColors")})).setAttribute("for",this.id+"-ps-colors");t=this.AddTableRow(i);this.pPasteSetBgBorders=t.leftCell.appendChild(BX.create("INPUT",{props:{id:this.id+"-ps-border",type:"checkbox"}}));t.rightCell.appendChild(BX.create("LABEL",{html:BX.message("BXEdPasteSetBgBorders")})).setAttribute("for",this.id+"-ps-border");t=this.AddTableRow(i);this.pPasteSetDecor=t.leftCell.appendChild(BX.create("INPUT",{props:{id:this.id+"-ps-decor",type:"checkbox"}}));t.rightCell.appendChild(BX.create("LABEL",{html:BX.message("BXEdPasteSetDecor")})).setAttribute("for",this.id+"-ps-decor");t=this.AddTableRow(i);this.pPasteTblDimen=t.leftCell.appendChild(BX.create("INPUT",{props:{id:this.id+"-ps-tbl-dim",type:"checkbox"}}));t.rightCell.appendChild(BX.create("LABEL",{html:BX.message("BXEdPasteSetTableDimen")})).setAttribute("for",this.id+"-ps-tbl-dim");t=i.insertRow(-1);e=t.insertCell(-1);BX.adjust(e,{props:{className:"bxhtmled-title-cell",colSpan:2},text:BX.message("BXEdViewSettings")});t=this.AddTableRow(i);this.pShowSnippets=t.leftCell.appendChild(BX.create("INPUT",{props:{id:this.id+"-show-snippets",type:"checkbox"}}));t.rightCell.appendChild(BX.create("LABEL",{html:BX.message("BXEdShowSnippets")+"*"})).setAttribute("for",this.id+"-show-snippets");t=i.insertRow(-1);e=t.insertCell(-1);BX.adjust(e,{props:{className:"bxhtmled-notice-cell",colSpan:2},text:"* "+BX.message("BXEdRefreshNotice")});this.pCont.appendChild(i);return this.pCont};j.prototype.Show=function(){var t={};this.SetValues(t);this.SetTitle(BX.message("BXEdSettings"));this.pCleanSpans.checked=this.editor.config.cleanEmptySpans;this.pPasteSetColors.checked=this.editor.config.pasteSetColors;this.pPasteSetBgBorders.checked=this.editor.config.pasteSetBorders;this.pPasteSetDecor.checked=this.editor.config.pasteSetDecor;this.pPasteTblDimen.checked=this.editor.config.pasteClearTableDimen;this.pShowSnippets.checked=this.editor.config.showSnippets;j.superclass.Show.apply(this,arguments)};j.prototype.Save=function(){this.editor.config.cleanEmptySpans=this.pCleanSpans.checked;this.editor.config.pasteSetColors=this.pPasteSetColors.checked;this.editor.config.pasteSetBorders=this.pPasteSetBgBorders.checked;this.editor.config.pasteSetDecor=this.pPasteSetDecor.checked;this.editor.config.pasteClearTableDimen=this.pPasteTblDimen.checked;this.editor.config.showSnippets=this.pShowSnippets.checked;this.editor.SaveOption("clean_empty_spans",this.editor.config.cleanEmptySpans?"Y":"N");this.editor.SaveOption("paste_clear_colors",this.editor.config.pasteSetColors?"Y":"N");this.editor.SaveOption("paste_clear_borders",this.editor.config.pasteSetBorders?"Y":"N");this.editor.SaveOption("paste_clear_decor",this.editor.config.pasteSetDecor?"Y":"N");this.editor.SaveOption("paste_clear_table_dimen",this.editor.config.pasteClearTableDimen?"Y":"N");this.editor.SaveOption("show_snippets",this.editor.config.showSnippets?"Y":"N")};function q(t,e){e={id:"bx_default",width:500,resizable:false,className:"bxhtmled-default-dialog"};this.id="default";this.action="universalFormatStyle";q.superclass.constructor.apply(this,[t,e]);this.SetContent(this.Build());BX.addCustomEvent(this,"OnDialogSave",BX.proxy(this.Save,this))}BX.extend(q,e);q.prototype.Show=function(t,e){var i=[],s,a,l=typeof t!=="object"||t.length==0,o;this.savedRange=e;if(this.savedRange){this.editor.selection.SetBookmark(this.savedRange)}if(l){t=this.editor.action.CheckState(this.action)}if(!t){t=[]}var n=t.length==1&&t[0].nodeName=="BODY";if(t.length==1&&BX.util.in_array(t[0].nodeName,["TD","TH","TR","TABLE"])){this.colorRow.style.display=""}else{this.colorRow.style.display="none"}if(!n){for(s=0;s<t.length;s++){if(a===undefined&&o===undefined){a=t[s].style.cssText;o=t[s].className}else{a=t[s].style.cssText===a?a:false;o=t[s].className===o?o:false}i.push(t[s].nodeName)}}this.SetValues({nodes:t,renewNodes:l,style:a,className:o});if(n)this.SetTitle(BX.message("BXEdDefaultPropDialog").replace("#NODES_LIST#",BX.message("BXEdDefaultPropDialogTextNode")));else this.SetTitle(BX.message("BXEdDefaultPropDialog").replace("#NODES_LIST#",i.join(", ")));q.superclass.Show.apply(this,arguments)};q.prototype.Build=function(){var t,e,i=this,s=BX.create("DIV");var a=BX.create("TABLE",{props:{className:"bxhtmled-dialog-tbl"}});t=a.insertRow(-1);e=BX.adjust(t.insertCell(-1),{props:{className:"bxhtmled-left-c"}});e.appendChild(BX.create("LABEL",{text:BX.message("BXEdCssClass")+":",attrs:{for:this.id+"-css-class"}}));e=BX.adjust(t.insertCell(-1),{props:{className:"bxhtmled-right-c"}});this.pCssClass=e.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-css-class"}}));t=a.insertRow(-1);e=BX.adjust(t.insertCell(-1),{props:{className:"bxhtmled-left-c"}});e.appendChild(BX.create("LABEL",{text:BX.message("BXEdCSSStyle")+":",attrs:{for:this.id+"-css-style"}}));e=BX.adjust(t.insertCell(-1),{props:{className:"bxhtmled-right-c"}});this.pCssStyle=e.appendChild(BX.create("INPUT",{props:{type:"text",id:this.id+"-css-style"}}));t=a.insertRow(-1);e=BX.adjust(t.insertCell(-1),{props:{className:"bxhtmled-left-c"}});e.appendChild(BX.create("LABEL",{text:BX.message("BXEdColorpickerDialog")+":",attrs:{for:this.id+"-css-class"}}));e=BX.adjust(t.insertCell(-1),{props:{className:"bxhtmled-right-c"}});this.textColor=e.appendChild(BX.create("INPUT",{props:{type:"hidden",id:this.id+"-s"}}));this.bgColor=e.appendChild(BX.create("INPUT",{props:{type:"hidden",id:this.id+"-s"}}));var l=new window.BXHtmlEditor.Controls.Color(this.editor,e,{registerActions:false,checkAction:false,BgColorMess:BX.message("BXEdBgColor"),callback:function(t,e){var s,a=" "+i.pCssStyle.value;if(t=="foreColor"){s=a.replace(/\s+color\s*:\s*([\s\S]*?);/gi,e?" color: "+e+";":"");if(s.toLowerCase()!=a.toLowerCase())a=s;else if(e)a+=" color: "+e+";"}else if(t=="backgroundColor"){s=a.replace(/background-color\s*:\s*([\s\S]*?);/gi,"background-color: "+e+";");if(s.toLowerCase()!=a.toLowerCase())a=s;else if(e)a+=" background-color: "+e+";"}i.pCssStyle.value=BX.util.trim(a)}});this.colorRow=t;s.appendChild(a);return s};q.prototype.SetValues=function(t){if(!t){t={}}this.nodes=t.nodes||[];this.renewNodes=t.renewNodes;this.pCssStyle.value=this.editor.util.RgbToHex(t.style||"");this.pCssClass.value=t.className||"";if(!this.oClass){this.oClass=new window.BXHtmlEditor.ClassSelector(this.editor,{id:this.id+"-class-selector",input:this.pCssClass,filterTag:"A",value:this.pCssClass.value});var e=this;BX.addCustomEvent(this.oClass,"OnComboPopupClose",(function(){e.closeByEnter=true}));BX.addCustomEvent(this.oClass,"OnComboPopupOpen",(function(){e.closeByEnter=false}))}else{this.oClass.OnChange()}};q.prototype.GetValues=function(){return{className:this.pCssClass.value,style:this.pCssStyle.value,nodes:this.renewNodes?[]:this.nodes}};function Y(t,e){this.editor=t;e={id:"bx_char",width:570,resizable:false,className:"bxhtmled-char-dialog"};this.id="char"+this.editor.id;Y.superclass.constructor.apply(this,[t,e]);this.oDialog.ClearButtons();this.oDialog.SetButtons([this.oDialog.btnCancel]);this.SetContent(this.Build());BX.addCustomEvent(this,"OnDialogSave",BX.proxy(this.Save,this))}BX.extend(Y,e);Y.prototype.Build=function(){var t=this,e,i,s,a=18,l,o=this.editor.HTML_ENTITIES.length,n=BX.create("DIV");var h=BX.create("TABLE",{props:{className:"bxhtmled-specialchar-tbl"}});for(s=0;s<o;s++){if(s%a==0){e=h.insertRow(-1)}l=this.editor.HTML_ENTITIES[s];i=e.insertCell(-1);i.innerHTML=l;i.setAttribute("data-bx-specialchar",l);i.title=BX.message("BXEdSpecialchar")+": "+l.substr(1,l.length-2)}BX.bind(h,"click",(function(e){var i,s=e.target||e.srcElement;if(s.nodeType==3){s=s.parentNode}if(s&&s.getAttribute&&s.getAttribute("data-bx-specialchar")&&t.editor.action.IsSupported("insertHTML")){if(t.savedRange){t.editor.selection.SetBookmark(t.savedRange)}i=s.getAttribute("data-bx-specialchar");t.editor.On("OnSpecialcharInserted",[i]);t.editor.action.Exec("insertHTML",i)}t.oDialog.Close()}));n.appendChild(h);return n};Y.prototype.SetValues=BX.DoNothing;Y.prototype.GetValues=BX.DoNothing;Y.prototype.Show=function(t){this.savedRange=t;if(this.savedRange){this.editor.selection.SetBookmark(this.savedRange)}this.SetTitle(BX.message("BXEdSpecialchar"));Y.superclass.Show.apply(this,arguments)};function Z(t,e){this.editor=t;e={id:"bx_list",width:360,resizable:false,className:"bxhtmled-list-dialog"};this.id="list"+this.editor.id;Z.superclass.constructor.apply(this,[t,e]);this.SetContent(this.Build());BX.addCustomEvent(this,"OnDialogSave",BX.proxy(this.Save,this))}BX.extend(Z,e);Z.prototype.Build=function(){var t=this,e,i,s,a=18,l,o=this.editor.HTML_ENTITIES.length,n=BX.create("DIV");this.itemsWrap=n.appendChild(BX.create("DIV",{props:{className:"bxhtmled-list-wrap"}}));this.addItem=n.appendChild(BX.create("span",{props:{className:"bxhtmled-list-add-item"},text:BX.message("BXEdAddListItem")}));BX.bind(this.addItem,"click",BX.proxy(this.AddItem,this));return n};Z.prototype.BuildList=function(t){if(this.pList){BX.remove(this.pList)}this.pList=this.itemsWrap.appendChild(BX.create(t,{props:{className:"bxhtmled-list"}}));this.AddItem({focus:true});this.AddItem({focus:false});this.AddItem({focus:false})};Z.prototype.AddItem=function(t){if(typeof t!=="object")t={};var e=BX.create("LI"),i=e.appendChild(BX.create("INPUT",{props:{type:"text",value:"",size:35}}));this.pList.appendChild(e);var s=e.appendChild(BX.create("SPAN",{props:{className:"bxhtmled-list-del-item",title:BX.message("DelListItem")}}));if(t.focus!==false){setTimeout((function(){BX.focus(i)}),100)}BX.bind(i,"keyup",BX.proxy(this.CheckList,this));BX.bind(i,"mouseup",BX.proxy(this.CheckList,this));BX.bind(i,"focus",BX.proxy(this.CheckList,this));BX.bind(s,"click",BX.proxy(this.RemoveItem,this))};Z.prototype.RemoveItem=function(t){var e=t.target||t.srcElement,i=BX.findParent(e,{tag:"LI"});if(i){BX.remove(i)}};Z.prototype.CheckList=function(){var t=this.pList.getElementsByTagName("LI");if(t.length<3){this.AddItem({focus:false});this.CheckList({focus:false})}else{if(t[t.length-1].firstChild&&t[t.length-1].firstChild.value!==""){this.AddItem({focus:false})}}};Z.prototype.InputKeyNavigation=function(t){var e=t.target||t.srcElement,i=t.keyCode};Z.prototype.SetValues=BX.DoNothing;Z.prototype.GetValues=BX.DoNothing;Z.prototype.Show=function(t){this.type=t.type;this.SetTitle(t.type=="ul"?BX.message("UnorderedList"):BX.message("OrderedList"));this.BuildList(t.type);Z.superclass.Show.apply(this,arguments)};Z.prototype.Save=function(){var t,e=[],i=this.pList.getElementsByTagName("INPUT");for(t=0;t<i.length;t++){if(i[t].value!==""){e.push(i[t].value)}}this.editor.action.Exec(this.type=="ul"?"insertUnorderedList":"insertOrderedList",{items:e})};window.BXHtmlEditor.Controls={SearchButton:s,ChangeView:a,Undo:o,Redo:n,StyleSelector:h,FontSelector:r,FontSize:d,Bold:p,Italic:c,Underline:u,Strikeout:m,Color:i,RemoveFormat:f,TemplateSelector:C,OrderedList:b,UnorderedList:g,IndentButton:B,OutdentButton:X,AlignList:x,InsertLink:y,InsertImage:v,InsertVideo:S,InsertAnchor:w,InsertTable:N,InsertChar:I,Settings:P,Fullscreen:V,PrintBreak:T,PageBreak:E,InsertHr:A,Spellcheck:k,Code:R,Quote:D,Smile:H,Sub:L,Sup:O,More:F,BbCode:l};window.BXHtmlEditor.dialogs.Image=_;window.BXHtmlEditor.dialogs.Link=z;window.BXHtmlEditor.dialogs.Video=W;window.BXHtmlEditor.dialogs.Source=M;window.BXHtmlEditor.dialogs.Anchor=G;window.BXHtmlEditor.dialogs.Table=U;window.BXHtmlEditor.dialogs.Settings=j;window.BXHtmlEditor.dialogs.Default=q;window.BXHtmlEditor.dialogs.Specialchar=Y;window.BXHtmlEditor.dialogs.InsertList=Z}if(window.BXHtmlEditor&&window.BXHtmlEditor.Button&&window.BXHtmlEditor.Dialog)t();else BX.addCustomEvent(window,"OnEditorBaseControlsDefined",t)})(); //# sourceMappingURL=html-controls.map.js