mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
New version function
This commit is contained in:
@@ -198,7 +198,7 @@ function showInfoDialog(type,header,message)
|
||||
$('#id_body').append(message);
|
||||
$('#id_footer').html('<button type="button" class="btn btn-primary" data-dismiss="modal">'+$.i18n('general_btn_ok')+'</button>');
|
||||
}
|
||||
|
||||
|
||||
$('#id_body').append('<h4 style="font-weight:bold;text-transform:uppercase;">'+header+'</h4>');
|
||||
$('#id_body').append(message);
|
||||
|
||||
@@ -709,3 +709,51 @@ function encode_utf8(s)
|
||||
{
|
||||
return unescape(encodeURIComponent(s));
|
||||
}
|
||||
|
||||
function getReleases(callback)
|
||||
{
|
||||
$.ajax({
|
||||
url: window.gitHubReleaseApiUrl,
|
||||
method: 'get',
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
callback(false);
|
||||
},
|
||||
success: function(releases)
|
||||
{
|
||||
window.gitHubVersionList = releases;
|
||||
|
||||
for(var i in releases)
|
||||
{
|
||||
if(releases[i].prerelease == true)
|
||||
{
|
||||
window.latestBetaVersion = releases[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: window.gitHubReleaseApiUrl + "/latest",
|
||||
method: 'get',
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown)
|
||||
{
|
||||
callback(false);
|
||||
},
|
||||
success: function(latest)
|
||||
{
|
||||
window.latestStableVersion = latest;
|
||||
|
||||
if(window.serverConfig.general.versionBranch == "Beta" && window.latestStableVersion.tag_name.replace(/\./g, '') <= window.latestBetaVersion.tag_name.replace(/\./g, ''))
|
||||
{
|
||||
window.latestVersion = window.latestBetaVersion;
|
||||
}
|
||||
else
|
||||
{
|
||||
window.latestVersion = window.latestStableVersion;
|
||||
}
|
||||
callback(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user