From 0bb44fc4efdf5de615bd2ff5f515d9b23e330dde Mon Sep 17 00:00:00 2001 From: rlx Date: Wed, 13 Jan 2016 10:19:49 +0530 Subject: [PATCH] update menu extras --- static/js/connectionButton.js | 4 +-- static/js/mainMenu.js | 2 +- static/js/notificationsButton.js | 6 ++-- static/js/updateButton.js | 51 ++++++++++++++++---------------- 4 files changed, 31 insertions(+), 32 deletions(-) diff --git a/static/js/connectionButton.js b/static/js/connectionButton.js index ae38c07..ba28ae5 100644 --- a/static/js/connectionButton.js +++ b/static/js/connectionButton.js @@ -6,7 +6,7 @@ oml.ui.connectionButton = function() { tooltip: Ox._('Transfers') }) .css({ - marginRight: '3px' + marginRight: '6px' }) .bindEvent({ click: function() { @@ -26,7 +26,7 @@ oml.ui.connectionButton = function() { function formatBandwidth(up, down) { return '↓ ' + Ox.formatValue(down, 'B') - + ' / ↑ ' + Ox.formatValue(up, 'B'); + + ' ↑ ' + Ox.formatValue(up, 'B'); } oml.bindEvent({ diff --git a/static/js/mainMenu.js b/static/js/mainMenu.js index bf556fe..a8335cb 100644 --- a/static/js/mainMenu.js +++ b/static/js/mainMenu.js @@ -9,8 +9,8 @@ oml.ui.mainMenu = function() { that = Ox.MainMenu({ extras: [ - oml.$ui.connectionButton = oml.ui.connectionButton(), oml.$ui.updateButton = oml.ui.updateButton(), + oml.$ui.connectionButton = oml.ui.connectionButton(), oml.$ui.notificationsButton = oml.ui.notificationsButton(), oml.$ui.loadingIcon = oml.ui.loadingIcon() ], diff --git a/static/js/notificationsButton.js b/static/js/notificationsButton.js index c4501fa..7981284 100644 --- a/static/js/notificationsButton.js +++ b/static/js/notificationsButton.js @@ -3,10 +3,10 @@ oml.ui.notificationsButton = function() { var that = Ox.Element({ - tooltip: Ox._('No notifications') + tooltip: Ox._('No peering requests') }) .css({ - marginRight: '3px' + marginRight: '6px' }) .bindEvent({ click: function() { @@ -16,7 +16,7 @@ oml.ui.notificationsButton = function() { Ox.Button({ style: 'symbol', - title: 'playlist', + title: 'user', type: 'image' }) .css({ diff --git a/static/js/updateButton.js b/static/js/updateButton.js index cbcb223..0eb993c 100644 --- a/static/js/updateButton.js +++ b/static/js/updateButton.js @@ -3,42 +3,41 @@ oml.ui.updateButton = function() { var that = Ox.Element({ - tooltip: Ox._('Updates Available') + tooltip: Ox._('Software Update') }) .css({ - marginRight: '3px' - }).hide(); + marginRight: '6px' + }) + .append( + Ox.Button({ + style: 'symbol', + title: 'set', + type: 'image' + }) + .css({ + float: 'left', + borderRadius: 0 + }) + .bindEvent({ + click: function() { + oml.UI.set({page: 'update'}) + } + }) + ) + .hide(); + + check(); function check() { - oml.api.getVersion(function(response) { - if (response.data.update) { + oml.api.getVersion(function(result) { + if (result.data.version != oml.version) { that.show(); } else { that.hide(); } }); + setTimeout(check, 3600000); } - check(); - setTimeout(check, 86400000); - - Ox.Button({ - style: 'symbol', - title: 'upload', - type: 'image' - }) - .css({ - float: 'left', - borderRadius: 0 - }) - .bindEvent({ - click: function() { - oml.UI.set({ - 'page': 'app', - 'part.app': 'update' - }) - } - }) - .appendTo(that); return that;