mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-04 10:58:31 +03:00
Use new gateway for latest version info
This commit is contained in:
parent
782e9895e5
commit
ee751b471d
@ -16,26 +16,25 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function ($) {
|
(function (Mibew, $) {
|
||||||
var loadVersion = function () {
|
Mibew.updateVersion = function(data) {
|
||||||
if (typeof (window.mibewLatest) == "undefined" || typeof (window.mibewLatest.version) == "undefined") {
|
if (!data.core || !data.core.stable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var current = $("#current-version").html();
|
$(document).ready(function() {
|
||||||
|
var currentVersion = $("#current-version").html(),
|
||||||
|
core = data.core.stable;
|
||||||
|
|
||||||
if (current != window.mibewLatest.version) {
|
if (currentVersion != core.version) {
|
||||||
if (current < window.mibewLatest.version) {
|
if (currentVersion < core.version) {
|
||||||
$("#current-version").css("color", "red");
|
$("#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 {
|
} else {
|
||||||
$("#current-version").css("color", "green");
|
$("#current-version").css("color", "green");
|
||||||
$("#latest-version").html(window.mibewLatest.version);
|
$("#latest-version").html(core.version);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$(function () {
|
|
||||||
loadVersion();
|
|
||||||
});
|
});
|
||||||
})(jQuery);
|
}
|
||||||
|
})(Mibew, jQuery);
|
||||||
|
@ -47,11 +47,11 @@ class AboutController extends AbstractController
|
|||||||
prepare_menu($this->getOperator())
|
prepare_menu($this->getOperator())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->getAssetManager()->attachJs('js/compiled/about.js');
|
||||||
$this->getAssetManager()->attachJs(
|
$this->getAssetManager()->attachJs(
|
||||||
'https://mibew.org/latestMibew.js',
|
'https://mibew.org/api/updates',
|
||||||
AssetManagerInterface::ABSOLUTE_URL
|
AssetManagerInterface::ABSOLUTE_URL
|
||||||
);
|
);
|
||||||
$this->getAssetManager()->attachJs('js/compiled/about.js');
|
|
||||||
|
|
||||||
return $this->render('about', $page);
|
return $this->render('about', $page);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user