summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-05-01 01:19:46 -0300
committerMorris Jobke <hey@morrisjobke.de>2017-05-01 01:29:00 -0300
commit4cd8b3379bd30493b3086a33a5abd7e4e418767f (patch)
treef4dde423b254c109ce42eb15fa74f69af44f37ad /core/js
parent2152d5f1f610a40539f11e91318ab27c54400ef3 (diff)
downloadnextcloud-server-4cd8b3379bd30493b3086a33a5abd7e4e418767f.tar.gz
nextcloud-server-4cd8b3379bd30493b3086a33a5abd7e4e418767f.zip
Remove unused methods from OC.Share
* they do calls against core/ajax/share.php which doesn't exist anymore * also the methods are not called in any of our apps or any of the apps in the appstore Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core/js')
-rw-r--r--core/js/share.js87
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};