-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[10.5.0] Add admin settings checkbox to 'Enable manual file locking on the web UI' #37702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,22 +3,34 @@ $(document).ready(function() { | |
| $('#persistentlocking input').change(function () { | ||
| var currentInput = $(this); | ||
| var name = currentInput.attr('name'); | ||
| var value = currentInput.val(); | ||
| var isValid = true; | ||
| var app = ''; | ||
| var value = ''; | ||
|
|
||
| var minRange = currentInput.attr('min'); | ||
| var maxRange = currentInput.attr('max'); | ||
| if (name === 'enable_lock_file_action') { | ||
| app = 'files'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This adds code to core settings panel JS that is aware of and manipulates a files app setting.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe |
||
| if (this.checked) { | ||
| value = 'yes'; | ||
| } else { | ||
| value = 'no'; | ||
| } | ||
| } else { | ||
| app = 'core'; | ||
| value = currentInput.val(); | ||
| var minRange = currentInput.attr('min'); | ||
| var maxRange = currentInput.attr('max'); | ||
|
|
||
| // range validation (mainly for firefox) to prevent saving wrong values | ||
| var isValid = true; | ||
| if (minRange !== undefined && value < minRange) { | ||
| isValid = false; | ||
| } | ||
| if (maxRange !== undefined && value > maxRange) { | ||
| isValid = false; | ||
| // range validation (mainly for firefox) to prevent saving wrong values | ||
| if (minRange !== undefined && value < minRange) { | ||
| isValid = false; | ||
| } | ||
| if (maxRange !== undefined && value > maxRange) { | ||
| isValid = false; | ||
| } | ||
| } | ||
|
|
||
| if (isValid) { | ||
| OC.AppConfig.setValue('core', name, value); | ||
| OC.AppConfig.setValue(app, name, value); | ||
| } | ||
| // browser should take care of the visual indication if the value | ||
| // isn't in the range | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is on a core panel outside of the files app, but references a files app setting.
Is that OK?
I don't know what to do when a settings panel needs to have settings from a mix of core and apps.