Commit Graph

476 Commits

Author SHA1 Message Date
John Molakvoæ (skjnldsv) 28551e0f4d
Force close all tooltips when closing sharing menu
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2019-10-09 08:21:57 +02:00
Joas Schilling dd1fe15b7c
Correctly show errors when setting the password
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-06-27 11:18:33 +02:00
Joas Schilling 1f056d1251
Merge pull request #495 from pulcov/master
Typo fix
2019-04-12 12:32:26 +02:00
Roeland Jago Douma 09fe428e34
Merge pull request #501 from nextcloud/bugfix/viewer-compatibility
Do not register file handlers if the new viewer app is installed
2019-03-06 21:10:03 +01:00
Julius Härtl 976f13d3bc
Fix loading of files/gallery script
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-03-05 18:47:18 +01:00
Julius Härtl 9497659b81
Quick fix for new files OperationProgressbar
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-03-05 17:50:19 +01:00
Julius Härtl c524731ca8
Do not register file handlers if the new viewer app is installed
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-02-26 17:55:40 +01:00
Pulcov 17284a5b53 Typo fix 2019-01-16 16:25:52 +01:00
Julius Härtl cd7094652f
Hide button if download links are hidden for link shares
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-11-19 14:20:55 +01:00
Roeland Jago Douma edecd93f2a
Move to compiled handlebars
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-10-30 12:27:29 +01:00
Daniel Calviño Sánchez 7d1f166f8d Hide body scrollbars when the slideshow is shown
The slideshow is a direct child of the body that is shown in front of
the other elements (header, content and footer) and fills the whole
viewport by using absolute positioning. However, as the other elements
were still shown behind it they affected the size of the body, and as
the body is the scrolling container its scroll bars were shown even if
the slideshow was shown.

Now the content and the footer are hidden when the slideshow is shown
(there is no need to hide the header due to its fixed position, which
does not affect the body size), so the body gets the size of the
slideshow and thus no scroll bars are shown.

Note, however, that when those elements are shown again the body scroll
bars will be reset to their initial position, so it is necessary to
explicitly restore them to their previous value. This is not needed for
the scroll bars of other elements, like the navigation bar or the
sidebar, as in that case the whole scrolling container was hidden and
shown; in the case of the body the scrolling container is kept and what
is hidden and shown are their contents, which alters its size and thus
its scroll bars.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-11 00:22:39 +02:00
Daniel Calviño Sánchez 81934a4902 Fix element coloured with the custom album background
Note that the proper replacemente for "#content-wrapper" in this case is
"#app-content" instead of "#content" due to "#app-content" having a
background colour set in the server, so if it was set to "#content" the
custom background would not be visible.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-11 00:22:39 +02:00
Daniel Calviño Sánchez 527421c2cf Fix vertical scrolling
In the layout provided by the server the scrolling container is now the
body instead of the content wrapper.

Note that the container used in "galleryfileaction.js" was not modified
on purpose, as that feature is currently broken; it restores the scroll
position when the slideshow is hidden due to the file list being
reloaded, but that does not happen in Files app, only in public pages.
Thus, in Files app it restores the position as soon as the file list is
reloaded after closing the slideshow, so it changes the scroll position,
for example, when the directory changes. However, as "#app-content" is
used as the scrolling container in that case the scroll position of the
body does not actually change.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-11 00:22:39 +02:00
Daniel Calviño Sánchez 287741123a Rename "#app" to "#app-content"
The standard layout in the server uses "#app-navigation",
"#app-content" and "#app-sidebar" as children of "#content"; the
navigation and sidebar are not needed, so "#app" is simply renamed to
"#app-content".

