big menu display.': "Compatible avec l'affichage
Menu large."
-'The logo is a link to the default app': "Le logo est un lien vers l'application par défaut"
+'Apps that should not be displayed in the menu': 'Applications qui ne doivent pas
+ être affichées dans le menu'
+'This feature is only compatible with the
big menu display.': "Compatible
+ avec l'affichage
Menu large."
+'The logo is a link to the default app': "Le logo est un lien vers l'application par
+ défaut"
'Others': 'Autres'
'Categories': 'Catégories'
'Customize sorting': 'Personnaliser le tri'
@@ -79,7 +94,8 @@
'Name': 'Nom'
'Customed': 'Personnalisé'
'Show and hide the list of categories': 'Afficher et masquer la liste des catégories'
-'This parameters are used when Dark theme or Breeze Dark Theme are enabled.': 'Ces paramètres sont utilisés lorsque le thème sombre ou le thème Breeze Dark sont activés.'
+'This parameters are used when Dark theme or Breeze Dark Theme are enabled.': 'Ces
+ paramètres sont utilisés lorsque le thème sombre ou le thème Breeze Dark sont activés.'
'Dark mode colors': 'Couleurs du mode sombre'
'With categories': 'Avec les catégories'
'Custom categories': 'Catégories personnalisées'
@@ -87,9 +103,12 @@
'Reset to default': 'Restaurer les valeurs par défaut'
'Applications': 'Applications'
'Applications kept in the top menu': 'Applications conservées dans le menu supérieur'
-'Applications kept in the top menu but also shown in side menu': 'Applications conservées dans le menu supérieur mais également affichées dans le menu latéral'
-'These applications must be selected in the previous option.': "Ces applications doivent également être sélectionnées dans l'option précédente."
-'Hide labels on mouse over': 'Masquer le libellé des applications au passage de la souris'
+'Applications kept in the top menu but also shown in side menu': 'Applications conservées
+ dans le menu supérieur mais également affichées dans le menu latéral'
+'These applications must be selected in the previous option.': "Ces applications doivent
+ également être sélectionnées dans l'option précédente."
+'Hide labels on mouse over': 'Masquer le libellé des applications au passage de la
+ souris'
'Except the hovered app': "À l'exception de l'application survolée"
'Search': 'Rechercher'
'Toggle the menu': 'Basculer le menu'
diff --git a/src/l10n/fixtures/ru.yaml b/src/l10n/fixtures/ru.yaml
index e23aa0b..e4a6997 100644
--- a/src/l10n/fixtures/ru.yaml
+++ b/src/l10n/fixtures/ru.yaml
@@ -43,8 +43,8 @@
'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).': 'Не отображать боковое меню и открывалку, если нет приложения (например, публичные страницы).'
+'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': 'Отобразить большое меню'
@@ -63,21 +63,21 @@
'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': 'Принудительно предоставить эту конфигурацию пользователям'
+'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.': 'За исключением случаев, когда конфигурация является принудительной.'
+'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.': 'Эта функция совместима только с отображением
большого меню.'
+'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': 'Customed'
+'Customed': 'Приспособлено'
'Show and hide the list of categories': 'Показать или скрыть список категорий'
'This parameters are used when Dark theme or Breeze Dark Theme are enabled.': 'Эти настройки используются темами Тёмная и Тёмная Breeze.'
'Dark mode colors': 'Цвета тёмной темы'
@@ -90,22 +90,22 @@
'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': 'Кроме приложения, на котором курсор'
+'Except the hovered app': 'Кроме приложения на котором сейчас'
'Search': 'Поиск'
'Toggle the menu': 'Переключить меню'
'Open the documentation': 'Open the documentation'
-'Ask the developer': 'Ask the developer'
-'New request': 'New request'
-'Report a bug': 'Report a bug'
-'Show the configuration': 'Show the configuration'
+'Ask the developer': 'Спросить разработчика'
+'New request': 'Новый запрос'
+'Report a bug': 'Пожаловаться на ошибку'
+'Show the configuration': 'Показать конфигурацию'
'Configuration:': 'Configuration:'
-'Done!': 'Done!'
-'Copy': 'Copy'
-'Need help': 'Need help'
-'I would like a new feature': 'I would like a new feature'
-'Something went wrong': 'Something went wrong'
-'Select apps': 'Select apps'
-'Sort': 'Sort'
-'Customize': 'Customize'
+'Done!': 'Готово!'
+'Copy': 'Копировать'
+'Need help': 'Нужна помощь'
+'I would like a new feature': 'Я хочу новую возможность'
+'Something went wrong': 'Что-то пошло не так'
+'Select apps': 'Выберете приложения'
+'Sort': 'Сортировать'
+'Customize': 'Приспособить'
'Custom': 'Custom'
-'Close': 'Close'
+'Close': 'Закрыть'
diff --git a/src/l10n/fixtures/sk.yaml b/src/l10n/fixtures/sk.yaml
index aa9d09c..2849008 100644
--- a/src/l10n/fixtures/sk.yaml
+++ b/src/l10n/fixtures/sk.yaml
@@ -90,7 +90,7 @@
'Applications kept in the top menu but also shown in side menu': 'Applications kept in the top menu but also shown in side menu'
'These applications must be selected in the previous option.': 'These applications must be selected in the previous option.'
'Hide labels on mouse over': 'Hide labels on mouse over'
-'Toggle the menu': 'Toggle the menu'
+'Toggle the menu': 'Prepnite ponuku'
'Open the documentation': 'Open the documentation'
'Ask the developer': 'Ask the developer'
'New request': 'New request'
diff --git a/src/l10n/fixtures/sv.yaml b/src/l10n/fixtures/sv.yaml
new file mode 100644
index 0000000..fe37f9a
--- /dev/null
+++ b/src/l10n/fixtures/sv.yaml
@@ -0,0 +1,111 @@
+'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/l10n/fixtures/zh_CN.yaml b/src/l10n/fixtures/zh_CN.yaml
index b6a1cb1..58bf8ab 100644
--- a/src/l10n/fixtures/zh_CN.yaml
+++ b/src/l10n/fixtures/zh_CN.yaml
@@ -1,9 +1,9 @@
'Custom menu': '自定义菜单'
'Enable the custom menu': '启用自定义菜单'
-'No': '取消'
-'Yes': '确定'
+'No': '否'
+'Yes': '是'
'Menu': '菜单'
-'Use the shortcut Ctrl+o to open and to hide the side menu. Use
tab to navigate.': '使用快捷键 Ctrl+o 打开或隐藏侧边栏菜单。使用
tab 来导航。'
+'Use the shortcut Ctrl+o to open and to hide the side menu. Use
tab to navigate.': '使用快捷键 Ctrl+o 打开或隐藏侧边栏菜单。使用
Tab 键来导航。'
'Top menu': '顶部菜单'
'Apps that not must be moved in the side menu': '禁止在侧边栏菜单移动的应用'
'If there is no selection then the global configuration is applied.': '如果没有选择,则应用全局配置。'
@@ -25,7 +25,7 @@
'Opposite color': '相反颜色'
'Transparent': '透明'
'Opaque': '不透明'
-'Opener': '容器'
+'Opener': '触发器'
'Default': '默认'
'Default (dark)': '默认(深色)'
'Hamburger': 'Hamburger'
@@ -35,10 +35,10 @@
'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).': '如果没有应用程序(例如:公共页面),则不要显示侧边栏菜单和容器。'
+'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)': '鼠标悬停时打开菜单 (触摸屏时将自动禁用)'
+'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': '图标和文本'
@@ -63,7 +63,7 @@
'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': 'logo链接到默认应用'
+'The logo is a link to the default app': '徽标链接到默认应用'
'Others': '其他'
'Categories': '类别'
'Customize sorting': '自定义排序'
@@ -85,27 +85,27 @@
'Small text': '小文本'
'Normal text': '普通文本'
'Big text': '大文本'
-'Applications': 'Applications'
-'Applications kept in the top menu': 'Applications kept in the top menu'
-'Applications kept in the top menu but also shown in side menu': 'Applications kept in the top menu but also shown in side menu'
-'These applications must be selected in the previous option.': 'These applications must be selected in the previous option.'
-'Hide labels on mouse over': 'Hide labels on mouse over'
-'Except the hovered app': 'Except the hovered app'
-'Search': 'Search'
-'Toggle menu': 'Toggle menu'
-'Open the documentation': 'Open the documentation'
-'Ask the developer': 'Ask the developer'
-'New request': 'New request'
-'Report a bug': 'Report a bug'
-'Show the configuration': 'Show the configuration'
-'Configuration:': 'Configuration:'
-'Done!': 'Done!'
-'Copy': 'Copy'
-'Need help': 'Need help'
-'I would like a new feature': 'I would like a new feature'
-'Something went wrong': 'Something went wrong'
-'Select apps': 'Select apps'
-'Sort': 'Sort'
-'Customize': 'Customize'
-'Custom': 'Custom'
-'Close': 'Close'
+'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 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: {