The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Activity Stream Javascript Fix (timeout)
Found a small "glitch" in vbulletin's activity stream's javascript. Essentially, the timeout timer is not being initiated unless a "mousemove" event is fired. This will only affect the largest of boards and those boards that heavily use the activity stream. Otherwise you would be wasting your time with this patch and the rest of this text will surely bore you.
Background ------------ My daughter had a redesign idea for her activity stream, so I finally had a bit of time to redevelop the JavaScript/AJAX for her new page. She wanted a dynamic window widget for her modified activity stream with additional filters and presentation information. When working with the new floating widget I noticed that the activity stream never timed out when the widget was not in focus. This will not do as her users want to have this window float on their desktops and will probably forget that it is there. I did not want 400 users banging on the server indefinitely for AJAX updates. vBulletin has done a fair job in their code here so updates are very minimized, unless the user asks for an update via the AJAX activity indicator. On my daughters board this additional click is optional so the updates can be a real-time stream. Once a "mousemove" event is triggered then everything works as expected. In most cases most users will perform this just viewing the page. This is only a real problem if this window/widget is not the current focus, thus impossible for an initial "mousemove" event. Anyway, here is the fix. (Do not bother with this unless you are doing something similar). In "/clientscript/vbulletin_activitystream.js" make the following changes and additions. Search for: Code:
YAHOO.util.Event.addListener(document, "mousemove", this.reset_idle_timer, this); Code:
this.init_idle_timer(this); // TBWORLD idle timer fix YAHOO.util.Event.addListener(document, "mousemove", this.reset_idle_timer, this); Code:
// Initialize the Idle-Timer (TBWORLD) vB_ActivityStream.prototype.init_idle_timer = function(activityobj) { activityobj.idletimer = setTimeout(function(){activityobj.go_idle();}, activityobj.idle_refresh); } |
Благодарность от: | ||
Scanu |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|