diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-09-01 18:53:48 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-09-01 18:53:48 -0400 |
commit | 6c29334b4888309e7b60cbdf4defdac1c47195bf (patch) | |
tree | ba6e3f3398420e5a8b821228df9c0c0e885f2195 /core/js | |
parent | aad7dc8390b67ee7d04d83765b1295b9507767f5 (diff) | |
download | nextcloud-server-6c29334b4888309e7b60cbdf4defdac1c47195bf.tar.gz nextcloud-server-6c29334b4888309e7b60cbdf4defdac1c47195bf.zip |
Add support for share expiration
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/share.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/js/share.js b/core/js/share.js index 4c164f65b24..2f3b5c2fa50 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -143,6 +143,9 @@ OC.Share={ html += '<input id="linkPassText" type="password" placeholder="Password" style="display:none; width:90%;" />'; html += '</div>'; } + html += '<div id="expiration">'; + html += '<input type="checkbox" name="expirationCheckbox" id="expirationCheckbox" value="1" /><label for="expirationCheckbox">Set expiration date</label>'; + html += '<input id="expirationDate" type="text" placeholder="Expiration date" style="display:none; width:90%;" />'; html += '</div>'; $(html).appendTo(appendTo); // Reset item shares @@ -422,6 +425,30 @@ $(document).ready(function() { } }); + $('#expirationCheckbox').live('change', function() { + if (this.checked) { + console.log('checked'); + $('#expirationDate').before('<br />'); + $('#expirationDate').show(); + $('#expirationDate').datepicker({ + dateFormat : 'dd-mm-yy' + }); + } else { + console.log('unchecled'); + $('#expirationDate').hide(); + } + }); + + $('#expirationDate').live('change', function() { + var itemType = $('#dropdown').data('item-type'); + var itemSource = $('#dropdown').data('item-source'); + $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setExpirationDate', itemType: itemType, itemSource: itemSource, date: $(this).val() }, function(result) { + if (!result || result.status !== 'success') { + OC.dialogs.alert('Error', 'Error setting expiration date'); + } + }); + }); + $('#emailPrivateLink').live('submit', function() { OC.Share.emailPrivateLink(); }); |