Compare commits

...

8 Commits

Author SHA1 Message Date
Simon Vieille e1d450218c release v1.7.0 2020-05-19 15:23:25 +02:00
Simon Vieille 93c8ade21a release v1.6.4 2020-05-19 15:21:44 +02:00
Simon Vieille dcc19f5b23 add loader 2020-05-19 15:17:54 +02:00
Simon Vieille 6418e79d49 compatibility with nextcloud 19 2020-05-15 16:59:52 +02:00
Simon Vieille 9b4aecaf41 add documentation 2020-05-14 17:03:09 +02:00
Simon Vieille 46148167e9 add documentation 2020-05-14 17:02:23 +02:00
Simon Vieille a0f4eddab0 release v1.6.3 2020-05-14 15:31:20 +02:00
Simon Vieille 24bf8496f3 fix issue #20: add shortcut to open and to hide the menu 2020-05-14 15:30:34 +02:00
10 changed files with 143 additions and 39 deletions
+19 -34
View File
@@ -6,52 +6,26 @@ This application is rather suitable for instances that activate a lot of applica
Comptatible with AppOrder. Comptatible with AppOrder.
Installation * [Installation and upgrade](#installation-and-upgrade)
------------ * [How to contribute?](#how-to-contribute)
* [Preview](#preview)
Side menu is availabe from the app store. Installation and upgrade
------------------------
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). Side menu is availabe 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`.
Copy the archive to your Nextcloud server.
``` ```
$ cd /path/to/nextcloud/apps $ cd /path/to/nextcloud/apps
$ unzip -d side_menu /path/to/side_menu_vX.Y.Z.zip $ unzip -d side_menu /path/to/side_menu_vX.Y.Z.zip
``` ```
### Upgrade
Side menu can be upgraded 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 archive to your Nextcloud server.
```
$ cd /path/to/nextcloud/apps
$ rm -frv side_menu
$ unzip -d side_menu /path/to/side_menu_vX.Y.Z.zip
```
Preview
-------
![](https://upload.deblan.org/u/2020-03/5e81b219.jpg)
![](https://upload.deblan.org/u/2020-03/5e7fab2b.jpg)
![](https://upload.deblan.org/u/2020-05/5eb6b76e.png)
![](https://upload.deblan.org/u/2020-05/5eb6b78a.png)
Configuration
-------------
Administrators can edit many settings using the administration page. Administrators can edit many settings using the administration page.
Users can disable the menu using the page of personal settings. Users can disable the menu using the page of personal settings.
Use the shortcut `Ctrl`+`o` to open and to hide the side menu. Use `tab` to navigate.
How to contribute? How to contribute?
------------------ ------------------
@@ -67,3 +41,14 @@ If you are a developer:
Build javascripts using `webpack --config ./webpack.js` (add `-w` to build them in real time). Build javascripts using `webpack --config ./webpack.js` (add `-w` to build them in real time).
Then commit and create a pull request. Then commit and create a pull request.
Preview
-------
![](https://upload.deblan.org/u/2020-03/5e81b219.jpg)
![](https://upload.deblan.org/u/2020-03/5e7fab2b.jpg)
![](https://upload.deblan.org/u/2020-05/5eb6b76e.png)
![](https://upload.deblan.org/u/2020-05/5eb6b78a.png)
+4 -2
View File
@@ -6,6 +6,8 @@
<description><![CDATA[Side menu allows you to modify the position of the main menu by creating a panel on the left of the interface. <description><![CDATA[Side menu allows you to modify the position of the main menu by creating a panel on the left of the interface.
This application is rather suitable for instances that activate a lot of applications. This application is rather suitable for instances that activate a lot of applications.
Use the shortcut `Ctrl`+`o` to open and to hide the side menu. Use `tab` to navigate.
Comptatible with AppOrder. Comptatible with AppOrder.
You can report a bug or request a feature by opening an issue. You can report a bug or request a feature by opening an issue.
@@ -13,7 +15,7 @@ You can report a bug or request a feature by opening an issue.
]]></description> ]]></description>
<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>
<version>1.6.2</version> <version>1.7.0</version>
<namespace>SideMenu</namespace> <namespace>SideMenu</namespace>
<category>customization</category> <category>customization</category>
<website>https://gitnet.fr/deblan/side_menu</website> <website>https://gitnet.fr/deblan/side_menu</website>
@@ -24,7 +26,7 @@ You can report a bug or request a feature by opening an issue.
<screenshot>https://upload.deblan.org/u/2020-05/5eb6b76e.png</screenshot> <screenshot>https://upload.deblan.org/u/2020-05/5eb6b76e.png</screenshot>
<screenshot>https://upload.deblan.org/u/2020-05/5eb6b78a.png</screenshot> <screenshot>https://upload.deblan.org/u/2020-05/5eb6b78a.png</screenshot>
<dependencies> <dependencies>
<nextcloud min-version="18" max-version="18"/> <nextcloud min-version="18" max-version="19"/>
</dependencies> </dependencies>
<settings> <settings>
<admin>OCA\SideMenu\Settings\Admin</admin> <admin>OCA\SideMenu\Settings\Admin</admin>
+9
View File
@@ -23,3 +23,12 @@
#side-menu-section select { #side-menu-section select {
margin: 10px 0 10px 0; margin: 10px 0 10px 0;
} }
.keyboard-key {
padding: 1px 9px;
margin: 0 2px;
background: #eee;
border: 1px solid #aaa;
color: #555;
border-radius: 3px;
}
+16 -1
View File
@@ -80,7 +80,7 @@
white-space: nowrap; white-space: nowrap;
} }
.side-menu-app a:hover, .side-menu-app.active a { .side-menu-app a:hover, .side-menu-app.active, .side-menu-app a:focus {
background: var(--side-menu-current-app-background-color, #444); background: var(--side-menu-current-app-background-color, #444);
} }
@@ -107,3 +107,18 @@
#side-menu.hide-opener .side-menu-logo { #side-menu.hide-opener .side-menu-logo {
margin-top: 20px; margin-top: 20px;
} }
#side-menu-loader {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 3001;
}
#side-menu-loader-bar {
height: 4px;
background: var(--side-menu-loader-color, #0e75ac);
width: 0;
transition-property: width;
}
+1
View File
@@ -61,6 +61,7 @@ class CssController extends Controller
'background-color' => $backgroundColor, 'background-color' => $backgroundColor,
'background-color-to' => $backgroundColorTo, 'background-color-to' => $backgroundColorTo,
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'), 'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
'loader-color' => $this->config->getAppValue('side_menu', 'loader-color', '#0e75ac'),
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'), 'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'), 'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'),
], ],
+1
View File
@@ -59,6 +59,7 @@ class JsController extends Controller
'external-sites-in-top-menu' => (bool) $this->config->getAppValue('side_menu', 'external-sites-in-top-menu', 0), 'external-sites-in-top-menu' => (bool) $this->config->getAppValue('side_menu', 'external-sites-in-top-menu', 0),
'force-light-icon' => (bool) $this->config->getAppValue('side_menu', 'force-light-icon', '0'), 'force-light-icon' => (bool) $this->config->getAppValue('side_menu', 'force-light-icon', '0'),
'hide-when-no-apps' => (bool) $this->config->getAppValue('side_menu', 'hide-when-no-apps', '0'), 'hide-when-no-apps' => (bool) $this->config->getAppValue('side_menu', 'hide-when-no-apps', '0'),
'loader-enabled' => (bool) $this->config->getAppValue('side_menu', 'loader-enabled', '1'),
]; ];
$response = new TemplateResponse('side_menu', 'js/script', $parameters, 'blank'); $response = new TemplateResponse('side_menu', 'js/script', $parameters, 'blank');
+2
View File
@@ -60,6 +60,8 @@ class Admin implements ISettings
'background-color' => $backgroundColor, 'background-color' => $backgroundColor,
'background-color-to' => $backgroundColorTo, 'background-color-to' => $backgroundColorTo,
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'), 'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
'loader-color' => $this->config->getAppValue('side_menu', 'loader-color', '#0e75ac'),
'loader-enabled' => $this->config->getAppValue('side_menu', 'loader-enabled', '1'),
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'), 'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
'force-light-icon' => $this->config->getAppValue('side_menu', 'force-light-icon', '0'), 'force-light-icon' => $this->config->getAppValue('side_menu', 'force-light-icon', '0'),
'cache' => $this->config->getAppValue('side_menu', 'cache', '0'), 'cache' => $this->config->getAppValue('side_menu', 'cache', '0'),
+46 -2
View File
@@ -28,6 +28,18 @@
var headerMenuOpener = $('#header .side-menu-opener') var headerMenuOpener = $('#header .side-menu-opener')
var sideMenuOpener = $('#side-menu .side-menu-opener') var sideMenuOpener = $('#side-menu .side-menu-opener')
sideMenuFocus = function() {
var a = sideMenu.find('.side-menu-app.active a')
if (a.length === 0) {
a = sideMenu.find('.side-menu-app:first-child a')
}
if (a.length > 0) {
a.focus()
}
}
<?php if ($_['opener-hover']): ?> <?php if ($_['opener-hover']): ?>
var sideMenuMouseLeave = function() { var sideMenuMouseLeave = function() {
sideMenu sideMenu
@@ -43,6 +55,8 @@
sideMenu sideMenu
.addClass('open') .addClass('open')
.on('mouseenter', sideMenuMouseEnter) .on('mouseenter', sideMenuMouseEnter)
sideMenuFocus()
} }
if (!isTouchDevice) { if (!isTouchDevice) {
@@ -53,17 +67,47 @@
<?php endif; ?> <?php endif; ?>
headerMenuOpener.on('click', function() { headerMenuOpener.on('click', function() {
sideMenu.addClass('open'); sideMenu.addClass('open')
sideMenu.find('.side-menu-app.active a').focus()
}) })
sideMenuOpener.on('click', function() { sideMenuOpener.on('click', function() {
sideMenu.removeClass('open'); sideMenu.removeClass('open')
})
$(document).keydown(function(e) {
var key = e.key || e.keyCode
if ((key === 'o' || key === 79) && e.ctrlKey === true) {
e.preventDefault()
sideMenu.toggleClass('open')
sideMenuFocus()
}
}) })
}) })
body.append(sideMenuContainer) body.append(sideMenuContainer)
sideMenuContainer.append(sideMenu) sideMenuContainer.append(sideMenu)
<?php if ($_['loader-enabled'] === true): ?>
var pageLoader = $('<div id="side-menu-loader">')
var pageLoaderBar = $('<div id="side-menu-loader-bar">')
body.append(pageLoader)
pageLoader.append(pageLoaderBar)
var pageLoaderValue = 0
$(window).on('beforeunload', function() {
setInterval(function() {
pageLoaderBar.width(pageLoaderValue.toString() + '%')
pageLoaderValue = Math.min(pageLoaderValue + .2, 100)
}, 25)
})
<?php endif; ?>
<?php if ($_['opener-position'] === 'before'): ?> <?php if ($_['opener-position'] === 'before'): ?>
sideMenuOpener.insertBefore('#nextcloud') sideMenuOpener.insertBefore('#nextcloud')
<?php else: ?> <?php else: ?>
+42
View File
@@ -102,6 +102,20 @@ $choicesSizes = [
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
<div>
<label for="side-menu-text-color" class="settings-hint">
<?php p($l->t('Loader')); ?>
</label>
</div>
<div>
<input
id="side-menu-loader-color"
name="loader-color"
type="color"
class="side-menu-setting"
value="<?php print_unescaped($_['loader-color']); ?>">
</div>
</div> </div>
<div class="section"> <div class="section">
@@ -213,6 +227,9 @@ $choicesSizes = [
</select> </select>
</div> </div>
<p>Use the shortcut <span class="keyboard-key">Ctrl</span>+<span class="keyboard-key">o</span>
to open and to hide the side menu. Use <span class="keyboard-key">tab</span> to navigate.</p>
<div> <div>
<label for="side-menu-opener" class="settings-hint"> <label for="side-menu-opener" class="settings-hint">
<?php p($l->t('Display the logo')); ?> <?php p($l->t('Display the logo')); ?>
@@ -253,6 +270,22 @@ $choicesSizes = [
</select> </select>
</div> </div>
<div>
<label for="side-menu-loader-enabled" class="settings-hint">
<?php p($l->t('Loader enabled')); ?>
</label>
</div>
<div>
<select id="side-menu-loader-enabled" name="loader-enabled" class="side-menu-setting">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['loader-enabled']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div> <div>
<label for="side-menu-external-sites-in-top-menu" class="settings-hint"> <label for="side-menu-external-sites-in-top-menu" class="settings-hint">
<?php p($l->t('Do not move external sites in the side menu')); ?> <?php p($l->t('Do not move external sites in the side menu')); ?>
@@ -271,6 +304,15 @@ $choicesSizes = [
</div> </div>
</div> </div>
<div class="section">
<h2>
<?php p($l->t('Tips')); ?>
</h2>
<p class="settings-hint">Use the shortcut <span class="keyboard-key">Ctrl</span>+<span class="keyboard-key">o</span>
to open and to hide the side menu. Use <span class="keyboard-key">tab</span> to navigate.</p>
</div>
<div class="section"> <div class="section">
<input type="hidden" id="side-menu-cache" name="cache" value="<?php print_unescaped($_['cache']); ?>" class="side-menu-setting"> <input type="hidden" id="side-menu-cache" name="cache" value="<?php print_unescaped($_['cache']); ?>" class="side-menu-setting">
+3
View File
@@ -48,6 +48,9 @@ $choicesYesNo = [
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
<p>Use the shortcut <span class="keyboard-key">Ctrl</span>+<span class="keyboard-key">o</span>
to open and to hide the side menu. Use <span class="keyboard-key">tab</span> to navigate.</p>
</div> </div>
<div class="section"> <div class="section">