diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-05-01 20:44:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-01 20:44:19 +0200 |
commit | 8cb3115acf2115ea9abe01c4b5d6ab806f7e485f (patch) | |
tree | a357430810516eb20d095ec989334bd8c452fa66 /core | |
parent | 4904117ba8206d24324d5c6a2f8150a1641e4ac5 (diff) | |
parent | 4cd8b3379bd30493b3086a33a5abd7e4e418767f (diff) | |
download | nextcloud-server-8cb3115acf2115ea9abe01c4b5d6ab806f7e485f.tar.gz nextcloud-server-8cb3115acf2115ea9abe01c4b5d6ab806f7e485f.zip |
Merge pull request #4615 from nextcloud/js-reduce-share.js-complexity
Remove abandoned methods in OC.Share that refer to old API endpoints
Diffstat (limited to 'core')
-rw-r--r-- | core/js/share.js | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/core/js/share.js b/core/js/share.js index 194eba5fbd4..1f2126b8f51 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -315,93 +315,6 @@ OC.Share = _.extend(OC.Share || {}, { } icon.removeClass('icon-shared icon-public').addClass(iconClass); }, - /** - * - * @param itemType - * @param itemSource - * @param callback - optional. If a callback is given this method works - * asynchronous and the callback will be provided with data when the request - * is done. - * @returns {OC.Share.Types.ShareInfo} - */ - loadItem:function(itemType, itemSource, callback) { - var data = ''; - var checkReshare = true; - var async = !_.isUndefined(callback); - if (typeof OC.Share.statuses[itemSource] === 'undefined') { - // NOTE: Check does not always work and misses some shares, fix later - var checkShares = true; - } else { - var checkShares = true; - } - $.ajax({type: 'GET', url: OC.filePath('core', 'ajax', 'share.php'), data: { fetch: 'getItem', itemType: itemType, itemSource: itemSource, checkReshare: checkReshare, checkShares: checkShares }, async: async, success: function(result) { - if (result && result.status === 'success') { - data = result.data; - } else { - data = false; - } - if(async) { - callback(data); - } - }}); - - return data; - }, - share:function(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, expirationDate, callback, errorCallback) { - // Add a fallback for old share() calls without expirationDate. - // We should remove this in a later version, - // after the Apps have been updated. - if (typeof callback === 'undefined' && - typeof expirationDate === 'function') { - callback = expirationDate; - expirationDate = ''; - console.warn( - "Call to 'OC.Share.share()' with too few arguments. " + - "'expirationDate' was assumed to be 'callback'. " + - "Please revisit the call and fix the list of arguments." - ); - } - - return $.post(OC.filePath('core', 'ajax', 'share.php'), - { - action: 'share', - itemType: itemType, - itemSource: itemSource, - shareType: shareType, - shareWith: shareWith, - permissions: permissions, - itemSourceName: itemSourceName, - expirationDate: expirationDate - }, function (result) { - if (result && result.status === 'success') { - if (callback) { - callback(result.data); - } - } else { - if (_.isUndefined(errorCallback)) { - var msg = t('core', 'Error'); - if (result.data && result.data.message) { - msg = result.data.message; - } - OC.dialogs.alert(msg, t('core', 'Error while sharing')); - } else { - errorCallback(result); - } - } - } - ); - }, - unshare:function(itemType, itemSource, shareType, shareWith, callback) { - $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'unshare', itemType: itemType, itemSource: itemSource, shareType: shareType, shareWith: shareWith }, function(result) { - if (result && result.status === 'success') { - if (callback) { - callback(); - } - } else { - OC.dialogs.alert(t('core', 'Error while unsharing'), t('core', 'Error')); - } - }); - }, showDropDown:function(itemType, itemSource, appendTo, link, possiblePermissions, filename) { var configModel = new OC.Share.ShareConfigModel(); var attributes = {itemType: itemType, itemSource: itemSource, possiblePermissions: possiblePermissions}; |