This improves the OCA.Files.FileActions class to support passing a
"render" function in the action object.
The default function "_defaultRenderFunction" is used by default and
renders actions in the usual actions container.
Moved "Rename" and "Delete" to custom render functions.
In the public page the scroll container is the window instead of a div.
The $(window) object doesn't support animating the scroll property, so
the $('body') element is used instead.
This is fix for https://github.com/owncloud/core/issues/10060
Instead of hard coding page size as 20 items, we check real page height, and divide by 50 (height of one row).
This will allow to load fewer items on small screens and enough items on large screens (4k, portrait orientation, etc.).
Also checking page height on every load to respond on browser window resizing,
When dropping files onto a read-only folder, a notification
is now shown instead of attempting to upload.
This for both the drag for upload and drag from inside the file list
cases.
Now passing the "scrollto" URL argument to the file list class which
will also automatically scroll and highlight the matching element.
This code is triggered by the search box when in a different folder and
also by the activity app.
Now using a natural sort algorithm that is more consistent between JS
and PHP (although not perfect in some corner cases)
- added OC.Util.naturalSortComparator that uses the same algo that was
used for the user list
- changed user list and files list to use OC.Util.naturalSortComparator
- removed toLowerCase() and changed the comparator to use
String.localeCompare()
- added unit tests
- added OC_NaturalSort that is used by OCP\Util::naturalSortCompare()
Added mountType attribute for files/folder to indicated whether they are
regular, external or shared.
The client side then adapts the "Delete" action hint text based on this
information.
Only the mount roots must have the delete icon hint adapted.
To make this detectable on the client side, the mountType can now
be null, "shared", "shared-root", "external" or "external-root".
This also gives room to icon customization on the client side.
Whenever an app needs to register an event late, it does that on the
original file actions object.
Since the file actions that the file list work on is a merged list, not
the original one, the registration event needs to be propagated there as
well.
Reload the files app in case of authentication errors, expired tokens or disabled app
Reloading will triger the full server side handeling of those errors
formatting
fix missing semicolon + some jshint warnings
Whenever file actions are modified, either by registering new actions or
when appending a new page of entries, the sharing app is now notified so
it can correctly refresh the sharing icon status.
Additionally, the core's loadIcons() method is also used to load the
existing shares and also refresh the sharing icons afterwards.
Whenever file actions are registered later, now the file lists are
automatically notified.
Added FileActions.addUpdateListener() to be able to receive such
notifications.
This removes the need for apps to manually call FileActions.display()
after registering new actions.
This fixes issues with race conditions when file actions are
registered after the file list was already rendered.
Rewrote the breadcrumb calculation to be more readable.
Breadcrumb now has a setMaxWidth() method to set the maximum allowed
width which is used to fit the breadcrumbs.
The breadcrumb width is now based on the container width, passed through
setMaxWidth() by the FileList class.
Now using fixed widths for the test crumbs to simulate consistent
widths across browsers which rendering engines might usually yield
different results.
When renaming to an existing file name, blurring the field should not
remove it.
This fix keeps the field until escape is pressed instead of replacing it
with a broken empty space.
Some apps are calling FileActions.display() directly but omit the new
fileList argument.
This fix makes the fileList argument correctly fall back to the default
file list (the one from the "All files" section)
When uploading files or folders, they only need to be appended or
updated when their path or a section of their path is inside the current
directory (which happens for folder upload)
Fixes issue where file was appended when dragging on a parent directory
onto the breadcrumb.
Fixes appending issue when uploading folders.