mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
added really ugly icon to quit the current app
This commit is contained in:
parent
bd6f5f28fe
commit
b2df44719c
@ -62,6 +62,10 @@ function beginBackgroundPollingOfHost(host) {
|
|||||||
host.initialPing(function () { // initial attempt was a success
|
host.initialPing(function () { // initial attempt was a success
|
||||||
$("#hostgrid-" + host.serverUid).removeClass('host-cell-inactive');
|
$("#hostgrid-" + host.serverUid).removeClass('host-cell-inactive');
|
||||||
activePolls[host.serverUid] = window.setInterval(function() {
|
activePolls[host.serverUid] = window.setInterval(function() {
|
||||||
|
if (api && activePolls[api.serverUid] != null) {
|
||||||
|
stopBackgroundPollingOfHost(api);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// every 5 seconds, poll at the address we know it was live at
|
// every 5 seconds, poll at the address we know it was live at
|
||||||
host.refreshServerInfoAtAddress(host.address).then(function (onSuccess){
|
host.refreshServerInfoAtAddress(host.address).then(function (onSuccess){
|
||||||
$("#hostgrid-" + host.serverUid).removeClass('host-cell-inactive');
|
$("#hostgrid-" + host.serverUid).removeClass('host-cell-inactive');
|
||||||
@ -72,6 +76,10 @@ function beginBackgroundPollingOfHost(host) {
|
|||||||
}, function () { // initial attempt was a failure
|
}, function () { // initial attempt was a failure
|
||||||
$("#hostgrid-" + host.serverUid).addClass('host-cell-inactive');
|
$("#hostgrid-" + host.serverUid).addClass('host-cell-inactive');
|
||||||
activePolls[host.serverUid] = window.setInterval(function() {
|
activePolls[host.serverUid] = window.setInterval(function() {
|
||||||
|
if (api && activePolls[api.serverUid] != null) {
|
||||||
|
stopBackgroundPollingOfHost(api);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(host.refreshServerInfoAtAddress(host.address)) {
|
if(host.refreshServerInfoAtAddress(host.address)) {
|
||||||
$("#hostgrid-" + host.serverUid).removeClass('host-cell-inactive');
|
$("#hostgrid-" + host.serverUid).removeClass('host-cell-inactive');
|
||||||
} else {
|
} else {
|
||||||
@ -323,6 +331,9 @@ function showApps() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#game-grid").append($("<div>", {html:$("<img src=icons\\icon48.png id=quitCurrentApp\>"), class: 'box-art mdl-cell mdl-cell--3-col'}).append($("<span>", {html: 'Quit Current App', class:"game-title"})));
|
||||||
|
$('#quitCurrentApp').on('click', function() {api.quitApp(); api.refreshServerInfo(); });
|
||||||
|
|
||||||
}, function (failedAppList) {
|
}, function (failedAppList) {
|
||||||
console.log('Failed to get applist from host: ' + api.address);
|
console.log('Failed to get applist from host: ' + api.address);
|
||||||
console.log('failed API object: ');
|
console.log('failed API object: ');
|
||||||
@ -344,6 +355,7 @@ function showHostsAndSettingsMode() {
|
|||||||
$("body").css('backgroundColor', 'white');
|
$("body").css('backgroundColor', 'white');
|
||||||
if(api && !activePolls[api.serverUid]) {
|
if(api && !activePolls[api.serverUid]) {
|
||||||
beginBackgroundPollingOfHost(api);
|
beginBackgroundPollingOfHost(api);
|
||||||
|
api = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user