Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| beacfdaeae | |||
| d666cac5be | |||
| 9a71429182 | |||
| f1b495809f | |||
| e44b2c70a7 | |||
| 52de7326ec | |||
| 4975743441 | |||
| be6e9eaced | |||
| 627b9e8bf4 | |||
| 7bc64003a5 | |||
| d078cc68e7 | |||
| 55a2b21ed1 | |||
| f7a8a41f6e | |||
| c2c6399106 | |||
| f4833d1956 | |||
| 9eab478c36 | |||
| c1588dfc2e | |||
| c24bb6f8c8 | |||
| ca689d8b6f | |||
| e81f0e4b76 | |||
| 7033569bed | |||
| a9788f0ab8 | |||
| 1a8063bd94 | |||
| cc841570ec | |||
| d6a2da402c | |||
| fef11cd0cf | |||
| 12b35470c7 | |||
| 23cb8fcfc1 | |||
| 2b4da9cfce | |||
| f2af45711d | |||
| 35afa38f73 | |||
| ad162f5821 | |||
| d3f87adcca | |||
| b32e4ded42 | |||
| 88e54e01b6 | |||
| 4d453676dc | |||
| 0cb14258ad | |||
| 7e7397735b | |||
| ccfb541404 | |||
| f4e35bdc5d |
+642
-253
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -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.3.0</version>
|
<version>6.2.0</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>
|
||||||
@@ -53,7 +53,7 @@ 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_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.5" />
|
<php min-version="8.1" max-version="8.5" />
|
||||||
<nextcloud min-version="31" max-version="33"/>
|
<nextcloud min-version="34" max-version="35"/>
|
||||||
</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'),
|
||||||
|
|||||||
Generated
+1536
-424
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
"@babel/core": ">=7.12.0 <8.0.0",
|
"@babel/core": ">=7.12.0 <8.0.0",
|
||||||
"@formatjs/intl-segmenter": "^12.0.8",
|
"@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",
|
||||||
|
|||||||
@@ -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'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': 'Personalizar'
|
'Customize': 'Personalizar'
|
||||||
'Custom': 'Custom'
|
'Custom': 'Custom'
|
||||||
'Close': 'Cerrar'
|
'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'
|
||||||
|
|||||||
@@ -109,3 +109,4 @@
|
|||||||
'Customize': '自定义'
|
'Customize': '自定义'
|
||||||
'Custom': '自定义'
|
'Custom': '自定义'
|
||||||
'Close': '关闭'
|
'Close': '关闭'
|
||||||
|
'Show the search form': 'Show the search form'
|
||||||
|
|||||||
@@ -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 && open"
|
||||||
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) - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
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()
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
/>
|
/>
|
||||||
</NcAppNavigation>
|
</NcAppNavigation>
|
||||||
<NcAppContent class="cm-settings cm-settings--nav">
|
<NcAppContent class="cm-settings cm-settings--nav">
|
||||||
|
<button @click="toggleNav" class="cm-settings-nav-toggle">{{ trans('Toggle menu') }}</button>
|
||||||
|
|
||||||
<SettingsSection :hidden="section !== 'panel'">
|
<SettingsSection :hidden="section !== 'panel'">
|
||||||
<SectionTitle label="Panel" />
|
<SectionTitle label="Panel" />
|
||||||
|
|
||||||
@@ -80,6 +82,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"
|
||||||
@@ -619,6 +630,10 @@ const filterConfig = (value) => {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const toggleNav = () => {
|
||||||
|
document.querySelector('.cm-settings-nav .app-navigation-toggle-wrapper > button').click()
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
config.value = await configStore.getAppConfig()
|
config.value = await configStore.getAppConfig()
|
||||||
|
|
||||||
|
|||||||
+16
-5
@@ -15,14 +15,25 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.cm-settings {
|
.cm-settings-nav {
|
||||||
&--nav {
|
padding-top: 30px !important;
|
||||||
padding-top: 30px;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
.cm-settings-nav-toggle {
|
||||||
|
margin-top: 40px !important;
|
||||||
|
margin-left: 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-settings-nav .app-navigation-toggle-wrapper > button {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-settings {
|
||||||
&-nav {
|
&-nav {
|
||||||
|
max-width: 50vw !important;
|
||||||
|
|
||||||
.app-navigation__content {
|
.app-navigation__content {
|
||||||
padding: 20px;
|
padding: 20px 10px 20px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-navigation-entry-icon {
|
.app-navigation-entry-icon {
|
||||||
|
|||||||
+58
-22
@@ -287,14 +287,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cm-standardmenu {
|
|
||||||
visibility: hidden;
|
|
||||||
|
|
||||||
&.show {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.cm-always-displayed {
|
.cm-always-displayed {
|
||||||
body {
|
body {
|
||||||
width: calc(100% - 50px) !important;
|
width: calc(100% - 50px) !important;
|
||||||
@@ -363,6 +355,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 +387,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) {
|
||||||
@@ -406,11 +418,25 @@
|
|||||||
$header-icon-size: 20px;
|
$header-icon-size: 20px;
|
||||||
|
|
||||||
.cm-standardmenu {
|
.cm-standardmenu {
|
||||||
|
visibility: hidden;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
&.show {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
color: var(--color-background-plain-text) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-menu-entry--label {
|
||||||
|
color: var(--color-background-plain-text) !important;
|
||||||
|
filter: var(--background-image-invert-if-bright, var(--primary-invert-if-bright)) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.app-menu-main {
|
.app-menu-main {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
@@ -470,7 +496,7 @@ $header-icon-size: 20px;
|
|||||||
color: var(--color-primary-text);
|
color: var(--color-primary-text);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
top: 45%;
|
top: 55%;
|
||||||
display: block;
|
display: block;
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
@@ -542,23 +568,27 @@ $header-icon-size: 20px;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-menu-more .button-vue--vue-tertiary {
|
&-app-menu-more {
|
||||||
opacity: 0.7;
|
padding-top: 9px !important;
|
||||||
margin: 8px 3px 3px 3px;
|
|
||||||
filter: var(--background-image-invert-if-bright, var(--primary-invert-if-bright));
|
|
||||||
|
|
||||||
&:not([aria-expanded='true']) {
|
.button-vue--vue-tertiary {
|
||||||
color: var(--color-main-text);
|
opacity: 0.7;
|
||||||
|
margin: 8px 3px 3px 3px;
|
||||||
|
filter: var(--background-image-invert-if-bright, var(--primary-invert-if-bright));
|
||||||
|
|
||||||
&:hover {
|
&:not([aria-expanded='true']) {
|
||||||
opacity: 1;
|
color: var(--color-main-text);
|
||||||
background-color: transparent !important;
|
|
||||||
|
&:hover {
|
||||||
|
opacity: 1;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
&:focus-visible {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -599,3 +629,9 @@ $header-icon-size: 20px;
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#header {
|
||||||
|
.unified-search-input:not(.unified-search-input--mobile) {
|
||||||
|
position: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -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