pixflow-auth-motionfactory-theme
Advanced tools
Comparing version 1.1.1 to 1.1.2
41
index.js
@@ -5,4 +5,2 @@ const PixflowControllerAuth = require("pixflow-controller-auth"); | ||
const path = require("path"); | ||
const token = require("pixflow-token"); | ||
const md5 = require("md5"); | ||
const CepManifest = require("pixflow-cep-manifest"); | ||
@@ -18,2 +16,3 @@ const cep_manifest = new CepManifest(); | ||
this.import_file(); | ||
this.querySelector("div.container > h2").innerHTML = cep_manifest.get_extension_name(); | ||
} | ||
@@ -30,7 +29,4 @@ | ||
document.querySelector("title").innerHTML = cep_manifest.get_extension_id(); | ||
this.querySelector("div.container > h2").innerHTML = cep_manifest.get_extension_name(); | ||
this.querySelectorAll("div > div:nth-child(2) > button:not(button.signup)").forEach(function(element){ | ||
this.querySelectorAll(".login, .signup").forEach(function(element){ | ||
element.addEventListener("click", self.register_click); | ||
@@ -42,35 +38,2 @@ }) | ||
}) | ||
this.querySelector("div > div:nth-child(2) > button.signup").addEventListener("click", function(){ | ||
this.parentNode.classList.remove("active"); | ||
this.parentNode.parentNode.querySelector("div:nth-child(3)").classList.add("active"); | ||
}) | ||
this.querySelector("div > div:nth-child(3) button.back").addEventListener("click", function(){ | ||
this.parentNode.parentNode.classList.remove("active"); | ||
this.parentNode.parentNode.parentNode.querySelector("div:nth-child(2)").classList.add("active"); | ||
}) | ||
this.querySelector("div > div:nth-child(3) > div:nth-child(3) > button.login").addEventListener("click", function(){ | ||
const xhr = new XMLHttpRequest(); | ||
const email = self.querySelector("input.email").value; | ||
const password = self.querySelector("input[type='password']").value; | ||
const query = new URLSearchParams({ | ||
token: token(), | ||
user_email: email, | ||
user_password: password | ||
}).toString(); | ||
xhr.open("post", `https://pixflow.net/wp-json/pixflow/check-user-password-auth?${query}`); | ||
xhr.addEventListener("load", function(){ | ||
const res = JSON.parse(this.responseText); | ||
if(res.message == true) { | ||
localStorage.setItem("email", email); | ||
localStorage.setItem("md5", md5(email)); | ||
window.location.href = "../../index.html"; | ||
} else { | ||
self.message_box("error-form"); | ||
} | ||
}) | ||
xhr.send(); | ||
}) | ||
} | ||
@@ -77,0 +40,0 @@ } |
{ | ||
"name": "pixflow-auth-motionfactory-theme", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "", | ||
@@ -14,6 +14,4 @@ "main": "index.js", | ||
"pixflow-controller-auth": "^1.0.2", | ||
"pixflow-token": "^1.0.0", | ||
"md5": "^2.3.0", | ||
"pixflow-cep-manifest": "^1.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2
13
750890
229
- Removedmd5@^2.3.0
- Removedpixflow-token@^1.0.0
- Removedcharenc@0.0.2(transitive)
- Removedcrypt@0.0.2(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedmd5@2.3.0(transitive)
- Removedpixflow-token@1.0.0(transitive)