+ $('#realtime_pause').bind('click', function() {
+ RealtimeUpdate.removeNoticesHover();
+ RealtimeUpdate.showPlay();
+ return false;
+ });
+ },
+
+ showPlay: function()
+ {
+ RealtimeUpdate.setPause(true);
+ $('#realtime_playpause').remove();
+ $('#realtime_actions').prepend('<li id="realtime_playpause"><span id="queued_counter"></span> <button id="realtime_play" class="play" title="Play">Play</button></li>');
+
+ $('#realtime_play').bind('click', function() {
+ RealtimeUpdate.showPause();
+ return false;
+ });
+ },
+
+ setPause: function(state)
+ {
+ RealtimeUpdate._paused = state;
+ if (typeof(localStorage) != 'undefined') {
+ localStorage.setItem('RealtimeUpdate_paused', RealtimeUpdate._paused);
+ }
+ },
+
+ showQueuedNotices: function()
+ {
+ $.each(RealtimeUpdate._queuedNotices, function(i, n) {
+ RealtimeUpdate.insertNoticeItem(n);
+ });
+
+ RealtimeUpdate._queuedNotices = [];
+
+ RealtimeUpdate.removeQueuedCounter();
+ },
+
+ updateQueuedCounter: function()
+ {
+ $('#realtime_playpause #queued_counter').html('('+RealtimeUpdate._queuedNotices.length+')');
+ },
+
+ removeQueuedCounter: function()
+ {
+ $('#realtime_playpause #queued_counter').empty();
+ },
+
+ addNoticesHover: function()
+ {
+ $('#notices_primary .notices').hover(
+ function() {
+ if (RealtimeUpdate._paused === false) {
+ RealtimeUpdate.showPlay();
+ }
+ },
+ function() {
+ if (RealtimeUpdate._paused === true) {
+ RealtimeUpdate.showPause();
+ }
+ }
+ );
+ },
+
+ removeNoticesHover: function()
+ {
+ $('#notices_primary .notices').unbind();
+ },
+
+ initAddPopup: function(url, timeline, path)
+ {
+ $('#realtime_timeline').append('<button id="realtime_popup" title="Pop up in a window">Pop up</button>');
+
+ $('#realtime_popup').bind('click', function() {