summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-06-09 12:05:02 +0200
committerLukas Reschke <lukas@owncloud.com>2016-06-09 17:55:26 +0200
commit5fdde426eb416b470bc37c86a518c49767a55251 (patch)
tree76837729f0e640a0fdfcc6d5c02afd2ff2f256ce /apps/files_sharing/js
parent53ba111e21de9c1c3971488911b48fb2aecca112 (diff)
downloadnextcloud-server-5fdde426eb416b470bc37c86a518c49767a55251.tar.gz
nextcloud-server-5fdde426eb416b470bc37c86a518c49767a55251.zip
Add fancy layout
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/files_drop.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/apps/files_sharing/js/files_drop.js b/apps/files_sharing/js/files_drop.js
new file mode 100644
index 00000000000..ced26fda220
--- /dev/null
+++ b/apps/files_sharing/js/files_drop.js
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch>
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+(function ($) {
+ var Drop = {
+ initialize: function () {
+ $(document).bind('drop dragover', function (e) {
+ // Prevent the default browser drop action:
+ e.preventDefault();
+ });
+ $('#publicUploadDiv').fileupload({
+ url: OC.linkTo('files', 'ajax/upload.php'),
+ dataType: 'json',
+ //maxFileSize: fileUploadContainer.data('maxupload'),
+ messages: {
+ maxFileSize: t('files_sharing', 'File is bigger than allowed.')
+ },
+ dropZone: $('#publicUploadDiv'),
+ formData: {
+ dirToken: $('#sharingToken').val()
+ }
+ });
+
+ }
+ };
+
+ $(document).ready(function() {
+ if($('#uploadOnlyInterface').val() === "1") {
+ $('.avatardiv').avatar($('#sharingUserId').val(), 128, true);
+ }
+
+ OCA.Files_Sharing_Drop = Drop;
+ OCA.Files_Sharing_Drop.initialize();
+ });
+
+
+})(jQuery);
+