if(!dojo.hostenv.findModule("xg.index.embed.badge",false)){ dojo.provide("xg.index.embed.badge"); xg.index.embed.badge={initialize:function(){ var _1=x$("div.xj_badge_body"); var _2=_1.attr("_embedCode"); _1.html(_2); }}; xg.addOnRequire(function(){ xg.index.embed.badge.initialize(); }); } if(!dojo.hostenv.findModule("xg.index.util.ScrollIntoView",false)){ dojo.provide("xg.index.util.ScrollIntoView"); xg.index.util.ScrollIntoView={scrollIntoView:function(_1){ var _2=x$(_1); var _3=_2.css("padding-top"); var _4=_2.css("padding-bottom"); var _5=_3&&_3.indexOf("px")>-1?parseInt(_3,10):0; var _6=_4&&_4.indexOf("px")>-1?parseInt(_4,10):0; var _7={top:_2.offset().top+_5,bottom:_2.offset().top+_2.height()+_6}; var _8={top:x$(window).scrollTop(),bottom:x$(window).scrollTop()+x$(window).height()}; var _9; if(_7.top<_8.top){ _9=_7.top; }else{ if(_7.bottom>_8.bottom){ _9=Math.min(_7.top,_8.top+(_7.bottom-_8.bottom)); } } if(_9){ x$("html,body").animate({scrollTop:_9},100); } }}; } if(!dojo.hostenv.findModule("xg.shared.EditUtil",false)){ dojo.provide("xg.shared.EditUtil"); xg.shared.EditUtil={showModuleForm:function(_1,_2,_3){ _1.style.height="0px"; dojo.html.show(_1); dojo.lfx.html.wipeIn(_1,200).play(); },hideModuleForm:function(_4,_5,_6,_7){ dojo.html.removeClass(_6,"close"); dojo.lfx.html.wipeOut(_4,200,null,function(){ dojo.html.hide(_4); if(_7){ _7(); } }).play(); }}; } if(!dojo.hostenv.findModule("xg.index.embed.BadgeModule",false)){ dojo.provide("xg.index.embed.BadgeModule"); dojo.widget.defineWidget("xg.index.embed.BadgeModule",dojo.widget.HtmlWidget,{_setValuesUrl:"",_badgeSizeSet:"",_badgeSizeOptionsJson:"",fillInTemplate:function(_1,_2){ this.module=this.getFragNodeRef(_2); this.h2=this.module.getElementsByTagName("h2")[0]; dojo.dom.insertAfter(dojo.html.createNodesFromText("

"+xg.index.nls.html("edit")+"

")[0],this.h2); dojo.event.connect(this.module.getElementsByTagName("a")[0],"onclick",dojo.lang.hitch(this,function(_3){ dojo.event.browser.stopEvent(_3); if((!this.form)||(this.form.style.height=="0px")){ this.showForm(); }else{ this.hideForm(); } })); },showForm:function(){ var _4=this.module.getElementsByTagName("a")[0]; var _5=""; dojo.lang.forEach(dj_eval(this._badgeSizeOptionsJson),function(_6){ _5+=""; }); if(!this.form){ this.form=xg.shared.util.createElement("
"+xg.index.nls.html("cancel")+"
"); this.head=dojo.html.getElementsByClass("xg_module_head",this.module)[0]; dojo.dom.insertAfter(this.form,this.head); this.formHeight=this.form.offsetHeight; this.form.style.height="0px"; dojo.event.connect(this.form,"onsubmit",dojo.lang.hitch(this,function(_7){ this.save(_7); })); dojo.event.connect(dojo.byId(this.widgetId+"_cancelbtn"),"onclick",dojo.lang.hitch(this,function(_8){ dojo.event.browser.stopEvent(_8); this.hideForm(); })); }else{ dojo.html.removeClass(this.form,"collapsed"); } this.form.style.height="0px"; xg.index.util.FormHelper.select(this._badgeSizeSet,dojo.byId(this.widgetId+"_badgeSize")); xg.shared.EditUtil.showModuleForm(this.form,this.formHeight,_4); },hideForm:function(){ var _9=this.module.getElementsByTagName("a")[0]; xg.shared.EditUtil.hideModuleForm(this.form,this.formHeight,_9); },save:function(_a){ dojo.event.browser.stopEvent(_a); this._badgeSizeSet=xg.index.util.FormHelper.selectedOption(dojo.byId(this.widgetId+"_badgeSize")).value; this.hideForm(); dojo.io.bind({url:this._setValuesUrl,method:"post",content:{badgeSizeSet:this._badgeSizeSet},preventCache:true,mimetype:"text/javascript",encoding:"utf-8",load:dojo.lang.hitch(this,dojo.lang.hitch(this,function(_b,_c,_d){ dojo.lang.forEach(dojo.html.getElementsByClass("xg_module_body",this.module),function(_e){ dojo.dom.removeNode(_e); }); x$(".xg_module_foot",this.module).before(dojo.html.createNodesFromText(_c.moduleBodyAndFooterHtml)); xg.shared.util.fixImagesInIE(this.module.getElementsByTagName("img")); xg.shared.util.parseWidgets(dojo.html.getElementsByClass("xg_module_body",this.module)[0]); if(!dojo.hostenv.findModule("xg.index.embed.badge",false)){ ning.loader.require("xg.index.embed.badge"); }else{ xg.index.embed.badge.initialize(); } }))}); }}); } if(!dojo.hostenv.findModule("xg.profiles.embed.MembersModule",false)){ dojo.provide("xg.profiles.embed.MembersModule"); dojo.widget.defineWidget("xg.profiles.embed.MembersModule",dojo.widget.HtmlWidget,{_setValuesUrl:"",_displaySet:"",_displayOptionsJson:"",_sortSet:"",_sortOptionsJson:"",_rowsSet:"",_rowsOptionsJson:"",isContainer:true,fillInTemplate:function(_1,_2){ this.module=this.getFragNodeRef(_2); this.h2=this.module.getElementsByTagName("h2")[0]; dojo.dom.insertAfter(dojo.html.createNodesFromText("

"+xg.profiles.nls.html("edit")+"

")[0],this.h2); dojo.event.connect(this.module.getElementsByTagName("a")[0],"onclick",dojo.lang.hitch(this,function(_3){ dojo.event.browser.stopEvent(_3); if((!this.form)||(this.form.style.height=="0px")){ this.showForm(); }else{ this.hideForm(); } })); },showForm:function(){ var _4=this.module.getElementsByTagName("a")[0]; var _5=""; dojo.lang.forEach(dj_eval(this._displayOptionsJson),function(_6){ _5+=""; }); var _7=""; dojo.lang.forEach(dj_eval(this._sortOptionsJson),function(_8){ _7+=""; }); var _9=""; dojo.lang.forEach(dj_eval(this._rowsOptionsJson),function(_a){ _9+=""; }); if(!this.form){ this.form=dojo.html.createNodesFromText(dojo.string.trim("
"+xg.profiles.nls.html("rows")+"
"+xg.profiles.nls.html("cancel")+"
"))[0]; this.head=dojo.html.getElementsByClass("xg_module_head",this.module)[0]; dojo.dom.insertAfter(this.form,this.head); this.formHeight=this.form.offsetHeight; this.form.style.height="0px"; dojo.event.connect(this.form,"onsubmit",dojo.lang.hitch(this,function(_b){ this.save(_b); })); dojo.event.connect(dojo.byId(this.widgetId+"_cancelbtn"),"onclick",dojo.lang.hitch(this,function(_c){ dojo.event.browser.stopEvent(_c); this.hideForm(); })); }else{ dojo.html.removeClass(this.form,"collapsed"); } this.form.style.height="0px"; xg.index.util.FormHelper.select(this._displaySet,dojo.byId(this.widgetId+"_display")); xg.index.util.FormHelper.select(this._sortSet,dojo.byId(this.widgetId+"_sort")); xg.index.util.FormHelper.select(this._rowsSet,dojo.byId(this.widgetId+"_rows")); xg.shared.EditUtil.showModuleForm(this.form,this.formHeight,_4); },hideForm:function(){ var _d=this.module.getElementsByTagName("a")[0]; xg.shared.EditUtil.hideModuleForm(this.form,this.formHeight,_d); },save:function(_e){ dojo.event.browser.stopEvent(_e); this._displaySet=xg.index.util.FormHelper.selectedOption(dojo.byId(this.widgetId+"_display")).value; this._sortSet=xg.index.util.FormHelper.selectedOption(dojo.byId(this.widgetId+"_sort")).value; this._rowsSet=xg.index.util.FormHelper.selectedOption(dojo.byId(this.widgetId+"_rows")).value; this.hideForm(); dojo.io.bind({url:this._setValuesUrl,method:"post",content:{displaySet:this._displaySet,sortSet:this._sortSet,rowsSet:this._rowsSet},preventCache:true,mimetype:"text/javascript",encoding:"utf-8",load:dojo.lang.hitch(this,dojo.lang.hitch(this,function(_f,_10,_11){ dojo.lang.forEach(dojo.html.getElementsByClass("xg_module_body",this.module),function(_12){ dojo.dom.removeNode(_12); }); var _13=dojo.html.getElementsByClass("xg_module_foot",this.module)[0]; if(_13){ dojo.dom.removeNode(_13); } dojo.lang.forEach(dojo.html.createNodesFromText(_10.moduleBodyAndFooterHtml),dojo.lang.hitch(this,function(_14){ dojo.dom.insertAtPosition(_14,this.module,"last"); })); xg.shared.util.fixImagesInIE(this.module.getElementsByTagName("img")); xg.shared.util.parseWidgets(dojo.html.getElementsByClass("xg_module_body",this.module)[0]); }))}); }}); } if(!dojo.hostenv.findModule("xg.profiles.embed.blog",false)){ dojo.provide("xg.profiles.embed.blog"); dojo.provide("xg.profiles.embed.blog.BlogModule"); dojo.widget.defineWidget("xg.profiles.embed.blog.BlogModule",dojo.widget.HtmlWidget,{_url:"",_updateUrl:"",_layoutType:"",_displaySet:"",_displayOptionsJson:"",_excerptLengthOptionsJson:"",_excerptLengthSet:"",_sortSet:"",_sortOptionsJson:"",_postsSet:"",_postsTitleOptionsJson:"",_postsDetailOptionsJson:"",postsTitleOptionsHtml:"",postsDetailOptionsHtml:"",fillInTemplate:function(_1,_2){ this.module=this.getFragNodeRef(_2); this.h2=this.module.getElementsByTagName("h2")[0]; dojo.dom.insertAfter(dojo.html.createNodesFromText("

"+xg.profiles.nls.html("edit")+"

")[0],this.h2); var _3=dj_eval(this._postsTitleOptionsJson); var _4=dj_eval(this._postsDetailOptionsJson); var _5=""; dojo.lang.forEach(_3,function(_6){ _5+=""; }); var _7=""; dojo.lang.forEach(_4,function(_8){ _7+=""; }); this.postsTitleOptionsHtml=_5; this.postsDetailOptionsHtml=_7; dojo.event.connect(this.module.getElementsByTagName("a")[0],"onclick",dojo.lang.hitch(this,function(_9){ dojo.event.browser.stopEvent(_9); if((!this.form)||(this.form.style.height=="0px")){ this.showForm(); }else{ this.hideForm(); } })); },showForm:function(){ var _a=this.module.getElementsByTagName("a")[0]; this.head=dojo.html.getElementsByClass("xg_module_head",this.module)[0]; this.body=dojo.html.getElementsByClass("xg_module_body",this.module)[0]; this.foot=dojo.html.getElementsByClass("xg_module_foot",this.module)[0]; if(!this.form){ var _b=""; dojo.lang.forEach(dj_eval(this._displayOptionsJson),function(_c){ _b+=""; }); if(this._sortOptionsJson){ var _d=""; dojo.lang.forEach(dj_eval(this._sortOptionsJson),function(_e){ _d+=""; }); } var _f=""; if(this._excerptLengthOptionsJson){ var _10=dj_eval(this._excerptLengthOptionsJson); for(var _11=0;_11<_10.length;_11++){ _f+=""; } } this.form=dojo.html.createNodesFromText(dojo.string.trim("
"+(this._sortOptionsJson?"
":"")+"
"+xg.profiles.nls.html("posts")+"
"+xg.profiles.nls.html("htmlCharacters")+"
"+xg.profiles.nls.html("cancel")+"
"))[0]; dojo.dom.insertAfter(this.form,this.head); this.formHeight=this.form.offsetHeight; this.form.style.height="0px"; dojo.event.connect(this.form,"onsubmit",dojo.lang.hitch(this,function(_12){ this.save(_12); })); dojo.event.connect(dojo.byId(this.widgetId+"_cancelbtn"),"onclick",dojo.lang.hitch(this,function(_13){ dojo.event.browser.stopEvent(_13); this.hideForm(); })); }else{ dojo.html.removeClass(this.form,"collapsed"); } this.form.style.height=0; xg.index.util.FormHelper.select(this._displaySet,dojo.byId(this.widgetId+"_display")); if(this._sortOptionsJson){ xg.index.util.FormHelper.select(this._sortSet,dojo.byId(this.widgetId+"_sort")); } xg.index.util.FormHelper.select(this._excerptLengthSet,dojo.byId(this.widgetId+"_excerptLength")); this.updateFieldDisplay(); var _14=this; x$("#"+this.widgetId+"_display").change(function(){ _14.updateFieldDisplay(true); }); xg.shared.EditUtil.showModuleForm(this.form,this.formHeight,_a); },updateFieldDisplay:function(_15){ if(dojo.byId(this.widgetId+"_display").value=="detail"){ x$("#"+this.widgetId+"_posts").html(this.postsDetailOptionsHtml); if(_15||!xg.index.util.FormHelper.select(this._postsSet,dojo.byId(this.widgetId+"_posts"))){ xg.index.util.FormHelper.select("4",dojo.byId(this.widgetId+"_posts")); } x$(".excerptItem",this.form).show(); }else{ x$("#"+this.widgetId+"_posts").html(this.postsTitleOptionsHtml); if(_15||!xg.index.util.FormHelper.select(this._postsSet,dojo.byId(this.widgetId+"_posts"))){ xg.index.util.FormHelper.select("5",dojo.byId(this.widgetId+"_posts")); } x$(".excerptItem",this.form).hide(); } },hideForm:function(){ var _16=this.module.getElementsByTagName("a")[0]; xg.shared.EditUtil.hideModuleForm(this.form,this.formHeight,_16); },updateEmbed:function(ui){ var _18=this.module.parentNode.getAttribute("_maxembedwidth"); dojo.io.bind({url:this._updateUrl,method:"post",encoding:"utf-8",mimetype:"text/json",preventCache:true,content:{maxEmbedWidth:_18},load:dojo.lang.hitch(this,function(_19,_1a,_1b){ this.module.getElementsByTagName("h2")[0].innerHTML=dojo.string.escape("html",_1a.embedTitle); var _1c=dojo.html.getElementsByClass("xg_module_foot",this.module)[0]; if(_1c){ dojo.dom.removeNode(_1c); } x$(this.module).find(".xg_module_body").replaceWith(_1a.moduleBodyHtml); ui.item.css("visibility",""); var _1d=this.module.getElementsByTagName("div")[0]; if(dojo.html.hasClass(_1d,"xg_handle")){ dojo.style.hide(_1d); } })}); },save:function(_1e){ dojo.event.browser.stopEvent(_1e); var _1f=this.module.parentNode.getAttribute("_maxembedwidth"); this._displaySet=xg.index.util.FormHelper.selectedOption(dojo.byId(this.widgetId+"_display")).value; if(this._sortOptionsJson){ this._sortSet=xg.index.util.FormHelper.selectedOption(dojo.byId(this.widgetId+"_sort")).value; } this._postsSet=xg.index.util.FormHelper.selectedOption(dojo.byId(this.widgetId+"_posts")).value; if(this._excerptLengthOptionsJson){ this._excerptLengthSet=x$("#"+this.widgetId+"_excerptLength").val(); } if("undefined"!=typeof this.body){ this.body.innerHTML=xg.profiles.nls.html("loading"); }else{ x$(this.foot).before("
"+xg.profiles.nls.html("loading")+"
"); } this.hideForm(); dojo.io.bind({url:this._url,method:"post",preventCache:true,encoding:"utf-8",mimetype:"text/javascript",content:{displaySet:this._displaySet,sortSet:this._sortSet,postsSet:this._postsSet,excerptLengthSet:this._excerptLengthSet,maxEmbedWidth:_1f},load:dojo.lang.hitch(this,function(_20,_21,_22){ this.h2.innerHTML=dojo.string.escape("html",_21.embedTitle); var _23="undefined"!=typeof this.body; var _24=_23?x$(this.body).prev()[0]:x$(this.head).next()[0]; if(_23){ x$(this.body).remove(); }else{ x$(".xj_loading_msg").remove(); } x$(this.foot).remove(); x$(_24).after(_21.moduleBodyHtml); xg.shared.util.parseWidgets(x$(_24).next()[0]); })}); }}); } if(!dojo.hostenv.findModule("xg.profiles.embed.BirthdaysModule",false)){ dojo.provide("xg.profiles.embed.BirthdaysModule"); dojo.widget.defineWidget("xg.profiles.embed.BirthdaysModule",dojo.widget.HtmlWidget,{_setValuesUrl:"",_itemCountSet:"",_itemCountOptionsJson:"",fillInTemplate:function(_1,_2){ this.module=this.getFragNodeRef(_2); this.h2=this.module.getElementsByTagName("h2")[0]; dojo.dom.insertAfter(dojo.html.createNodesFromText("

"+xg.profiles.nls.html("edit")+"

")[0],this.h2); dojo.event.connect(this.module.getElementsByTagName("a")[0],"onclick",dojo.lang.hitch(this,function(_3){ dojo.event.browser.stopEvent(_3); if((!this.form)||(this.form.style.height=="0px")){ this.showForm(); }else{ this.hideForm(); } })); },showForm:function(){ var _4=this.module.getElementsByTagName("a")[0]; var _5=""; dojo.lang.forEach(dj_eval(this._itemCountOptionsJson),function(_6){ _5+=""; }); if(!this.form){ this.form=xg.shared.util.createElement("
"+xg.profiles.nls.html("birthdays")+"
"+xg.profiles.nls.html("cancel")+"
"); this.head=dojo.html.getElementsByClass("xg_module_head",this.module)[0]; dojo.dom.insertAfter(this.form,this.head); this.formHeight=this.form.offsetHeight; this.form.style.height="0px"; dojo.event.connect(this.form,"onsubmit",dojo.lang.hitch(this,function(_7){ this.save(_7); })); dojo.event.connect(dojo.byId(this.widgetId+"_cancelbtn"),"onclick",dojo.lang.hitch(this,function(_8){ dojo.event.browser.stopEvent(_8); this.hideForm(); })); }else{ dojo.html.removeClass(this.form,"collapsed"); } this.form.style.height="0px"; xg.index.util.FormHelper.select(this._itemCountSet,dojo.byId(this.widgetId+"_itemCount")); xg.shared.EditUtil.showModuleForm(this.form,this.formHeight,_4); },hideForm:function(){ var _9=this.module.getElementsByTagName("a")[0]; xg.shared.EditUtil.hideModuleForm(this.form,this.formHeight,_9); },save:function(_a){ dojo.event.browser.stopEvent(_a); this._itemCountSet=xg.index.util.FormHelper.selectedOption(dojo.byId(this.widgetId+"_itemCount")).value; this.hideForm(); dojo.io.bind({url:this._setValuesUrl,method:"post",content:{itemCountSet:this._itemCountSet},preventCache:true,mimetype:"text/javascript",encoding:"utf-8",load:dojo.lang.hitch(this,dojo.lang.hitch(this,function(_b,_c,_d){ dojo.lang.forEach(dojo.html.getElementsByClass("xg_module_body",this.module),function(_e){ dojo.dom.removeNode(_e); }); dojo.lang.forEach(dojo.html.createNodesFromText(_c.moduleBodyAndFooterHtml),dojo.lang.hitch(this,function(_f){ dojo.dom.insertAtPosition(_f,this.module,"last"); })); xg.shared.util.fixImagesInIE(this.module.getElementsByTagName("img")); xg.shared.util.parseWidgets(dojo.html.getElementsByClass("xg_module_body",this.module)[0]); }))}); }}); } if(!dojo.hostenv.findModule("xg.shared.editors.PlainEditor",false)){ dojo.provide("xg.shared.editors.PlainEditor"); xg.shared.editors.PlainEditor=function(_1){ var _2={}; var _={}; _2.setMaxLength=function(_4){ xg.shared.util.setAdvisableMaxLength(_1[0],_4); }; _2.updateBackgroundColor=function(){ }; _2.val=function(){ if(arguments.length){ _1.val(arguments[0]); return; } return _1.val(); }; _2.valWithLineBreakAdjustments=function(){ return _2.val(); }; _2.adjustLineBreaks=function(){ }; _2.unadjustLineBreaks=function(){ }; _2.initializeAfterPageLoad=function(){ return _2; }; _2.uninitialize=function(){ return _2; }; _2.focus=function(){ _1[0].focus(); }; _2.moveCursorToStart=function(){ xg.shared.editors.Editor.moveCursorToStart(_1[0]); }; _2.updateTextarea=function(){ }; _2.setEnabled=function(_5){ if(_5){ _1.removeClass("disabled").prop("disabled",false); }else{ _1.addClass("disabled").prop("disabled",true); } }; _2.getTextarea=function(){ return _1; }; return _2; }; } if(!dojo.hostenv.findModule("xg.shared.editors.tinymce.WordpressLineBreakRules",false)){ dojo.provide("xg.shared.editors.tinymce.WordpressLineBreakRules"); xg.shared.editors.tinymce.WordpressLineBreakRules=(function($){ var _2={}; var _={}; var _4=""; var _5=""; var _6="OBJECT|EMBED|PARAM|APPLET|IFRAME|SCRIPT|BR|ADDRESS|BLOCKQUOTE|CENTER|DIR|DIV|DL|FIELDSET|FORM|H1|H2|H3|H4|H5|H6|HR|ISINDEX|MENU|NOFRAMES|NOSCRIPT|OL|P|PRE|TABLE|UL|DD|DT|FRAMESET|LI|TBODY|TD|TFOOT|TH|THEAD|TR"; var _7="(?:[^>\\n\"']|'([^'\\n]|\\\\')*'|\"([^\"\\n]|\\\\\")*\")*"; _2.adjustLineBreaksEnteredInHtmlMode=function(s){ if(s.match(//gi,function(_a){ _9.push(_a); return "
"+(_9.length-1)+"
"; }); while(true){ var _b=s.replace(new RegExp("(<[^\\s]"+_7+")\\n+","g"),"$1 "); if(s==_b){ break; } s=_b; } s=s.replace(/

\s*<\/p>/g,"

 

"); s=s.replace(/
\s*<\/div>/g,"
 
"); s=s.replace(/\r\n/g,"\n"); s=s.replace(new RegExp(_4+"\\n","gi"),"
"); s=s.replace(new RegExp(_5+"\\n?","gi"),"\n\n"); s=s.replace(/(^[\n\s]*)|([\n\s]*$)/g,""); s=s.replace(new RegExp("[\\n\\s]*("); s=s.replace(/\n/g,"
"); s=s.replace(new RegExp("^\\s*(?!"); x$.each(_9,function(i,_d){ s=s.replace("
"+i+"
",_9[i]); }); return s; }; _2.adjustLineBreaksEnteredInVisualMode=function(s){ s=s.replace(new RegExp(_4+"(?!\\n)","gi"),"
\n"); return s; }; return _2; })(x$); } if(!dojo.hostenv.findModule("xg.shared.editors.tinymce.Utilities",false)){ dojo.provide("xg.shared.editors.tinymce.Utilities"); xg.shared.editors.tinymce.Utilities=(function($){ var _2={}; var _={}; var _4=27; var _5=7; var _6=1; var _7; var _8; var _9=[["mce_code"],["mce_link"],["mce_image"],["mce_file"],["mce_bold"],["mce_italic"],["mce_underline"],["mce_bullist"],["mce_numlist"],["mce_media"],["mce_removeformat"],["mce_justifyleft","mce_justifycenter","mce_justifyright"],["mce_strikethrough"],["mce_pastetext"],["mce_blockquote"],["mce_tinyautosave"]]; var _a=0; _.initialize=function(){ }; _2.addIdIfNecessary=function(_b){ if(!_b.attr("id")){ _b.attr("id","xj_mce_"+_a++); } }; _2.getEditor=function(_c){ if(!window.tinymce){ return null; } return tinymce.get("mce_fullscreen")||tinymce.get(_c.attr("id")); }; _2.updateLiquidLayout=function(_d){ var _e=_2.getEditor(_d)?x$(".mceToolbar:first",_2.getEditor(_d).getContainer()):_d.data("xj_html_toolbar").getElement().find("table:first"); var _f=_e.find(".mceToolbarRow1:first").find("td"); if(!_d.parent().hasClass("ultracompact-editor")){ _f.removeClass("dy-displaynone"); _d.parent().removeClass("uninitialized-liquid-layout"); _d.data("xj_html_toolbar").updateWidth(); _d.data("xj_html_dragbar").updateWidth(); return; } _f.addClass("dy-displaynone"); _d.parent().removeClass("uninitialized-liquid-layout"); _d.data("xj_html_toolbar").updateWidth(); _d.data("xj_html_dragbar").updateWidth(); var _10=_e.width(); if(!_10){ _f.find(".mce_code, .mce_link, .mce_image, .mce_bold, .mce_italic").parent().removeClass("dy-displaynone"); _f.find(".mce_bold, .mce_code").parent().prev().removeClass("dy-displaynone"); return; } for(var i=0;i<_9.length;i++){ var _12=_9[i]; var _13=2*_6+_f.filter(":visible").find(".mceSeparator").length*_5+1*_5+_f.filter(":visible").find(".mceButton").length*_4+_12.length*_4; if(_13>_10){ break; } for(var j=0;j<_12.length;j++){ var _15=_12[j]; _f.find("."+_15).parent().removeClass("dy-displaynone"); } var _16=true; _f.each(function(){ if(x$(this).find(".mceSeparator").length){ if(_16){ x$(this).addClass("dy-displaynone"); }else{ x$(this).removeClass("dy-displaynone"); } _16=true; }else{ if(x$(this).find(".mceButton").length&&x$(this).is(":visible")){ _16=false; } } }); } }; _2.updateBackgroundColor=function(_17,_18){ if(!_18.getDoc()){ return; } var _19=x$(_18.getDoc().body); var _1a=xg.shared.util.closest(_17,".error").length>0; if(_1a&&!_19.hasClass("error")){ _19.addClass("error").css("background-color","#FFF4F2"); }else{ if(!_1a&&_19.hasClass("error")){ _19.removeClass("error").css("background-color","#FFFFFF"); } } }; _2.saveSelection=function(_1b){ _7=undefined; _8=undefined; var _1c=_2.getEditor(_1b); if(_1c){ contentWindow=_1c.getWin(); contentWindow.focus(); if(contentWindow.document.selection){ _7=contentWindow.document.selection.createRange(); } return _1c.selection.getContent({format:"text"}); }else{ if(document.selection){ _1b.focus(); _7=document.selection.createRange(); return _7.text; }else{ if(_1b[0].selectionStart||_1b[0].selectionStart=="0"){ _8={start:_1b[0].selectionStart,end:_1b[0].selectionEnd}; return _1b[0].value.substring(_8.start,_8.end); } } } return ""; }; _2.overwriteSelection=function(_1d,_1e,_1f){ _2.restoreSelection(_1d); var _20=_2.getEditor(_1d); if(_20){ if(_1f){ _20.selection.collapse(false); } tinyMCE.execInstanceCommand(_20.id,"mceInsertContent",false,_1e); }else{ if(_7){ _7.text=_1e; if(_1f){ _7.collapse(); } }else{ if(_8){ var _21=_1d[0]; if(_8.end>_1d.val().length){ _8.end=_1d.val().length; } var _22=_21.scrollTop; _1d.val(_1d.val().slice(0,_8.start)+_1e+_1d.val().slice(_8.end)); _21.scrollTop=_22; _21.selectionStart=_8.start; _21.selectionEnd=_8.end=_8.start+_1e.length; if(_1f){ _21.selectionStart=_8.start=_8.end; } }else{ _1d[0].value+=_1e; } } } }; _2.restoreSelection=function(_23){ var _24=_2.getEditor(_23); if(_24){ contentWindow=_24.getWin(); if(_7){ _7.select(); } contentWindow.focus(); }else{ _23.focus(); } }; _2.getDefaultTargetForUrl=function(url){ if(url.indexOf(ning.CurrentApp.url)===0){ return "_self"; } for(var i=0;i=_28:false; }; _.countUploadedFiles=function(_29){ var val=_2.getEditor(_29)?_2.getEditor(_29).getContent():_29.val(); var _2b=val.match(/https?:\/\/api\.(xn.\.ningops\.net|ning\.com)(:[0-9]+)?\/[^"'\s?]+/gi)||[]; var _2c={}; var _2d=0; x$.each(_2b,function(i,_2f){ if(!_2c[_2f]){ _2c[_2f]=_2f; _2d++; } }); return _2d; }; _2.adjustLineBreaksEnteredInHtmlMode=function(_30){ var _31=_30.parents(".texteditor:first").find(".html_editor_toolbar table").is(":visible"); if(!_31||_30.val().match(/