You are on page 1of 7

/*1343616792,169776065*/ if (window.CavalryLogger) { CavalryLogger.start_js(["+DALe"]); } __d("sprintf",[],function(a,b,c,d,e,f){function g(h,i){i=Array.prototype.slice.c all(arguments,1);var j=0;return h.replace(/%s/g,function(k){return i[j++];});}e. exports=g;}); __d("Log",["sprintf"],function(a,b,c,d,e,f){var g=b('sprintf'),h={DEBUG:3,INFO:2 ,WARNING:1,ERROR:0};function i(k,l){var m=Array.prototype.slice.

call(arguments,2 ),n=g.apply(null,m);if(j.level>=k&&window.console)console[l in console?l:'log']( n);}var j={level:-1,Level:h,debug:i.bind(null,h.DEBUG,'debug'),info:i.bind(null, h.INFO,'debug'),warn:i.bind(null,h.WARNING,'debug'),error:i.bind(null,h.ERROR,'d ebug')};e.exports=j;}); __d("resolveWindow",[],function(a,b,c,d,e,f){function g(h){var i=window,j=h.spli t('.');try{for(var l=0;l<j.length;l++){var m=j[l],n=/^frames\[['"]?([a-zA-Z0-9\_]+)['"]?\]$/.exec(m);if(n){i=i.frames[n[1]];}else if(m==='opener'||m==='parent' ||m==='top'){i=i[m];}else return null;}}catch(k){return null;}return i;}e.export s=g;}); __d("XD",["function-extensions","Arbiter","DOM","DOMDimensions","Log","URI","Use rAgent","copyProperties","isInIframe","resolveWindow"],function(a,b,c,d,e,f){b(' function-extensions');var g=b('Arbiter'),h=b('DOM'),i=b('DOMDimensions'),j=b('Lo g'),k=b('URI'),l=b('UserAgent'),m=b('copyProperties'),n=b('isInIframe'),o=b('res olveWindow'),p='fb_xdm_frame_'+location.protocol.replace(':',''),q={_callbacks:[ ],_opts:{autoResize:false,allowShrink:true,channelUrl:null,hideOverflow:false,re sizeTimeout:100,resizeWidth:false,expectResizeAck:false,resizeAckTimeout:6000},_ lastResizeAckId:0,_resizeCount:0,_resizeTimestamp:0,_shrinker:null,init:function (s){this._opts=m(m({},this._opts),s);if(this._opts.autoResize)this._startResizeM onitor();g.subscribe('Connect.Unsafe.resize.ack',function(t,u){if(!u.id)u.id=thi s._resizeCount;if(u.id>this._lastResizeAckId)this._lastResizeAckId=u.id;}.bind(t his));},send:function(s,t){t=t||this._opts.channelUrl;if(!t)return;var u={},v=ne w k(t);m(u,s);m(u,k.explodeQuery(v.getFragment()));var w=new k(u.origin),x=w.get Domain()+(w.getPort()?':'+w.getPort():''),y=o(u.relation.replace(/^parent\./,'') ),z=y.frames[p];z?z.proxyMessage(k.implodeQuery(u),[x]):j.warn('No such frame "' +p+'" to proxyMessage to');},_computeSize:function(){var s=i.getDocumentDimensio ns(),t=0;if(this._opts.resizeWidth){var u=document.body;if(u.clientWidth<u.scrol lWidth){t=s.width;}else{var v=u.childNodes;for(var w=0;w<v.length;w++){var x=v[w ],y=x.offsetLeft+x.offsetWidth;if(y>t)t=y;}}t=Math.max(t,q.forced_min_width);}s. width=t;if(this._opts.allowShrink){if(!this._shrinker)this._shrinker=h.create('d iv');h.appendContent(document.body,this._shrinker);s.height=Math.max(this._shrin ker.offsetTop,0);}return s;},_startResizeMonitor:function(){var s,t=document.doc umentElement;if(this._opts.hideOverflow){t.style.overflow='hidden';document.body .style.overflow='hidden';}setInterval((function(){var u=this._computeSize(),v=Da te.now(),w=this._lastResizeAckId<this._resizeCount&&(v-this._resizeTimestamp)>th is._opts.resizeAckTimeout;if(!s||(this._opts.expectResizeAck&&w)||(this._opts.al lowShrink&&s.width!=u.width)||(!this._opts.allowShrink&&s.width<u.width)||(this. _opts.allowShrink&&s.height!=u.height)||(!this._opts.allowShrink&&s.height<u.hei ght)){s=u;this._resizeCount++;this._resizeTimestamp=v;var x={type:'resize',heigh t:u.height,ackData:{id:this._resizeCount}};if(u.width&&u.width!=0)x.width=u.widt h;try{if(k(document.referrer).isFacebookURI()&&n()&&window.name&&window.parent.l ocation&&window.parent.location.toString&&k(window.parent.location).isFacebookUR I()){var z=window.parent.document.getElementsByTagName('iframe');for(var aa=0;aa <z.length;aa=aa+1)if(z[aa].name==window.name){if(this._opts.resizeWidth)z[aa].st yle.width=x.width+'px';z[aa].style.height=x.height+'px';}}this.send(x);}catch(y) {this.send(x);}}}).bind(this),this._opts.resizeTimeout);}},r=m({},q);e.exports.U nverifiedXD=r;e.exports.XD=q;a.UnverifiedXD=r;a.XD=q;}); __d("legacy:connect-xd",["XD"],function(a,b,c,d){a.UnverifiedXD=b('XD').Unverifi edXD;a.XD=b('XD').XD;},3); __d("legacy:primer",["Primer"],function(a,b,c,d){b('Primer');},3); __d("legacy:startsWith",["startsWith"],function(a,b,c,d){a.startsWith=b('startsW ith');},3);

if(!window.CommentAdminPanelController){window.CommentAdminPanelController=funct ion(a){copyProperties(this,{REAL_TIME_POLLING_DELAY:10000,locale:a.locale,channe l:a.channel,controllerID:a.controllerID,commentIDs:a.commentIDs,domIDs:a.domIDs, duplicateComments:[],fetchMoreCommentsIsPending:{},blacklistedActors:a.blacklist edActors,actorToCommentInfoMap:a.actorToCommentIDMap,commentInfoMap:a.commentInf oMap,inAggregatedView:a.inAggregatedView,inModerationQueue:a.inModerationQueue,i nContextualDialog:a.inContextualDialog,isPolling:false,loggedIn:a.loggedIn,newes tCommentTimestamp:a.newestCommentTimestamp,realTimePollingParams:{},userOwnsPage s:a.userOwnsPages,recentlyBlacklistedActors:a.blacklistedActors});this.controlle dRegion=$(this.controllerID);this.attachClickHandlers();if(this.inModerationQueu e)this.registerModeratorQueueHandlers(true);if(this.inContextualDialog)this.atta chContextualDialogHandlers();if(!this.inAggregatedView)UnverifiedXD.init({autoRe size:true,channelUrl:a.channel,hideOverflow:true,resizeWidth:false});};copyPrope rties(CommentAdminPanelController,{allControllers:{},mainController:null,context ualControllers:{},initController:function(a){var b=new CommentAdminPanelControll er(a),c=a.controllerID;CommentAdminPanelController.allControllers[c]=b;if(b.inCo ntextualDialog){CommentAdminPanelController.contextualControllers[c]=b;}else Com mentAdminPanelController.mainController=b;},syncController:function(a,b){var c=C ommentAdminPanelController.allControllers[a];c.attachClickHandlers();if(!c.isCon trollingModerationQueue())return;c.deselectComments(b);c.registerModeratorQueueH andlers(false);c.synchronizeModeratorQueueUI();},resetController:function(a){var b=CommentAdminPanelController.allControllers[a];b.resetController();},prependCo mments:function(a,b,c){var d=CommentAdminPanelController.allControllers[a];d.pre pendComments(b,c);},updateController:function(a,b,c,d,e,f,g){var h=CommentAdminP anelController.allControllers[a];h.updateController(b,c,d,e,f,g);if(!CommentAdmi nPanelController.mainController.loggedIn)MultiLoginPopup.reattachLoginIntercepto rs();if(!h.isControllingModerationQueue())return;h.registerModeratorQueueHandler s(false);h.synchronizeModeratorQueueUI();},updatePollingParamsCommentas:function (a,b){var c=CommentAdminPanelController.allControllers[a];c.updatePollingParamsC ommentas(b);},registerMoreCommentsLinkHandler:function(a,b){var c=CommentAdminPa nelController.allControllers[a];c.registerMoreCommentsLinkHandler(b);},setRealTi mePollingParams:function(a,b){var c=CommentAdminPanelController.allControllers[a ];c.setRealTimePollingParams(b);},enableRealTimePolling:function(a){var b=Commen tAdminPanelController.allControllers[a];b.enableRealTimePolling();},disableRealT imePolling:function(a){var b=CommentAdminPanelController.allControllers[a];b.dis ableRealTimePolling();},replaceContentMaybe:function(a,b){var c=DOM.scry(documen t.documentElement,a)[0];if(c)DOM.replace(c,b);},notifyCommentCreated:function(a) {if(!CommentAdminPanelController.mainController.channel)return;UnverifiedXD.send ({type:'commentCreated',href:a.href,parentCommentID:a.parentCommentID,commentID: a.commentID});},notifyCommentRemoved:function(a){if(!CommentAdminPanelController .mainController.channel)return;UnverifiedXD.send({type:'commentRemoved',href:a.h ref,commentID:a.commentID});},markAsShowingAllReplies:function(a){var b=a+' a.fb UpDownVoteOption',c=DOM.scry(document.documentElement,b),d=a+' li.fbUpDownVoteOp tion a.itemAnchor',e=DOM.scry(document.documentElement,d),f=c.concat(e);for(var g=0;g<f.length;g++){var h=f[g],i=new URI(h.getAttribute('ajaxify'));i.addQueryDa ta({show_all_replies:1});h.setAttribute('ajaxify',i.toString());}},setLoggedIn:f unction(a){CommentAdminPanelController.mainController.loggedIn=a;}});copyPropert ies(CommentAdminPanelController.prototype,{isControllingModerationQueue:function (){var a=this==CommentAdminPanelController.mainController&&this.inModerationQueu e;return a;},resetController:function(){this.commentIDs=[];this.domIDs=[];},upda teController:function(a,b,c,d,e,f){a.forEach(function(h){this.commentIDs.push(h) ;},this);b.forEach(function(h){this.domIDs.push(h);},this);copyProperties(this.b lacklistedActors,d);for(var g in e){if(!this.actorToCommentInfoMap[g])this.actor ToCommentInfoMap[g]=[];e[g].forEach(function(h){this.actorToCommentInfoMap[g].pu sh(h);},this);}this.newestCommentTimestamp=Math.max(this.newestCommentTimestamp, c);copyProperties(this.commentInfoMap,f);this.attachClickHandlers();},updatePoll ingParamsCommentas:function(a){this.realTimePollingParams.commentas=a;},attachCl ickHandlers:function(){for(var a=0;a<this.domIDs.length;a++){var b='li[id="'+thi s.domIDs[a]+'"]',c=DOM.scry(this.controlledRegion,b);if(c.length===0)continue;va r d=c[0],e=DOM.scry(d,'a.uiCloseButton');Event.listen(d,'mouseleave',this.closeS

tickyMenuFlyouts.bind(this,e));var f=DOM.scry(d,'.fbModerateDropdownContainer'); if(f.length>0){var g=f[0],h=DOM.find(g,'.fbModerateDropdownLink');Event.listen(h ,'mouseover',function(q,event){CSS.addClass(q,'fbUnderlineText');}.curry(h));Eve nt.listen(h,'mouseout',function(q,event){CSS.removeClass(q,'fbUnderlineText');}. curry(h));var i=DOM.find(g,'.fbModerationDropdownList');Event.listen(h,'click',t his.exposeDropDownMenu.bind(this,h,i));Event.listen(i.parentNode,'mouseleave',th is.concealDropDownMenu.bind(this,h,i));this.attachDropDownHandlers(d,this.commen tIDs[a],i);}var j=this.commentInfoMap[this.commentIDs[a]].actor,k=!!this.recentl yBlacklistedActors[j];if(k){var l=DOM.scry(d,'.fbUndoBlacklistLink');if(l.length >0){var m=l[0];Event.listen(m,'click',this.toggleBlackListAndSync.bind(this,this .commentIDs[a]));}}}var n=DOM.scry(this.controlledRegion,'.fbReplyButton'),o=DOM .scry(this.controlledRegion,'.fbReplyAfterLoginButton');for(var p=0;p<n.length;p ++)if(this.loggedIn){CSS.show(n[p]);CSS.hide(o[p]);}else{CSS.hide(n[p]);CSS.show (o[p]);}},closeStickyMenuFlyouts:function(a,event){Toggler.hide();for(var b=0;b< a.length;b++)a[b].blur();},attachDropDownHandlers:function(a,b,c){var d=DOM.scry (c,'.fbBanUser');if(d.length>0){var e=d[0],f=DOM.find(e,'^.fbFeedbackPost');if(s tartsWith(f.id,b))Event.listen(e,'click',this.toggleBlackListAndSync.bind(this,b ));}},exposeDropDownMenu:function(a,b,event){if(CSS.shown(b))return this.conceal DropDownMenu(a,b,event);Event.stop(event);CSS.show(b);b.focus();a.blur();return false;},concealDropDownMenu:function(a,b,event){Event.stop(event);CSS.removeClas s(a,'fbUnderlineText');CSS.hide(b);a.blur();return false;},registerMoreCommentsL inkHandler:function(a){var b=a.pager_id;if(!ge(b))return;var c=$(b);Event.listen (c,'click',this.fetchMoreComments.bind(this,a,c));},deselectComments:function(a) {for(var b=0;b<a.length;b++)delete this.selectedCommentsMap[a[b]];},registerMode ratorQueueHandlers:function(a){if(a)this.selectedCommentsMap={};this.selectableC omments=this.findSelectableComments();this.selectableCheckboxes=[];this.selectAl lCheckBoxes=DOM.scry(this.controlledRegion,'.fbSelectAllCheckbox');this.approveB uttons=DOM.scry(this.controlledRegion,'.fbApproveButton');this.removeButtons=DOM .scry(this.controlledRegion,'.fbRemoveButton');for(var b=0;b<this.selectableComm ents.length;b++){var c=this.selectableComments[b].id,d=!!this.selectedCommentsMa p[c];this.setCommentSelection(this.selectableComments[b],d);var e=DOM.find(this. selectableComments[b],'.fbCommentCheckbox');Event.listen(e,'click',this.toggleCo mmentSelection.bind(this));Event.listen(this.selectableComments[b],'click',this. toggleCommentSelection.bind(this));e.checked=d;this.selectableCheckboxes.push(e) ;}for(var f=0;f<this.selectAllCheckBoxes.length;f++){this.selectAllCheckBoxes[f] .checked=false;this.selectAllCheckBoxes[f].disabled=this.selectableComments.leng th===0;Event.listen(this.selectAllCheckBoxes[f],'click',this.toggleSelectAllChec kbox.bind(this,this.selectAllCheckBoxes[f]));}for(var g=0;g<this.approveButtons. length;g++)Event.listen(this.approveButtons[g],'click',this.setBulkPrivacy.bind( this,false));for(var h=0;h<this.removeButtons.length;h++)Event.listen(this.remov eButtons[h],'click',this.setBulkPrivacy.bind(this,true));},findSelectableComment s:function(){var a=DOM.scry(this.controlledRegion,'.fbTopLevelComment'),b=[];for (var c=0;c<a.length;c++)if((DOM.scry(a[c],'.fbCommentCheckbox').length===1)&&(DO M.scry(a[c],'.fbCommentOverlay').length===0))b.push(a[c]);return b;},toggleComme ntSelection:function(event){var a={a:true},b=event.getTarget(),c=b.tagName.toLow erCase(),d=b.parentNode.tagName.toLowerCase();if(a[c]||a[d])return;var e=CSS.has Class(b,'fbFeedbackPost')?b:DOM.find(b,'^.fbFeedbackPost'),f=this.commentIsSelec ted(e),g=!f;this.setCommentSelection(e,g);this.synchronizeModeratorQueueUI();if( CSS.hasClass(b,'fbCommentCheckbox'))Event.stop(event);},commentIsSelected:functi on(a){return CSS.hasClass(a,'fbCommentSelected');},setCommentSelection:function( a,b){if(b){this.selectComment(a);}else this.deselectComment(a);},selectComment:f unction(a){CSS.addClass(a,'fbCommentSelected');this.selectedCommentsMap[a.id]=tr ue;DOM.find(a,'.fbCommentCheckbox').checked=true;},deselectComment:function(a){C SS.removeClass(a,'fbCommentSelected');delete this.selectedCommentsMap[a.id];DOM. find(a,'.fbCommentCheckbox').checked=false;},toggleSelectAllCheckbox:function(a, event){Event.stop(event);var b=a.checked;for(var c=0;c<this.selectableComments.l ength;c++){this.setCommentSelection(this.selectableComments[c],a.checked);this.s electableCheckboxes[c].checked=b;}this.synchronizeBulkModerationCheckboxes(b);th is.synchronizeBulkModerationButtons(b);},synchronizeModeratorQueueUI:function(){ var a=0;for(var b=0;b<this.selectableCheckboxes.length;b++)if(this.selectableChe

ckboxes[b].checked)a++;var c=this.selectableCheckboxes.length>0&&a==this.selecta bleCheckboxes.length;this.synchronizeBulkModerationCheckboxes(c);this.synchroniz eBulkModerationButtons(a>0);},synchronizeBulkModerationCheckboxes:function(a){fo r(var b=0;b<this.selectAllCheckBoxes.length;b++)this.selectAllCheckBoxes[b].chec ked=a;},synchronizeBulkModerationButtons:function(a){for(var b=0;b<this.approveB uttons.length;b++)Button.setEnabled(this.approveButtons[b],a);for(var c=0;c<this .removeButtons.length;c++)Button.setEnabled(this.removeButtons[c],a);},setBulkPr ivacy:function(a,event){Event.stop(event);this.synchronizeBulkModerationButtons( false);selectedCommentIDs=[];for(var b in this.selectedCommentsMap)selectedComme ntIDs.push(b);var c={is_private:a,in_moderation_queue:true,comment_ids:selectedC ommentIDs,uniqids:selectedCommentIDs,controller_id:this.controllerID,locale:this .locale,owns_pages:this.userOwnsPages,in_aggregated_view:this.inAggregatedView,i n_contextual_dialog:this.inContextualDialog};new AsyncRequest().setURI('/ajax/co nnect/comments/set_bulk_private.php').setData(c).send();return false;},toggleBla ckListAndSync:function(a,event){Event.stop(event);var b=this.commentInfoMap[a].a ctor,c={blacklist:!this.blacklistedActors[b],in_moderation_queue:this.inModerati onQueue,comment_id:a,other_comment_ids:this.getOtherCommentsByActor(b,a),uniqid: a,controller_id:this.controllerID,locale:this.locale,owns_pages:this.userOwnsPag es,in_aggregated_view:this.inAggregatedView,in_contextual_dialog:this.inContextu alDialog};new AsyncRequest().setURI('/ajax/connect/comments/set_blacklist.php'). setData(c).setHandler(function(d){this.blacklistedActors[b]=!this.blacklistedAct ors[b];if(this.blacklistedActors[b]){this.recentlyBlacklistedActors[b]=true;}els e delete this.recentlyBlacklistedActors[b];}.bind(this)).send();return false;},g etOtherCommentsByActor:function(a,b){return this.actorToCommentInfoMap[a].filter (function(c){return c!=b;});},fetchMoreComments:function(a,b,event){Event.kill(e vent);CSS.addClass(b,'async_saving');if(this.fetchMoreCommentsIsPending[a.pager_ id]===true)return;this.fetchMoreCommentsIsPending[a.pager_id]=true;var c={is_rep ly_thread:false,in_moderation_queue:false,view_as_moderator:false};copyPropertie s(c,a);c.recently_blacklisted=this.getRecentlyBlacklistedActors();c.offset=this. getVisibleCommentCount(c);if(!c.aggregate_view)delete c.aggregate_view;if(!c.com ment_id)delete c.comment_id;if(!c.is_reply_thread)c.comment_ids=this.commentIDs; new AsyncRequest().setURI('/ajax/connect/feedback.php').setReadOnly(true).setDat a(c).setHandler(function(d){this.fetchMoreCommentsIsPending[a.pager_id]=false;}. bind(this)).send();},getVisibleCommentCount:function(a){var b=this.getCommentsSe lector(a),c=this.getCollapsedCommentsSelector(a),d=DOM.scry($(a.controller_id),b );d=d.concat(DOM.scry($(a.controller_id),c));var e=0;for(var f=0;f<d.length;f++) if(!CSS.hasClass(d[f],'fbCommentIgnored'))e++;return e;},getCommentsSelector:fun ction(a){var b=a.is_reply_thread?'li.fbCommentReply':'li.fbTopLevelComment';if(a .controller_id!=a.uniqid)b='div[id="'+a.uniqid+'"] '+b;return b;},getCollapsedCo mmentsSelector:function(a){var b=a.is_reply_thread?'div.fbCommentReply':'div.fbT opLevelComment';if(a.controller_id!=a.uniqid)b='div[id="'+a.uniqid+'"] '+b;retur n b;},getRecentlyBlacklistedActors:function(){var a=[];for(var b in this.recentl yBlacklistedActors)a.push(b);return a;},attachContextualDialogHandlers:function( ){this.documentClickListener=Event.listen(document.documentElement,'click',this. closeContextualDialog.bind(this));},closeContextualDialog:function(event){var a= event.getTarget(),b=Parent.byClass(a,'fbCommentContext');if(!b)this.destroyConte xtualDialog();},destroyContextualDialog:function(){this.documentClickListener.re move();delete this.documentClickListener;var a=this.controllerID;Feedback.closeC ontextualDialog(a);},setRealTimePollingParams:function(a){this.realTimePollingPa rams=a;},enableRealTimePolling:function(){if(!this.isPolling){this.isPolling=tru e;this.schedulePolling(this.REAL_TIME_POLLING_DELAY);}},disableRealTimePolling:f unction(){if(this.isPolling){this.isPolling=false;clearTimeout(this.realTimePoll ingTimeout);}},schedulePolling:function(a){var b=this.realTimePollingParams;this .realTimePollingTimeout=setTimeout(this.pollForComments.bind(this,b),a);},prepen dComments:function(a,b){var c=DOM.scry(document,a)[0];if(!c)return;var d=b.getNo des(),e=[];for(var f=d.length;f-->0;){var g={id:DOM.getID(d[f]),element:d[f]};e. push(g);var h=ge(g.id);if(h){CSS.hide(g.element);this.duplicateComments.push(g.e lement);for(var i=0;i<e.length;++i)DOM.insertAfter(h,e[i].element);e=[];}}for(f= 0;f<e.length;++f)DOM.prependContent(c,e[f].element);setTimeout(this.removeDuplic ateComments.bind(this),0);},removeDuplicateComments:function(){for(var a=0;a<thi

s.duplicateComments.length;++a)DOM.remove(this.duplicateComments[a]);this.duplic ateComments=[];},pollForComments:function(a){data={locale:this.locale,command:'p oll'};copyProperties(data,a);data.recently_blacklisted=this.getRecentlyBlacklist edActors();if(!data.is_reply_thread)data.comment_ids=this.commentIDs;data.newest _comment_timestamp=this.newestCommentTimestamp;handler=this.handlePollResponse.b ind(this);errorHandler=this.handlePollError.bind(this);finallyHandler=this.handl ePollFinally.bind(this);new AsyncRequest().setURI('/plugins/comments/poll').setR eadOnly(true).setData(data).setMethod('GET').setHandler(handler).setErrorHandler (errorHandler).setFinallyHandler(finallyHandler).send();},handlePollResponse:fun ction(a){},handlePollError:function(a){},handlePollFinally:function(a){this.sche dulePolling(this.REAL_TIME_POLLING_DELAY);}});} WindowComm={_callbacks:{},makeHandler:function(a,b){b=b||'opener';var c='f'+(Mat h.random()*(1<<30)).toString(16).replace('.','');WindowComm._callbacks[c]=a;retu rn new URI('/connect/window_comm.php').setQueryData({_id:c,_relation:b}).getQual ifiedURI().toString();},_recv:function(a){var b=new URI(a).getQueryData();Window Comm._callbacks[b._id](b);}}; __d("PopupWindow",["DOMDimensions","DOMQuery","UserAgent","copyProperties"],func tion(a,b,c,d,e,f){var g=b('DOMDimensions'),h=b('DOMQuery'),i=b('UserAgent'),j=b( 'copyProperties'),k={_opts:{allowShrink:true,strategy:'vector',timeout:100,width Element:null},init:function(l){j(k._opts,l);setInterval(k._resizeCheck,k._opts.t imeout);},_resizeCheck:function(){var l=g.getViewportDimensions(),m=k._getDocume ntSize(),n=m.height-l.height,o=m.width-l.width;if(o<0&&!k._opts.widthElement)o=0 ;o=o>1?o:0;if(!k._opts.allowShrink&&n<0)n=0;if(n||o)try{window.console&&window.c onsole.firebug;window.resizeBy(o,n);if(o)window.moveBy(o/-2,0);}catch(p){}},_get DocumentSize:function(){var l=g.getDocumentDimensions();if(k._opts.strategy==='o ffsetHeight')l.height=document.body.offsetHeight;if(k._opts.widthElement){var m= h.scry(document.body,k._opts.widthElement)[0];if(m)l.width=g.getElementDimension s(m).width;}if(window.Dialog&&Dialog.max_bottom&&Dialog.max_bottom>l.height)l.he ight=Dialog.max_bottom;return l;},open:function(l,m,n){var o=typeof window.scree nX!='undefined'?window.screenX:window.screenLeft,p=typeof window.screenY!='undef ined'?window.screenY:window.screenTop,q=typeof window.outerWidth!='undefined'?wi ndow.outerWidth:document.body.clientWidth,r=typeof window.outerHeight!='undefine d'?window.outerHeight:(document.body.clientHeight-22),s=parseInt(o+((q-n)/2),10) ,t=parseInt(p+((r-m)/2.5),10),u=('width='+n+',height='+m+',left='+s+',top='+t);r eturn window.open(l,'_blank',u);}};e.exports=k;}); __d("legacy:popup-resizer",["PopupWindow"],function(a,b,c,d){a.PopupResizer=b('P opupWindow');},3); ConnectLogin={init:function(a){this.appID=a.appID;this.addToProfile=a.addToProfi le;this.oneClick=a.oneClick;this.channelUrl=a.channelUrl;XD.init(a);},login:func tion(a,b,c){if(this.oneClick&&!b){this._oneClick(a);}else this._openPopup(a,b,c) ;},logout:function(){XD.send({type:'logout'});},_oneClick:function(a){new AsyncR equest().setURI('/ajax/api/tos.php').setData({app_id:this.appID,grant_perm:1}).s etHandler(function(b){ConnectLogin._refreshLoginStatus();a&&a();}).send();},_ope nPopup:function(a,b,c){c=c||{};var d=WindowComm.makeHandler(function(h){ConnectL ogin._closePopup();if(ConnectLogin.appID)ConnectLogin._refreshLoginStatus();a&&a ();}),e=WindowComm.makeHandler(function(h){ConnectLogin._closePopup();}),f=new U RI('/login.php');f.setQueryData({api_key:this.appID,next:d,channel_url:e,cancel_ url:e,req_perms:b,v:'1.0',fbconnect:1,add_to_profile:this.addToProfile,display:' popup'});f.addQueryData(c);var g=this._getSize(c);this._popup=PopupResizer.open( f.toString(),g.height,g.width);},_closePopup:function(){if(this._popup){this._po pup.close();this._popup=null;}},_refreshLoginStatus:function(){if(this.channelUr l){XD.send({type:'refreshLoginStatus'});}else window.location.reload();},_getSiz e:function(a){if(a.social_plugin=='registration'){return {width:640,height:370}; }else return {width:610,height:280};}}; __d("legacy:input-methods",["Input","copyProperties"],function(a,b,c,d){var e=b( 'Input'),f=b('copyProperties');f(a.Input||(a.Input={}),e);},3); add_properties('Feedback',{registerComment:function(a,b){Feedback.comments[a]=b; return Feedback;},getRegisteredComment:function(a){return Feedback.comments[a];} ,deleteClickHandler:function(a,b,c,d,e,f){var g=new Dialog().setTitle("Delete po st?").setBody("Are you sure you want to delete this post?").setButtons([Dialog.n

ewButton('delete',"Delete"),Dialog.CANCEL]).setHandler(function(event){new Async Request().setURI('/ajax/connect/feedback.php').setData({command:'delete',url:a,u niqid:d,owns_pages:e,controller_id:c,locale:f,comment_id:b}).send();}.bind(this) ).show();},resizeCommentas:function(a){var b=DOM.scry(a,'div.post')[0];if(b){var c=Vector2.getElementDimensions(b).x;if(c){var d=DOM.find(b,'.commentas'),e=Vect or2.getElementDimensions(d).x;if((c-e)<190&&(c-190)>60){Style.set(d,'width',c-19 0+'px');var f=DOM.scry(d,'span.commentas_inner')[0];if(f){var g=Vector2.getEleme ntDimensions(f).x;Style.set(d,'width',g+'px');}}}}},exposeContextualDialogReply: function(a){var b=$(a),c=b.parentNode.parentNode;CSS.show(DOM.find(c,"form"));DO M.find(c,"textarea").focus();return false;},concealContextualDialogReply:functio n(a){var b=$(a),c=b.parentNode.parentNode,d=DOM.find(c,"form"),e=DOM.find(c,"tex tarea"),f=e.value.length;if(!Input.getValue(e))CSS.hide(d);return false;},closeC ontextualDialog:function(a){var b=ContextualDialogX.getInstance($(a));b.hide();r eturn false;},_clickLocked:false,attachOptInClickListener:function(a){Event.list en(a,'click',function(b){Event.kill(b);if(!this._clickLocked){this._clickLocked= true;setTimeout(function(){this._clickLocked=false;}.bind(this),1000);PlatformOp tInPopup.open('feedback','opt.in');}});},attachReplyListener:function(a){if(!a)r eturn;var b=DOM.find(a,'textarea');a.suppressBlur=false;Event.listen(a,'click',f unction(c){var d=c.getTarget(),e=Parent.byClass(d,'commentas')!==null,f=Parent.b yClass(d,'uiButton')!==null,g=Parent.byClass(d,'uiSelector')!==null;a.suppressBl ur=e||f||g;});Event.listen(b,'blur',function(c,d){if(a.interval)return;a.interva l=setInterval((function(e,f){if(e.suppressBlur||Input.getValue(f)||f==document.a ctiveElement)return;CSS.hide(e);e.suppressBlur=false;clearInterval(e.interval);d elete e.interval;}).curry(a,c),100);}.curry(b));},attachReplyClickListener:funct ion(a,b,c){if(!a)return;var d=DOM.find(a,'textarea');Event.listen(b,'click',func tion(e){CSS.show(a);d.focus();if(!c.isViewer&&c.isReply){var f=MentionsInput.get Instance(d);if(f){var g=f.getMentions();if(!g[c.uid]&&Input.getValue(d)===''){f. addMention(c);Input.setValue(d,Input.getValue(d)+' ');}}else Input.setValue(d,c. text+' ');}e.preventDefault();});},resetInput:function(a){var b=MentionsInput.ge tInstance(a);if(b){b.reset({flattened:'',mention_data:{}});}else Input.setValue( a,'');}});if(!window.Feedback.comments)window.Feedback.comments={}; __d("legacy:Keys",["Keys"],function(a,b,c,d){a.Keys=b('Keys');},3); __d("legacy:error-dialog",["ErrorDialog"],function(a,b,c,d){var e=b('ErrorDialog ');a.ErrorDialog=e;},3); __d("DOMEventListener",[],function(a,b,c,d,e,f){var g,h;if(window.addEventListen er){g=function(j,k,l){j.addEventListener(k,l,false);};h=function(j,k,l){j.remove EventListener(k,l,false);};}else if(window.attachEvent){g=function(j,k,l){j.atta chEvent('on'+k,l);};h=function(j,k,l){j.detachEvent('on'+k,l);};}var i={add:func tion(j,k,l){g(j,k,l);return {remove:function(){h(j,k,l);j=null;}};},remove:h};e. exports=i;}); __d("PluginPerms",["DOMEvent","DOMEventListener","PopupWindow","URI","bind","cop yProperties"],function(a,b,c,d,e,f){var g=b('DOMEvent'),h=b('DOMEventListener'), i=b('PopupWindow'),j=b('URI'),k=b('bind'),l=b('copyProperties');function m(n,o){ l(this,{return_params:j.getRequestURI().getQueryData(),login_params:{},perms_par ams:{},perms:[],plugin:n,app:o});this.addReturnParams({ret:'perms'});delete this .return_params.hash;}l(m.prototype,{addReturnParams:function(n){l(this.return_pa rams,n);},addLoginParams:function(n){l(this.login_params,n);},addPermsParams:fun ction(n){l(this.perms_params,n);},addPerms:function(n){this.perms.push.apply(thi s.perms,n);},start:function(){var n=j('/dialog/plugin.perms').addQueryData(this. perms_params).addQueryData({display:'popup',app_id:this.app,perms:this.perms.joi n(','),secure:j.getRequestURI().isSecure(),social_plugin:this.plugin,return_para ms:JSON.stringify(this.return_params),login_params:JSON.stringify(this.login_par ams)});this.popup=i.open(n.toString(),210,450);}});m.starter=function(n,o,p,q,r, s){var t=new m(n,o);t.addReturnParams(q||{});t.addLoginParams(r||{});t.addPermsP arams(s||{});t.addPerms(p||[]);return k(t,t.start);};m.listen=function(n,o,p,q,r ,s,t){h.add(n,'click',function(u){new g(u).kill();m.starter(o,p,q,r,s,t)();});}; e.exports=m;}); __d("UnverifiedXD",["XD","XDUnverifiedChannel"],function(a,b,c,d,e,f){var g=b('X D').UnverifiedXD,h=c('XDUnverifiedChannel').channel;g.init({channelUrl:h});e.exp orts=g;});

__d("PluginResize",["Log","UnverifiedXD","bind","copyProperties","curry"],functi on(a,b,c,d,e,f){var g=b('Log'),h=b('UnverifiedXD'),i=b('bind'),j=b('copyProperti es'),k=b('curry');function l(o){o=o||document.body;return o.offsetWidth+o.offset Left;}function m(o){o=o||document.body;return o.offsetHeight+o.offsetTop;}functi on n(o,p,event){this.calcWidth=o||l;this.calcHeight=p||m;this.width=undefined;th is.height=undefined;this.event=event||'resize';}j(n.prototype,{resize:function() {var o=this.calcWidth(),p=this.calcHeight();if(o!==this.width||p!==this.height){ g.debug('Resizing Plugin: (%s, %s, %s)',o,p,this.event);this.width=o;this.height =p;h.send({type:this.event,width:o,height:p});}return this;},auto:function(o){se tInterval(i(this,this.resize),o||250);return this;}});n.auto=function(o,event,p) {return new n(k(l,o),k(m,o),event).resize().auto(p);};n.autoHeight=function(o,p, event,q){return new n(function(){return o;},k(m,p),event).resize().auto(q);};e.e xports=n;}); __d("PluginShareButton",["DOMEvent","DOMEventListener","PluginResize","PopupWind ow","UserAgent"],function(a,b,c,d,e,f){var g=b('DOMEvent'),h=b('DOMEventListener '),i=b('PluginResize'),j=b('PopupWindow'),k=b('UserAgent'),l={listen:function(m, n){var o=m.href;h.add(m,'click',function(p){new g(p).kill();j.open(o,340,670);}) ;},resize:function(m){var n=k.firefox()||k.ie()>=9?1:0;new i(function(){return m .offsetWidth+m.offsetLeft+n;},function(){return m.offsetHeight+m.offsetTop;}).re size().auto();}};e.exports=l;}); __d("PluginXDReady",["Arbiter","UnverifiedXD"],function(a,b,c,d,e,f){var g=b('Ar biter'),h=b('UnverifiedXD'),i={handleMessage:function(j){if(!j.method)return;try {g.inform('Connect.Unsafe.'+j.method,JSON.parse(j.params),g.BEHAVIOR_PERSISTENT) ;}catch(k){}}};a.XdArbiter=i;h.send({xd_action:'plugin_ready',name:window.name}) ;e.exports=null;}); WidgetArbiter={_findSiblings:function(){if(WidgetArbiter._siblings)return;Widget Arbiter._siblings=[];for(var a=parent.frames.length-1;a>=0;a--)try{if(parent.fra mes[a]&&parent.frames[a].Arbiter&&parent.frames[a].Arbiter.inform)WidgetArbiter. _siblings.push(parent.frames[a].Arbiter);}catch(b){}},inform:function(){WidgetAr biter._findSiblings();var a=$A(arguments);WidgetArbiter._siblings.forEach(functi on(b){b.inform.apply(b,a);});}};

You might also like