Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option for jExam like styling in Selma #149

Merged
merged 22 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ chrome.runtime.onInstalled.addListener(async (details) => {
'theme',
'studiengang',
'hisqisPimpedTable',
'selmajExamTheme',
'savedClickCounter',
'saved_click_counter', // legacy
'Rocket', // legacy
Expand All @@ -57,6 +58,7 @@ chrome.runtime.onInstalled.addListener(async (details) => {
if (typeof currentSettings.dashboardDisplay === 'undefined') updateObj.dashboardDisplay = 'favoriten'
if (typeof currentSettings.fwdEnabled === 'undefined') updateObj.fwdEnabled = true
if (typeof currentSettings.hisqisPimpedTable === 'undefined') updateObj.hisqisPimpedTable = true
if (typeof currentSettings.selmajExamTheme === 'undefined') updateObj.selmajExamTheme = true
if (typeof currentSettings.theme === 'undefined') updateObj.theme = 'system'
if (typeof currentSettings.studiengang === 'undefined') updateObj.studiengang = 'general'
if (typeof currentSettings.selectedRocketIcon === 'undefined') updateObj.selectedRocketIcon = JSON.stringify(rockets.default)
Expand Down
4 changes: 2 additions & 2 deletions src/freshContent/settings/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import AutoLogin from './settingPages/AutoLogin.vue'
import Email from './settingPages/Email.vue'
import OpalCourses from './settingPages/OpalCourses.vue'
import ImproveOpal from './settingPages/ImproveOpal.vue'
import SelmajExamTheme from './settingPages/SelmajExamTheme.vue'
import ImproveSelma from './settingPages/ImproveSelma.vue'
import Shortcuts from './settingPages/Shortcuts.vue'
import SearchEngines from './settingPages/SearchEngines.vue'
import Rockets from './settingPages/Rockets.vue'
Expand Down Expand Up @@ -116,7 +116,7 @@ export default defineComponent({
Email,
OpalCourses,
ImproveOpal,
SelmajExamTheme,
ImproveSelma,
Shortcuts,
SearchEngines,
Rockets,
Expand Down
3 changes: 2 additions & 1 deletion src/freshContent/settings/components/SettingTile.vue
Noxdor marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script lang="ts">
import { defineComponent, PropType } from 'vue'
// Temporary fix: We need to import the Componentes for the icons manually as no global usage is possible
import { PhLockKey, PhNotification, PhListDashes, PhSparkle, PhGauge, PhGoogleLogo, PhRocket, PhEnvelopeOpen } from '@dnlsndr/vue-phosphor-icons'
import { PhLockKey, PhNotification, PhListDashes, PhSparkle, PhChartBar, PhGauge, PhGoogleLogo, PhRocket, PhEnvelopeOpen } from '@dnlsndr/vue-phosphor-icons'

export default defineComponent({
components: {
Expand All @@ -28,6 +28,7 @@ export default defineComponent({
PhListDashes,
PhSparkle,
PhGauge,
PhChartBar,
PhGoogleLogo,
PhRocket,
PhEnvelopeOpen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<p class="max-line p-margin">
Dieses feature fügt Graphen für die Notenverteilungen und Versuchstracker in
selma hinzu. Zusätzlich wird das layout und design angepasst
umbenutzerfreundlicher zu sein.
um allgemein benutzerfreundlicher zu sein.
</p>

<Setting
v-model="selmajExamTheme"
txt="Das jExam theme bei Selma benutzen"
txt="Das verbesserte layout und die Notenverteilung bei Selma benutzen"
class="setting"
/>
</template>
Expand All @@ -23,14 +23,14 @@ export default defineComponent({
Setting
},
setup () {
const selmajExamTheme = ref(false)
const selmajExamTheme = ref(true)

onBeforeMount(async () => {
const { selmajExamTheme: storedValue } = await chrome.storage.local.get([
'selmajExamTheme'
])

selmajExamTheme.value = storedValue ?? false
selmajExamTheme.value = storedValue ?? true
watch(selmajExamTheme, valueUpdate)
})

Expand Down
6 changes: 3 additions & 3 deletions src/freshContent/settings/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"settingsPage": "ImproveOpal"
},
{
"title": "Selma jExam Theme",
"icon": "PhSparkle",
"settingsPage": "SelmajExamTheme"
"title": "Selma verbessern",
"icon": "PhChartBar",
"settingsPage": "ImproveSelma"
},
{
"title": "Shortcuts",
Expand Down