Skip to content

Commit

Permalink
Merge pull request #290 from fga-eps-mds/feature-RF02_disciplinasCurs…
Browse files Browse the repository at this point in the history
…adas

[UPDATE] (issue #268 #273): Redimensionando componentes para se adequ…
  • Loading branch information
GabriellyAssuncao authored Apr 25, 2022
2 parents 22d402b + 4ec9eac commit fb85eed
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 38 deletions.
21 changes: 0 additions & 21 deletions api/services/scraping/materiasCursadas.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/telaGraficos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ p {
margin-top: 0.5em;
font-size: 18.5px;
font-weight: 500;
margin-left: 52.5em;
margin-left: 26em;
}
.container {
Expand All @@ -131,6 +131,6 @@ p {
height: 15em;
border: 1px solid #d3d3d3;
background: rgb(255, 255, 255);
margin-bottom: 4em;
margin-bottom: 10em;
}
</style>
39 changes: 38 additions & 1 deletion src/details/Contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand Down Expand Up @@ -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(){
Expand All @@ -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(){
Expand All @@ -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"
}


Expand Down
37 changes: 23 additions & 14 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
25 changes: 25 additions & 0 deletions src/materiasCursadas.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit fb85eed

Please sign in to comment.