Author: sevein
Date: Sun Oct 10 08:42:55 2010
New Revision: 8040
Log:
Persistent notification.
Modified:
trunk/apps/qubit/modules/default/actions/updateCheckComponent.class.php
trunk/js/updateCheck.js
Modified:
trunk/apps/qubit/modules/default/actions/updateCheckComponent.class.php
==============================================================================
--- trunk/apps/qubit/modules/default/actions/updateCheckComponent.class.php
Sun Oct 10 00:02:46 2010 (r8039)
+++ trunk/apps/qubit/modules/default/actions/updateCheckComponent.class.php
Sun Oct 10 08:42:55 2010 (r8040)
@@ -29,7 +29,7 @@
{
public function execute($request)
{
- if (!$this->getUser()->hasCredential('administrator') ||
!sfConfig::get('app_check_for_updates') ||
$request->getCookie('update_checked'))
+ if (!$this->getUser()->hasCredential('administrator') ||
!sfConfig::get('app_check_for_updates'))
{
return sfView::NONE;
Modified: trunk/js/updateCheck.js
==============================================================================
--- trunk/js/updateCheck.js Sun Oct 10 00:02:46 2010 (r8039)
+++ trunk/js/updateCheck.js Sun Oct 10 08:42:55 2010 (r8040)
@@ -8,6 +8,23 @@
attach: function (context)
{
+ var showNotification = function (version)
+ {
+ if (1 > version_compare(Qubit.updateCheck.currentVersion,
version))
+ {
+ $('<div id="update-check"><span>' +
Qubit.updateCheck.notificationMessage.replace('%1%', version) +
'</span></div>').insertAfter('#languageMenu');
+ }
+ };
+
+ var version = YAHOO.util.Cookie.get('update_checked');
+
+ if (version)
+ {
+ showNotification(version);
+
+ return;
+ }
+
$.ajax({
data: Qubit.updateCheck.data,
dataType: 'jsonp',
@@ -17,12 +34,9 @@
url: Qubit.updateCheck.url,
success: function(data)
{
- if (1 > version_compare(Qubit.updateCheck.currentVersion,
data.version))
- {
- $('<div id="update-check"><span>' +
Qubit.updateCheck.notificationMessage.replace('%1%', data.version) +
'</span></div>').insertAfter('#languageMenu');
- }
+ showNotification(data.version);
- YAHOO.util.Cookie.set('update_checked', 1, { path: '/' });
+ YAHOO.util.Cookie.set('update_checked', data.version, { path:
'/' });
}
});
}
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.