+
{{ t('addon.dev', 'Developer') }}
-
+
{{ t('addon.unlisted', 'Unlisted') }}
-
{{ addon.name_i18n ? t(addon.name_i18n, addon.name) : addon.name }} ({{ addon.id }})
+
+ {{ addon.name_i18n ? t(addon.name_i18n, addon.name) : addon.name }}
+
+ ({{ addon.id }})
+
+
{{ t('addon.author', 'By: {author}', {
author: addon.author_i18n ? t(addon.author_i18n, addon.author) : addon.author
}) }}
-
+
{{ t('addon.version', 'Version {version}', {version}) }}
+
+ {{ t('addon.updated', 'Updated: {when,humantime}', {when: addon.updated}) }}
+
+
+
+
+ {{ t('home.new-settings', 'New Settings') }}
+
+
+
+ {{ t('home.new-settings.desc', 'These are settings that you haven\'t looked at yet.') }}
+
+
+
+
+
+
+
+ {{ t('home.addon-updates', 'Updated Add-Ons') }}
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+ {{ t('home.addon-new', 'New Add-Ons') }}
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
@@ -70,10 +213,32 @@ export default {
data() {
return {
- md: HOME_MD
+ md: HOME_MD,
+ theme: '',
+ addons: null,
+ new_addons: null,
+ unseen: this.item.getUnseen()
}
},
+ created() {
+ this.updateAddons();
+ this.updateTheme();
+ this.context.context.on('changed:theme.is-dark', this.updateTheme, this);
+
+ const ffz = this.context.getFFZ();
+ ffz.on('main_menu:update-unseen', this.updateUnseen, this);
+ ffz.on('addons:data-loaded', this.updateAddons, this);
+ },
+
+ beforeDestroy() {
+ this.context.context.off('changed:theme.is-dark', this.updateTheme, this);
+
+ const ffz = this.context.getFFZ();
+ ffz.off('main_menu:update-unseen', this.updateUnseen, this);
+ ffz.off('addons:data-loaded', this.updateAddons, this);
+ },
+
mounted() {
let el;
document.head.appendChild(el = e('script', {
@@ -83,7 +248,54 @@ export default {
src: 'https://platform.twitter.com/widgets.js',
onLoad: () => el.remove()
}));
+ },
+ methods: {
+ updateUnseen() {
+ this.unseen = this.item.getUnseen();
+ },
+
+ updateAddons() {
+ const ffz = this.context.getFFZ(),
+ addon_module = ffz.resolve('addons'),
+ addons = addon_module?.addons;
+
+ const out = [],
+ new_out = [],
+ week_ago = Date.now() - (86400 * 7 * 1000);
+
+ if ( addons )
+ for(const [key, addon] of Object.entries(addons)) {
+ const enabled = addon_module.isAddonEnabled(key),
+ copy = {
+ key,
+ enabled,
+ icon: addon.icon,
+ name: addon.name,
+ name_i18n: addon.name_i18n,
+ updated: addon.updated,
+ settings: addon.settings,
+ version: addon.version
+ };
+
+ if ( addon.created && addon.created >= week_ago )
+ new_out.push(copy);
+
+ if ( addon.updated && addon.updated >= week_ago && enabled ) {
+ out.push(copy);
+ }
+ }
+
+ out.sort((a,b) => b.updated - a.updated);
+ new_out.sort((a,b) => b.created - a.created);
+
+ this.addons = out.length ? out : null;
+ this.new_addons = new_out.length ? new_out : null;
+ },
+
+ updateTheme() {
+ this.theme = this.context.context.get('theme.is-dark') ? 'dark' : 'light'
+ }
}
}
\ No newline at end of file
diff --git a/src/modules/main_menu/components/main-menu.vue b/src/modules/main_menu/components/main-menu.vue
index 3a26e258..22f54607 100644
--- a/src/modules/main_menu/components/main-menu.vue
+++ b/src/modules/main_menu/components/main-menu.vue
@@ -110,6 +110,7 @@
:context="context"
:item="currentItem"
:filter="filter"
+ :nav_keys="nav_keys"
@change-item="changeItem"
@mark-seen="markSeen"
@navigate="navigate"
diff --git a/src/modules/main_menu/components/menu-page.vue b/src/modules/main_menu/components/menu-page.vue
index 2b42dea2..13debc12 100644
--- a/src/modules/main_menu/components/menu-page.vue
+++ b/src/modules/main_menu/components/menu-page.vue
@@ -82,6 +82,7 @@
ref="children"
:context="context"
:item="i"
+ :nav_keys="nav_keys"
:filter="filter"
@change-item="changeItem"
@mark-seen="markSeen"
@@ -94,7 +95,7 @@