Skip to content

Refactor upload js - #2279

Merged
bartv2 merged 8 commits into
masterfrom
refactor_upload_js
Apr 6, 2013
Merged

bartv2 merged 8 commits into
masterfrom
refactor_upload_js

Conversation

@butonic

@butonic butonic commented Mar 13, 2013

Copy link
Copy Markdown
Contributor

Today I bring you a completely refactored file upload. It features a correct usage of fileupload events and a seperation of ui updates (now in filelist.js) and file upload handling (files.js). While this might not really solve any current issues, it sure cleans up the code and makes it at least barely understandable.

Here it works at least in Chrome, FF. With multi-file upload and drag'n'drop of files. Dragging files onto folders will correctly show the upload there. Dragging of folders is still experimental in HTML5 so nothing new here.

@icewind1991 @Raydiation @DeepDiver1975 @bartv2 @karlitschek Drool later! Test and 👍!

PS: this is for after the release.

@butonic

butonic commented Mar 13, 2013

Copy link
Copy Markdown
Contributor Author

now also working without js warnings in ie

@butonic

butonic commented Mar 13, 2013

Copy link
Copy Markdown
Contributor Author

oh and the upload code is now indented correctly :trollface:

Comment thread apps/files/js/files.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would also be true if the type is null, please use ===

@BernhardPosselt

Copy link
Copy Markdown
Contributor

Code looks good except that == didnt test 👍

@karlitschek

Copy link
Copy Markdown
Contributor

Is is possible to switch to one of the existing jQuery plugins that support chunked uploading. We still have people complaining that the web-interface doesn' work with big fileuploads.

@butonic

butonic commented Mar 13, 2013

Copy link
Copy Markdown
Contributor Author

blueimps jquery fileupload which we already use already supports chunked fileuploads ... wait let me rephrase that ... which we loaded but hacked apart and reimplemented browser workarounds in the wrong places. The library already fixes ALL of them AND supports chunked uploads: https://github.com/blueimp/jQuery-File-Upload/wiki/Chunked-file-uploads

So let us first use it correctly. This PR does the first step.

I still have more changes from a customer that will provide nicer notifications when hundreds of files are deleted. I could even add code for upload buttons in the gallery and media app if we want that: @jancborchardt ?

@karlitschek

Copy link
Copy Markdown
Contributor

Cool. 👍

@jancborchardt

Copy link
Copy Markdown
Contributor

@butonic oooh sweet yes people would very mch like upload functionality in the Pictures and Music app directly! :)

@laryllian

Copy link
Copy Markdown

But then you really have to make clear and visible, that the "Music" and "Pictures" tabs are only views onto the "Files" one, otherwise ppl will wonder, why the pics they uploaded in "Pictures" suddenly appear in the "Files".

@jancborchardt

Copy link
Copy Markdown
Contributor

They should probably appear in a folder called »Pictures« and »Music«, making it very obvious what happens.

@icewind1991

Copy link
Copy Markdown
Contributor

I wouldn't add an upload to music, to pictures it makes more sense since the target it clear, the gallery you're currently viewing

@icewind1991

Copy link
Copy Markdown
Contributor

code looks good 👍 can someone test IE?

@jancborchardt

Copy link
Copy Markdown
Contributor

Upload functionality, or let’s call it »add new stuff here« inside of both Music and Pictures was expected multiple times in usability tests.

@butonic

butonic commented Mar 19, 2013

Copy link
Copy Markdown
Contributor Author

How we implement upload functionality is a completely separate topic. Before we dive into that someone please test and merge this. I saw three thumbs but don't have the feeling more than one of them really tested the branch. hint hint

@stefannagtegaal

Copy link
Copy Markdown

Code tested and works as expected in Safari 6 and Firefox 19 on OS X 10.8.3.
Unfortunatly I'm unable to test this is IE. Codewise this is a big improvement! 👍

This is about refactoring code, new features should be discussed in another threat imo.

Besides that, the fact that users think the music & pictures pages are separate directories is a usability issue.
I do not think we need to allow uploads on those pages, but make it more clear it is just another (limited) presentation of the current directory.
I have some idea's about this, but it needs some more refactoring inside the theme system to give more power to themes/theming.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

