diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-09-12 14:21:14 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-16 07:23:27 +0200 |
commit | f29b51682bc0be785e1a3e4e5901db3255e4a377 (patch) | |
tree | 93375423f13d63a4ca97cc800b8fb981d48432f5 /core/js/share.js | |
parent | 4c702aa8fdfb28bea4b021e55e7df5eeeb6999d2 (diff) | |
download | nextcloud-server-f29b51682bc0be785e1a3e4e5901db3255e4a377.tar.gz nextcloud-server-f29b51682bc0be785e1a3e4e5901db3255e4a377.zip |
share and unshare via link (not yet password). also some internal changes to reduce unnecessary rendering
Diffstat (limited to 'core/js/share.js')
-rw-r--r-- | core/js/share.js | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/core/js/share.js b/core/js/share.js index bd87ab10d40..6581c401281 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -956,80 +956,6 @@ $(document).ready(function() { permissions); }); - $(document).on('change', '#dropdown #linkCheckbox', function() { - var $dropDown = $('#dropdown'); - var itemType = $dropDown.data('item-type'); - var itemSource = $dropDown.data('item-source'); - var itemSourceName = $dropDown.data('item-source-name'); - var $loading = $dropDown.find('#link .icon-loading-small'); - var $button = $(this); - - if (!$loading.hasClass('hidden')) { - // already in progress - return false; - } - - if (this.checked) { - // Reset password placeholder - $('#linkPassText').attr('placeholder', t('core', 'Choose a password for the public link')); - // Reset link - $('#linkText').val(''); - $('#showPassword').prop('checked', false); - $('#linkPass').hide(); - $('#sharingDialogAllowPublicUpload').prop('checked', false); - $('#expirationCheckbox').prop('checked', false); - $('#expirationDate').hide(); - var expireDateString = ''; - // Create a link - if (oc_appconfig.core.enforcePasswordForPublicLink === false) { - expireDateString = OC.Share.getDefaultExpirationDate(); - $loading.removeClass('hidden'); - $button.addClass('hidden'); - $button.prop('disabled', true); - - OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', OC.PERMISSION_READ, itemSourceName, expireDateString, function(data) { - $loading.addClass('hidden'); - $button.removeClass('hidden'); - $button.prop('disabled', false); - OC.Share.showLink(data.token, null, itemSource); - $('#dropdown').trigger(new $.Event('sharesChanged', {shares: OC.Share.currentShares})); - OC.Share.updateIcon(itemType, itemSource); - }); - } else { - $('#linkPass').slideToggle(OC.menuSpeed); - // TODO drop with IE8 drop - if($('html').hasClass('ie8')) { - $('#linkPassText').attr('placeholder', null); - $('#linkPassText').val(''); - } - $('#linkPassText').focus(); - } - if (expireDateString !== '') { - OC.Share.showExpirationDate(expireDateString); - } - } else { - // Delete private link - OC.Share.hideLink(); - $('#expiration').slideUp(OC.menuSpeed); - if ($('#linkText').val() !== '') { - $loading.removeClass('hidden'); - $button.addClass('hidden'); - $button.prop('disabled', true); - OC.Share.unshare(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', function() { - $loading.addClass('hidden'); - $button.removeClass('hidden'); - $button.prop('disabled', false); - OC.Share.itemShares[OC.Share.SHARE_TYPE_LINK] = false; - $('#dropdown').trigger(new $.Event('sharesChanged', {shares: OC.Share.currentShares})); - OC.Share.updateIcon(itemType, itemSource); - if (typeof OC.Share.statuses[itemSource] === 'undefined') { - $('#expiration').slideUp(OC.menuSpeed); - } - }); - } - } - }); - $(document).on('click', '#dropdown #linkText', function() { $(this).focus(); $(this).select(); |