From faf0f545a8f1e685cc218f465ad7746387e0d289 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 12 Dec 2022 10:21:02 +0100 Subject: [PATCH 1/3] refs #4869 --- js/index.js | 7 +++++++ js/main.js | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/js/index.js b/js/index.js index 9e25ccd..64ecef2 100644 --- a/js/index.js +++ b/js/index.js @@ -7,6 +7,12 @@ $(document).ready(function () { }); function setEvents() { + const heartEl = document.querySelector('body > h1 > span') + heartEl.addEventListener('click', function() { + const key = prompt('Introduce la clave'); + localStorage.setItem('vnKey', key); + }); + $(".btnnum").on("click", function () { pin += parseInt($(this).children().html()); $("#txtPin").text(pin); @@ -26,6 +32,7 @@ function setEvents() { }, 200); $(".loading").fadeOut(200); }); + } function login() { diff --git a/js/main.js b/js/main.js index d7273da..b605579 100644 --- a/js/main.js +++ b/js/main.js @@ -19,6 +19,11 @@ function printError(msg){ $.ajaxPrefilter(function(xhr) { var orgErrorHandler = xhr.error; + var key = localStorage.getItem('vnKey'); + if(key){ + xhr.jsonData.push(key) + } + Object.assign(xhr, { url: `${urlBase}/workerTimeControl/${xhr.urlPath}`, headers: { From 54f4c104f1aa069c62a8765ce6d992ab46c20a31 Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 27 Jan 2023 08:45:56 +0100 Subject: [PATCH 2/3] refs #4869 arreglar formato --- js/index.js | 3 +-- js/main.js | 2 +- package-lock.json | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/js/index.js b/js/index.js index 64ecef2..654a801 100644 --- a/js/index.js +++ b/js/index.js @@ -7,7 +7,7 @@ $(document).ready(function () { }); function setEvents() { - const heartEl = document.querySelector('body > h1 > span') + const heartEl = document.querySelector('body > h1 > span'); heartEl.addEventListener('click', function() { const key = prompt('Introduce la clave'); localStorage.setItem('vnKey', key); @@ -32,7 +32,6 @@ function setEvents() { }, 200); $(".loading").fadeOut(200); }); - } function login() { diff --git a/js/main.js b/js/main.js index b605579..33d9a8f 100644 --- a/js/main.js +++ b/js/main.js @@ -20,7 +20,7 @@ $.ajaxPrefilter(function(xhr) { var orgErrorHandler = xhr.error; var key = localStorage.getItem('vnKey'); - if(key){ + if (key) { xhr.jsonData.push(key) } diff --git a/package-lock.json b/package-lock.json index 6465606..8e14c92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "es.verdnatura.worker-time-control", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { From f511abd906b4fdd978996c1e568b079c5fe33288 Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 27 Jan 2023 08:47:42 +0100 Subject: [PATCH 3/3] refs #4869 --- js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/index.js b/js/index.js index 654a801..c4c5d3e 100644 --- a/js/index.js +++ b/js/index.js @@ -7,7 +7,7 @@ $(document).ready(function () { }); function setEvents() { - const heartEl = document.querySelector('body > h1 > span'); + const heartEl = document.querySelector('body > h1 > span'); heartEl.addEventListener('click', function() { const key = prompt('Introduce la clave'); localStorage.setItem('vnKey', key);