I'll do the IE testing as usual - but I need some more time on this. Too busy with other stuff.

@jancborchardt

Copy link
Copy Markdown
Contributor

@stefannagtegaal I don’t understand how you can say (about Music and Pictures) »I do not think we need to allow uploads on those pages«. I’m not joking when I say that this has come up in every single usability test we did. People have no idea how to add Pictures or Music. This is a big issue. We don’t need to educate people about how our software works, we just need to fix it. It’s as simple as adding an upload function in those apps.

@jancborchardt

Copy link
Copy Markdown
Contributor

But yes, this is a different issue tracked in owncloud-archive/apps#82

@stefannagtegaal

Copy link
Copy Markdown

@jancborchardt While I don't think it's appropriate to discuss this here, I do think that this needs fixing. However, Pictures and Music is just nothing else as another (limited) view of the Files page with a different presentation (eg. image-files are presented as such, and music-files are being capable of playing. Besides that, it's nothing new..

The fact that the above is totally misunderstood by users, is that the menu items "Images" and "Music" appear in the top navigation which gives people the idea of switching between different directories, while they are basically only switching views (only display images and only display music-files).

If you want to go this way and have a different navigation-item for Images and Music, how would you do that for the rest of all file formats like pdf/doc/docx/ppt/wav/mp4/ogg, etc, etc.. Do you want them all to appear in the top navigation, categorised by type? It doesn't make sense to me..

Code wise, we are doing nothing else as selecting all the filetypes which are of a special mime-type, and presenting it differently. So, some sort of menu which gives users the ability to switch between different views, would be better imo.

@butonic

butonic commented Mar 20, 2013

Copy link
Copy Markdown
Contributor Author

@stefannagtegaal please move that discussion to owncloud-archive/apps#82

@DeepDiver1975

Copy link
Copy Markdown
Contributor

now testing ....

@DeepDiver1975

Copy link
Copy Markdown
Contributor
`SCRIPT5007: Für die Eigenschaft "0" kann kein Wert abgerufen werden: Das Objekt ist Null oder undefiniert 
filelist.js, Zeile 432 Zeichen 5

@DeepDiver1975

Copy link
Copy Markdown
Contributor

data.result is undefined in IE8

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@butonic

@butonic

butonic commented Mar 27, 2013

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 I cannot reproduce the error you posted with a VM runnning Win7 and IE8 in IE8 standards mode or IE9 in IE9 standards mode. I don't have a VM with IE10 ...

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@butonic rebase please - thx

@butonic

butonic commented Mar 28, 2013

Copy link
Copy Markdown
Contributor Author

rabased and added css fixes for bonuspoints. dac875e actually shows the cancel button in browsers that support it again. 7ecbaef uses the new css browser switch of the html tag instead of the deprecated jquery detection.

@karlitschek @Raydiation @DeepDiver1975 @icewind1991 @schiesbn @stefannagtegaal please test and 👍 the rebased version.

@butonic

butonic commented Mar 28, 2013

Copy link
Copy Markdown
Contributor Author

pulling @tanghus here, too to make him not only admire but also test the upload rewrite!

@tanghus

tanghus commented Mar 28, 2013

Copy link
Copy Markdown
Contributor

lol - I'll test right after dinner :)

@tanghus

tanghus commented Mar 28, 2013

Copy link
Copy Markdown
Contributor

This works flawlessly with FF 19.0.2 and Chromium 25.0.1364.160

A few issues that probably doesn't have anything to do with this PR.

  • The mime-type requests really shouldn't be necessary, and the number of requests when uploading multiple files actually blocked FF until its build-in http.js something was stopped. Can't this be done in css?
  • When dropping on folders either in the file list or bread crumbs, there's no drop target indication, so it's try and fail if you hit the right spot.

Otherwise I'm in awe over the code ;) 👍

bartv2 added a commit that referenced this pull request Apr 6, 2013
@bartv2
bartv2 merged commit 6d6dfff into master Apr 6, 2013
@bartv2
bartv2 deleted the refactor_upload_js branch April 6, 2013 22:44
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants