Merge branch 'master' of gitnet.fr:deblan/side_menu
26
CHANGELOG.md
|
@ -1,5 +1,31 @@
|
|||
## [Unreleased]
|
||||
|
||||
## 2.3.2
|
||||
### Fixed
|
||||
- fix hidden menu
|
||||
|
||||
## 2.3.1
|
||||
### Fixed
|
||||
- fix #88: does not work with default menu
|
||||
|
||||
## 2.3.0
|
||||
### Added
|
||||
- fix #82: add an option to keep visible an app in both menus
|
||||
- fix #83: add custom categories
|
||||
- add auto-reload when settings are saved
|
||||
|
||||
## 2.2.0
|
||||
### Added
|
||||
- fix #84: update icons
|
||||
- fix #85: use Nextcloud colors by default
|
||||
|
||||
### Fixed
|
||||
- fix categories order in large menu
|
||||
|
||||
## 2.1.0
|
||||
### Added
|
||||
- add compatibility with Nextcloud 23
|
||||
|
||||
## 2.0.1
|
||||
### Fixed
|
||||
- fix #78: Top menu is broken - invisible apps are shown
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===============================
|
||||
|
||||
Allows you to modify the position of the main menu by creating a panel on the left of the interface or with a big menu on the top.
|
||||
You can also define apps that must be displayed in the top menu. Fully customisable.
|
||||
You can also add and sort custom categories, define apps that must be displayed in the top menu, etc. Fully customisable.
|
||||
|
||||
This application is rather suitable for instances that activate a lot of applications.
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ If you like this application and if you want to support the development:
|
|||
* [Donate with liberapay](https://liberapay.com/deblan)
|
||||
* [Leave a comment](https://apps.nextcloud.com/apps/side_menu#comments)
|
||||
]]></description>
|
||||
<version>2.0.1</version>
|
||||
<version>2.3.2</version>
|
||||
<licence>agpl</licence>
|
||||
<author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
|
||||
<namespace>SideMenu</namespace>
|
||||
|
@ -46,7 +46,7 @@ If you like this application and if you want to support the development:
|
|||
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/nc20_big_menu_responsive.png</screenshot>
|
||||
<screenshot>https://gitnet.fr/deblan/side_menu/raw/branch/master/screenshots/personal_settings.png</screenshot>
|
||||
<dependencies>
|
||||
<nextcloud min-version="19" max-version="22"/>
|
||||
<nextcloud min-version="19" max-version="23"/>
|
||||
<php min-version="7.3"/>
|
||||
</dependencies>
|
||||
<settings>
|
||||
|
|
|
@ -97,6 +97,10 @@
|
|||
margin-top: -1px;
|
||||
}
|
||||
|
||||
#apps-categories-custom-list select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.side-menu-setting-table {
|
||||
display: table;
|
||||
|
@ -115,7 +119,7 @@
|
|||
|
||||
.side-menu-setting-form {
|
||||
display: table-cell;
|
||||
width: 300px;
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
.side-menu-setting-label-short {
|
||||
|
|
|
@ -1,6 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583">
|
||||
<g color="#000" fill="#fff">
|
||||
<rect transform="rotate(135)" ry=".545" rx=".545" y="-8.209" x="-3.608" height="1.451" width="7.216" style="marker:none" overflow="visible" paint-order="stroke markers fill"/>
|
||||
<rect transform="rotate(-135)" ry=".545" rx=".545" y="-.726" x="-11.091" height="1.451" width="7.216" style="marker:none" overflow="visible" paint-order="stroke markers fill"/>
|
||||
</g>
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583"><g fill="#fff" color="#000" transform="translate(-.067 .224)"><rect width="5.027" height=".777" x="-2.307" y="6.984" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none" transform="rotate(-45)"/><rect width="5.027" height=".777" x="4.859" y="-.595" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none" transform="rotate(45)"/></g></svg>
|
Before Width: | Height: | Size: 498 B After Width: | Height: | Size: 495 B |
|
@ -1,173 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="0 0 10.583 10.583"
|
||||
version="1.1"
|
||||
id="svg935"
|
||||
sodipodi:docname="side-menu-opener-dark.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
|
||||
<metadata
|
||||
id="metadata941">
|
||||
<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></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs939" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1918"
|
||||
inkscape:window-height="1008"
|
||||
id="namedview937"
|
||||
showgrid="false"
|
||||
inkscape:zoom="8.34386"
|
||||
inkscape:cx="83.025045"
|
||||
inkscape:cy="14.304895"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="41"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg935" />
|
||||
<g
|
||||
transform="translate(.3 -286.074)"
|
||||
fill="#fff"
|
||||
color="#000"
|
||||
fill-opacity=".855"
|
||||
id="g933"
|
||||
style="fill:#000000;fill-opacity:0.89855075">
|
||||
<rect
|
||||
ry="0"
|
||||
rx="0"
|
||||
y="288.474"
|
||||
x="4.266"
|
||||
height="1.451"
|
||||
width="1.451"
|
||||
style="marker:none;fill:#000000;fill-opacity:0.89855075"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect909" />
|
||||
<g
|
||||
transform="translate(-.13)"
|
||||
id="g915"
|
||||
style="fill:#000000;fill-opacity:0.89855075">
|
||||
<rect
|
||||
style="marker:none;fill:#000000;fill-opacity:0.89855075"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="6.445"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect911" />
|
||||
<rect
|
||||
style="marker:none;fill:#000000;fill-opacity:0.89855075"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="2.345"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect913" />
|
||||
</g>
|
||||
<rect
|
||||
ry="0"
|
||||
rx="0"
|
||||
y="290.631"
|
||||
x="4.266"
|
||||
height="1.451"
|
||||
width="1.451"
|
||||
style="marker:none;fill:#000000;fill-opacity:0.89855075"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect917" />
|
||||
<g
|
||||
transform="translate(-.13 2.157)"
|
||||
id="g923"
|
||||
style="fill:#000000;fill-opacity:0.89855075">
|
||||
<rect
|
||||
style="marker:none;fill:#000000;fill-opacity:0.89855075"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="6.445"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect919" />
|
||||
<rect
|
||||
style="marker:none;fill:#000000;fill-opacity:0.89855075"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="2.345"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect921" />
|
||||
</g>
|
||||
<rect
|
||||
ry="0"
|
||||
rx="0"
|
||||
y="292.808"
|
||||
x="4.266"
|
||||
height="1.451"
|
||||
width="1.451"
|
||||
style="marker:none;fill:#000000;fill-opacity:0.89855075"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect925" />
|
||||
<g
|
||||
transform="translate(-.13 4.334)"
|
||||
id="g931"
|
||||
style="fill:#000000;fill-opacity:0.89855075">
|
||||
<rect
|
||||
style="marker:none;fill:#000000;fill-opacity:0.89855075"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="6.445"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect927" />
|
||||
<rect
|
||||
style="marker:none;fill:#000000;fill-opacity:0.89855075"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="2.345"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect929" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583"><g fill-opacity=".898" color="#000" transform="matrix(.90559 0 0 .86896 .772 -247.893)"><rect width="1.451" height="1.451" x="4.266" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><g transform="translate(-.13)"><rect width="1.451" height="1.451" x="6.445" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="1.451" height="1.451" x="2.345" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g><rect width="1.451" height="1.451" x="4.266" y="290.631" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><g transform="translate(-.13 2.157)"><rect width="1.451" height="1.451" x="6.445" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="1.451" height="1.451" x="2.345" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g><rect width="1.451" height="1.451" x="4.266" y="292.808" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><g transform="translate(-.13 4.334)"><rect width="1.451" height="1.451" x="6.445" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="1.451" height="1.451" x="2.345" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g></g></svg>
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 1.6 KiB |
|
@ -1,102 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="0 0 10.583 10.583"
|
||||
version="1.1"
|
||||
id="svg1090"
|
||||
sodipodi:docname="side-menu-opener-hamburger-2-dark.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
|
||||
<metadata
|
||||
id="metadata1096">
|
||||
<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></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs1094" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1918"
|
||||
inkscape:window-height="1008"
|
||||
id="namedview1092"
|
||||
showgrid="false"
|
||||
inkscape:zoom="8.34386"
|
||||
inkscape:cx="84.523455"
|
||||
inkscape:cy="12.270318"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="41"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg1090" />
|
||||
<rect
|
||||
overflow="visible"
|
||||
style="marker:none;fill:#000000;fill-opacity:1"
|
||||
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"
|
||||
id="rect1082" />
|
||||
<rect
|
||||
overflow="visible"
|
||||
style="marker:none;fill:#000000;fill-opacity:1"
|
||||
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"
|
||||
id="rect1084" />
|
||||
<rect
|
||||
overflow="visible"
|
||||
style="marker:none;fill:#000000;fill-opacity:1"
|
||||
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"
|
||||
id="rect1086" />
|
||||
<path
|
||||
style="marker:none;fill:#000000;fill-opacity:1"
|
||||
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"
|
||||
id="path1088" />
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583"><rect width="7.62" height="7.62" x="1.482" y="1.482" fill="none" stroke="#000" stroke-linecap="square" stroke-width=".777" color="#000" overflow="visible" paint-order="markers fill stroke" rx="0" ry="0" style="marker:none"/><rect width="5.027" height=".777" x="2.778" y="3.148" color="#000" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="5.027" height=".777" x="2.778" y="6.658" color="#000" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="5.027" height=".777" x="2.778" y="4.936" color="#000" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></svg>
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 786 B |
|
@ -1,101 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="0 0 10.583 10.583"
|
||||
version="1.1"
|
||||
id="svg1443"
|
||||
sodipodi:docname="side-menu-opener-hamburger-2.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
|
||||
<metadata
|
||||
id="metadata1449">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs1447" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1918"
|
||||
inkscape:window-height="1008"
|
||||
id="namedview1445"
|
||||
showgrid="false"
|
||||
inkscape:zoom="5.9"
|
||||
inkscape:cx="90.508475"
|
||||
inkscape:cy="4.5762712"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="41"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg1443" />
|
||||
<rect
|
||||
overflow="visible"
|
||||
style="marker:none;fill:#ffffff;fill-opacity:1"
|
||||
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"
|
||||
id="rect1435" />
|
||||
<rect
|
||||
overflow="visible"
|
||||
style="marker:none;fill:#ffffff;fill-opacity:1"
|
||||
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"
|
||||
id="rect1437" />
|
||||
<rect
|
||||
overflow="visible"
|
||||
style="marker:none;fill:#ffffff;fill-opacity:1"
|
||||
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"
|
||||
id="rect1439" />
|
||||
<path
|
||||
style="marker:none;fill:#ffffff;fill-opacity:1"
|
||||
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"
|
||||
id="path1441" />
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583"><rect width="7.62" height="7.62" x="1.482" y="1.482" fill="none" stroke="#fff" stroke-linecap="square" stroke-width=".777" color="#000" overflow="visible" paint-order="markers fill stroke" rx="0" ry="0" style="marker:none"/><g fill="#fff" color="#000" transform="translate(0 .034)"><rect width="5.027" height=".777" x="2.778" y="3.114" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="5.027" height=".777" x="2.778" y="6.624" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="5.027" height=".777" x="2.778" y="4.903" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g></svg>
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 809 B |
|
@ -1,92 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="0 0 10.583 10.583"
|
||||
version="1.1"
|
||||
id="svg1168"
|
||||
sodipodi:docname="side-menu-opener-hamburger-dark.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
|
||||
<metadata
|
||||
id="metadata1174">
|
||||
<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></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs1172" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1918"
|
||||
inkscape:window-height="1008"
|
||||
id="namedview1170"
|
||||
showgrid="false"
|
||||
inkscape:zoom="5.9"
|
||||
inkscape:cx="112.71186"
|
||||
inkscape:cy="0.16949153"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="41"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg1168" />
|
||||
<g
|
||||
color="#000"
|
||||
fill="#fff"
|
||||
fill-opacity=".855"
|
||||
transform="translate(0 -286.417)"
|
||||
id="g1166"
|
||||
style="fill:#000000;fill-opacity:0.99637681">
|
||||
<rect
|
||||
ry=".545"
|
||||
rx="0"
|
||||
y="288.816"
|
||||
x="2.516"
|
||||
height="1.451"
|
||||
width="5.551"
|
||||
style="marker:none;fill:#000000;fill-opacity:0.99637681"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1160" />
|
||||
<rect
|
||||
ry=".545"
|
||||
rx="0"
|
||||
y="290.973"
|
||||
x="2.516"
|
||||
height="1.451"
|
||||
width="5.551"
|
||||
style="marker:none;fill:#000000;fill-opacity:0.99637681"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1162" />
|
||||
<rect
|
||||
ry=".545"
|
||||
rx="0"
|
||||
y="293.15"
|
||||
x="2.516"
|
||||
height="1.451"
|
||||
width="5.551"
|
||||
style="marker:none;fill:#000000;fill-opacity:0.99637681"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1164" />
|
||||
</g>
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583"><g color="#000" transform="matrix(.85624 0 0 .9944 .747 .03)"><g transform="matrix(1.0055 0 0 1 -.013 0)"><rect width="5.839" height=".782" x="2.372" y="2.764" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="5.839" height=".782" x="2.372" y="7.037" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g><rect width="5.871" height=".782" x="2.372" y="4.901" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g></svg>
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 637 B |
|
@ -1,91 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="0 0 10.583 10.583"
|
||||
version="1.1"
|
||||
id="svg1382"
|
||||
sodipodi:docname="side-menu-opener-hamburger.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
|
||||
<metadata
|
||||
id="metadata1388">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs1386" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1918"
|
||||
inkscape:window-height="1008"
|
||||
id="namedview1384"
|
||||
showgrid="false"
|
||||
inkscape:zoom="5.9"
|
||||
inkscape:cx="108.13559"
|
||||
inkscape:cy="3.8983051"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="41"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg1382" />
|
||||
<g
|
||||
color="#000"
|
||||
fill="#fff"
|
||||
fill-opacity=".855"
|
||||
transform="translate(0 -286.417)"
|
||||
id="g1380"
|
||||
style="fill:#ffffff;fill-opacity:1">
|
||||
<rect
|
||||
ry=".545"
|
||||
rx="0"
|
||||
y="288.816"
|
||||
x="2.516"
|
||||
height="1.451"
|
||||
width="5.551"
|
||||
style="marker:none;fill:#ffffff;fill-opacity:1"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1374" />
|
||||
<rect
|
||||
ry=".545"
|
||||
rx="0"
|
||||
y="290.973"
|
||||
x="2.516"
|
||||
height="1.451"
|
||||
width="5.551"
|
||||
style="marker:none;fill:#ffffff;fill-opacity:1"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1376" />
|
||||
<rect
|
||||
ry=".545"
|
||||
rx="0"
|
||||
y="293.15"
|
||||
x="2.516"
|
||||
height="1.451"
|
||||
width="5.551"
|
||||
style="marker:none;fill:#ffffff;fill-opacity:1"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1378" />
|
||||
</g>
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583"><g fill="#fff" color="#000" transform="matrix(.85624 0 0 .9944 .747 .03)"><g transform="matrix(1.0055 0 0 1 -.013 0)"><rect width="5.839" height=".782" x="2.372" y="2.764" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="5.839" height=".782" x="2.372" y="7.037" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g><rect width="5.871" height=".782" x="2.372" y="4.901" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g></svg>
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 649 B |
|
@ -1,172 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="0 0 10.583 10.583"
|
||||
version="1.1"
|
||||
id="svg1321"
|
||||
sodipodi:docname="side-menu-opener.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
|
||||
<metadata
|
||||
id="metadata1327">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs1325" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1918"
|
||||
inkscape:window-height="1008"
|
||||
id="namedview1323"
|
||||
showgrid="false"
|
||||
inkscape:zoom="5.9"
|
||||
inkscape:cx="78.983051"
|
||||
inkscape:cy="5.5932203"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="41"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg1321" />
|
||||
<g
|
||||
transform="translate(.3 -286.074)"
|
||||
fill="#fff"
|
||||
color="#000"
|
||||
fill-opacity=".855"
|
||||
id="g1319"
|
||||
style="fill:#ffffff;fill-opacity:0.94565219">
|
||||
<rect
|
||||
ry="0"
|
||||
rx="0"
|
||||
y="288.474"
|
||||
x="4.266"
|
||||
height="1.451"
|
||||
width="1.451"
|
||||
style="marker:none;fill:#ffffff;fill-opacity:0.94565219"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1295" />
|
||||
<g
|
||||
transform="translate(-.13)"
|
||||
id="g1301"
|
||||
style="fill:#ffffff;fill-opacity:0.94565219">
|
||||
<rect
|
||||
style="marker:none;fill:#ffffff;fill-opacity:0.94565219"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="6.445"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1297" />
|
||||
<rect
|
||||
style="marker:none;fill:#ffffff;fill-opacity:0.94565219"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="2.345"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1299" />
|
||||
</g>
|
||||
<rect
|
||||
ry="0"
|
||||
rx="0"
|
||||
y="290.631"
|
||||
x="4.266"
|
||||
height="1.451"
|
||||
width="1.451"
|
||||
style="marker:none;fill:#ffffff;fill-opacity:0.94565219"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1303" />
|
||||
<g
|
||||
transform="translate(-.13 2.157)"
|
||||
id="g1309"
|
||||
style="fill:#ffffff;fill-opacity:0.94565219">
|
||||
<rect
|
||||
style="marker:none;fill:#ffffff;fill-opacity:0.94565219"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="6.445"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1305" />
|
||||
<rect
|
||||
style="marker:none;fill:#ffffff;fill-opacity:0.94565219"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="2.345"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1307" />
|
||||
</g>
|
||||
<rect
|
||||
ry="0"
|
||||
rx="0"
|
||||
y="292.808"
|
||||
x="4.266"
|
||||
height="1.451"
|
||||
width="1.451"
|
||||
style="marker:none;fill:#ffffff;fill-opacity:0.94565219"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1311" />
|
||||
<g
|
||||
transform="translate(-.13 4.334)"
|
||||
id="g1317"
|
||||
style="fill:#ffffff;fill-opacity:0.94565219">
|
||||
<rect
|
||||
style="marker:none;fill:#ffffff;fill-opacity:0.94565219"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="6.445"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1313" />
|
||||
<rect
|
||||
style="marker:none;fill:#ffffff;fill-opacity:0.94565219"
|
||||
width="1.451"
|
||||
height="1.451"
|
||||
x="2.345"
|
||||
y="288.474"
|
||||
rx="0"
|
||||
ry="0"
|
||||
overflow="visible"
|
||||
paint-order="stroke markers fill"
|
||||
id="rect1315" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 10.583 10.583"><g fill="#fff" fill-opacity=".946" color="#000" transform="matrix(.90559 0 0 .86896 .772 -247.893)"><rect width="1.451" height="1.451" x="4.266" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><g transform="translate(-.13)"><rect width="1.451" height="1.451" x="6.445" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="1.451" height="1.451" x="2.345" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g><rect width="1.451" height="1.451" x="4.266" y="290.631" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><g transform="translate(-.13 2.157)"><rect width="1.451" height="1.451" x="6.445" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="1.451" height="1.451" x="2.345" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g><rect width="1.451" height="1.451" x="4.266" y="292.808" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><g transform="translate(-.13 4.334)"><rect width="1.451" height="1.451" x="6.445" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/><rect width="1.451" height="1.451" x="2.345" y="288.474" overflow="visible" paint-order="stroke markers fill" rx="0" ry="0" style="marker:none"/></g></g></svg>
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 1.6 KiB |
|
@ -27,6 +27,8 @@ use OCP\AppFramework\Http\Response;
|
|||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\IRequest;
|
||||
use OCP\IUserSession;
|
||||
use OCA\Theming\ThemingDefaults;
|
||||
use OCA\SideMenu\Service\Color;
|
||||
|
||||
class CssController extends Controller
|
||||
{
|
||||
|
@ -40,12 +42,30 @@ class CssController extends Controller
|
|||
*/
|
||||
protected $user;
|
||||
|
||||
public function __construct(string $appName, IRequest $request, ConfigProxy $config)
|
||||
/**
|
||||
* @var ThemingDefaults
|
||||
*/
|
||||
protected $theming;
|
||||
|
||||
/**
|
||||
* @var Color
|
||||
*/
|
||||
protected $color;
|
||||
|
||||
public function __construct(
|
||||
string $appName,
|
||||
IRequest $request,
|
||||
ConfigProxy $config,
|
||||
ThemingDefaults $theming,
|
||||
Color $color
|
||||
)
|
||||
{
|
||||
parent::__construct($appName, $request);
|
||||
|
||||
$this->user = OC::$server[IUserSession::class]->getUser();
|
||||
$this->config = $config;
|
||||
$this->theming = $theming;
|
||||
$this->color = $color;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,6 +87,7 @@ class CssController extends Controller
|
|||
{
|
||||
$isForced = $this->config->getAppValueBool('force', '0');
|
||||
$topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]');
|
||||
$topSideMenuApps = $this->config->getAppValueArray('top-side-menu-apps', '[]');
|
||||
|
||||
$isAccessibilityAppEnabled = $this->config->getAppValueBool('enabled', '0', 'accessibility');
|
||||
$isBreezeDarkAppEnabled = $this->config->getAppValueBool('enabled', '0', 'breezedark');
|
||||
|
@ -74,11 +95,16 @@ class CssController extends Controller
|
|||
|
||||
if ($this->user) {
|
||||
$userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]');
|
||||
$userTopSideMenuApps = $this->config->getUserValueArray($this->user, 'top-side-menu-apps', '[]');
|
||||
|
||||
if (!empty($userTopMenuApps) && !$isForced) {
|
||||
$topMenuApps = $userTopMenuApps;
|
||||
}
|
||||
|
||||
if (!empty($userTopSideMenuApps) && !$isForced) {
|
||||
$topSideMenuApps = $userTopSideMenuApps;
|
||||
}
|
||||
|
||||
$isDarkThemeUserEnabled = $this->config->getUserValue($this->user, 'theme', '', 'accessibility') === 'dark';
|
||||
$isBreezeDarkUserEnabled = $this->config->getUserValue($this->user, 'theme_enabled', '', 'breezedark');
|
||||
|
||||
|
@ -90,23 +116,29 @@ class CssController extends Controller
|
|||
|
||||
$isDarkMode = ($isAccessibilityAppEnabled && $isDarkThemeUserEnabled) || ($isBreezeDarkAppEnabled && $isBreezeDarkUserEnabled);
|
||||
|
||||
$primaryColor = $this->theming->getColorPrimary();
|
||||
$lightenPrimaryColor = $this->color->adjustBrightness($primaryColor, 0.2);
|
||||
$darkenPrimaryColor = $this->color->adjustBrightness($primaryColor, -0.2);
|
||||
$darkenPrimaryColor2 = $this->color->adjustBrightness($primaryColor, -0.3);
|
||||
$textColor = $this->theming->getTextColorPrimary();
|
||||
|
||||
if ($isDarkMode) {
|
||||
$backgroundColor = $this->config->getAppValue('dark-mode-background-color', '#333333');
|
||||
$backgroundColorTo = $this->config->getAppValue('dark-mode-background-color-to', $backgroundColor);
|
||||
$currentAppBackgroundColor = $this->config->getAppValue('dark-mode-current-app-background-color', '#444444');
|
||||
$loaderColor = $this->config->getAppValue('dark-mode-loader-color', '#cccccc');
|
||||
$textColor = $this->config->getAppValue('dark-mode-text-color', '#FFFFFF');
|
||||
$backgroundColor = $this->config->getAppValue('dark-mode-background-color', $darkenPrimaryColor);
|
||||
$backgroundColorTo = $this->config->getAppValue('dark-mode-background-color-to', $darkenPrimaryColor);
|
||||
$currentAppBackgroundColor = $this->config->getAppValue('dark-mode-current-app-background-color', $darkenPrimaryColor2);
|
||||
$loaderColor = $this->config->getAppValue('dark-mode-loader-color', $lightenPrimaryColor);
|
||||
$textColor = $this->config->getAppValue('dark-mode-text-color', $textColor);
|
||||
$iconInvertFilter = abs($this->config->getAppValueInt('dark-mode-icon-invert-filter', '0')).'%';
|
||||
$iconOpacity = abs($this->config->getAppValueInt('dark-mode-icon-opacity', '100') / 100);
|
||||
$opener = $this->config->getAppValue('dark-mode-opener', 'side-menu-opener');
|
||||
|
||||
$backgroundOpacity = dechex($this->config->getAppValueInt('dark-mode-background-color-opacity', '100') * 255 / 100);
|
||||
} else {
|
||||
$backgroundColor = $this->config->getAppValue('background-color', '#333333');
|
||||
$backgroundColorTo = $this->config->getAppValue('background-color-to', $backgroundColor);
|
||||
$currentAppBackgroundColor = $this->config->getAppValue('current-app-background-color', '#444444');
|
||||
$loaderColor = $this->config->getAppValue('loader-color', '#0e75ac');
|
||||
$textColor = $this->config->getAppValue('text-color', '#FFFFFF');
|
||||
$backgroundColor = $this->config->getAppValue('background-color', $darkenPrimaryColor);
|
||||
$backgroundColorTo = $this->config->getAppValue('background-color-to', $darkenPrimaryColor);
|
||||
$currentAppBackgroundColor = $this->config->getAppValue('current-app-background-color', $darkenPrimaryColor2);
|
||||
$loaderColor = $this->config->getAppValue('loader-color', $lightenPrimaryColor);
|
||||
$textColor = $this->config->getAppValue('text-color', $textColor);
|
||||
$iconInvertFilter = abs($this->config->getAppValueInt('icon-invert-filter', '0')).'%';
|
||||
$iconOpacity = abs($this->config->getAppValueInt('icon-opacity', '100') / 100);
|
||||
$opener = $this->config->getAppValue('opener', 'side-menu-opener');
|
||||
|
@ -136,6 +168,7 @@ class CssController extends Controller
|
|||
'always-displayed' => $this->config->getAppValueBool('always-displayed', '0'),
|
||||
'big-menu' => $this->config->getAppValueBool('big-menu', '0'),
|
||||
'top-menu-apps' => $topMenuApps,
|
||||
'top-side-menu-apps' => $topSideMenuApps,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,6 +94,7 @@ class JsController extends Controller
|
|||
protected function getConfig(): array
|
||||
{
|
||||
$topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]');
|
||||
$topSideMenuApps = $this->config->getAppValueArray('top-side-menu-apps', '[]');
|
||||
$targetBlankApps = $this->config->getAppValueArray('target-blank-apps', '[]');
|
||||
$useAvatar = $this->config->getAppValueBool('use-avatar', '0');
|
||||
$isForced = $this->config->getAppValueBool('force', '0');
|
||||
|
@ -103,11 +104,16 @@ class JsController extends Controller
|
|||
|
||||
if ($this->user) {
|
||||
$userTopMenuApps = $this->config->getUserValueArray($this->user, 'top-menu-apps', '[]');
|
||||
$userTopSideMenuApps = $this->config->getUserValueArray($this->user, 'top-side-menu-apps', '[]');
|
||||
|
||||
if (!empty($userTopMenuApps) && !$isForced) {
|
||||
$topMenuApps = $userTopMenuApps;
|
||||
}
|
||||
|
||||
if (!empty($userTopSideMenuApps) && !$isForced) {
|
||||
$topSideMenuApps = $userTopSideMenuApps;
|
||||
}
|
||||
|
||||
$userTargetBlankMode = $this->config->getUserValueInt($this->user, 'target-blank-mode', '1');
|
||||
$userTargetBlankApps = $this->config->getUserValueArray($this->user, 'target-blank-apps', '[]');
|
||||
|
||||
|
@ -157,6 +163,7 @@ class JsController extends Controller
|
|||
'big-menu-hidden-apps' => $this->config->getAppValueArray('big-menu-hidden-apps', '[]'),
|
||||
'avatar' => $avatar,
|
||||
'top-menu-apps' => $topMenuApps,
|
||||
'top-side-menu-apps' => $topSideMenuApps,
|
||||
'target-blank-apps' => $targetBlankApps,
|
||||
'settings' => $settings,
|
||||
'logo' => $this->themingDefaults->getLogo(),
|
||||
|
|
|
@ -187,9 +187,18 @@ class NavController extends Controller
|
|||
|
||||
usort($items, function ($a, $b) use ($categoriesLabels) {
|
||||
foreach ($categoriesLabels as $key => $value) {
|
||||
if ($a['categoryId'] === 'other') {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ($b['categoryId'] === 'other') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($a['categoryId'] === $key) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ($b['categoryId'] === $key) {
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class PersonalSettingController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if ('top-menu-apps' === $name) {
|
||||
if (in_array($name, ['top-menu-apps', 'top-side-menu-apps'])) {
|
||||
$doSave = true;
|
||||
$data = json_decode($value, true);
|
||||
|
||||
|
|
|
@ -21,10 +21,27 @@ class AppRepository
|
|||
*/
|
||||
protected $l10nFactory;
|
||||
|
||||
public function __construct(\OC_App $ocApp, IFactory $l10nFactory)
|
||||
/**
|
||||
* @var ConfigProxy
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var CategoryRepository
|
||||
*/
|
||||
protected $categoryRepository;
|
||||
|
||||
public function __construct(
|
||||
\OC_App $ocApp,
|
||||
IFactory $l10nFactory,
|
||||
ConfigProxy $config,
|
||||
CategoryRepository $categoryRepository
|
||||
)
|
||||
{
|
||||
$this->ocApp = $ocApp;
|
||||
$this->l10nFactory = $l10nFactory;
|
||||
$this->config = $config;
|
||||
$this->categoryRepository = $categoryRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,6 +52,9 @@ class AppRepository
|
|||
public function getVisibleApps()
|
||||
{
|
||||
$navigation = $this->ocApp->getNavigation();
|
||||
$appCategoriesCustom = $this->config->getAppValueArray('apps-categories-custom', '[]');
|
||||
$categoriesCustom = $this->config->getAppValueArray('categories-custom', '[]');
|
||||
$categories = $this->categoryRepository->getOrderedCategories();
|
||||
$apps = $this->ocApp->listAllApps();
|
||||
$visibleApps = [];
|
||||
|
||||
|
@ -74,6 +94,12 @@ class AppRepository
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($visibleApps as $id => $app) {
|
||||
if (isset($appCategoriesCustom[$id], $categories[$appCategoriesCustom[$id]])) {
|
||||
$visibleApps[$id]['category'] = [$appCategoriesCustom[$id]];
|
||||
}
|
||||
}
|
||||
|
||||
usort($visibleApps, function ($a, $b) {
|
||||
return ($a['name'] < $b['name']) ? -1 : 1;
|
||||
});
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace OCA\SideMenu\Service;
|
|||
use OC\App\AppStore\Fetcher\CategoryFetcher;
|
||||
use OCA\SideMenu\AppInfo\Application;
|
||||
use OCP\IConfig;
|
||||
use OCP\IUserSession;
|
||||
use OCP\L10N\IFactory;
|
||||
|
||||
/**
|
||||
|
@ -34,16 +35,23 @@ class CategoryRepository
|
|||
*/
|
||||
protected $iConfig;
|
||||
|
||||
/**
|
||||
* @var IUserSession
|
||||
*/
|
||||
protected $userSession;
|
||||
|
||||
public function __construct(
|
||||
CategoryFetcher $categoryFetcher,
|
||||
ConfigProxy $config,
|
||||
IConfig $iConfig,
|
||||
IFactory $l10nFactory
|
||||
IFactory $l10nFactory,
|
||||
IUserSession $userSession
|
||||
) {
|
||||
$this->categoryFetcher = $categoryFetcher;
|
||||
$this->l10nFactory = $l10nFactory;
|
||||
$this->config = $config;
|
||||
$this->iConfig = $iConfig;
|
||||
$this->userSession = $userSession;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,8 +64,8 @@ class CategoryRepository
|
|||
$currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2);
|
||||
$type = $this->config->getAppValue('categories-order-type', 'default');
|
||||
$order = $this->config->getAppValueArray('categories-order', '[]');
|
||||
|
||||
$categoriesLabels = $this->config->getAppValueArray('cache-categories', '[]');
|
||||
$customCategories = $this->config->getAppValueArray('categories-custom', '[]');
|
||||
|
||||
if (empty($categoriesLabels)) {
|
||||
$categoriesLabels = $this->categoryFetcher->get();
|
||||
|
@ -74,6 +82,18 @@ class CategoryRepository
|
|||
$categoriesLabels['external_links'] = $this->l10nFactory->get('external')->t('External sites');
|
||||
$categoriesLabels['other'] = '';
|
||||
|
||||
$user = $this->userSession->getUser();
|
||||
|
||||
if ($user) {
|
||||
$lang = $this->iConfig->getUserValue($user->getUid(), 'core', 'lang');
|
||||
} else {
|
||||
$lang = 'en';
|
||||
}
|
||||
|
||||
foreach ($customCategories as $category) {
|
||||
$categoriesLabels[$category['id']] = $category[$lang] ?? $category['en'];
|
||||
}
|
||||
|
||||
asort($categoriesLabels);
|
||||
|
||||
if ('custom' === $type) {
|
||||
|
|
34
lib/Service/Color.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\SideMenu\Service;
|
||||
|
||||
/**
|
||||
* class Color.
|
||||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
class Color
|
||||
{
|
||||
/**
|
||||
* @thanks https://stackoverflow.com/posts/54393956/revision
|
||||
*/
|
||||
public function adjustBrightness(string $hexCode, float $adjustPercent): string
|
||||
{
|
||||
$hexCode = ltrim($hexCode, '#');
|
||||
|
||||
if (3 == strlen($hexCode)) {
|
||||
$hexCode = $hexCode[0].$hexCode[0].$hexCode[1].$hexCode[1].$hexCode[2].$hexCode[2];
|
||||
}
|
||||
|
||||
$hexCode = array_map('hexdec', str_split($hexCode, 2));
|
||||
|
||||
foreach ($hexCode as &$color) {
|
||||
$adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color;
|
||||
$adjustAmount = ceil($adjustableLimit * $adjustPercent);
|
||||
|
||||
$color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
return '#'.implode($hexCode);
|
||||
}
|
||||
}
|
43
lib/Service/LangRepository.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\SideMenu\Service;
|
||||
|
||||
use OCP\IDBConnection;
|
||||
|
||||
/**
|
||||
* class LangRepository.
|
||||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
class LangRepository
|
||||
{
|
||||
/**
|
||||
* @var IDBConnection
|
||||
*/
|
||||
protected $db;
|
||||
|
||||
public function __construct(IDBConnection $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
public function getUsedLangs(): array
|
||||
{
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
$qb->select($qb->createFunction('DISTINCT configvalue'))
|
||||
->where('configkey="lang" and appid="core" and configvalue<>"en"')
|
||||
->from('preferences')
|
||||
;
|
||||
|
||||
$stmt = $qb->execute();
|
||||
|
||||
$langs = ['en'];
|
||||
|
||||
foreach ($stmt->fetchAll() as $result) {
|
||||
$langs[] = $result['configvalue'];
|
||||
}
|
||||
|
||||
return $langs;
|
||||
}
|
||||
}
|
|
@ -26,6 +26,9 @@ use OCP\AppFramework\Http\TemplateResponse;
|
|||
use OCP\IL10N;
|
||||
use OCP\ILogger;
|
||||
use OCP\Settings\ISettings;
|
||||
use OCA\Theming\ThemingDefaults;
|
||||
use OCA\SideMenu\Service\Color;
|
||||
use OCA\SideMenu\Service\LangRepository;
|
||||
|
||||
class Admin implements ISettings
|
||||
{
|
||||
|
@ -54,18 +57,39 @@ class Admin implements ISettings
|
|||
*/
|
||||
private $categoryRepository;
|
||||
|
||||
/**
|
||||
* @var ThemingDefaults
|
||||
*/
|
||||
protected $theming;
|
||||
|
||||
/**
|
||||
* @var Color
|
||||
*/
|
||||
protected $color;
|
||||
|
||||
/**
|
||||
* @var LangRepository
|
||||
*/
|
||||
protected $langRepository;
|
||||
|
||||
public function __construct(
|
||||
IL10N $l,
|
||||
ILogger $logger,
|
||||
ConfigProxy $config,
|
||||
AppRepository $appRepository,
|
||||
CategoryRepository $categoryRepository
|
||||
CategoryRepository $categoryRepository,
|
||||
ThemingDefaults $theming,
|
||||
Color $color,
|
||||
LangRepository $langRepository
|
||||
) {
|
||||
$this->l = $l;
|
||||
$this->logger = $logger;
|
||||
$this->config = $config;
|
||||
$this->appRepository = $appRepository;
|
||||
$this->categoryRepository = $categoryRepository;
|
||||
$this->theming = $theming;
|
||||
$this->color = $color;
|
||||
$this->langRepository = $langRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,29 +97,35 @@ class Admin implements ISettings
|
|||
*/
|
||||
public function getForm()
|
||||
{
|
||||
$backgroundColor = $this->config->getAppValue('background-color', '#333333');
|
||||
$backgroundColorTo = $this->config->getAppValue('background-color-to', $backgroundColor);
|
||||
$primaryColor = $this->theming->getColorPrimary();
|
||||
$lightenPrimaryColor = $this->color->adjustBrightness($primaryColor, 0.2);
|
||||
$darkenPrimaryColor = $this->color->adjustBrightness($primaryColor, -0.2);
|
||||
$darkenPrimaryColor2 = $this->color->adjustBrightness($primaryColor, -0.3);
|
||||
$textColor = $this->theming->getTextColorPrimary();
|
||||
|
||||
$darkModeBackgroundColor = $this->config->getAppValue('dark-mode-background-color', '#333333');
|
||||
$darkModeBackgroundColorTo = $this->config->getAppValue('dark-mode-background-color-to', $darkModeBackgroundColor);
|
||||
$backgroundColor = $this->config->getAppValue('background-color', $darkenPrimaryColor);
|
||||
$backgroundColorTo = $this->config->getAppValue('background-color-to', $darkenPrimaryColor);
|
||||
|
||||
$darkModeBackgroundColor = $this->config->getAppValue('dark-mode-background-color', $darkenPrimaryColor);
|
||||
$darkModeBackgroundColorTo = $this->config->getAppValue('dark-mode-background-color-to', $darkenPrimaryColor);
|
||||
|
||||
$parameters = [
|
||||
'background-color' => $backgroundColor,
|
||||
'background-color-to' => $backgroundColorTo,
|
||||
'background-color-opacity' => $this->config->getAppValueInt('background-color-opacity', '100'),
|
||||
'current-app-background-color' => $this->config->getAppValue('current-app-background-color', '#444444'),
|
||||
'loader-color' => $this->config->getAppValue('loader-color', '#0e75ac'),
|
||||
'current-app-background-color' => $this->config->getAppValue('current-app-background-color', $darkenPrimaryColor2),
|
||||
'loader-color' => $this->config->getAppValue('loader-color', $lightenPrimaryColor),
|
||||
'icon-invert-filter' => $this->config->getAppValueInt('icon-invert-filter', '0'),
|
||||
'icon-opacity' => $this->config->getAppValueInt('icon-opacity', '100'),
|
||||
'text-color' => $this->config->getAppValue('text-color', '#FFFFFF'),
|
||||
'text-color' => $this->config->getAppValue('text-color', $textColor),
|
||||
'dark-mode-background-color' => $darkModeBackgroundColor,
|
||||
'dark-mode-background-color-to' => $darkModeBackgroundColorTo,
|
||||
'dark-mode-background-color-opacity' => $this->config->getAppValueInt('dark-mode-background-color-opacity', '100'),
|
||||
'dark-mode-current-app-background-color' => $this->config->getAppValue('dark-mode-current-app-background-color', '#444444'),
|
||||
'dark-mode-loader-color' => $this->config->getAppValue('dark-mode-loader-color', '#cccccc'),
|
||||
'dark-mode-current-app-background-color' => $this->config->getAppValue('dark-mode-current-app-background-color', $darkenPrimaryColor2),
|
||||
'dark-mode-loader-color' => $this->config->getAppValue('dark-mode-loader-color', $textColor),
|
||||
'dark-mode-icon-invert-filter' => $this->config->getAppValueInt('dark-mode-icon-invert-filter', '0'),
|
||||
'dark-mode-icon-opacity' => $this->config->getAppValueInt('dark-mode-icon-opacity', '100'),
|
||||
'dark-mode-text-color' => $this->config->getAppValue('dark-mode-text-color', '#FFFFFF'),
|
||||
'dark-mode-text-color' => $this->config->getAppValue('dark-mode-text-color', $textColor),
|
||||
'dark-mode-opener' => $this->config->getAppValue('dark-mode-opener', 'side-menu-opener'),
|
||||
'opener' => $this->config->getAppValue('opener', 'side-menu-opener'),
|
||||
'loader-enabled' => $this->config->getAppValue('loader-enabled', '1'),
|
||||
|
@ -117,11 +147,15 @@ class Admin implements ISettings
|
|||
'force' => $this->config->getAppValue('force', '0'),
|
||||
'target-blank-apps' => $this->config->getAppValueArray('target-blank-apps', '[]'),
|
||||
'top-menu-apps' => $this->config->getAppValueArray('top-menu-apps', '[]'),
|
||||
'top-side-menu-apps' => $this->config->getAppValueArray('top-side-menu-apps', '[]'),
|
||||
'default-enabled' => $this->config->getAppValue('default-enabled', '1'),
|
||||
'apps' => $this->appRepository->getVisibleApps(),
|
||||
'apps-categories-custom' => $this->config->getAppValueArray('apps-categories-custom', '[]'),
|
||||
'categories-order-type' => $this->config->getAppValue('categories-order-type', 'default'),
|
||||
'categories-order' => $this->config->getAppValueArray('categories-order', '[]'),
|
||||
'apps' => $this->appRepository->getVisibleApps(),
|
||||
'categories-custom' => $this->config->getAppValueArray('categories-custom', '[]'),
|
||||
'categories' => $this->categoryRepository->getOrderedCategories(),
|
||||
'langs' => $this->langRepository->getUsedLangs(),
|
||||
];
|
||||
|
||||
return new TemplateResponse(Application::APP_ID, 'settings/admin-form', $parameters, '');
|
||||
|
|
|
@ -78,6 +78,7 @@ class Personal implements ISettings
|
|||
$this->config->getAppValue('default-enabled', '1')
|
||||
),
|
||||
'top-menu-apps' => $this->config->getUserValueArray($user, 'top-menu-apps', '[]'),
|
||||
'top-side-menu-apps' => $this->config->getUserValueArray($user, 'top-side-menu-apps', '[]'),
|
||||
'target-blank-mode' => $this->config->getUserValue($user, 'target-blank-mode', '1'),
|
||||
'target-blank-apps' => $this->config->getUserValueArray($user, 'target-blank-apps', '[]'),
|
||||
'apps' => $this->appRepository->getVisibleApps(),
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
"stylelint:fix": "stylelint src --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nextcloud/axios": "^1.3.2",
|
||||
"@nextcloud/vue": "^1.4.0",
|
||||
"axios": "^0.19.2",
|
||||
"@nextcloud/axios": "^1.8.0",
|
||||
"@nextcloud/vue": "^1.5.0",
|
||||
"axios": "^0.24.0",
|
||||
"trim": "0.0.1",
|
||||
"vue": "^2.6.11"
|
||||
},
|
||||
|
|
182
src/AdminCategoriesCustom.vue
Normal file
|
@ -0,0 +1,182 @@
|
|||
<!--
|
||||
@license GNU AGPL version 3 or any later version
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<ul class="side-menu-setting-list">
|
||||
<li v-for="item in values" class="side-menu-setting-list-item" v-on:click="showEditForm(item)">
|
||||
<span v-html="item.en"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<Actions>
|
||||
<ActionButton @click="showAddForm" icon="icon-add"></ActionButton>
|
||||
</Actions>
|
||||
|
||||
<Modal v-if="addForm" @close="hideAddForm">
|
||||
<div class="modal__content">
|
||||
<div v-for="lang in langs">
|
||||
<span class="lang" v-html="lang"></span>
|
||||
<input type="text" v-model="newValue[lang]" required>
|
||||
</div>
|
||||
|
||||
<Actions>
|
||||
<ActionButton @click="saveAdd" icon="icon-checkmark"></ActionButton>
|
||||
</Actions>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
<Modal v-if="editForm" @close="hideEditForm">
|
||||
<div class="modal__content">
|
||||
<div v-for="lang in langs">
|
||||
<span class="lang" v-html="lang"></span>
|
||||
<input type="text" v-model="editValue[lang]" required>
|
||||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
<Actions>
|
||||
<ActionButton @click="removeEdit" icon="icon-delete"></ActionButton>
|
||||
</Actions>
|
||||
</div>
|
||||
|
||||
<Actions>
|
||||
<ActionButton @click="saveEdit" icon="icon-checkmark"></ActionButton>
|
||||
</Actions>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.modal__content {
|
||||
width: 200px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.modal__content .lang {
|
||||
width: 60px;
|
||||
display: inline-block;
|
||||
padding: 4px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.modal__content input[type=text] {
|
||||
width: calc(100% - 85px);
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.pull-right {
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import Modal from '@nextcloud/vue/dist/Components/Modal'
|
||||
import Actions from '@nextcloud/vue/dist/Components/Actions'
|
||||
import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
|
||||
|
||||
export default {
|
||||
name: 'AdminCategoriesCustom',
|
||||
components: {
|
||||
Modal,
|
||||
Actions,
|
||||
ActionButton,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
input: null,
|
||||
values: [],
|
||||
langs: [],
|
||||
addForm: false,
|
||||
editForm: false,
|
||||
newValue: {},
|
||||
editValue: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.values = JSON.parse(this.input.value)
|
||||
this.langs = JSON.parse(this.input.getAttribute('data-langs'))
|
||||
},
|
||||
update() {
|
||||
this.input.value = JSON.stringify(this.values)
|
||||
},
|
||||
showAddForm() {
|
||||
this.newValue = {id: 'cat' + Math.random().toString().replace('0.', '')}
|
||||
|
||||
this.addForm = true
|
||||
},
|
||||
showEditForm(value) {
|
||||
this.editValue = {id: value.id}
|
||||
|
||||
for (let i of this.langs) {
|
||||
this.editValue[i] = typeof value[i] !== 'undefined' ? value[i] : ''
|
||||
}
|
||||
|
||||
this.editForm = true
|
||||
},
|
||||
saveAdd() {
|
||||
for (let i of this.langs) {
|
||||
if (!this.newValue[i] || /^\s*$/.test(this.newValue[i])) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.values.push(this.newValue)
|
||||
this.update()
|
||||
this.hideAddForm()
|
||||
this.newValue = {}
|
||||
},
|
||||
saveEdit() {
|
||||
for (let i of this.langs) {
|
||||
if (!this.editValue[i] || /^\s*$/.test(this.editValue[i])) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
for (let i in this.values) {
|
||||
if (this.values[i].id === this.editValue.id) {
|
||||
this.values[i] = this.editValue
|
||||
}
|
||||
}
|
||||
|
||||
this.update()
|
||||
this.hideEditForm()
|
||||
},
|
||||
removeEdit() {
|
||||
for (let i in this.values) {
|
||||
if (this.values[i].id === this.editValue.id) {
|
||||
this.values.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
this.update()
|
||||
this.hideEditForm()
|
||||
},
|
||||
hideAddForm() {
|
||||
this.addForm = false
|
||||
},
|
||||
hideEditForm() {
|
||||
this.editForm = false
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.input = document.querySelector('input[name="categories-custom"]')
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -100,7 +100,7 @@ export default {
|
|||
var dataId = parent.getAttribute('data-id')
|
||||
dataId = dataId !== null ? dataId : ''
|
||||
|
||||
if (!parent.classList.contains('app-hidden') && !menuIsHidden) {
|
||||
if (!parent.classList.contains('app-top-side-menu') && !parent.classList.contains('app-hidden') && !menuIsHidden) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
40
src/admin.js
|
@ -15,6 +15,12 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import AdminCategoriesCustom from './AdminCategoriesCustom.vue'
|
||||
import Vue from 'vue'
|
||||
|
||||
Vue.prototype.OC = window.OC
|
||||
Vue.prototype.OCA = window.OCA
|
||||
|
||||
let elements = []
|
||||
|
||||
const selector = '#side-menu-message'
|
||||
|
@ -80,10 +86,11 @@ const saveSettings = (key) => {
|
|||
t('side_menu', (key + 1) + '/' + size)
|
||||
)
|
||||
|
||||
if (key < size) {
|
||||
if (key < size - 1) {
|
||||
saveSettings(key + 1)
|
||||
} else {
|
||||
OC.msg.finishedSuccess(selector, t('side_menu', 'Saved'))
|
||||
OC.msg.finishedSuccess(selector, t('side_menu', 'Saved! Page is reloading...'))
|
||||
location.reload()
|
||||
}
|
||||
},
|
||||
error: () => {
|
||||
|
@ -108,7 +115,29 @@ const elementToggler = (element) => {
|
|||
element.style.display = display
|
||||
}
|
||||
|
||||
const updateAppsCategoriesCustom = () => {
|
||||
let values = {}
|
||||
|
||||
for (let item of document.querySelectorAll('.apps-categories-custom')) {
|
||||
let app = item.getAttribute('data-app')
|
||||
let value = item.value
|
||||
|
||||
if (value) {
|
||||
values[app] = value
|
||||
}
|
||||
}
|
||||
|
||||
document.querySelector('#apps-categories-custom').value = JSON.stringify(values)
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if (document.querySelector('#side-menu-categories-custom')) {
|
||||
const View = Vue.extend(AdminCategoriesCustom)
|
||||
const adminCategoriesCustom = new View({})
|
||||
|
||||
adminCategoriesCustom.$mount('#side-menu-categories-custom')
|
||||
}
|
||||
|
||||
elements = document.querySelectorAll('.side-menu-setting')
|
||||
|
||||
document.querySelector('#side-menu-save').addEventListener('click', (event) => {
|
||||
|
@ -134,6 +163,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
})
|
||||
}
|
||||
|
||||
for (let item of document.querySelectorAll('.apps-categories-custom')) {
|
||||
item.addEventListener('change', (event) => {
|
||||
updateAppsCategoriesCustom()
|
||||
})
|
||||
}
|
||||
|
||||
for (let item of document.querySelectorAll('.side-menu-setting-live')) {
|
||||
item.addEventListener('change', (event) => {
|
||||
const target = event.target
|
||||
|
@ -196,6 +231,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
let value = []
|
||||
|
||||
for (let item of document.querySelectorAll('#categories-list .side-menu-setting-list-item')) {
|
||||
console.log(item.getAttribute('data-id'))
|
||||
value.push(item.getAttribute('data-id'))
|
||||
}
|
||||
|
||||
|
|
|
@ -77,3 +77,8 @@
|
|||
"This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "Tyto parametry jsou použity v případě, že je zapnutý (Breeze) tmavý motiv vzhledu."
|
||||
"Dark mode colors": "Barvy tmavého režimu"
|
||||
"With categories": "S kategoriemi"
|
||||
"Custom categories": "Vlastní kategorie"
|
||||
"Customize application categories": "Personnaliser les catégories des applications"
|
||||
"Customize application categories": "Přizpůsobte kategorie aplikací"
|
||||
"Apps only visible in the top menu": "Aplikace jsou viditelné pouze v horní nabídce "
|
||||
"Apps visible in the top and side menus": "Aplikace viditelné v horní a boční nabídce"
|
||||
|
|
|
@ -77,3 +77,7 @@
|
|||
"This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "Diese Optionen werden auf <code>Dark Theme</code> oder <code>Breeze Dark Theme</code> angewendet."
|
||||
"Dark mode colors": "Farben für den dunklen Modus"
|
||||
"With categories": "Mit Kategorien"
|
||||
"Custom categories": "Benutzerdefinierte Kategorien"
|
||||
"Customize application categories": "Anwendungskategorien anpassen"
|
||||
"Apps only visible in the top menu": "Apps nur im oberen Menü sichtbar "
|
||||
"Apps visible in the top and side menus": "Apps im oberen und seitlichen Menü sichtbar"
|
||||
|
|
|
@ -77,3 +77,7 @@
|
|||
"This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "Ces paramètres sont utilisés lorsque le thème sombre ou le thème Breeze Dark sont activés."
|
||||
"Dark mode colors": "Couleurs du mode sombre"
|
||||
"With categories": "Avec les catégories"
|
||||
"Custom categories": "Catégories personnalisées"
|
||||
"Customize application categories": "Personnaliser les catégories des applications"
|
||||
"Apps only visible in the top menu": "Applications visibles uniquement dans le menu supérieur"
|
||||
"Apps visible in the top and side menus": "Applications visibles dans le menus supérieur et latéral"
|
||||
|
|
|
@ -77,3 +77,7 @@
|
|||
"This parameters are used when Dark theme or Breeze Dark Theme are enabled.": "此参数将应用于暗黑主题激活时。"
|
||||
"Dark mode colors": "暗黑模式颜色"
|
||||
"With categories": "有类别"
|
||||
"Custom categories": "自定义类别"
|
||||
"Customize application categories": "自定义应用程序类别"
|
||||
"Apps only visible in the top menu": "应用程序仅在顶部菜单中可见"
|
||||
"Apps visible in the top and side menus": "顶部和侧边菜单中可见的应用程序"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<?php endforeach; ?>
|
||||
}
|
||||
|
||||
<?php if (empty($_['top-menu-apps'])): ?>
|
||||
<?php if (empty($_['top-menu-apps']) && empty($_['top-side-menu-apps'])): ?>
|
||||
#appmenu {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -52,13 +52,17 @@ const updateTopMenu = function() {
|
|||
continue
|
||||
}
|
||||
|
||||
if (topMenuApps.indexOf(dataId) === -1) {
|
||||
if (topMenuApps.indexOf(dataId) === -1 && topSideMenuApps.indexOf(dataId) === -1) {
|
||||
app.classList.add('hidden')
|
||||
app.classList.add('app-hidden')
|
||||
} else {
|
||||
app.classList.remove('hidden')
|
||||
app.classList.add('app-external-site')
|
||||
|
||||
if (topSideMenuApps.indexOf(dataId) !== -1) {
|
||||
app.classList.add('app-top-side-menu')
|
||||
}
|
||||
|
||||
appShown.push(app)
|
||||
|
||||
navigationAppsHtml = navigationAppsHtml + app.outerHTML
|
||||
|
|
|
@ -186,8 +186,9 @@ if ($_['always-displayed']) {
|
|||
nextcloud.parentNode.insertBefore(sideMenuOpener, nextcloud.nextSibling)
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($_['top-menu-apps'])): ?>
|
||||
const topMenuApps = <?php echo json_encode($_['top-menu-apps']); ?>
|
||||
<?php if (!empty($_['top-menu-apps']) || !empty($_['top-side-menu-apps'])): ?>
|
||||
const topMenuApps = <?php echo json_encode($_['top-menu-apps']), "\n"; ?>
|
||||
const topSideMenuApps = <?php echo json_encode($_['top-side-menu-apps']); ?>
|
||||
|
||||
<?php require_once __DIR__.'/_topMenuApps.js'; ?>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -497,7 +497,6 @@ $choicesSizes = [
|
|||
<div>
|
||||
<label for="side-menu-opener">
|
||||
<?php p($l->t('Always displayed')); ?>
|
||||
<small><span class="warning"><?php p($l->t('Experimental')); ?></span></small>
|
||||
</label>
|
||||
</div>
|
||||
<p><em><?php p($l->t('Not compatible with touch screens.')); ?></em></p>
|
||||
|
@ -731,7 +730,7 @@ $choicesSizes = [
|
|||
<div class="side-menu-setting-table">
|
||||
<div class="side-menu-setting-row">
|
||||
<div class="side-menu-setting-label">
|
||||
<?php p($l->t('Apps that not must be moved in the side menu')); ?>
|
||||
<?php p($l->t('Apps only visible in the top menu')); ?>
|
||||
</div>
|
||||
<div class="side-menu-setting-form">
|
||||
<a class="side-menu-toggler" data-target="#top-menu-apps" href="#_">
|
||||
|
@ -760,6 +759,39 @@ $choicesSizes = [
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="side-menu-setting-table">
|
||||
<div class="side-menu-setting-row">
|
||||
<div class="side-menu-setting-label">
|
||||
<?php p($l->t('Apps visible in the top and side menus')); ?>
|
||||
</div>
|
||||
<div class="side-menu-setting-form">
|
||||
<a class="side-menu-toggler" data-target="#top-side-menu-apps" href="#_">
|
||||
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
|
||||
</a>
|
||||
|
||||
<div class="side-menu-setting" data-name="top-side-menu-apps" id="top-side-menu-apps" data-checkbox style="display: none">
|
||||
<ul class="side-menu-setting-list">
|
||||
<?php foreach ($_['apps'] as $app): ?>
|
||||
<li class="side-menu-setting-list-item">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="top-side-menu-apps[]"
|
||||
value="<?php echo $app['id'] ?>"
|
||||
id="top-side-menu-app-<?php echo $app['id'] ?>"
|
||||
<?php if (in_array($app['id'], $_['top-side-menu-apps'])): ?>checked<?php endif; ?>
|
||||
/>
|
||||
|
||||
<label for="top-side-menu-app-<?php echo $app['id'] ?>">
|
||||
<?php echo p($l->t($app['name'])); ?>
|
||||
</label>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -790,6 +822,61 @@ $choicesSizes = [
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="side-menu-setting-row">
|
||||
<div class="side-menu-setting-label">
|
||||
<?php p($l->t('Custom categories')); ?>
|
||||
</div>
|
||||
<div class="side-menu-setting-form">
|
||||
<input type="hidden" name="categories-custom" class="side-menu-setting" data-langs="<?php echo htmlentities(json_encode($langs)) ?>" value="<?php echo htmlentities(json_encode($_['categories-custom'])) ?>">
|
||||
|
||||
<div id="side-menu-categories-custom">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="side-menu-setting-row">
|
||||
<div class="side-menu-setting-label">
|
||||
<?php p($l->t('Customize application categories')); ?>
|
||||
<small><span class="warning"><?php p($l->t('Experimental')); ?></span></small>
|
||||
</div>
|
||||
<div class="side-menu-setting-form">
|
||||
<a class="side-menu-toggler" data-target="#apps-categories-custom-list" href="#_">
|
||||
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
|
||||
</a>
|
||||
|
||||
<div id="apps-categories-custom-list" style="display: none">
|
||||
<ul class="side-menu-setting-list">
|
||||
<?php foreach ($_['apps'] as $app): ?>
|
||||
<li class="side-menu-setting-list-item">
|
||||
<label for="apps-categories-custom-<?php echo $app['id'] ?>">
|
||||
<?php echo p($l->t($app['name'])); ?>
|
||||
</label>
|
||||
|
||||
<br>
|
||||
|
||||
<select data-app="<?php echo $app['id'] ?>" class="apps-categories-custom">
|
||||
<option value=""></option>
|
||||
|
||||
<?php foreach ($_['categories'] as $id => $category): ?>
|
||||
<?php if ($category): ?>
|
||||
<option
|
||||
value="<?php echo $id ?>"
|
||||
<?php if (($_['apps-categories-custom'][$app['id']] ?? '') === $id): ?>
|
||||
selected
|
||||
<?php endif; ?>
|
||||
><?php echo $category ?></option>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<input type="hidden" class="side-menu-setting" id="apps-categories-custom" name="apps-categories-custom" value="<?php echo htmlentities(json_encode($_['apps-categories-custom'])) ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="side-menu-setting-row">
|
||||
<div class="side-menu-setting-label">
|
||||
<?php p($l->t('Customize sorting')); ?>
|
||||
|
|
|
@ -43,17 +43,16 @@ $choicesYesNo = [
|
|||
<?php p($l->t('Menu')); ?>
|
||||
</h2>
|
||||
|
||||
<div>
|
||||
<label for="side-menu-enabled">
|
||||
<?php p($l->t('Enable the custom menu')); ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<em><?php echo $l->t('Use the shortcut <span class="keyboard-key">Ctrl</span>+<span class="keyboard-key">o</span> to open and to hide the side menu. Use <span class="keyboard-key">tab</span> to navigate.'); ?></em>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<div class="side-menu-setting-table">
|
||||
<div class="side-menu-setting-row">
|
||||
<div class="side-menu-setting-label">
|
||||
<?php p($l->t('Enable the custom menu')); ?>
|
||||
</div>
|
||||
<div class="side-menu-setting-form">
|
||||
<select id="side-menu-enabled" name="enabled" class="side-menu-setting" data-personal>
|
||||
<?php foreach ($choicesYesNo as $label => $value): ?>
|
||||
<option value="<?php echo $value ?>" <?php if ($value === $_['enabled']): ?>selected<?php endif; ?>>
|
||||
|
@ -62,14 +61,15 @@ $choicesYesNo = [
|
|||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="side-menu-target-blank">
|
||||
<?php p($l->t('Open apps in new tab')); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="side-menu-setting-table">
|
||||
<div class="side-menu-setting-row">
|
||||
<div class="side-menu-setting-label">
|
||||
<?php p($l->t('Open apps in new tab')); ?>
|
||||
</div>
|
||||
<div class="side-menu-setting-form">
|
||||
<?php $choices = [
|
||||
'Use the global setting' => '1',
|
||||
'Use my selection' => '2',
|
||||
|
@ -82,7 +82,6 @@ $choicesYesNo = [
|
|||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<a class="side-menu-toggler" data-target="#target-blank-apps" href="#_">
|
||||
|
@ -91,8 +90,9 @@ $choicesYesNo = [
|
|||
</p>
|
||||
|
||||
<div class="side-menu-setting" data-name="target-blank-apps" id="target-blank-apps" data-personal data-checkbox style="display: none">
|
||||
<ul class="side-menu-setting-list">
|
||||
<?php foreach ($_['apps'] as $app): ?>
|
||||
<div>
|
||||
<li class="side-menu-setting-list-item">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="target-blank-apps[]"
|
||||
|
@ -104,8 +104,12 @@ $choicesYesNo = [
|
|||
<label for="target-blank-app-<?php echo $app['id'] ?>">
|
||||
<?php echo p($l->t($app['name'])); ?>
|
||||
</label>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -113,18 +117,18 @@ $choicesYesNo = [
|
|||
<h2>
|
||||
<?php p($l->t('Top menu')); ?>
|
||||
</h2>
|
||||
<div>
|
||||
<label for="side-menu-top-menu-apps">
|
||||
<?php p($l->t('Apps that not must be moved in the side menu')); ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="side-menu-setting-table">
|
||||
<div class="side-menu-setting-row">
|
||||
<div class="side-menu-setting-label">
|
||||
<?php p($l->t('Apps only visible in the top menu')); ?>
|
||||
<p>
|
||||
<em>
|
||||
<?php p($l->t('If there is no selection then the global configuration is applied.')); ?>
|
||||
</em>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="side-menu-setting-form">
|
||||
<p>
|
||||
<a class="side-menu-toggler" data-target="#top-menu-apps" href="#_">
|
||||
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
|
||||
|
@ -132,8 +136,9 @@ $choicesYesNo = [
|
|||
</p>
|
||||
|
||||
<div class="side-menu-setting" data-name="top-menu-apps" data-checkbox data-personal id="top-menu-apps" style="display: none">
|
||||
<ul class="side-menu-setting-list">
|
||||
<?php foreach ($_['apps'] as $app): ?>
|
||||
<div>
|
||||
<li class="side-menu-setting-list-item">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="top-menu-apps[]"
|
||||
|
@ -145,8 +150,52 @@ $choicesYesNo = [
|
|||
<label for="top-menu-app-<?php echo $app['id'] ?>">
|
||||
<?php echo $app['name'] ?>
|
||||
</label>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="side-menu-setting-table">
|
||||
<div class="side-menu-setting-row">
|
||||
<div class="side-menu-setting-label">
|
||||
<?php p($l->t('Apps visible in the top and side menus')); ?>
|
||||
<p>
|
||||
<em>
|
||||
<?php p($l->t('If there is no selection then the global configuration is applied.')); ?>
|
||||
</em>
|
||||
</p>
|
||||
</div>
|
||||
<div class="side-menu-setting-form">
|
||||
<p>
|
||||
<a class="side-menu-toggler" data-target="#top-side-menu-apps" href="#_">
|
||||
🖱️ <?php p($l->t('Show and hide the list of applications')); ?>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<div class="side-menu-setting" data-name="top-side-menu-apps" data-checkbox data-personal id="top-side-menu-apps" style="display: none">
|
||||
<ul class="side-menu-setting-list">
|
||||
<?php foreach ($_['apps'] as $app): ?>
|
||||
<li class="side-menu-setting-list-item">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="top-side-menu-apps[]"
|
||||
value="<?php echo $app['id'] ?>"
|
||||
id="top-side-menu-app-<?php echo $app['id'] ?>"
|
||||
<?php if (in_array($app['id'], $_['top-side-menu-apps'])): ?>checked<?php endif; ?>
|
||||
/>
|
||||
|
||||
<label for="top-side-menu-app-<?php echo $app['id'] ?>">
|
||||
<?php echo $app['name'] ?>
|
||||
</label>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
|