Nhờ HD thêm bộ BBcode

Thảo luận trong 'Add-on Quesions' bắt đầu bởi thoden.it, 7/8/12.

1votes
5/5, 1 vote

  1. thoden.it

    thoden.it New Member

    Bài viết:
    62
    Likes :
    12
    các bạn có thể chia sẻ mình bộ bbcode này được không... mò mò add hoài mà chưa thành công...
    [​IMG]

    cám ơn bạn nhé
    demo: http://tamnhinso.info
     
    gacon_hocit thích bài này.
    Đang tải...
  2. ku Hiệu

    ku Hiệu Lì Lắm Luôn

    Bài viết:
    1,345
    Likes :
    862
    mở file /js/tinymce/themes/xenforo/editor_template.js
    tìm

    Mã:
    addButtons : function (theme, tb)
     
            {
     
                var tags = theme.settings.xenforo_custom_bbcode_tags,
     
                    controlManager = theme.editor.controlManager;
     
                //tb.add(controlManager.createControl('|'));
     
                tb.add(controlManager.createButton('xenforo_quote',
     
                    { title: 'xenforo.quote', cmd: 'xenForoWrapBbCode', ui: false, value: 'QUOTE' }
     
                ));
    Muốn thêm thẻ gì thì thêm phía trên cái )); theo dạng sau:
    Ví dụ thêm thẻ [flash] thì thêm thế này

    ,
    tb.add(controlManager.createButton('xenforo_flash',
    { title: 'chèn Flash', image : 'link hình cho nút BBcode', cmd: 'xenForoWrapBbCode', ui: false, value: 'flash' }


    DEMO LUÔN

    [​IMG]
     
    Duy and thoden.it like this.
  3. Duy

    Duy New Member

    Bài viết:
    4
    Likes :
    0
    Sao mình làm lại bị mất luôn cả bbcode mặc định vậy?
     
  4. 1234nguyenlinh

    1234nguyenlinh New Member

    Bài viết:
    51
    Likes :
    3
    cho hỏi sao file của em nó như thế này!, không tìm và edit được ạ!
    Mã:
    (function(){var a=function(a,b){var c=a.selection,d,e,f;d="["+b+"]"+c.getContent().replace(/^<p>/,"").replace(/<\/p>$/,"")+'<span id="__xfBbCaret">_</span>'+"[/"+b+"]",d="<p>"+d+"</p>",c.setContent(d),a.getDoc().createRange&&(f=a.dom.get("__xfBbCaret"),e=a.getDoc().createRange(),e.setStartBefore(f),e.setEndBefore(f),c.setRng(e)),a.dom.remove("__xfBbCaret")};tinymce.create("tinymce.plugins.XenForoCustomBbCode",{init:function(b,c){b.addCommand("xenForoWrapBbCode",function(c,d){a(b,d)})},addButtons:function(a,b){var c=a.settings.xenforo_custom_bbcode_tags,d=a.editor.controlManager;b.add(d.createButton("xenforo_quote",{title:"xenforo.quote",cmd:"xenForoWrapBbCode",ui:!1,value:"QUOTE"})),typeof c!="undefined"&&c.length!==0&&c!=={}&&tinymce.each(c,function(a,c){b.add(d.createButton("xenforo_custom_bbcode_"+c,{title:a[0],image:a[1],cmd:"xenForoWrapBbCode",ui:!1,value:c}))})},getInfo:function(){return{longname:"XenForo Custom BB Code",author:"",version:"1.0"}}}),tinymce.create("tinymce.plugins.XenForoSmilies",{addButtons:function(a,b){var c=a.settings.xenforo_smilies,d=a.editor.controlManager,e=a.editor,f,g=tinymce.DOM;typeof c!="undefined"&&c.length!==0&&c!=={}&&(f=d.createColorSplitButton("xenforo_smilies",{title:"xenforo.smilies_desc",icons:!1,onclick:function(){f.showMenu()},onselect:function(a,b){var c;b=g.encode(b)+" ",typeof a=="number"?c='<img src="styles/default/xenforo/clear.png" alt="'+b+'" class="mceSmilieSprite mceSmilie'+a+'" data-smilie="yes" /> ':c='<img src="'+g.encode(a)+'" alt="'+b+'" class="mceSmilie" data-smilie="yes" /> ',e.execCommand("mceInsertContent",!1,c)},smilies:c},tinymce.ui.XenForoSmiliesButton),b.add(f))},getInfo:function(){return{longname:"XenForo Smilies",author:"",version:"2.0"}}}),tinymce.create("tinymce.plugins.XenForoMedia",{addButtons:function(a,b){var c=a.editor.controlManager,d=a.editor,e,f=tinymce.DOM;e=c.createButton("xenforo_media",{title:"xenforo.media_desc",onclick:function(b,c){d.windowManager.open({url:a._getFullDialogUrl("media"),width:310,height:300,inline:!0})}}),b.add(e)},getInfo:function(){return{longname:"XenForo Media",author:"",version:"1.0"}}}),tinymce.create("tinymce.plugins.XenForoCode",{addButtons:function(a,b){var c=a.editor.controlManager,d=a.editor,e,f=tinymce.DOM;e=c.createButton("xenforo_code",{title:"xenforo.code",onclick:function(b,c){d.windowManager.open({url:a._getFullDialogUrl("code"),width:400,height:300,inline:!0})}}),b.add(e)},getInfo:function(){return{longname:"XenForo Code",author:"",version:"1.0"}}}),tinymce.create("tinymce.plugins.XenForoElastic",{init:function(a){if(!($.browser.msie&&$.browser.version<=6)){var b,c,d=0,e,f,g;f=function(){e=$(a.getContentAreaContainer()).find("iframe"),c=$(a.getWin()).height(),b=$(window).height()-200,e.closest(".xenOverlay").length&&(b-=(b+200)/10),b=Math.max(b,c),$(a.getBody()).css("overflow-y","hidden"),g(),setTimeout(g,250)},g=function(){if(!!e){var f=a.getDoc().documentElement.scrollHeight,g,h,i=$.browser.webkit||$.browser.msie&&$.browser.version>=9;i||(f+=22),f<c?f=c:f>b&&(f=b);if(f!=d){if(!$.browser.msie||$.browser.version>=9)d<f&&f==b?$(a.getBody()).css("overflow-y","auto"):d==b&&f<b&&$(a.getBody()).css("overflow-y","hidden");e.height(f),d=f}}},a.onInit.add(f),a.onSetContent.add(g),a.onPaste.add(g),a.onChange.add(g),a.onKeyDown.add(g),a.addCommand("xenForoElastic",function(a,b){g()})}},getInfo:function(){return{longname:"XenForo Elastic",author:"",version:"1.0"}}}),tinymce.create("tinymce.plugins.XenForoBbCodeSwitch",{init:function(a){var b=this;b.editor=a,a.onPostRender.add(function(){$("<a />").attr("class","mceButton mceButtonEnabled bbCodeEditorButton").append($("<span />").attr({title:a.settings.xenforo_bbcode_switch_text[0],"class":"mceIcon"}).click($.context(b,"wysiwygToBbCode"))).prependTo("#"+a.id+"_tbl td.mceToolbar")})},wysiwygToBbCode:function(){XenForo.ajax("index.php?editor/to-bb-code",{html:this.editor.getContent()},$.context(this,"wysiwygToBbCodeSuccess"))},wysiwygToBbCodeSuccess:function(a){if(!XenForo.hasResponseError(a)&&typeof a.bbCode!="undefined"){var b=this.editor;$container=$(b.getContainer()),$existingTextArea=$(b.getElement()),$textContainer=$('<div class="bbCodeEditorContainer" />'),$newTextArea=$('<textarea class="textCtrl Elastic" rows="5" />');if($existingTextArea.attr("disabled"))return;$newTextArea.attr("name",$existingTextArea.attr("name").replace(/_html(]|$)/,"")).val(a.bbCode).appendTo($textContainer),$("<a />").attr("href","javascript:").text(b.settings.xenforo_bbcode_switch_text[1]).click($.context(this,"bbCodeToWysiwyg")).appendTo($("<div />").appendTo($textContainer)),$existingTextArea.attr("disabled",!0).after($textContainer),$.browser.mozilla&&$(window).unbind("unload.rte").bind("unload.rte",function(){$existingTextArea.removeAttr("disabled")}),$container.hide(),$textContainer.xfActivate(),$newTextArea.focus(),this.$bbCodeTextContainer=$textContainer,this.$bbCodeTextArea=$newTextArea}},bbCodeToWysiwyg:function(){XenForo.ajax("index.php?editor/to-html",{bbCode:this.$bbCodeTextArea.val()},$.context(this,"bbCodeToWysiwygSuccess"))},bbCodeToWysiwygSuccess:function(a){if(!XenForo.hasResponseError(a)&&typeof a.html!="undefined"){var b=this.editor;$container=$(b.getContainer()),$existingTextArea=$(b.getElement());if(!$existingTextArea.attr("disabled"))return;$existingTextArea.attr("disabled",!1),$container.show(),b.setContent(a.html),b.focus(),this.$bbCodeTextContainer.remove()}},getInfo:function(){return{longname:"XenForo BB Code Switch",author:"",version:"1.0"}}}),tinymce.PluginManager.add("xenforo_custom_bbcode",tinymce.plugins.XenForoCustomBbCode),tinymce.PluginManager.add("xenforo_smilies",tinymce.plugins.XenForoSmilies),tinymce.PluginManager.add("xenforo_media",tinymce.plugins.XenForoMedia),tinymce.PluginManager.add("xenforo_code",tinymce.plugins.XenForoCode),tinymce.PluginManager.add("xenforo_elastic",tinymce.plugins.XenForoElastic),tinymce.PluginManager.add("xenforo_bbcode_switch",tinymce.plugins.XenForoBbCodeSwitch)})(),function(a){var b=a.DOM,c=a.dom.Event,d=a.is,e=a.each;a.create("tinymce.ui.XenForoSmiliesButton:tinymce.ui.SplitButton",{XenForoSmiliesButton:function(b,c){var d=this;d.parent(b,c),d.settings=c=a.extend({smilies:{}},d.settings),d.onShowMenu=new a.util.Dispatcher(d),d.onHideMenu=new a.util.Dispatcher(d)},showMenu:function(){var a=this,d,e,f,g;if(!a.isDisabled()){a.isMenuRendered||(a.renderMenu(),a.isMenuRendered=!0);if(a.isMenuVisible)return a.hideMenu();f=b.get(a.id),b.show(a.id+"_menu"),b.addClass(f,"mceSplitButtonSelected"),g=b.getPos(f),b.setStyles(a.id+"_menu",{left:g.x,top:g.y+f.clientHeight,zIndex:2e5}),f=0,c.add(b.doc,"mousedown",a.hideMenu,a),a._focused&&(a._keyHandler=c.add(a.id+"_menu","keydown",function(b){b.keyCode==27&&a.hideMenu()}),b.select("a",a.id+"_menu")[0].focus()),a.isMenuVisible=1}},hideMenu:function(a){var d=this;if(!a||a.type!="mousedown"||!b.getParent(a.target,function(a){return a.id===d.id+"_open"})){if(!a||!b.getParent(a.target,".mceSplitButtonMenu"))b.removeClass(d.id,"mceSplitButtonSelected"),c.remove(b.doc,"mousedown",d.hideMenu,d),c.remove(d.id+"_menu","keydown",d._keyHandler),b.hide(d.id+"_menu");d.isMenuVisible=0}},renderMenu:function(){var a=this,d,f=0,g=a.settings,h,i,j,k;k=b.add(g.menu_container,"div",{id:a.id+"_menu","class":g.menu_class+" "+g["class"],style:"position:absolute;left:0;top:-1000px;"}),d=b.add(k,"div",{"class":g["class"]+" mceSplitButtonMenu mceSmiliesMenu"}),b.add(d,"span",{"class":"mceMenuLine"}),h=b.add(d,"div"),f=0,e(g.smilies,function(a,c){var d,e;typeof a[1]=="number"?d='<img src="styles/default/xenforo/clear.png" alt="" title="'+b.encode(a[0]+"    "+c)+'" class="mceSmilieSprite mceSmilie'+a[1]+'" />':d='<img src="'+b.encode(a[1])+'" alt="" title="'+b.encode(a[0]+"    "+c)+'" />',b.add(h,"a",{href:"javascript:;","data-smilieInfo":a[1],"data-smilieText":c},d)}),c.add(a.id+"_menu","click",function(b){var d,e;b=b.target,e=$(b).closest("[data-smilieInfo]"),e.length&&(a.settings.onselect(e.data("smilieInfo"),e.data("smilieText")),a.hideMenu());return c.cancel(b)});return k},destroy:function(){this.parent(),c.clear(this.id+"_menu"),b.remove(this.id+"_menu")}})}(tinymce),function(){var a=tinymce.DOM,b=tinymce.dom.Element,c=tinymce.dom.Event,d=tinymce.each,e=tinymce.is;tinymce.create("tinymce.plugins.XenForoInlinePopups",{init:function(a,b){a.onBeforeRenderUI.add(function(){a.windowManager=new tinymce.XenForoInlineWindowManager(a)})},getInfo:function(){return{longname:"XenForoInlinePopups",author:"Moxiecode Systems AB, modifications for XenForo",version:"1.0"}}}),tinymce.create("tinymce.XenForoInlineWindowManager:tinymce.WindowManager",{XenForoInlineWindowManager:function(a){var b=this;b.parent(a),b.zIndex=3e5,b.count=0,b.windows={}},open:function(d,e){var f=this,g,h="",i=f.editor,j=0,k=0,l,m,n,o,p,q,r;d=d||{},e=e||{};if(!d.inline)return f.parent(d,e);d.type||(f.bookmark=i.selection.getBookmark(1)),g=a.uniqueId(),l=a.getViewPort(),d.width=parseInt(d.width||320),d.height=parseInt(d.height||240)+(tinymce.isIE?8:0),d.min_width=parseInt(d.min_width||150),d.min_height=parseInt(d.min_height||100),d.max_width=parseInt(d.max_width||2e3),d.max_height=parseInt(d.max_height||2e3),d.left=d.left||Math.round(Math.max(l.x,l.x+l.w/2-d.width/2)),d.top=d.top||Math.round(Math.max(l.y,l.y+l.h/2-d.height/2)),d.movable=d.resizable=!0,e.mce_width=d.width,e.mce_height=d.height,e.mce_inline=!0,e.mce_window_id=g,e.mce_auto_focus=d.auto_focus,f.features=d,f.params=e,f.onOpen.dispatch(f,d,e),d.type&&(h+=" mceModal",d.type&&(h+=" mce"+d.type.substring(0,1).toUpperCase()+d.type.substring(1)),d.resizable=!1),f._addAll(a.doc.body,["div",{id:g,"class":"editorInlinePopup",style:"width:100px; height:100px"},["div",{id:g+"_content","class":"popupContent",style:"height:100%"}]]),a.setStyles(g,{top:-1e4,left:-1e4}),a.setStyles(g,{top:d.top,left:d.left,width:d.width+j}),r=d.url||d.file,r&&(tinymce.relaxedDomain&&(r+=(r.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain),r=tinymce._addVer(r)),d.type?(a.add(g+"_wrapper","a",{id:g+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok"),d.type=="confirm"&&a.add(g+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel"),a.add(g+"_middle","div",{"class":"mceIcon"}),a.setHTML(g+"_content",d.content.replace("\n","<br />"))):(a.add(g+"_content","iframe",{id:g+"_ifr",src:"javascript:;",frameBorder:0,scrolling:"no",style:"border:0; width:100%; height: 100%;"}),c.add(g+"_ifr","load",function(b){a.setStyles(g,{height:b.target.contentWindow.document.documentElement.scrollHeight}),a.setStyles(g+"_ifr",{height:b.target.contentWindow.document.documentElement.scrollHeight})}),a.setAttrib(g+"_ifr","src",r),a.get(g+"_ifr").focus()),q=f.windows[g]={id:g,mousedown_func:n,click_func:o,element:new b(g,{blocker:1,container:i.getContainer()}),iframeElement:new b(g+"_ifr"),features:d,deltaWidth:j,deltaHeight:k},q.iframeElement.on("focus",function(){f.focus(g)}),f.count==0&&f.editor.getParam("dialog_type","modal")=="modal"?(a.add(a.doc.body,"div",{id:"mceModalBlocker","class":"editorInlinePopup_modalBlocker",style:{zIndex:f.zIndex-1}}),c.add("mceModalBlocker","click",function(){f.close(null,g)}),a.show("mceModalBlocker")):a.setStyle("mceModalBlocker","z-index",f.zIndex-1),(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||tinymce.isIE&&!a.boxModel)&&a.setStyles("mceModalBlocker",{position:"absolute",left:l.x,top:l.y,width:l.w-2,height:l.h-2}),f.focus(g),f._fixIELayout(g,1),a.get(g+"_ok")&&a.get(g+"_ok").focus(),f.count++;return q},focus:function(b){var c=this,d;if(d=c.windows[b])d.zIndex=this.zIndex++,d.element.setStyle("zIndex",d.zIndex),d.element.update(),b=b+"_wrapper",a.removeClass(c.lastId,"mceFocus"),a.addClass(b,"mceFocus"),c.lastId=b},_addAll:function(a,b){var c,d,f=this,g=tinymce.DOM;if(e(b,"string"))a.appendChild(g.doc.createTextNode(b));else if(b.length){a=a.appendChild(g.create(b[0],b[1]));for(c=2;c<b.length;c++)f._addAll(a,b[c])}},resizeBy:function(a,b,c){return;var d=this.windows[c]},close:function(b,e){var f=this,g,h=a.doc,i=0,j,e;e=f._findId(e||b);if(!f.windows[e])f.parent(b);else{f.count--,f.count==0&&a.remove("mceModalBlocker");if(g=f.windows[e])f.onClose.dispatch(f),c.remove(h,"mousedown",g.mousedownFunc),c.remove(h,"click",g.clickFunc),c.clear(e),c.clear(e+"_ifr"),a.setAttrib(e+"_ifr","src",'javascript:""'),g.element.remove(),delete f.windows[e],d(f.windows,function(a){a.zIndex>i&&(j=a,i=a.zIndex)}),j&&f.focus(j.id)}},setTitle:function(b,c){var d;b=this._findId(b);if(d=a.get(b+"_title"))d.innerHTML=a.encode(c)},alert:function(b,c,d){var e=this,f;f=e.open({title:e,type:"alert",button_func:function(a){c&&c.call(a||e,a),e.close(null,f.id)},content:a.encode(e.editor.getLang(b,b)),inline:1,width:400,height:130})},confirm:function(b,c,d){var e=this,f;f=e.open({title:e,type:"confirm",button_func:function(a){c&&c.call(a||e,a),e.close(null,f.id)},content:a.encode(e.editor.getLang(b,b)),inline:1,width:400,height:130})},_findId:function(b){var c=this;if(typeof b=="string")return b;d(c.windows,function(c){var d=a.get(c.id+"_ifr");if(d&&b==d.contentWindow){b=c.id;return!1}});return b},_fixIELayout:function(b,c){var e,f;!!tinymce.isIE6&&(e=this.windows[b])&&(e.element.hide(),e.element.show(),d(a.select("div,a",b),function(a,b){a.currentStyle.backgroundImage!="none"&&(f=new Image,f.src=a.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1"))}),a.get(b).style.filter="")}}),tinymce.PluginManager.add("xenforo_inline_popups",tinymce.plugins.XenForoInlinePopups)}(),function(a){var b=a.DOM,c=a.dom.Event,d=a.extend,e=a.each,f=a.util.Cookie,g,h=a.explode;a.create("tinymce.themes.XenForoTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["strikethrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(c,f){var g=this,h,i,j;g.editor=c,g.url=f,g.onResolveName=new a.util.Dispatcher(this);if(!c.settings.skin||c.settings.skin=="default")c.settings.skin="xenForo";c.settings.popup_css=!1,c.settings.language="xenforo",c.settings.paste_remove_styles_if_webkit=!1,c.settings.convert_urls=!1,c.settings.gecko_spellcheck=!0,c.settings.entities="160,nbsp,38,amp,34,quot,60,lt,62,gt",c.onPostProcess.add(function(a,b){b.content=b.content.replace(/\t/g,"&nbsp;&nbsp;&nbsp; ")});var k=XenForo.isRTL(),l=k?"justifyright,justifycenter,justifyleft":"justifyleft,justifycenter,justifyright",m=k?"redo,undo":"undo,redo",n=k?"indent,outdent":"outdent,indent";g.settings=h=d({theme_xenforo_path:!0,theme_xenforo_buttons1:"removeformat,|,fontselect,fontsizeselect,forecolor,xenforo_smilies,|,"+m,theme_xenforo_buttons2:"bold,italic,underline,strikethrough,|,"+l+",|,bullist,numlist,"+n+",|,link,unlink,image,xenforo_media,|,xenforo_code,xenforo_custom_bbcode",theme_xenforo_buttons3:"",theme_xenforo_toolbar_location:"top",theme_xenforo_toolbar_align:"left",theme_xenforo_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_xenforo_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva",theme_xenforo_more_colors:1,theme_xenforo_row_height:23,theme_xenforo_resize_horizontal:1,theme_xenforo_resizing_use_cookie:1,theme_xenforo_font_sizes:"1,2,3,4,5,6,7",theme_xenforo_font_selector:"span",theme_xenforo_dialog_url:"",readonly:c.settings.readonly},c.settings),c.settings.formats={xenForoRemoveFormat:[{selector:"h1,h2,h3,h4,h5,h6",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0}]},a.is(h.theme_xenforo_font_sizes,"string")&&(h.font_size_style_values=a.explode(h.font_size_style_values),h.font_size_classes=a.explode(h.font_size_classes||""),j={},c.settings.theme_xenforo_font_sizes=h.theme_xenforo_font_sizes,e(c.getParam("theme_xenforo_font_sizes","","hash"),function(a,b){var d;b==a&&a>=1&&a<=7&&c.settings.convert_fonts_to_spans&&(d=h.font_size_classes[a-1],a=h.font_size_style_values[a-1]||g.sizes[a-1]+"pt"),/^\s*\./.test(a)&&(d=a.replace(/\./g,"")),j[b]=d?{"class":d}:{fontSize:a}}),h.theme_xenforo_font_sizes=j),(i=h.theme_xenforo_path_location)&&i!="none"&&(h.theme_xenforo_statusbar_location=h.theme_xenforo_path_location),h.theme_xenforo_statusbar_location=="none"&&(h.theme_xenforo_statusbar_location=0),c.onInit.add(function(){c.onNodeChange.add(g._nodeChanged,g),c.dom.loadCSS(h.theme_xenforo_contents_css_url),c.editorCommands.addCommands({Outdent:$.context(g,"_queryOutdent")},"state");var a="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li";c.formatter.register({alignleft:[{selector:a,styles:{textAlign:"left"}},{selector:"img,table",collapsed:!1,styles:{display:"block",marginLeft:"0",marginRight:"auto"}}],alignright:[{selector:a,styles:{textAlign:"right"}},{selector:"img,table",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"0"}}]})}),c.addShortcut("shift+ctrl+z",c.getLang("redo_desc"),"Redo"),c.onSetProgressState.add(function(a,c,d){var e,f=a.id,h;c?g.progressTimer=setTimeout(function(){e=a.getContainer(),e=e.insertBefore(b.create("DIV",{style:"position:relative"}),e.firstChild),h=b.get(a.id+"_tbl"),b.add(e,"div",{id:f+"_blocker","class":"mceBlocker",style:{width:h.clientWidth+2,height:h.clientHeight+2}}),b.add(e,"div",{id:f+"_progress","class":"mceProgress",style:{left:h.clientWidth/2,top:h.clientHeight/2}})},d||0):(b.remove(f+"_blocker"),b.remove(f+"_progress"),clearTimeout(g.progressTimer))})},createControl:function(a,b){var c,d;if(d=b.createControl(a))return d;switch(a){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if(c=this.controls[a])return b.createButton(a,{title:"xenforo."+c[0],cmd:c[1],ui:c[2],value:c[3]})},execCommand:function(a,b,c){var d=this["_"+a];if(d){d.call(this,b,c);return!0}return!1},_importClasses:function(a){var b=this.editor,c=b.controlManager.get("styleselect");c.getLength()==0&&e(b.dom.getClasses(),function(a){c.add(a["class"],a["class"])})},_createStyleSelect:function(a){var b=this,d=b.editor,f=d.controlManager,g=f.createListBox("styleselect",{title:"xenforo.style_select",onselect:function(a){if(g.selectedValue===a){d.execCommand("mceSetStyleInfo",0,{command:"removeformat"}),g.select();return!1}d.execCommand("mceSetCSSClass",0,a)}});g&&(e(d.getParam("theme_xenforo_styles","","hash"),function(a,c){a&&g.add(b.editor.translate(c),a)}),g.onPostRender.add(function(a,d){g.NativeListBox?c.add(d.id,"focus",b._importClasses,b):(c.add(d.id+"_text","focus",b._importClasses,b),c.add(d.id+"_text","mousedown",b._importClasses,b),c.add(d.id+"_open","focus",b._importClasses,b),c.add(d.id+"_open","mousedown",b._importClasses,b))}));return g},_createFontSelect:function(){var a,b=this,c=b.editor;a=c.controlManager.createListBox("fontselect",{title:"xenforo.fontdefault",cmd:"FontName"}),a&&e(c.getParam("theme_xenforo_fonts",b.settings.theme_xenforo_fonts,"hash"),function(b,d){a.add(c.translate(d),b,{style:b.indexOf("dings")==-1?"font-family:"+b:""})});return a},_createFontSizeSelect:function(){var a=this,b=a.editor,c,d=0,f=[];c=b.controlManager.createListBox("fontsizeselect",{title:"xenforo.font_size",onselect:function(c){c.fontSize?b.execCommand("FontSize",!1,c.fontSize):(e(a.settings.theme_xenforo_font_sizes,function(a,b){a["class"]&&f.push(a["class"])}),b.editorCommands._applyInlineStyle("span",{"class":c["class"]},{check_classes:f}))}}),c&&e(a.settings.theme_xenforo_font_sizes,function(b,e){var f=b.fontSize;f>=1&&f<=7&&(f=a.sizes[parseInt(f)-1]+"pt"),c.add(e,b,{style:"font-size:"+f,"class":"mceFontSize"+d++ +(" "+(b["class"]||""))})});return c},_createBlockFormats:function(){var a,b={p:"xenforo.paragraph",address:"xenforo.address",pre:"xenforo.pre",h1:"xenforo.h1",h2:"xenforo.h2",h3:"xenforo.h3",h4:"xenforo.h4",h5:"xenforo.h5",h6:"xenforo.h6",div:"xenforo.div",blockquote:"xenforo.blockquote",code:"xenforo.code",dt:"xenforo.dt",dd:"xenforo.dd",samp:"xenforo.samp"},c=this;a=c.editor.controlManager.createListBox("formatselect",{title:"xenforo.block",cmd:"FormatBlock"}),a&&e(c.editor.getParam("theme_xenforo_blockformats",c.settings.theme_xenforo_blockformats,"hash"),function(d,e){a.add(c.editor.translate(e!=d?e:b[d]),d,{"class":"mce_formatPreview mce_"+d})});return a},_createForeColorMenu:function(){var a,b=this,c=b.settings,d={},e;c.theme_xenforo_more_colors&&(d.more_colors_func=function(){b._mceColorPicker(0,{color:a.value,func:function(b){a.setColor(b)}})});if(e=c.theme_xenforo_text_colors)d.colors=e;c.theme_xenforo_default_foreground_color&&(d.default_color=c.theme_xenforo_default_foreground_color),d.title="xenforo.forecolor_desc",d.cmd="ForeColor",d.scope=this,a=b.editor.controlManager.createColorSplitButton("forecolor",d);return a},_createBackColorMenu:function(){var a,b=this,c=b.settings,d={},e;c.theme_xenforo_more_colors&&(d.more_colors_func=function(){b._mceColorPicker(0,{color:a.value,func:function(b){a.setColor(b)}})});if(e=c.theme_xenforo_background_colors)d.colors=e;c.theme_xenforo_default_background_color&&(d.default_color=c.theme_xenforo_default_background_color),d.title="xenforo.backcolor_desc",d.cmd="HiliteColor",d.scope=this,a=b.editor.controlManager.createColorSplitButton("backcolor",d);return a},renderUI:function(a){var d,f,g,h=this,i=h.editor,j=h.settings,k,l,m;i.settings&&(i.settings.aria_label=j.aria_label+i.getLang("advanced.help_shortcut")),d=l=b.create("span",{role:"application","aria-labelledby":i.id+"_voice",id:i.id+"_parent","class":"mceEditor "+i.settings.skin+"Skin"+(j.skin_variant?" "+i.settings.skin+"Skin"+h._ufirst(j.skin_variant):"")}),b.add(d,"span",{"class":"mceVoiceLabel",style:"display:none;",id:i.id+"_voice"},j.aria_label),b.boxModel||(d=b.add(d,"div",{"class":"mceOldBoxModel"})),d=k=b.add(d,"table",{role:"presentation",id:i.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0}),d=g=b.add(d,"tbody");switch((j.theme_xenforo_layout_manager||"").toLowerCase()){case"rowlayout":f=h._rowLayout(j,g,a);break;case"customlayout":f=i.execCallback("theme_xenforo_custom_layout",j,g,a,l);break;default:f=h._simpleLayout(j,g,a,l)}d=a.targetNode,m=k.rows,b.addClass(m[0],"mceFirst"),b.addClass(m[m.length-1],"mceLast"),e(b.select("tr",g),function(a){b.addClass(a.firstChild,"mceFirst"),b.addClass(a.childNodes[a.childNodes.length-1],"mceLast")}),b.get(j.theme_xenforo_toolbar_container)?b.get(j.theme_xenforo_toolbar_container).appendChild(l):b.insertAfter(l,d),c.add(i.id+"_path_row","click",function(a){a=a.target;if(a.nodeName=="A"){h._sel(a.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return c.cancel(a)}}),i.getParam("accessibility_focus")||c.add(b.add(l,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(i.id).focus()}),j.theme_xenforo_toolbar_location=="external"&&(a.deltaHeight=0),h.deltaHeight=a.deltaHeight,a.targetNode=null,i.onKeyDown.add(function(a,d){var e=121,f=122;if(d.altKey){if(d.keyCode===e){h.toolbarGroup.focus();return c.cancel(d)}if(d.keyCode===f){b.get(a.id+"_path_row").focus();return c.cancel(d)}}}),i.addShortcut("alt+0","","mceShortcuts",h);return{iframeContainer:f,editorContainer:i.id+"_parent",sizeContainer:k,deltaHeight:a.deltaHeight}},getInfo:function(){return{longname:"XenForo theme",author:"",authorurl:"",version:"1.0"}},resizeBy:function(a,c){var d=b.get(this.editor.id+"_ifr");this.resizeTo(d.clientWidth+a,d.clientHeight+c)},resizeTo:function(a,c){var d=this.editor,e=d.settings,f=b.get(d.id+"_tbl"),g=b.get(d.id+"_ifr"),h;a=Math.max(e.theme_xenforo_resizing_min_width||100,a),c=Math.max(e.theme_xenforo_resizing_min_height||100,c),a=Math.min(e.theme_xenforo_resizing_max_width||65535,a),c=Math.min(e.theme_xenforo_resizing_max_height||65535,c),h=f.clientHeight-g.clientHeight,b.setStyle(g,"height",c-h),b.setStyles(f,{width:a,height:c})},destroy:function(){var a=this.editor.id;c.clear(a+"_resize"),c.clear(a+"_path_row"),c.clear(a+"_external_close")},_simpleLayout:function(a,d,e,f){var h=this,i=h.editor,j=a.theme_xenforo_toolbar_location,k=a.theme_xenforo_statusbar_location,l,m,n,o;if(a.readonly){l=b.add(d,"tr"),l=m=b.add(l,"td",{"class":"mceIframeContainer"});return m}j=="top"&&h._addToolbars(d,e),j=="external"&&(l=o=b.create("div",{style:"position:relative"}),l=b.add(l,"div",{id:i.id+"_external","class":"mceExternalToolbar"}),b.add(l,"a",{id:i.id+"_external_close",href:"javascript:;","class":"mceExternalClose"}),l=b.add(l,"table",{id:i.id+"_tblext",cellSpacing:0,cellPadding:0}),n=b.add(l,"tbody"),f.firstChild.className=="mceOldBoxModel"?f.firstChild.appendChild(o):f.insertBefore(o,f.firstChild),h._addToolbars(n,e),i.onMouseUp.add(function(){var a=b.get(i.id+"_external");b.show(a),b.hide(g);var d=c.add(i.id+"_external_close","click",function(){b.hide(i.id+"_external"),c.remove(i.id+"_external_close","click",d)});b.show(a),b.setStyle(a,"top",0-b.getRect(i.id+"_tblext").h-1),b.hide(a),b.show(a),a.style.filter="",g=i.id+"_external",a=null})),k=="top"&&h._addStatusBar(d,e),a.theme_xenforo_toolbar_container||(l=b.add(d,"tr"),l=m=b.add(l,"td",{"class":"mceIframeContainer"})),j=="bottom"&&h._addToolbars(d,e),k=="bottom"&&h._addStatusBar(d,e);return m},_rowLayout:function(a,c,d){var f=this,g=f.editor,i,j,k=g.controlManager,l,m,n,o;i=a.theme_xenforo_containers_default_class||"",j=a.theme_xenforo_containers_default_align||"center",e(h(a.theme_xenforo_containers||""),function(e,g){var h=a["theme_xenforo_container_"+e]||"";switch(h.toLowerCase()){case"mceeditor":l=b.add(c,"tr"),l=m=b.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":f._addStatusBar(c,d);break;default:o=(a["theme_xenforo_container_"+e+"_align"]||j).toLowerCase(),o="mce"+f._ufirst(o),l=b.add(b.add(c,"tr"),"td",{"class":"mceToolbar "+(a["theme_xenforo_container_"+e+"_class"]||i)+" "+o||j}),n=k.createToolbar("toolbar"+g),f._addControls(h,n),b.setHTML(l,n.renderHTML()),d.deltaHeight-=a.theme_xenforo_row_height}});return m},_addControls:function(a,b){var c=this,d=c.settings,f,g=c.editor.controlManager;d.theme_xenforo_disable&&!c._disabled?(f={},e(h(d.theme_xenforo_disable),function(a){f[a]=1}),c._disabled=f):f=c._disabled,e(h(a),function(a){var d;if(!f||!f[a]){if(a=="tablecontrols"){e(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(a){a=c.createControl(a,g),a&&b.add(a)});return}if(a.indexOf("xenforo_")==0&&c.editor.plugins[a]&&c.editor.plugins[a].addButtons){c.editor.plugins[a].addButtons(c,b);return}d=c.createControl(a,g),d&&b.add(d)}})},_addToolbars:function(a,c){var d=this,e,f,g=d.editor,h=d.settings,i,j=g.controlManager,k,l,m=[],n,o;o=j.createToolbarGroup("toolbargroup",{name:g.getLang("advanced.toolbar"),tab_focus_toolbar:g.getParam("theme_advanced_tab_focus_toolbar")}),d.toolbarGroup=o,n=h.theme_xenforo_toolbar_align.toLowerCase(),n="mce"+d._ufirst(n),l=b.add(b.add(a,"tr",{role:"presentation"}),"td",{"class":"mceToolbar "+n,role:"presentation"});for(e=1;i=h["theme_xenforo_buttons"+e];e++)f=j.createToolbar("toolbar"+e,{"class":"mceToolbarRow"+e}),h["theme_xenforo_buttons"+e+"_add"]&&(i+=","+h["theme_xenforo_buttons"+e+"_add"]),h["theme_xenforo_buttons"+e+"_add_before"]&&(i=h["theme_xenforo_buttons"+e+"_add_before"]+","+i),d._addControls(i,f),o.add(f),c.deltaHeight-=h.theme_xenforo_row_height;m.push(o.renderHTML()),m.push(b.createHTML("a",{href:"#",accesskey:"z",title:"",onfocus:"tinyMCE.getInstanceById('"+g.id+"').focus();"},"<!-- IE -->")),b.setHTML(l,m.join("")),$(l).find("a[id$=removeformat]").focus(function(){tinyMCE.getInstanceById(g.id).focus()})},_addStatusBar:function(a,d){var e,g=this,h=g.editor,i=g.settings,j,k,l,m;e=b.add(a,"tr"),e=m=b.add(e,"td",{"class":"mceStatusbar"}),e=b.add(e,"div",{id:h.id+"_path_row",role:"group","aria-labelledby":h.id+"_path_voice"}),i.theme_advanced_path?(b.add(e,"span",{id:h.id+"_path_voice"},h.translate("advanced.path")),b.add(e,"span",{},": ")):b.add(e,"span",{},"&#160;"),i.theme_xenforo_resizing&&(b.add(m,"a",{id:h.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"}),i.theme_xenforo_resizing_use_cookie&&h.onPostRender.add(function(){var a=f.getHash("TinyMCE_"+h.id+"_size"),c=b.get(h.id+"_tbl");!a||(i.theme_xenforo_resize_horizontal&&(c.style.width=Math.max(10,a.cw)+"px"),c.style.height=Math.max(10,a.ch)+"px",b.get(h.id+"_ifr").style.height=Math.max(10,parseInt(a.ch)+g.deltaHeight)+"px")}),h.onPostRender.add(function(){c.add(h.id+"_resize","mousedown",function(a){var d,e,g,m,n,o;d=b.get(h.id+"_tbl"),g=d.clientWidth,m=d.clientHeight,miw=i.theme_xenforo_resizing_min_width||100,mih=i.theme_xenforo_resizing_min_height||100,maw=i.theme_xenforo_resizing_max_width||65535,mah=i.theme_xenforo_resizing_max_height||65535,e=b.add(b.get(h.id+"_parent"),"div",{"class":"mcePlaceHolder"}),b.setStyles(e,{width:g,height:m}),b.hide(d),b.show(e),j={x:a.screenX,y:a.screenY,w:g,h:m,dx:null,dy:null},k=c.add(b.doc,"mousemove",function(a){var b,d;j.dx=a.screenX-j.x,j.dy=a.screenY-j.y,b=Math.max(miw,j.w+j.dx),d=Math.max(mih,j.h+j.dy),b=Math.min(maw,b),d=Math.min(mah,d),i.theme_xenforo_resize_horizontal&&(e.style.width=b+"px"),e.style.height=d+"px";return c.cancel(a)}),l=c.add(b.doc,"mouseup",function(a){var g;c.remove(b.doc,"mousemove",k),c.remove(b.doc,"mouseup",l),d.style.display="",b.remove(e),j.dx!==null&&(g=b.get(h.id+"_ifr"),i.theme_xenforo_resize_horizontal&&(d.style.width=Math.max(10,j.w+j.dx)+"px"),d.style.height=Math.max(10,j.h+j.dy)+"px",g.style.height=Math.max(10,g.clientHeight+j.dy)+"px",i.theme_xenforo_resizing_use_cookie&&f.setHash("TinyMCE_"+h.id+"_size",{cw:j.w+j.dx,ch:j.h+j.dy}))});return c.cancel(a)})})),d.deltaHeight-=21,e=a=null},_updateUndoStatus:function(a){var b=a.controlManager;b.setDisabled("undo",!a.undoManager.hasUndo()&&!a.typing),b.setDisabled("redo",!a.undoManager.hasRedo())},_nodeChanged:function(c,d,e,f){var g=this,h,i=0,j,k,l=g.settings,m,n,o;if(!l.readonly){a.each(g.stateControls,function(a){d.setActive(a,c.queryCommandState(g.controls[a][1]))}),d.setActive("visualaid",c.hasVisual),d.setDisabled("undo",!c.undoManager.hasUndo()&&!c.typing),d.setDisabled("redo",!c.undoManager.hasRedo()),d.setDisabled("outdent",!c.queryCommandState("Outdent")),h=b.getParent(e,"A");if(k=d.get("link"))if(!h||!h.name)k.setDisabled(!h&&f),k.setActive(!!h);if(k=d.get("unlink"))k.setDisabled(!h&&f),k.setActive(!!h&&!h.name);if(k=d.get("anchor"))k.setActive(!f&&!!h&&h.name),a.isWebKit&&(h=b.getParent(e,"IMG"),k.setActive(!!h&&b.getAttrib(h,"mce_name")=="a"));h=b.getParent(e,"IMG"),(k=d.get("image"))&&k.setActive(!f&&!!h&&e.className.indexOf("mceItem")==-1);if(k=d.get("styleselect"))e.className?(g._importClasses(),k.select(e.className)):k.select();if(k=d.get("formatselect"))h=b.getParent(e,b.isBlock),h&&k.select(h.nodeName.toLowerCase());if(c.settings.convert_fonts_to_spans)c.dom.getParent(e,function(a){a.nodeName==="SPAN"&&(!m&&a.className&&(m=a.className),!n&&a.style.fontSize&&(n=a.style.fontSize),!o&&a.style.fontFamily&&(o=a.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()));return!1}),(k=d.get("fontselect"))&&k.select(function(a){return a.
    replace(/^([^,]+).*/,"$1").toLowerCase()==o}),(k=d.get("fontsizeselect"))&&k.select(function(a){if(a.fontSize&&a.fontSize===n)return!0;if(a["class"]&&a["class"]===m)return!0});else{(k=d.get("fontselect"))&&k.select(c.queryCommandValue("FontName"));if(k=d.get("fontsizeselect"))j=c.queryCommandValue("FontSize"),k.select(function(a){return a.fontSize==j})}l.theme_xenforo_path&&l.theme_xenforo_statusbar_location&&(h=b.get(c.id+"_path")||b.add(c.id+"_path_row","span",{id:c.id+"_path"}),b.setHTML(h,""),c.dom.getParent(e,function(c){var d=c.nodeName.toLowerCase(),e,f,k="";if(c.nodeType==1&&c.nodeName!=="BR"&&!b.hasClass(c,"mceItemHidden")&&!b.hasClass(c,"mceItemRemoved")){if(j=b.getAttrib(c,"mce_name"))d=j;a.isIE&&c.scopeName!=="HTML"&&(d=c.scopeName+":"+d),d=d.replace(/mce\:/g,"");switch(d){case"b":d="strong";break;case"i":d="em";break;case"img":if(j=b.getAttrib(c,"src"))k+="src: "+j+" ";break;case"a":if(j=b.getAttrib(c,"name"))k+="name: "+j+" ",d+="#"+j;if(j=b.getAttrib(c,"href"))k+="href: "+j+" ";break;case"font":l.convert_fonts_to_spans&&(d="span");if(j=b.getAttrib(c,"face"))k+="font: "+j+" ";if(j=b.getAttrib(c,"size"))k+="size: "+j+" ";if(j=b.getAttrib(c,"color"))k+="color: "+j+" ";break;case"span":if(j=b.getAttrib(c,"style"))k+="style: "+j+" "}if(j=b.getAttrib(c,"id"))k+="id: "+j+" ";if(j=c.className){j=j.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,"");if(j&&j.indexOf("mceItem")==-1){k+="class: "+j+" ";if(b.isBlock(c)||d=="img"||d=="span")d+="."+j}}d=d.replace(/(html:)/g,""),d={name:d,node:c,title:k},g.onResolveName.dispatch(g,d),k=d.title,d=d.name,f=b.create("a",{href:"javascript:;",onmousedown:"return false;",title:k,"class":"mcePath_"+i++},d),h.hasChildNodes()?(h.insertBefore(b.doc.createTextNode(" » "),h.firstChild),h.insertBefore(f,h.firstChild)):h.appendChild(f)}},c.getBody()))}},_sel:function(a){this.editor.execCommand("mceSelectNodeDepth",!1,a)},_mceHelp:function(){var a=this.editor;a.windowManager.open({url:this._getFullDialogUrl("about"),width:480,height:380,inline:!0},{theme_url:this.url})},_mceColorPicker:function(a,b){var c=this.editor;b=b||{},c.windowManager.open({url:this._getFullDialogUrl("color_picker"),width:375+parseInt(c.getLang("xenforo.colorpicker_delta_width",0)),height:250+parseInt(c.getLang("xenforo.colorpicker_delta_height",0)),close_previous:!1,inline:!0,translate_i18n:!1},{input_color:b.color,func:b.func,theme_url:this.url})},_mceImage:function(a,b){var c=this.editor;c.dom.getAttrib(c.selection.getNode(),"class").indexOf("mceItem")==-1&&c.windowManager.open({url:this._getFullDialogUrl("image"),width:355+parseInt(c.getLang("xenforo.image_delta_width",0)),height:275+parseInt(c.getLang("xenforo.image_delta_height",0)),inline:!0,translate_i18n:!1},{theme_url:this.url})},_mceLink:function(a,b){var c=this.editor;c.windowManager.open({url:this._getFullDialogUrl("link"),width:310+parseInt(c.getLang("xenforo.link_delta_width",0)),height:200+parseInt(c.getLang("xenforo.link_delta_height",0)),inline:!0,translate_i18n:!1},{theme_url:this.url})},_mceForeColor:function(){var a=this;this._mceColorPicker(0,{color:a.fgColor,func:function(b){a.fgColor=b,a.editor.execCommand("ForeColor",!1,b)}})},_mceBackColor:function(){var a=this;this._mceColorPicker(0,{color:a.bgColor,func:function(b){a.bgColor=b,a.editor.execCommand("HiliteColor",!1,b)}})},_ufirst:function(a){return a.substring(0,1).toUpperCase()+a.substring(1)},_getFullDialogUrl:function(a){var b=this.settings.theme_xenforo_dialog_url;return b.indexOf("?")==-1?b+"?dialog="+encodeURIComponent(a):b+"&dialog="+encodeURIComponent(a)},_RemoveFormat:function(){if(!this._removeFormatExecuting){this._removeFormatExecuting=!0;var a=this.editor;a.execCommand("removeFormat",!1),a.formatter.remove("xenForoRemoveFormat"),this._removeFormatExecuting=!1}},_removeFormatExecuting:!1,_Indent:function(a,b){return this._handleIndentOutdent("indent")},_Outdent:function(a){return this._handleIndentOutdent("outdent")},_handleIndentOutdent:function(a){var b,c,d,f=XenForo.isRTL()?"paddingRight":"paddingLeft",g=this.editor,h=g.selection,i=g.dom;b=g.settings.indentation,c=/[a-z%]+$/i.exec(b),b=parseInt(b),!g.queryCommandState("InsertUnorderedList")&&!g.queryCommandState("InsertOrderedList")?e(h.getSelectedBlocks(),function(e){a=="outdent"?(d=Math.max(0,parseInt(e.style[f]||0)-b),i.setStyle(e,f,d?d+c:"")):i.setStyle(e,f,parseInt(e.style[f]||0)+b+c)}):g.getDoc().execCommand(a,!1,null)},_queryOutdent:function(){var a,b=XenForo.isRTL()?"paddingRight":"paddingLeft",c=this.editor,d=c.settings,e=c.selection,f=c.dom;if(d.inline_styles){if((a=f.getParent(e.getStart(),f.isBlock))&&parseInt(a.style[b])>0)return!0;if((a=f.getParent(e.getEnd(),f.isBlock))&&parseInt(a.style[b])>0)return!0}return c.queryCommandState("InsertUnorderedList")||c.queryCommandState("InsertOrderedList")||!d.inline_styles&&!!f.getParent(e.getNode(),"BLOCKQUOTE")}}),a.ThemeManager.add("xenforo",a.themes.XenForoTheme)}(tinymce)
     
  5. huydateh00

    huydateh00 Member

    Bài viết:
    121
    Likes :
    25
    Mình edit file đó = notepad khi lưu lại thì bị mất hết thanh button @@

    Khi mình download file này up lên dùng thử thì ban đầu dùng đc, nhưng sau khi edit (ko thừa ko thiếu dòng nào) thì bị mất button như trên.

    Mình nghĩ edit cái này phải dùng trình gì rùi ?? bác nào biết xin chỉ giáo :D
     
  6. 1234nguyenlinh

    1234nguyenlinh New Member

    Bài viết:
    51
    Likes :
    3
  7. hoang tai

    hoang tai New Member

    Bài viết:
    8
    Likes :
    1
    Đoạn code sửa lại :
    Mã:
    addButtons : function (theme, tb)
    {
    var tags = theme.settings.xenforo_custom_bbcode_tags,
    controlManager = theme.editor.controlManager;
     
    //tb.add(controlManager.createControl('|'));
     
    tb.add(controlManager.createButton('xenforo_quote',
    { title: 'xenforo.quote', cmd: 'xenForoWrapBbCode', ui: false, value: 'QUOTE' },
                tb.add(controlManager.createButton('xenforo_doc',
                        { title: 'Google Doc', image : '/styles/img/GoogleDocs.jpg', cmd: 'xenForoWrapBbCode', ui: false, value: 'gdoc' },
    tb.add(controlManager.createButton('xenforo_hide',
                        { title: 'Hide', image : '/styles/img/hide.gif', cmd: 'xenForoWrapBbCode', ui: false, value: 'an' }
              ))
              ))
    ));
    Khi thêm 1 bbcode thì thêm vào
    Mã:
    ))
    và nhớ xóa dấu
    Mã:
    ,
    Ở bbcode cuối cùng
     
    nhoveai thích bài này.
  8. yukitoro

    yukitoro New Member

    Bài viết:
    4
    Likes :
    1
    Cái thanh soạn thảo giống bạn là add on gì vậy?
     
  9. ku Hiệu

    ku Hiệu Lì Lắm Luôn

    Bài viết:
    1,345
    Likes :
    862
    xenForo phiên bản cũ đấy X_X
     
    yukitoro thích bài này.
  10. yukitoro

    yukitoro New Member

    Bài viết:
    4
    Likes :
    1
    Vậy có bộ soạn thảo nào tốt cho xen 1.2.x không bạn?
     
  11. vansontv1

    vansontv1 New Member

    Bài viết:
    19
    Likes :
    0
    Ku Hiệu ơi trong js của mình khong có thẻ /js/tinymce/themes/xenforo/editor_template.js như cậu nói cậu xem giùm nhé Demo
    Urểghtitled
     
  12. vansontv

    vansontv Member

    Bài viết:
    80
    Likes :
    6
    lên
     
comments powered by Disqus
: thoden.it

Chia sẻ trang này

Đang tải...