Use new gateway for latest version info

This commit is contained in:
Dmitriy Simushev 2014-12-23 13:46:43 +00:00
parent 782e9895e5
commit ee751b471d
2 changed files with 18 additions and 19 deletions

View File

@ -16,26 +16,25 @@
* limitations under the License.
*/
(function ($) {
var loadVersion = function () {
if (typeof (window.mibewLatest) == "undefined" || typeof (window.mibewLatest.version) == "undefined") {
(function (Mibew, $) {
Mibew.updateVersion = function(data) {
if (!data.core || !data.core.stable) {
return;
}
var current = $("#current-version").html();
$(document).ready(function() {
var currentVersion = $("#current-version").html(),
core = data.core.stable;
if (current != window.mibewLatest.version) {
if (current < window.mibewLatest.version) {
if (currentVersion != core.version) {
if (currentVersion < core.version) {
$("#current-version").css("color", "red");
}
$("#latest-version").html(window.mibewLatest.version + ", Download <a href=\"" + window.mibewLatest.download + "\">" + window.mibewLatest.title + "</a>");
$("#latest-version").html(core.version + ", Download <a href=\"" + core.download + "\">" + core.title + "</a>");
} else {
$("#current-version").css("color", "green");
$("#latest-version").html(window.mibewLatest.version);
$("#latest-version").html(core.version);
}
}
$(function () {
loadVersion();
});
})(jQuery);
}
})(Mibew, jQuery);

View File

@ -47,11 +47,11 @@ class AboutController extends AbstractController
prepare_menu($this->getOperator())
);
$this->getAssetManager()->attachJs('js/compiled/about.js');
$this->getAssetManager()->attachJs(
'https://mibew.org/latestMibew.js',
'https://mibew.org/api/updates',
AssetManagerInterface::ABSOLUTE_URL
);
$this->getAssetManager()->attachJs('js/compiled/about.js');
return $this->render('about', $page);
}