diff --git a/api/services/scraping/materiasCursadas.js b/api/services/scraping/materiasCursadas.js deleted file mode 100644 index 985ad04..0000000 --- a/api/services/scraping/materiasCursadas.js +++ /dev/null @@ -1,21 +0,0 @@ -console.log("Hello World!") -// criando botão para acionar a função -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'); -}; -document.body.appendChild(btn); -// ----Retornando matérias salvas no local storage---- -// const disciplinas = JSON.parse(localStorage.getItem('materias')); -// console.log(disciplinas); \ No newline at end of file diff --git a/src/components/telaGraficos.vue b/src/components/telaGraficos.vue index 5948e6b..0db79bc 100644 --- a/src/components/telaGraficos.vue +++ b/src/components/telaGraficos.vue @@ -122,7 +122,7 @@ p { margin-top: 0.5em; font-size: 18.5px; font-weight: 500; - margin-left: 52.5em; + margin-left: 26em; } .container { @@ -131,6 +131,6 @@ p { height: 15em; border: 1px solid #d3d3d3; background: rgb(255, 255, 255); - margin-bottom: 4em; + margin-bottom: 10em; } diff --git a/src/details/Contentscript.js b/src/details/Contentscript.js index 816b3e1..91c370b 100644 --- a/src/details/Contentscript.js +++ b/src/details/Contentscript.js @@ -4,7 +4,7 @@ if (document.body.contains(document.querySelector("#menu-dropdown"))){ const menu = document.querySelector(".ThemeOfficeMenu tr"); const img = document.createElement("img"); - var imgURL = "assets/48logoSigaaPlus.png"; + var imgURL = chrome.runtime.getURL("assets/48logoSigaaPlus.png") img.src = imgURL; @@ -84,6 +84,11 @@ if (document.body.contains(document.querySelector("#menu-dropdown"))){ document.querySelector("#container").style.height = "800px" document.querySelector("#turmas-portal").style.visibility = "hidden" document.querySelector("#noticias-portal").style.visibility = "hidden" + document.querySelector("#formAtividades").style.visibility = 'visible' + + //Esconde os outros itens do dropdown caso estejam visíveis + document.querySelector(".fluxo").style.visibility = "hidden" + document.querySelector(".graficos").style.visibility = "hidden" } function exibirFluxo(){ @@ -92,6 +97,31 @@ if (document.body.contains(document.querySelector("#menu-dropdown"))){ document.querySelector("#container").style.height = "800px" document.querySelector("#turmas-portal").style.visibility = "hidden" document.querySelector("#noticias-portal").style.visibility = "hidden" + document.querySelector("#formAtividades").style.visibility = 'visible' + + //Esconde os outros itens do dropdown caso estejam visíveis + document.querySelector(".equivalencia").style.visibility = "hidden" + document.querySelector(".graficos").style.visibility = "hidden" + + const disciplinas = JSON.parse(localStorage.getItem('materias')); + console.log(disciplinas); + + for(const disciplina of disciplinas){ + + const trSub = document.createElement('tr') + trSub.style.height = "4em" + trSub.classList.add('linhaPar') + + const tdSub = document.createElement('td') + tdSub.textContent = disciplina.materia + trSub.appendChild(tdSub) + + const divCursadas = document.querySelector(".conteudo") + divCursadas.appendChild(trSub) + divCursadas.style.overflow = 'auto'; + } + + } function exibirCreditos(){ @@ -100,6 +130,13 @@ if (document.body.contains(document.querySelector("#menu-dropdown"))){ document.querySelector("#container").style.height = "800px" document.querySelector("#turmas-portal").style.visibility = "hidden" document.querySelector("#noticias-portal").style.visibility = "hidden" + document.querySelector("#participantes").style.visibility = 'hidden' + document.querySelector("#formAtividades").style.visibility = 'hidden' + document.querySelector("#forum-portal").style.marginTop = '4em' + + //Esconde os outros itens do dropdown caso estejam visíveis + document.querySelector(".equivalencia").style.visibility = "hidden" + document.querySelector(".fluxo").style.visibility = "hidden" } diff --git a/src/manifest.json b/src/manifest.json index 1114176..f1871fd 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,27 +1,36 @@ { "manifest_version": 3, - "name": "SIGAA+", - "description":"teste SIGAA+", + "name": "Sigaa Plus", "version": "1.0", + + "description": "A plain text description", "icons": { - "16": "/assets/16logoSigaaPlus.png", - "48": "/assets/48logoSigaaPlus.png", - "128": "/assets/128logoSigaaPlus.png" + "16":"assets/16logoSigaaPlus.png", + "48":"assets/48logoSigaaPlus.png", + "128":"assets/128logoSigaaPlus.png" }, - "permissions": [ - "storage" - ], - - "action": { - "default_popup":"/details/popup.html" + "background":{ + "service_worker":"background.js" }, + "author": "Grupo 02", + "permissions": ["storage"], + "content_scripts":[ { "matches": ["https://sig.unb.br/*"], - "js": ["/details/Contentscript.js"] + "js":[ + "materiasCursadas.js", + "Contentscript.js", + "dist/js/app.b8019ffe.js", + "dist/js/chunk-vendors.2c3e9449.js" + ], + "css":["dist/css/app.dc179720.css"] } - ] - + ], + "action": { + "default_icon": "assets/128logoSigaaPlus.png", + "default_popup": "popup.html" + } } \ No newline at end of file diff --git a/src/materiasCursadas.js b/src/materiasCursadas.js new file mode 100644 index 0000000..7c92cd8 --- /dev/null +++ b/src/materiasCursadas.js @@ -0,0 +1,25 @@ +console.log("Hello World!") + +if(document.body.contains(document.querySelector(".infoAltRem"))){ + // criando botão para acionar a função + 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") + }; + document.body.appendChild(btn); +} +// ----Retornando matérias salvas no local storage---- +// const disciplinas = JSON.parse(localStorage.getItem('materias')); +// console.log(disciplinas); \ No newline at end of file