update menu extras

This commit is contained in:
rlx 2016-01-13 10:19:49 +05:30
parent 4dc7a97504
commit 0bb44fc4ef
4 changed files with 31 additions and 32 deletions

View file

@ -6,7 +6,7 @@ oml.ui.connectionButton = function() {
tooltip: Ox._('Transfers') tooltip: Ox._('Transfers')
}) })
.css({ .css({
marginRight: '3px' marginRight: '6px'
}) })
.bindEvent({ .bindEvent({
click: function() { click: function() {
@ -26,7 +26,7 @@ oml.ui.connectionButton = function() {
function formatBandwidth(up, down) { function formatBandwidth(up, down) {
return '↓ ' + Ox.formatValue(down, 'B') return '↓ ' + Ox.formatValue(down, 'B')
+ ' / ↑ ' + Ox.formatValue(up, 'B'); + ' ↑ ' + Ox.formatValue(up, 'B');
} }
oml.bindEvent({ oml.bindEvent({

View file

@ -9,8 +9,8 @@ oml.ui.mainMenu = function() {
that = Ox.MainMenu({ that = Ox.MainMenu({
extras: [ extras: [
oml.$ui.connectionButton = oml.ui.connectionButton(),
oml.$ui.updateButton = oml.ui.updateButton(), oml.$ui.updateButton = oml.ui.updateButton(),
oml.$ui.connectionButton = oml.ui.connectionButton(),
oml.$ui.notificationsButton = oml.ui.notificationsButton(), oml.$ui.notificationsButton = oml.ui.notificationsButton(),
oml.$ui.loadingIcon = oml.ui.loadingIcon() oml.$ui.loadingIcon = oml.ui.loadingIcon()
], ],

View file

@ -3,10 +3,10 @@
oml.ui.notificationsButton = function() { oml.ui.notificationsButton = function() {
var that = Ox.Element({ var that = Ox.Element({
tooltip: Ox._('No notifications') tooltip: Ox._('No peering requests')
}) })
.css({ .css({
marginRight: '3px' marginRight: '6px'
}) })
.bindEvent({ .bindEvent({
click: function() { click: function() {
@ -16,7 +16,7 @@ oml.ui.notificationsButton = function() {
Ox.Button({ Ox.Button({
style: 'symbol', style: 'symbol',
title: 'playlist', title: 'user',
type: 'image' type: 'image'
}) })
.css({ .css({

View file

@ -3,42 +3,41 @@
oml.ui.updateButton = function() { oml.ui.updateButton = function() {
var that = Ox.Element({ var that = Ox.Element({
tooltip: Ox._('Updates Available') tooltip: Ox._('Software Update')
}) })
.css({ .css({
marginRight: '3px' marginRight: '6px'
}).hide(); })
.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() { function check() {
oml.api.getVersion(function(response) { oml.api.getVersion(function(result) {
if (response.data.update) { if (result.data.version != oml.version) {
that.show(); that.show();
} else { } else {
that.hide(); 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; return that;