Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7a8a41f6e | |||
| c2c6399106 | |||
| f4833d1956 | |||
| 9eab478c36 | |||
| c1588dfc2e | |||
| c24bb6f8c8 | |||
| ca689d8b6f | |||
| e81f0e4b76 | |||
| 7033569bed | |||
| a9788f0ab8 | |||
| 1a8063bd94 | |||
| cc841570ec | |||
| d6a2da402c | |||
| fef11cd0cf | |||
| 12b35470c7 | |||
| 23cb8fcfc1 | |||
| 2b4da9cfce | |||
| f2af45711d | |||
| 35afa38f73 | |||
| ad162f5821 | |||
| d3f87adcca | |||
| b32e4ded42 | |||
| 88e54e01b6 | |||
| ce01983f1c | |||
| 6ee79a3110 | |||
| a32bf417a7 | |||
| 337e1a07e3 | |||
| fccfe1341a | |||
| 242569316f | |||
| 78888460fc | |||
| 4d453676dc | |||
| f49b30b20e | |||
| 0067b4e1c8 | |||
| 77cf610c8b | |||
| 5cd106640c | |||
| d057cd7665 | |||
| 520225603b | |||
| c2ecc5bf98 | |||
| 8cca320a43 | |||
| 19aaf0759b | |||
| 47a83f10cc | |||
| e1a191121d | |||
| 54f4dce09b | |||
| c0aaa206ed | |||
| 0124336558 | |||
| 5ccb56309a | |||
| 0cb14258ad | |||
| 7d26be253a | |||
| 0437019bb0 | |||
| 7e7397735b | |||
| be68f2ef55 | |||
| ccfb541404 | |||
| f4e35bdc5d | |||
| 1bf9cee8d6 |
+524
-133
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,7 @@ If you want to install it from source, go to https://gitnet.fr/deblan/side_menu/
|
|||||||
|
|
||||||
```
|
```
|
||||||
$ cd /path/to/nextcloud/apps
|
$ cd /path/to/nextcloud/apps
|
||||||
$ VERSION=x.y.z; curl -sS https://gitnet.fr/deblan/side_menu/releases/download/v${VERSION}/side_menu_v${VERSION}.tar.gz | tar xvfz -
|
$ VERSION=x.y.z; curl -sS "https://gitnet.fr/deblan/side_menu/releases/download/${VERSION}/side_menu_v${VERSION}.tar.gz" | tar xvfz -
|
||||||
```
|
```
|
||||||
|
|
||||||
Administrators can edit many settings using the administration page.
|
Administrators can edit many settings using the administration page.
|
||||||
|
|||||||
+3
-3
@@ -30,7 +30,7 @@ Notice
|
|||||||
Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**.
|
Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**.
|
||||||
In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/).
|
In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/).
|
||||||
]]></description>
|
]]></description>
|
||||||
<version>5.1.3</version>
|
<version>6.0.1</version>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author mail="contact@deblan.fr" homepage="https://www.deblan.fr/">Simon Vieille</author>
|
<author mail="contact@deblan.fr" homepage="https://www.deblan.fr/">Simon Vieille</author>
|
||||||
<namespace>SideMenu</namespace>
|
<namespace>SideMenu</namespace>
|
||||||
@@ -52,8 +52,8 @@ In case of downtime, you can download **Custom Menu** from [here](https://kim.de
|
|||||||
<screenshot><![CDATA[https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc25_big_menu.png]]></screenshot>
|
<screenshot><![CDATA[https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc25_big_menu.png]]></screenshot>
|
||||||
<screenshot><![CDATA[https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc25_default_menu.png]]></screenshot>
|
<screenshot><![CDATA[https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc25_default_menu.png]]></screenshot>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<php min-version="8.1" max-version="8.4" />
|
<php min-version="8.1" max-version="8.5" />
|
||||||
<nextcloud min-version="31" max-version="32"/>
|
<nextcloud min-version="34" max-version="34"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<settings>
|
<settings>
|
||||||
<admin>OCA\SideMenu\Settings\Admin</admin>
|
<admin>OCA\SideMenu\Settings\Admin</admin>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use OC\AllConfig;
|
|||||||
use OC\App\AppStore\Fetcher\CategoryFetcher;
|
use OC\App\AppStore\Fetcher\CategoryFetcher;
|
||||||
use OC\AppFramework\Http\Request;
|
use OC\AppFramework\Http\Request;
|
||||||
use OC\Security\CSP\ContentSecurityPolicyNonceManager;
|
use OC\Security\CSP\ContentSecurityPolicyNonceManager;
|
||||||
|
use OC\Security\CSRF\CsrfTokenManager;
|
||||||
use OC\User\User;
|
use OC\User\User;
|
||||||
use OCA\SideMenu\Service\AppRepository;
|
use OCA\SideMenu\Service\AppRepository;
|
||||||
use OCA\SideMenu\Service\CategoryRepository;
|
use OCA\SideMenu\Service\CategoryRepository;
|
||||||
@@ -19,8 +20,11 @@ use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
|||||||
use OCP\EventDispatcher\IEventDispatcher;
|
use OCP\EventDispatcher\IEventDispatcher;
|
||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
use OCP\INavigationManager;
|
use OCP\INavigationManager;
|
||||||
|
use OCP\IRequest;
|
||||||
|
use OCP\IURLGenerator;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use OCP\L10N\IFactory;
|
use OCP\L10N\IFactory;
|
||||||
|
use OCP\Server;
|
||||||
use OCP\Util;
|
use OCP\Util;
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
@@ -34,9 +38,9 @@ class Application extends App implements IBootstrap
|
|||||||
public const APP_ID = 'side_menu';
|
public const APP_ID = 'side_menu';
|
||||||
public const APP_NAME = 'Custom menu';
|
public const APP_NAME = 'Custom menu';
|
||||||
|
|
||||||
protected AllConfig $config;
|
protected IConfig $config;
|
||||||
protected ContentSecurityPolicyNonceManager $cspnm;
|
protected ContentSecurityPolicyNonceManager $cspnm;
|
||||||
protected Request $request;
|
protected IRequest $request;
|
||||||
protected ?User $user = null;
|
protected ?User $user = null;
|
||||||
|
|
||||||
public function __construct(array $urlParams = [])
|
public function __construct(array $urlParams = [])
|
||||||
@@ -83,10 +87,9 @@ class Application extends App implements IBootstrap
|
|||||||
|
|
||||||
public function boot(IBootContext $context): void
|
public function boot(IBootContext $context): void
|
||||||
{
|
{
|
||||||
$this->config = \OC::$server->getConfig();
|
$this->config = Server::get(IConfig::class);
|
||||||
$this->cspnm = \OC::$server->getContentSecurityPolicyNonceManager();
|
$this->user = Server::get(IUserSession::class)->getUser();
|
||||||
$this->user = \OC::$server[IUserSession::class]->getUser();
|
$this->request = Server::get(IRequest::class);
|
||||||
$this->request = \OC::$server->getRequest();
|
|
||||||
|
|
||||||
if (!$this->isEnabled()) {
|
if (!$this->isEnabled()) {
|
||||||
return;
|
return;
|
||||||
@@ -138,7 +141,7 @@ class Application extends App implements IBootstrap
|
|||||||
$cache = $this->config->getAppValue(self::APP_ID, 'cache', '0');
|
$cache = $this->config->getAppValue(self::APP_ID, 'cache', '0');
|
||||||
|
|
||||||
foreach ($assets as $value) {
|
foreach ($assets as $value) {
|
||||||
$route = \OC::$server->getURLGenerator()->linkToRoute(
|
$route = Server::get(IURLGenerator::class)->linkToRoute(
|
||||||
$value['route'],
|
$value['route'],
|
||||||
['v' => $cache]
|
['v' => $cache]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ class AdminSettingController extends Controller
|
|||||||
'use-avatar',
|
'use-avatar',
|
||||||
'add-logo-link',
|
'add-logo-link',
|
||||||
'show-settings',
|
'show-settings',
|
||||||
|
'show-search-form',
|
||||||
'loader-enabled',
|
'loader-enabled',
|
||||||
'always-displayed',
|
'always-displayed',
|
||||||
'enabled',
|
'enabled',
|
||||||
@@ -137,6 +138,7 @@ class AdminSettingController extends Controller
|
|||||||
'use-avatar' => '0',
|
'use-avatar' => '0',
|
||||||
'add-logo-link' => '1',
|
'add-logo-link' => '1',
|
||||||
'show-settings' => '0',
|
'show-settings' => '0',
|
||||||
|
'show-search-form' => '1',
|
||||||
'loader-enabled' => '1',
|
'loader-enabled' => '1',
|
||||||
'always-displayed' => '0',
|
'always-displayed' => '0',
|
||||||
'enabled' => '1',
|
'enabled' => '1',
|
||||||
@@ -206,7 +208,17 @@ class AdminSettingController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($defaults as $key => $default) {
|
foreach ($defaults as $key => $default) {
|
||||||
if (!array_key_exists($key, $config)) {
|
if (array_key_exists($key, $config)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in_array($key, $booleans)) {
|
||||||
|
$config[$key] = $default === '1';
|
||||||
|
} elseif (in_array($key, $arrays)) {
|
||||||
|
$config[$key] = json_decode($default);
|
||||||
|
} elseif (in_array($key, $integers)) {
|
||||||
|
$config[$key] = (int) $default;
|
||||||
|
} else {
|
||||||
$config[$key] = $default;
|
$config[$key] = $default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ class JsController extends Controller
|
|||||||
'force-light-icon' => $this->config->getAppValueBool('force-light-icon', '0'),
|
'force-light-icon' => $this->config->getAppValueBool('force-light-icon', '0'),
|
||||||
'display-logo' => $this->config->getAppValueBool('display-logo', '1'),
|
'display-logo' => $this->config->getAppValueBool('display-logo', '1'),
|
||||||
'use-avatar' => $this->config->getAppValueBool('use-avatar', '0'),
|
'use-avatar' => $this->config->getAppValueBool('use-avatar', '0'),
|
||||||
|
'show-search-form' => $this->config->getAppValueBool('show-search-form', '1'),
|
||||||
'hide-when-no-apps' => $this->config->getAppValueBool('hide-when-no-apps', '0'),
|
'hide-when-no-apps' => $this->config->getAppValueBool('hide-when-no-apps', '0'),
|
||||||
'loader-enabled' => $this->config->getAppValueBool('loader-enabled', '1'),
|
'loader-enabled' => $this->config->getAppValueBool('loader-enabled', '1'),
|
||||||
'always-displayed' => $this->config->getAppValueBool('always-displayed', '0'),
|
'always-displayed' => $this->config->getAppValueBool('always-displayed', '0'),
|
||||||
|
|||||||
@@ -30,7 +30,12 @@ class LangRepository
|
|||||||
->from('preferences')
|
->from('preferences')
|
||||||
;
|
;
|
||||||
|
|
||||||
$stmt = $qb->execute();
|
// Nextcloud >=33+
|
||||||
|
if (method_exists($qb, 'executeQuery')) {
|
||||||
|
$stmt = $qb->executeQuery();
|
||||||
|
} else {
|
||||||
|
$stmt = $qb->execute();
|
||||||
|
}
|
||||||
|
|
||||||
$langs = ['en'];
|
$langs = ['en'];
|
||||||
|
|
||||||
|
|||||||
Generated
+1583
-416
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -11,8 +11,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": ">=7.12.0 <8.0.0",
|
"@babel/core": ">=7.12.0 <8.0.0",
|
||||||
|
"@formatjs/intl-segmenter": "^12.0.8",
|
||||||
"@nextcloud/router": "^3.0.1",
|
"@nextcloud/router": "^3.0.1",
|
||||||
"@nextcloud/vue": "^9.0.0-alpha.8",
|
"@nextcloud/vue": "^9.9.0",
|
||||||
"node-polyfill-webpack-plugin": "^4.1.0",
|
"node-polyfill-webpack-plugin": "^4.1.0",
|
||||||
"pinia": "^3.0.1",
|
"pinia": "^3.0.1",
|
||||||
"postcss": "^7.0.0 || ^8.0.1",
|
"postcss": "^7.0.0 || ^8.0.1",
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
import './scss/admin.scss'
|
import './scss/admin.scss'
|
||||||
|
|
||||||
|
import '@formatjs/intl-segmenter/polyfill.js'
|
||||||
|
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
import { waitContainer } from './lib/dom.js'
|
import { waitContainer } from './lib/dom.js'
|
||||||
|
|||||||
@@ -73,10 +73,10 @@ const save = async () => {
|
|||||||
if (Array.isArray(value) || typeof value === 'object') {
|
if (Array.isArray(value) || typeof value === 'object') {
|
||||||
value = JSON.stringify(value)
|
value = JSON.stringify(value)
|
||||||
} else if (typeof value === 'boolean') {
|
} else if (typeof value === 'boolean') {
|
||||||
value = value ? 1 : 0
|
value = value ? '1' : '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
OCP.AppConfig.setValue('side_menu', key, value, {
|
OCP.AppConfig.setValue('side_menu', key, value.toString(), {
|
||||||
success() {
|
success() {
|
||||||
update()
|
update()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -69,11 +69,11 @@ const save = async () => {
|
|||||||
if (Array.isArray(value) || typeof value === 'object') {
|
if (Array.isArray(value) || typeof value === 'object') {
|
||||||
value = JSON.stringify(value)
|
value = JSON.stringify(value)
|
||||||
} else if (typeof value === 'boolean') {
|
} else if (typeof value === 'boolean') {
|
||||||
value = value ? 1 : 0
|
value = value ? '1' : '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
formData.push('name=' + encodeURIComponent(key))
|
formData.push('name=' + encodeURIComponent(key))
|
||||||
formData.push('value=' + encodeURIComponent(value))
|
formData.push('value=' + encodeURIComponent(value.toString()))
|
||||||
|
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Přizpůsobit'
|
'Customize': 'Přizpůsobit'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Zavřít'
|
'Close': 'Zavřít'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Customize'
|
'Customize': 'Customize'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Close'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
+14
-13
@@ -94,18 +94,19 @@
|
|||||||
'Search': 'Buscar'
|
'Search': 'Buscar'
|
||||||
'Toggle the menu': 'Alternar el menú'
|
'Toggle the menu': 'Alternar el menú'
|
||||||
'Open the documentation': 'Open the documentation'
|
'Open the documentation': 'Open the documentation'
|
||||||
'Ask the developer': 'Ask the developer'
|
'Ask the developer': 'Pregúntale al desarrollador'
|
||||||
'New request': 'New request'
|
'New request': 'Nueva solicitud'
|
||||||
'Report a bug': 'Report a bug'
|
'Report a bug': 'Informar de un fallo'
|
||||||
'Show the configuration': 'Show the configuration'
|
'Show the configuration': 'Mostrar los ajustes'
|
||||||
'Configuration:': 'Configuration:'
|
'Configuration:': 'Configuration:'
|
||||||
'Done!': 'Done!'
|
'Done!': '¡Realizado!'
|
||||||
'Copy': 'Copy'
|
'Copy': 'Copiar'
|
||||||
'Need help': 'Need help'
|
'Need help': 'Ayudame'
|
||||||
'I would like a new feature': 'I would like a new feature'
|
'I would like a new feature': 'Me gustaría una nueva función'
|
||||||
'Something went wrong': 'Something went wrong'
|
'Something went wrong': 'Algo salió mal'
|
||||||
'Select apps': 'Select apps'
|
'Select apps': 'Selecciona las aplicaciones'
|
||||||
'Sort': 'Sort'
|
'Sort': 'Ordenar'
|
||||||
'Customize': 'Customize'
|
'Customize': 'Personalizar'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Cerrar'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -128,3 +128,4 @@
|
|||||||
'Customize': 'Personnaliser'
|
'Customize': 'Personnaliser'
|
||||||
'Custom': 'Personnalisé'
|
'Custom': 'Personnalisé'
|
||||||
'Close': 'Fermer'
|
'Close': 'Fermer'
|
||||||
|
'Show the search form': 'Afficher le formulaire de recherche'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Personalizar'
|
'Customize': 'Personalizar'
|
||||||
'Custom': 'Personalizado'
|
'Custom': 'Personalizado'
|
||||||
'Close': 'Pechar'
|
'Close': 'Pechar'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Customize'
|
'Customize': 'Customize'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Close'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -107,3 +107,4 @@
|
|||||||
'Customize': 'Customize'
|
'Customize': 'Customize'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Close'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Приспособить'
|
'Customize': 'Приспособить'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Закрыть'
|
'Close': 'Закрыть'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -107,3 +107,4 @@
|
|||||||
'Customize': 'Customize'
|
'Customize': 'Customize'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Close'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Anpassa'
|
'Customize': 'Anpassa'
|
||||||
'Custom': 'Anpassad'
|
'Custom': 'Anpassad'
|
||||||
'Close': 'Stäng'
|
'Close': 'Stäng'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Customize'
|
'Customize': 'Customize'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Close'
|
'Close': 'Close'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
'Show only the opener (hidden logo)': '仅显示触发器(隐藏徽标)'
|
'Show only the opener (hidden logo)': '仅显示触发器(隐藏徽标)'
|
||||||
'Do not display the side menu and the opener if there is no application (eg: public pages).': '如果没有应用程序(例如:公共页面),则不要显示侧边栏菜单和触发器。'
|
'Do not display the side menu and the opener if there is no application (eg: public pages).': '如果没有应用程序(例如:公共页面),则不要显示侧边栏菜单和触发器。'
|
||||||
'Panel': '面板'
|
'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 big menu': '显示大型菜单'
|
||||||
'Display the logo': '显示徽标'
|
'Display the logo': '显示徽标'
|
||||||
'Icons and texts': '图标和文本'
|
'Icons and texts': '图标和文本'
|
||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': '自定义'
|
'Customize': '自定义'
|
||||||
'Custom': '自定义'
|
'Custom': '自定义'
|
||||||
'Close': '关闭'
|
'Close': '关闭'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
import './scss/menu.scss'
|
import './scss/menu.scss'
|
||||||
|
|
||||||
|
import '@formatjs/intl-segmenter/polyfill.js'
|
||||||
|
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
import { createElement, waitContainer } from './lib/dom.js'
|
import { createElement, waitContainer } from './lib/dom.js'
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
:label="settings.name"
|
:label="settings.name"
|
||||||
:avatar="settings.avatar"
|
:avatar="settings.avatar"
|
||||||
/>
|
/>
|
||||||
<AppSearch v-model="search" />
|
<AppSearch v-if="showSearchForm" v-model="search" />
|
||||||
<OpenerButton
|
<OpenerButton
|
||||||
v-if="!openerHover"
|
v-if="!openerHover"
|
||||||
@click="$emit('close')"
|
@click="$emit('close')"
|
||||||
@@ -102,6 +102,7 @@ const activeApp = ref(null)
|
|||||||
const targetBlankApps = ref([])
|
const targetBlankApps = ref([])
|
||||||
const settings = ref(null)
|
const settings = ref(null)
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
|
const showSearchForm = ref(true)
|
||||||
const openerHover = ref(false)
|
const openerHover = ref(false)
|
||||||
const menu = useTemplateRef('menu')
|
const menu = useTemplateRef('menu')
|
||||||
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
||||||
@@ -120,6 +121,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
targetBlankApps.value = config['target-blank-apps']
|
targetBlankApps.value = config['target-blank-apps']
|
||||||
settings.value = config['settings']
|
settings.value = config['settings']
|
||||||
|
showSearchForm.value = config['show-search-form']
|
||||||
openerHover.value = config['opener-hover'] && !isTouchDevice
|
openerHover.value = config['opener-hover'] && !isTouchDevice
|
||||||
|
|
||||||
items.value = await navStore.getCategories()
|
items.value = await navStore.getCategories()
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
:avatar="settings.avatar"
|
:avatar="settings.avatar"
|
||||||
/>
|
/>
|
||||||
<AppSearch
|
<AppSearch
|
||||||
v-if="open"
|
v-if="showSearchForm"
|
||||||
v-model="search"
|
v-model="search"
|
||||||
/>
|
/>
|
||||||
<OpenerButton
|
<OpenerButton
|
||||||
@@ -103,6 +103,7 @@ const openerHover = ref(false)
|
|||||||
const alwaysDisplayed = ref(false)
|
const alwaysDisplayed = ref(false)
|
||||||
const displayLogo = ref(false)
|
const displayLogo = ref(false)
|
||||||
const useAvatarAsLogo = ref(false)
|
const useAvatarAsLogo = ref(false)
|
||||||
|
const showSearchForm = ref(true)
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
const apps = ref([])
|
const apps = ref([])
|
||||||
const menu = useTemplateRef('menu')
|
const menu = useTemplateRef('menu')
|
||||||
@@ -151,6 +152,7 @@ onMounted(async () => {
|
|||||||
alwaysDisplayed.value = config['always-displayed']
|
alwaysDisplayed.value = config['always-displayed']
|
||||||
targetBlankApps.value = config['target-blank-apps']
|
targetBlankApps.value = config['target-blank-apps']
|
||||||
forceLightIcon.value = config['force-light-icon']
|
forceLightIcon.value = config['force-light-icon']
|
||||||
|
showSearchForm.value = config['show-search-form']
|
||||||
|
|
||||||
avatar.value = config['avatar']
|
avatar.value = config['avatar']
|
||||||
logo.value = config['logo']
|
logo.value = config['logo']
|
||||||
|
|||||||
+17
-12
@@ -62,8 +62,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<NcActions
|
<NcActions
|
||||||
class="cm-standardmenu-app-menu-more app-menu-more"
|
class="cm-standardmenu-app-menu-more"
|
||||||
:aria-label="t('core', 'More apps')"
|
:aria-label="t('core', 'More apps')"
|
||||||
|
:forceMenu="true"
|
||||||
>
|
>
|
||||||
<NcActionLink
|
<NcActionLink
|
||||||
v-for="app in popoverAppList"
|
v-for="app in popoverAppList"
|
||||||
@@ -132,19 +133,27 @@ const setApps = (value) => {
|
|||||||
const appLimit = () => {
|
const appLimit = () => {
|
||||||
const headerStart = document.querySelector('#header .header-start')
|
const headerStart = document.querySelector('#header .header-start')
|
||||||
const headerEnd = document.querySelector('#header .header-end')
|
const headerEnd = document.querySelector('#header .header-end')
|
||||||
|
const unifiedSearch = document.querySelector('#header .unified-search-input')
|
||||||
const body = document.querySelector('body')
|
const body = document.querySelector('body')
|
||||||
|
|
||||||
let size = (headerEnd ? headerEnd.offsetWidth : 0) + 70
|
let totalWidth = body.offsetWidth
|
||||||
|
let otherElementsWidth = headerEnd ? headerEnd.offsetWidth : 0
|
||||||
|
|
||||||
|
if (unifiedSearch && headerEnd.offsetWidth < unifiedSearch.offsetWidth) {
|
||||||
|
otherElementsWidth += unifiedSearch.offsetWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
let maxWidth = body.offsetWidth - otherElementsWidth
|
||||||
|
|
||||||
if (headerStart) {
|
if (headerStart) {
|
||||||
Array.from(headerStart.children).forEach((child) => {
|
Array.from(headerStart.children).forEach((child) => {
|
||||||
if (child.id !== 'app-menu-container') {
|
if (child.id !== 'app-menu-container') {
|
||||||
size += child.offsetWidth
|
maxWidth -= child.offsetWidth
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return Math.max(0, Math.floor((body.offsetWidth - size) / 70))
|
return Math.max(0, Math.floor(maxWidth / 60))
|
||||||
}
|
}
|
||||||
|
|
||||||
const makeStyle = (app) => {
|
const makeStyle = (app) => {
|
||||||
@@ -156,13 +165,9 @@ const makeStyle = (app) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const computeLists = () => {
|
const computeLists = () => {
|
||||||
mainAppList.value = appList.value.slice(0, appLimit())
|
const limit = appLimit()
|
||||||
popoverAppList.value = appList.value.slice(appLimit()).sort((a, b) => a.order - b.order)
|
mainAppList.value = appList.value.slice(0, limit)
|
||||||
}
|
popoverAppList.value = appList.value.slice(limit).sort((a, b) => a.order - b.order)
|
||||||
|
|
||||||
const reComputeLists = (delay) => {
|
|
||||||
window.clearTimeout(resizeTimeout)
|
|
||||||
resizeTimeout = window.setTimeout(computeLists, delay || 100)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
@@ -177,7 +182,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
setApps(await navStore.getCoreApps())
|
setApps(await navStore.getCoreApps())
|
||||||
|
|
||||||
window.addEventListener('resize', reComputeLists)
|
window.setInterval(computeLists, 100)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
:label="settings.name"
|
:label="settings.name"
|
||||||
:avatar="settings.avatar"
|
:avatar="settings.avatar"
|
||||||
/>
|
/>
|
||||||
<AppSearch v-model="search" />
|
<AppSearch v-if="showSearchForm" v-model="search" />
|
||||||
<OpenerButton
|
<OpenerButton
|
||||||
v-if="!openerHover"
|
v-if="!openerHover"
|
||||||
@click="$emit('close')"
|
@click="$emit('close')"
|
||||||
@@ -107,6 +107,7 @@ const activeApp = ref(null)
|
|||||||
const targetBlankApps = ref([])
|
const targetBlankApps = ref([])
|
||||||
const settings = ref(null)
|
const settings = ref(null)
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
|
const showSearchForm = ref(true)
|
||||||
const openerHover = ref(false)
|
const openerHover = ref(false)
|
||||||
const menu = useTemplateRef('menu')
|
const menu = useTemplateRef('menu')
|
||||||
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches
|
||||||
@@ -125,6 +126,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
targetBlankApps.value = config['target-blank-apps']
|
targetBlankApps.value = config['target-blank-apps']
|
||||||
settings.value = config['settings']
|
settings.value = config['settings']
|
||||||
|
showSearchForm.value = config['show-search-form']
|
||||||
openerHover.value = config['opener-hover'] && !isTouchDevice
|
openerHover.value = config['opener-hover'] && !isTouchDevice
|
||||||
|
|
||||||
items.value = await navStore.getCategories()
|
items.value = await navStore.getCategories()
|
||||||
|
|||||||
@@ -80,6 +80,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<FormYesNo v-model="config['show-settings']" />
|
<FormYesNo v-model="config['show-settings']" />
|
||||||
</SettingValue>
|
</SettingValue>
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
|
<SettingItem :disabled="config['always-displayed']">
|
||||||
|
<SettingLabel
|
||||||
|
label="Show the search form"
|
||||||
|
:middle="true"
|
||||||
|
/>
|
||||||
|
<SettingValue>
|
||||||
|
<FormYesNo v-model="config['show-search-form']" />
|
||||||
|
</SettingValue>
|
||||||
|
</SettingItem>
|
||||||
<SettingItem>
|
<SettingItem>
|
||||||
<SettingLabel
|
<SettingLabel
|
||||||
label="Icons"
|
label="Icons"
|
||||||
|
|||||||
@@ -363,6 +363,16 @@
|
|||||||
right: 0 !important;
|
right: 0 !important;
|
||||||
margin-left: 0 !important;
|
margin-left: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
left: 53px;
|
||||||
|
width: calc(100% - (var(--body-container-margin) * 2) - 62px);
|
||||||
|
}
|
||||||
|
|
||||||
|
#content-vue {
|
||||||
|
width: calc(100% - (var(--body-container-margin) * 2) - 60px);
|
||||||
|
margin-left: 11px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1024px) {
|
@media screen and (max-width: 1024px) {
|
||||||
@@ -385,6 +395,16 @@
|
|||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#header {
|
||||||
|
.unified-search-input {
|
||||||
|
width: 80px !important;
|
||||||
|
|
||||||
|
.unified-search-input__label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 1024px) {
|
@media screen and (min-width: 1024px) {
|
||||||
@@ -599,3 +619,9 @@ $header-icon-size: 20px;
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#header {
|
||||||
|
.unified-search-input:not(.unified-search-input--mobile) {
|
||||||
|
position: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
import './scss/admin.scss'
|
import './scss/admin.scss'
|
||||||
|
|
||||||
|
import '@formatjs/intl-segmenter/polyfill.js'
|
||||||
|
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
import { waitContainer } from './lib/dom.js'
|
import { waitContainer } from './lib/dom.js'
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ body[data-theme-light], body[data-theme-light-highcontrast] {
|
|||||||
|
|
||||||
<?php if ($_['opener-only']) { ?>
|
<?php if ($_['opener-only']) { ?>
|
||||||
#nextcloud {
|
#nextcloud {
|
||||||
display: none;
|
display: none !important;
|
||||||
}
|
}
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
@@ -117,15 +117,3 @@ body[data-theme-light], body[data-theme-light-highcontrast] {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if ($_['always-displayed']) { ?>
|
|
||||||
#content {
|
|
||||||
left: 53px;
|
|
||||||
width: calc(100% - (var(--body-container-margin) * 2) - 62px);
|
|
||||||
}
|
|
||||||
|
|
||||||
#content-vue {
|
|
||||||
width: calc(100% - (var(--body-container-margin) * 2) - 60px);
|
|
||||||
margin-left: 11px;
|
|
||||||
}
|
|
||||||
<?php } ?>
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
|
|||||||
const TerserPlugin = require('terser-webpack-plugin')
|
const TerserPlugin = require('terser-webpack-plugin')
|
||||||
|
|
||||||
const appName = 'side_menu'
|
const appName = 'side_menu'
|
||||||
|
const appVersion = '6.x'
|
||||||
const buildMode = process.env.NODE_ENV
|
const buildMode = process.env.NODE_ENV
|
||||||
const isDev = buildMode === 'development'
|
const isDev = buildMode === 'development'
|
||||||
|
|
||||||
@@ -80,6 +81,7 @@ module.exports = {
|
|||||||
|
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
appName: JSON.stringify(appName),
|
appName: JSON.stringify(appName),
|
||||||
|
appVersion: JSON.stringify(appVersion),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user