summaryrefslogtreecommitdiffstats
path: root/core/js
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* There was an error loading → could not loadAllan Nordhøy2018-01-201-1/+1
|
* Spelling: FreeTypeAllan Nordhøy2018-01-141-2/+2
|
* Spelling: FreeTypeAllan Nordhøy2018-01-141-1/+1
|
* Merge pull request #7709 from ↵Morris Jobke2018-01-111-1/+1
|\ | | | | | | | | nextcloud/fix-password-displayed-as-username-in-password-manager Fix password displayed as username in Firefox password manager dialog
| * Fix password displayed as username in Firefox password manager dialogDaniel Calviño Sánchez2018-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When finishing the setup of Nextcloud through the WebUI (setting admin user and database) Firefox offers to save the username and password. However, the password was shown in both the username and password fields of the Firefox password manager dialog. The problem was that the password input element (in the HTML form) is cloned in a text input element, which is used to show the password in plain text when clicking on the "Show password" button. As it was a text input immediately followed by a password input Firefox seemed to assume that it had to be the username and ignored the real username field, no matter the value set for the "autocomplete" attribute. Now the cloned text input is added after the password input, so Firefox no longer thinks that the cloned text input is the username field and the password manager dialog shows the proper username instead. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | Merge pull request #7650 from rpirritano/masterMorris Jobke2018-01-111-0/+1
|\ \ | | | | | | made small changes to login screen
| * | made small changes to login screenRobert Pirritano2018-01-111-0/+1
| | | | | | | | | | | | | | | | | | added height back 70px back to footer and removed .htaccess file Signed-off-by: Robert R Pirritano <rpirritano@gmail.com>
* | | Adds rel="noopener noreferrer" to _blank links inside commentsThomas Citharel2018-01-111-1/+1
|/ / | | | | | | | | | | For more details, check out https://mathiasbynens.github.io/rel-noopener/ for instance Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* | Merge pull request #7635 from Abijeet/bug-7106Roeland Jago Douma2018-01-102-2/+66
|\ \ | | | | | | Fixes password input being prompted every time.
| * | Add extra test cases for password confirmationDaniel Calviño Sánchez2018-01-101-2/+26
| | | | | | | | | | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * | Added test cases for the fix for the password confirmation box appearing ↵Abijeet2018-01-101-0/+37
| | | | | | | | | | | | | | | | | | repeatedly. Signed-off-by: Abijeet <abijeetpatro@gmail.com>
| * | Fixes password input being prompted every time.Abijeet2018-01-081-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #7106 - Echoing the current server time via a JS variable and storing the current time on page load in JS. - Calculating the diff and taking it into account when deciding whether to show the password confirmation. Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* | | opens comments links in _blank 🙊Arthur Schiwon2018-01-081-1/+1
| | | | | | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | | Fix testsJulius Härtl2018-01-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | The avatar plugin should not change the display element, since the avatar is always shown by default and the display value is up to the developers Signed-off-by: Julius Härtl <jus@bitgrid.net>