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')
})
.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({

View File

@ -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()
],

View File

@ -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({

View File

@ -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;