Also note that "#controls" is already the first child of "#app-content",
so there is no need to prepend it. In a similar way there are standard
CSS rules defined in the server for "#controls" as a child of
"#app-content", so no special rules need to be defined here.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-11 00:22:34 +02:00
Julius Härtl 739ce553cf
Use gallery preview endpoints again since they have some additional details for SVG images
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-07-28 00:08:29 +02:00
Julius Härtl 639b6ed291
Use core preview endpoint and remove requesttoken
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-07-27 23:52:07 +02:00
Julius Härtl b928599a23
Move from EventSource loading to individual requests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-07-27 23:52:07 +02:00
Xheni Myrtaj d25049db6a ensure that data-id is removed when unsharing
Signed-off-by: Xheni Myrtaj <myrtajxheni@gmail.com>
2018-04-12 17:08:54 +02:00
Xheni Myrtaj 7089a58b3b use data function instead of attr function
Signed-off-by: Xheni Myrtaj <myrtajxheni@gmail.com>
2018-04-12 17:08:54 +02:00
Julius Härtl 186915b4ea
Remove save form showing method, since it done by the server
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-04-05 13:14:45 +02:00
Julius Härtl f53cbb8077
Cleanup template
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-04-05 12:23:05 +02:00
Daniel Calviño Sánchez a010c697b6 Keep showing the working icon while there are pending operations
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>
2018-04-03 23:50:20 +02:00
Daniel Calviño Sánchez 6eeb230dbb Extract code to restore the UI after confirming a share
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-03 23:50:15 +02:00
Daniel Calviño Sánchez f5c1a45864 Discard cached suggestions when adding a share
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>
2018-04-03 23:47:46 +02:00
Daniel Calviño Sánchez c4a46d2767 Reuse last suggestions if the same parameters are used
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>
2018-04-03 23:47:46 +02:00
Daniel Calviño Sánchez ec9a2705f9 Confirm a share also by pressing enter on the input field
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 processed.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-03 23:47:46 +02:00
Daniel Calviño Sánchez 8c1e5c6d0a Add a share when clicking on the confirm button
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>
2018-04-03 23:47:46 +02:00
Daniel Calviño Sánchez f422262c2f Trigger autocompletion when the input field is focused
This unifies the behaviour with the one used in the file list, and it
will also simplify other changes in following commits (like not needing
to show error messages when confirming a share and instead rely on those
from the autocompletion).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-03 23:47:46 +02:00
Daniel Calviño Sánchez 79a81925ce Extract code to get the permissions to its own method
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-03 23:47:46 +02:00
Daniel Calviño Sánchez b47e809bae Return also exact matches besides all suggestions
"_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>
2018-04-03 23:47:46 +02:00
Daniel Calviño Sánchez 509e60db5f Extract code to filter suggestions to its own function
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-03 23:47:46 +02:00
Daniel Calviño Sánchez 54306a38b4 Show an error when getting the suggestions succeeds with failure content
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>
2018-04-03 23:47:46 +02:00
Daniel Calviño Sánchez d003793e2a Use "showTemporary" instead of explicitly hiding the notification
"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>
2018-04-03 23:47:46 +02:00
Daniel Calviño Sánchez 7504926422 Extract code to get suggestions to its own method
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-03 23:47:46 +02:00
Jan-Christoph Borchardt cb61a6bc17 Replace information icon with confirmation button in share input
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>
2018-04-03 23:45:32 +02:00
Daniel Calviño Sánchez 6e19986175 Hide "No results found" tooltip on autocompletion
If the tooltip is not explicitly hidden it would still be shown once the
autocompletion dropdown is shown (behind it while it is open, but fully
visible when it is closed).

This unifies its behaviour with the one used in the server, but it does
not address its problems (for example, if a search is started and while
it is being performed the input field is cleared the tooltip would be
still shown once the search response is received, even if the input
field is now empty).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-26 14:03:02 +02:00
Morris Jobke 2363e4f761
Merge pull request #417 from nextcloud/fix-ui-while-a-share-is-added
Fix UI while a share is being added
2018-03-23 09:00:22 +01:00
Daniel Calviño Sánchez 080539db78 Fix UI while a share is being added
After calling "Gallery.Share.share" the UI was restored (the working
icon was hidden, the input field enabled...). However, "share" is
asynchronous, so the UI was restored while the share was still being
added. Now the UI is restored in the share callbacks, so it is restored
once the sharing finished, either successfully or with a failure; in
this later case now a notification is also shown.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-23 04:47:03 +01:00
Daniel Calviño Sánchez c0cd2af21e Hide tooltip when the input field is cleared
The "No results found" tooltip is now removed when the input field is
cleared.

