big menu display.': 'Denna funktion är endast kompatibel med
stor meny.'
-'The logo is a link to the default app': 'Logotypen är en länk till standardappen'
-'Others': 'Övriga'
-'Categories': 'Kategorier'
-'Customize sorting': 'Anpassa sortering'
-'Order by': 'Sortera efter'
-'Name': 'Namn'
-'Customed': 'Anpassad'
-'Show and hide the list of categories': 'Visa och dölj listan över kategorier'
-'This parameters are used when Dark theme or Breeze Dark Theme are enabled.': 'Dessa parametrar används när mörkt tema eller Breeze Dark Theme är aktiverade.'
-'Dark mode colors': 'Färger för mörkt läge'
-'With categories': 'Med kategorier'
-'Custom categories': 'Anpassade kategorier'
-'Customize application categories': 'Anpassa app kategorier'
-'Reset to default': 'Återställ till standardvärden'
-'Applications': 'Applikationer'
-'Applications kept in the top menu': 'Applikationer som hålls i toppmenyn'
-'Applications kept in the top menu but also shown in side menu': 'Applikationer som visas både i toppmenyn och i sidomenyn'
-'These applications must be selected in the previous option.': 'Dessa applikationer måste väljas i föregående alternativ.'
-'Hide labels on mouse over': 'Dölj etiketter när muspekaren är över'
-'Except the hovered app': 'Förutom den app som muspekaren är över'
-'Search': 'Sök'
-'Toggle the menu': 'Växla menyn'
-'Open the documentation': 'Öppna dokumentationen'
-'Ask the developer': 'Fråga utvecklaren'
-'New request': 'Ny förfrågan'
-'Report a bug': 'Rapportera ett fel'
-'Show the configuration': 'Visa konfigurationen'
-'Configuration:': 'Konfiguration:'
-'Done!': 'Klar!'
-'Copy': 'Kopiera'
-'Need help': 'Behöver hjälp'
-'I would like a new feature': 'Jag skulle vilja ha en ny funktion'
-'Something went wrong': 'Något gick fel'
-'Select apps': 'Välj appar'
-'Sort': 'Sortera'
-'Customize': 'Anpassa'
-'Custom': 'Anpassad'
-'Close': 'Stäng'
+'Custom menu': ''
+'Enable the custom menu': ''
+'No': ''
+'Yes': ''
+'Menu': ''
+'Use the shortcut Ctrl+o to open and to hide the side menu. Use tab key to navigate.': ''
+'Top menu': ''
+'Apps that not must be moved in the side menu': ''
+'If there is no selection then the global configuration is applied.': ''
+'Experimental': ''
+'Save': ''
+'You like this app and you want to support me?': ''
+'Buy me a coffee ☕': ''
+'Hidden': ''
+'Small': ''
+'Normal': ''
+'Big': ''
+'Hidden icon': ''
+'Small icon': ''
+'Normal icon': ''
+'Big icon': ''
+'Hidden text': ''
+'Small text': ''
+'Normal text': ''
+'Big text': ''
+'Colors': ''
+'Background color': ''
+'Background color of current app': ''
+'Text color': ''
+'Loader': ''
+'Icon': ''
+'Same color': ''
+'Opposite color': ''
+'Transparent': ''
+'Opaque': ''
+'Opener': ''
+'Default': ''
+'Default (dark)': ''
+'Hamburger': ''
+'Hamburger (dark)': ''
+'Hamburger 2': ''
+'Hamburger 2 (dark)': ''
+'Before the logo': ''
+'After the logo': ''
+'Position': ''
+'Show only the opener (hidden logo)': ''
+'Do not display the side menu and the opener if there is no application (eg: public pages).': ''
+'Panel': ''
+'Open the menu when the mouse is hover the opener (automatically disabled on touch screens)': ''
+'Display the big menu': ''
+'Display the logo': ''
+'Icons and texts': ''
+'Loader enabled': ''
+'Tips': ''
+'Always displayed': ''
+'This is the automatic behavior when the menu is always displayed.': ''
+'Not compatible with touch screens.': ''
+'Big menu': ''
+'Live preview': ''
+'Open apps in new tab': ''
+'Use the global setting': ''
+'Use my selection': ''
+'Show and hide the list of applications': ''
+'Use the avatar instead of the logo': ''
+'You do not have permission to change the settings.': ''
+'Force this configuration to users': ''
+'Export the configuration': ''
+'Purge the cache': ''
+'Show the link to settings': ''
+'The menu is enabled by default for users': ''
+'Except when the configuration is forced.': ''
+'Apps that should not be displayed in the menu': ''
+'This feature is only compatible with the
big menu display.': ''
+'The logo is a link to the default app': ''
+'Others': ''
+'Categories': ''
+'Customize sorting': ''
+'Order by': ''
+'Name': ''
+'Customed': ''
+'Show and hide the list of categories': ''
+'This parameters are used when Dark theme or Breeze Dark Theme are enabled.': ''
+'Dark mode colors': ''
+'With categories': ''
+'Custom categories': ''
+'Customize application categories': ''
+'Reset to default': ''
+'Applications': ''
+'Applications kept in the top menu': ''
+'Applications kept in the top menu but also shown in side menu': ''
+'These applications must be selected in the previous option.': ''
+'Hide labels on mouse over': ''
+'Except the hovered app': ''
+'Search': ''
+'Toggle the menu': ''
+'Open the documentation': ''
+'Ask the developer': ''
+'New request': ''
+'Report a bug': ''
+'Show the configuration': ''
+'Configuration:': ''
+'Done!': ''
+'Copy': ''
+'Need help': ''
+'I would like a new feature': ''
+'Something went wrong': ''
+'Select apps': ''
+'Sort': ''
+'Customize': ''
+'Custom': ''
+'Close': ''
diff --git a/src/menus/StandardMenu.vue b/src/menus/StandardMenu.vue
index 5e817ee..81b9ff9 100644
--- a/src/menus/StandardMenu.vue
+++ b/src/menus/StandardMenu.vue
@@ -33,7 +33,7 @@ along with this program. If not, see
.
:data-app-id="app.id"
class="app-menu-entry"
:class="{
- 'app-menu-entry__active': app.active,
+ 'app-menu-entry__active': app.id === activeApp,
'app-menu-entry__hidden-label': hiddenLabels === 1,
'app-menu-main__show-hovered': hiddenLabels === 2,
}"
@@ -44,7 +44,7 @@ along with this program. If not, see
.
:class="{ 'has-unread': app.unread > 0 }"
:aria-label="app.name"
:target="targetBlankApps.indexOf(app.id) !== -1 ? '_blank' : undefined"
- :aria-current="app.active ? 'page' : false"
+ :aria-current="app.id === activeApp ? 'page' : false"
>
![]()
.
v-for="app in popoverAppList"
:key="app.id"
:aria-label="app.name"
- :aria-current="app.active ? 'page' : false"
+ :aria-current="app.id === activeApp ? 'page' : false"
:href="app.href"
:style="makeStyle(app)"
class="cm-standardmenu-app-menu-popover-entry app-menu-popover-entry"
@@ -101,6 +101,7 @@ import { ref, onMounted } from 'vue'
import { useConfigStore } from '../store/config.js'
import { useNavStore } from '../store/nav.js'
import { NcActions, NcActionLink } from '@nextcloud/vue'
+import { getActiveAppId } from '../lib/app.js'
const navStore = useNavStore()
const configStore = useConfigStore()
@@ -112,6 +113,7 @@ const topMenuApps = ref([])
const appsOrder = ref([])
const mainAppList = ref([])
const popoverAppList = ref([])
+const activeApp = ref(null)
let resizeTimeout = null
const setApps = (value) => {
@@ -142,7 +144,7 @@ const appLimit = () => {
})
}
- return Math.floor((body.offsetWidth - size) / 70)
+ return Math.max(0, Math.floor((body.offsetWidth - size) / 70))
}
const makeStyle = (app) => {
@@ -158,6 +160,11 @@ const computeLists = () => {
popoverAppList.value = appList.value.slice(appLimit()).sort((a, b) => a.order - b.order)
}
+const reComputeLists = (delay) => {
+ window.clearTimeout(resizeTimeout)
+ resizeTimeout = window.setTimeout(computeLists, delay || 100)
+}
+
onMounted(async () => {
const config = await configStore.getConfig()
@@ -165,14 +172,12 @@ onMounted(async () => {
hiddenLabels.value = config['top-menu-mouse-over-hidden-label']
topMenuApps.value = config['top-menu-apps']
appsOrder.value = config['apps-order']
+ activeApp.value = getActiveAppId()
ready.value = true
setApps(await navStore.getCoreApps())
- window.addEventListener('resize', () => {
- window.clearTimeout(resizeTimeout)
- resizeTimeout = window.setTimeout(computeLists, 100)
- })
+ window.addEventListener('resize', reComputeLists)
})
diff --git a/src/store/nav.js b/src/store/nav.js
index 03a128e..98abe0d 100644
--- a/src/store/nav.js
+++ b/src/store/nav.js
@@ -41,10 +41,7 @@ export const useNavStore = defineStore('nav', () => {
async function getCoreApps() {
if (coreApps == null) {
- coreApps = await axios
- .get(generateOcsUrl('core/navigation', 2) + '/apps?format=json')
- .then((response) => response.data)
- .then((value) => value.ocs.data)
+ coreApps = await await axios.get(generateUrl('/apps/side_menu/core/apps')).then((response) => response.data.items)
}
return coreApps
diff --git a/webpack.config.js b/webpack.config.js
index d9876e8..0c16d61 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -77,6 +77,10 @@ module.exports = {
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
+
+ new webpack.DefinePlugin({
+ appName: JSON.stringify(appName),
+ }),
],
resolve: {