Fixed download URL in public page
Fixed JS issues in public page

- fixed subdir detection when uploading into subdir
- add class detection before overriding to avoid JS errors
Merge pull request #8646 from owncloud/publicshare-fixes

[master] Fixed for public link page