This unifies its behaviour with the one used in the server, but it does
not address its problems (for example, if a search is started and while
it is being performed the input field is cleared the tooltip would be
still shown once the search response is received, even if the input
field is now empty).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-22 18:35:11 +01:00
Daniel Calviño Sánchez f9f0d0f8c4 Fix reference error
There is no "view" nor "configModel" in a Share of the gallery;
configuration parameters are got using "oc_appconfig".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-22 18:06:30 +01:00
rakekniven 5f2aa4a708
Update share.js
Fixed typo.
2018-03-16 18:54:43 +01:00
Daniel Calviño Sánchez 73d7c3f428 Add controls to #app instead of before #content-wrapper
The "#content-wrapper" element is the scrolling container of the
gallery. As the "#controls" element was a sibling with a relative top
position it overlapped the "#content-wrapper"; the contents themselves
were not overlapped due to the "margin-top" CSS rule for "#content
.hascontrols" elements, but as the scroll bar belongs to the
"#content-wrapper" it was.

This could have been fixed by setting the top position of the
"#content-wrapper" element to visually move it below the "#controls".
However, conceptually the controls are part of the contents, and other
apps may expect that the gallery adds all its contents in the
"#content-wrapper" (like the JSXC app), so also for consistency with the
Files app this commit moves the "#controls" element into the "#app"
element instead.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-07 07:02:14 +01:00
Morris Jobke 69ae822617
Merge pull request #400 from nextcloud/rakekniven-l10n-fix
Update share.js
2018-03-05 10:38:50 +01:00
rakekniven a6d12454f5
Update share.js 2018-02-24 15:41:06 +01:00
Daniel Calviño Sánchez df92586da6 Fix gallery button hidden in folders without create permission
In the "Files" app the actions that require the create permission (those
marked as "creatable") are hidden in folders that do not have that
permission. However, as there is only one ".actions" element inside
"#controls" and that ".actions" element also has the "creatable" CSS
class appending the gallery button to it meant that the gallery button
was hidden in folders without create permissions. Now the gallery button
is appended to the "#controls" element instead, and thus it is no longer
affected by the permissions of the folder.

As the button is now appended to the "#controls" element its top margin
was increased to align it with the rest of the buttons (as the
".actions" element uses a padding of 5px), and as the button appears in
the top right corner of the contents its right margin was set to the
same value as the top margin to "frame" the button.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-02-18 22:25:05 +01:00
Daniel Calviño Sánchez f4dd72dde9 Fix element to append the share drop down to
The share drop down was appended to the grandparent element of the
clicked element that caused the drop down to be shown. This, in itself,
was not problematic; however, due to the CSS rules for the actions bar
when the drop down was a child of the action bar (that is, when shown in
the gallery) it was not properly shown. Now the drop down is appended to
either the "#slideshow" element (when in the slideshow, just like
before) or to the "#controls" element (when in the gallery, the parent
of the actions bar).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-02-11 13:08:39 +01:00
Morris Jobke 16128b9e8f
Merge pull request #354 from nextcloud/hide-the-share-drop-down-when-closing-the-slideshow
Hide the share drop down when closing the slideshow
2018-01-22 17:46:31 +01:00
Morris Jobke 07dfd8355c
Merge pull request #369 from nextcloud/fix-loading-icon-position-in-share-with-field
Fix loading icon position in "shareWith" field
2018-01-22 17:35:17 +01:00
Morris Jobke 5cb19c1e43
Merge pull request #370 from nextcloud/fix-adding-shares-to-wrong-element
Fix adding shares to wrong HTML element
2018-01-22 17:13:33 +01:00
Daniel Calviño Sánchez 8f6e67d74d Fix shortcuts activated when typing in the share dropdown
When in slideshow mode certain keys trigger actions like toggling full
screen or zooming. However, due to event bubbling, those actions were
triggered too when typing in the input fields of the share dropdown.
Instead of stopping the propagation in each input field this is now
fixed by not triggering the actions if the element that received the key
press was an input field.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-01-22 10:28:46 +01:00