javascript code cleanup + fixing syntax errors
Merge pull request #8200 from owncloud/js-cleanup-dialogs-master

javascript code cleanup + fixing syntax errors