Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 077191cf47 | |||
| 9eab478c36 | |||
| c1588dfc2e | |||
| c24bb6f8c8 | |||
| ca689d8b6f | |||
| e81f0e4b76 | |||
| 7033569bed | |||
| a9788f0ab8 | |||
| 1a8063bd94 | |||
| cc841570ec | |||
| d6a2da402c | |||
| 746585b1c7 | |||
| fef11cd0cf | |||
| 12b35470c7 | |||
| 23cb8fcfc1 | |||
| f2a9a11c08 | |||
| 2b4da9cfce | |||
| f2af45711d | |||
| 35afa38f73 | |||
| ad162f5821 | |||
| d3f87adcca | |||
| b32e4ded42 | |||
| 88e54e01b6 |
+621
-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.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>
|
||||||
@@ -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="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]
|
||||||
);
|
);
|
||||||
|
|||||||
Generated
+1527
-415
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",
|
||||||
|
|||||||
+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>
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -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