/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 10th 2010 3:07:10 AM PST                            */
/*      Machine:  10.16.139.101                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/inline_participants.js r138624                            */
/*       Locale:  id_ID                                                        */
/*         Path:  js/inline_participants.js                                    */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/inline_participants.js"]); }


function InlineParticipants(targetId,asyncUri){this.asyncUri=asyncUri;this.target=$(targetId);this.targetId=targetId;if((!this.target)||this.target.pending){return;}
if(this.target.cached){toggle(this.targetId);}else{this.initializeFromTarget();this.fetchParticipants();}}
copy_properties(InlineParticipants.prototype,{fetchParticipants:function(){this.target.pending=true;new AsyncRequest().setURI(this.asyncUri).setMethod('GET').setReadOnly(true).setData(this.getFetchData()).setHandler(bind(this,'fetchedActorsResponse')).setErrorHandler(bind(this,'fetchedActorsError')).send();this.loadTimeout=setTimeout(this.showLoadIndicator.bind(this),200);},showLoadIndicator:function(){this.loadTimeout=null;if(this.target.pending){this.loading=true;CSS.addClass(this.target,'participants_loading');show(this.target);}},hideLoadIndicator:function(){if(this.loadTimeout){clearTimeout(this.loadTimeout);this.loadTimeout=null;}
if(this.loading){CSS.removeClass(this.target,'participants_loading');}},getSearchUri:function(){return this.target.getAttribute("search_href");},fetchedActorsResponse:function(asyncResponse){var payload=asyncResponse.getPayload();var show_more=payload["has_more"];var actors=payload["actors"];var nameContainers=[];if(!actors){return this.fetchedActorsError();}
this.hideLoadIndicator();for(var i=0;i<actors.length;i++){var container=this.createNameContainer(actors[i]);this.target.appendChild(container);}
if(show_more){var search_uri=this.getSearchUri();var search_text=payload['more_text']||this.getSearchText();if(search_uri){var search_link=$N('a',{href:search_uri,className:'see_all'},search_text);this.target.appendChild(search_link);}}
this.target.pending=false;this.target.cached=true;animation(this.target).show().from('opacity',0).to('opacity',1).duration(450).go();},getSearchText:function(){return _tx("Lihat semuanya...");},fetchedActorsError:function(asyncResponse){this.target.pending=false;var search_uri=this.getSearchUri();if(search_uri){goURI(search_uri);}else{hide(this.target);}},createNameContainer:function(spec){var container=$N("div",{title:spec.name,className:"name_container "+
(spec.div_class||"")},null);var pic=new Image();pic.alt=spec.name;pic.src=spec.img_src;pic.width='50';pic.height='50';var pic_link=$N('a',{className:"pic_container",href:spec.profile_href,onclick:spec.profile_onclick||''},pic);container.appendChild(pic_link);var name_link=$N('a',{href:spec.profile_href,onclick:spec.profile_onclick||''},spec.first_name);container.appendChild($N('span',{className:"name"},name_link));return container;}});function StoryParticipants(targetId,linkData,hash){var asyncUri='/ajax/feed_participants_ajax.php';this.parent.construct(this,targetId,asyncUri);this.linkData=linkData;this.hash=hash;}
copy_properties(StoryParticipants.prototype,{initializeFromTarget:function(){this.storyKey=this.target.getAttribute("story_key");this.storyUser=this.target.getAttribute("user");},getFetchData:function(){if(this.linkData){return{sid:this.storyKey,uid:this.storyUser,link_data:this.linkData,hash:this.hash};}else{return{sid:this.storyKey,uid:this.storyUser};}}});StoryParticipants.extend('InlineParticipants');function MutualFriends(targetId){var asyncUri='/ajax/mutual_friends_ajax.php';this.parent.construct(this,targetId,asyncUri);}
copy_properties(MutualFriends.prototype,{initializeFromTarget:function(){this.friend=this.target.getAttribute("friend");},getFetchData:function(){return{uid:this.friend};},getSearchText:function(){return _tx("Lihat semua teman bersama");}});MutualFriends.extend('InlineParticipants');function SearchMutualFriends(targetId){this.parent.construct(this,targetId);}
copy_properties(SearchMutualFriends.prototype,{getFetchData:function(){return{uid:this.friend,max:8};}});SearchMutualFriends.extend('MutualFriends');function SuggestionReceivers(targetId,suggesters,newcomer,receiver){var asyncUri='/ajax/suggestion_receivers_ajax.php';copy_properties(this,{suggesters:suggesters,newcomer:newcomer,receiver:receiver});this.parent.construct(this,targetId,asyncUri);}
copy_properties(SuggestionReceivers.prototype,{getFetchData:function(){return{suggesters:this.suggesters,newcomer:this.newcomer,receiver:this.receiver};},initializeFromTarget:bagofholding});SuggestionReceivers.extend('InlineParticipants');function LikeParticipants(feedback_params,target_id,search_uri){var asyncUri='/ajax/like/participants.php';copy_properties(this,{feedback_params:feedback_params,search_uri:search_uri});this.parent.construct(this,target_id,asyncUri);}
copy_properties(LikeParticipants.prototype,{getFetchData:function(){return{feedback_params:JSON.encode(this.feedback_params)};},getSearchUri:function(){return this.search_uri;},fetchedActorsResponse:function(response){LikeController.informUpdateState(this.feedback_params.target_fbid,response.getPayload().like_state_info);this.parent.fetchedActorsResponse(response);},initializeFromTarget:bagofholding});LikeParticipants.extend('InlineParticipants');

if (window.Bootloader) { Bootloader.done(["js\/inline_participants.js"]); }