summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2012-12-10 18:41:08 +0100
committerThomas Mueller <thomas.mueller@tmit.eu>2012-12-10 18:41:08 +0100
commit45074d5023d408f4f81bc45380ce68b1008f9414 (patch)
treeb9d32d1b211e4c30d522deb3af7af49b58a6cb5f /apps/files_sharing/js
parent9a3a83e16a5a65229ffeebafe739fffd524499bc (diff)
downloadnextcloud-server-45074d5023d408f4f81bc45380ce68b1008f9414.tar.gz
nextcloud-server-45074d5023d408f4f81bc45380ce68b1008f9414.zip
restoring feature to send sharing link via email
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/share.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 7eb086712f4..a83252867a9 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -33,6 +33,28 @@ $(document).ready(function() {
});
OC.Share.loadIcons('file');
}
-
+
+ $('#emailPrivateLink').live('submit', function(event) {
+ event.preventDefault();
+ var link = $('#linkText').val();
+ var itemType = $('#dropdown').data('item-type');
+ var itemSource = $('#dropdown').data('item-source');
+
+ var file = $('tr').filterAttr('data-id', String(itemSource)).data('file');
+ var email = $('#email').val();
+ if (email != '') {
+ $.post(OC.filePath('files_sharing', 'ajax', 'email.php'), { toaddress: email, link: link, type: itemType, file: file }, function(result) {
+ if (result && result.status == 'success') {
+ $('#email').css('font-weight', 'bold');
+ $('#email').animate({ fontWeight: 'normal' }, 2000, function() {
+ $(this).val('');
+ }).val('Email sent');
+ } else {
+ OC.dialogs.alert(result.data.message, 'Error while sharing');
+ }
+ });
+ }
+ });
+
}); \ No newline at end of file