diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 37da965..0000000 --- a/.babelrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "presets": [ - ["env", { - "targets": { - "browsers": "last 2 versions" - }, - "useBuiltIns": true, - "debug": false - }] - ], - "ignore": ["node_modules"], - "plugins": [ - ["transform-runtime", { "polyfill": false }] - ] -} diff --git a/.gitignore b/.gitignore index 549db57..5302287 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ npm-debug.log dist/ packages/ +extension diff --git a/.nvmrc b/.nvmrc index 53a4221..790e110 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16.13.2 +v20.10.0 diff --git a/gulpfile.babel.js b/gulpfile.babel.js deleted file mode 100644 index f291ac9..0000000 --- a/gulpfile.babel.js +++ /dev/null @@ -1,5 +0,0 @@ -import requireDir from 'require-dir' - -// Check out the tasks directory -// if you want to modify tasks! -requireDir('./tasks') diff --git a/package.json b/package.json index f1d971a..efa01af 100644 --- a/package.json +++ b/package.json @@ -4,21 +4,16 @@ "version": "1.1.7", "description": "Adiciona funcionalidades novas ao sistema de matricula da UFABC", "scripts": { - "serve": "node server/app.js", - "start": "yarn build && yarn serve", - "deploy": "caprover deploy", - "build": "yarn build:chrome", - "build:chrome": "gulp pack --production --vendor=chrome", - "build:firefox": "gulp pack --production --vendor=firefox", - "build:opera": "gulp pack --production --vendor=opera", - "build:edge": "gulp pack --production --vendor=edge", - "dev": "yarn dev:chrome", - "staging": "gulp --watch --staging --vendor=chrome", - "dev:chrome": "gulp --watch --vendor=chrome", - "dev:firefox": "gulp --watch --vendor=firefox", - "dev:opera": "gulp --watch --vendor=opera", - "dev:edge": "gulp --watch --vendor=edge", - "lint": "standard" + "dev": "rimraf extension/dev && run-p dev:*", + "dev:prepare": "node --no-warnings=ExperimentalWarning tasks/prepare.dev.mjs dev", + "dev:web": "vite", + "dev:js": "yarn run build:dev --watch src", + "build": "NODE_ENV=prod run-s clear build:web build:prepare build:prod", + "build:prepare": "node tasks/prepare.prod.mjs build", + "build:web": "vite build", + "build:dev": "tsup src/scripts/background.js src/scripts/contentscript.js --target=node20 --format iife --out-dir extension/dev/dist --no-splitting --onSuccess 'node --no-warnings=ExperimentalWarning tasks/mvsw.dev.mjs'", + "build:prod": "tsup src/scripts/background.js src/scripts/contentscript.js --target=node20 --minify --format iife --out-dir extension/prod/dist --no-splitting --onSuccess 'node --no-warnings=ExperimentalWarning tasks/mvsw.prod.mjs'", + "clear": "rimraf extension/prod" }, "standard": { "globals": [ @@ -26,56 +21,23 @@ ] }, "devDependencies": { - "babel-cli": "6.x.x", - "babel-core": "6.x.x", - "babel-loader": "7.x.x", - "babel-preset-env": "1.x.x", - "chai": "4.x.x", - "chromereload": "0.x.x", - "debounce": "1.x.x", - "del": "3.x.x", - "gulp": "4.x.x", - "gulp-bump": "2.x.x", - "gulp-cache": "0.x.x", - "gulp-clean-css": "^3.x.x", - "gulp-filter": "^5.x.x", - "gulp-git": "^2.x.x", - "gulp-if": "2.x.x", - "gulp-imagemin": "4.x.x", - "gulp-json-transform": "0.x.x", - "gulp-less": "3.x.x", - "gulp-livereload": "3.x.x", - "gulp-plumber": "1.x.x", - "gulp-sass": "5.1.0", - "gulp-sequence": "1.x.x", - "gulp-sourcemaps": "^2.x.x", - "gulp-tag-version": "1.x.x", - "gulp-util": "3.x.x", - "gulp-zip": "^4.x.x", - "require-dir": "0.x.x", - "sass": "^1.59.3", - "standard": "^10.0.2", - "vinyl-named": "1.x.x", - "webpack": "3.x.x", - "webpack-stream": "3.x.x", - "yargs": "^8.x.x" + "@vitejs/plugin-vue2": "^2.3.1", + "chokidar": "^3.6.0", + "fs-extra": "^11.2.0", + "kolorist": "^1.8.0", + "npm-run-all": "^4.1.5", + "rimraf": "^5.0.5", + "tsup": "^8.0.1", + "vite": "^5.1.1" }, "dependencies": { "autoprefixer": "^9.3.1", "axios": "^0.17.0", - "babel-plugin-transform-runtime": "^6.23.0", - "babel-preset-es2015": "^6.24.1", - "bluebird": "^3.5.1", "caprover": "^1.2.0", "compression": "^1.7.3", "cors": "^2.8.5", - "css-loader": "^1.0.1", "element-ui": "^2.4.11", "express": "^4.16.4", - "extract-text-webpack-plugin": "^3.0.2", - "gulp-cssimport": "^6.0.1", - "gulp-rename": "^1.2.2", - "gulp-vueify": "^0.0.3", "highcharts": "^6.2.0", "is_js": "^0.9.0", "jquery": "^3.2.1", @@ -86,19 +48,13 @@ "postcss-load-config": "1.0.0", "postcss-loader": "1.0.0", "postcss-url": "8.0.0", - "style-loader": "^0.23.1", "toastify-js": "^1.9.0", "toastr": "^2.1.4", - "url-loader": "^1.1.2", - "vue": "2.5.17", - "vue-loader": "^15.3.0", - "vue-style-loader": "^4.1.2", - "vue-template-compiler": "2.5.17", + "vue": "2.7.0", "vue2-highcharts": "^1.2.5", "vuedraggable": "^2.16.0", "vueify": "^9.4.1", "vueify-insert-css": "^1.0.0", - "vuetify": "1.2.6", - "webui-popover": "^1.2.18" + "vuetify": "1.2.6" } } diff --git a/src/images/error.svg b/src/assets/error.svg similarity index 100% rename from src/images/error.svg rename to src/assets/error.svg diff --git a/src/images/icon-128.png b/src/assets/icon-128.png similarity index 100% rename from src/images/icon-128.png rename to src/assets/icon-128.png diff --git a/src/images/icon-16.png b/src/assets/icon-16.png similarity index 100% rename from src/images/icon-16.png rename to src/assets/icon-16.png diff --git a/src/images/icon-19.png b/src/assets/icon-19.png similarity index 100% rename from src/images/icon-19.png rename to src/assets/icon-19.png diff --git a/src/images/icon-38.png b/src/assets/icon-38.png similarity index 100% rename from src/images/icon-38.png rename to src/assets/icon-38.png diff --git a/src/images/loading.svg b/src/assets/loading.svg similarity index 100% rename from src/images/loading.svg rename to src/assets/loading.svg diff --git a/src/images/logo-white.svg b/src/assets/logo-white.svg similarity index 100% rename from src/images/logo-white.svg rename to src/assets/logo-white.svg diff --git a/src/images/logo.svg b/src/assets/logo.svg similarity index 100% rename from src/images/logo.svg rename to src/assets/logo.svg diff --git a/src/images/refresh.png b/src/assets/refresh.png similarity index 100% rename from src/images/refresh.png rename to src/assets/refresh.png diff --git a/src/images/refresh_small.png b/src/assets/refresh_small.png similarity index 100% rename from src/images/refresh_small.png rename to src/assets/refresh_small.png diff --git a/src/images/ring.gif b/src/assets/ring.gif similarity index 100% rename from src/images/ring.gif rename to src/assets/ring.gif diff --git a/src/manifest.json b/src/manifest.json deleted file mode 100644 index 5c827d8..0000000 --- a/src/manifest.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "UFABC Next", - "short_name": "UFABC Next", - "description": "Adiciona funcionalidades novas ao sistema de matricula da UFABC", - "version": "1.2.0", - "manifest_version": 3, - "minimum_chrome_version": "55.0.0", - "icons": { - "16": "images/icon-16.png", - "128": "images/icon-128.png" - }, - "background": { - "service_worker": "scripts/background.js" - }, - "permissions": ["storage"], - "host_permissions": [ - "http://*.ufabc.edu.br/*", - "https://*.ufabc.edu.br/*", - "http://localhost:8000/*", - "http://*.ufabcnext.com/*", - "https://*.ufabcnext.com/*" - ], - "content_scripts": [ - { - "all_frames": true, - "js": ["scripts/contentscript.js"], - "matches": [ - "http://*.ufabc.edu.br/*", - "https://*.ufabc.edu.br/*", - "http://localhost:8000/*", - "http://*.ufabcnext.com/*", - "https://*.ufabcnext.com/*" - ], - "run_at": "document_end" - } - ], - "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlg7ae7OuGQW9cQU3/qbuewZ6DdTjc1yDXtiwdwoOwgF/CByfjX+yf4addlXcxnLjXVBWwSvRj78mv03lLBjkeh63ia4t/BIzzzvciZyZAKEasC5rt0M6+MKVbkKQS9JGGVFsBiBQcQ6kUP8R4cpWX1G9uEhnshdF+u4Nrs7gq9uXIPZ4pf9PhI/IsPyAsv0m5uO4EHhIMtAp8pFyJfECWWSLchlBoGlaaCyf+fT6SYDsWaw53AcwT5jOJfxdQsoGRKGI5UW8V9+Mw+EDdpTpi7f8E5k604EMqZwmzhYLiXcuUqxeXbNZkyTsUNHXTQFcpNUdmisfjiT50kcxVZVc9wIDAQAB", - "externally_connectable": { - "matches": [ - "http://*.ufabc.edu.br/*", - "https://*.ufabc.edu.br/*", - "http://localhost:8000/*", - "http://*.ufabcnext.com/*", - "https://*.ufabcnext.com/*" - ] - }, - "action": { - "default_icon": { - "19": "images/icon-19.png", - "38": "images/icon-38.png" - }, - "default_title": "UFABC Matricula", - "default_popup": "pages/popup.html" - }, - "content_security_policy": { - "extension_pages": "script-src 'self'; object-src 'self'" - }, - "web_accessible_resources": [ - { - "resources": [ - "components/*", - "images/*", - "lib/*", - "pages/*", - "scripts/*", - "services/*", - "styles/*", - "utils/*", - "views/*", - "html/*" - ], - "matches": [ - "http://*.ufabc.edu.br/*", - "https://*.ufabc.edu.br/*", - "http://localhost:8000/*", - "http://*.ufabcnext.com/*", - "https://*.ufabcnext.com/*" - ] - } - ] -} diff --git a/src/manifest.mjs b/src/manifest.mjs new file mode 100644 index 0000000..491adb0 --- /dev/null +++ b/src/manifest.mjs @@ -0,0 +1,95 @@ +import pkg from "../package.json" with { type: "json" }; + +const isDev = process.env.NODE_ENV !== "prod"; + +export async function getManifest() { + // update this file to update this manifest.json + + const manifest = { + manifest_version: 3, + name: pkg.displayName || pkg.name, + version: pkg.version, + description: pkg.description, + icons: { + 16: "./assets/icon-16.png", + 128: "./assets/icon-128.png", + }, + background: { + service_worker: "background.js", + }, + permissions: ["storage"], + host_permissions: [ + "http://*.ufabc.edu.br/*", + "https://*.ufabc.edu.br/*", + "http://localhost:8000/*", + "http://*.ufabcnext.com/*", + "https://*.ufabcnext.com/*", + ], + content_scripts: [ + { + all_frames: true, + js: ["contentscript.js"], + matches: [ + "http://*.ufabc.edu.br/*", + "https://*.ufabc.edu.br/*", + "http://localhost:8000/*", + "http://*.ufabcnext.com/*", + "https://*.ufabcnext.com/*", + ], + run_at: "document_end", + }, + ], + key: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlg7ae7OuGQW9cQU3/qbuewZ6DdTjc1yDXtiwdwoOwgF/CByfjX+yf4addlXcxnLjXVBWwSvRj78mv03lLBjkeh63ia4t/BIzzzvciZyZAKEasC5rt0M6+MKVbkKQS9JGGVFsBiBQcQ6kUP8R4cpWX1G9uEhnshdF+u4Nrs7gq9uXIPZ4pf9PhI/IsPyAsv0m5uO4EHhIMtAp8pFyJfECWWSLchlBoGlaaCyf+fT6SYDsWaw53AcwT5jOJfxdQsoGRKGI5UW8V9+Mw+EDdpTpi7f8E5k604EMqZwmzhYLiXcuUqxeXbNZkyTsUNHXTQFcpNUdmisfjiT50kcxVZVc9wIDAQAB", + externally_connectable: { + matches: [ + "http://*.ufabc.edu.br/*", + "https://*.ufabc.edu.br/*", + "http://localhost:8000/*", + "http://*.ufabcnext.com/*", + "https://*.ufabcnext.com/*", + ], + }, + action: { + default_icon: { + 19: "assets/icon-19.png", + 38: "assets/icon-38.png", + }, + default_title: "Next Extension", + default_popup: "./views/Popup/index.html", + }, + content_security_policy: { + extension_pages: "script-src 'self'; object-src 'self'", + }, + web_accessible_resources: [ + { + resources: [ + "components/*", + "assets/*", + "lib/*", + "pages/*", + "scripts/*", + "services/*", + "styles/*", + "utils/*", + "views/*", + "html/*", + ], + matches: [ + "http://*.ufabc.edu.br/*", + "https://*.ufabc.edu.br/*", + "http://localhost:8000/*", + "http://*.ufabcnext.com/*", + "https://*.ufabcnext.com/*", + ], + }, + ], + }; + + if (isDev) { + manifest.content_security_policy = { + extension_pages: `script-src 'self' http://localhost:${5001}; object-src 'self'`, + }; + } + + return manifest; +} diff --git a/src/pages/popup.html b/src/pages/popup.html deleted file mode 100644 index cef4490..0000000 --- a/src/pages/popup.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -
- - - diff --git a/src/scripts/contentScriptPortal.js b/src/scripts/contentScriptPortal.js index 01500a3..853a439 100644 --- a/src/scripts/contentScriptPortal.js +++ b/src/scripts/contentScriptPortal.js @@ -6,9 +6,9 @@ import { NextAPI } from "../services/NextAPI"; import Axios from "axios"; import Toastify from "toastify-js"; import "toastify-js/src/toastify.css"; -const loading = require("../images/loading.svg"); -const errorSVG = require("../images/error.svg"); -const logoWhite = require("../images/logo-white.svg"); +const loading = require("../assets/loading.svg"); +const errorSVG = require("../assets/error.svg"); +const logoWhite = require("../assets/logo-white.svg"); const nextApi = NextAPI(); diff --git a/src/services/NextStorage.mjs b/src/services/NextStorage.mjs new file mode 100644 index 0000000..aa799cc --- /dev/null +++ b/src/services/NextStorage.mjs @@ -0,0 +1,43 @@ +export const NextStorage = { + setItem(key, value) { + return new Promise((resolve, reject) => { + try { + const date = Date.now(); + const event = new CustomEvent("requestStorage", { + detail: { + method: `setStorage-${key}-${date}`, + date: date, + key: key, + value: value, + }, + }); + document.addEventListener(`setStorage-${key}-${date}`, (evt) => { + resolve(evt.detail.value); + }); + document.dispatchEvent(event); + } catch (err) { + console.error(err); + } + }); + }, + getItem(key) { + return new Promise((resolve, reject) => { + try { + const date = Date.now(); + const event = new CustomEvent("requestStorage", { + detail: { + method: `getStorage-${key}-${date}`, + key: key, + date: date, + }, + }); + document.addEventListener(`getStorage-${key}-${date}`, (evt) => { + resolve(evt.detail.value); + }); + document.dispatchEvent(event); + } catch (err) { + console.error(err); + } + }); + }, +}; diff --git a/src/styles/main.css b/src/styles/main.css index 406c94b..f11eaea 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -3,18 +3,19 @@ /*@import "../../node_modules/element-ui/lib/theme-chalk/index.css";*/ @import "../../node_modules/vuetify/dist/vuetify.min.css"; +@import url("https://fonts.googleapis.com/css?family=Ubuntu"); + /* fallback */ @font-face { - font-family: 'Material Icons'; + font-family: "Material Icons"; font-style: normal; font-weight: 400; - src: url(https://fonts.gstatic.com/s/materialicons/v41/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) format('woff2'); + src: url(https://fonts.gstatic.com/s/materialicons/v41/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) + format("woff2"); } -@import url('https://fonts.googleapis.com/css?family=Ubuntu'); - .material-icons { - font-family: 'Material Icons'; + font-family: "Material Icons"; font-weight: normal; font-style: normal; font-size: 24px; @@ -25,7 +26,7 @@ white-space: nowrap; word-wrap: normal; direction: ltr; - -webkit-font-feature-settings: 'liga'; + -webkit-font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; } @@ -48,169 +49,169 @@ display: none; } .highcharts-credits { - display: none; + display: none; } .ufabc-extension-font { - font-size: 11px; - text-transform: uppercase; - font-weight: bold; + font-size: 11px; + text-transform: uppercase; + font-weight: bold; } .ufabc-extension-prof { - font-size: 13px; - text-transform: uppercase; - font-weight: bold; + font-size: 13px; + text-transform: uppercase; + font-weight: bold; } .ufabc-well { - min-height: 20px; - border: 1px solid; - border-radius: 4px; + min-height: 20px; + border: 1px solid; + border-radius: 4px; } .ufabc-well a { - color: #F39C12 !important; + color: #f39c12 !important; } .ufabc-orange { - color: #fff; - background-color: #f39c12; - border-color: #f39c12; + color: #fff; + background-color: #f39c12; + border-color: #f39c12; } .ufabc-red { - color: #fff; - background-color: #e74c3c; - border-color: #e74c3c; + color: #fff; + background-color: #e74c3c; + border-color: #e74c3c; } .ufabc-green { - background-color: #18bc9c; - border-color: #18bc9c; - color: #fff + background-color: #18bc9c; + border-color: #18bc9c; + color: #fff; } .ufabc-blue { - background-color: #3498db; - border-color: #3498db; - color: #fff + background-color: #3498db; + border-color: #3498db; + color: #fff; } .ufabc-purple { - background-color: #4d3a7d; - border-color: #4d3a7d; - color: #fff + background-color: #4d3a7d; + border-color: #4d3a7d; + color: #fff; } .ufabc-transparent { - background-color: transparent; - border-color: transparent; + background-color: transparent; + border-color: transparent; } .extension { - border: 2px solid #428bca; - padding: 7px 14px; + border: 2px solid #428bca; + padding: 7px 14px; } .notSearch { - display: none; + display: none; } .material-switch > input[type="checkbox"] { - display: none; + display: none; } .material-switch > label { - cursor: pointer; - height: 0px; - position: relative; - width: 40px; + cursor: pointer; + height: 0px; + position: relative; + width: 40px; } .material-switch > label::before { - background: rgb(0, 0, 0); - box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5); - border-radius: 8px; - content: ''; - height: 16px; - margin-top: -8px; - position:absolute; - opacity: 0.3; - transition: all 0.4s ease-in-out; - width: 40px; + background: rgb(0, 0, 0); + box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5); + border-radius: 8px; + content: ""; + height: 16px; + margin-top: -8px; + position: absolute; + opacity: 0.3; + transition: all 0.4s ease-in-out; + width: 40px; } .material-switch > label::after { - background: rgb(255, 255, 255); - border-radius: 16px; - box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3); - content: ''; - height: 24px; - left: -4px; - margin-top: -8px; - position: absolute; - top: -4px; - transition: all 0.3s ease-in-out; - width: 24px; + background: rgb(255, 255, 255); + border-radius: 16px; + box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3); + content: ""; + height: 24px; + left: -4px; + margin-top: -8px; + position: absolute; + top: -4px; + transition: all 0.3s ease-in-out; + width: 24px; } .material-switch > input[type="checkbox"]:checked + label::before { - background: inherit; - opacity: 0.5; + background: inherit; + opacity: 0.5; } .material-switch > input[type="checkbox"]:checked + label::after { - background: inherit; - left: 20px; + background: inherit; + left: 20px; } -.list-group-item{ - position: relative; - display: block; - padding: 10px 15px; - margin-bottom: -1px; - background-color: #fff; - border: none !important; +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #fff; + border: none !important; } .notAndre { - display: none; + display: none; } .notBernardo { - display: none; + display: none; } .notMatutino { - display: none; + display: none; } .notNoturno { - display: none; + display: none; } .btn-outline { - background-color: transparent; - color: inherit; - transition: all .5s; + background-color: transparent; + color: inherit; + transition: all 0.5s; } .btn-primary.btn-outline { - color: #428bca; + color: #428bca; } .btn-success.btn-outline { - color: #5cb85c; + color: #5cb85c; } .btn-info.btn-outline { - color: #5bc0de; + color: #5bc0de; } .btn-warning.btn-outline { - color: #f0ad4e; + color: #f0ad4e; } .btn-danger.btn-outline { - color: #d9534f; + color: #d9534f; } .btn-primary.btn-outline:hover, @@ -218,15 +219,15 @@ .btn-info.btn-outline:hover, .btn-warning.btn-outline:hover, .btn-danger.btn-outline:hover { - color: #fff; + color: #fff; } .my_data { - display: none; + display: none; } .notHigh { - display: none; + display: none; } td span.sbc:hover, td span.sa:hover { @@ -234,9 +235,6 @@ td span.sa:hover { cursor: pointer; } - - - /* Grid helpers */ .ufabc-flex { flex: 1 1 auto; @@ -293,7 +291,6 @@ td span.sa:hover { justify-content: flex-end; } - .ufabc-align-start { align-items: flex-start; } @@ -315,8 +312,8 @@ td span.sa:hover { .ufabc-float-none { float: none; } -/* - Divider styles +/* + Divider styles */ .ufabc-column > .ufabc-divider { flex: 0; @@ -326,10 +323,10 @@ td span.sa:hover { position: relative; top: 1px; z-index: 1; - background-color: rgba(0, 0, 0, 0.06) !important + background-color: rgba(0, 0, 0, 0.06) !important; } -/* +/* Positions helpers */ .ufabc-static { @@ -345,8 +342,8 @@ td span.sa:hover { position: fixed; } -/* - Flexbox helpers +/* + Flexbox helpers */ .ufabc-flex-wrap { flex-wrap: wrap; @@ -355,8 +352,7 @@ td span.sa:hover { justify-content: space-around; } - -.ufabc-element-switch .el-switch__label *{ +.ufabc-element-switch .el-switch__label * { font-size: 13px; } @@ -374,60 +370,60 @@ td span.sa:hover { transform: translateY(-3px); } .elevate-1 { - box-shadow: 0 1px 4px -1px rgba(0,0,0,.2) !important + box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.2) !important; } .elevate-2 { - box-shadow: 0 2px 7px -1px rgba(0,0,0,.2) !important; + box-shadow: 0 2px 7px -1px rgba(0, 0, 0, 0.2) !important; } .elevate-3 { box-shadow: 0px 5px 26px -4px rgba(0, 0, 0, 0.2) !important; } -/* +/* Borders */ .border-right { - border-right: 1px solid rgba(0,0,0,0.07)!important; + border-right: 1px solid rgba(0, 0, 0, 0.07) !important; } .border-left { - border-left: 1px solid rgba(0,0,0,0.07) !important; + border-left: 1px solid rgba(0, 0, 0, 0.07) !important; } .border-top { - border-top: 1px solid rgba(0,0,0,0.07)!important; + border-top: 1px solid rgba(0, 0, 0, 0.07) !important; } .border-bottom { - border-bottom: 1px solid rgba(0,0,0,0.07)!important; + border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important; } .border { - border: 1px solid rgba(0,0,0,0.07)!important; + border: 1px solid rgba(0, 0, 0, 0.07) !important; } .border-right-lighten-3 { - border-right: 3px solid #f4f5f7!important; + border-right: 3px solid #f4f5f7 !important; } .border-left-lighten-3 { - border-left: 3px solid #f4f5f7!important; + border-left: 3px solid #f4f5f7 !important; } .border-top-lighten-3 { - border-top: 3px solid #f4f5f7!important; + border-top: 3px solid #f4f5f7 !important; } .border-bottom-lighten-3 { - border-bottom: 3px solid #f4f5f7!important; + border-bottom: 3px solid #f4f5f7 !important; } .border-lighten-3 { - border: 3px solid #f4f5f7!important; + border: 3px solid #f4f5f7 !important; } -.no-border { +.no-border { border: none !important; } -/* - * Webkit Scrollbar +/* + * Webkit Scrollbar */ - *::-webkit-scrollbar { +*::-webkit-scrollbar { width: 6px !important; height: 6px !important; overflow: hidden; @@ -440,25 +436,25 @@ td span.sa:hover { } *::-webkit-scrollbar-thumb { - background-color: rgba(0,0,0,0.2) + background-color: rgba(0, 0, 0, 0.2); } *::-webkit-scrollbar-track { - background: rgba(255,255,255,0.08) + background: rgba(255, 255, 255, 0.08); } -/* +/* * Cursor helpers */ .ufabc-cursor-pointer { cursor: pointer !important; } -/* +/* * Custom table */ -.kicks-table > el-table, -.kicks-table tr, -.kicks-table td, +.kicks-table > el-table, +.kicks-table tr, +.kicks-table td, .kicks-table th { /* border: none !important; */ border-width: 0px 0px 1px 0px !important; @@ -468,7 +464,7 @@ td span.sa:hover { } .el-table .aluno-row { - background-color: #B7D3FF !important; + background-color: #b7d3ff !important; } .el-table .kicked-row { @@ -484,7 +480,7 @@ td span.sa:hover { } .aluno { - background-color: #B7D3FF !important; + background-color: #b7d3ff !important; } .kicked { @@ -501,4 +497,4 @@ td span.sa:hover { .ufabc-cursor-grabbing .v-chip__content { cursor: move !important; -} \ No newline at end of file +} diff --git a/src/utils/Matricula.js b/src/utils/Matricula.js index 4efd35e..04cbf22 100644 --- a/src/utils/Matricula.js +++ b/src/utils/Matricula.js @@ -48,8 +48,6 @@ function Matricula() { "Energia: Origens, Conversão e Uso": "Bases Conceituais da Energia", "Transformações nos Seres Vivos e Ambiente": "Biodiversidade: Interações entre organismos e ambiente", - "Transformações Bioquímicas": - "Bioquímica: estrutura, propriedade e funções de Biomoléculas", "Transformações Bioquímicas": "Bioquímica: Estrutura, Propriedade e Funções de Biomoléculas", "Origem da Vida e Diversidade dos Seres Vivos": diff --git a/src/utils/setupStorageESM.mjs b/src/utils/setupStorageESM.mjs new file mode 100644 index 0000000..5d3268c --- /dev/null +++ b/src/utils/setupStorageESM.mjs @@ -0,0 +1,39 @@ +// will only support chrome storage for now +export function setupStorageESM() { + document.addEventListener("requestStorage", (event) => { + const key = event.detail.key; + const date = event.detail.date; + const value = event.detail.value; + const method = event.detail.method.split("-")[0]; + const eventType = event.type; + if (!key || !date || !method || eventType != "requestStorage") return; + + const eventMethod = event.detail.method; + + console.log(`[${method} | ${key}] Using chrome.storage 🔵`); + // maybe below is actually resolve(data && data[key]) - please check + + if (method == "setStorage") { + chrome.storage.local.set({ [key]: value }); + return document.dispatchEvent( + new CustomEvent(eventMethod, { + detail: { + key: key, + value: value, + }, + }) + ); + } else if (method == "getStorage") { + return chrome.storage.local.get(key, (data) => { + document.dispatchEvent( + new CustomEvent(eventMethod, { + detail: { + key: key, + value: data && data[key], + }, + }) + ); + }); + } + }); +} diff --git a/src/views/Matricula.vue b/src/views/Matricula.vue index 684541e..d453868 100644 --- a/src/views/Matricula.vue +++ b/src/views/Matricula.vue @@ -2,7 +2,7 @@
diff --git a/src/views/popup.vue b/src/views/Popup/Popup.vue similarity index 60% rename from src/views/popup.vue rename to src/views/Popup/Popup.vue index e4f0053..a457212 100644 --- a/src/views/popup.vue +++ b/src/views/Popup/Popup.vue @@ -1,9 +1,8 @@ -
Última atualização: {{ formatDate(student.lastUpdate) }}
+
+ Última atualização: {{ formatDate(student.lastUpdate) }} +
- Atualizar dados agora + Atualizar dados agora
- Está com problemas com a extensão?
Clique aqui
+ Está com problemas com a extensão?
Clique aqui