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("
")[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(" "); 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(" "))[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:""+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(" "))[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("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(" "); 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="