forked from deblan/side_menu
Compare commits
15 commits
renovate/e
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| d485b728e7 | |||
|
8772504b76 |
|||
| 75bea4be38 | |||
| 8787918547 | |||
|
1fcbd89d19 |
|||
|
f177340b13 |
|||
| aaa7afac51 | |||
|
fd4628d209 |
|||
|
f9aa59ca04 |
|||
| 95e4ef136e | |||
|
c0eb65547d |
|||
|
29d061c379 |
|||
| 8e22d9ea62 | |||
|
8957f1ae78 |
|||
|
7b4b447754 |
6 changed files with 34 additions and 9 deletions
13
CHANGELOG.md
13
CHANGELOG.md
|
|
@ -1,5 +1,18 @@
|
|||
## [Unreleased]
|
||||
|
||||
## 5.0.3
|
||||
### Fixed
|
||||
* fix #422: undefined array key "HTTP_USER_AGENT"
|
||||
|
||||
## 5.0.2
|
||||
### Fixed
|
||||
* fix #413: add user-agent check for memories mobile app
|
||||
* fix #418: allow non admin user to access their settings
|
||||
|
||||
## 5.0.1
|
||||
### Fixed
|
||||
* fix(StandardMenu): appLimit must return a value > 0
|
||||
|
||||
## 5.0.0
|
||||
### Fixed
|
||||
* fix apps's order in the standard menu
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ You like this app and you want to support me? ☕ [Buy me a coffee](https://www.
|
|||
Requirements
|
||||
------------
|
||||
|
||||
* PHP >= 8.0
|
||||
* App `theming` enabled
|
||||
* PHP >= 8.1
|
||||
|
||||
Installation and upgrade
|
||||
------------------------
|
||||
|
|
@ -41,7 +40,7 @@ If you want to install it from source, go to https://gitnet.fr/deblan/side_menu/
|
|||
|
||||
```
|
||||
$ cd /path/to/nextcloud/apps
|
||||
$ curl -sS https://gitnet.fr/attachments/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | tar xvfz -
|
||||
$ VERSION=x.y.z; curl -sS https://gitnet.fr/deblan/side_menu/releases/download/v${VERSION}/side_menu_v${VERSION}.tar.gz | tar xvfz -
|
||||
```
|
||||
|
||||
Administrators can edit many settings using the administration page.
|
||||
|
|
|
|||
|
|
@ -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.0.0</version>
|
||||
<version>5.0.3</version>
|
||||
<licence>agpl</licence>
|
||||
<author mail="contact@deblan.fr" homepage="https://www.deblan.fr/">Simon Vieille</author>
|
||||
<namespace>SideMenu</namespace>
|
||||
|
|
|
|||
|
|
@ -49,6 +49,11 @@ class Application extends App implements IBootstrap
|
|||
*/
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* @var Request
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
public function __construct(array $urlParams = [])
|
||||
{
|
||||
parent::__construct(self::APP_ID, $urlParams);
|
||||
|
|
@ -96,6 +101,7 @@ class Application extends App implements IBootstrap
|
|||
$this->config = \OC::$server->getConfig();
|
||||
$this->cspnm = \OC::$server->getContentSecurityPolicyNonceManager();
|
||||
$this->user = \OC::$server[IUserSession::class]->getUser();
|
||||
$this->request = \OC::$server->getRequest();
|
||||
|
||||
if (!$this->isEnabled()) {
|
||||
return;
|
||||
|
|
@ -106,6 +112,10 @@ class Application extends App implements IBootstrap
|
|||
|
||||
protected function isEnabled(): bool
|
||||
{
|
||||
if (isset($this->request->server['HTTP_USER_AGENT']) && preg_match('/MemoriesNative/', $this->request->server['HTTP_USER_AGENT'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$enabled = true;
|
||||
$isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0');
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ class PersonalSettingController extends Controller
|
|||
}
|
||||
|
||||
#[NoCSRFRequired]
|
||||
#[NoAdminRequired]
|
||||
#[FrontpageRoute(verb: 'GET', url: '/user/config')]
|
||||
public function configuration(): JSONResponse
|
||||
{
|
||||
|
|
|
|||
|
|
@ -142,7 +142,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 +158,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()
|
||||
|
||||
|
|
@ -169,10 +174,7 @@ onMounted(async () => {
|
|||
|
||||
setApps(await navStore.getCoreApps())
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
window.clearTimeout(resizeTimeout)
|
||||
resizeTimeout = window.setTimeout(computeLists, 100)
|
||||
})
|
||||
window.addEventListener('resize', reComputeLists)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue