pixflow-upgrade-planning 1.2.3 → 1.2.5

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 CHANGED
@@ -57,10 +57,6 @@ class PixflowUpgradePlanning extends HTMLElement {
57
57
  }
58
58
  })
59
59
  }
60
-
61
- if(cep_manifest.get_extension_id() != "net.pixflow.voiceai" && localStorage.getItem("unlock") == "0"){
62
- this.querySelector("div.activate-code").classList.add("active");
63
- }
64
60
 
65
61
  }
66
62
 
@@ -82,9 +78,12 @@ class PixflowUpgradePlanning extends HTMLElement {
82
78
  }
83
79
 
84
80
  get_product_price_detail(){
81
+ const self = this;
85
82
  if(cep_manifest.get_extension_id() == "net.pixflow.voiceai")
86
83
  return;
87
- const self = this;
84
+ self.querySelector("div.pixflow div.activate-code-block button").addEventListener("click", function(){
85
+ window.cep.util.openURLInDefaultBrowser(JSON.parse(localStorage.getItem("init-data")).userData.upgrade_subscription_url);
86
+ })
88
87
  const xhr = new XMLHttpRequest();
89
88
  xhr.open("GET", `https://pixflow.net/wp-json/pixflow/get_product_price_detail?product-id=${cep_manifest.get_post_id()}&token=${token()}`);
90
89
  xhr.addEventListener("load", function(){
@@ -110,9 +109,6 @@ class PixflowUpgradePlanning extends HTMLElement {
110
109
  el_plan.setAttribute("data-url", url);
111
110
  el_plan.querySelector("div > p").textContent = plan;
112
111
  }
113
- self.querySelector("div.pixflow div.activate-code-block button").addEventListener("click", function(){
114
- window.cep.util.openURLInDefaultBrowser(`https://pixflow.net/product/${cep_manifest.get_link()}/`);
115
- })
116
112
  self.querySelectorAll("div.plan > div > div").forEach(function(element){
117
113
  element.addEventListener("click", function(){
118
114
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixflow-upgrade-planning",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/template.html CHANGED
@@ -8,7 +8,6 @@
8
8
  </div>
9
9
  <div class="activate-code-block">
10
10
  <button class="btn">Go premium <img src="./node_modules/pixflow-upgrade-planning/images/pixflow/outside-link.svg"></button>
11
- <div class="activate-code">Do you have the purchase code?</div>
12
11
  </div>
13
12
  </div>
14
13