/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.5.2
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2019 MH Sub I, LLC dba vBulletin. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache.push("error_fetching_avatar","insert_video","retrieve_remote_file_and_ref_local","insert_page_break","insert_preview_break","wrap_x_tags");window.vBulletin.options=window.vBulletin.options||{};window.vBulletin.options.precache=window.vBulletin.options.precache||[];window.vBulletin.options.precache=$.merge(window.vBulletin.options.precache,["maxuserlength","minuserlength","threadpreview","userbbcodeavatar"]);vBulletin.ckeditor=vBulletin.ckeditor||{};CKEDITOR.config.allowedContent=true;CKEDITOR.config.baseHref=pageData.baseurl+"/";if(typeof pageData.ckeditorCss!="undefined"){if(typeof pageData.ckeditorCss=="string"){pageData.ckeditorCss=[pageData.ckeditorCss]}if(!$.isArray(CKEDITOR.config.contentsCss)){CKEDITOR.config.contentsCss=[]}$.each(pageData.ckeditorCss,function(A,B){if(vBulletin.isAbsoluteUrl(B)){CKEDITOR.config.contentsCss.push(B)}else{CKEDITOR.config.contentsCss.push(CKEDITOR.config.baseHref+B)}})}CKEDITOR.config.toolbar_vBulletinFull=(function(){var D=[["EnhancedSource","Source","RemoveFormat","PasteText","PasteFromWord"],["Font","FontSize"],["TextColor","-","Undo","Redo"],["Bold","Italic","Underline"],["JustifyLeft","JustifyCenter","JustifyRight"],["NumberedList","BulletedList","Outdent","Indent"],["Link","Email","Unlink","Image","Video"],["Quote"],["Code","Html","Php"],["Table","vBTable"],["Subscript","Superscript","HorizontalRule"]];if(window.pageData&&window.pageData.channelType&&window.pageData.channelType=="article"){D.push(["PageBreak","PreviewBreak"])}if(jQuery.type(window.vBulletin.customBbcode)!=="undefined"){var B=[];for(var A in window.vBulletin.customBbcode){if(!A){continue}var C=window.vBulletin.customBbcode[A];B.push(C.title)}if(B.length>0){D[D.length]=B}}return D})();var CK2BB={Font:"font",FontSize:"size",TextColor:"color",Bold:"b",Italic:"i",Underline:"u",Subscript:"sub",Superscript:"sup",HorizontalRule:"hr",Table:"table",TableProperties:"table",DeleteTable:"table",InsertRowBefore:"table",InsertRowAfter:"table",DeleteRow:"table",InsertColumnBefore:"table",InsertColumnAfter:"table",DeleteColumn:"table",JustifyLeft:"left",JustifyCenter:"center",JustifyRight:"right",NumberedList:"list",BulletedList:"list",Outdent:"indent",Indent:"indent",Link:"url",Email:"email",Unlink:"url",Image:"img",Quote:"quote",Code:"code",Html:"html",Php:"php"};CKEDITOR.config.smiley_path=pageData.baseurl_core+"/";CKEDITOR.config.enterMode=CKEDITOR.ENTER_BR;CKEDITOR.config.entities=false;CKEDITOR.config.height=70;CKEDITOR.config.width="100%";CKEDITOR.config.autoGrow_minHeight=70;CKEDITOR.config.autoGrow_maxHeight=800;CKEDITOR.config.autoGrow_viewportLimit=true;CKEDITOR.config.image2_alignClasses=["align_left","align_center","align_right"];if(typeof vBulletin.contentEntryBox=="undefined"||typeof vBulletin.contentEntryBox.image2_showuploadcheckbox=="undefined"){CKEDITOR.config.image2_showuploadcheckbox=false;CKEDITOR.config.image2_checkuploadbydefault=false}else{CKEDITOR.config.image2_showuploadcheckbox=vBulletin.contentEntryBox.image2_showuploadcheckbox;CKEDITOR.config.image2_checkuploadbydefault=CKEDITOR.config.image2_showuploadcheckbox}CKEDITOR.config.contentsLangDirection=pageData.textdirection;CKEDITOR.config.language="en";CKEDITOR.config.defaultLanguage="en";CKEDITOR.config.language_list=["en"];CKEDITOR.config.skin="moono";vBulletin.ckeditor.config={toolbar:"vBulletinFull",customConfig:"",toolbarCanCollapse:false,resize_dir:"vertical",removePlugins:"about,contextmenu,elementspath,link,smiley,liststyle,sourcearea,scayt",extraPlugins:"vblink,vbwrapbuttons,vbsource,videotag,autosave,autogrow,vbtable,resize,lineutils,widget,image2",pluginPath:pageData.baseurl+"/js/ckeplugins/",tabIndex:0,disableNativeSpellChecker:false,filebrowserImageUploadUrl:pageData.baseurl+"/uploader/CKEditorInsertImage"};(function(){var A=vBulletin.ckeditor.config.extraPlugins.split(",");for(var B=0;B<A.length;B++){try{if(!CKEDITOR.plugins.get(A[B])){console.log("Ckeditor: Plugin Loaded: "+pageData.baseurl+"/js/ckeplugins/"+A[B]+"/plugin.js");CKEDITOR.plugins.addExternal(A[B],vBulletin.ckeditor.config.pluginPath+A[B]+"/","plugin.js")}}catch(C){console.warn("Ckeditor: Plugin failed to load: "+pageData.baseurl+"/js/ckeplugins/"+A[B]+"/plugin.js")}}})();(function(){var A=CKEDITOR.dom.element.createFromHtml;CKEDITOR.dom.element.createFromHtml=function(){var B=A.apply(this,arguments);if(arguments.length>0&&arguments[0].match(/<iframe /)){B.on("load",function(D){var C=$(D.data.$.target);if(C.is(".cke_pasteframe")){vBulletin.ckeditor.addEditorCssToIframe(C)}})}return B}})();vBulletin.ckeditor.instances={};vBulletin.ckeditor.imageSettings=["imgAlignment","imgSize","imgTitle","imgDescription","imgStyles","imgLink","imgLinkURL","imgLinkTarget",];vBulletin.ckeditor.initFocus=function(B,A){if($("#"+B).is(".js-ckeditor-init-on-focus")||$("#"+B).is(".js-ckeditor-focus-editor-after-init")){A.focus();console.log("Ckeditor: Focus on editor for editor: {0}".format(B))}};vBulletin.ckeditor._isEmptyData=function(A){A=A+"";if(A.length>1000){return false}if(A.match(/<(table|ol|ul|li|img|hr)/)||A.match(/<(div|ol|ul|li|img) style="(margin-left|margin-right|text-align)/)){return false}if(A.match(/<h3\s+class="wysiwyg_pagebreak">/)){return false}A=$("<div />").append(A).text();A=$.trim(A).replace(/&nbsp;|\s|\n|\t/g,"");return !A};vBulletin.ckeditor.initPlaceholder=function(D,C){var E=$("#"+D),J=E.attr("placeholder");C=C||vBulletin.ckeditor.getEditor(D);console.log("Ckeditor: Initializing placeholder text");if(!J){console.warn("Ckeditor: Placeholder text: No placeholder text");return }var H=function(L){var M=E.closest(".b-editor").find(".cke_contents"),K=M.find(".b-editor__placeholder");if(K.length==0){K=$("<div />").text(J).addClass("b-editor__placeholder h-hide placeholder").appendTo(M)}return K};var B=function(K){return K.document?K.document.getBody():null};var F=function(K){if(K&&K.$&&!K.hasClass("js-vbulletin-has-placeholder-events")){console.log("Ckeditor: Placeholder text: attachBodyEventHandlers");K.on("keydown",I);K.on("drop",I);K.addClass("js-vbulletin-has-placeholder-events")}};var A=true;var I=function(K){window.setTimeout(function(){var L=B(C),N=H(D);if(L&&L.$){F(L);var O=vBulletin.ckeditor._isEmptyData(L.getHtml());N.toggleClass("h-hide",!O);if(A&&!O){var M=E.closest(".js-content-entry");M.find(".js-contententry-buttons").removeClass("h-hide");vBulletin.hv.show(M.find(".js-human-verification"));A=false}}},10)};C.on("saveSnapshot",I);C.on("afterCommandExec",I);C.on("afterSetData",I);var G=function(K){if(K.editor.mode!="source"){I()}};C.on("mode",G);I()};vBulletin.ckeditor.initToolbarCloseButton=function(B,A){var E=$("#"+B),D=E.closest(".b-editor");var C=$("<span />").addClass("b-icon b-icon__x-circle--dark js-link js-contententry-panel-x h-margin-right-m h-margin-top-m js-ckeditor-toolbar-close").attr("tabindex","0").text("x").appendTo(D)};vBulletin.ckeditor.modifyDialogs=function(C,A){var B=vBulletin.ckeditor.getEditor(C);CKEDITOR.on("dialogDefinition",function(G){var H=G.data.name;var J=G.data.definition;switch(H){case"image":J.removeContents("advanced");J.removeContents("Link");var F=J.getContents("info");F.remove("remote");F.remove("txtWidth");F.remove("txtHeight");F.remove("txtBorder");F.remove("txtAlt");F.remove("ratioLock");F.remove("txtHSpace");F.remove("txtVSpace");F.remove("cmbAlign");for(var E=0;E<vBulletin.ckeditor.imageSettings.length;E++){F.remove(vBulletin.ckeditor.imageSettings[E])}F.add({type:"radio",id:"imgAlignment",label:B.lang.common.align,items:[[B.lang.vbulletin.none,"none"],[B.lang.common.alignLeft,"left"],[B.lang.common.alignCenter,"center"],[B.lang.common.alignRight,"right"]],"default":"none",});F.add({type:"radio",id:"imgSize",label:B.lang.vbulletin.size,items:[[B.lang.vbulletin.icon,"icon"],[B.lang.vbulletin.thumbnail,"thumb"],[B.lang.vbulletin.small,"small"],[B.lang.vbulletin.medium,"medium"],[B.lang.vbulletin.large,"large"],[B.lang.vbulletin.fullsize,"full"]],"default":"full",});F.add({type:"text",id:"imgTitle",label:B.lang.vbulletin.title,});F.add({type:"textarea",id:"imgDescription",label:B.lang.vbulletin.description,});F.add({type:"text",id:"imgStyles",label:B.lang.vbulletin.style,});F.add({type:"radio",id:"imgLink",label:B.lang.vbulletin.linktype,items:[[B.lang.vbulletin["default"],"0"],[B.lang.common.url,"1"],[B.lang.vbulletin.none,"2"]],"default":"0",onChange:function(){var K=this.getDialog();var L=K.getContentElement("info","imgLink");var N=K.getContentElement("info","imgLinkURL");var M=K.getContentElement("info","imgLinkTarget");if(L.isEnabled()&&L.getValue()==1){N.enable();M.enable()}else{N.disable();M.disable()}},});F.add({type:"text",id:"imgLinkURL",label:B.lang.vbulletin.linkurl,onShow:function(){var K=this.getDialog();var L=K.getContentElement("info","imgLink");if(L.isEnabled()&&L.getValue()==1){this.enable()}else{this.disable()}},});F.add({type:"select",id:"imgLinkTarget",label:B.lang.vbulletin.linktarget,items:[[B.lang.common.targetSelf,"0"],[B.lang.common.targetNew,"1"]],"default":"0",onShow:function(){var K=this.getDialog();var L=K.getContentElement("info","imgLink");if(L.isEnabled()&&L.getValue()==1){this.enable()}else{this.disable()}},});F.add({type:"checkbox",id:"remote",label:vBulletin.phrase.get("retrieve_remote_file_and_ref_local"),validate:function(){if(this.getValue()){var M=this.getDialog();var L=M.getContentElement("info","txtUrl");var K=L.getValue();if(!K){return true}M.disableButton("ok");M.disableButton("cancel");var O=false;var N=this;vBulletin.AJAX({async:false,url:vBulletin.getAjaxBaseurl()+"/uploader/url",data:{urlupload:K,attachment:1},skipdefaultsuccess:true,success:function(P){if(P.errors){var Q=P.errors;if($.isArray(Q)&&Q.length>0){Q=Q[0]}alert(vBulletin.phrase.get("error_x",vBulletin.phrase.get(Q)))}else{if(P.imageUrl){var R={url:P.imageUrl,filedataid:P.filedataid,name:P.filename,};vBulletin.ckeditor.closeFileDialog(C,new Array(R));O=true}}},fail:function(Q){var R=vBulletin.phrase.get("error_uploading_image");var P="error";if(Q&&Q.files.length>0){switch(Q.files[0].error){case"acceptFileTypes":R=vBulletin.phrase.get("invalid_image_allowed_filetypes_are");P="warning";break}}alert(R)},complete:function(){M.enableButton("ok");M.enableButton("cancel")}});return O}}});var I=J.onOk;J.onOk=function(M){var L=this.getContentElement("info","remote");if(L&&L.getValue()){}else{var K=this.getContentElement("info","txtUrl").getValue();vBulletin.ckeditor.autogrowEditorOnImageLoad(K,B);I.apply(this,M)}};break;case"image2":break;default:}});function D(H){if(!H){return false}var G=pageData.baseurl+"/filedata/fetch?",E="filedata/fetch?",F="/filedata/fetch?";return(H.indexOf(E)==0||H.indexOf(F)==0||H.indexOf(G)!==-1)}B.on("dialogShow",function(V){var S=V.data;var L=S.getName();switch(L){case"image":var P=B.getSelection(),I=P&&P.getSelectedElement(),N=I&&B.elementPath(I).contains("a",1);S.getContentElement("info","htmlPreview").getElement().hide();var F=I&&I.getAttribute("src"),T=F&&D(F)||false;showDefaultImageBits=function(){S.showPage("Upload");for(var X=0;X<vBulletin.ckeditor.imageSettings.length;X++){imgSettingElement=S.getContentElement("info",vBulletin.ckeditor.imageSettings[X]);if(imgSettingElement){imgSettingElement.getElement().hide()}}S.getContentElement("info","remote").getElement().show();S.getContentElement("info","txtUrl").getElement().show()};if(I&&I.getName()=="img"&&T){var O=I.getAttribute("data-tempid"),H=I.getAttribute("data-attachmentid"),E=O||H,M=false;if(!E){var J=/(\?|&)filedataid=(\d+)/,G=J.exec(F),Q=G&&G[2];if(!Q){J=/(\?|&)([A-Za-z]*id)=(\d+)/;G=J.exec(F);if(G){vBulletin.AJAX({async:false,url:vBulletin.getAjaxBaseurl()+"/uploader/fetchfiledataid",data:{idname:G[2],id:G[3]},success:function(X){if(X.filedataid){Q=X.filedataid}},})}}E=Q&&vBulletin.ckeditor.generateTempAttachmentId(Q);M=Q&&true}if(E){S.hidePage("Upload");for(var R=0;R<vBulletin.ckeditor.imageSettings.length;R++){imgSettingElement=S.getContentElement("info",vBulletin.ckeditor.imageSettings[R]);if(imgSettingElement){imgSettingElement.getElement().show()}}S.getContentElement("info","remote").getElement().hide();S.getContentElement("info","txtUrl").getElement().hide();for(var R=0;R<vBulletin.ckeditor.imageSettings.length;R++){cleanId=vBulletin.ckeditor.imageSettings[R].substring(3).toLowerCase();attributeName="data-"+cleanId;fieldValue=I.getAttribute(attributeName);if(fieldValue){S.getContentElement("info",vBulletin.ckeditor.imageSettings[R]).setValue(fieldValue)}}var K=S.on("ok",function(){var X=$("#"+C).closest("form"),c={},Z=false;for(var Y=0;Y<vBulletin.ckeditor.imageSettings.length;Y++){fieldElement=S.getContentElement("info",vBulletin.ckeditor.imageSettings[Y]);fieldValue=fieldElement&&fieldElement.isEnabled()&&fieldElement.getValue();cleanId=vBulletin.ckeditor.imageSettings[Y].substring(3).toLowerCase();attributeName="data-"+cleanId;hiddenInputName="setting["+E+"]["+cleanId+"]";if(fieldValue){I.setAttribute(attributeName,fieldValue);if(H){c[cleanId]=fieldValue}else{$('input[type="hidden"][name="'+hiddenInputName+'"]').remove();$parent=X.find('input[name="filedataids['+E+']"]').parent();if(!$parent||$parent.length==0){$parent=X}$parent.append($("<input />").attr({type:"hidden",name:hiddenInputName}).val(fieldValue));Z=true}}else{I.removeAttribute(attributeName);if(H){}else{$('input[type="hidden"][name="'+hiddenInputName+'"]').remove()}}switch(cleanId){case"size":newImgSrc=F.replace(/&type=[A-Za-z]+/,"")+"&type="+fieldValue;I.setAttribute("src",newImgSrc);break;case"alignment":I.removeClass("align_left");I.removeClass("align_center");I.removeClass("align_right");if(fieldValue!=="none"){I.addClass("align_"+fieldValue)}break;case"title":break;default:break}}if(Z&&M){vBulletin.ckeditor.insertImageAttachment(C,Q,"",E);var a=/(\?|&)[A-Za-z]*id=\d+/,b=a.exec(F);I.setAttribute("src",I.getAttribute("src").replace(b[0],"?filedataid="+Q));if(I.getAttribute("data-cke-saved-src")){I.setAttribute("data-cke-saved-src",I.getAttribute("data-cke-saved-src").replace(b[0],"?filedataid="+Q))}I.setAttribute("data-tempid",E);I.setAttribute("data-tempid",E);I.addClass("bbcode-attachment")}if(H){c.attachmentid=H;vBulletin.AJAX({url:vBulletin.getAjaxBaseurl()+"/uploader/saveattachmentsetting",data:c,success:function(d){if(d.success){console.log("/uploader/saveattachmentsetting Success!")}else{}},})}});S.on("hide",function(){K.removeListener()})}else{showDefaultImageBits()}}else{showDefaultImageBits()}var U=($(window).height()-S.getSize().height)/2,W=($(window).width()-S.getSize().width)/2;if(U<0){U=0}S.move(W,(U-1));S.move(W,U,true);S.on("selectPage",function(Y){var X=Y.data.page;switch(X){case"Upload":var Z=$(S.getElement().$).find("iframe.cke_dialog_ui_input_file").contents().find("form");if(Z.find('input[name="securitytoken"]').length){Z.find('input[name="securitytoken"]').val(pageData.securitytoken)}else{Z.append('<input type="hidden" name="securitytoken" value="'+pageData.securitytoken+'" />')}break}});break;default:}})};vBulletin.ckeditor.killImageFloat=function(C,A){var B=vBulletin.ckeditor.getEditor(C);var D=B.getCommand("justifyright");$.each(D._.events.exec.listeners,function(E,F){D.removeListener("exec",F.fn)});$.each(D._.events.refresh.listeners,function(E,F){D.removeListener("refresh",F.fn)});var D=B.getCommand("justifyleft");$.each(D._.events.exec.listeners,function(E,F){D.removeListener("exec",F.fn)});$.each(D._.events.refresh.listeners,function(E,F){D.removeListener("refresh",F.fn)});var D=B.getCommand("justifycenter");$.each(D._.events.refresh.listeners,function(E,F){D.removeListener("refresh",F.fn)})};vBulletin.ckeditor.modifyMagicline=function(B,A){try{A.plugins.magicline.backdoor.that.triggers.h3=1;console.log("Ckeditor: Added h3 to ckeditor magicline triggers.")}catch(C){console.warn("Ckeditor: Unable to add h3 to ckeditor magicline triggers. Error: {0}".format(C))}};vBulletin.ckeditor.verifyEditorCss=function(C,B,F,G,H,J){function E(L){if(L&&L.document&&L.document.$&&L.document.$.defaultView&&L.document.$.defaultView.frameElement){return L.document.$.defaultView.frameElement.contentDocument||L.document.$.defaultView.frameElement.contentWindow.document}return false}function K(S,O){if(!S){return -1}var N,M,R,Q=false;function L(T){return(T+"").replace(/&amp;/g,"&")}for(N=0;N<S.styleSheets.length;++N){try{$.each(CKEDITOR.config.contentsCss,function(T,U){if(L(S.styleSheets[N].href)==L(U)){Q=true}});R=S.styleSheets[N].cssRules;for(M=0;M<R.length;++M){if(R[M].selectorText==O){return 1}}}catch(P){}}return Q?0:-1}function D(){++I;if(F>0&&K(A,H)==0){--F;window.setTimeout(D,G)}else{J.apply(B,[C,B]);console.log("Ckeditor: Init: verifyEditorCss: checkCss called {0} times".format(I))}}var A=E(B),I=0;D()};vBulletin.ckeditor.initSmilies=function(B,A){A.on("mode",function(C){if(C.editor.mode=="source"){$("#"+B).closest(".js-content-entry").find(".js-smilie-container .js-smilie-button").addClass("b-smilie__button--disabled")}else{$("#"+B).closest(".js-content-entry").find(".js-smilie-container .js-smilie-button").removeClass("b-smilie__button--disabled")}})};vBulletin.ckeditor.initHandleEditorFocus=function(B,A){A.on("focus",function(D){var C=$("#"+B).closest(".js-content-entry");C.find(".js-contententry-buttons").removeClass("h-hide");vBulletin.hv.show(C.find(".js-human-verification"))})};vBulletin.ckeditor.initHandleEditorBlur=function(B,A){A.on("blur",function(C){(function(){var D=$("#"+B).closest(".js-content-entry"),E=vBulletin.ckeditor.getEditorContent(B);vBulletin.contentEntryBox.populateMetaDescription(E,D)})()})};vBulletin.ckeditor.isEditorEmpty=function(A){var B=vBulletin.ckeditor.getEditorContent(A);if(B===false||B===""){return true}return vBulletin.ckeditor._isEmptyData(B)};vBulletin.ckeditor.resetEditor=function(B,C){B=vBulletin.ckeditor.verifyEditorId(B);C=C||function(){};var A=vBulletin.ckeditor.getEditor(B);if(!A){return false}A.setData("",C)};vBulletin.ckeditor.maintainContent=function(B,A){};vBulletin.ckeditor.convertToAdvancedEditor=function(A){};vBulletin.ckeditor.convertToBasicEditor=function(A){};vBulletin.ckeditor.toggleAdvancedAndBasicEditor=function(B,A){};vBulletin.ckeditor.toggleToolbar=function(B,C){var D=$(B);if(typeof C=="undefined"){D.closest(".b-editor").toggleClass("b-editor--cke-toolbar-is-hidden")}else{D.closest(".b-editor").toggleClass("b-editor--cke-toolbar-is-hidden",!C)}var A=!D.closest(".b-editor").hasClass("b-editor--cke-toolbar-is-hidden");D.closest(".js-content-entry").find(".js-toolbar-secondary .b-toolbar__item").filter(function(){return($(this).data("panel")=="b-content-entry-panel__content--toggle-editor")}).toggleClass("b-toolbar__item--active",A)};vBulletin.ckeditor.doInitEditor=function(A,I){if(CKEDITOR.env.mobile&&!CKEDITOR.env.isCompatible){console.log("Ckeditor: Not supported on this mobile device");vBulletin.ckeditor.hideLoadingDialog(A);return }console.log("Ckeditor: Initializing editor: {0}".format(A));var F=$("#"+A);F.trigger("beforeInit",[A]);if(vBulletin.ckeditor.editorExists(A)){console.log("The editor ({0}) already exists.".format(A));return }if(F.is(":visible")&&F.val()==""){F.val(" ")}var D=F.data("disable-features");if(D){if(D=="all"){console.log("Ckeditor: Disabling features: All");vBulletin.ckeditor.config.toolbar=[]}else{D=D.split(",");var C=CKEDITOR.config["toolbar_"+vBulletin.ckeditor.config.toolbar];var H,E,B,G;for(E=0;E<C.length;E++){for(B=0;B<C[E].length;B++){H=C[E][B];if(H.length==0||H=="-"||!CK2BB[H]){continue}if(jQuery.inArray(CK2BB[H],D)>=0){console.log("Ckeditor: Disabling feature: "+H);delete C[E][B]}}}for(E=0;E<C.length;E++){C[E]=C[E].filter(function(J){return J})}}}vBulletin.ckeditor.toggleToolbar(F,false);F.ckeditor(function(){vBulletin.ckeditor.hideLoadingDialog(A);vBulletin.ckeditor.instances[A]=this;vBulletin.ckeditor.initPlaceholder(A,this);vBulletin.ckeditor.initHandleEditorFocus(A,this);vBulletin.ckeditor.initHandleEditorBlur(A,this);vBulletin.ckeditor.initFocus(A,this);vBulletin.ckeditor.initToolbarCloseButton(A,this);vBulletin.ckeditor.initSmilies(A,this);vBulletin.ckeditor.killImageFloat(A,this);vBulletin.ckeditor.modifyDialogs(A,this);vBulletin.ckeditor.modifyMagicline(A,this);console.log("Ckeditor: Editor initialized: {0}".format(A));if(F.closest("form").length>0){F.closest("form").attr("ck-editorid",A);console.log('Ckeditor: Added editorId "'+A+'" to form')}var J=F.data("disable-resize");if(J){vBulletin.ckeditor.disableResizeAndAutogrow(A,this)}vBulletin.contentEntryBox.restoreEditorState(A);vBulletin.ckeditor.verifyEditorCss(A,this,10,100,"hr.previewbreak",function(L,K){F.trigger("afterInit",[L]);vBulletin.ckeditor.fireCallbacks(L,I,"success",this)})},vBulletin.ckeditor.config)};vBulletin.ckeditor.editorExists=function(A){A=vBulletin.ckeditor.verifyEditorId(A);return(typeof vBulletin.ckeditor.instances[A]!="undefined"&&vBulletin.ckeditor.instances[A])};vBulletin.ckeditor.getEditor=function(A){A=vBulletin.ckeditor.verifyEditorId(A);return vBulletin.ckeditor.editorExists(A)?vBulletin.ckeditor.instances[A]:null};vBulletin.ckeditor.closeFileDialog=function(E,J){var G=vBulletin.ckeditor.getEditor(E);if(G){var H=CKEDITOR.dialog.getCurrent();if(H.getName()=="image"){for(var F=0;F<J.length;F++){var C=J[F]["url"],A=J[F]["filedataid"],B=J[F]["name"],I=vBulletin.ckeditor.generateTempAttachmentId(A);if(A&&C){vBulletin.ckeditor.autogrowEditorOnImageLoad(C,G);var D=CKEDITOR.dom.element.createFromHtml('<img class="bbcode-attachment" src="'+C+'" data-tempid="'+I+'" />');if(B){D.setAttribute("data-title",B)}G.insertElement(D);vBulletin.ckeditor.insertImageAttachment(E,A,B,I)}}H.hide()}else{if(H.getName()=="image2"){for(var F=0;F<J.length;F++){var C=J[F]["url"],A=J[F]["filedataid"],B=J[F]["name"],I=vBulletin.ckeditor.generateTempAttachmentId(A);if(A&&C&&I){vBulletin.ckeditor.autogrowEditorOnImageLoad(C,G);H.widget.setData("tempid",I);if(B!=""&&H.getValueOf("info","title")==""){H.widget.setData("title",B);H.setValueOf("info","title",B)}if(typeof H.checkUrlSrcAndRemoteCheckbox=="function"){H.checkUrlSrcAndRemoteCheckbox()}vBulletin.ckeditor.insertImageAttachment(E,A,B,I,true)}}}}}};vBulletin.ckeditor.insertImageAttachment=function(D,E,F,A,C){var B=$("#"+D).closest("form");F=F||"";A=A||"";filedataObj={filedataid:E,filename:F,};if(!C){filedataObj.imagesize="full"}vBulletin.contentEntryBox.addAttachmentItemPanel(B,A,filedataObj)};vBulletin.ckeditor.destroyEditor=function(A){console.log("Ckeditor: Destroying editor: {0}".format(A));A=vBulletin.ckeditor.verifyEditorId(A);if(vBulletin.ckeditor.editorExists(A)){try{vBulletin.ckeditor.getEditor(A).destroy()}catch(B){}vBulletin.ckeditor.instances[A]=null;vBulletin.ckeditor.toggleToolbar($("#"+A),false);return true}else{console.warn("Ckeditor: Not destroyed, because editor {0} does not exist.".format(A))}return false};vBulletin.ckeditor.generateTempAttachmentId=function(C){var B=Math.floor(Math.random()*1000),A=(new Date()).getTime();return"temp_"+C+"_"+A+"_"+B};vBulletin.ckeditor.swapLanguage=function(A){A.editor.on("langLoaded",function(D){var C=($("#debug-information").length==1);CKEDITOR.vBulletin=CKEDITOR.vBulletin||{};if(typeof (CKEDITOR.vBulletin.langInit)=="undefined"&&typeof (window.vBulletin.ckeditorPhrases)!="undefined"){CKEDITOR.vBulletin.langInit=true;if(C){var E={};function B(G,F){F=F||"";$.each(G,function(H,I){if(typeof I=="object"){B(G[H],H+".")}else{G[H]="~~"+I+"~~ ("+F+H+")";E[F+H]=0}})}B(CKEDITOR.lang.en)}$.each(window.vBulletin.ckeditorPhrases,function(G,F){var I=CKEDITOR.lang.en;var H=G.split(".");for(var J=0;J<H.length;J++){if(J==(H.length-1)){if(C){if(typeof I[H[J]]!="undefined"){E[G]=1}else{E[G]=-1}}if(F===null){I[H[J]]="Undefined: "+G}else{I[H[J]]=F}}else{if(typeof (I[H[J]])!="object"||I[H[J]]===null){I[H[J]]={}}I=I[H[J]]}}});CKEDITOR.lang.en.dir=pageData.textdirection;if(C){}}else{if(typeof (window.vBulletin.ckeditorPhrases)=="undefined"&&C){console.warn("Ckeditor phrases not loaded.")}}});CKEDITOR.removeListener("instanceCreated",vBulletin.ckeditor.swapLanguage)};vBulletin.ckeditor.fixMobileDisplay=function(B){var A=B.editor;if(CKEDITOR.env.ie){try{document.execCommand("AutoUrlDetect",false,false)}catch(D){}}var C=$("#"+A.id+"_contents").children().filter(function(){return this.tagName=="IFRAME"?true:false});if(parseInt(A.config.width)<310){C.hide();C.show()}if("ontouchstart" in document.documentElement){C.get(0).contentWindow.scrollTo(0,10)}A.dataProcessor.dataFilter.addRules({elements:{img:function(H){if(H.attributes["class"]&&H.attributes["class"].indexOf("js-need-data-att-update")!==-1){var E=H.attributes["data-tempid"],F=$("#"+A.element.getId()).closest("form");if(E&&F){for(var G=0;G<vBulletin.ckeditor.imageSettings.length;G++){cleanId=vBulletin.ckeditor.imageSettings[G].substring(3).toLowerCase();inputName="setting["+E+"]["+cleanId+"]";$inputElement=F.find('input[name="'+inputName+'"]');inputValue=$inputElement&&$inputElement.is(":enabled")&&$inputElement.val();if(inputValue){H.attributes["data-"+cleanId]=inputValue;switch(cleanId){case"size":newImgSrc=H.attributes.src.replace(/&type=[A-Za-z]+/,"")+"&type="+inputValue;H.attributes.src=newImgSrc;break;case"alignment":H.attributes["class"]=H.attributes["class"].replace("align_left","").replace("align_center","").replace("align_right","");if(inputValue!=="none"){H.attributes["class"]=H.attributes["class"]+" align_"+inputValue}break;case"title":break;default:break}}}}H.attributes["class"]=H.attributes["class"].replace("js-need-data-att-update","")}}}})};vBulletin.ckeditor.fixIeEditorClick=function(B){var A=B.editor||false;if(A&&A.container&&A.container.$){$(".cke_wysiwyg_frame",A.container.$).contents().on("click",function(C){A.focus()})}};vBulletin.ckeditor.fixTableFunctionality=function(B,C){var A=C||B.editor;$("#"+A.id+"_top .cke_button__table").hide()};vBulletin.ckeditor.initUsernameAutosuggest=function(N){var J=0,R=300,I={},Q=[],A=false,L={};function T(U){if(U&&U.data&&U.data.keyCode){switch(U.data.keyCode){case 27:case 13:case 38:case 40:if(J){window.clearTimeout(J);J=0}return F(U);break}}if(J){return }J=window.setTimeout(function(){F(U)},R)}function F(V){if(!V||!V.data||!V.data.keyCode){return true}var X=V.data.keyCode,Y=([13,27,38,40].indexOf(X)!=-1),U=P(V.editor),W=true;if(Y){W=C(V,U)}if(A&&!U){A=false}J=0;return W}function C(X,U){var Z=X.data.keyCode,V=vBulletin.ckeditor.verifyEditorId(X.editor),Y=$("#"+V).closest(".js-content-entry"),a=$(".js-contententry-username-autosuggest",Y),W=a.autocomplete("widget");if(!W.is(":visible")){return true}switch(Z){case 27:A=true;a.val("").autocomplete("close");break;case 13:W.menu("select");break;case 38:W.menu("previous");break;case 40:W.menu("next");break}X.cancel();X.stop();return false}function P(V){if(V.mode&&V.mode=="source"){return false}var U=vBulletin.ckeditor.verifyEditorId(V),W=$("#"+U).closest(".js-content-entry"),Y=$(".js-contententry-username-autosuggest",W),X=M(V),Z="";if(X){Z=X.username}if(Z!=""&&Z.length>=3&&Z.length<=vBulletin.options.get("maxuserlength")){console.log(Z,Y.val());if(Z!=Y.val()){G(V,Z,X.startNode)}return true}else{Y.val("").autocomplete("close");return false}}function M(Z){var x=Z.getSelection();if(!x){return false}var g=x.getRanges()[0];g.collapse(true);g.setStartAt(Z.editable(),CKEDITOR.POSITION_AFTER_START);var p=g.endOffset,n=new CKEDITOR.dom.walker(g),Y=0;var j=n.previous();--Y;var v=j;if(!j){return false}var e=j.getText(),h=e.lastIndexOf("@");if(h==-1){while(true){var i=n.previous();--Y;if(i&&i.type==CKEDITOR.NODE_TEXT){var d=i.getText(),f=d.lastIndexOf("@");e=d+e;h=f;p+=d.length;if(h!=-1){v=i;break}}else{break}}}if(h==-1){return false}if(h==e.length-1){return false}if(h==0){var i=n.previous();--Y;if(i){var m=i.getText();if(m!=""&&!(/\s$/.test(m))){return false}if(i&&i.$&&i.$.tagName&&i.$.tagName.toUpperCase){var a=i.$.tagName.toUpperCase();if(a!="BR"&&a!="HR"){return false}}}}if(h>0){if(!(/\s/.test(e.substr(h-1,1)))){return false}}var r,b,l=h,k=e;while(1){r=n.previous();--Y;if(!r){break}else{if(r.type==CKEDITOR.NODE_TEXT){b=r.getText();k=b+k;l+=b.length}}}k=k.substr(0,l);var u=false,t={CODE_TAG:0,PHP_TAG:0,HTML_TAG:0},w=/\[(\/?)(noparse|code|php|html)\]/gi,o,V,U,s;while(o=w.exec(k)){V=(o[1]=="/");U=o[2].toUpperCase();if(u){if(U=="NOPARSE"&&V){u=false}continue}switch(U){case"NOPARSE":if(!V){u=true}break;case"CODE":case"PHP":case"HTML":s=U+"_TAG";if(V){if(t[s]>0){--t[s]}}else{++t[s]}break;default:break}}var c=(u||t.CODE_TAG>0||t.PHP_TAG>0||t.HTML_TAG>0);if(c){return false}while(Y<0){n.next();++Y}while(1){var W=n.next();if(W&&W.type==CKEDITOR.NODE_TEXT){var q=W.getText();if(q!=""){e+=q;p+=q.length}}else{break}}var X=e.substr(h+1);X=X.substr(0,p-h-1);X=$.trim(X);return{username:X,startNode:v}}function G(X,Y,d){H("showUsernameAutosuggest()");var i=vBulletin.ckeditor.verifyEditorId(X),e=$("#"+i).closest(".js-content-entry"),W=$(".js-contententry-username-autosuggest",e);if(A){W.val("").autocomplete("close");return }var U=e.find(".cke_wysiwyg_frame").offset(),c=e.offset();var b=d.getParent(),f=b.getDocumentPosition(),k=b.getHtml(),V=d.getText();function Z(m){return m.replace(/&nbsp;/g," ").replace((new RegExp("\u00A0","g"))," ")}k=Z(k);V=Z(V);var g=V.lastIndexOf("@");if(V.substr(g+1).length<Y.length){V=V.substr(0,g+1)+Y}var a=V.substr(0,g)+'<span id="vb-get-pos">x</span>'+V.substr(g),l=k.replace(V,a);$("<div />").attr("id","vb-temp-position-el").css({position:"absolute",top:(U.top-c.top+f.y),left:(U.left-c.left+f.x),border:"1px solid red",background:"#CCC",zIndex:"999"}).html(l).appendTo(e);var j=$("#vb-get-pos",e).offset(),h=$("#vb-get-pos",e).outerHeight();$("#vb-temp-position-el",e).remove();W.css({top:(j.top-c.top+h),left:(j.left-c.left)});W.val(Y);W.autocomplete("search",Y);W.data("node",d)}function K(V){var U=vBulletin.ckeditor.verifyEditorId(V.editor.name),W=$("#"+U).closest(".js-content-entry"),X=$(".js-contententry-username-autosuggest",W);X.val("").autocomplete("close")}function E(U,Z){var V=false;$.each(Q,function(a,b){if(U.term.indexOf(b)==0){V=true;return false}});if(V){$(this.element).val("").autocomplete("close");return }var X=$(this.element),W=X.closest(".js-content-entry");function Y(a){Z(a);window.setTimeout(function(){var b=$(".ui-autocomplete",W);b.find(".ui-menu-item").on("mouseout",function(){return false})},10)}if(typeof I[U.term]!="undefined"){Y(I[U.term])}else{vBulletin.AJAX({call:"/ajax/api/user/getAutocomplete",data:({searchStr:U.term}),success:function(b){if(b&&$.isArray(b.suggestions)){var a=[];$.each(b.suggestions,function(c,d){a.push({label:d.title,value:d.value,userid:d.id})});if(a.length>0){Y(a);I[U.term]=a}else{Q.push(U.term);X.val("").autocomplete("close")}}},error_phrase:"error_getting_suggestions"})}}function D(V){var U=0;$.each(I,function(X,W){$.each(W,function(Y,Z){if(Z.value==V){U=Z.userid;return false}});if(U){return false}});return U}function B(f,g){var h=$(this),i=h.closest(".js-content-entry"),W=i.find(".js-editor").attr("id"),c=vBulletin.ckeditor.getEditor(W),b=h.data("node").getParent(),j=b.getHtml(),a="@"+h.val(),U=j.lastIndexOf(a),Y=j.substr(0,U),V=j.substr(U+a.length).replace(/<br>$/i,""),d=V.match(/(&nbsp;| )$/);if(d){V=V.replace(/(&nbsp;| )$/,"")}b.setText("");c.insertHtml(Y);if(vBulletin.options.get("userbbcodeavatar")){function X(m,k,o){var e=pageData.baseurl_core+"/"+o,n=m.document?m.document.getBody():null;if(n&&n.$){var l=$(".js-bbcode-user--userid"+k,n.$);l.css("background-image","url('"+e+"')")}}var Z=D(g.item.value);c.insertHtml('<a href="#" class="b-bbcode-user b-bbcode-user--has-avatar js-bbcode-user js-bbcode-user--userid'+Z+'">'+g.item.value+"</a>&nbsp;");if(typeof L["userid_"+Z]!="undefined"){X(c,Z,L["userid_"+Z])}else{vBulletin.AJAX({call:"/ajax/api/user/fetchAvatar",data:({userid:Z,thumb:true}),success:function(e){if(e&&e.avatarpath){X(c,Z,e.avatarpath);L["userid_"+Z]=e.avatarpath}},error_phrase:"error_fetching_avatar"})}}else{c.insertHtml('<a href="#" class="b-bbcode-user js-bbcode-user">'+g.item.value+"</a>&nbsp;")}c.insertHtml(V);J=0;h.val("").autocomplete("close")}function S(U){J=0}function H(V,U){console.log("Ckeditor: Username autosuggest: "+V);if(typeof U!="undefined"){console.dir(U)}}function O(V){H("init() start");if(!V){H("Editor instance in empty");return }if(typeof vBulletin.contentEntryBox.bbcode_enabled.user=="undefined"){H("Warning, vBulletin.contentEntryBox.bbcode_enabled.user is undefined! Disabling usermention auto suggest.");vBulletin.contentEntryBox.bbcode_enabled.user=false}if(!vBulletin.contentEntryBox.bbcode_enabled.user){H("USER bbcode is disabled on this forum. Disabling usermention auto suggest.");return }V.on("key",T,null,null,1);V.on("contentDom",function(){this.document.on("click",function(Y){P(V)})});V.on("blur",K);var U=vBulletin.ckeditor.verifyEditorId(V),W=$("#"+U).closest(".js-content-entry").css("position","relative"),X=$('<input type="text" class="js-contententry-username-autosuggest" style="position:absolute;top:0px;left:0px;visibility:hidden;width:1px;height:1px;" />');X.appendTo(W).autocomplete({appendTo:W,autoFocus:true,delay:0,minLength:3,source:E,select:B,close:S});H("init() finish")}O(N.editor)};vBulletin.ckeditor.modifyCkeditorDialogs=function(C){var D=C.data.name,B=C.data.definition;switch(D){case"table":case"tableProperties":var A=B.getContents("info");A.remove("txtCaption");A.remove("txtSummary");A.remove("selHeaders");A.remove("txtCellSpace");delete B.contents[0].elements[1];delete B.contents[0].elements[2];B.minHeight=200;delete B.contents[1];break;default:break}B.dialog.on("load",function(){var E=$(this.definition.dialog.parts.dialog.$);E.addClass("ckeditor-dialog");E.find('input[type="text"]').addClass("b-form-input__input b-form-input__input--border-box");E.find(".cke_dialog_ui_button").each(function(){var F=$(this);if(!F.parent().closest(".cke_dialog_ui_button").length){F.addClass("b-button");if(F.is(".cke_dialog_ui_button_ok")){F.addClass("b-button--primary")}else{F.addClass("b-button--secondary")}}});vBulletin.ckeditor.modifyImagePaths(E)});B.dialog.on("show",function(){var E=$(this.definition.dialog.parts.dialog.$);window.setTimeout(function(){E.find(".cke_pasteframe").addClass("b-editor__pasteframe")},0)})};vBulletin.ckeditor.autogrowEditorOnImageLoad=function(B,C){var A=new Image();A.onload=function(){C.execCommand("autogrow_ifallowed")};A.src=B};vBulletin.ckeditor.applyCustomPasteFilter=function(B){var A=B.editor;A.on("paste",function(F){var D=new CKEDITOR.htmlParser.filter({elements:{p:function(H){var J="<br>",K="<br>";if(H.previous&&H.previous.type==CKEDITOR.NODE_TEXT){J="<br><br>"}else{if(H.previous&&H.previous.type==CKEDITOR.NODE_ELEMENT&&H.previous.name=="p"){}else{if(H.previous===null){J=""}}}if(H.next&&H.next.type==CKEDITOR.NODE_TEXT){K="<br><br>"}else{if(H.next&&H.next.type==CKEDITOR.NODE_ELEMENT&&H.next.name=="p"){K=""}else{if(H.next===null){K=""}}}var G=J+H.getHtml()+K,I=new CKEDITOR.htmlParser.text(G);H.replaceWith(I)},div:function(H){var G="<br>"+H.getHtml()+"<br>",I=new CKEDITOR.htmlParser.text(G);H.replaceWith(I)}}});var C=CKEDITOR.htmlParser.fragment.fromHtml(F.data.dataValue),E=new CKEDITOR.htmlParser.basicWriter();D.applyTo(C);C.writeHtml(E);F.data.dataValue=E.getHtml()})};vBulletin.ckeditor.modifyImagePaths=function(B){var C=pageData.baseurl+"/js/ckeditor/images/"+pageData.ckeditor_image_path+"/",A=CKEDITOR.env.hidpi?"icons_hidpi.png":"icons.png";B.find(".cke_dialog_close_button").css("backgroundImage","url("+C+"close.png)");B.find(".cke_button_icon").each(function(){var E=$(this),G=E.css("cssText"),D=E.attr("style"),F=E.css("background-image");if(F=="none"||F.match(/js\/ckeditor\/skins\/moono\/icons/)){E.css("cssText",G+"background-image:url("+C+A+") !important;")}else{if(F.match(/js\/ckeditor\/images\/default\/vbulletin/)){var I=F.replace("js/ckeditor/images/default/vbulletin","js/ckeditor/images/"+pageData.ckeditor_image_path+"/vbulletin");E.css("cssText",G+"background-image:"+I+" !important;")}else{if(F.match(/js\/ckeditor\/images\/default\/icons/)){var H=D.replace("js/ckeditor/images/default/","js/ckeditor/images/"+pageData.ckeditor_image_path+"/");E.attr("style",H)}}}})};vBulletin.ckeditor.modifyImagePathsInstance=function(A){vBulletin.ckeditor.modifyImagePaths($(A.editor.container.$))};vBulletin.ckeditor.addEditorCssToIframe=function(A){window.setTimeout(function(){var B=A.contents().find("head");if(!B.is(".js-added-extra-css")){$.each(CKEDITOR.config.contentsCss,function(C,E){var D=$("<link />",{rel:"stylesheet",type:"text/css",href:E.replace(/&amp;/g,"&")});B.append(D)});B.addClass("js-added-extra-css")}},0)};vBulletin.ckeditor.addCssToCkeditorIframes=function(A){A.editor.on("menuShow",function(D){var C=null;try{C=D.data[0].element.$.children[0]}catch(B){}vBulletin.ckeditor.addEditorCssToIframe($(C))});CKEDITOR.ui.on("ready",function(D){var C=null;try{C=D.data._.panel.element.$.children[0]}catch(B){}vBulletin.ckeditor.addEditorCssToIframe($(C))})};vBulletin.ckeditor.initResizeToolbar=function(C){var B=vBulletin.ckeditor.verifyEditorId(C.editor);function A(){vBulletin.ckeditor.resizeToolbar(B)}A();vBulletin.Responsive.Debounce.registerCallback(A)};vBulletin.ckeditor.resizeToolbar=function(D){var A=$("#cke_"+D+" .cke_toolbox"),G=A.find(".cke_toolbar"),C=A.find(".cke_button, .cke_combo");function I(J){if(J.filter(".js-button-priority-0").length>0){return }var L={cke_button__source:0,cke_button__removeformat:0,cke_button__pastetext:0,cke_button__pastefromword:0,cke_combo__font:0,cke_combo__fontsize:0,cke_button__textcolor:1,cke_button__undo:1,cke_button__redo:1,cke_button__bold:2,cke_button__italic:2,cke_button__underline:2,cke_button__justifyleft:2,cke_button__justifycenter:2,cke_button__justifyright:2,cke_button__numberedlist:2,cke_button__bulletedlist:2,cke_button__outdent:1,cke_button__indent:1,cke_button__link:0,cke_button__unlink:0,cke_button__image:2,cke_button__video:0,cke_button__quote:0,cke_button__code:0,cke_button__html:0,cke_button__php:0,cke_button__table:0,cke_button__vbtable:0,cke_button__subscript:0,cke_button__superscript:0,cke_button__horizontalrule:0,cke_button__pagebreak:0,cke_button__previewbreak:0};function K(M){var N=0;$.each(L,function(O,P){if(M.is("."+O)){N=P;return false}});return N}J.each(function(){var O=$(this),M=K(O),N="js-button-priority-"+M;O.addClass(N)})}function E(J){function K(O){function S(T){return T.find(".cke_toolbar, .js-vb-toolbar-more-container").filter(":visible")}var M=S(O);if(M.length>0){var L=B(O);if(L.is(":visible")&&$("body").is(".l-small")){var P=10;while(--P>0&&M.length>0&&!vBulletin.Responsive.Debounce.areElementsOnOneRow(M)){var R=O.find(".cke_button, .cke_combo").not(".js-vb-toolbar-more").filter(":visible").last().addClass("h-hide-imp");var N=R.closest(".cke_toolbar"),Q=N.find(".cke_button:visible, .cke_combo:visible").length==0;N.toggleClass("h-hide-imp",Q);M=S(O)}}return true}return false}if(!K(J)){setTimeout(function(){K(J)},0)}}function B(K){var J=K.find(".js-vb-toolbar-more");if(J.length<1){function L(M){$(M.target).closest(".js-vb-toolbar-more").toggleClass("cke_button_on");H()}var J=$("<a />").addClass("js-vb-toolbar-more cke_button").css({borderRadius:"3px"}).on("click",L);$("<span />").addClass("b-icon b-icon__ellipsis").appendTo(J);$("<div />").addClass("cke_toolgroup js-vb-toolbar-more-container").css({borderColor:"transparent",background:"transparent",marginRight:0,marginLeft:0}).append(J).appendTo(K)}return J}function F(K){var L="h-hide-imp",J=B(A);if(J.is(".cke_button_on")){K=0}G.addClass(L);$.each([0,1,2],function(M,N){C.filter(".js-button-priority-"+N).toggleClass(L,(N<K))});C.not("."+L).closest(".cke_toolbar").removeClass(L);J.toggleClass(L,!$("body").is(".l-small"))}function H(){var M=$("body"),L=M.is(".l-small"),J=M.is(".l-xsmall"),K=J?2:(L?1:0);F(K)}I(C);H();E(A)};vBulletin.ckeditor.disableResizeAndAutogrow=function(B,A){var A=A||vBulletin.ckeditor.getEditor(B);A.fire("disableResize")};CKEDITOR.on("instanceCreated",vBulletin.ckeditor.swapLanguage);CKEDITOR.on("instanceReady",vBulletin.ckeditor.fixMobileDisplay);CKEDITOR.on("instanceReady",vBulletin.ckeditor.fixIeEditorClick);CKEDITOR.on("instanceReady",vBulletin.ckeditor.fixTableFunctionality);CKEDITOR.on("instanceReady",vBulletin.ckeditor.initUsernameAutosuggest);CKEDITOR.on("instanceReady",vBulletin.ckeditor.applyCustomPasteFilter);CKEDITOR.on("instanceReady",vBulletin.ckeditor.modifyImagePathsInstance);CKEDITOR.on("instanceReady",vBulletin.ckeditor.addCssToCkeditorIframes);CKEDITOR.on("instanceReady",vBulletin.ckeditor.initResizeToolbar);CKEDITOR.on("dialogDefinition",vBulletin.ckeditor.modifyCkeditorDialogs);