From b369adbd9487496d799cf04f66fcc72a002ccda5 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Wed, 25 Apr 2012 11:51:18 -0400 Subject: Allow admin to disable resharing of files --- apps/files_sharing/js/settings.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 apps/files_sharing/js/settings.js (limited to 'apps/files_sharing/js') diff --git a/apps/files_sharing/js/settings.js b/apps/files_sharing/js/settings.js new file mode 100644 index 00000000000..f1b1643e7d6 --- /dev/null +++ b/apps/files_sharing/js/settings.js @@ -0,0 +1,9 @@ +$(document).ready(function() { + $('#allowResharing').bind('change', function() { + var checked = 1; + if (!$('#allowResharing').attr('checked')) { + checked = 0; + } + $.post(OC.filePath('files_sharing','ajax','toggleresharing.php'), 'resharing='+checked); + }); +}); \ No newline at end of file -- cgit v1.2.3 From 6895c54a3fe4cbc690ce0e17154bfe2e40295bb0 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Wed, 25 Apr 2012 14:35:30 -0400 Subject: Fix javascript checkbox toggle for resharing --- apps/files_sharing/js/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files_sharing/js') diff --git a/apps/files_sharing/js/settings.js b/apps/files_sharing/js/settings.js index f1b1643e7d6..bb7d79fecbb 100644 --- a/apps/files_sharing/js/settings.js +++ b/apps/files_sharing/js/settings.js @@ -1,7 +1,7 @@ $(document).ready(function() { $('#allowResharing').bind('change', function() { var checked = 1; - if (!$('#allowResharing').attr('checked')) { + if (!this.checked) { checked = 0; } $.post(OC.filePath('files_sharing','ajax','toggleresharing.php'), 'resharing='+checked); -- cgit v1.2.3 From 754844f5c9884d1889ea29cdf5fd3ecc9ef6fb86 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Thu, 26 Apr 2012 10:33:06 -0400 Subject: Add ability to send private links from sharing via email --- apps/files_sharing/ajax/email.php | 15 +++++++++++++++ apps/files_sharing/js/share.js | 21 +++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 apps/files_sharing/ajax/email.php (limited to 'apps/files_sharing/js') diff --git a/apps/files_sharing/ajax/email.php b/apps/files_sharing/ajax/email.php new file mode 100644 index 00000000000..d6d53c49bff --- /dev/null +++ b/apps/files_sharing/ajax/email.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 54d749d833e..4125fd14d25 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -163,6 +163,9 @@ $(document).ready(function() { data: data, success: function(){ $('#link').hide('blind'); + $('#emailBreak').remove(); + $('#email').hide('blind'); + $('#emailButton').hide('blind'); } }); } @@ -172,6 +175,14 @@ $(document).ready(function() { $(this).focus(); $(this).select(); }); + + $('#emailButton').live('click', function() { + $('#email').css('font-weight', 'bold'); + $('#email').animate({ fontWeight: 'normal' }, 2000, function() { + $(this).val(''); + }).val('Email sent'); + $.post(OC.filePath('files_sharing','ajax','email.php'), 'toaddress='+$('#email').val()+'&link='+$('#link').val()); + }); }); function createDropdown(filename, files) { @@ -183,10 +194,12 @@ function createDropdown(filename, files) { html += '
    '; html += ''; html += '
    '; - html += ''; + html += ''; //html += ''; html += '
    '; html += ''; + html += ''; + html += ''; html += '
    '; if (filename) { $('tr').filterAttr('data-file',filename).addClass('mouseOver'); @@ -241,5 +254,9 @@ function showPublicLink(token, file) { $('#makelink').attr('checked', true); $('#link').data('token', token); $('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token+'&f='+file); - $('#link').show('blind'); + $('#link').show('blind', function() { + $('#link').after('
    '); + $('#email').show('blind'); + $('#emailButton').show('blind'); + }); } -- cgit v1.2.3