'use strict'; oml.ui.appDialog = function() { var ui = oml.user.ui, tabs = Ox.getObjectById(oml.config.pages, 'app').parts.map(function(tab) { return { id: tab.id, title: tab.title.replace(/ Open Media Library$/, ''), selected: tab.id == ui.part.app }; }), $panel = Ox.TabPanel({ content: function(id) { var $content = Ox.Element(), $logo = Ox.Element(), $text = Ox.Element() .addClass('OxTextPage'), title = Ox._(Ox.getObjectById( Ox.getObjectById(oml.config.pages, 'app').parts, id ).title); $('') .attr({ src: '/static/png/oml.png' }) .css({ position: 'absolute', left: '16px', top: '16px', width: '192px', height: '192px' }) .appendTo($logo); if (id == 'update') { $content.html('
./ctl update
'));
} else {
$update.html(Ox._('A new version of Open Media Library is available'));
Ox.Button({
id: 'update',
title: Ox._('Install Now')
}).bindEvent({
click: function() {
this.options({
disabled: true,
title: 'Installing...'
});
oml.api.restart({update: true},function(response) {
if (response.status.code == 200) {
setTimeout(reload, 500);
}
});
}
}).appendTo($content);
}
} else {
if (response.data.current == 'git') {
$update.html(Ox._('You\'re up to date'));
} else {
$update.html(Ox._('You are running Version {0}. You\'re up to date.', [response.data.current]));
}
}
});
} else {
$content.html('The lazy brown fox jumped over the lazy black fox, but otherwise not really much happened here since you last checked.'); } $('