├── .gitignore ├── logo.png ├── logo16.png ├── logo48.png ├── img └── calendar.png ├── README.md ├── manifest.json └── js ├── moneySpent.js ├── examsCalendar.js └── mediacalc.js /.gitignore: -------------------------------------------------------------------------------- 1 | screenshot*.png 2 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DCruzDev/paco_ua_extension/HEAD/logo.png -------------------------------------------------------------------------------- /logo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DCruzDev/paco_ua_extension/HEAD/logo16.png -------------------------------------------------------------------------------- /logo48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DCruzDev/paco_ua_extension/HEAD/logo48.png -------------------------------------------------------------------------------- /img/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DCruzDev/paco_ua_extension/HEAD/img/calendar.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # paco_ua_extension 2 | Extensão que adiciona funcionalidade ao PACO. 3 | 4 | Ainda em fase inicial. 5 | 6 | Features atuais: 7 | * Mostra a média ponderada na página plano curricular 8 | * Adicionar exames ao google calendar com um clique 9 | * Mostra o total gasto em propinas 10 | 11 | Features para adicionar: 12 | * ... 13 | 14 | ## Installation 15 | 16 | Chrome: [Webstore Link](https://chrome.google.com/webstore/detail/paco-ua-extension/lcgdmdafgpgplkiaiifgamdkcnpnnopp) 17 | 18 | Firefox: [Download signed extension](https://github.com/DCruzDev/paco_ua_extension/releases/latest) 19 | 20 | ## Contributors (Big Thanks) 21 | 22 | @RodrigoRosmaninho 23 | @rodrigogonegit 24 | @jtsimoes 25 | 26 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "PACO UA Extension", 4 | "version": "0.29", 5 | 6 | "description": "Adiciona funcionalidade ao antigo PACO da Universidade de Aveiro", 7 | 8 | "icons": { 9 | "16": "logo16.png", 10 | "48": "logo48.png", 11 | "128": "logo.png" }, 12 | 13 | "content_scripts": [ 14 | { 15 | "matches": ["https://paco.ua.pt/secvirtual/c_planocurr.asp"], 16 | "js": ["js/mediacalc.js"] 17 | }, 18 | { 19 | "matches": ["https://paco.ua.pt/secvirtual/c_calendarioDeExames.asp"], 20 | "js": ["js/examsCalendar.js"] 21 | }, 22 | { 23 | "matches": ["https://paco.ua.pt/secvirtual/c_estadoDasProprinas.asp"], 24 | "js": ["js/moneySpent.js"] 25 | } 26 | ], 27 | 28 | "web_accessible_resources": [ 29 | "img/calendar.png" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /js/moneySpent.js: -------------------------------------------------------------------------------- 1 | mainTable = document.querySelector("#template_main > p:nth-child(12) > table:nth-child(1) > tbody:nth-child(1)").children; 2 | stats = parseMainTable(mainTable); 3 | writeStats(stats); 4 | 5 | // Write stats on table at the end of page 6 | function writeStats(stats){ 7 | tableToWrite = document.querySelector("#template_main > p:nth-child(12) > table:nth-child(1) > tbody").children; 8 | tableToWrite = tableToWrite[tableToWrite.length-3]; 9 | tableToWrite = tableToWrite.firstElementChild; 10 | //Create Element to add 11 | var elementToAdd = document.createElement("b"); 12 | 13 | elementToAdd.innerText = "Dinheiro total gasto em propinas: " + stats["totalmoney"].toFixed(2) + "€"; 14 | 15 | //Add elements 16 | tableToWrite.append(elementToAdd); 17 | } 18 | 19 | function parseMainTable (table){ 20 | sum = 0; 21 | // Go Through each row 22 | for(i=2;i table:nth-child(2) > tbody:nth-child(1)").children; 2 | parseMainTable(mainTable); 3 | 4 | function parseMainTable(table){ 5 | var i; 6 | var row; 7 | //Cycle through rows 8 | for(i=2;i table:nth-child(6) > tbody:nth-child(1)").children; 2 | stats = parseMainTable(mainTable); 3 | writeStats(stats); 4 | 5 | // Write stats on table at the end of page 6 | function writeStats(stats){ 7 | tableToWrite = document.querySelector("#template_main > table:nth-child(8) > tbody:nth-child(1)"); 8 | 9 | //Create Element to add 10 | var newNode1 = document.createElement("tr"); 11 | newNode1.className = "table_cell_par"; 12 | var newTd1 = document.createElement("td"); 13 | newTd1.setAttribute("align", "left"); 14 | newTd1.innerText = "Total Disciplinas"; 15 | var newTd2 = document.createElement("td"); 16 | newTd2.setAttribute("align", "right"); 17 | newTd2.innerText = stats["countD"]; 18 | //Compose element 19 | newNode1.appendChild(newTd1); 20 | newNode1.appendChild(newTd2); 21 | 22 | //Create Element to add 23 | var newNode2 = document.createElement("tr"); 24 | newNode2.className = "table_cell_impar"; 25 | var newTd1 = document.createElement("td"); 26 | newTd1.setAttribute("align", "left"); 27 | newTd1.innerText = "Media Ponderada"; 28 | var newTd2 = document.createElement("td"); 29 | newTd2.setAttribute("align", "right"); 30 | newTd2.innerText = stats["media"].toFixed(2); 31 | 32 | //Compose element 33 | newNode2.appendChild(newTd1); 34 | newNode2.appendChild(newTd2); 35 | //Create Element to add 36 | var newNode3 = document.createElement("tr"); 37 | newNode3.className = "table_cell_impar"; 38 | var newTd1 = document.createElement("td"); 39 | newTd1.setAttribute("align", "left"); 40 | newTd1.innerText = "Total ECTS"; 41 | var newTd2 = document.createElement("td"); 42 | newTd2.setAttribute("align", "right"); 43 | newTd2.innerText = stats["countEcts"]; 44 | //Compose element 45 | newNode3.appendChild(newTd1); 46 | newNode3.appendChild(newTd2); 47 | 48 | //Add elements 49 | tableToWrite.appendChild(newNode2); 50 | tableToWrite.appendChild(newNode1); 51 | tableToWrite.appendChild(newNode3); 52 | } 53 | 54 | function parseMainTable (table){ 55 | count = 0; 56 | countD = 0; 57 | sum = 0; 58 | // Go Through each row 59 | for(i=1;itable>tbody").children; 84 | for(j=1; j