Compare commits

...

7 Commits

Author SHA1 Message Date
Simon Vieille b208c8cb19 release v1.19.1 2020-10-21 18:06:00 +02:00
Simon Vieille 0e5cd135b4 fix issue #47 2020-10-21 18:05:36 +02:00
Simon Vieille 854beb8078 release v1.19.0 2020-10-19 18:26:17 +02:00
Simon Vieille 709f938f48 update screenshots 2020-10-19 18:24:08 +02:00
Simon Vieille 80700cac32 add option: the menu is enabled by default for users 2020-10-19 13:44:07 +02:00
Simon Vieille a71a8c7208 add documentation 2020-10-16 13:42:23 +02:00
Simon Vieille cf80c3512c add licence 2020-10-16 11:46:25 +02:00
17 changed files with 173 additions and 12 deletions
+9 -2
View File
@@ -17,11 +17,18 @@ You like this app and you want to support me? [Buy me a coffee](https://www.buym
Installation and upgrade Installation and upgrade
------------------------ ------------------------
Custom menu is available from the app store. If you want to install it from source: go to https://gitnet.fr/deblan/side_menu/releases and download the last release (side_menu_vX.Y.Z.zip). Copy the content into `apps`. Custom menu is available from the app store.
```
$ cd /path/to/nextcloud
$ php occ app:install side_menu
```
If you want to install it from source, go to https://gitnet.fr/deblan/side_menu/releases and copy the link to the last release (side_menu_vX.Y.Z.tar.gz). Then:
``` ```
$ cd /path/to/nextcloud/apps $ cd /path/to/nextcloud/apps
$ unzip /path/to/side_menu_vX.Y.Z.zip # tar xvf /path/to/side_menu_vX.Y.Z.tar.gz $ curl -sS https://gitnet.fr/attachments/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | tar xvfz -
``` ```
Administrators can edit many settings using the administration page. Administrators can edit many settings using the administration page.
+1 -1
View File
@@ -20,7 +20,7 @@ If you like this application and want to support the development:
* ☕ [Buy me a coffee](https://www.buymeacoffee.com/deblan) * ☕ [Buy me a coffee](https://www.buymeacoffee.com/deblan)
* 😃 [Leave a comment](https://apps.nextcloud.com/apps/side_menu#comments) * 😃 [Leave a comment](https://apps.nextcloud.com/apps/side_menu#comments)
]]></description> ]]></description>
<version>1.18.0</version> <version>1.19.1</version>
<licence>agpl</licence> <licence>agpl</licence>
<author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author> <author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
<namespace>SideMenu</namespace> <namespace>SideMenu</namespace>
+10 -1
View File
@@ -58,7 +58,16 @@ class Application extends App
$isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0'); $isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0');
if (null !== $this->user && !$isForced) { if (null !== $this->user && !$isForced) {
$enabled = (bool) $this->config->getUserValue($this->user->getUid(), self::APP_ID, 'enabled', '1'); $enabled = (bool) $this->config->getUserValue(
$this->user->getUid(),
self::APP_ID,
'enabled',
$this->config->getAppValue(
self::APP_ID,
'default-enabled',
'1'
)
);
} }
return $enabled; return $enabled;
+1
View File
@@ -89,6 +89,7 @@ class Admin implements ISettings
'force' => $this->config->getAppValue('force', '0'), 'force' => $this->config->getAppValue('force', '0'),
'target-blank-apps' => $this->config->getAppValueArray('target-blank-apps', '[]'), 'target-blank-apps' => $this->config->getAppValueArray('target-blank-apps', '[]'),
'top-menu-apps' => $this->config->getAppValueArray('top-menu-apps', '[]'), 'top-menu-apps' => $this->config->getAppValueArray('top-menu-apps', '[]'),
'default-enabled' => $this->config->getAppValue('default-enabled', '1'),
'apps' => $this->appRepository->getVisibleApps(), 'apps' => $this->appRepository->getVisibleApps(),
]; ];
+5 -1
View File
@@ -72,7 +72,11 @@ class Personal implements ISettings
$parameters = [ $parameters = [
'force' => $this->config->getAppValueBool('force', '0'), 'force' => $this->config->getAppValueBool('force', '0'),
'enabled' => $this->config->getUserValue($user, 'enabled', '1'), 'enabled' => $this->config->getUserValue(
$user,
'enabled',
$this->config->getAppValue('default-enabled', '1')
),
'top-menu-apps' => $this->config->getUserValueArray($user, 'top-menu-apps', '[]'), 'top-menu-apps' => $this->config->getUserValueArray($user, 'top-menu-apps', '[]'),
'target-blank-mode' => $this->config->getUserValue($user, 'target-blank-mode', '1'), 'target-blank-mode' => $this->config->getUserValue($user, 'target-blank-mode', '1'),
'target-blank-apps' => $this->config->getUserValueArray($user, 'target-blank-apps', '[]'), 'target-blank-apps' => $this->config->getUserValueArray($user, 'target-blank-apps', '[]'),
Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 132 KiB

+16
View File
@@ -1,3 +1,19 @@
<!--
@license GNU AGPL version 3 or any later version
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<template> <template>
<button class="side-menu-opener side-menu-closer"></button> <button class="side-menu-opener side-menu-closer"></button>
</template> </template>
+16
View File
@@ -1,3 +1,19 @@
<!--
@license GNU AGPL version 3 or any later version
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<template> <template>
<div class="side-menu-loader"> <div class="side-menu-loader">
<svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg"> <svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg">
+16
View File
@@ -1,3 +1,19 @@
<!--
@license GNU AGPL version 3 or any later version
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<template> <template>
<div v-bind:class="classes"> <div v-bind:class="classes">
<img v-bind:src="image"> <img v-bind:src="image">
+16
View File
@@ -1,3 +1,19 @@
<!--
@license GNU AGPL version 3 or any later version
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<template> <template>
<button class="side-menu-opener"></button> <button class="side-menu-opener"></button>
</template> </template>
+16
View File
@@ -1,3 +1,19 @@
<!--
@license GNU AGPL version 3 or any later version
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<template> <template>
<div class="side-menu-settings"> <div class="side-menu-settings">
<a v-bind:href="href"> <a v-bind:href="href">
+16
View File
@@ -1,3 +1,19 @@
<!--
@license GNU AGPL version 3 or any later version
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<template> <template>
<li v-bind:class="classes"> <li v-bind:class="classes">
<a v-bind:href="href" :target="target" v-bind:title="label"> <a v-bind:href="href" :target="target" v-bind:title="label">
+16
View File
@@ -1,3 +1,19 @@
<!--
@license GNU AGPL version 3 or any later version
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<template> <template>
<li v-bind:class="classes"> <li v-bind:class="classes">
<a v-bind:href="href" :target="target" v-bind:title="label"> <a v-bind:href="href" :target="target" v-bind:title="label">
+2
View File
@@ -62,3 +62,5 @@
"Export the configuration": "Exportieren Sie die Konfiguration" "Export the configuration": "Exportieren Sie die Konfiguration"
"Purge the cache": "Leeren Sie den Cache" "Purge the cache": "Leeren Sie den Cache"
"Show the link to settings": "Zeigen Sie den Link zu den Einstellungen an" "Show the link to settings": "Zeigen Sie den Link zu den Einstellungen an"
"The menu is enabled by default for users": "Das Menü ist standardmäßig für Benutzer aktiviert"
"Except when the configuration is forced.": "Außer wenn die Konfiguration erzwungen wird."
+2
View File
@@ -62,3 +62,5 @@
"Export the configuration": "Exporter la configuration" "Export the configuration": "Exporter la configuration"
"Purge the cache": "Purger le cache" "Purge the cache": "Purger le cache"
"Show the link to settings": "Afficher le lien vers les paramètres" "Show the link to settings": "Afficher le lien vers les paramètres"
"The menu is enabled by default for users": "Le menu est activé par défaut pour les utilisateurs"
"Except when the configuration is forced.": "Sauf lorsque la configuration est forcée."
+13 -7
View File
@@ -34,10 +34,14 @@ var alwaysDisplayed = function() {
for (var i in fixedElements) { for (var i in fixedElements) {
var element = fixedElements[i] var element = fixedElements[i]
var value = window.getComputedStyle(element, null).getPropertyValue('left') var computedStyle = window.getComputedStyle(element, null)
var intValue = parseInt(value.replace('px', '')) var left = computedStyle.getPropertyValue('left')
var right = computedStyle.getPropertyValue('right')
element.style.setProperty('transform', 'translateX(' + (intValue + 50) + 'px)') if (right !== '0px') {
var intValue = parseInt(left.replace('px', ''))
element.style.setProperty('transform', 'translateX(' + (intValue + 50) + 'px)')
}
} }
} }
@@ -45,14 +49,17 @@ let content = document.getElementById('content')
if (content && content.classList.contains('app-settings')) { if (content && content.classList.contains('app-settings')) {
let loaded = false let loaded = false
const config = {attributes: false, childList: true, subtree: true} const config = {
attributes: false,
childList: true,
subtree: true
}
const observer = new MutationObserver(() => { const observer = new MutationObserver(() => {
if (loaded) { if (loaded) {
return; return;
} }
const element = content.querySelector('#app-category-your-apps') const element = content.querySelector('#app-category-your-apps') || content.querySelector('#app-navigation ul')
|| content.querySelector('#app-navigation ul')
if (element) { if (element) {
loaded = true loaded = true
@@ -65,4 +72,3 @@ if (content && content.classList.contains('app-settings')) {
} else { } else {
window.setTimeout(alwaysDisplayed, 200) window.setTimeout(alwaysDisplayed, 200)
} }
+18
View File
@@ -496,11 +496,29 @@ $choicesSizes = [
</div> </div>
<div class="section"> <div class="section">
<div>
<label for="side-menu-default-enabled">
<?php p($l->t('The menu is enabled by default for users')); ?>
</label>
<p><em><?php p($l->t('Except when the configuration is forced.')); ?></em></p>
<select id="side-menu-default-enabled" name="default-enabled" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['default-enabled']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div> <div>
<label for="side-menu-opener-only"> <label for="side-menu-opener-only">
<?php p($l->t('Force this configuration to users')); ?> <?php p($l->t('Force this configuration to users')); ?>
</label> </label>
</div>
<div>
<select id="side-menu-force" name="force" class="side-menu-setting"> <select id="side-menu-force" name="force" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?> <?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['force']): ?>selected<?php endif; ?>> <option value="<?php echo $value ?>" <?php if ($value === $_['force']): ?>selected<?php endif; ?>>