pixflow-upgrade-planning 0.0.36 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5,6 +5,7 @@ const CepManifest = require("pixflow-cep-manifest");
|
|
|
5
5
|
const cep_manifest = new CepManifest();
|
|
6
6
|
const token = require("pixflow-token");
|
|
7
7
|
const PixflowPurchaseCodeActivate = require("pixflow-purchase-code-activate");
|
|
8
|
+
const purchase_code = new PixflowPurchaseCodeActivate();
|
|
8
9
|
|
|
9
10
|
class PixflowUpgradePlanning extends HTMLElement {
|
|
10
11
|
|
|
@@ -13,7 +14,7 @@ class PixflowUpgradePlanning extends HTMLElement {
|
|
|
13
14
|
this.port = localStorage.getItem("port");
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
connectedCallback(){
|
|
17
|
+
async connectedCallback(){
|
|
17
18
|
const self = this;
|
|
18
19
|
const style = document.createElement("style");
|
|
19
20
|
style.textContent = fs.readFileSync(path.join(__dirname, "styles", `${this.port}.css`));
|
|
@@ -22,6 +23,8 @@ class PixflowUpgradePlanning extends HTMLElement {
|
|
|
22
23
|
this.template = parse.parseFromString(fs.readFileSync(path.join(__dirname, "template.html")).toString("utf8"), "text/html");
|
|
23
24
|
this.appendChild(this.template.querySelector(`div.${this.port}`));
|
|
24
25
|
|
|
26
|
+
await purchase_code.check_device_select();
|
|
27
|
+
|
|
25
28
|
this.querySelector(`img.close`).addEventListener("click", this.close_click);
|
|
26
29
|
|
|
27
30
|
if(this.port == "pixflow"){
|
|
@@ -51,10 +54,9 @@ class PixflowUpgradePlanning extends HTMLElement {
|
|
|
51
54
|
|
|
52
55
|
this.querySelector("div.purchase-code > form > button").addEventListener("click", async function(e){
|
|
53
56
|
e.preventDefault();
|
|
54
|
-
|
|
57
|
+
purchase_code.set_code(self.querySelector("div.purchase-code > form > input[type=text]").value);
|
|
55
58
|
const message = self.querySelector("div.purchase-code > form > p.message");
|
|
56
59
|
const msg = self.querySelectorAll("div.purchase-code > form > ul.msg > *");
|
|
57
|
-
const purchase_code = new PixflowPurchaseCodeActivate(code);
|
|
58
60
|
const res = await purchase_code.activate_code();
|
|
59
61
|
if(!res.error){
|
|
60
62
|
message.innerHTML = msg[0].innerHTML;
|