Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/fileman/light_editor/ |
Upload File : |
if(!window.LHEButtons)LHEButtons={};LHEButtons["Source"]={id:"Source",width:44,name:BX.message.Source,OnBeforeCreate:function(e,t){if(e.bBBCode&&!e.arConfig.bConvertContentFromBBCodes){t.id="SourceBB";t.name=t.title=BX.message.BBSource}t.title+=": "+BX.message.Off;return t},handler:function(e){var t=e.pLEditor.sEditorMode=="html";e.pWnd.title=e.oBut.name+": "+(t?BX.message.On:BX.message.Off);e.pLEditor.SetView(t?"code":"html");e.Check(t)}};LHEButtons["Anchor"]={id:"Anchor",name:BX.message.Anchor,bBBHide:true,OnBeforeCreate:function(e,t){if(e.bBBCode)return false;return t},handler:function(e){e.pLEditor.OpenDialog({id:"Anchor"})},parser:{name:"anchor",obj:{Parse:function(e,t,n){return t.replace(/<a(\s[\s\S]*?)(?:>\s*?<\/a)?(?:\/?)?>/gi,(function(e){if(e.toLowerCase().indexOf("href")>0)return e;var t=n.SetBxTag(false,{tag:"anchor",params:{value:e}});return'<img id="'+t+'" src="'+n.oneGif+'" class="bxed-anchor" />'}))},UnParse:false}}};LHEButtons["CreateLink"]={id:"CreateLink",name:BX.message.CreateLink,name_edit:BX.message.EditLink,OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},handler:function(e){var t=e.arSelectedElement&&e.arSelectedElement["A"]?e.arSelectedElement["A"]:e.pLEditor.GetSelectionObject();e.pLEditor.OpenDialog({id:"Link",obj:t,bCM:!!e.menu})},parser:{name:"a",obj:{Parse:function(e,t,n){return t.replace(/(<noindex>)*?<a([\s\S]*?(?:.*?[^\?]{1})??)(>[\s\S]*?<\/a>)(<\/noindex>)*/gi,(function(e,t,o,i,r){var a=n.GetAttributesList(o),s,l,d="",m=false;if(t&&r&&t.toLowerCase().indexOf("noindex")!=-1&&r.toLowerCase().indexOf("noindex")!=-1){a.noindex=true;a.rel="nofollow"}d='<a id="'+n.SetBxTag(false,{tag:"a",params:a})+'" ';for(s in a){if(typeof a[s]=="string"&&s!="id"&&s!="noindex"){d+=s+'="'+BX.util.htmlspecialchars(a[s])+'" '}}d+=i;return d}))},UnParse:function(e,t,n){if(!e.params)return"";var o,i="<a ";if(n.bBBCode){var r="";for(o=0;o<t.arNodes.length;o++)r+=n._RecursiveGetHTML(t.arNodes[o]);if(BX.util.trim(r)==BX.util.trim(e.params.href))i="[url]"+e.params.href+"[/url]";else i="[url="+e.params.href+"]"+r+"[/url]";return i}e.params["class"]=t.arAttributes["class"]||"";for(o in e.params)if(e.params[o]&&o!="noindex")i+=o+'="'+BX.util.htmlspecialchars(e.params[o])+'" ';i+=">";for(o=0;o<t.arNodes.length;o++)i+=n._RecursiveGetHTML(t.arNodes[o]);i+="</a>";if(e.params.noindex)i="<noindex>"+i+"</noindex>";return i}}}};LHEButtons["DeleteLink"]={id:"DeleteLink",name:BX.message.DeleteLink,cmd:"Unlink",disableOnCodeView:true,handler:function(e){var t=e.arSelectedElement&&e.arSelectedElement["A"]?e.arSelectedElement["A"]:e.pLEditor.GetSelectionObject();if(t&&t.tagName!="A")t=BX.findParent(e.pLEditor.GetSelectionObject(),{tagName:"A"});if(BX.browser.IsIE()&&!t){var n=e.pLEditor.GetSelectionRange();if(e.pLEditor.GetSelectedText(n)==""){e.pLEditor.InsertHTML('<img id="bx_lhe_temp_bogus_node" src="'+e.pLEditor.oneGif+'" _moz_editor_bogus_node="on" style="border: 0px !important;"/>');var o=e.pLEditor.pEditorDocument.getElementById("bx_lhe_temp_bogus_node");if(o){t=BX.findParent(o,{tagName:"A"});o.parentNode.removeChild(o)}}}if(t){if(!BX.browser.IsIE())e.pLEditor.SelectElement(t);e.pLEditor.executeCommand("Unlink")}}};LHEButtons["Image"]={id:"Image",name:BX.message.Image,name_edit:BX.message.EditImage,OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},handler:function(e){var t=e.arSelectedElement&&e.arSelectedElement["IMG"]?e.arSelectedElement["IMG"]:e.pLEditor.GetSelectionObject();if(!t||t.tagName!="IMG")t=false;e.pLEditor.OpenDialog({id:"Image",obj:t})},parser:{name:"img",obj:{Parse:function(e,t,n){return t.replace(/<img([\s\S]*?(?:.*?[^\?]{1})??)>/gi,(function(e,t){var o=n.GetAttributesList(t),i,r,a="",s=false;if(o&&o.id){var l=n.GetBxTag(o.id);if(l.tag)return e}a='<img id="'+n.SetBxTag(false,{tag:"img",params:o})+'" ';for(i in o){if(typeof o[i]=="string"&&i!="id")a+=i+'="'+BX.util.htmlspecialchars(o[i])+'" '}a+=" />";return a}))},UnParse:function(e,t,n){if(!e.params)return"";var o=parseInt(t.arStyle.width)||parseInt(t.arAttributes.width),i=parseInt(t.arStyle.height)||parseInt(t.arAttributes.height);if(n.bBBCode){var r=o&&i&&n.bBBParseImageSize?" WIDTH="+o+" HEIGHT="+i:"";return s="[IMG"+r+"]"+e.params.src+"[/IMG]"}if(o&&!isNaN(o))e.params.width=o;if(i&&!isNaN(i))e.params.height=i;e.params["class"]=t.arAttributes["class"]||"";var a,s="<img ";for(a in e.params)if(e.params[a])s+=a+'="'+BX.util.htmlspecialchars(e.params[a])+'" ';s+=" />";return s}}}};LHEButtons["Bold"]={id:"Bold",name:BX.message.Bold+" (Ctrl + B)",OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},cmd:"Bold",bbHandler:function(e){e.pLEditor.FormatBB({tag:"B",pBut:e})}};LHEButtons["Italic"]={id:"Italic",name:BX.message.Italic+" (Ctrl + I)",cmd:"Italic",OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},bbHandler:function(e){e.pLEditor.FormatBB({tag:"I",pBut:e})}};LHEButtons["Underline"]={id:"Underline",name:BX.message.Underline+" (Ctrl + U)",cmd:"Underline",OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},bbHandler:function(e){e.pLEditor.FormatBB({tag:"U",pBut:e})}};LHEButtons["RemoveFormat"]={id:"RemoveFormat",name:BX.message.RemoveFormat,OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},handler:function(e){e.pLEditor.executeCommand("RemoveFormat");var t=e.pLEditor.GetSelectionObject(),n,o=[];if(t){var o=BX.findChildren(t,{tagName:"del"},true);if(!o||!o.length)o=[];var i=BX.findParent(t,{tagName:"del"});if(i)o.push(i);if(t.nodeName&&t.nodeName.toLowerCase()=="del")o.push(t)}if(o&&o.length>0){for(n=0;n<o.length;n++){o[n].style.textDecoration="";e.pLEditor.RidOfNode(o[n],true)}}},bbHandler:function(e){e.pLEditor.RemoveFormatBB()}};LHEButtons["Strike"]={id:"Strike",name:BX.message.Strike,OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},handler:function(e){var t=e.pLEditor.GetSelectionObject(),n=[];if(t&&t.nodeName){if(t.nodeName.toLowerCase()=="body"){}else{var n=BX.findChildren(t,{tagName:"del"},true);if(!n||!n.length)n=[];var o=BX.findParent(t,{tagName:"del"});if(o)n.push(o);if(t.nodeName.toLowerCase()=="del")n.push(t)}}if(n&&n.length>0){for(var i=0;i<n.length;i++){n[i].style.textDecoration="";e.pLEditor.RidOfNode(n[i],true)}e.Check(false)}else{e.pLEditor.WrapSelectionWith("del")}},OnSelectionChange:function(){var e=this.pMainObj.GetSelectedNode(true),t=false,n;while(!t){if(!e)break;if(e.nodeType==1&&(BX.style(e,"text-decoration",null)=="line-through"||e.nodeName.toLowerCase()=="strike")){t=true;break}else e=e.parentNode}pBut.Check(t)},bbHandler:function(e){e.pLEditor.FormatBB({tag:"S",pBut:e})}};LHEButtons["Quote"]={id:"Quote",name:BX.message.Quote+" (Ctrl + Q)",OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;e.systemCSS+="blockquote.bx-quote {border: 1px solid #C0C0C0!important; background: #fff4ca url("+e.imagePath+"font_quote.gif) left top no-repeat; padding: 4px 4px 4px 24px; color: #373737!important;}\n";return t},handler:function(e){if(e.pLEditor.arConfig.bQuoteFromSelection){var t;if(document.selection&&document.selection.createRange)t=document.selection.createRange().text;else if(window.getSelection)t=window.getSelection().toString();t=BX.util.htmlspecialchars(t);t=t.replace(/\n/g,"<br />");var n="";if(!e.pLEditor.bBBCode)n=' id"='+e.pLEditor.SetBxTag(false,{tag:"quote"})+'"';if(t&&t.length>0)return e.pLEditor.InsertHTML('<blockquote class="bx-quote"'+n+">"+t+"</blockquote> <br/>")}var o=e.pLEditor.pEditorDocument.getElementsByTagName("blockquote"),i,r=o.length;for(i=0;i<r;i++)o[i].name="__bx_temp_quote";e.pLEditor.executeCommand("Indent");setTimeout((function(){var t=e.pLEditor.pEditorDocument.getElementsByTagName("blockquote"),n,i=t.length;for(n=0;n<i;n++){if(o[n].name=="__bx_temp_quote"){o[n].removeAttribute("name")}else{o[n].className="bx-quote";o[n].id=e.pLEditor.SetBxTag(false,{tag:"quote"})}try{o[n].setAttribute("style","")}catch(e){}if(!o[n].nextSibling)o[n].parentNode.appendChild(BX.create("BR",{},e.pLEditor.pEditorDocument));if(o[n].previousSibling&&o[n].previousSibling.nodeName&&o[n].previousSibling.nodeName.toLowerCase()=="blockquote")o[n].parentNode.insertBefore(BX.create("BR",{},e.pLEditor.pEditorDocument),o[n])}}),10)},bbHandler:function(e){if(e.pLEditor.arConfig.bQuoteFromSelection){if(document.selection&&document.selection.createRange)res=document.selection.createRange().text;else if(window.getSelection)res=window.getSelection().toString();if(res&&res.length>0)return e.pLEditor.WrapWith("[QUOTE]","[/QUOTE]",res)}e.pLEditor.FormatBB({tag:"QUOTE",pBut:e})},parser:{name:"quote",obj:{Parse:function(e,t,n){t=t.replace(/\[quote\]/gi,'<blockquote class="bx-quote" id="'+n.SetBxTag(false,{tag:"quote"})+'">');t=t.replace(/\[\/quote\]$/gi,"</blockquote><br/>");t=t.replace(/\[\/quote\](<blockquote)/gi,"</blockquote><br/>$1");t=t.replace(/\[\/quote\]/gi,"</blockquote>");return t},UnParse:function(e,t,n){if(e.tag=="quote"){var o,i=t.arNodes.length,r="[QUOTE]";for(o=0;o<i;o++)r+=n._RecursiveGetHTML(t.arNodes[o]);r+="[/QUOTE]";return r}return""}}}};LHEButtons["Code"]={id:"Code",name:BX.message.InsertCode,OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;e.systemCSS+=".lhe-code{border: 1px solid #C0C0C0!important; white-space: pre!important; padding: 5px!important; display: block;}\n .lhe-code *, .lhe-code{background: #eaeaea!important; color: #000080!important; font-weight: normal!important; line-height: normal!important; text-decoration: none!important; font-size: 11px!important;font-family:Verdana!important;}";return t},handler:function(e){var t={className:"lhe-code",title:BX.message.CodeDel};if(!e.pLEditor.bBBCode)t.id=e.pLEditor.SetBxTag(false,{tag:"code"});var n=e.pLEditor.WrapSelectionWith("pre",{props:t});if(n&&n.length>0){var o=n[0],i=n[n.length-1];if(o)o.parentNode.insertBefore(BX.create("BR",{},e.pLEditor.pEditorDocument),o);if(i&&i.parentNode){var r=BX.create("BR",{},e.pLEditor.pEditorDocument);if(i.nextSibling)i.parentNode.insertBefore(r,i.nextSibling);else i.parentNode.appendChild(r)}}else{var a="";if(!e.pLEditor.bBBCode)a='id="'+e.pLEditor.SetBxTag(false,{tag:"code"})+'" ';e.pLEditor.InsertHTML("<br/><pre "+a+'class="lhe-code" title="'+BX.message.CodeDel+'"><br id="lhe_bogus_code_br"/> </pre> <br/>');setTimeout((function(){var t=e.pLEditor.pEditorDocument.getElementById("lhe_bogus_code_br");if(t)e.pLEditor.SelectElement(t)}),100)}},bbHandler:function(e){e.pLEditor.FormatBB({tag:"CODE",pBut:e})},parser:{name:"code",obj:{UnParse:function(e,t,n){if(e.tag=="code")return n.UnParseNodeBB(t);return""}}}};LHEButtons["InsertCut"]={id:"InsertCut",name:BX.message.InsertCut,OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;e.systemCSS+="img.bxed-cut {margin: 2px; width: 100%; height: 12px; background: transparent url("+e.imagePath+"cut.gif) left top repeat-x;}\n";return t},handler:function(e){e.pLEditor.InsertHTML(e.pLEditor.GetCutHTML())},bbHandler:function(e){e.pLEditor.WrapWith("","","[CUT]")},parser:{name:"cut",obj:{Parse:function(e,t,n){return t.replace(/\[CUT\]/gi,n.GetCutHTML())},UnParse:function(e,t,n){if(e.tag=="cut")return"[CUT]";return""}}}};LHEButtons["Translit"]={id:"Translit",name:BX.message.Translit,cmd:"none"};LHEButtons["JustifyLeft"]=LHEButtons["Justify"]={id:"JustifyLeft_L",name:BX.message.ImgAlign+": "+BX.message.JustifyLeft,type:"List",OnAfterCreate:function(e,t){t.arJustifyInd={justifyleft:0,justifycenter:1,justifyright:2,justifyfull:3};t.arJustify=[{id:"JustifyLeft",name:BX.message.JustifyLeft,cmd:"JustifyLeft",bb:"LEFT"},{id:"JustifyCenter",name:BX.message.JustifyCenter,cmd:"JustifyCenter",bb:"CENTER"},{id:"JustifyRight",name:BX.message.JustifyRight,cmd:"JustifyRight",bb:"RIGHT"},{id:"JustifyFull",name:BX.message.JustifyFull,cmd:"JustifyFull",bb:"JUSTIFY"}];var n=t.arJustify.length,o;BX.addClass(t.pValuesCont,"lhe-justify-list");t.pPopupTbl=t.pValuesCont.appendChild(BX.create("TABLE",{props:{className:"lhe-smiles-cont lhe-justify-cont "}}));for(o=0;o<n;o++){t.arJustify[o].pIcon=t.pPopupTbl.insertRow(-1).insertCell(-1).appendChild(BX.create("IMG",{props:{id:"lhe_btn_"+t.arJustify[o].id.toLowerCase(),src:t.pLEditor.oneGif,className:"lhe-button",title:t.arJustify[o].name}}));t.arJustify[o].pIcon.onmouseover=function(){BX.addClass(this,"lhe-tlbr-just-over")};t.arJustify[o].pIcon.onmouseout=function(){BX.removeClass(this,"lhe-tlbr-just-over")};t.arJustify[o].pIcon.onmousedown=function(){if(t.pLEditor.sEditorMode!="code")t.pLEditor.SelectRange(t.pLEditor.oPrevRange);var e=t.arJustifyInd[this.id.substr("lhe_btn_".length)];t.oBut.SetJustify(t.arJustify[e],t)}}},SetJustify:function(e,t){t.pWnd.id="lhe_btn_"+e.id.toLowerCase()+"_l";t.pWnd.title=BX.message.ImgAlign+": "+e.name;t.selected=e;if(t.pLEditor.sEditorMode=="code"&&t.pLEditor.bBBCode)t.pLEditor.FormatBB({tag:e.bb});else if(t.pLEditor.sEditorMode!="code"){t.pLEditor.executeCommand(e.cmd);if(t.pLEditor.bBBCode){setTimeout((function(){var e,n,o=[],i=t.pLEditor.pEditorDocument.getElementsByTagName("DIV"),r=t.pLEditor.pEditorDocument.getElementsByTagName("P");for(e=0;e<i.length;e++)o.push(i[e]);for(e=0;e<r.length;e++)o.push(r[e]);for(e=0;e<o.length;e++){n=o[e];if(n&&n.nodeType==1&&n.childNodes.length>0&&n.getAttribute("align"))n.innerHTML=n.innerHTML.replace(/<span[^>]*?text-align[^>]*?>((?:\s|\S)*?)<\/span>/gi,"$1")}}),100)}}if(t.bOpened)t.Close()},parser:{name:"align",obj:{Parse:function(e,t,n){if(BX.browser.IsIE())t=t.replace(/<span[^>]*?text\-align\:((?:\s|\S)*?);display\:block;[^>]*?>((?:\s|\S)*?)<\/span>/gi,'<p align="$1">$2</p>');if(!n.bBBCode)return t;var o,i,r=["left","right","center","justify"];for(i in r){o=r[i];t=t.replace(new RegExp(BX.util.preg_quote("["+o+"]"),"ig"),'<div align="'+o+'" id="'+n.SetBxTag(false,{tag:"align"})+'">');t=t.replace(new RegExp(BX.util.preg_quote("[/"+o+"]"),"ig"),"</div>")}return t},UnParse:function(e,t,n){if(e.tag=="align"&&(t.arAttributes.align||t.arStyle.textAlign)){var o=t.arStyle.textAlign||t.arAttributes.align;o=o.toUpperCase();var i,r=t.arNodes.length,a="["+o+"]";for(i=0;i<r;i++)a+=n._RecursiveGetHTML(t.arNodes[i]);a+="[/"+o+"]";return a}return""}}}};LHEButtons["InsertOrderedList"]={id:"InsertOrderedList",name:BX.message.OrderedList,cmd:"InsertOrderedList",OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},bbHandler:function(e){e.pLEditor.OpenDialog({id:"List",obj:false,bOrdered:true,bEnterClose:false})}};LHEButtons["InsertUnorderedList"]={id:"InsertUnorderedList",name:BX.message.UnorderedList,cmd:"InsertUnorderedList",OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},bbHandler:function(e){e.pLEditor.OpenDialog({id:"List",obj:false,bOrdered:false,bEnterClose:false})}};LHEButtons["Outdent"]={id:"Outdent",name:BX.message.Outdent,cmd:"Outdent",bBBHide:true};LHEButtons["Indent"]={id:"Indent",name:BX.message.Indent,cmd:"Indent",bBBHide:true};LHEButtons["Video"]={id:"Video",name:BX.message.InsertVideo,name_edit:BX.message.EditVideo,handler:function(e){e.pLEditor.OpenDialog({id:"Video",obj:false})},parser:{name:"video",obj:{Parse:function(sName,sContent,pLEditor){var ReplaceWMV=function(str,b1,b2,b3,b4){var id=b2,JSConfig,w,h,prPath,bgimg="";try{eval("JSConfig = "+b4)}catch(e){JSConfig=false}if(!id||!JSConfig)return"";w=(parseInt(JSConfig.width)||50)+"px";h=(parseInt(JSConfig.height)||25)+"px";if(JSConfig.image)bgimg="background-image: url("+JSConfig.image+")!important; ";return'<img class="bxed-video" id="'+pLEditor.SetBxTag(false,{tag:"video",params:{id:id,JSConfig:JSConfig}})+'" src="'+pLEditor.oneGif+'" style="'+bgimg+" width: "+w+"; height: "+h+';" title="'+BX.message.Video+": "+JSConfig.file+'"/>'};sContent=sContent.replace(/<script.*?silverlight\.js.*?<\/script>\s*?<script.*?wmvplayer\.js.*?<\/script>\s*?<div.*?id\s*?=\s*?("|\')(.*?)\1.*?<\/div>\s*?<script.*?jeroenwijering\.Player\(document\.getElementById\(("|\')\2\3.*?wmvplayer\.xaml.*?({.*?})\).*?<\/script>/gi,ReplaceWMV);var ReplaceFLV=function(e,t){t=t.replace(/[\r\n]+/gi," ");t=t.replace(/\s+/gi," ");t=BX.util.trim(t);var n={},o={},i,r,a,s,l="";t.replace(/([^\w]??)(\w+?)\s*=\s*("|\')([^\3]+?)\3/gi,(function(e,t,o,i,r){o=o.toLowerCase();if(o=="src"||o=="type"||o=="allowscriptaccess"||o=="allowfullscreen"||o=="pluginspage"||o=="wmode")return"";n[o]=r;return t}));if(!n.flashvars||!n.id)return e;n.flashvars+="&";n.flashvars.replace(/(\w+?)=((?:\s|\S)*?)&/gi,(function(e,t,n){o[t]=n;return""}));i=(parseInt(n.width)||50)+"px";r=(parseInt(n.height)||25)+"px";n.flashvars=o;if(o.image)l="background-image: url("+o.image+")!important; ";return'<img class="bxed-video" id="'+pLEditor.SetBxTag(false,{tag:"video",params:n})+'" src="'+pLEditor.oneGif+'" style="'+l+" width: "+i+"; height: "+r+';" title="'+BX.message.Video+": "+n.flashvars.file+'"/>'};sContent=sContent.replace(/<embed((?:\s|\S)*?player\/mediaplayer\/player\.swf(?:\s|\S)*?)(?:>\s*?<\/embed)?(?:\/?)?>/gi,ReplaceFLV);return sContent},UnParse:function(e,t,n){if(!e.params)return"";var o=e.params,i,r;var a=n.arConfig.videoSettings;if(a.maxWidth&&o.width&&parseInt(o.width)>parseInt(a.maxWidth))o.width=a.maxWidth;if(a.maxHeight&&o.height&&parseInt(o.height)>parseInt(a.maxHeight))o.height=a.maxHeight;if(o["flashvars"]){r='<embed src="/bitrix/components/bitrix/player/mediaplayer/player" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" pluginspage="http:/'+'/www.macromedia.com/go/getflashplayer" ';r+='id="'+o.id+'" ';if(a.WMode)r+='WMode="'+a.WMode+'" ';for(i in o){if(i=="flashvars"){if(a.bufferLength)o[i].bufferlength=a.bufferLength;if(a.skin)o[i].skin=a.skin;if(a.logo)o[i].logo=a.logo;r+='flashvars="';for(k in o[i])r+=k+"="+o[i][k]+"&";r=r.substring(0,r.length-1)+'" '}else{r+=i+'="'+o[i]+'" '}}r+="></embed>"}else{r='<script src="/bitrix/components/bitrix/player/wmvplayer/silverlight.js" /><\/script>'+'<script src="/bitrix/components/bitrix/player/wmvplayer/wmvplayer.js"><\/script>'+'<div id="'+o.id+'">WMV Player</div>'+'<script>new jeroenwijering.Player(document.getElementById("'+o.id+'"), "/bitrix/components/bitrix/player/wmvplayer/wmvplayer.xaml", {';if(a.bufferLength)o.JSConfig.bufferlength=a.bufferLength;if(a.logo)o.JSConfig.logo=a.logo;if(a.windowless)o.JSConfig.windowless=a.windowless?true:false;for(i in o.JSConfig)r+=i+': "'+o.JSConfig[i]+'", ';r=r.substring(0,r.length-2);r+="});<\/script>"}return r}}}};LHEButtons["SmileList"]={id:"SmileList",name:BX.message.SmileList,bBBShow:true,type:"List",OnBeforeCreate:function(e,t){if(e.arConfig.arSmiles.length<=0)return false;return t},OnAfterCreate:function(e,t){var n=parseInt(e.arConfig.smileCountInToolbar);if(n>0){var o=e.arConfig.arSmiles,i,r=o.length,a=t.pWnd.parentNode.appendChild(BX.create("TABLE",{props:{className:"lhe-smiles-tlbr-table"}})),s=a.insertRow(-1),l,d,m,u,f=[];t.oSmiles={};for(i=0;i<n;i++){d=o[i];if(typeof d!="object"||!d.path||!d.code)continue;u="smile_"+i+"_"+e.id;m=s.insertCell(-1).appendChild(BX.create("DIV",{props:{className:"lhe-tlbr-smile-cont",title:d.name||"",id:u}}));l=m.appendChild(BX.create("IMG",{props:{src:d.path}}));t.oSmiles[u]=d;m.onmousedown=function(){t.oBut.SetSmile(this.id,t)};m.onmouseover=function(){BX.addClass(this,"lhe-tlbr-smile-over")};m.onmouseout=function(){BX.removeClass(this,"lhe-tlbr-smile-over")};f.push(l)}BX.addClass(t.pWnd,"lhe-tlbr-smile-more");t.pWnd.id="";s.insertCell(-1).appendChild(t.pWnd);a.parentNode.style.width=parseInt(a.offsetWidth)+16+"px";var p=function(){var e,t=f.length;for(e=0;e<t;e++){f[e].removeAttribute("height");f[e].style.height="auto";f[e].style.width="auto"}setTimeout((function(){for(e=0;e<t;e++){var n=f[e].offsetHeight,o=f[e].offsetWidth;if(n>20){f[e].style.height="20px";f[e].height="20";n=20}f[e].style.marginTop=Math.round((20-n)/2)+"px";if(o>20){f[e].parentNode.style.width=f[e].offsetWidth+"px";o=20}f[e].style.marginLeft=Math.round((20-o)/2)+"px";f[e].style.visibility="visible"}a.parentNode.style.width=parseInt(a.offsetWidth)+16+"px"}),10)};BX.addCustomEvent(e,"onShow",(function(){p();setTimeout(p,1e3)}))}},OnCreate:function(e){var t=e.pLEditor.arConfig.arSmiles,n=t.length,o,i,r,a,s,l;if(n<=0)return;e.pValuesCont.style.width="100px";e.oSmiles={};var d=Math.round(Math.sqrt(n*4/3));var m=e.pValuesCont.appendChild(BX.create("TABLE",{props:{className:"lhe-smiles-cont"}}));for(a=0;a<n;a++){s=t[a];if(typeof s!="object"||!s.path||!s.code)continue;l="smile_"+a+"_"+e.pLEditor.id;r=BX.create("DIV",{props:{className:"lhe-smile-cont",title:s.name||"",id:l}});i=r.appendChild(BX.create("IMG",{props:{src:s.path,className:"lhe-smile"}}));i.onerror=function(){var e=this.parentNode;e.parentNode.removeChild(e)};e.oSmiles[l]=s;r.onmousedown=function(){e.oBut.SetSmile(this.id,e)};r.onmouseover=function(){this.className="lhe-smile-cont lhe-smile-cont-over"};r.onmouseout=function(){this.className="lhe-smile-cont"};if(a%d==0)o=m.insertRow(-1);o.insertCell(-1).appendChild(r)}while(o.cells.length<d)o.insertCell(-1);if(m.offsetWidth>0){e.pValuesCont.style.width=m.offsetWidth+2+"px"}else{var u=0;var f=setInterval((function(){if(m.offsetWidth>0){e.pValuesCont.style.width=m.offsetWidth+2+"px";clearInterval(f)}u++;if(u>100){clearInterval(f);e.pValuesCont.style.width="180px"}}),5)}if(i)i.onload=function(){e.pValuesCont.style.width="";setTimeout((function(){e.pValuesCont.style.width=m.offsetWidth+2+"px"}),50)}},SetSmile:function(e,t){var n=t.oSmiles[e];if(t.pLEditor.sEditorMode=="code")t.pLEditor.WrapWith(false,false,n.code);else t.pLEditor.InsertHTML('<img id="'+t.pLEditor.SetBxTag(false,{tag:"smile",params:n})+'" src="'+n.path+'" title="'+n.name+'"/>');if(t.bOpened)t.Close()},parser:{name:"smile",obj:{Parse:function(e,t,n){if(n.sortedSmiles){var o=[];t=t.replace(/\<(?:\s|\S)*?>/gi,(function(e){o.push(e);return"#BXTAG"+(o.length-1)+"#"}));var i,r=n.sortedSmiles.length,a;for(i=0;i<r;i++){a=n.sortedSmiles[i];if(a.path&&a.code)t=t.replace(new RegExp(BX.util.preg_quote(a.code),"ig"),'<img id="'+n.SetBxTag(false,{tag:"smile",params:a})+'" src="'+a.path+'" title="'+a.name+'"/>')}if(o.length>0)t=t.replace(/#BXTAG(\d+)#/gi,(function(e,t){return o[t]||e}))}return t},UnParse:function(e,t,n){if(!e.params||!e.params.code)return"";return e.params.code}}}};LHEButtons["HeaderList"]={id:"HeaderList",name:BX.message.HeaderList,bBBHide:true,type:"List",handler:function(){},OnCreate:function(e){var t,n,o,i;e.arItems=[{value:"p",name:BX.message.Normal},{value:"h1",name:BX.message.Heading+" 1"},{value:"h2",name:BX.message.Heading+" 2"},{value:"h3",name:BX.message.Heading+" 3"},{value:"h4",name:BX.message.Heading+" 4"},{value:"h5",name:BX.message.Heading+" 5"},{value:"h6",name:BX.message.Heading+" 6"},{value:"pre",name:BX.message.Preformatted}];var r=BX.create("DIV",{props:{className:"lhe-header-innercont"}});for(o=0;o<e.arItems.length;o++){i=e.arItems[o];if(typeof i!="object"||!i.name)continue;n=BX.create("DIV",{props:{className:"lhe-header-cont",title:i.name,id:"lhe_header__"+o}});n.appendChild(BX.create(i.value.toUpperCase(),{text:i.name}));n.onmousedown=function(){e.oBut.Select(e.arItems[this.id.substring("lhe_header__".length)],e)};n.onmouseover=function(){this.className="lhe-header-cont lhe-header-cont-over"};n.onmouseout=function(){this.className="lhe-header-cont"};i.pWnd=r.appendChild(n)}e.pValuesCont.appendChild(r)},OnOpen:function(e){var t=e.pLEditor.queryCommand("FormatBlock"),n,o;if(e.pSelectedItemId>=0)e.SelectItem(false);if(!t)t="p";for(n=0;n<e.arItems.length;n++){o=e.arItems[n];if(o.value==t){e.pSelectedItemId=n;e.SelectItem(true)}}},Select:function(e,t){t.pLEditor.SelectRange(t.pLEditor.oPrevRange);t.pLEditor.executeCommand("FormatBlock","<"+e.value+">");t.Close()}};LHEButtons["FontList"]={id:"FontList",name:BX.message.FontList,type:"List",handler:function(){},OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},OnCreate:function(e){var t,n,o,i,r;e.arItems=[];for(o in e.pLEditor.arConfig.arFonts){r=e.pLEditor.arConfig.arFonts[o];if(typeof r=="string")e.arItems.push({value:r,name:r})}for(o=0;o<e.arItems.length;o++){i=e.arItems[o];if(typeof i!="object"||!i.name)continue;n=BX.create("DIV",{props:{className:"lhe-list-item-cont",title:i.name,id:"lhe_font__"+o}});n.appendChild(BX.create("SPAN",{props:{className:"lhe-list-font-span"},style:{fontFamily:i.value},text:i.name}));n.onmousedown=function(){e.oBut.Select(e.arItems[this.id.substring("lhe_font__".length)],e)};n.onmouseover=function(){this.className="lhe-list-item-cont lhe-list-item-cont-over"};n.onmouseout=function(){this.className="lhe-list-item-cont"};i.pWnd=e.pValuesCont.appendChild(n)}},OnOpen:function(e){var t=e.pLEditor.queryCommand("FontName"),n,o;if(e.pSelectedItemId>=0)e.SelectItem(false);if(!t)t="p";for(n=0;n<e.arItems.length;n++){o=e.arItems[n];if(o.value.toLowerCase()==t.toLowerCase()){e.pSelectedItemId=n;e.SelectItem(true)}}},Select:function(e,t){t.pLEditor.RestoreSelectionRange();if(t.pLEditor.sEditorMode=="code"){if(t.pLEditor.bBBCode)t.pLEditor.FormatBB({tag:"FONT",pBut:t,value:e.value})}else{t.pLEditor.executeCommand("FontName",e.value)}t.Close()}};LHEButtons["FontSizeList"]={id:"FontSizeList",name:BX.message.FontSizeList,type:"List",handler:function(){},OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},OnCreate:function(e){var t,n,o,i,r;e.arItems=[];for(o in e.pLEditor.arConfig.arFontSizes){r=e.pLEditor.arConfig.arFontSizes[o];if(typeof r=="string")e.arItems.push({value:parseInt(o),name:r})}for(o=0;o<e.arItems.length;o++){i=e.arItems[o];if(typeof i!="object"||!i.name)continue;n=BX.create("DIV",{props:{className:"lhe-list-item-cont",title:i.name,id:"lhe_font_size__"+o}});n.appendChild(BX.create("SPAN",{props:{className:"lhe-list-font-span"},style:{fontSize:i.name},text:i.name}));if(BX.browser.IsIE()&&!BX.browser.IsDoctype())n.style.width="200px";n.onmousedown=function(){e.oBut.Select(e.arItems[this.id.substring("lhe_font_size__".length)],e)};n.onmouseover=function(){this.className="lhe-list-item-cont lhe-list-item-cont-over"};n.onmouseout=function(){this.className="lhe-list-item-cont"};i.pWnd=e.pValuesCont.appendChild(n)}},OnOpen:function(e){var t=e.pLEditor.queryCommand("FontSize"),n,o;if(e.pSelectedItemId>=0)e.SelectItem(false);if(!t)t="p";t=t.toString().toLowerCase();for(n=0;n<e.arItems.length;n++){o=e.arItems[n];if(o.value.toString().toLowerCase()==t){e.pSelectedItemId=n;e.SelectItem(true)}}},Select:function(e,t){t.pLEditor.RestoreSelectionRange();if(t.pLEditor.sEditorMode=="code"){if(t.pLEditor.bBBCode)t.pLEditor.FormatBB({tag:"SIZE",pBut:t,value:e.value})}else{t.pLEditor.executeCommand("FontSize",e.value)}t.Close()}};LHEButtons["BackColor"]={id:"BackColor",name:BX.message.BackColor,bBBHide:true,type:"Colorpicker",OnSelect:function(e,t){if(BX.browser.IsIE()){t.pLEditor.executeCommand("BackColor",e||"")}else{try{t.pLEditor.pEditorDocument.execCommand("styleWithCSS",false,true);if(!e)t.pLEditor.executeCommand("removeFormat");else t.pLEditor.executeCommand("hilitecolor",e);t.pLEditor.pEditorDocument.execCommand("styleWithCSS",false,false)}catch(e){}}}};LHEButtons["ForeColor"]={id:"ForeColor",name:BX.message.ForeColor,type:"Colorpicker",OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},OnSelect:function(e,t){if(t.pLEditor.sEditorMode=="code"){if(t.pLEditor.bBBCode)t.pLEditor.FormatBB({tag:"COLOR",pBut:t,value:e})}else{if(!e&&!BX.browser.IsIE())t.pLEditor.executeCommand("removeFormat");else t.pLEditor.executeCommand("ForeColor",e||"")}}};LHEButtons["Table"]={id:"table",name:BX.message.InsertTable,OnBeforeCreate:function(e,t){t.disableOnCodeView=!e.bBBCode||e.arConfig.bConvertContentFromBBCodes;return t},handler:function(e){e.pLEditor.OpenDialog({id:"Table"})}};var LHEContMenu={};LHEContMenu["A"]=[LHEButtons["CreateLink"],LHEButtons["DeleteLink"]];LHEContMenu["IMG"]=[LHEButtons["Image"]];LHEContMenu["VIDEO"]=[LHEButtons["Video"]]; //# sourceMappingURL=le_toolbarbuttons.map.js