Commit Graph

191 Commits

Author SHA1 Message Date
Vincent Petry f72ffa2f11
Fix js unit tests for webdav put upload changes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-24 21:45:00 +02:00
Vincent Petry 786e858d23
Add support for chunked upload
Hacked around Blueimp's jquery.fileupload to make it work with our new
chunking API.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-24 21:45:00 +02:00
Vincent Petry 59c5be1cc5
Use Webdav PUT for uploads in the web browser
- uses PUT method with jquery.fileupload for regular and public file
  lists
- for IE and browsers that don't support it, use POST with iframe
  transport
- implemented Sabre plugin to handle iframe transport and redirect the
  embedded PUT request to the proper handler
- added RFC5995 POST to file collection with "add-member" property to
  make it possible to auto-rename conflicting file names
- remove obsolete ajax/upload.php and obsolete ajax routes

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-24 21:45:00 +02:00
Morris Jobke 6b2920a6bc Merge pull request #1520 from nextcloud/upload-allow-zero
Allow uploading empty files (#26113)
2016-09-26 17:40:53 +02:00
Vincent Petry e8836bfd30
Allow uploading empty files (#26113)
Downstreaming of https://github.com/owncloud/core/pull/26113

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-09-26 11:28:05 +02:00
Morris Jobke 8d4e5747f3
Fix folder drag glitch in Firefox
issue:
* drag'n'drop a folder into the files app in Firefox
* the highlight stays there because Firefox doesn't trigger the drop event for folders

solution:
* behave like the drop event if the dragover event isn't fired for 100ms (only applied in Firefox)
2016-09-14 13:44:34 +02:00
Joas Schilling 45c99c226b
Fix the HTML encoding when uploading a folder in FF when using french l10n 2016-07-20 13:03:27 +02:00
Vincent Chan 0552933770 changes emptycontent icon to drag-accept on file-drag 2016-06-23 11:25:03 +02:00
Vincent Chan 10f8d643dc store icons in class 2016-06-15 14:42:39 +02:00
Vincent Chan aecdcf737f dragging over folder will highlight folder only 2016-06-15 11:28:53 +02:00
Vincent Chan 6214420974 restrict dropZone to app-content div 2016-06-15 09:45:36 +02:00
Vincent Chan 203a07e7f3 change folder icon when dragging over a directory 2016-06-15 01:03:59 +02:00
Vincent Chan 433cea30c3 adds visual indication for file drag and drop 2016-06-13 23:00:56 +02:00
Vincent Petry 5f6fb45704
Merge branch 'Superduper-Progressbar-branch-thingie' of https://github.com/luckydonald/core into luckydonald-Superduper-Progressbar-branch-thingie 2016-05-12 18:15:54 +02:00
Christoph Wurst 05d203a989
replace $.parseJSON() by JSON.parse() 2016-04-19 15:06:42 +02:00
Lukas Reschke f8ae1bb36e Disable pastezone for jquery.fileupload
jquery.fileupload offers the [`pastezone`](https://github.com/blueimp/jQuery-File-Upload/wiki/Options#pastezone) functionality. This functionality is enabled by default and if somebody copy-pastes something into Chrome it will automatically trigger an upload of the content to any configured jquery.fileupload element embedded in the JS.

This implementation triggers some problems:

1. The pastezone is defined globally by default (🙈). So if there are multiple fileupload's on a page (such as in the personal settings) then stuff is going to be uploaded to all embedded uploads.
2. Our server code is not able to parse the data. For example for uploads in the files app we expect a file name which is not specified => Just an error is thrown. You can reproduce this by taking a file into your clipboard and in Chrome then pressing <kbd>CTRL + V</kbd>.
3. When copy-pasting some string from MS Office on the personal page a temporary avatar with said content is created.

Considering that this is anyways was never working at all and causes bugs I've set the `pastezone` to `null`. This mens that upload via copy and paste will be disabled.

Lesson learned: Third-party JS libraries can have some weird details.
2016-03-22 20:28:57 +01:00
Vincent Petry 8ea80e114a Accumulate notifications instead of blinking
This makes it possible to display multiple notifications.
If the options.type is set to "error", it will also add a close button.
2016-02-22 17:25:32 +01:00
Vincent Petry ceaefc2c54 Defer quota check in web UI when overwriting shared file
When receiving a shared file, the quota for that file counts in the
owner's storage, not the current user's storage.

To make it possible to overwrite the file even when the current user
doesn't have enough space, the quota check is deferred for such files.
2016-02-17 15:38:21 +01:00
Vincent Petry abd0ba1f25 Fix file upload, conflict dialog, also in public link
- Use "FileList" instead of "OCA.Files.App.fileList" that doesn't exist in public
link page.
- Fix public link upload by properly adding the form data using a new
  utility function "addFormData". That one is needed because IE8 upload
  and regular upload use a different format...
2015-10-21 12:18:06 +02:00
Vincent Petry 47475f3b4c Debounce cancel upload message 2015-10-12 15:11:52 +02:00
Thomas Müller aedb7a7e70 Revert "Debounce cancel upload message" 2015-10-12 11:30:15 +02:00
Vincent Petry 8a1a1c1326 Debounce cancel upload message 2015-10-07 16:34:06 +02:00
Vincent Petry 5dff9d88cb Make sure the conflict dialog is loaded before adding conflicts 2015-10-02 09:55:43 +02:00
Vincent Petry cc8efaa037 Show conflict dialog before upload when possible
When uploading files, first check if the files exist in the current file
list. For the ones that do, show a conflict dialog.
For the rest, upload directly.

If the upload operation detects a conflict on the server side, it will
also continue populating the conflict dialog.

From now on, server side conflict can only occur if someone concurrently
uploaded a file into the same folder but the current user hasn't
refreshed the list yet.
2015-09-28 17:50:11 +02:00
Vincent Petry 59273a8863 Combine upload action into the "New" menu
Refactored the new menu to be encapsulated in the NewFileMenu JS class
2015-08-28 17:27:48 +02:00
Vincent Petry 69f88b38c9 Fix file name validation in New menu 2015-04-27 16:31:18 +02:00
Robin McCorkell a323d781a6 Revert "add https:// placeholder for From Link feature. closes #13255"
This reverts commit 18b5966f3a.
2015-03-26 14:47:21 +00:00
Lukas Reschke 02c0fe8d43 Merge pull request #13941 from owncloud/fix-folder-upload-on-firefox
Show message if upload of folder isn't allowed
2015-03-23 17:18:46 +01:00
Lukas Reschke acabd81f42 Remove "Download from URL" feature
Fixes https://github.com/owncloud/core/issues/13326
2015-03-02 21:06:25 +01:00
Morris Jobke 4e18b52527 Show message if upload of folder isn't allowed
* current firefox doesn't throw an exception anymore
	* it just reads 0 bytes -> folder or empty file
* upload of folder or empty file isn't supported in every
  browser except Chrome
* fixes #13940
2015-02-06 11:15:09 +01:00
Volkan Gezer 18b5966f3a add https:// placeholder for From Link feature. closes #13255 2015-01-12 20:11:45 +01:00
Morris Jobke 3036a8714d Merge pull request #12941 from owncloud/wave-accessibility-compliance
Wave accessibility compliance
2014-12-19 00:30:56 +01:00
Morris Jobke 7798ea0cd7 show spinner on file upload in IE8, 9 2014-12-18 22:24:07 +01:00
Jan-Christoph Borchardt cd81687a38 properly escape variable 2014-12-18 17:19:23 +01:00
Jan-Christoph Borchardt 137d19f6b1 fix accessibility for 'New' file inputs 2014-12-18 15:52:42 +01:00
Jan-Christoph Borchardt 0e78415cb1 fix accessibility of file upload 2014-12-18 14:12:34 +01:00
Jörn Friedrich Dreyer c615b3527f show readonly message in file conflict dialog, make it always selected 2014-12-11 16:32:27 +01:00
Vincent Petry 0f3e6cb50a Improved Javascript docs for JSDoc
Added namespaces so that JSDoc can find them.
Fixed a few warnings.
Improved some comments.
2014-10-31 13:43:30 +01:00
Vincent Petry 6ca9e27438 Scroll to new file/folder after adding
When creating a new file from the menu, the list now scrolls to that
file.
2014-09-04 12:34:17 +02:00
pdessauw 0d078e48ce Highlight every uploaded files and scroll down to the last one 2014-09-03 09:59:01 -04:00
luckydonald cacf5ed23f Optimized time formatting, optimized time smoothing. 2014-08-14 12:32:08 +02:00
luckydonald f261c45b0e Changes for scrutinizer. Yay! 2014-08-13 18:46:23 +02:00
luckydonald efdff4e148 fixed browser showing the tipsy tooltip as default tooltip twice. 2014-08-13 13:39:14 +02:00
luckydonald df72723fb9 Fixed "Any minute now" staying because of undefined buffer. Also increased buffer size to 20 to be less jittery. 2014-08-13 13:18:24 +02:00
luckydonald 69d88500d3 Updated String formatting. Label font-weight was already normal. 2014-08-13 13:06:00 +02:00
luckydonald 5e86ff6d85 Fixed Positioning, fixed formatting for both mobile and desktop.
Tooltips still frustrate me-
And the updated code with tabs nicely. yay.
2014-08-13 11:40:36 +02:00
Oliver Gasser eb2669448d Compare upload limit against biggest file
When uploading multiple files from the web interface, compare the PHP
upload limit against the largest file, not against the sum of all files.
2014-08-12 19:46:04 +02:00
luckydonald 159747117f Added remaining time displaying, moved Information to tooltip, removed now unneeded speed div 2014-08-12 00:32:46 +02:00
luckydonald 7fc574cc53 Updated and optimized Mobile Layout as well. 2014-08-11 02:37:01 +02:00
luckydonald 19efa259e9 Fixed translations, indentation and renamed the .percents class to .speed class. 2014-08-10 23:45:06 +02:00
luckydonald 03a34235e0 Upload progress bar now displays informations about uploades size (12kB of 3MB) and the current speed. 2014-08-10 22:26:03 +02:00
Vincent Petry ec4cf96f0d Breadcrumb width calculation fix
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.
2014-06-27 11:11:34 +02:00
Vincent Petry 9ef7410abe Fixed uploading by drag and drop into folder 2014-06-19 16:14:10 +02:00
Vincent Petry 6fd084243b Fixed many issues, clean up
- fixed upload and storage statistics
- fixed infinite scroll to use the correct contain for scroll detection
- fixed unit test that sometimes fail for rename case
- controls are now sticky again
- fixed selection overlay to be aligned with the table
- fixed "select all" checkbox that had id conflicts
- fixed public page
- fixed global actions permissions detection
- fix when URL contains an invalid view id
- viewer mode now hides the sidebar (ex: text editor)
- added unit tests for trashbin
- clean up storage info in template (most is retrieved via ajax call now)
2014-05-15 17:51:04 +02:00
Vincent Petry 9d38e3602b Namespacing for FileList, FileActions and trashbin app
- FileList is now an instantiable class
- FileActions is now in namespace
- added App class for trashbin app
- moved trashbin overrides into classes extending FileList
- replaced many static calls with "this." or "self." to make the classes
  reusable/extendable
- new URL parameter "view" to specify which view is shown, for example
  "files" or "trashbin"
- added OC.Util.History utility class in core for handling history
- moved URL handling/routing to OCA.Files.App
- popstate will correctly update the current view and notify the view of
  the URL change so it can update the current dir
- added JS unitt tests for the trashbin app
- fixed public app to work with the new namespaces
2014-05-15 17:51:04 +02:00
Jörn Friedrich Dreyer f0f059576e polish jslint for files-upload.js 2014-05-09 15:22:11 +02:00
Vincent Petry 2883f231d0 Fixed insertion of files
Removed "insert" flag, inserting is by default for FileList.add().
Added "animate" flag to FileList.add().
Added logic to correctly detect when to insert/append elements whenever
the insertion point is visible or not.
Fixed "render next page" logic to work correctly when many pages of
files have been added.
2014-04-28 14:55:01 +02:00
Bjoern Schiessle 27c5a978f9 we no longer need to handle the Shared folder different from any other folder 2014-04-23 12:54:25 +02:00
Thomas Müller 83e8981e24 add link to further discussion about that folder check 2014-04-15 21:39:13 +02:00
Thomas Müller 0edacf372c fix single file upload in firefox 2014-04-10 18:07:36 +02:00
Thomas Müller e8be2ac554 In cases folder drag and drop is not supported a proper message is displayed 2014-04-09 23:32:12 +02:00
Thomas Müller 3587c88fe9 Merge branch 'master' of https://github.com/lukepolo/core-1 into lukepolo-master
Conflicts:
	apps/files/js/file-upload.js
2014-04-07 22:28:16 +02:00
Vincent Petry 0be9de5df5 Files, trashbin, public apps use ajax/JSON for the file list
Files app:

- removed file list template, now rendering list from JSON response
- FileList.addFile/addDir is now FileList.add() and takes a JS map with all required
  arguments instead of having a long number of function arguments
- added unit tests for many FileList operations
- fixed newfile.php, newfolder.php and rename.php to return the file's
  full JSON on success
- removed obsolete/unused undo code
- removed download_url / loading options, now using
  Files.getDownloadUrl() for that
- server side now uses Helper::getFileInfo() to prepare file JSON response
- previews are now client-side only

Breadcrumbs are now JS only:

- Added BreadCrumb class to handle breadcrumb rendering and events
- Added unit test for BreadCrumb class
- Moved all relevant JS functions to the BreadCrumb class

Public page now uses ajax to load the file list:

- Added Helper class in sharing app to make it easier to authenticate
  and retrieve the file's real path
- Added ajax/list.php to retrieve the file list
- Fixed FileActions and FileList to work with the ajax list

Core:

- Fixed file picker dialog to use the same list format as files app
2014-04-02 15:33:47 +02:00
Morris Jobke 5747e0e3f9 remove executable flag for file-upload.js 2014-03-20 13:26:21 +01:00
Oskar Hollmann 90839b784f Comment moved to prevent 'Line is too long' warning. 2014-03-19 23:05:03 +01:00
Oskar Hollmann fa28c089fa Fix: 'Upload button tooltip doesn't disappear'
Fixes issue #7461. Tipsy tooltip must be hidden when the upload starts. Otherwise it covers the progress bar and stays in DOM.
2014-03-19 22:09:09 +01:00
IchEben e7d5715114 only initialise upload dropZone if public upload is allowed 2014-03-07 17:45:24 +01:00
Vincent Petry 0dcac65aa1 Fixed upload issue when free space is not known 2014-03-06 13:53:55 +01:00
Vincent Petry 07f78c8248 Added unit tests for "add()" method for file upload
- Added OC.Upload.init() to make the code testable
- Added unit tests for the add() method of the uploader with some error
  cases
2014-03-06 13:53:34 +01:00
Bjoern Schiessle 2e73c957e5 don't allow to create a file or folder named 'Shared' in the root folder, also exclude all combinations of lower and upper case letters 2014-03-05 13:16:25 +01:00
Luke Policinski 79a6d89bcc Feature Added : Ability to drag and drop in Chrome 2014-02-19 21:23:39 +00:00
Thomas Müller 6d3b61f388 Merge pull request #7011 from owncloud/jshint
Added .jshintrc
2014-02-04 12:11:32 -08:00
Pellaeon Lin 099b71c712 Merge branch 'master' into pr-exceed_upload_limit_msg
Conflicts:
	apps/files/templates/index.php
	apps/files_sharing/templates/public.php
2014-01-30 22:50:20 +08:00
Vincent Petry d36a2ff9ee Added .jshintrc
- Also fixes a few JSHint warnings in files app
- Added "global" comment on top of files app to suppress warning and
  also inform devs about what globals are use
2014-01-30 13:40:01 +01:00
Vincent Petry 58c7042e70 Added error message for when target folder was removed
Whent trying to upload/rename/create files in a folder that was removed
or rename, the correct error message is now shown.

In the case of upload of multiple files, the upload is cancelled.

This situation can happen if the target folder was renamed or removed
from another browser window or client.
2014-01-29 12:46:11 +01:00
Pellaeon Lin 19675c2c9d Fix variable name 2014-01-24 22:54:16 +08:00
Pellaeon Lin cd6ab29313 Use t() 's native method 2014-01-16 17:51:00 +08:00
Vincent Petry 1042733634 Fixed various file name escaping issues in core apps
- Refactored file tr lookup into FileList.findFileEl that uses
  filterAttr to avoid escaping issues in jQuery selectors
- Fixed versions and sharing app to properly escape file names in
  attributes
2014-01-10 15:02:26 +01:00
Vincent Petry 335b2f40a6 Fixed download file from URL error messages
- L10N now converted to string to make them work with json_encode
- Added specific error message when server doesn't allow fopen on URLs
- Fixed client side to correctly show error message in a notification
- Added OCP\JSON::encode() method to encode JSON with support for the
  OC_L10N_String values
2013-12-12 10:38:12 +01:00
Pellaeon Lin 5ddd85ff9c Contextual upload error message 2013-12-11 15:40:58 +08:00
Pellaeon Lin 64bf0fa47f Display different messages for uploadLimit and freeSpace 2013-12-08 23:17:35 +08:00
Pellaeon Lin 69f2bde324 Change misleading message when file size exceeds upload limit 2013-12-08 15:41:20 +08:00
Vincent Petry 24a08c686d New file box now has default file name + extension
Whenever a user creates a file or folder in the web UI, the input field
will contain a default file name, pre-selected up to the extension for
easier typing.

The purpose is mostly to prevent users creating text files without an
extension.

Fixes #6045
2013-11-28 10:18:31 +01:00
Vincent Petry c16fbbf386 Increased upload error delay to 10 seconds
Fixes #5662

Also made it use OC.Notification instead of directly access the
notification HTML element.
2013-11-08 11:22:08 +01:00
Vincent Petry 5d9ab6e7ac Update quota value in client after scan and upload
After uploading, the quota value wasn't refreshed.
This fix refreshes the quota value after files have been scanned or
uploaded.
2013-11-06 10:15:05 +01:00
Thomas Müller 3488202f67 Merge pull request #5582 from owncloud/files-previewcaching
Append file etag to preview URLs
2013-11-05 01:21:51 -08:00
Vincent Petry 19eeb618ff Prevent closing the create dropdown when right clicking in Firefox
Firefox sends a click event on the document when right clicking which
makes pasting with right click into the field impossible.

Fixes #5498
2013-10-30 17:55:41 +01:00
Vincent Petry 71cf83b314 Added fix to correctly parse non-array error messages
Some apps like the antivirus app return messages in a non-array format.
2013-10-29 16:00:34 +01:00
Vincent Petry e62ca4ea4f Append file etag to preview URLs
Fixes #5534
2013-10-28 14:14:55 +01:00
Jörn Friedrich Dreyer 8ed73e5ced use a more descriptive error message when the user tries to create '/Shared' 2013-10-23 11:08:30 +02:00
Thomas Müller ca3771f8fd fixing js syntax error 2013-10-22 22:39:28 +02:00
Jörn Friedrich Dreyer 45e6d96702 prevent user from creating or renaming sth. to an existing filename
- show tooltip when violating naming constraints while typing
- when target filename exists on server fallback to dialog to interrupt the users flow because something unexpected went wrong
- fixes #5062
- also fixes some whitespace and codestyle issues in files js
- uses css selector over filterAttr in touched js files
2013-10-22 18:11:03 +02:00
Vincent Petry 467f864db4 Fixed sharing status update for new/uploaded files
Creating new files, folders or uploading files now have their sharing
icon updated accordingly.

For this, the global share status list that is cached in
OC.Share.statuses is reused for new files.

Performance should improve as the sharing list is now only loaded once
per navigation session.

In OC.Share, split loadIcons into loadIcons + updateIcons.

Fixes #4977
2013-10-17 12:55:10 +02:00
Morris Jobke a132144eca Merge pull request #5262 from owncloud/files-ie8-conflictdialogbrokenfix
Fixed conflict dialog in IE8
2013-10-16 12:52:41 -07:00
Thomas Müller dc58195c7f Merge pull request #5207 from owncloud/fixing-4011-part2-master
[OC6] file upload exception handling
2013-10-11 10:35:17 -07:00
Vincent Petry e98ea06890 File actions are now updated after create/upload file
The file actions must explicitly be updated by calling
FileActions.display() on the file element after creating or uploading a
file.

Fixes #4971 and #4993
2013-10-11 17:07:48 +02:00
Vincent Petry e2a4417079 Fixed conflict dialog in IE8
- Fixed JS error that prevent the conflict dialog to open #5060
- Fixed JS error that prevented the overwrite case to run
2013-10-10 15:54:00 +02:00
Thomas Müller 7c6ed6ab33 catch exceptions while uploading and pass on the error message 2013-10-08 15:03:24 +02:00
Jörn Friedrich Dreyer 0683372200 canceling individual uploads is currently impossible because there is no placeholder 2013-10-07 11:14:11 +02:00
Jörn Friedrich Dreyer 1bba800e47 Merge branch 'fix_3728_with_file_exists_dialog' of github.com:owncloud/core into fix_3728_with_file_exists_dialog 2013-09-19 11:33:34 +02:00