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.
|
||||
*/
|
||||
|
||||
(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) {
|
||||
$("#current-version").css("color", "red");
|
||||
if (currentVersion != core.version) {
|
||||
if (currentVersion < core.version) {
|
||||
$("#current-version").css("color", "red");
|
||||
}
|
||||
$("#latest-version").html(core.version + ", Download <a href=\"" + core.download + "\">" + core.title + "</a>");
|
||||
} else {
|
||||
$("#current-version").css("color", "green");
|
||||
$("#latest-version").html(core.version);
|
||||
}
|
||||
$("#latest-version").html(window.mibewLatest.version + ", Download <a href=\"" + window.mibewLatest.download + "\">" + window.mibewLatest.title + "</a>");
|
||||
} else {
|
||||
$("#current-version").css("color", "green");
|
||||
$("#latest-version").html(window.mibewLatest.version);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
loadVersion();
|
||||
});
|
||||
})(jQuery);
|
||||
})(Mibew, jQuery);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user