Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d0c072bee5 | |||
| 95f7eb5980 | |||
| 18314b260f | |||
| e3c159b4d6 | |||
| a48611edf4 | |||
| 5dde7ca850 | |||
| db2f7becae | |||
| 1715ae5d52 | |||
| 847fa23345 | |||
| 0495046d02 | |||
| 0474ef55e8 | |||
| 7c9653943a | |||
| 457bfc282b | |||
| 84c78538f0 | |||
| f0d17a61bd | |||
| fdbeaf6677 | |||
| 9d18b33715 | |||
| bfb2b5d819 | |||
| a6e789c859 | |||
| 0cceb03213 | |||
| 91db830ea7 | |||
| af69d64e87 | |||
| f4ec00c9f7 | |||
| 8b20b11ce2 | |||
| e597ed95a3 | |||
| bf3493bb03 | |||
| fe665d58a9 | |||
| 407073dd98 | |||
| f85b5de28d | |||
| ee5be2cf21 | |||
| 91195d0160 | |||
| 29e0526844 | |||
| 8d2818150c | |||
| 299abe5e96 | |||
| 47bcf68218 | |||
| 2b32f6e50a | |||
| bf26217c55 | |||
| 39ffc91d43 | |||
| ec8b0a2866 | |||
| b9bb3989f4 | |||
| d07af9ddf9 | |||
| da6f89d5c1 | |||
| e6520336ce |
@@ -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
|
||||||
|
|
||||||
|
...
|
||||||
@@ -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
|
||||||
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
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
@@ -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
@@ -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.3</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/5ea42d1a.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>
|
||||||
|
|||||||
@@ -19,5 +19,7 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'routes' => [
|
'routes' => [
|
||||||
|
['name' => 'Css#stylesheet', 'url' => '/css/stylesheet', 'verb' => 'GET'],
|
||||||
|
['name' => 'Js#script', 'url' => '/js/script', 'verb' => 'GET'],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -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');
|
|
||||||
})
|
|
||||||
+21
-11
@@ -26,26 +26,29 @@
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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 +63,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 +85,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#side-menu.hide-opener .side-menu-logo {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -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 |
@@ -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
@@ -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 |
@@ -0,0 +1,75 @@
|
|||||||
|
<?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),
|
||||||
|
'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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
<?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'),
|
||||||
|
'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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-11
@@ -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() {
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
/**
|
||||||
|
* @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-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)
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
: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 ($_['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; ?>
|
||||||
@@ -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');
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})();
|
||||||
@@ -0,0 +1,222 @@
|
|||||||
|
<?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',
|
||||||
|
];
|
||||||
|
?>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<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
@@ -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: {
|
||||||
|
|||||||
Reference in New Issue
Block a user