mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
user can now forget hosts
- hosts are never unpaired, so re-adding the hostname will not require pairing GFEHostIP field marked as `dirty` when mDNS found - thanks to https://github.com/google/material-design-lite/issues/903 - untested.
This commit is contained in:
parent
55275b8c4b
commit
5d4f191b07
@ -54,6 +54,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="button-holder">
|
<div class="button-holder">
|
||||||
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="hostChosen">Connect</button>
|
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="hostChosen">Connect</button>
|
||||||
|
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--accent" id="forgetHost">Forget</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ function attachListeners() {
|
|||||||
$('#bitrateSlider').on('input', updateBitrateField); // input occurs every notch you slide
|
$('#bitrateSlider').on('input', updateBitrateField); // input occurs every notch you slide
|
||||||
$('#bitrateSlider').on('change', saveBitrate); // change occurs once the mouse lets go.
|
$('#bitrateSlider').on('change', saveBitrate); // change occurs once the mouse lets go.
|
||||||
$('#hostChosen').on('click', hostChosen);
|
$('#hostChosen').on('click', hostChosen);
|
||||||
|
$('#forgetHost').on('click', forgetHost);
|
||||||
$('#cancelPairingDialog').on('click', pairingPopupCanceled);
|
$('#cancelPairingDialog').on('click', pairingPopupCanceled);
|
||||||
$('#selectGame').on('change', gameSelectUpdated);
|
$('#selectGame').on('change', gameSelectUpdated);
|
||||||
$('#startGameButton').on('click', startSelectedGame);
|
$('#startGameButton').on('click', startSelectedGame);
|
||||||
@ -142,9 +143,27 @@ function hostChosen() {
|
|||||||
if(!api.paired) {
|
if(!api.paired) {
|
||||||
pairTo(target);
|
pairTo(target);
|
||||||
}
|
}
|
||||||
|
if(hosts.indexOf(target) < 0) { // we don't have this host in our list. add it, and save it.
|
||||||
|
var opt = document.createElement('option');
|
||||||
|
opt.appendChild(document.createTextNode(target));
|
||||||
|
opt.value = target;
|
||||||
|
$('#selectHost')[0].appendChild(opt);
|
||||||
|
hosts.push(target);
|
||||||
|
saveHosts();
|
||||||
|
$('#GFEHostIPField').val(''); // eat the contents of the textbox
|
||||||
|
}
|
||||||
showApps();
|
showApps();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// locally remove the hostname/ip from the saved `hosts` array.
|
||||||
|
// note: this does not make the host forget the pairing to us.
|
||||||
|
// this means we can re-add the host, and will still be paired.
|
||||||
|
function forgetHost() {
|
||||||
|
updateTarget();
|
||||||
|
$("#selectHost option:selected").remove();
|
||||||
|
hosts.splice(hosts.indexOf(target), 1); // remove the host from the array;
|
||||||
|
saveHosts();
|
||||||
}
|
}
|
||||||
|
|
||||||
function pairingPopupCanceled() {
|
function pairingPopupCanceled() {
|
||||||
@ -419,6 +438,7 @@ function onWindowLoad(){
|
|||||||
var ip = Object.keys(finder.byService_['_nvstream._tcp'])[0];
|
var ip = Object.keys(finder.byService_['_nvstream._tcp'])[0];
|
||||||
if (finder.byService_['_nvstream._tcp'][ip]) {
|
if (finder.byService_['_nvstream._tcp'][ip]) {
|
||||||
$('#GFEHostIPField').val(ip);
|
$('#GFEHostIPField').val(ip);
|
||||||
|
$('#GFEHostIPField').parent().addClass('is-dirty'); // mark it as dirty to float the textfield label
|
||||||
updateTarget();
|
updateTarget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user