Compare commits
84 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 | |||
| f8b36938a4 | |||
| 479cac1f90 | |||
| f17d088b81 | |||
| f59e62bf0b | |||
| b9f204b545 | |||
| bed8d8ff21 | |||
| 2e5404464e | |||
| 28e08e51a3 | |||
| 2b84ed37e8 | |||
| a4e459d8ed | |||
| 9fea794e2f | |||
| 55967ff81e | |||
| 12604b44fc | |||
| b1e19ac965 | |||
| ea83cc050c | |||
| 36750532f6 | |||
| cf9495de46 | |||
| 076435dc8e | |||
| fe5f0287c3 | |||
| eff18bb143 | |||
| 29826d3c54 | |||
| 695934c28b | |||
| aa2246a1ec | |||
| da04cf4222 | |||
| 7b33271d00 | |||
| e4e054835d | |||
| eae8ce80fb | |||
| 972c69d880 | |||
| dd8561e691 | |||
| 61a4689eb2 | |||
| 4532dd345e | |||
| 6effdc6eed | |||
| 810d83880b | |||
| 25e70f276f | |||
| d06b6b9e31 | |||
| 5c218bff2a | |||
| b0385c172b | |||
| 04ac7e5ed1 | |||
| 67743485cb | |||
| 0ce318d6ec | |||
| c26c5f26df | |||
| 6ce7d3223f | |||
| 6eb977dad5 | |||
| 5f307cd046 | |||
| d2421f90bf | |||
| b16da36507 | |||
| 29f0ead9cc | |||
| e1567b0689 | |||
| aa139bc671 | |||
| b133ba3a97 | |||
| aaf2bb55db | |||
| 749f25a231 | |||
| 04026f5c75 | |||
| 48b2b30406 | |||
| 22e5445330 | |||
| 0544fd3765 | |||
| 2635dd89ca | |||
| aa203bb406 | |||
| 368c59a2bd | |||
| ab7b1e96fe | |||
| f4322a8d71 |
+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**.
|
||||
In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/).
|
||||
]]></description>
|
||||
<version>5.3.0</version>
|
||||
<version>6.0.1</version>
|
||||
<licence>agpl</licence>
|
||||
<author mail="contact@deblan.fr" homepage="https://www.deblan.fr/">Simon Vieille</author>
|
||||
<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>
|
||||
<dependencies>
|
||||
<php min-version="8.1" max-version="8.5" />
|
||||
<nextcloud min-version="31" max-version="33"/>
|
||||
<nextcloud min-version="34" max-version="34"/>
|
||||
</dependencies>
|
||||
<settings>
|
||||
<admin>OCA\SideMenu\Settings\Admin</admin>
|
||||
|
||||
@@ -6,6 +6,7 @@ use OC\AllConfig;
|
||||
use OC\App\AppStore\Fetcher\CategoryFetcher;
|
||||
use OC\AppFramework\Http\Request;
|
||||
use OC\Security\CSP\ContentSecurityPolicyNonceManager;
|
||||
use OC\Security\CSRF\CsrfTokenManager;
|
||||
use OC\User\User;
|
||||
use OCA\SideMenu\Service\AppRepository;
|
||||
use OCA\SideMenu\Service\CategoryRepository;
|
||||
@@ -19,8 +20,11 @@ use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\IConfig;
|
||||
use OCP\INavigationManager;
|
||||
use OCP\IRequest;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\IUserSession;
|
||||
use OCP\L10N\IFactory;
|
||||
use OCP\Server;
|
||||
use OCP\Util;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
@@ -34,9 +38,9 @@ class Application extends App implements IBootstrap
|
||||
public const APP_ID = 'side_menu';
|
||||
public const APP_NAME = 'Custom menu';
|
||||
|
||||
protected AllConfig $config;
|
||||
protected IConfig $config;
|
||||
protected ContentSecurityPolicyNonceManager $cspnm;
|
||||
protected Request $request;
|
||||
protected IRequest $request;
|
||||
protected ?User $user = null;
|
||||
|
||||
public function __construct(array $urlParams = [])
|
||||
@@ -83,10 +87,9 @@ class Application extends App implements IBootstrap
|
||||
|
||||
public function boot(IBootContext $context): void
|
||||
{
|
||||
$this->config = \OC::$server->getConfig();
|
||||
$this->cspnm = \OC::$server->getContentSecurityPolicyNonceManager();
|
||||
$this->user = \OC::$server[IUserSession::class]->getUser();
|
||||
$this->request = \OC::$server->getRequest();
|
||||
$this->config = Server::get(IConfig::class);
|
||||
$this->user = Server::get(IUserSession::class)->getUser();
|
||||
$this->request = Server::get(IRequest::class);
|
||||
|
||||
if (!$this->isEnabled()) {
|
||||
return;
|
||||
@@ -138,7 +141,7 @@ class Application extends App implements IBootstrap
|
||||
$cache = $this->config->getAppValue(self::APP_ID, 'cache', '0');
|
||||
|
||||
foreach ($assets as $value) {
|
||||
$route = \OC::$server->getURLGenerator()->linkToRoute(
|
||||
$route = Server::get(IURLGenerator::class)->linkToRoute(
|
||||
$value['route'],
|
||||
['v' => $cache]
|
||||
);
|
||||
|
||||
Generated
+1521
-408
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -13,7 +13,7 @@
|
||||
"@babel/core": ">=7.12.0 <8.0.0",
|
||||
"@formatjs/intl-segmenter": "^12.0.8",
|
||||
"@nextcloud/router": "^3.0.1",
|
||||
"@nextcloud/vue": "^9.0.0-alpha.8",
|
||||
"@nextcloud/vue": "^9.9.0",
|
||||
"node-polyfill-webpack-plugin": "^4.1.0",
|
||||
"pinia": "^3.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>
|
||||
</ul>
|
||||
<NcActions
|
||||
class="cm-standardmenu-app-menu-more app-menu-more"
|
||||
class="cm-standardmenu-app-menu-more"
|
||||
:aria-label="t('core', 'More apps')"
|
||||
:forceMenu="true"
|
||||
>
|
||||
<NcActionLink
|
||||
v-for="app in popoverAppList"
|
||||
@@ -132,19 +133,27 @@ const setApps = (value) => {
|
||||
const appLimit = () => {
|
||||
const headerStart = document.querySelector('#header .header-start')
|
||||
const headerEnd = document.querySelector('#header .header-end')
|
||||
const unifiedSearch = document.querySelector('#header .unified-search-input')
|
||||
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) {
|
||||
Array.from(headerStart.children).forEach((child) => {
|
||||
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) => {
|
||||
@@ -156,13 +165,9 @@ const makeStyle = (app) => {
|
||||
}
|
||||
|
||||
const computeLists = () => {
|
||||
mainAppList.value = appList.value.slice(0, appLimit())
|
||||
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)
|
||||
const limit = appLimit()
|
||||
mainAppList.value = appList.value.slice(0, limit)
|
||||
popoverAppList.value = appList.value.slice(limit).sort((a, b) => a.order - b.order)
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -177,7 +182,7 @@ onMounted(async () => {
|
||||
|
||||
setApps(await navStore.getCoreApps())
|
||||
|
||||
window.addEventListener('resize', reComputeLists)
|
||||
window.setInterval(computeLists, 100)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -363,6 +363,16 @@
|
||||
right: 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) {
|
||||
@@ -385,6 +395,16 @@
|
||||
padding: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
#header {
|
||||
.unified-search-input {
|
||||
width: 80px !important;
|
||||
|
||||
.unified-search-input__label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1024px) {
|
||||
@@ -599,3 +619,9 @@ $header-icon-size: 20px;
|
||||
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;
|
||||
}
|
||||
<?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 appName = 'side_menu'
|
||||
const appVersion = '6.x'
|
||||
const buildMode = process.env.NODE_ENV
|
||||
const isDev = buildMode === 'development'
|
||||
|
||||
@@ -80,6 +81,7 @@ module.exports = {
|
||||
|
||||
new webpack.DefinePlugin({
|
||||
appName: JSON.stringify(appName),
|
||||
appVersion: JSON.stringify(appVersion),
|
||||
}),
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user