Browse Source

Merge pull request 'Release 2.0.1' (#79) from develop into master

Reviewed-on: #79
master v2.0.1
Simon Vieille 3 weeks ago
parent
commit
7f33f7523f
  1. 6
      CHANGELOG.md
  2. 2
      appinfo/info.xml
  3. 1
      lib/Controller/PersonalSettingController.php
  4. 26
      src/admin.js
  5. 5
      templates/js/_topMenuApps.js
  6. 1
      templates/settings/admin-form.php
  7. 3
      templates/settings/personal-form.php

6
CHANGELOG.md

@ -1,5 +1,11 @@
## [Unreleased]
## 2.0.1
### Fixed
- fix #78: Top menu is broken - invisible apps are shown
- fix #77: Update personal settings - HTTP error 412 (Precondition Failed)
- fix js error on the personal settings page (undefined sortable)
## 2.0.0
### Fixed
- fix #66: removing usage of setInterval

2
appinfo/info.xml

@ -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.0</version>
<version>2.0.1</version>
<licence>agpl</licence>
<author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
<namespace>SideMenu</namespace>

1
lib/Controller/PersonalSettingController.php

@ -54,6 +54,7 @@ class PersonalSettingController extends Controller
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* @param mixed $name
* @param mixed $value

26
src/admin.js

@ -21,16 +21,17 @@ const selector = '#side-menu-message'
const userConfig = (name, value, callbacks) => {
const url = OC.generateUrl('/apps/side_menu/personalSetting/valueSet')
const formData = new FormData()
formData.append('name', name)
formData.append('value', value)
const formData = []
formData.push('name=' + encodeURIComponent(name))
formData.push('value=' + encodeURIComponent(value))
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: formData
body: formData.join('&')
})
.then(callbacks.success)
.catch(callbacks.error)
@ -190,13 +191,16 @@ document.addEventListener('DOMContentLoaded', () => {
placeholderClass: 'side-menu-setting-list-drop'
})
sortable('#categories-list .side-menu-setting-list')[0].addEventListener('sortstop', (e) => {
let value = []
try {
sortable('#categories-list .side-menu-setting-list')[0].addEventListener('sortstop', (e) => {
let value = []
for (let item of document.querySelectorAll('#categories-list .side-menu-setting-list-item')) {
value.push(item.getAttribute('data-id'))
}
for (let item of document.querySelectorAll('#categories-list .side-menu-setting-list-item')) {
value.push(item.getAttribute('data-id'))
}
document.querySelector('input[name="categories-order"]').value = JSON.stringify(value)
})
document.querySelector('input[name="categories-order"]').value = JSON.stringify(value)
})
} catch (e) {
}
})

5
templates/js/_topMenuApps.js

@ -103,7 +103,6 @@ const updateTopMenu = function() {
let k = 0
let notInHeader = 0
for (let app of appShown) {
const name = app.getAttribute('data-id')
const li = querySelector('#apps li[data-id=' + name + '].app-external-site')
@ -199,8 +198,8 @@ const updateTopMenu = function() {
menuCache = menu.innerHTML + menu.nextSibling.innerHTML
}
for (let timeout of [300, 500, 700, 900, 1100]) {
setTimeout(updateTopMenu, timeout)
for (let i = 0; i < 3000; i+= 100) {
setTimeout(updateTopMenu, i)
}
let resizeTimeout = null;

1
templates/settings/admin-form.php

@ -40,7 +40,6 @@ $choicesSizes = [
];
?>
<div id="side-menu-section">
<div class="section">
<h2>

3
templates/settings/personal-form.php

@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
vendor_script('side_menu', 'html5sortable.min');
script('side_menu', 'admin');
style('side_menu', 'admin');
@ -25,8 +26,6 @@ $choicesYesNo = [
];
?>
<div id="side-menu-section">
<?php if ($_['force']): ?>
<div class="section">

Loading…
Cancel
Save