2014-09-01 12:01:41 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
oml.ui.updateButton = function() {
|
|
|
|
|
|
|
|
var that = Ox.Element({
|
2016-01-13 04:49:49 +00:00
|
|
|
tooltip: Ox._('Software Update')
|
2014-09-01 12:01:41 +00:00
|
|
|
})
|
|
|
|
.css({
|
2016-01-13 04:49:49 +00:00
|
|
|
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();
|
2014-09-01 12:01:41 +00:00
|
|
|
|
|
|
|
function check() {
|
2016-01-13 04:49:49 +00:00
|
|
|
oml.api.getVersion(function(result) {
|
|
|
|
if (result.data.version != oml.version) {
|
2014-09-01 12:01:41 +00:00
|
|
|
that.show();
|
|
|
|
} else {
|
|
|
|
that.hide();
|
|
|
|
}
|
|
|
|
});
|
2016-01-13 04:49:49 +00:00
|
|
|
setTimeout(check, 3600000);
|
2014-09-01 12:01:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return that;
|
|
|
|
|
|
|
|
};
|