Skip to content

Commit

Permalink
e
Browse files Browse the repository at this point in the history
  • Loading branch information
QkeleQ10 committed Jun 18, 2024
1 parent db23a66 commit dc3c131
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion manifest-firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"manifest_version": 3,
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"version": "3.11.2",
"version": "3.11.3",
"default_locale": "nl",
"icons": {
"16": "icons/[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"manifest_version": 3,
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"version": "3.11.2",
"version": "3.11.3",
"default_locale": "nl",
"icons": {
"16": "icons/[email protected]",
Expand Down
16 changes: 11 additions & 5 deletions src/magister/scripts/gamification.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,23 +428,29 @@ async function themeContest() {
event.preventDefault()

if ((await getFromStorage('themeContestJurorMode', 'session')) === 'true') {
const textarea = element('textarea', 'null', document.body, { style: 'position: absolute; z-index: 99999999; top: 50%; left: 50%; translate: -50% -50%; width: 300px; height: 200px;', resize: 'both' })
document.body.addEventListener('auxclick', (event) => {
if (event.button == 1) {
const textarea = element('textarea', 'null', document.body, { style: 'position: absolute; z-index: 99999999; top: 50%; left: 50%; translate: -50% -50%; width: 300px; height: 200px; transition: all 200ms;', resize: 'both' })
document.body.addEventListener('click', (event) => {
if (event.altKey) {
event.preventDefault()
textarea.style.top = event.clientY + 'px'
textarea.style.left = event.clientX + 'px'
}
if (event.ctrlKey) {
event.preventDefault()
textarea.style.opacity = textarea.style.opacity == '1' ? 0 : 1
}
})
textarea.addEventListener('paste', (event) => {
try {
let decoded = atob((event.clipboardData || window.clipboardData).getData("text"))?.split('/')
if (decoded[0] !== 'Magister Theme Contest!') {
throw new Error('invalid')
}
textarea.value = decoded.join('\n')
setTimeout(() => textarea.value = decoded.join('\n'), 0)
syncedStorage = { ...syncedStorage, ...(JSON.parse(decoded[3])) }
applyStyles(null, null, null, true)
} catch {
textarea.value = 'Ongeldig!'
setTimeout(() => textarea.value = 'Ongeldig!', 0)
}
})

Expand Down
4 changes: 2 additions & 2 deletions src/magister/scripts/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ function rootVarsForTheme(scheme = 'light', color = { h: 207, s: 95, l: 55 }) {
}
}

async function applyStyles(varsOnly, overrideTheme, overrideColor) {
if (chrome?.storage) syncedStorage = await getFromStorageMultiple(null, 'sync', true)
async function applyStyles(varsOnly, overrideTheme, overrideColor, dontUpdate) {
if (!dontUpdate && chrome?.storage) syncedStorage = await getFromStorageMultiple(null, 'sync', true)

let now = new Date()

Expand Down
4 changes: 2 additions & 2 deletions src/magister/scripts/today.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ async function today() {
}

// Cancelled label
if (item.Status === 5) {
if (item.Status == 5) {
eventElement.classList.add('cancelled')
element('div', `st-start-event-${item.Id}-cancelled`, eventElement, { class: 'st-start-event-cancelled', title: "Dit blok vervalt mogelijk.\nControleer alsjeblieft even je Magister-app of de pagina 'Agenda'!" })
}
Expand Down Expand Up @@ -1490,7 +1490,7 @@ function checkCollision(eventArr) {
function getEventChips(event) {
let chips = []

if (event.Status === 5) chips.push({ name: i18n('chips.cancelled'), type: 'warn' })
if (event.Status == 5) chips.push({ name: i18n('chips.cancelled'), type: 'warn' })
if (event.InfoType === 1 && event.Afgerond) chips.push({ name: i18n('chips.hw'), type: 'ok' })
else if (event.InfoType === 1) chips.push({ name: i18n('chips.hw'), type: 'info' })
if (event.InfoType === 2 && event.Afgerond) chips.push({ name: i18n('chips.pw'), type: 'ok' })
Expand Down

0 comments on commit dc3c131

Please sign in to comment.