pixflow-upgrade-planning 0.0.5 → 0.0.7
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 +11 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -14,6 +14,7 @@ class PixflowUpgradePlanning extends HTMLElement {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
async connectedCallback(){
|
|
17
|
+
self = this;
|
|
17
18
|
this.cep_manifest = new PixflowCEPManifest();
|
|
18
19
|
const style = document.createElement("style");
|
|
19
20
|
style.textContent = fs.readFileSync(path.join(__dirname, "styles", `${this.port}.css`));
|
|
@@ -30,10 +31,16 @@ class PixflowUpgradePlanning extends HTMLElement {
|
|
|
30
31
|
this.querySelector("div.activate-code").addEventListener("click", this.activate_code_click);
|
|
31
32
|
this.querySelector("div.pixflow > div.activate-code-block > button").addEventListener("click", this.activate_code_block_click);
|
|
32
33
|
this.querySelector("div.purchase-code > div > button").addEventListener("click", this.purchase_code_click);
|
|
34
|
+
this.querySelectorAll("div.plan > div > div").forEach(function(element){
|
|
35
|
+
element.addEventListener("click", function(){
|
|
36
|
+
element.parentNode.parentNode.querySelector("div.plan > div > div.active").classList.remove("active");
|
|
37
|
+
this.classList.add("active");
|
|
38
|
+
})
|
|
39
|
+
})
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
this.querySelectorAll(`img.close`).forEach(function(element){
|
|
36
|
-
element.addEventListener("click",
|
|
43
|
+
element.addEventListener("click", element.parentNode.parentNode.close_click)
|
|
37
44
|
});
|
|
38
45
|
|
|
39
46
|
}
|
|
@@ -49,7 +56,8 @@ class PixflowUpgradePlanning extends HTMLElement {
|
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
activate_code_block_click(e){
|
|
52
|
-
const
|
|
59
|
+
const cep_manifest = new PixflowCEPManifest();
|
|
60
|
+
const item_name = cep_manifest.get_item_name();
|
|
53
61
|
const license = this.parentNode.parentNode.querySelector("div.plan > div > div.active").parentNode.className.split(" ")[0];
|
|
54
62
|
var link = `https://pixflow.net/product/px-${item_name}/?active-license=free`;
|
|
55
63
|
if(license != "free")
|
|
@@ -58,6 +66,7 @@ class PixflowUpgradePlanning extends HTMLElement {
|
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
activate_code_click(e){
|
|
69
|
+
e.target.parentNode.parentNode.classList.remove("active");
|
|
61
70
|
e.target.parentNode.parentNode.parentNode.querySelector("div.purchase-code").classList.add("active");
|
|
62
71
|
}
|
|
63
72
|
|