Compare commits

...

51 Commits

Author SHA1 Message Date
Simon Vieille ef22990f4b release v1.3.4 2020-04-27 08:48:48 +02:00
Simon Vieille c84ce6a615 release v1.4.0 2020-04-26 23:46:38 +02:00
Simon Vieille 9b060d1a4b fix #13: add option to show only the opener 2020-04-26 23:45:33 +02:00
Simon Vieille 26e737e2d7 fix #13: add alternate hamburger icon 2020-04-26 23:32:30 +02:00
Simon Vieille 67f27e0ef4 fix #13: add alternate hamburger icon 2020-04-26 23:30:43 +02:00
Simon Vieille 58661508d4 indentation 2020-04-25 16:29:52 +02:00
Simon Vieille 5509b69908 fix #11 2020-04-25 16:04:54 +02:00
Simon Vieille 51eccde659 add gitignore 2020-04-25 16:03:51 +02:00
Simon Vieille d0c072bee5 release v1.3.3 2020-04-25 14:30:02 +02:00
Simon Vieille 95f7eb5980 add options to select the size of icons and texts or hide them 2020-04-25 14:25:51 +02:00
Simon Vieille 18314b260f add 2nd background color 2020-04-25 13:25:41 +02:00
Simon Vieille e3c159b4d6 add 2nd background color 2020-04-25 13:05:01 +02:00
Simon Vieille a48611edf4 indentation 2020-04-22 19:35:56 +02:00
Simon Vieille 5dde7ca850 add padding on icons 2020-04-22 19:30:04 +02:00
Simon Vieille db2f7becae add documentation 2020-04-22 00:42:47 +02:00
Simon Vieille 1715ae5d52 release v1.3.2 2020-04-20 19:52:02 +02:00
Simon Vieille 847fa23345 add support message 2020-04-20 19:51:54 +02:00
Simon Vieille 0495046d02 fix #9: apply a patch to correctly generate an image path 2020-04-20 19:24:37 +02:00
Simon Vieille 0474ef55e8 release v1.3.1 2020-04-20 14:07:59 +02:00
Simon Vieille 7c9653943a remove extension from routes (css, js) 2020-04-20 14:05:08 +02:00
Simon Vieille 457bfc282b add opener-position option (issue #3) 2020-04-20 14:04:06 +02:00
Simon Vieille 84c78538f0 fix typo 2020-04-17 14:16:15 +02:00
Simon Vieille f0d17a61bd release v1.3.0 2020-04-17 13:59:42 +02:00
Simon Vieille fdbeaf6677 Merge branch 'feature/menu-position' into develop 2020-04-17 13:58:55 +02:00
Simon Vieille 9d18b33715 add styles 2020-04-17 13:58:45 +02:00
Simon Vieille bfb2b5d819 remove main.js from webpack and add styles 2020-04-17 13:58:34 +02:00
Simon Vieille a6e789c859 add option: enabled hover on opener 2020-04-17 13:58:01 +02:00
Simon Vieille 0cceb03213 add js script using a controller 2020-04-17 13:57:23 +02:00
Simon Vieille 91db830ea7 update screenshot 2020-04-17 13:56:37 +02:00
Simon Vieille af69d64e87 release 2020-04-16 12:36:39 +02:00
Simon Vieille f4ec00c9f7 prevent image error on old browsers 2020-04-16 12:36:30 +02:00
Simon Vieille 8b20b11ce2 fix #7: Opener icon not visible in Safari 2020-04-16 12:18:10 +02:00
Simon Vieille e597ed95a3 fix #6: menu items x4 2020-04-15 21:48:37 +02:00
Simon Vieille bf3493bb03 fix typo 2020-04-15 15:35:25 +02:00
Simon Vieille fe665d58a9 release 2020-04-15 12:19:30 +02:00
Simon Vieille 407073dd98 fix issue #4: add option to hide the logo 2020-04-15 12:17:17 +02:00
Simon Vieille f85b5de28d release v1.2.1 2020-04-11 11:21:40 +02:00
Simon Vieille ee5be2cf21 add compatibility with Audioplayer 2020-04-11 11:17:29 +02:00
Simon Vieille 91195d0160 add documentation 2020-04-09 14:33:35 +02:00
Simon Vieille 29e0526844 remove/comment useless code 2020-04-09 14:22:10 +02:00
Simon Vieille 8d2818150c add test before insert nextcloud logo 2020-04-09 14:19:10 +02:00
Simon Vieille 299abe5e96 PSR 2 compliance and beautify javascript 2020-04-09 14:16:40 +02:00
Simon Vieille 47bcf68218 add screeshot 2020-04-09 10:52:58 +02:00
Simon Vieille 2b32f6e50a Merge branch 'feature/theming' into develop 2020-04-09 10:38:38 +02:00
Simon Vieille bf26217c55 fix issue with logo size 2020-04-09 10:36:38 +02:00
Simon Vieille 39ffc91d43 fix issue with settings save 2020-04-09 10:33:54 +02:00
Simon Vieille ec8b0a2866 add admin settings 2020-04-09 09:55:45 +02:00
Simon Vieille b9bb3989f4 add colors as css vars 2020-04-08 17:13:49 +02:00
Simon Vieille d07af9ddf9 fix side menu position 2020-04-08 17:04:04 +02:00
Simon Vieille da6f89d5c1 add documentation 2020-03-30 10:47:45 +02:00
Simon Vieille e6520336ce add documentation 2020-03-30 10:44:46 +02:00
23 changed files with 1001 additions and 209 deletions
+2
View File
@@ -0,0 +1,2 @@
/js
/node_modules
+33
View File
@@ -0,0 +1,33 @@
## Feature
### Description
...
### Benefits
...
---
## Issue
### Environment
* Side menu version: ...
* PHP version: ...
* Web server (Nginx, Apache2): ...
### Steps to reproduce
* ...
* ...
* ...
### Observed Results
...
### Expected Results
...
+51 -3
View File
@@ -1,11 +1,59 @@
🤙 Nextcloud app / Side menu 🎨 🤙 Nextcloud app / Side menu 🎨
=============================== ===============================
Side menu allows you to modify the position of the main menu by creating a panel on the left of the interface.
This application moves the top menu of Nextcloud to the left side. This application is rather suitable for instances that activate a lot of applications.
Comptatible with AppOrder. Comptatible with AppOrder.
Installation
------------
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 archive to your Nextcloud server.
```
$ cd /path/to/nextcloud/apps
$ 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
```
![](https://upload.deblan.org/u/2020-03/5e7fab2b.jpg) ![](https://upload.deblan.org/u/2020-03/5e7fab2b.jpg)
![](https://upload.deblan.org/u/2020-03/5e7fab16.jpg) ![](https://upload.deblan.org/u/2020-03/5e81b219.jpg)
![](https://upload.deblan.org/u/2020-04/5ea68025.png)
How to contribute?
------------------
You can report a bug or request a feature by opening an issue: https://gitnet.fr/deblan/side_menu/issues
If you are a developer:
* fork the repository
* install an instance of Nextcloud
* go to `apps/` and clone your repository
* go to `apps/side_menu` and run `npm install`
Build javascripts using `webpack --config ./webpack.js` (add `-w` to build them in real time).
Then commit and create a pull request.
+31 -8
View File
@@ -25,15 +25,38 @@ use OCP\Util;
$config = \OC::$server->getConfig(); $config = \OC::$server->getConfig();
$cspnm = \OC::$server->getContentSecurityPolicyNonceManager(); $cspnm = \OC::$server->getContentSecurityPolicyNonceManager();
Util::addScript('side_menu', 'main');
Util::addScript('side_menu', 'sideMenu'); Util::addScript('side_menu', 'sideMenu');
Util::addStyle('side_menu', 'sideMenu'); Util::addStyle('side_menu', 'sideMenu');
$stylesheet = \OC::$server->getURLGenerator()->linkToRoute(
'side_menu.Css.stylesheet',
[
'v' => $config->getAppValue('side_menu', 'cache', '0'),
]
);
// whitelist the URL to allow loading JS from this external domain $script = \OC::$server->getURLGenerator()->linkToRoute(
// $CSPManager = \OC::$server->getContentSecurityPolicyManager(); 'side_menu.Js.script',
// $policy = new ContentSecurityPolicy(); [
// $policy->addAllowedScriptDomain($url); 'v' => $config->getAppValue('side_menu', 'cache', '0'),
// $policy->addAllowedImageDomain($url); ]
// $policy->addAllowedConnectDomain($url); );
// $CSPManager->addDefaultPolicy($policy);
Util::addHeader(
'link',
[
'href' => $stylesheet,
'rel' => 'stylesheet'
],
''
);
Util::addHeader(
'script',
[
'src' => $script,
'nonce' => $cspnm->getNonce(),
],
''
);
+15 -3
View File
@@ -3,18 +3,30 @@
<id>side_menu</id> <id>side_menu</id>
<name>Side menu</name> <name>Side menu</name>
<summary>Move the top menu to the left side.</summary> <summary>Move the top menu to the left side.</summary>
<description>Move the top menu to the left side.</description> <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.
Comptatible with AppOrder.
You can report a bug or request a feature by opening an issue
]]></description>
<licence>agpl</licence> <licence>agpl</licence>
<author mail="dev+sidemenu@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author> <author mail="dev+sidemenu@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
<version>1.1.2</version> <version>1.3.4</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>
<bugs>https://gitnet.fr/deblan/side_menu/issues</bugs> <bugs>https://gitnet.fr/deblan/side_menu/issues</bugs>
<repository type="git">https://gitnet.fr/deblan/side_menu</repository> <repository type="git">https://gitnet.fr/deblan/side_menu</repository>
<screenshot>https://upload.deblan.org/u/2020-03/5e7fab2b.jpg</screenshot> <screenshot>https://upload.deblan.org/u/2020-03/5e7fab2b.jpg</screenshot>
<screenshot>https://upload.deblan.org/u/2020-03/5e7fab16.jpg</screenshot> <screenshot>https://upload.deblan.org/u/2020-03/5e81b219.jpg</screenshot>
<screenshot>https://upload.deblan.org/u/2020-04/5ea68025.png</screenshot>
<dependencies> <dependencies>
<nextcloud min-version="18" max-version="18"/> <nextcloud min-version="18" max-version="18"/>
</dependencies> </dependencies>
<settings>
<admin>OCA\SideMenu\Settings\Admin</admin>
<admin-section>OCA\SideMenu\Settings\Section</admin-section>
</settings>
</info> </info>
+2
View File
@@ -19,5 +19,7 @@
return [ return [
'routes' => [ 'routes' => [
['name' => 'Css#stylesheet', 'url' => '/css/stylesheet', 'verb' => 'GET'],
['name' => 'Js#script', 'url' => '/js/script', 'verb' => 'GET'],
], ],
]; ];
+7 -9
View File
@@ -15,13 +15,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
const sideMenuContainer = $('<div id="side-menu">') #side-menu-section input[type="color"] {
const sideMenuOpener = $('<button class="side-menu-opener"></button>') width: 100px;
margin: 10px 0 10px 0;
}
$('body').append(sideMenuContainer); #side-menu-section select {
margin: 10px 0 10px 0;
sideMenuOpener.insertBefore('#nextcloud'); }
$('body').on('click', '.side-menu-opener', () => {
$('#side-menu').toggleClass('is-active');
})
+26 -11
View File
@@ -26,26 +26,33 @@
height: 100vh; height: 100vh;
width: 100%; width: 100%;
max-width: 250px; max-width: 250px;
background: #333; background: linear-gradient(90deg, var(--side-menu-background-color, #333) 0%, var(--side-menu-background-color-to, #333) 100%);
z-index: 3000; z-index: 3000;
color: #fff; color: var(--side-menu-text-color, #fff);
box-shadow: rgba(0, 0, 0, 0.22) 0px 25.6px 57.6px 0px, rgba(0, 0, 0, 0.18) 0px 4.8px 14.4px 0px; box-shadow: rgba(0, 0, 0, 0.22) 0px 25.6px 57.6px 0px, rgba(0, 0, 0, 0.18) 0px 4.8px 14.4px 0px;
padding: 2px 0 0 0;
display: none; display: none;
} }
#side-menu.is-active { #side-menu.open {
display: block; display: block;
} }
#header .side-menu-opener {
margin-left: 5px;
}
.side-menu-opener { .side-menu-opener {
background: url('../img/side-menu-opener.svg'); background: var(--side-menu-opener, url('../img/side-menu-opener.svg'));
height: 40px; height: 40px;
width: 40px; width: 40px;
border-radius: 0; border-radius: 0;
border: 0; border: 0;
} }
#side-menu.hide-opener .side-menu-opener {
display: none;
}
.side-menu-apps-list { .side-menu-apps-list {
height: calc(100vh - 150px); height: calc(100vh - 150px);
z-index: 2200; z-index: 2200;
@@ -60,20 +67,21 @@
width: 20px; width: 20px;
vertical-align: middle; vertical-align: middle;
margin-right: 10px; margin-right: 10px;
padding-top: 3px;
} }
.side-menu-app a { .side-menu-app a {
line-height: 30px; line-height: 30px;
color: #fff; color: var(--side-menu-text-color, #fff);
display: block; display: block;
padding: 7px 0 7px 15px; padding: 7px 0 5px 15px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.side-menu-app a:hover, .side-menu-app.is-active a { .side-menu-app a:hover, .side-menu-app.active a {
background: #444; background: var(--side-menu-current-app-background-color, #444);
} }
.side-menu-logo { .side-menu-logo {
@@ -81,14 +89,21 @@
} }
.side-menu-logo img { .side-menu-logo img {
width: 60%; max-width: 60%;
max-height: 100px;
} }
.side-menu-header { .side-menu-header {
height: 150px; height: 150px;
width: 100%;
z-index: 2300; z-index: 2300;
max-width: 250px; max-width: 250px;
background: #333;
position: fixed; position: fixed;
padding-top: 2px;
padding-left: 5px;
top: 0; top: 0;
} }
#side-menu.hide-opener .side-menu-logo {
margin-top: 20px;
}
+1
View File
@@ -0,0 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M10.707 11.412l-.587-.587-.03-.03a.513.513 0 0 1-.074-.526L13.07 3.4l-1.5-1.498-.15.15-.708-.706.505-.505a.538.538 0 0 1 .224-.128c.04-.01.05-.01.087-.016h.087c.04.006.05.006.086.016.072.02.134.055.192.1.74.676 1.42 1.415 2.127 2.124a.503.503 0 0 1 .103.556l-3.053 6.87.344.343.49-.49 3.01 3.01a1.192 1.192 0 0 1-1.685 1.686l-3.012-3.01.49-.488zm-.533-10.217a.986.986 0 0 0-1.396 0l-7.582 7.58a.99.99 0 0 0 0 1.398l1.397 1.396a.986.986 0 0 0 1.396 0l7.58-7.583a.988.988 0 0 0 0-1.396l-1.396-1.395z" fill="#000"/></svg>

After

Width:  |  Height:  |  Size: 611 B

+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583">
<rect overflow="visible" style="marker:none" width="4.806" height="1.256" x="2.888" y="2.787" rx="0" ry=".472" color="#000" fill="#fff" fill-opacity=".855" paint-order="stroke markers fill"/>
<rect overflow="visible" style="marker:none" width="4.806" height="1.256" x="2.888" y="4.655" rx="0" ry=".472" color="#000" fill="#fff" fill-opacity=".855" paint-order="stroke markers fill"/>
<rect overflow="visible" style="marker:none" width="4.806" height="1.256" x="2.888" y="6.54" rx="0" ry=".472" color="#000" fill="#fff" fill-opacity=".855" paint-order="stroke markers fill"/>
<path style="marker:none" d="M1.243.71A.469.469 0 0 0 .881.88a.469.469 0 0 0-.171.362V9.34c0 .146.067.275.171.362a.469.469 0 0 0 .362.171H9.34a.469.469 0 0 0 .362-.171.469.469 0 0 0 .171-.362V1.243a.469.469 0 0 0-.171-.362A.469.469 0 0 0 9.34.71zm.723 1.256h6.65v6.65h-6.65z" color="#000" overflow="visible" fill="#fff" fill-opacity=".855" paint-order="stroke markers fill"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583">
<g color="#000" fill="#fff" fill-opacity=".855" transform="translate(0 -286.417)">
<rect ry=".545" rx="0" y="288.816" x="2.516" height="1.451" width="5.551" style="marker:none" overflow="visible" paint-order="stroke markers fill"/>
<rect ry=".545" rx="0" y="290.973" x="2.516" height="1.451" width="5.551" style="marker:none" overflow="visible" paint-order="stroke markers fill"/>
<rect ry=".545" rx="0" y="293.15" x="2.516" height="1.451" width="5.551" style="marker:none" overflow="visible" paint-order="stroke markers fill"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 649 B

+16 -156
View File
@@ -1,159 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583">
<!-- Created with Inkscape (http://www.inkscape.org/) --> <g transform="translate(.3 -286.074)" fill="#fff" color="#000" fill-opacity=".855">
<rect ry="0" rx="0" y="288.474" x="4.266" height="1.451" width="1.451" style="marker:none" overflow="visible" paint-order="stroke markers fill"/>
<svg <g transform="translate(-.13)">
xmlns:dc="http://purl.org/dc/elements/1.1/" <rect style="marker:none" width="1.451" height="1.451" x="6.445" y="288.474" rx="0" ry="0" overflow="visible" paint-order="stroke markers fill"/>
xmlns:cc="http://creativecommons.org/ns#" <rect style="marker:none" width="1.451" height="1.451" x="2.345" y="288.474" rx="0" ry="0" overflow="visible" paint-order="stroke markers fill"/>
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" </g>
xmlns:svg="http://www.w3.org/2000/svg" <rect ry="0" rx="0" y="290.631" x="4.266" height="1.451" width="1.451" style="marker:none" overflow="visible" paint-order="stroke markers fill"/>
xmlns="http://www.w3.org/2000/svg" <g transform="translate(-.13 2.157)">
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" <rect style="marker:none" width="1.451" height="1.451" x="6.445" y="288.474" rx="0" ry="0" overflow="visible" paint-order="stroke markers fill"/>
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" <rect style="marker:none" width="1.451" height="1.451" x="2.345" y="288.474" rx="0" ry="0" overflow="visible" paint-order="stroke markers fill"/>
width="40" </g>
height="40" <rect ry="0" rx="0" y="292.808" x="4.266" height="1.451" width="1.451" style="marker:none" overflow="visible" paint-order="stroke markers fill"/>
viewBox="0 0 10.583333 10.583333" <g transform="translate(-.13 4.334)">
version="1.1" <rect style="marker:none" width="1.451" height="1.451" x="6.445" y="288.474" rx="0" ry="0" overflow="visible" paint-order="stroke markers fill"/>
id="svg8" <rect style="marker:none" width="1.451" height="1.451" x="2.345" y="288.474" rx="0" ry="0" overflow="visible" paint-order="stroke markers fill"/>
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="side-menu-opener.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="9.7123697"
inkscape:cx="61.421304"
inkscape:cy="18.194306"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1918"
inkscape:window-height="1027"
inkscape:window-x="0"
inkscape:window-y="21"
inkscape:window-maximized="0" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-286.41667)">
<g
id="g1014"
transform="translate(0.30030892,0.3423999)"
style="fill:#ffffff">
<rect
ry="0"
rx="0"
y="288.47351"
x="4.2660251"
height="1.4506654"
width="1.4506654"
id="rect817-7"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.85507244;fill-rule:nonzero;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke markers fill;enable-background:accumulate" />
<g
transform="translate(-0.12939894)"
id="g952"
style="fill:#ffffff">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.85507244;fill-rule:nonzero;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke markers fill;enable-background:accumulate"
id="rect817-7-5"
width="1.4506654"
height="1.4506654"
x="6.4453764"
y="288.47351"
rx="0"
ry="0" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.85507244;fill-rule:nonzero;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke markers fill;enable-background:accumulate"
id="rect817-7-3"
width="1.4506654"
height="1.4506654"
x="2.3454716"
y="288.47351"
rx="0"
ry="0" />
</g>
<rect
ry="0"
rx="0"
y="290.63095"
x="4.2660251"
height="1.4506654"
width="1.4506654"
id="rect817-7-56"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.85507244;fill-rule:nonzero;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke markers fill;enable-background:accumulate" />
<g
transform="translate(-0.12939893,2.157457)"
id="g952-2"
style="fill:#ffffff">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.85507244;fill-rule:nonzero;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke markers fill;enable-background:accumulate"
id="rect817-7-5-9"
width="1.4506654"
height="1.4506654"
x="6.4453764"
y="288.47351"
rx="0"
ry="0" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.85507244;fill-rule:nonzero;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke markers fill;enable-background:accumulate"
id="rect817-7-3-1"
width="1.4506654"
height="1.4506654"
x="2.3454716"
y="288.47351"
rx="0"
ry="0" />
</g>
<rect
ry="0"
rx="0"
y="292.80765"
x="4.2660251"
height="1.4506654"
width="1.4506654"
id="rect817-7-56-2"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.85507244;fill-rule:nonzero;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke markers fill;enable-background:accumulate" />
<g
transform="translate(-0.12939893,4.3341867)"
id="g952-2-7"
style="fill:#ffffff">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.85507244;fill-rule:nonzero;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke markers fill;enable-background:accumulate"
id="rect817-7-5-9-0"
width="1.4506654"
height="1.4506654"
x="6.4453764"
y="288.47351"
rx="0"
ry="0" />
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.85507244;fill-rule:nonzero;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:stroke markers fill;enable-background:accumulate"
id="rect817-7-3-1-9"
width="1.4506654"
height="1.4506654"
x="2.3454716"
y="288.47351"
rx="0"
ry="0" />
</g>
</g> </g>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

+76
View File
@@ -0,0 +1,76 @@
<?php
/**
* @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/>.
*/
namespace OCA\SideMenu\Controller;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\Response;
use OCP\IConfig;
use OCP\IRequest;
class CssController extends Controller
{
/** @var \OCP\IConfig */
protected $config;
/**
* @param string $appName
* @param IRequest $request
* @param IConfig $config
*/
public function __construct($appName, IRequest $request, IConfig $config)
{
parent::__construct($appName, $request);
$this->config = $config;
}
/**
* @NoAdminRequired
* @NoCSRFRequired
* @PublicPage
*
* @return Response
*/
public function stylesheet()
{
$backgroundColor = $this->config->getAppValue('side_menu', 'background-color', '#333333');
$backgroundColorTo = $this->config->getAppValue('side_menu', 'background-color-to', $backgroundColor);
$parameters = [
'vars' => [
'background-color' => $backgroundColor,
'background-color-to' => $backgroundColorTo,
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'),
],
'display-logo' => (bool) $this->config->getAppValue('side_menu', 'display-logo', 1),
'opener-only' => (bool) $this->config->getAppValue('side_menu', 'opener-only', 0),
'size-icon' => $this->config->getAppValue('side_menu', 'size-icon', 'normal'),
'size-text' => $this->config->getAppValue('side_menu', 'size-text', 'normal'),
];
$response = new TemplateResponse('side_menu', 'css/stylesheet', $parameters, 'blank');
$response->addHeader('Content-Type', 'text/css');
return $response;
}
}
+64
View File
@@ -0,0 +1,64 @@
<?php
/**
* @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/>.
*/
namespace OCA\SideMenu\Controller;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\Response;
use OCP\IConfig;
use OCP\IRequest;
class JsController extends Controller
{
/** @var \OCP\IConfig */
protected $config;
/**
* @param string $appName
* @param IRequest $request
* @param IConfig $config
*/
public function __construct($appName, IRequest $request, IConfig $config)
{
parent::__construct($appName, $request);
$this->config = $config;
}
/**
* @NoAdminRequired
* @NoCSRFRequired
* @PublicPage
*
* @return Response
*/
public function script()
{
$parameters = [
'opener-position' => $this->config->getAppValue('side_menu', 'opener-position', 'before'),
'opener-hover' => (bool) $this->config->getAppValue('side_menu', 'opener-hover', '0'),
];
$response = new TemplateResponse('side_menu', 'js/script', $parameters, 'blank');
$response->addHeader('Content-Type', 'text/javascript');
return $response;
}
}
+90
View File
@@ -0,0 +1,90 @@
<?php
/**
* @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/>.
*/
namespace OCA\SideMenu\Settings;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IL10N;
use OCP\ILogger;
use OCP\Settings\ISettings;
use OCP\IConfig;
class Admin implements ISettings
{
/** @var IL10N */
private $l;
/** @var ILogger */
private $logger;
/** @var IConfig */
private $config;
public function __construct(IL10N $l, ILogger $logger, IConfig $config)
{
$this->l = $l;
$this->logger = $logger;
$this->config = $config;
}
/**
* @return TemplateResponse
*/
public function getForm()
{
$backgroundColor = $this->config->getAppValue('side_menu', 'background-color', '#333333');
$backgroundColorTo = $this->config->getAppValue('side_menu', 'background-color-to', $backgroundColor);
$parameters = [
'background-color' => $backgroundColor,
'background-color-to' => $backgroundColorTo,
'current-app-background-color' => $this->config->getAppValue('side_menu', 'current-app-background-color', '#444444'),
'text-color' => $this->config->getAppValue('side_menu', 'text-color', '#FFFFFF'),
'cache' => $this->config->getAppValue('side_menu', 'cache', '0'),
'opener' => $this->config->getAppValue('side_menu', 'opener', 'side-menu-opener'),
'display-logo' => $this->config->getAppValue('side_menu', 'display-logo', '1'),
'opener-position' => $this->config->getAppValue('side_menu', 'opener-position', 'before'),
'opener-hover' => $this->config->getAppValue('side_menu', 'opener-hover', '0'),
'opener-only' => $this->config->getAppValue('side_menu', 'opener-only', '0'),
'size-icon' => $this->config->getAppValue('side_menu', 'size-icon', 'normal'),
'size-text' => $this->config->getAppValue('side_menu', 'size-text', 'normal'),
];
return new TemplateResponse('side_menu', 'settings/admin-form', $parameters, '');
}
/**
* @return string the section ID, e.g. 'sharing'
*/
public function getSection()
{
return 'side_menu';
}
/**
* @return int whether the form should be rather on the top or bottom of
* the admin section. The forms are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
*/
public function getPriority()
{
return 70;
}
}
+84
View File
@@ -0,0 +1,84 @@
<?php
/**
* @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/>.
*/
namespace OCA\SideMenu\Settings;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Settings\IIconSection;
class Section implements IIconSection
{
/** @var IL10N */
private $l;
/** @var IURLGenerator */
private $url;
/**
* @param IURLGenerator $url
* @param IL10N $l
*/
public function __construct(IURLGenerator $url, IL10N $l)
{
$this->url = $url;
$this->l = $l;
}
/**
* returns the ID of the section. It is supposed to be a lower case string,
* e.g. 'ldap'
*
* @returns string
*/
public function getID()
{
return 'side_menu';
}
/**
* returns the translated name as it should be displayed, e.g. 'LDAP / AD
* integration'. Use the L10N service to translate it.
*
* @return string
*/
public function getName()
{
return $this->l->t('Side menu');
}
/**
* @return int whether the form should be rather on the top or bottom of
* the settings navigation. The sections are arranged in ascending order of
* the priority values. It is required to return a value between 0 and 99.
*
* E.g.: 70
*/
public function getPriority()
{
return 70;
}
/**
* {@inheritdoc}
*/
public function getIcon()
{
return $this->url->imagePath('theming', 'app-dark.svg');
}
}
+5 -4
View File
@@ -18,18 +18,19 @@
import Vue from 'vue' import Vue from 'vue'
import SideMenu from './SideMenu.vue' import SideMenu from './SideMenu.vue'
Vue.prototype.t = t // Vue.prototype.t = t
Vue.prototype.OC = OC // Vue.prototype.OC = OC
// Vue.prototype.OC = OCP
const View = Vue.extend(SideMenu) const View = Vue.extend(SideMenu)
const sideMenu = new View({ const sideMenu = new View({})
})
const mountSideMenuComponent = () => { const mountSideMenuComponent = () => {
const sideMenuContainer = document.querySelector('#side-menu') const sideMenuContainer = document.querySelector('#side-menu')
if (sideMenuContainer) { if (sideMenuContainer) {
sideMenu.$mount('#side-menu') sideMenu.$mount('#side-menu')
$('body').trigger('side-menu.ready')
} else { } else {
window.setTimeout(mountSideMenuComponent, 50) window.setTimeout(mountSideMenuComponent, 50)
} }
+25 -14
View File
@@ -25,11 +25,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
<ul class="side-menu-apps-list"> <ul class="side-menu-apps-list">
<li v-for="app in apps" v-bind:class="{'side-menu-app': true, 'is-active': app.active}"> <li v-for="app in apps" v-bind:class="{'side-menu-app': true, 'active': app.active}">
<a v-bind:href="app.href"> <a v-bind:href="app.href">
<span class="side-menu-app-icon" v-html="app.icon"></span> <span class="side-menu-app-icon" v-html="app.icon"></span>
<span class="side-menu-app-text" v-html="app.name"></span>
{{ app.name }}
</a> </a>
</li> </li>
</ul> </ul>
@@ -37,9 +36,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</template> </template>
<script> <script>
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'
export default { export default {
name: 'SideMenu', name: 'SideMenu',
data() { data() {
@@ -57,20 +53,32 @@ export default {
let href = element.getAttribute('href') let href = element.getAttribute('href')
if (href !== '#') { if (href !== '#') {
let svg = element.querySelector('svg').outerHTML
svg = svg.replace(/(height|width)="20"/, '')
this.apps.push({ this.apps.push({
href: href, href: href,
name: element.querySelector('span').innerHTML, name: element.querySelector('span').innerHTML,
icon: element.querySelector('svg').outerHTML, icon: svg,
active: element.classList.contains('active') active: element.classList.contains('active')
}); });
} }
} }
}, },
retrieveLogo() { retrieveLogo() {
this.logo = window.getComputedStyle(document.querySelector('#nextcloud .logo'), null) const ncLogo = document.querySelector('#nextcloud .logo')
.getPropertyValue('background-image')
.replace('url("', '') if (ncLogo) {
.replace('")', '') const url = window.getComputedStyle(ncLogo, null)
.getPropertyValue('background-image')
.replace('url("', '')
.replace('")', '')
if (url && url !== 'none') {
this.logo = url
}
}
}, },
}, },
created() { created() {
@@ -78,9 +86,12 @@ export default {
this.retrieveLogo(); this.retrieveLogo();
const menu = document.querySelector('#appmenu') const menu = document.querySelector('#appmenu')
const config = {attributes: true, childList: true, subtree: true};
const observer = new MutationObserver(this.retrieveApps); if (menu) {
observer.observe(menu, config); const config = {attributes: true, childList: true, subtree: true};
const observer = new MutationObserver(this.retrieveApps);
observer.observe(menu, config);
}
} }
} }
</script> </script>
+71
View File
@@ -0,0 +1,71 @@
/**
* @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/>.
*/
const elements = [
'side-menu-background-color',
'side-menu-background-color-to',
'side-menu-current-app-background-color',
'side-menu-text-color',
'side-menu-opener',
'side-menu-opener-position',
'side-menu-opener-hover',
'side-menu-opener-only',
'side-menu-display-logo',
'side-menu-size-icon',
'side-menu-size-text',
'side-menu-cache',
];
const selector = '#side-menu-message';
const saveSettings = (key) => {
const element = elements[key]
const name = $('#' + element).attr('name')
let value = $('#' + element).val()
const size = elements.length
if (element === 'side-menu-cache') {
value++
}
OCP.AppConfig.setValue('side_menu', name, value, {
success: () => {
OC.msg.finishedSuccess(
selector,
t('side_menu', (key + 1) + '/' + size)
)
if (key < size - 1) {
saveSettings(++key)
} else {
OC.msg.finishedSuccess(selector, t('side_menu', 'Saved'))
}
},
error: () => {
OC.msg.finishedError(selector, t('side_menu', 'Error while saving "' + element + '"'))
}
});
}
$(document).ready(() => {
$('#side-menu-save').on('click', (event) => {
event.preventDefault()
OC.msg.startSaving(selector)
saveSettings(0)
});
});
+92
View File
@@ -0,0 +1,92 @@
:root {
<?php foreach ($_['vars'] as $key => $value): ?>
<?php if ($key === 'opener'): ?>
--side-menu-<?php echo $key ?>: url('<?php print_unescaped(image_path('side_menu', $value.'.svg')); ?>');
<?php else: ?>
--side-menu-<?php echo $key ?>: <?php echo $value ?>;
<?php endif; ?>
<?php endforeach; ?>
}
<?php if ($_['opener-only'] === true): ?>
#nextcloud {
display: none;
}
<?php endif; ?>
<?php if ($_['display-logo'] === false): ?>
.side-menu-logo {
display: none;
}
.side-menu-header {
height: 50px;
}
.side-menu-apps-list {
height: calc(100vh - 60px);
top: 60px;
}
#side-menu.hide-opener .side-menu-header {
display: none;
}
#side-menu.hide-opener .side-menu-apps-list {
height: calc(100vh);
top: 0;
}
<?php if ($_['size-text'] === 'hidden'): ?>
#side-menu, .side-menu-apps-list {
<?php if ($_['size-icon'] === 'big'): ?>
width: 55px;
<?php else: ?>
width: 52px;
<?php endif; ?>
}
#side-menu .side-menu-opener {
<?php if ($_['size-icon'] === 'big'): ?>
margin-left: 6px;
<?php else: ?>
margin-left: 4px;
<?php endif; ?>
}
<?php endif; ?>
<?php endif; ?>
<?php if ($_['size-icon'] === 'hidden'): ?>
.side-menu-app-icon {
display: none;
}
<?php elseif ($_['size-icon'] === 'small'): ?>
.side-menu-app-icon svg {
width: 15px;
height: 15px;
}
<?php elseif ($_['size-icon'] === 'normal'): ?>
.side-menu-app-icon svg {
width: 20px;
height: 20px;
}
<?php elseif ($_['size-icon'] === 'big'): ?>
.side-menu-app-icon svg {
width: 23px;
height: 23px;
}
<?php endif; ?>
<?php if ($_['size-text'] === 'hidden'): ?>
.side-menu-app-text {
display: none;
}
<?php elseif ($_['size-text'] === 'small'): ?>
.side-menu-app-text {
font-size: 12px;
}
<?php elseif ($_['size-text'] === 'big'): ?>
.side-menu-app-text {
font-size: 16px;
}
<?php endif; ?>
+57
View File
@@ -0,0 +1,57 @@
(function() {
var sideMenuContainer = $('<div id="side-menu-container">')
var sideMenuOpener = $('<button class="side-menu-opener"></button>')
var sideMenu = $('<div id="side-menu">')
var body = $('body')
body.append(sideMenuContainer)
sideMenuContainer.append(sideMenu)
<?php if ($_['opener-position'] === 'before'): ?>
sideMenuOpener.insertBefore('#nextcloud')
<?php else: ?>
sideMenuOpener.insertAfter('#nextcloud')
<?php endif; ?>
var isTouchDevice = window.matchMedia("(pointer: coarse)").matches
body.on('side-menu.ready', function() {
sideMenu = $('#side-menu')
var headerMenuOpener = $('#header .side-menu-opener')
var sideMenuOpener = $('#side-menu .side-menu-opener')
<?php if ($_['opener-hover']): ?>
var sideMenuMouseLeave = function() {
sideMenu
.removeClass('open')
.off('mouseleave', sideMenuMouseLeave)
}
var sideMenuMouseEnter = function() {
sideMenu.on('mouseleave', sideMenuMouseLeave)
}
var sideMenuOpenerMouseEnter = function() {
sideMenu
.addClass('open')
.on('mouseenter', sideMenuMouseEnter)
}
if (!isTouchDevice) {
headerMenuOpener.on('mouseenter', sideMenuOpenerMouseEnter)
sideMenu.addClass('hide-opener')
}
<?php endif; ?>
headerMenuOpener.on('click', function() {
sideMenu.addClass('open');
})
sideMenuOpener.on('click', function() {
sideMenu.removeClass('open');
})
})
})();
+239
View File
@@ -0,0 +1,239 @@
<?php
/**
* @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/>.
*/
script('side_menu', 'admin');
style('side_menu', 'admin');
style('side_menu', 'support');
$choicesYesNo = [
'No' => '0',
'Yes' => '1',
];
$choicesSizes = [
'Hidden' => 'hidden',
'Small' => 'small',
'Normal' => 'normal',
'Big' => 'big',
];
?>
<div id="side-menu-section">
<div class="section">
<h2>
<?php p($l->t('Colors')); ?>
</h2>
<div>
<label for="side-menu-background-color" class="settings-hint">
<?php p($l->t('Background color')); ?>
</label>
</div>
<div>
<input
id="side-menu-background-color"
name="background-color"
type="color"
value="<?php print_unescaped($_['background-color']); ?>">
<input
id="side-menu-background-color-to"
name="background-color-to"
type="color"
value="<?php print_unescaped($_['background-color-to']); ?>">
</div>
<div>
<label for="side-menu-current-app-background-color" class="settings-hint">
<?php p($l->t('Background color of current app')); ?>
</label>
</div>
<div>
<input
id="side-menu-current-app-background-color"
name="current-app-background-color"
type="color"
value="<?php print_unescaped($_['current-app-background-color']); ?>">
</div>
<div>
<label for="side-menu-text-color" class="settings-hint">
<?php p($l->t('Text color')); ?>
</label>
</div>
<div>
<input
id="side-menu-text-color"
name="text-color"
type="color"
value="<?php print_unescaped($_['text-color']); ?>">
</div>
</div>
<div class="section">
<h2>
<?php p($l->t('Opener')); ?>
</h2>
<?php
$choices = [
'Default' => 'side-menu-opener',
'Hamburger' => 'side-menu-opener-hamburger',
'Hamburger 2' => 'side-menu-opener-hamburger-2',
];
?>
<div>
<label for="side-menu-opener" class="settings-hint">
<?php p($l->t('Icon')); ?>
</label>
</div>
<div>
<select id="side-menu-opener" name="opener">
<?php foreach ($choices as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['opener']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<?php
$choices = [
'Before the logo' => 'before',
'After the logo' => 'after',
];
?>
<div>
<label for="side-menu-opener-position" class="settings-hint">
<?php p($l->t('Position')); ?>
</label>
</div>
<div>
<select id="side-menu-opener-position" name="opener-position">
<?php foreach ($choices as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['opener-position']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-opener-only" class="settings-hint">
<?php p($l->t('Show only the opener (hidden logo)')); ?>
</label>
</div>
<div>
<select id="side-menu-opener-only" name="opener-only">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['opener-only']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="section">
<h2>
<?php p($l->t('Panel')); ?>
</h2>
<div>
<label for="side-menu-opener" class="settings-hint">
<?php p($l->t('Open the menu when the mouse is hover the opener (automatically disabled on touch screens)')); ?>
</label>
</div>
<div>
<select id="side-menu-opener-hover" name="opener-hover">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['opener-hover']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label for="side-menu-opener" class="settings-hint">
<?php p($l->t('Display the logo')); ?>
</label>
</div>
<div>
<select id="side-menu-display-logo" name="display-logo">
<?php foreach ($choicesYesNo as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['display-logo']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label class="settings-hint">
<?php p($l->t('Icons and texts')); ?>
</label>
</div>
<div>
<select id="side-menu-size-icon" name="size-icon">
<?php foreach ($choicesSizes as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['size-icon']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?> icon
</option>
<?php endforeach; ?>
</select>
<select id="side-menu-size-text" name="size-text">
<?php foreach ($choicesSizes as $label => $value): ?>
<option value="<?php echo $value ?>" <?php if ($value === $_['size-text']): ?>selected<?php endif; ?>>
<?php echo $l->t($label); ?> text
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="section">
<input type="hidden" id="side-menu-cache" name="cache" value="<?php print_unescaped($_['cache']); ?>">
<button id="side-menu-save" class="btn btn-primary"><?php p($l->t('Save')); ?></button>
<span id="side-menu-message" class="msg"></span>
<div style="height: 30px"></div>
<div>
<span for="side-menu-opener" class="settings-hint">
<?php p($l->t('You like this app and you want to support me?')); ?>
<a style="margin-left: 10px" target="_blank" href="https://www.buymeacoffee.com/deblan">
<button>
<?php p($l->t('Buy me a coffe ☕')); ?>
</button>
</a>
</span>
</div>
</div>
</div>
+1 -1
View File
@@ -4,7 +4,7 @@ const StyleLintPlugin = require('stylelint-webpack-plugin')
module.exports = { module.exports = {
entry: { entry: {
'main': path.join(__dirname, 'src', 'main.js'), 'admin': path.join(__dirname, 'src', 'admin.js'),
'sideMenu': path.join(__dirname, 'src', 'SideMenu.js'), 'sideMenu': path.join(__dirname, 'src', 'SideMenu.js'),
}, },
output: { output: {