summaryrefslogtreecommitdiffstats
path: root/devtools/client/webide/content/wifi-auth.js
diff options
context:
space:
mode:
authorJeroen Vreeken <jeroen@vreeken.net>2019-07-18 11:02:12 +0200
committerJeroen Vreeken <jeroen@vreeken.net>2019-07-18 11:02:12 +0200
commitf820636a8300b44751750354a01be21895b4b536 (patch)
treeab217ad50a145a8c7a1094fbafd5d3d30260e7cd /devtools/client/webide/content/wifi-auth.js
parent6b6aa59ffc97ac76b4429db38eedac8474f5fda7 (diff)
parent45cb5ab7291f44d3e06de4e71e5b0a9e80f6a0b6 (diff)
downloadUXP-f820636a8300b44751750354a01be21895b4b536.tar
UXP-f820636a8300b44751750354a01be21895b4b536.tar.gz
UXP-f820636a8300b44751750354a01be21895b4b536.tar.lz
UXP-f820636a8300b44751750354a01be21895b4b536.tar.xz
UXP-f820636a8300b44751750354a01be21895b4b536.zip
Merge branch 'master' of github.com:JeroenVreeken/UXP
Diffstat (limited to 'devtools/client/webide/content/wifi-auth.js')
-rw-r--r--devtools/client/webide/content/wifi-auth.js44
1 files changed, 0 insertions, 44 deletions
diff --git a/devtools/client/webide/content/wifi-auth.js b/devtools/client/webide/content/wifi-auth.js
deleted file mode 100644
index 5ae5d824c..000000000
--- a/devtools/client/webide/content/wifi-auth.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-var Cu = Components.utils;
-const { require } =
- Cu.import("resource://devtools/shared/Loader.jsm", {});
-const Services = require("Services");
-const QR = require("devtools/shared/qrcode/index");
-
-window.addEventListener("load", function onLoad() {
- window.removeEventListener("load", onLoad);
- document.getElementById("close").onclick = () => window.close();
- document.getElementById("no-scanner").onclick = showToken;
- document.getElementById("yes-scanner").onclick = hideToken;
- buildUI();
-});
-
-function buildUI() {
- let { oob } = window.arguments[0];
- createQR(oob);
- createToken(oob);
-}
-
-function createQR(oob) {
- let oobData = JSON.stringify(oob);
- let imgData = QR.encodeToDataURI(oobData, "L" /* low quality */);
- document.querySelector("#qr-code img").src = imgData.src;
-}
-
-function createToken(oob) {
- let token = oob.sha256.replace(/:/g, "").toLowerCase() + oob.k;
- document.querySelector("#token pre").textContent = token;
-}
-
-function showToken() {
- document.querySelector("body").setAttribute("token", "true");
-}
-
-function hideToken() {
- document.querySelector("body").removeAttribute("token");
-}