Permalink
Browse files

Remove unpair functionality because it doesn't work on modern GFE ver…

…sions
  • Loading branch information...
1 parent 6e9de37 commit da960c0be1089b2e34cf883115778101c880ebcb @cgutman cgutman committed Oct 30, 2016
Showing with 23 additions and 33 deletions.
  1. +6 −6 index.html
  2. +17 −23 static/js/index.js
  3. +0 −4 static/js/utils.js
View
@@ -104,16 +104,16 @@ <h3 class="mdl-dialog__title">Quit Running App?</h3>
</div>
</dialog>
- <dialog id="unpairHostDialog" class="mdl-dialog">
- <h3 class="mdl-dialog__title">Unpair from this host?</h3>
+ <dialog id="deleteHostDialog" class="mdl-dialog">
+ <h3 class="mdl-dialog__title">Delete PC</h3>
<div class="mdl-dialog__content">
- <p id="unpairHostDialogText">
- Are you sure you want to unpair from this host?
+ <p id="deleteHostDialogText">
+ Are you sure you want to delete this host?
</p>
</div>
<div class="mdl-dialog__actions">
- <button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="cancelUnpairHost">No</button>
- <button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="continueUnpairHost">Yes</button>
+ <button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="cancelDeleteHost">No</button>
+ <button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" id="continueDeleteHost">Yes</button>
</div>
</dialog>
View
@@ -297,49 +297,43 @@ function addHostToGrid(host, ismDNSDiscovered=false) {
var removalButton = $("<div>", {class: "remove-host", id: "removeHostButton-" + host.serverUid});
removalButton.off('click');
removalButton.click(function () {
- unpairClicked(host);
+ removeClicked(host);
});
cell.off('click');
cell.click(function () {
hostChosen(host);
});
$(outerDiv).append(cell);
if (!ismDNSDiscovered) {
- // we don't have the option to unpair from mDNS hosts. So don't show it to the user.
+ // we don't have the option to delete mDNS hosts. So don't show it to the user.
$(outerDiv).append(removalButton);
}
$('#host-grid').append(outerDiv);
hosts[host.serverUid] = host;
}
-function unpairClicked(host) {
- var unpairHostDialog = document.querySelector('#unpairHostDialog');
- document.getElementById('unpairHostDialogText').innerHTML =
- ' Are you sure you want like to unpair from ' + host.hostname + '?';
- unpairHostDialog.showModal();
+function removeClicked(host) {
+ var deleteHostDialog = document.querySelector('#deleteHostDialog');
+ document.getElementById('deleteHostDialogText').innerHTML =
+ ' Are you sure you want like to delete ' + host.hostname + '?';
+ deleteHostDialog.showModal();
- $('#cancelUnpairHost').off('click');
- $('#cancelUnpairHost').on('click', function () {
- unpairHostDialog.close();
+ $('#cancelDeleteHost').off('click');
+ $('#cancelDeleteHost').on('click', function () {
+ deleteHostDialog.close();
});
// 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.
- $('#continueUnpairHost').off('click');
- $('#continueUnpairHost').on('click', function () {
- host.unpair().then(function (onSuccess) {
- var unpairHostDialog = document.querySelector('#unpairHostDialog');
- $('#host-container-' + host.serverUid).remove();
- snackbarLog('Successfully unpaired from host');
- delete hosts[host.serverUid]; // remove the host from the array;
- saveHosts();
- }, function (onFailure) {
- snackbarLog('Failed to unpair from host!');
- });
- unpairHostDialog.close();
+ $('#continueDeleteHost').off('click');
+ $('#continueDeleteHost').on('click', function () {
+ var deleteHostDialog = document.querySelector('#deleteHostDialog');
+ $('#host-container-' + host.serverUid).remove();
+ delete hosts[host.serverUid]; // remove the host from the array;
+ saveHosts();
+ deleteHostDialog.close();
});
-
}
// puts the CSS style for current app on the app that's currently running
View
@@ -465,10 +465,6 @@ NvHTTP.prototype = {
}.bind(this));
},
- unpair: function () {
- return sendMessage('openUrl', [this._baseUrlHttps + '/unpair?' + this._buildUidStr(), false]);
- },
-
_buildUidStr: function () {
return 'uniqueid=' + this.clientUid + '&uuid=' + guuid();
},

0 comments on commit da960c0

Please sign in to comment.