Nu viser det sig, at facebook er på vej med en ny videochat.
På nedenstående link kan du se selve koden :
http://static.ak.fbcdn.net/rsrc.php/zCPX3/lpkg/1p5jfdhw/en_US/141/162428/js/8qmlbumen008ckso.pkg.js
Skulle denne være fjernet kan du se nedenfor. Der er ingen tvivl om, at dette her er vejen til en ny funktionaliet på facebook, kigger vi alene på notifikationsbeskederne vil vi se, at “Waiting for your friend…”, “Video call denied.”, “Incoming call:”, og “Loading video call…” er helt klar.
Nå men nu til selve koden :
/* HTTP Host: static.ak.fbcdn.net */
/* Generated: May 12th 2009 1:59:27 PM PDT */
/* Machine: 10.16.140.110 */
/* Source: Local Cache */
/* Location: rsrc:1p5jfdhw:en_US:/html/js/8qmlbumen008ckso.pkg.js:141 */
/* Locale: en_US */
/* Path: js/8qmlbumen008ckso.pkg.js */
function VideoCall(to){this._to=to;this._state=VideoCall.STATETYPE.DEAD;this._popup=null;this._uid=null;this._faruid=null;this._arbiter=null;this._lastMessageTime=null;this._missedMsgs=0;this._chatShown=true;}
VideoCall.STATETYPE={DEAD:0,CALLING:1,RECEIVING:2,LOADING:3,LIMBO:4,POPUPBLOCKED:5,LOADED:6,CONNECTED:7};VideoCall.ACTIONTYPE={MAKECALL:'call',ACCEPTCALL:'accept',LOADING:'loading',LOADED:'loaded',HANGUP:'hangup',FINISH:'finish',DENYCALL:'deny',CANCELCALL:'cancel',POPUPBLOCKED:'popupblocked'};VideoCall.MESSAGETYPE={RECEIVED:'videocall/received',CANCELED:'videocall/canceled',LOADING:'videocall/loading',DENIED:'videocall/denied',HANGUP:'videocall/hangup',COMPLETED:'videocall/completed',WAITING:'videocall/waiting',POPUPBLOCKED:'videocall/popupblocked',CONNECTED:'videocall/connected',SEND:'videocall/send'};copy_properties(VideoCall.prototype,{arbiter:function(){return this._arbiter||(this._arbiter=new Arbiter());},call:function(){if(this._state==VideoCall.STATETYPE.DEAD||this._state==VideoCall.STATETYPE.LIMBO){this._sendAction(VideoCall.ACTIONTYPE.MAKECALL);}else if(this._state==VideoCall.STATETYPE.RECEIVING){this._sendAction(VideoCall.ACTIONTYPE.ACCEPTCALL);}},accept:function(){if(this._state==VideoCall.STATETYPE.RECEIVING){this._sendAction(VideoCall.ACTIONTYPE.ACCEPTCALL);}},deny:function(){if(this._state==VideoCall.STATETYPE.RECEIVING){this._sendAction(VideoCall.ACTIONTYPE.DENYCALL);}},cancel:function(){if(this._state==VideoCall.STATETYPE.POPUPBLOCKED||this._state==VideoCall.STATETYPE.CALLING||this._state==VideoCall.STATETYPE.LOADED||this._state==VideoCall.STATETYPE.LOADING){this._sendAction(VideoCall.ACTIONTYPE.CANCELCALL);}},finish:function(){this._reset();this._sendAction(VideoCall.ACTIONTYPE.FINISH);},leave:function(){if(this._state==VideoCall.STATETYPE.CONNECTED||this._state==VideoCall.STATETYPE.LOADED){this._sendAction(VideoCall.ACTIONTYPE.HANGUP);}},openPopup:function(){if(this._state==VideoCall.STATETYPE.POPUPBLOCKED){this._openCallWindow();this._sendAction(VideoCall.ACTIONTYPE.LOADING);}},registerFarUID:function(faruid){this._state=VideoCall.STATETYPE.LOADED;this._faruid=faruid;},setUID:function(uid){if(this._state==VideoCall.STATETYPE.LOADING||this._state==VideoCall.STATETYPE.LOADED){this._uid=uid;this._sendAction(VideoCall.ACTIONTYPE.LOADED);}},displayChat:function(shown){if(presence.inVideoChat){this._chatShown=shown;this._missedMsgs=0;if(!shown){var swf=this.getSWF();if(swf){swf.updateMessages(this._missedMsgs);swf.showPendingMessages(false);}}}},isChatShown:function(){return this._chatShown;},getSWF:function(){return ge('swf_'+this._callSWFID());},receivedChatMessage:function(){if(!this._chatShown&&presence.inVideoChat){this._missedMsgs++;var swf=this.getSWF();if(swf){swf.updateMessages(this._missedMsgs);}}},isDead:function(){var isDead=this._state==VideoCall.STATETYPE.DEAD||this._state==VideoCall.STATETYPE.LIMBO;return isDead;},receiveStale:function(packet,time){this._receivePacket(packet,time,{stale:true});},sendStale:function(packet,time){packet=JSON.decode(packet);this._sendAction(packet.action,time,{stale:true});},receive:function(packet,time){this._receivePacket(packet,time);},_receivePacket:function(packet,time,options){packet=JSON.decode(packet);var stale=options&&options.stale;if(stale&&this._state==VideoCall.STATETYPE.DEAD){if(packet.action==VideoCall.ACTIONTYPE.POPUPBLOCKED||packet.action==VideoCall.ACTIONTYPE.LOADED){this._state=VideoCall.STATETYPE.RECEIVING;this._inform(VideoCall.MESSAGETYPE.RECEIVED);}}
switch(packet.action){case VideoCall.ACTIONTYPE.MAKECALL:if(presence.inVideoChat){this._sendAction(VideoCall.ACTIONTYPE.ACCEPTCALL);}else{this._state=VideoCall.STATETYPE.RECEIVING;this._inform(VideoCall.MESSAGETYPE.RECEIVED);}
if(!stale){this._reset();}
break;case VideoCall.ACTIONTYPE.CANCELCALL:this._state=VideoCall.STATETYPE.LIMBO;this._inform(VideoCall.MESSAGETYPE.CANCELED);if(!stale){this._reset();}
break;case VideoCall.ACTIONTYPE.ACCEPTCALL:if(this._state!=VideoCall.STATETYPE.LOADED&&this._state!=VideoCall.STATETYPE.LOADING){this._state=VideoCall.STATETYPE.LOADING;this._inform(VideoCall.MESSAGETYPE.LOADING);if(!stale){this._openCallWindow();}}
break;case VideoCall.ACTIONTYPE.DENYCALL:this._state=VideoCall.STATETYPE.LIMBO;this._inform(VideoCall.MESSAGETYPE.DENIED);if(!stale){this._reset();}
break;case VideoCall.ACTIONTYPE.LOADED:if(packet.uid){this._faruid=packet.uid;}
if(!stale&&presence.inVideoChat){if(this._state==VideoCall.STATETYPE.LOADED&&this._faruid&&this._uid){this._attachFarUid();}}
break;case VideoCall.ACTIONTYPE.HANGUP:this._state=VideoCall.STATETYPE.LIMBO;this._inform(VideoCall.MESSAGETYPE.HANGUP);if(!stale){this._reset();}
break;}},_sendAction:function(action,time,options){var stale=options&&options.stale;if(!stale){var data={action:action,uid:this._uid};this._inform(VideoCall.MESSAGETYPE.SEND,data);}else if(!this._lastMessageTime||time>this._lastMessageTime){this._lastMessageTime=time;}else{return;}
switch(action){case VideoCall.ACTIONTYPE.MAKECALL:if(this.isDead()){this._state=VideoCall.STATETYPE.LOADING;this._inform(VideoCall.MESSAGETYPE.LOADING);if(!stale){this._openCallWindow();}}
break;case VideoCall.ACTIONTYPE.LOADING:if(stale){this._state=VideoCall.STATETYPE.LOADING;this._inform(VideoCall.MESSAGETYPE.LOADING);}
break;case VideoCall.ACTIONTYPE.CANCELCALL:this._state=VideoCall.STATETYPE.DEAD;this._inform(VideoCall.MESSAGETYPE.COMPLETED);if(presence.inVideoChat){window.close();}
this._reset();break;case VideoCall.ACTIONTYPE.ACCEPTCALL:this._state=VideoCall.STATETYPE.LOADING;this._inform(VideoCall.MESSAGETYPE.LOADING);if(!stale){this._openCallWindow();}
break;case VideoCall.ACTIONTYPE.LOADED:if(this._state==VideoCall.STATETYPE.LIMBO||this._state==VideoCall.STATETYPE.CONNECTED){break;}
if(!presence.inVideoChat){this._state=VideoCall.STATETYPE.LOADED;this._inform(VideoCall.MESSAGETYPE.COMPLETED);}else{if(this._faruid){if(this._uid){this._attachFarUid();}}else{if(stale){var uid=options&&options.uid;if(uid){this._uid=uid;}}
this._state=VideoCall.STATETYPE.LOADED;if(this._uid){this._inform(VideoCall.MESSAGETYPE.WAITING);}}}
break;case VideoCall.ACTIONTYPE.DENYCALL:this._state=VideoCall.STATETYPE.DEAD;this._inform(VideoCall.MESSAGETYPE.COMPLETED);this._reset();break;case VideoCall.ACTIONTYPE.FINISH:this._state=VideoCall.STATETYPE.DEAD;this._inform(VideoCall.MESSAGETYPE.COMPLETED);this._reset();break;case VideoCall.ACTIONTYPE.POPUPBLOCKED:this._state=VideoCall.STATETYPE.POPUPBLOCKED;this._inform(VideoCall.MESSAGETYPE.POPUPBLOCKED);break;case VideoCall.ACTIONTYPE.HANGUP:if(this._state!=VideoCall.STATETYPE.DEAD){this._state=VideoCall.STATETYPE.LIMBO;this._inform(VideoCall.MESSAGETYPE.HANGUP);this._reset();}
break;}},_attachFarUid:function(){var swf=this.getSWF();if(swf){this._state=VideoCall.STATETYPE.CONNECTED;swf.farIDAcquired(this._faruid);this._inform(VideoCall.MESSAGETYPE.CONNECTED);}},_callSWFID:function(){return'video_call_swf_'+this._to;},_callWindowName:function(){return'video_call_window_'+this._to;},_openCallWindow:function(){if(!this._popup||this._popup.closed){this._popup=window.open(URI('/chat/video_popup.php').addQueryData({swf_id:this._callSWFID(),call_to:this._to,faruid:this._faruid}),this._callWindowName(),'width=745,height=358,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes');if(!this._popup||this._popup.closed){this._sendAction(VideoCall.ACTIONTYPE.POPUPBLOCKED);}else{setTimeout(this._checkPopupExists.bind(this),3000);}}},_checkPopupExists:function(){if(this._state==VideoCall.STATETYPE.LOADING){if(!this._popup||this._popup.closed){this._popup=null;this._sendAction(VideoCall.ACTIONTYPE.POPUPBLOCKED);}
setTimeout(this._checkPopupExists.bind(this),3000);}},_inform:function(message,data){this.arbiter().inform(message,data);},_reset:function(){if(this._popup){this._popup=null;}
this._uid=null;this._faruid=null;}});
CallCenter={_calls:{},call:function(to){return CallCenter._calls[to]||(CallCenter._calls[to]=new VideoCall(to));}};
function VideoCallTab(tab){this.enabled=false;this.actionHidden=false;this.notification_elm=null;this._tab=tab;this._tab.messageTypes['video']={visible:false,user:true,preserveHistory:false};this._to=tab.id;this.actionVideoCall='videoCall';}
copy_properties(VideoCallTab.prototype,{registerCallbacks:function(callbacks){this._tab.arbiter.subscribe(ChatTab.TABMESSAGETYPE.HISTORYBEGIN,this.historyBeginRender.bind(this));this._tab.arbiter.subscribe(ChatTab.TABMESSAGETYPE.HISTORYITER,this.historyIter.bind(this));this._tab.arbiter.subscribe(ChatTab.TABMESSAGETYPE.HISTORYEND,this.historyEndRender.bind(this));this._tab.arbiter.subscribe(ChatTab.TABMESSAGETYPE.CREATETAB,this.createTab.bind(this));this._tab.arbiter.subscribe(ChatTab.TABMESSAGETYPE.RECEIVEMSG,this.receiveMsg.bind(this));this._tab.arbiter.subscribe(ChatTab.TABMESSAGETYPE.DISPLAYCHAT,this.displayChat.bind(this));this._tab.arbiter.subscribe(ChatTab.TABMESSAGETYPE.USERINFOUPDATED,this.userInfoUpdated.bind(this));var arbiter=CallCenter.call(this._to).arbiter();arbiter.subscribe(VideoCall.MESSAGETYPE.RECEIVED,this.videocall_received.bind(this));arbiter.subscribe(VideoCall.MESSAGETYPE.CANCELED,this.videocall_canceled.bind(this));arbiter.subscribe(VideoCall.MESSAGETYPE.LOADING,this.videocall_loading.bind(this));arbiter.subscribe(VideoCall.MESSAGETYPE.DENIED,this.videocall_denied.bind(this));arbiter.subscribe(VideoCall.MESSAGETYPE.HANGUP,this.videocall_hangup.bind(this));arbiter.subscribe(VideoCall.MESSAGETYPE.COMPLETED,this.videocall_completed.bind(this));arbiter.subscribe(VideoCall.MESSAGETYPE.WAITING,this.videocall_waiting.bind(this));arbiter.subscribe(VideoCall.MESSAGETYPE.POPUPBLOCKED,this.videocall_popupblocked.bind(this));arbiter.subscribe(VideoCall.MESSAGETYPE.CONNECTED,this.videocall_connected.bind(this));arbiter.subscribe(VideoCall.MESSAGETYPE.SEND,this.videocall_send.bind(this));},displayChat:function(type,data){CallCenter.call(this._to).displayChat(data.visible);},userInfoUpdated:function(type,data){this.enabled=data.userInfo.enableVC;this._tab.actions.setVisible(this.actionVideoCall,this.enabled&&!this.actionHidden).refresh();},historyBeginRender:function(type,data){this.lastVideoMsg=null;},historyIter:function(type,data){this.lastVideoMsg=data.item;},historyEndRender:function(type,data){var call=CallCenter.call(this._to);if(!presence.inVideoChat&&this.lastVideoMsg){var msg=this.lastVideoMsg;if(msg.from==this._to){call.receiveStale(msg.msg.text,msg.time);}else if(msg.to==this._to){call.sendStale(msg.msg.text,msg.time);}}},createTab:function(type,data){var call_object=CallCenter.call(this._to);this._tab.actions.prependAction(this.actionVideoCall,function(){return $N('span',{className:'action_wrapper'},[$N('img',{src:'/images/icons/motion.gif?1233602833'}),$N('span',{className:'action'},'Video Call')]);},call_object.call.bind(call_object)).setVisible(this.actionVideoCall,!presence.inVideoChat&&this.enabled);this.actionHidden=presence.inVideoChat;this.notification_elm=$N('div',{className:'call_notifications',style:{display:'none'}});data.toolbox.prependContent(this.notification_elm);},receiveMsg:function(type,data){var call=CallCenter.call(this._to);if(data.type=='video'){if(data.msgItem.to==this._to){call.sendStale(data.msgItem.msg.text,data.msgItem.time);}else{call.receive(data.msgItem.msg.text,data.msgItem.time);}}else if(data.type=='msg'){call.receivedChatMessage();}},_renderNotification:function(element,xaction){if(!this.enabled){return;}
if(!this.notification_elm){return;}
if(typeof element=='string'){element=$N('div',[$N('img',{src:'/images/icons/motion.gif?1233602833'}),$N('span',element)]);}
DOM.empty(this.notification_elm);if(xaction){var xbutton=$N('div',{className:'notification_x',onclick:function(){xaction();this._tab.handleResize();}.bind(this)});this.notification_elm.appendChild(xbutton);}
this.notification_elm.appendChild(element);this.notification_elm.removeClass('default');show(this.notification_elm);this._tab.actions.setVisible(this.actionVideoCall,false).refresh();this.actionHidden=true;this._tab.handleResize();},videocall_send:function(type,data){var pendingMsg=this._tab._createMessage('','video');delete pendingMsg.text;copy_properties(pendingMsg,data);this._tab.pendingSentMsgs.push(pendingMsg);this._tab._flushSmallQueue();},videocall_canceled:function(type,data){this._renderNotification(_tx("Video call canceled."),function(){CallCenter.call(this._to).finish();}.bind(this));},videocall_received:function(type,data){var call=CallCenter.call(this._to);var div=$N('div',[$N('img',{src:'/images/icons/motion.gif?1233602833'}),$N('span',_tx("Incoming call:")),$N('span',{'className':'videocall_actions','innerHTML':_tx("{action1} or {action2}",{'action1':''+_tx("Accept")+'','action2':''+_tx("Deny")+''})})]);var action1=DOM.scry(div,'span.action1');if(action1.length==1){Event.listen(action1[0],'click',call.accept.bind(call));}
var action2=DOM.scry(div,'span.action2');if(action2.length==1){Event.listen(action2[0],'click',call.deny.bind(call));}
this._renderNotification(div);},videocall_loading:function(type,data){this._renderNotification(_tx("Loading video call..."),function(){CallCenter.call(this._to).cancel();}.bind(this));},videocall_waiting:function(type,data){if(presence.inVideoChat){this._renderNotification(_tx("Waiting for your friend..."));}},videocall_connected:function(type,data){hide(this.notification_elm);},videocall_denied:function(type,data){this._renderNotification(_tx("Video call denied."),function(){CallCenter.call(this._to).finish();}.bind(this));},videocall_popupblocked:function(type,data){var call=CallCenter.call(this._to);var div=$N('div',[$N('img',{src:'/images/icons/motion.gif?1233602833'}),$N('span',_tx("Popup blocker detected:")),$N('span',{'className':'videocall_actions','innerHTML':_tx("{action1} or {action2}",{'action1':''+_tx("Retry")+'','action2':''+_tx("Cancel")+''})})]);var action1=DOM.scry(div,'span.action1');if(action1.length==1){Event.listen(action1[0],'click',call.openPopup.bind(call));}
var action2=DOM.scry(div,'span.action2');if(action2.length==1){Event.listen(action2[0],'click',call.cancel.bind(call));}
this._renderNotification(div);},videocall_hangup:function(type,data){this._renderNotification(_tx("Video call ended."),function(){CallCenter.call(this._to).finish();}.bind(this));},videocall_completed:function(type,data){hide(this.notification_elm);this._tab.actions.setVisible(this.actionVideoCall,this.enabled).refresh();this.actionHidden=false;this._tab.handleResize();}});onloadRegister(function(){Arbiter.subscribe(ChatTab.GLOBALMESSAGETYPE.NEWTAB,function(type,data){var videocallTab=new VideoCallTab(data.tab);videocallTab.registerCallbacks();});});
function Beep(owner,properties){copy_properties(this,properties);this.unread=true;this._owner=owner;this._node=$(HTML(this.html).getNodes()[0]);CSS.setOpacity(this._node,'0');this._node.find('a.beeper_x').listen('click',this.xout.bind(this));var elements=this._node.scry('a.undo_link');if(elements.length==1){elements[0].listen('click',this.onUndoClick.bind(this,elements[0]));}
this._node.listen('mouseover',this.onMouseOver.bind(this));this._node.listen('mouseout',this.onMouseOut.bind(this));}
copy_properties(Beep,{REMOVE_BEEP_ANIM_MS:250,UNDONE_BEEP_DELAY_MS:1000});copy_properties(Beep.prototype,{onMouseOver:function(event){this._node.addClass('UIBeep_Selected');this._selected=true;this.setEdges();},onMouseOut:function(event){this._node.removeClass('UIBeep_Selected');this._selected=false;this.setEdges();},onUndoClick:function(link){new AsyncRequest().setURI('/ajax/presence/undo_send.php').setData({alert_id:this.alertId}).setHandler(function(){DOM.replace(link,$N('span',{className:'undo_link'},_tx("Undone")));this.remove.bind(this).defer(Beep.UNDONE_BEEP_DELAY_MS);}.bind(this)).send();},xout:function(){this._owner.pause();var cancel_handler=function(){this._owner.unpause();}.bind(this);ChatNotifications.showReportDialog(this.applicationName,this.onHideBeepSpam.bind(this,false),this.onHideBeepSpam.bind(this,true),cancel_handler);},onHideBeepSpam:function(isSpamReport){ChatNotifications.markAppNotificationSpam(this.applicationId,this.platformType,isSpamReport);this._owner.hideBeepsByApplication(this.applicationId);presenceNotifications.hideNotifications(this.applicationId);this._owner.unpause(Beeper.DEFAULT_DELAY_MS);},remove:function(){animation(this._node).to('width',30).to('height',27).to('margin-left',169).to('opacity',0).duration(Beep.REMOVE_BEEP_ANIM_MS).ease(animation.ease.both).ondone(function(){this._node.remove();this._owner.beeps.remove(this);if(!this._owner.beeps.length){this._owner.reset();}else{this._owner.updateEdges();}}.bind(this)).go();this.fadeOut(Beep.REMOVE_BEEP_ANIM_MS);},markRead:function(){this.unread=false;},endFade:function(){if(this._node){this._node.removeClass('UIBeep_Fading');}
this._owner.setFading(false,this._isTop,this._isBottom);},fadeOut:function(duration){this._node.addClass('UIBeep_Fading');this._owner.setFading(true,this._isTop,this._isBottom);var thumb=this._node.scry('img.beeper_pic');if(thumb&&thumb.length){thumb=thumb[0];animation(thumb).to('width',20).to('height',20).duration(duration).blind().go();}
var icon=this._node.find('div.UIBeep_Icon');animation(icon).from('width',40).to(20).duration(duration).ondone(this.endFade.bind(this)).go();},fadeIn:function(duration){this._owner.fadeIn(this._isTop,this._isBottom,duration);animation(this._node).to('opacity',1.0).ease(animation.ease.both).duration(duration).show().go();},setEdges:function(){if(this._isTop){this.setTop(true);}
if(this._isBottom){this.setBottom(true);}},setBottom:function(value){this._isBottom=value;CSS.conditionClass(this._node,'UIBeep_Bottom',value);if(value){this._owner.setBottom(this._selected);}},setTop:function(value){this._isTop=value;CSS.conditionClass(this._node,'UIBeep_Top',value);if(value){this._owner.setTop(this._selected);}},getNode:function(){return this._node;}});
function Beeper(root){this._baseRoot=root;this._receiver=new LiveMessageReceiver(Beeper.BEEP_EVENT).setAppId(Beeper.APP_ID).setHandler(this.fromMessage.bind(this)).register();presence.registerTabOpenHandler(this.onPresenceTabOpen.bind(this));}
copy_properties(Beeper,{BEEP_EVENT:'beep_event',APP_ID:30729425562,DEFAULT_DELAY_MS:10000,DEFAULT_UNPAUSE_MS:500,SLIDE_DOWN_ANIMATION_MS:700,FADE_IN_ANIMATION_MS:500,FADE_OUT_ANIMATION_MS:1250,_instance:null,setInstance:function(instance){Beeper._instance=instance;},getInstance:function(){if(!Beeper._instance){throw'Beeper must be initialiazed with .setInstance() first.';}
return Beeper._instance;}});copy_properties(Beeper.prototype,{beeps:[],reset:function(){this.beeps=[];if(this._root){this._root.remove();}
this._root=$(this._baseRoot.cloneNode(true));this._root.listen('mouseover',this.mouseover.bind(this));this._root.listen('mouseout',this.mouseout.bind(this));DOM.insertAfter(this._baseRoot,this._root);this._full=this._root.find('div.UIBeeper_Full');this._inside=this._root.find('div.Beeps');this._top=this._root.find('img.UIBeeper_Top');this._top_selected=this._root.find('img.UIBeeper_Top_Selected');this._bottom=this._root.find('img.UIBeeper_Bottom');this._bottom_selected=this._root.find('img.UIBeeper_Bottom_Selected');this.deactivateListeners();if(this._timer){clearInterval(this._timer);}
this._timer=null;this._animation=null;this._animatingOut=false;this._paused=0;Arbiter.inform(Arbiter.BEEPS_EXPIRED);},onPresenceTabOpen:function(tab){if(tab=='presence_notifications_tab'){this.reset();}},mouseover:function(event){this.pause();this.markRead();},mouseout:function(event){var target=$E(event).getTarget();this.unpause();},fromMessage:function(properties){if(!this._root){this.reset();}
var beep=new Beep(this,properties);this.addBeep(beep);},addBeep:function(beep){if(presence.focusedTab=='presence_notifications_tab'){return;}
if(this._animatingOut){this.addBeep.bind(this,beep).defer(500);return;}
this.beeps.push(beep);beep.setTop(true);if(this.beeps.length==1){beep.setBottom(true);this._root.addClass('UIBeeper_Active');}else{beep.setBottom(false);this.beeps[this.beeps.length-2].setTop(false);}
this._restartTimer(Beeper.DEFAULT_DELAY_MS);this._inside.prependContent(beep.getNode());beep.fadeIn(Beeper.FADE_IN_ANIMATION_MS);this.activateListeners();},activateListeners:function(){this._activityToken=UserActivity.subscribe(this.onActivity.bind(this));},deactivateListeners:function(){if(this._activityToken){Arbiter.unsubscribe(this._activityToken);}},onActivity:function(){this.deactivateListeners();this.markRead();},hasIncoming:function(){for(var i=0;ireturn false;},expireBeeps:function(){if(this.beeps.length<=0){return;}
this.fadeOut();},shrinkOut:function(){animation(this._full).to('width',30).to('height',27*this.beeps.length).to('margin-left',169).to('margin-bottom',5).duration(Beeper.SLIDE_DOWN_ANIMATION_MS).ease(animation.ease.both).checkpoint(0.3).to('opacity',0).to('height',0).ease(animation.ease.both).ondone(function(){this.reset();}.bind(this)).go();this._animatingOut=true;for(var ii=0;iivar alertMap=Object.from(alertsRead);this.beeps.each(function(beep){if(alertMap[beep.alertId]){beep.markRead();}});if(!skipAsyncRequest&&alertsRead.length){presenceNotifications.notifyRead(alertsRead);}},pause:function(){if(this._animatingOut){return;}
if(this._animation&&this._animation.undo){this._animation.undo();this._animation=null;return;}
this._pauseTimer();this._root.addClass('UIBeeper_Paused');this._paused++;},_pauseTimer:function(){if(this._timer){clearInterval(this._timer);}},unpause:function(extendMs){if(!extendMs){extendMs=Beeper.DEFAULT_UNPAUSE_MS;}
this._paused--;if(this._paused<=0){this._root.removeClass('UIBeeper_Paused');this._restartTimer(extendMs);}},_restartTimer:function(extraTime){if(this._timer){clearInterval(this._timer);}
this._timer=this.expireBeeps.bind(this).defer(extraTime);},updateEdges:function(){if(this.beeps.length<=0){return;}
this.beeps[0].setBottom(true);this.beeps[this.beeps.length-1].setTop(true);},hideBeepsByApplication:function(applicationId){for(var ii=0;iiif(includeBottom){toFade.push(this._bottom);toFade.push(this._bottom_selected);}
for(var i=0;iif(includeBottom){toggler(this._root,'UIBeeper_Fading_Bottom');}},setTop:function(selected){CSS.conditionClass(this._top,'display_none',selected);CSS.conditionClass(this._top_selected,'display_none',!selected);},setBottom:function(selected){CSS.conditionClass(this._bottom,'display_none',selected);CSS.conditionClass(this._bottom_selected,'display_none',!selected);}});
if (window.Bootloader) { Bootloader.done(["js\/8qmlbumen008ckso.pkg.js"]); }
| Kommentar |
|





































