diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2012-12-10 23:22:42 +0100 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2012-12-10 23:22:42 +0100 |
commit | 162a2c0fba6f7d7be3aa2372554e4a77a70a3e00 (patch) | |
tree | 733323b13feb40ef6e52d326b691d078b6f3bda4 /core/js | |
parent | 45074d5023d408f4f81bc45380ce68b1008f9414 (diff) | |
download | nextcloud-server-162a2c0fba6f7d7be3aa2372554e4a77a70a3e00.tar.gz nextcloud-server-162a2c0fba6f7d7be3aa2372554e4a77a70a3e00.zip |
moving sharing email code to core
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/share.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/core/js/share.js b/core/js/share.js index 962983e2f35..9f71f1bb66b 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -555,4 +555,27 @@ $(document).ready(function() { }); }); + + $('#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('core', 'ajax', 'share.php'), { action: 'email', toaddress: email, link: link, itemType: itemType, itemSource: itemSource, file: file}, function(result) { + if (result && result.status == 'success') { + $('#email').css('font-weight', 'bold'); + $('#email').animate({ fontWeight: 'normal' }, 2000, function() { + $(this).val(''); + }).val(t('core','Email sent')); + } else { + OC.dialogs.alert(result.data.message, t('core', 'Error while sharing')); + } + }); + } + }); + + }); |