修复ESPNConversations(添加暂停按钮) [英] fixing ESPNConversations (add pause button)

查看:115
本文介绍了修复ESPNConversations(添加暂停按钮)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是他们的新讨论板。 (http://espn.go.com/nba/conversation?id=310605006)问题是,实时更新不断添加新评论,因此它会一直滚动远离您正在阅读的内容,例如在比赛结束后成千上万的人正在添加评论。它真的很荒谬。因此,只需尝试编写一个greasemonkey脚本,您可以点击按钮,它将暂停电路板更新。

Its their new discussion board. (http://espn.go.com/nba/conversation?id=310605006) The problem is, the real time updates keep adding new comments so it keeps scrolling away from whatever you're reading, for example right after a game when thousands of people are adding comments. Its really ridiculous. So just trying to write a greasemonkey script where you can hit a button and it will pause the board updates.

暂停功能是我不知道的 - 最基本的直接方式是什么 - 暂时禁用ajax之类的东西,我在想,但任何有效的东西。 (不确定他们正在使用它的ajax。)

The pause function is what I don't know - what is the most basic straightforward way to do that - something that temporarily disables ajax or the like I'm thinking, but anything that works. (Don't know for sure its ajax they're using.)

推荐答案

暂停AJAX没有固定的方法。这一切都取决于页面详细信息。

There is no set way to pause AJAX. It all depends on the page details.

在这种情况下,当您将鼠标悬停在会话区域时,该页面会暂停更新。该页面使用jQuery和 Echo Stream 库。

In this case, that page pauses updates when you mouse over the conversation area. And that page uses jQuery and the Echo Stream library.

所以你可以让你的脚本创建一个发送的按钮mouseover 1 事件(切换为发送 mouseout 以清除)。

So you could have your script create a button that sends mouseover 1 events (toggling to send mouseout to clear).

暂停来自Firebug控制台的评论:

To pause the comments from the Firebug console:

jQuery ('div.echo-stream-body').mouseover ();




暂停Greasemonkey脚本的注释:



To pause the comments from a Greasemonkey script:

unsafeWindow.jQuery ('div.echo-stream-body').mouseover ();




希望这足以让你入门。



Hopefully that's enough to get you started.

如需帮助从头开始编写该页面的脚本,请尝试 userscripts。组织论坛

For help writing a script from scratch for that page, try the userscripts.org forum.

对于特定的代码问题,我们可以在这里提供帮助(在另一个问题中)。

For specific code problems, we can help here (in another question).


1 或者你可能会找到回声流触发的函数在悬停事件和直接挂钩。

1 Or you could probably find the function that echo stream fires on hover events and hook in directly.

这篇关于修复ESPNConversations(添加暂停按钮)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