diff --git a/index.html b/index.html index 4952aa2..24424b4 100644 --- a/index.html +++ b/index.html @@ -86,5 +86,18 @@ + + +

Pairing

+
+

+ Please enter the number XXXX on the GFE dialog on the computer. This dialog will be dismissed once complete +

+
+
+ +
+
+ diff --git a/static/css/style.css b/static/css/style.css index fbc8a4b..bd0901a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -4,6 +4,21 @@ .mdl-button { color: #fff !important; } +.mdl-dialog { + border: none; + box-shadow: 0 9px 46px 8px rgba(0, 0, 0, 0.14), 0 11px 15px -7px rgba(0, 0, 0, 0.12), 0 24px 38px 3px rgba(0, 0, 0, 0.2); + width: 280px; +} +.mdl-dialog__title { + padding: 24px 24px 0; + margin: 0; + font-size: 2.5rem; +} +.mdl-dialog__content { + padding: 20px 24px 24px 24px; + color: rgba(0,0,0, 0.54); +} + main { padding: 50px 100px; } diff --git a/static/js/index.js b/static/js/index.js index 45d7d34..fef0a87 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -13,6 +13,7 @@ function attachListeners() { $('#selectFramerate').on('change', saveFramerate); $('#bitrateSlider').on('input', updateBitrateField); // input occurs every notch you slide $('#bitrateSlider').on('change', saveBitrate); // change occurs once the mouse lets go. + $(window).resize(fullscreenNaclModule); } @@ -54,6 +55,7 @@ function pairPushed() { console.log("User wants to pair, and we still have no cert. Problem = very yes.") return; } + $('#pairButton')[0].innerHTML = 'Pairing...'; target = $('#GFEHostIPField')[0].value; if (target == null || target == "") { var e = $("#selectHost")[0]; @@ -62,8 +64,21 @@ function pairPushed() { console.log("Attempting to pair to: " + target); sendMessage('httpInit', [pairingCert.cert, pairingCert.privateKey, myUniqueid]).then(function (ret) { console.log('httpInit function completed. it returned: ' + ret); + var pairingDialog = document.querySelector('#pairingDialog'); + document.getElementById('pairingDialogText').innerHTML = + 'Please enter the number 1233 on the GFE dialog on the computer. This dialog will be dismissed once complete'; + pairingDialog.showModal(); + pairingDialog.querySelector('#CancelPairingDialog').addEventListener('click', function() { + pairingDialog.close(); + }); sendMessage('pair', [target, "1233"]).then(function (ret2) { - console.log("pair attempt to to " + target + " has returned."); + if (ret2 === 0) { + $('#pairButton')[0].innerHTML = 'Paired'; + pairingDialog.close(); + } else { + $('#pairButton')[0].innerHTML = 'Pairing Failed'; + document.getElementById('pairingDialogText').innerHTML = 'Error: Pairing failed with code: ' + ret2; + } console.log("pairing attempt returned: " + ret2); }) }); diff --git a/static/js/utils.js b/static/js/utils.js index 9dedc20..6862be6 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -88,7 +88,9 @@ NvHTTP.prototype = { }, getAppList: function () { + console.log('Requested app list'); return sendMessage('openUrl', [_self._baseUrlHttps+'/applist?'+_self._buildUidStr()]).then(function (ret) { + console.log('App list request returned with: ' + ret); $xml = _self._parseXML(ret); var rootElement = $xml.find("root")[0]; @@ -103,6 +105,7 @@ NvHTTP.prototype = { }); } + console.log('Returning app list: ' + appList); return appList; }); },