From 1fc60ffe4f798531ad78806dc65258cc894bccbc Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Sun, 25 Oct 2020 22:00:39 -0700 Subject: [PATCH 1/9] chore: alphebetizes config states, refactors SettingToggle => LayoutToggle --- src/App.vue | 20 +++++++++---------- .../{SettingToggle.vue => LayoutToggle.vue} | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) rename src/components/{SettingToggle.vue => LayoutToggle.vue} (97%) diff --git a/src/App.vue b/src/App.vue index d97df0c..93e90f2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -30,7 +30,7 @@ > - export default { - name: "SettingToggle", + name: "LayoutToggle", props: { name: String, icon: String, From 729d1b53098f89ab0111b067f3d1974b55b67f3c Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Mon, 26 Oct 2020 02:47:18 -0700 Subject: [PATCH 2/9] feat: adds support for theme_use_dark --- src/App.vue | 4 +++- src/components/DarkMode.vue | 20 +++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/App.vue b/src/App.vue index 93e90f2..3568c35 100644 --- a/src/App.vue +++ b/src/App.vue @@ -28,7 +28,7 @@ :links="config.links" @navbar-toggle="showMenu = !showMenu" > - + export default { name: "Darkmode", - data: function () { - return { - isDark: null, - }; - }, + props: ["isDark"], created: function () { - this.isDark = + var isDark = "overrideDark" in localStorage ? JSON.parse(localStorage.overrideDark) - : matchMedia("(prefers-color-scheme: dark)").matches; - this.$emit("updated", this.isDark); + : this.isDark === null + ? matchMedia("(prefers-color-scheme: dark)").matches + : this.isDark; + this.$emit("updated", isDark); }, methods: { toggleTheme: function () { - this.isDark = !this.isDark; - localStorage.overrideDark = this.isDark; - this.$emit("updated", this.isDark); + var isDark = !this.isDark; + localStorage.overrideDark = isDark; + this.$emit("updated", isDark); }, }, }; From ae8d62958bdf0e61498a32d0a8e49bfddf338b6d Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Mon, 26 Oct 2020 03:01:39 -0700 Subject: [PATCH 3/9] feat: adds support for vlayout config option --- src/App.vue | 3 ++- src/components/DarkMode.vue | 4 ++-- src/components/LayoutToggle.vue | 24 ++++++++++++++---------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/App.vue b/src/App.vue index 3568c35..1397e73 100644 --- a/src/App.vue +++ b/src/App.vue @@ -31,6 +31,7 @@ - - + + @@ -12,27 +12,31 @@ export default { name: String, icon: String, iconAlt: String, + vlayout: Boolean, }, data: function () { return { secondaryIcon: null, - value: true, }; }, created: function () { this.secondaryIcon = this.iconAlt || this.icon; - + let vlayout; if (this.name in localStorage) { - this.value = JSON.parse(localStorage[this.name]); + vlayout = JSON.parse(localStorage[this.name]); + } else { + vlayout = this.vlayout === null + ? true + : this.vlayout; } - this.$emit("updated", this.value); + this.$emit("updated", vlayout); }, methods: { - toggleSetting: function () { - this.value = !this.value; - localStorage[this.name] = this.value; - this.$emit("updated", this.value); + toggleLayout: function () { + let vlayout = !this.vlayout; + localStorage[this.name] = vlayout; + this.$emit("updated", vlayout); }, }, }; From 6b17544aa05334b96991f916c7a3512d9ce5bb72 Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Mon, 26 Oct 2020 03:04:26 -0700 Subject: [PATCH 4/9] docs: adds documentation on vlayout and theme_use_dark configuration options --- docs/configuration.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 7df5651..75fcb6d 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -22,10 +22,12 @@ header: true # Set to false to hide the header footer: '

Created with ❤️ with bulma, vuejs & font awesome // Fork me on

' # set false if you want to hide it. columns: "3" # "auto" or number (must be a factor of 12: 1, 2, 3, 4, 6, 12) +vlayout: true # default to the vertical layout connectivityCheck: true # whether you want to display a message when the apps are not accessible anymore (VPN disconnected for example) # Optional theming theme: default # 'default' or one of the theme available in 'src/assets/themes'. +theme_use_dark: false # true or false, useful for overriding browser default in new sessions # Optional custom stylesheet # Will load custom CSS files. Especially useful for custom icon sets. From 188bcb4f21140e26a0a8bdd3a38e1ade0074826b Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Mon, 26 Oct 2020 03:14:25 -0700 Subject: [PATCH 5/9] chore: cleans up linter issues --- src/components/DarkMode.vue | 4 +++- src/components/LayoutToggle.vue | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/DarkMode.vue b/src/components/DarkMode.vue index 36fcb3f..ec4bec2 100644 --- a/src/components/DarkMode.vue +++ b/src/components/DarkMode.vue @@ -11,7 +11,9 @@ - */ + +*/