summaryrefslogtreecommitdiffstats
path: root/core/js
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #9224 from nextcloud/accessibility-improvementsMorris Jobke2018-04-191-0/+7
|\ | | | | Add labels for Contacts menu and Settings, thanks to @MarcoZehe
| * Add proper ARIA attributes and structure to header for accessibility, thanks ↵Jan-Christoph Borchardt2018-04-181-0/+7
| | | | | | | | | | | | to @MarcoZehe Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
* | Remove no longer needed escaping of special charactersDaniel Calviño Sánchez2018-04-181-3/+1
| | | | | | | | | | | | | | | | | | | | The escaping of special characters was needed when the ids of the permission checkboxes for shares were based on the "shareWith" field. Since they are based on the "shareId" field the escaping is no longer needed, as the "sharedId" is expected to always contain compatible characters. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Fix ids of permission checkboxes for sharesDaniel Calviño Sánchez2018-04-182-11/+41
|/ | | | | | | | | | | | | | | | | | | | | | | | | | The ids of permission checkboxes for shares were generated using the "shareWith" field of the share. The "shareWith" field can contain spaces (as spaces are allowed, for example, in user or circle names), so this could cause the id attribute of the HTML element to contain spaces too, which is forbidden by the HTML specification. It is not just a "formal" issue, though; when the list was rendered, if the id contained a space the selector to get the checkbox element was wrong (as it ended being something like "#canEdit-view1-name with spaces") and thus the initial state of the checkbox was not properly set. Besides that, "shareWith" can contain too single quotes, which would even cause the jQuery selector to abort the search and leave the UI in an invalid state. Instead of adding more cases to the regular expression to escape special characters and apply it too when the ids are created now the ids of permission checkboxes for shares are based on the "shareId" field instead of on "shareWith", as "shareId" is expected to always contain compatible characters. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fix js tests with placeholderJohn Molakvoæ (skjnldsv)2018-04-131-5/+5
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Merge pull request #8535 from nextcloud/new-color-generatorJan-Christoph Borchardt2018-04-121-53/+61
|\ | | | | New color generator algorithm
| * Fixed documentationJohn Molakvoæ (skjnldsv)2018-04-061-7/+7
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
| * New algorithmJohn Molakvoæ (skjnldsv)2018-04-061-46/+54
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* | Merge pull request #8820 from nextcloud/mtime-sortMorris Jobke2018-04-121-1/+1
|\ \ | | | | | | Sorts filepicker files by modified date
| * | sorts filepicker files by modified dateSagorika Das2018-03-141-1/+1
| | | | | | | | | | | | Signed-off-by: Sagorika Das <sagorika1996@gmail.com>
* | | Merge pull request #9002 from nextcloud/whitespaceJan-Christoph Borchardt2018-04-101-4/+0
|\ \ \ | |_|/ |/| | More whitespace: Increase header height from 45px to 50
| * | Fix app menu, popovers and searchboxJulius Härtl2018-04-041-4/+0
| | | | | | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | | Move external share saving to templateJulius Härtl2018-04-051-0/+7
| | | | | | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | | Move styling and menu handling to publicpage.jsJulius Härtl2018-04-051-2/+13
|/ / | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Keep showing the working icon while there are pending operationsDaniel Calviño Sánchez2018-03-212-17/+94
| | | | | | | | | | | | | | | | | | | | | | | | Before, whenever a pending operation (getting the suggestions, confirming a share or selecting a recipient) finished the working icon was hidden and the confirm button was shown again, even if there were other pending operations (the most common case is typing slowly on the input field, as several operations to get the suggestions could pile if the server response is not received fast enough). Now, the working icon is not hidden until the last pending operation finishes. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Extract code to restore the UI after confirming a shareDaniel Calviño Sánchez2018-03-211-30/+15
| | | | | | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Discard cached suggestions when adding a shareDaniel Calviño Sánchez2018-03-211-0/+6
| | | | | | | | | | | | | | | | | | The suggestions depend on the results returned by the server, but also on the sharees already shared with. Due to that adding a share changes the suggestions, so now the cached suggestions are discarded when a share is added. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Reuse last suggestions if the same parameters are usedDaniel Calviño Sánchez2018-03-212-1/+192
| | | | | | | | | | | | | | | | | | | | When a share is confirmed the suggestions are got to check if there is an exact match. Usually the suggestions were already got with the same parameters in order to fill the autocomplete dropdown, so to avoid a superfluous request now the last suggestions are reused when got again, although only if the same parameters as the last time are used. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Confirm a share also by pressing enter on the input fieldDaniel Calviño Sánchez2018-03-202-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides confirming a share by clicking on the confirm button now it is possible to do it by pressing enter on the input field. Clicking on the confirm button implicitly hides the autocomplete dropdown. On the other hand, pressing enter on the input field does not, so the autocompletion must be disabled and closed when the confirmation begins and then enabled again once it finishes. Otherwise the autocomplete dropdown would be visible and it would be possible to interact with it while the share is being confirmed. The order in which the input field and the autompletion are disabled is important. Internally, the autocompletion sets a timeout when the input field is modified that requests the suggestions to the server and then shows them in the dropdown. That timeout is not cancelled when the autocompletion is disabled, but when the input field loses its focus and the autocompletion is not disabled. Therefore, the input field has to be disabled (which causes it to lose the focus) before the autocompletion is disabled. Otherwise it could happen that while a share is being confirmed the timeout ends, so an autocompletion request is sent and then, once the share is successfully confirmed and thus the autocompletion is enabled again, the request is received and the autocomplete dropdown is shown with the old suggestions. Strange, but possible nevertheless ;-) Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Add a share when clicking on the confirm buttonDaniel Calviño Sánchez2018-03-202-1/+447
| | | | | | | | | | | | | | | | | | Clicking on the confirm button now adds a share, but only if there is just a single exact match. If there are no exact matches or there is more than one exact match no share is added, and the autocomplete dropdown is shown again with all the suggestions. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Return also exact matches besides all suggestionsDaniel Calviño Sánchez2018-03-202-16/+299
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "_getSuggestions" returned all the suggestions from the server, which are composed by exact matches and partial matches. Now the exact matches are also returned on their own parameter. This will be used by the button to confirm a share. Note that until now the order of the suggestions was "exact users, partial users, exact groups, partial groups, exact..."; this commit also changes that order to become "exact users, exact groups, exact..., partial users, partial groups, partial...". This is not a problem, as the suggestions were used in the autocomplete dropdown, and this new order is arguably better than the old one, as all exact matches appear now at the beginning. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Extract code to filter suggestions to its own functionDaniel Calviño Sánchez2018-03-201-60/+64
| | | | | | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Show an error when getting the suggestions succeeds with failure contentDaniel Calviño Sánchez2018-03-202-10/+16
| | | | | | | | | | | | | | | | Instead of silently failing now an error is shown to the user when the ajax call to get the suggestions succeeds yet it returns failure content (for example, if an "OCSBadRequestException" was thrown in the server). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Use "showTemporary" instead of explicitly hiding the notificationDaniel Calviño Sánchez2018-03-202-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | "OC.Notification.hide" expects the notification to be hidden to be passed as an argument. As it was being used to show a temporary notification the combination of "OC.Notification.show" and "OC.Notification.hide" was replaced by a single call to "OC.Notification.showTemporary". The timeout could have been specified in the options of the call, but it was left to the default value (7 seconds) for consistency with other notifications. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Move stub setup outside the test methodDaniel Calviño Sánchez2018-03-201-4/+11
| | | | | | | | | | | | | | | | | | | | | | Stubs should be restored outside the test method in which they are used to ensure that they are properly restored no matter the result of the test (for example, if an exception is thrown). Besides that, this will make possible to reuse the stub in other sibling tests without having to explicitly setup it in them. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Extract code to get suggestions to its own methodDaniel Calviño Sánchez2018-03-201-73/+92
| | | | | | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Add autocompletion tests for each type of shareDaniel Calviño Sánchez2018-03-201-25/+283
| | | | | | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Add tests for exact search results already shared withDaniel Calviño Sánchez2018-03-201-0/+274
| | | | | | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Add tests for emails and circles already shared withDaniel Calviño Sánchez2018-03-201-1/+120
| | | | | | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Adjust search term to testDaniel Calviño Sánchez2018-03-201-3/+3
| | | | | | | | | | | | | | | | As the server response is faked the search term is ignored in the tests. However, it is clearer to use a search term that would make the server return what the faked response contains. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Replace information icon with confirmation button in share inputJan-Christoph Borchardt2018-03-202-60/+9
| | | | | | | | | | | | | | The confirmation button right now is just an icon; its behaviour will be added in the following commits. Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
* | Use the display name in the avatar for a circle shareDaniel Calviño Sánchez2018-03-162-2/+2
|/ | | | | | | | | | | | | | | | | | | | Before, the avatar for a circle share was generated using the "share_with" field as the seed for "imageplaceholder". Due to this, when the "share_with" field is set to the circle ID the character shown in the avatar was just a random character instead of the first character of the display name. Now the "share_with" is still used as the seed for the colour, but the display name is used as the text of the avatar. This adds support for "share_with" fields set to the circle ID while being backwards compatible with "share_with" fields set to the circle name. Note that when "share_with" fields is set to the circle name the colour of the avatar is different in the list of suggested sharees and in the list of current sharees, but that also happened before these changes (due to a different seed being used in each place). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add CSRF token controller to retrieve the current CSRF tokenChristoph Wurst2018-03-082-27/+22
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use correct variablesJohn Molakvoæ (skjnldsv)2018-03-041-1/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Create special option to toggle header menu containerJohn Molakvoæ (skjnldsv)2018-03-042-5/+7
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Clean scss, use proper loading icon and menu position on narrow screensJohn Molakvoæ (skjnldsv)2018-03-041-2/+7
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Set autocomplete=new-password for mail share passwordRoeland Jago Douma2018-02-281-1/+1
| | | | | | | This avoids the browser to do autocompletion on the mail share password field. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #7363 from nextcloud/default-share-permsMorris Jobke2018-02-273-9/+52
|\ | | | | Let the admin configure the default share permissions
| * Fix JSDocMorris Jobke2018-02-271-1/+1
| | | | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
| * Fix share capabilities JS testsVincent Petry2018-02-271-1/+24
| | | | | | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
| * add share permissions to settings pageBjoern Schiessle2018-02-271-8/+9
| | | | | | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
| * expose capabilities in jsBjoern Schiessle2018-02-271-0/+19
| | | | | | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* | Add public templateJulius Härtl2018-02-272-0/+30
|/ | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Merge pull request #8390 from dasisdormax/masterMorris Jobke2018-02-263-18/+84
|\ | | | | Add indeterminate state to share permission checkbox
| * Update tests for indeterminate state, fix slashes not being escapedMaximilian Wende2018-02-162-2/+50
| | | | | | | | Signed-off-by: Maximilian Wende <dasisdormax@mailbox.org>
| * Fix indeterminate checkbox state not showing correctlyMaximilian Wende2018-02-151-8/+11
| | | | | | | | | | | | | | | | | | Also, the checkbox is updated to the correct state while a permission change is in progress. should fix issue #8371 Signed-off-by: Maximilian Wende <dasisdormax@secure.mailbox.org>
| * Add indeterminate state to 'can edit' share permission checkbox, see #8371Maximilian Wende2018-02-152-9/+24
| | | | | | | | Signed-off-by: Maximilian Wende <dasisdormax@secure.mailbox.org>
* | Remove unused var in OC.Notification.showTemporaryChristoph Wurst2018-02-191-1/+0
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Removed additional and uneccessary request on password reset, to fix ↵Luca Adrian Lindhorst2018-01-241-8/+1
| | | | | | redirection afterwards. Signed-off-by: Luca Adrian Lindhorst <info@lucalindhorst.de>
* There was an error loading → Could not loadAllan Nordhøy2018-01-201-1/+1
|