Author: eallen
Date: 2009-06-04 16:37:49 -0400 (Thu, 04 Jun 2009)
New Revision: 3423
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Added "Page Updated" indicator to top-left of all pages.
Paused background updates after 30 minutes.
Added "Resume Updates" button that displays after updates are paused.
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2009-06-04 20:37:02 UTC (rev 3422)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2009-06-04 20:37:49 UTC (rev 3423)
@@ -45,6 +45,9 @@
def get_default(self, session):
return list()
+class CuminHeartBeat(Widget):
+ pass
+
class CuminMainView(TabbedModeSet):
def __init__(self, app, name):
super(CuminMainView, self).__init__(app, name)
@@ -54,6 +57,9 @@
self.actions = ActionInvocationSet(app, "actions")
self.add_child(self.actions)
+ heartbeat = CuminHeartBeat(app, "heartbeat")
+ self.add_child(heartbeat)
+
def do_process(self, session, *args):
self.actions.process(session)
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2009-06-04 20:37:02 UTC (rev 3422)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2009-06-04 20:37:49 UTC (rev 3423)
@@ -108,6 +108,56 @@
top: -2px;
}
+[CuminMainView.javascript]
+ wooly.addPageUpdateListener( function () {
+ var myEffect = new Fx.Morph('heartbeat', {duration: 1000});
+ $('shock').style.display = "none";
+ $('heartbeat').style.display = "inline";
+ $('heartbeat').style.color = "#000000";
+ setTimeout(function () {myEffect.start({ 'color': ['#000000',
'#CCCCCC'] })}, 500);
+
+ });
+ cumin.expireIntervalUpdate = function () {
+ if (typeof cumin.expireID != "undefined") {
+ if (cumin.expireID) {
+ window.clearTimeout(cumin.expireID);
+ cumin.expireID = null;
+ }
+ }
+ cumin.expireID = setTimeout(function () {
+ wooly.cancelIntervalUpdate();
+ setTimeout(function () {
+ $('heartbeat').style.display = "none";
+ $('shock').style.display = "block"}, 1000);
+ $('shock').onclick = function () {
+ wooly.resumeIntervalUpdate();
+ cumin.expireIntervalUpdate();
+ }
+ }, 30*60*1000);
+ };
+ cumin.expireIntervalUpdate();
+
+[CuminHeartBeat.css]
+#updateStatus {
+ float:right;
+ padding: 0.25em;
+ font-size: 0.8em;
+}
+#updateStatus button {
+ display: none;
+ margin-left:0.5em;
+ padding: 0;
+ background-color: #FFF0F0;
+ color: #600;
+ border: 1px solid #C00;
+}
+
+[CuminHeartBeat.html]
+<div id="updateStatus">
+ <span id="heartbeat">Page Updated</span>
+ <button id="shock">Resume Updates</button>
+</div>
+
[CuminMainView.html]
<div id="head">
<div id="user">
@@ -123,6 +173,7 @@
<div id="body">
<div id="messages" style="display: {action_display};"><p
title="close"
onclick="cumin.hideActions()">x</p>{actions}</div>
+ {heartbeat}
{content}</div>
Show replies by date