From 81e9256b8cdb1e9d882dc688163cc090a4dc912f Mon Sep 17 00:00:00 2001 From: HianPraxedes Date: Mon, 25 Apr 2022 17:44:30 -0300 Subject: [PATCH] [ADD] (Issue: #228) : Comparando materias cursadas --- package-lock.json | 248 ++++++++++++++++++++++++++--------- package.json | 2 +- src/components/telaRF2.vue | 118 ++++------------- src/cursoDoUsuario.js | 29 ++++ src/details/Contentscript.js | 17 +++ src/materiasCursadas.js | 118 ++++++++++++++++- 6 files changed, 377 insertions(+), 155 deletions(-) create mode 100644 src/cursoDoUsuario.js diff --git a/package-lock.json b/package-lock.json index d229842..a4405d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2008,6 +2008,27 @@ "whatwg-fetch": "^3.6.2" }, "dependencies": { + "@vue/vue-loader-v15": { + "version": "npm:vue-loader@15.9.8", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.8.tgz", + "integrity": "sha512-GwSkxPrihfLR69/dSV3+5CdMQ0D+jXg8Ma1S4nQXKJAznYFX14vHdc/NetQc34Dw+rBbIJyP7JOuVb9Fhprvog==", + "dev": true, + "requires": { + "@vue/component-compiler-utils": "^3.1.0", + "hash-sum": "^1.0.2", + "loader-utils": "^1.1.0", + "vue-hot-reload-api": "^2.3.0", + "vue-style-loader": "^4.1.0" + }, + "dependencies": { + "hash-sum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz", + "integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=", + "dev": true + } + } + }, "ajv": { "version": "8.11.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", @@ -2092,6 +2113,26 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, "mini-css-extract-plugin": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.6.0.tgz", @@ -2340,11 +2381,18 @@ } }, "@vue/reactivity": { - "version": "3.2.31", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.31.tgz", - "integrity": "sha512-HVr0l211gbhpEKYr2hYe7hRsV91uIVGFYNHj73njbARVGHQvIojkImKMaZNDdoDZOIkMsBc9a1sMqR+WZwfSCw==", + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.33.tgz", + "integrity": "sha512-62Sq0mp9/0bLmDuxuLD5CIaMG2susFAGARLuZ/5jkU1FCf9EDbwUuF+BO8Ub3Rbodx0ziIecM/NsmyjardBxfQ==", "requires": { - "@vue/shared": "3.2.31" + "@vue/shared": "3.2.33" + }, + "dependencies": { + "@vue/shared": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.33.tgz", + "integrity": "sha512-UBc1Pg1T3yZ97vsA2ueER0F6GbJebLHYlEi4ou1H5YL4KWvMOOWwpYo9/QpWq93wxKG6Wo13IY74Hcn/f7c7Bg==" + } } }, "@vue/reactivity-transform": { @@ -2360,73 +2408,88 @@ } }, "@vue/runtime-core": { - "version": "3.2.31", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.31.tgz", - "integrity": "sha512-Kcog5XmSY7VHFEMuk4+Gap8gUssYMZ2+w+cmGI6OpZWYOEIcbE0TPzzPHi+8XTzAgx1w/ZxDFcXhZeXN5eKWsA==", + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.33.tgz", + "integrity": "sha512-N2D2vfaXsBPhzCV3JsXQa2NECjxP3eXgZlFqKh4tgakp3iX6LCGv76DLlc+IfFZq+TW10Y8QUfeihXOupJ1dGw==", "requires": { - "@vue/reactivity": "3.2.31", - "@vue/shared": "3.2.31" + "@vue/reactivity": "3.2.33", + "@vue/shared": "3.2.33" + }, + "dependencies": { + "@vue/shared": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.33.tgz", + "integrity": "sha512-UBc1Pg1T3yZ97vsA2ueER0F6GbJebLHYlEi4ou1H5YL4KWvMOOWwpYo9/QpWq93wxKG6Wo13IY74Hcn/f7c7Bg==" + } } }, "@vue/runtime-dom": { - "version": "3.2.31", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.31.tgz", - "integrity": "sha512-N+o0sICVLScUjfLG7u9u5XCjvmsexAiPt17GNnaWHJUfsKed5e85/A3SWgKxzlxx2SW/Hw7RQxzxbXez9PtY3g==", + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.33.tgz", + "integrity": "sha512-LSrJ6W7CZTSUygX5s8aFkraDWlO6K4geOwA3quFF2O+hC3QuAMZt/0Xb7JKE3C4JD4pFwCSO7oCrZmZ0BIJUnw==", "requires": { - "@vue/runtime-core": "3.2.31", - "@vue/shared": "3.2.31", + "@vue/runtime-core": "3.2.33", + "@vue/shared": "3.2.33", "csstype": "^2.6.8" + }, + "dependencies": { + "@vue/shared": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.33.tgz", + "integrity": "sha512-UBc1Pg1T3yZ97vsA2ueER0F6GbJebLHYlEi4ou1H5YL4KWvMOOWwpYo9/QpWq93wxKG6Wo13IY74Hcn/f7c7Bg==" + } } }, "@vue/server-renderer": { - "version": "3.2.31", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.31.tgz", - "integrity": "sha512-8CN3Zj2HyR2LQQBHZ61HexF5NReqngLT3oahyiVRfSSvak+oAvVmu8iNLSu6XR77Ili2AOpnAt1y8ywjjqtmkg==", - "requires": { - "@vue/compiler-ssr": "3.2.31", - "@vue/shared": "3.2.31" - } - }, - "@vue/shared": { - "version": "3.2.31", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz", - "integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ==" - }, - "@vue/vue-loader-v15": { - "version": "npm:vue-loader@15.9.8", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.8.tgz", - "integrity": "sha512-GwSkxPrihfLR69/dSV3+5CdMQ0D+jXg8Ma1S4nQXKJAznYFX14vHdc/NetQc34Dw+rBbIJyP7JOuVb9Fhprvog==", - "dev": true, + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.33.tgz", + "integrity": "sha512-4jpJHRD4ORv8PlbYi+/MfP8ec1okz6rybe36MdpkDrGIdEItHEUyaHSKvz+ptNEyQpALmmVfRteHkU9F8vxOew==", "requires": { - "@vue/component-compiler-utils": "^3.1.0", - "hash-sum": "^1.0.2", - "loader-utils": "^1.1.0", - "vue-hot-reload-api": "^2.3.0", - "vue-style-loader": "^4.1.0" + "@vue/compiler-ssr": "3.2.33", + "@vue/shared": "3.2.33" }, "dependencies": { - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, + "@vue/compiler-core": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.33.tgz", + "integrity": "sha512-AAmr52ji3Zhk7IKIuigX2osWWsb2nQE5xsdFYjdnmtQ4gymmqXbjLvkSE174+fF3A3kstYrTgGkqgOEbsdLDpw==", "requires": { - "minimist": "^1.2.0" + "@babel/parser": "^7.16.4", + "@vue/shared": "3.2.33", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" } }, - "loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", - "dev": true, + "@vue/compiler-dom": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.33.tgz", + "integrity": "sha512-GhiG1C8X98Xz9QUX/RlA6/kgPBWJkjq0Rq6//5XTAGSYrTMBgcLpP9+CnlUg1TFxnnCVughAG+KZl28XJqw8uQ==", "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" + "@vue/compiler-core": "3.2.33", + "@vue/shared": "3.2.33" } + }, + "@vue/compiler-ssr": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.33.tgz", + "integrity": "sha512-XQh1Xdk3VquDpXsnoCd7JnMoWec9CfAzQDQsaMcSU79OrrO2PNR0ErlIjm/mGq3GmBfkQjzZACV+7GhfRB8xMQ==", + "requires": { + "@vue/compiler-dom": "3.2.33", + "@vue/shared": "3.2.33" + } + }, + "@vue/shared": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.33.tgz", + "integrity": "sha512-UBc1Pg1T3yZ97vsA2ueER0F6GbJebLHYlEi4ou1H5YL4KWvMOOWwpYo9/QpWq93wxKG6Wo13IY74Hcn/f7c7Bg==" } } }, + "@vue/shared": { + "version": "3.2.31", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.31.tgz", + "integrity": "sha512-ymN2pj6zEjiKJZbrf98UM2pfDd6F2H7ksKw7NDt/ZZ1fh5Ei39X5tABugtT03ZRlWd9imccoK0hE8hpjpU7irQ==" + }, "@vue/web-component-wrapper": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz", @@ -8427,15 +8490,80 @@ "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==" }, "vue": { - "version": "3.2.31", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.31.tgz", - "integrity": "sha512-odT3W2tcffTiQCy57nOT93INw1auq5lYLLYtWpPYQQYQOOdHiqFct9Xhna6GJ+pJQaF67yZABraH47oywkJgFw==", - "requires": { - "@vue/compiler-dom": "3.2.31", - "@vue/compiler-sfc": "3.2.31", - "@vue/runtime-dom": "3.2.31", - "@vue/server-renderer": "3.2.31", - "@vue/shared": "3.2.31" + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.33.tgz", + "integrity": "sha512-si1ExAlDUrLSIg/V7D/GgA4twJwfsfgG+t9w10z38HhL/HA07132pUQ2KuwAo8qbCyMJ9e6OqrmWrOCr+jW7ZQ==", + "requires": { + "@vue/compiler-dom": "3.2.33", + "@vue/compiler-sfc": "3.2.33", + "@vue/runtime-dom": "3.2.33", + "@vue/server-renderer": "3.2.33", + "@vue/shared": "3.2.33" + }, + "dependencies": { + "@vue/compiler-core": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.33.tgz", + "integrity": "sha512-AAmr52ji3Zhk7IKIuigX2osWWsb2nQE5xsdFYjdnmtQ4gymmqXbjLvkSE174+fF3A3kstYrTgGkqgOEbsdLDpw==", + "requires": { + "@babel/parser": "^7.16.4", + "@vue/shared": "3.2.33", + "estree-walker": "^2.0.2", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-dom": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.33.tgz", + "integrity": "sha512-GhiG1C8X98Xz9QUX/RlA6/kgPBWJkjq0Rq6//5XTAGSYrTMBgcLpP9+CnlUg1TFxnnCVughAG+KZl28XJqw8uQ==", + "requires": { + "@vue/compiler-core": "3.2.33", + "@vue/shared": "3.2.33" + } + }, + "@vue/compiler-sfc": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.33.tgz", + "integrity": "sha512-H8D0WqagCr295pQjUYyO8P3IejM3vEzeCO1apzByAEaAR/WimhMYczHfZVvlCE/9yBaEu/eu9RdiWr0kF8b71Q==", + "requires": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.33", + "@vue/compiler-dom": "3.2.33", + "@vue/compiler-ssr": "3.2.33", + "@vue/reactivity-transform": "3.2.33", + "@vue/shared": "3.2.33", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7", + "postcss": "^8.1.10", + "source-map": "^0.6.1" + } + }, + "@vue/compiler-ssr": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.33.tgz", + "integrity": "sha512-XQh1Xdk3VquDpXsnoCd7JnMoWec9CfAzQDQsaMcSU79OrrO2PNR0ErlIjm/mGq3GmBfkQjzZACV+7GhfRB8xMQ==", + "requires": { + "@vue/compiler-dom": "3.2.33", + "@vue/shared": "3.2.33" + } + }, + "@vue/reactivity-transform": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.33.tgz", + "integrity": "sha512-4UL5KOIvSQb254aqenW4q34qMXbfZcmEsV/yVidLUgvwYQQ/D21bGX3DlgPUGI3c4C+iOnNmDCkIxkILoX/Pyw==", + "requires": { + "@babel/parser": "^7.16.4", + "@vue/compiler-core": "3.2.33", + "@vue/shared": "3.2.33", + "estree-walker": "^2.0.2", + "magic-string": "^0.25.7" + } + }, + "@vue/shared": { + "version": "3.2.33", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.33.tgz", + "integrity": "sha512-UBc1Pg1T3yZ97vsA2ueER0F6GbJebLHYlEi4ou1H5YL4KWvMOOWwpYo9/QpWq93wxKG6Wo13IY74Hcn/f7c7Bg==" + } } }, "vue-eslint-parser": { diff --git a/package.json b/package.json index 9a4d537..74fa977 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "laravel-mix": "^6.0.43", "puppeteer": "^13.4.1", "puppeteer-cluster": "^0.23.0", - "vue": "^3.2.13" + "vue": "^3.2.33" }, "devDependencies": { "@babel/core": "^7.12.16", diff --git a/src/components/telaRF2.vue b/src/components/telaRF2.vue index 7b37084..8f8a100 100644 --- a/src/components/telaRF2.vue +++ b/src/components/telaRF2.vue @@ -1,117 +1,55 @@ diff --git a/src/cursoDoUsuario.js b/src/cursoDoUsuario.js new file mode 100644 index 0000000..30f3180 --- /dev/null +++ b/src/cursoDoUsuario.js @@ -0,0 +1,29 @@ + +// criando função para salvar as matérias ao clicar no botão + + +const nomeCurso = document.querySelector('#agenda-docente > table > tbody > tr:nth-child(2) > td:nth-child(2)') +let contar = 0 +const nameCurso = nomeCurso.innerText +const nCurso = [] + + +//Como tem cursos com nomes iguais tem que pegar a especializacao do curso, então ele vai salvar ate o segundo ¨-¨ +for (let i = 0; i < nameCurso.length; i++) { + if (nameCurso[i] != '-') { + nCurso[i] = nameCurso[i] + } else { + contar++ + if (contar == 2) { + contar = 0; + break + } else { + nCurso[i] = nameCurso[i] + } + } +} +let nomeC = nCurso.join([separador = '']) +localStorage.setItem("curso",(nomeC)) +//const cursoU = JSON.parse(localStorage.getItem('curso')); +console.log('Curso salvo com sucesso'); + diff --git a/src/details/Contentscript.js b/src/details/Contentscript.js index 91c370b..c1a2113 100644 --- a/src/details/Contentscript.js +++ b/src/details/Contentscript.js @@ -120,6 +120,23 @@ if (document.body.contains(document.querySelector("#menu-dropdown"))){ divCursadas.appendChild(trSub) divCursadas.style.overflow = 'auto'; } + const disCursadas = JSON.parse(localStorage.getItem('matRest')); + console.log(disciplinas); + + for(const disciplina of disCursadas){ + + const trSub = document.createElement('tr') + trSub.style.height = "4em" + trSub.classList.add('linhaPar') + + const tdSub = document.createElement('td') + tdSub.textContent = disciplina + trSub.appendChild(tdSub) + + const divCursadas = document.querySelector(".conteudoNcursado") + divCursadas.appendChild(trSub) + divCursadas.style.overflow = 'auto'; + } } diff --git a/src/materiasCursadas.js b/src/materiasCursadas.js index 7c92cd8..6b4f2d6 100644 --- a/src/materiasCursadas.js +++ b/src/materiasCursadas.js @@ -1,22 +1,132 @@ console.log("Hello World!") if(document.body.contains(document.querySelector(".infoAltRem"))){ - // criando botão para acionar a função + + let p = [] + fetch('https://secret-scrubland-39947.herokuapp.com/dadosDoCurso') + .then(resp => resp.json()) + .then(data=> p = data) + + + const recebe = [] + const recebe2 = [] + const ja = [] + const todo = [] + const posiLista = [] + const noCurso = [] + let conta = 0 + const cursoU = localStorage.getItem('curso'); + + + + let btn = document.createElement("button"); btn.innerHTML = "Salvar"; btn.style.cssText = 'position:absolute;top:105px;left:150px;width:100px;height:24px;background-color: #404E82; color: white;border:0px solid #ddd;'; - // criando função para salvar as matérias ao clicar no botão + btn.onclick = function () { + + + let doc = document.querySelectorAll("#j_id_jsp_303365748_2 > table > tbody:nth-child(4) > tr > td:nth-child(1)") const matList = [...doc] const materias = matList.map(({ innerText }) => ({ materia: innerText })) console.log(materias) - // salvando matérias em um json no localStorage + localStorage.setItem("materias", JSON.stringify(materias)) console.log('Matérias salvas com sucesso'); - alert("Matérias salvas com sucesso") + + //----Retornando matérias salvas no local storage---- + const disciplinas = JSON.parse(localStorage.getItem('materias')); + //----Converte as matérias salvas no local storage para objeto---- + let matObjeto = disciplinas; + + //===================================================================== + // Parte que vai comparar as materias + const recebe = [] + const recebe2 = [] + const ja = [] + const todo = [] + const posiLista = [] + let conta = 0 + const cursoU =localStorage.getItem('curso'); + let nomeCur + + // essa parte vai buscar o curso na lista do dadosDoCurso.json + //OBS: tem que testar com o dadosDoCurso.JSon. Eu fiz uma lista para testar (variavel p) quando fizer com os dados do arquivo é so trocar o p pelo nome da variavel que vai receber os dados da lista, acho que vai precisar usar o JSON.parse(variavel) senao ele nao vai ficar como um vetor de objetos. + + //Essa parte vai converter os nomes dos curso para o padrão que foi decidido (ate o segundo -) + for (let k = 0; k < p.length; k++) { + //Essa parte vai converter os nomes dos curso para o padrão que foi decidido (ate o segundo -) + const noCurso = [] + + for (let i = 0; i < p[k].nameCurso.length; i++) { + + if (p[k].nameCurso[i] != '-') { + noCurso[i] = p[k].nameCurso[i] + + } else { + conta++ + if (conta == 2) { + conta = 0 + break + } else { + + noCurso[i] = p[k].nameCurso[i] + + } + } + + } + nomeCur = noCurso.join([separador = '']) + + //se o nome do curso do da posição do vetor for igual ao do usuario ele continua + if (nomeCur == cursoU) { + + //aqui ele vai pegar so a parte do codigo da materia ex:(FGA0001) das materias que o usuario ja fez + for (let i = 0; i < matObjeto.length; i++) { + for (let j = 0; j < 7; j++) { + recebe[j] = matObjeto[i].materia[j] + + ja[i] = recebe.join([separador = '']) + + } + } + //aqui ele vai pegar so a parte do codigo da materia ex:(FGA0001) das materias do fluxo do curso + for (let i = 0; i < p[k].materias.length; i++) { + for (let j = 0; j < 7; j++) { + recebe2[j] = p[k].materias[i].materia[j] + todo[i] = recebe2.join([separador = '']) + } + } + let contador = 0 + //aqui ele vai comprar as 2 listas e vai fazer a lista de materias que ainda nao foram feitas pelo usuario + for (let i = 0; i < todo.length; i++) { + for (let j = 0; j < ja.length; j++) { + + if (ja[j] != todo[i]) { + if (j == ja.length - 1) { + posiLista[contador] = p[k].materias[i].materia + contador++ + } + } else { + break + } + } + + } + + break + + }; + } + + localStorage.setItem("matRest", JSON.stringify(posiLista)); + const listaComparada = JSON.parse(localStorage.getItem('matRest')); + const listaComparada1 = listaComparada + console.log(listaComparada1) }; document.body.appendChild(btn); }