aboutsummaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js')
-rw-r--r--core/js/sharedialoglinkshareview.js4
-rw-r--r--core/js/sharedialogview.js81
-rw-r--r--core/js/shareitemmodel.js2
-rw-r--r--core/js/tests/specs/jquery.avatarSpec.js2
-rw-r--r--core/js/tests/specs/sharedialogviewSpec.js4
5 files changed, 44 insertions, 49 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js
index 0e317d8c921..9368982d916 100644
--- a/core/js/sharedialoglinkshareview.js
+++ b/core/js/sharedialoglinkshareview.js
@@ -60,14 +60,14 @@
'<input type="checkbox" name="showPassword" id="showPassword-{{cid}}" class="checkbox showPasswordCheckbox" {{#if isPasswordSet}}checked="checked"{{/if}} value="1" />' +
'<label for="showPassword-{{cid}}">{{enablePasswordLabel}}</label>' +
' {{/if}}' +
- '<div id="linkPass" class="linkPass {{#unless isPasswordSet}}hidden{{/unless}}">' +
+ '<div id="linkPass" class="oneline linkPass {{#unless isPasswordSet}}hidden{{/unless}}">' +
' <label for="linkPassText-{{cid}}" class="hidden-visually">{{passwordLabel}}</label>' +
' {{#if showPasswordCheckBox}}' +
' <input id="linkPassText-{{cid}}" class="linkPassText" type="password" placeholder="{{passwordPlaceholder}}" />' +
' {{else}}' +
' <input id="linkPassText-{{cid}}" class="linkPassText" type="password" placeholder="{{passwordPlaceholderInitial}}" />' +
' {{/if}}' +
- ' <span class="icon-loading-small hidden"></span>' +
+ ' <span class="icon icon-loading-small hidden"></span>' +
'</div>' +
'{{else}}' +
// FIXME: this doesn't belong in this view
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index 16a2be0c4a9..3b09d13a7e2 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -22,7 +22,7 @@
'<div class="oneline">' +
' <input id="shareWith-{{cid}}" class="shareWithField" type="text" placeholder="{{sharePlaceholder}}" />' +
' <span class="shareWithLoading icon-loading-small hidden"></span>'+
- '{{{remoteShareInfo}}}' +
+ '{{{shareInfo}}}' +
'</div>' +
'{{/if}}' +
'<div class="shareeListView subView"></div>' +
@@ -30,9 +30,9 @@
'<div class="expirationView subView"></div>' +
'<div class="loading hidden" style="height: 50px"></div>';
- var TEMPLATE_REMOTE_SHARE_INFO =
- '<a target="_blank" class="icon icon-info shareWithRemoteInfo hasTooltip" href="{{docLink}}" ' +
- 'title="{{tooltip}}"></a>';
+ var TEMPLATE_SHARE_INFO =
+ '<span class="icon icon-info shareWithRemoteInfo hasTooltip" ' +
+ 'title="{{tooltip}}"></span>';
/**
* @class OCA.Share.ShareDialogView
@@ -135,7 +135,7 @@
var $shareWithField = $('.shareWithField'),
view = this,
$loading = this.$el.find('.shareWithLoading'),
- $remoteShareInfo = this.$el.find('.shareWithRemoteInfo');
+ $shareInfo = this.$el.find('.shareWithRemoteInfo');
var count = oc_config['sharing.minSearchStringLength'];
if (search.term.trim().length < count) {
@@ -160,7 +160,7 @@
$loading.removeClass('hidden');
$loading.addClass('inlineblock');
- $remoteShareInfo.addClass('hidden');
+ $shareInfo.addClass('hidden');
$shareWithField.removeClass('error')
.tooltip('hide');
@@ -177,7 +177,7 @@
function (result) {
$loading.addClass('hidden');
$loading.removeClass('inlineblock');
- $remoteShareInfo.removeClass('hidden');
+ $shareInfo.removeClass('hidden');
if (result.ocs.meta.statuscode === 100) {
var users = result.ocs.data.exact.users.concat(result.ocs.data.users);
var groups = result.ocs.data.exact.groups.concat(result.ocs.data.groups);
@@ -314,7 +314,7 @@
).fail(function() {
$loading.addClass('hidden');
$loading.removeClass('inlineblock');
- $remoteShareInfo.removeClass('hidden');
+ $shareInfo.removeClass('hidden');
OC.Notification.show(t('core', 'An error occurred. Please try again'));
window.setTimeout(OC.Notification.hide, 5000);
});
@@ -359,22 +359,22 @@
var $loading = this.$el.find('.shareWithLoading');
$loading.removeClass('hidden')
.addClass('inlineblock');
- var $remoteShareInfo = this.$el.find('.shareWithRemoteInfo');
- $remoteShareInfo.addClass('hidden');
+ var $shareInfo = this.$el.find('.shareWithRemoteInfo');
+ $shareInfo.addClass('hidden');
this.model.addShare(s.item.value, {success: function() {
$(e.target).val('')
.attr('disabled', false);
$loading.addClass('hidden')
.removeClass('inlineblock');
- $remoteShareInfo.removeClass('hidden');
+ $shareInfo.removeClass('hidden');
}, error: function(obj, msg) {
OC.Notification.showTemporary(msg);
$(e.target).attr('disabled', false)
.autocomplete('search', $(e.target).val());
$loading.addClass('hidden')
.removeClass('inlineblock');
- $remoteShareInfo.removeClass('hidden');
+ $shareInfo.removeClass('hidden');
}});
},
@@ -412,7 +412,7 @@
cid: this.cid,
shareLabel: t('core', 'Share'),
sharePlaceholder: this._renderSharePlaceholderPart(),
- remoteShareInfo: this._renderRemoteShareInfoPart(),
+ shareInfo: this._renderShareInfoPart(),
isSharingAllowed: this.model.sharePermissionPossible()
}));
@@ -457,47 +457,42 @@
this.linkShareView.showLink = this._showLink;
},
- _renderRemoteShareInfoPart: function() {
- var remoteShareInfo = '';
- if(this.configModel.get('isRemoteShareAllowed')) {
- var infoTemplate = this._getRemoteShareInfoTemplate();
- remoteShareInfo = infoTemplate({
- docLink: this.configModel.getFederatedShareDocLink(),
- tooltip: t('core', 'Share with people on other servers using their Federated Cloud ID username@example.com/nextcloud')
+ _renderShareInfoPart: function() {
+ var shareInfo = '';
+ var infoTemplate = this._getShareInfoTemplate();
+
+ if(this.configModel.get('isMailShareAllowed') && this.configModel.get('isRemoteShareAllowed')) {
+ shareInfo = infoTemplate({
+ tooltip: t('core', 'Share with other people by entering a user or group, a federated cloud ID or an email address.')
+ });
+ } else if(this.configModel.get('isRemoteShareAllowed')) {
+ shareInfo = infoTemplate({
+ tooltip: t('core', 'Share with other people by entering a user or group or a federated cloud ID.')
+ });
+ } else if(this.configModel.get('isMailShareAllowed')) {
+ shareInfo = infoTemplate({
+ tooltip: t('core', 'Share with other people by entering a user or group or an email address.')
});
}
- return remoteShareInfo;
+ return shareInfo;
},
_renderSharePlaceholderPart: function () {
- var allowGroupSharing = this.configModel.get('allowGroupSharing');
var allowRemoteSharing = this.configModel.get('isRemoteShareAllowed');
var allowMailSharing = this.configModel.get('isMailShareAllowed');
- if (!allowGroupSharing && !allowRemoteSharing && allowMailSharing) {
- return t('core', 'Share with users or by mail...');
- }
- if (!allowGroupSharing && allowRemoteSharing && !allowMailSharing) {
- return t('core', 'Share with users or remote users...');
- }
- if (!allowGroupSharing && allowRemoteSharing && allowMailSharing) {
- return t('core', 'Share with users, remote users or by mail...');
- }
- if (allowGroupSharing && !allowRemoteSharing && !allowMailSharing) {
- return t('core', 'Share with users or groups...');
- }
- if (allowGroupSharing && !allowRemoteSharing && allowMailSharing) {
- return t('core', 'Share with users, groups or by mail...');
+ if (!allowRemoteSharing && allowMailSharing) {
+ return t('core', 'Name or email address...');
}
- if (allowGroupSharing && allowRemoteSharing && !allowMailSharing) {
- return t('core', 'Share with users, groups or remote users...');
+ if (allowRemoteSharing && !allowMailSharing) {
+ return t('core', 'Name or federated cloud ID...');
}
- if (allowGroupSharing && allowRemoteSharing && allowMailSharing) {
- return t('core', 'Share with users, groups, remote users or by mail...');
+ if (allowRemoteSharing && allowMailSharing) {
+ return t('core', 'Name, federated cloud ID or email address...');
}
- return t('core', 'Share with users...');
+ return t('core', 'Name...');
},
/**
@@ -520,8 +515,8 @@
* @returns {Function}
* @private
*/
- _getRemoteShareInfoTemplate: function() {
- return this._getTemplate('remoteShareInfo', TEMPLATE_REMOTE_SHARE_INFO);
+ _getShareInfoTemplate: function() {
+ return this._getTemplate('shareInfo', TEMPLATE_SHARE_INFO);
}
});
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index 8144d8faa21..41f9eb5e0aa 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -798,7 +798,7 @@
isLinkShare: true,
id: share.id,
token: share.token,
- password: share.password,
+ password: share.share_with,
link: link,
permissions: share.permissions,
// currently expiration is only effective for link shares.
diff --git a/core/js/tests/specs/jquery.avatarSpec.js b/core/js/tests/specs/jquery.avatarSpec.js
index 9bb10c41be7..dab78500d0b 100644
--- a/core/js/tests/specs/jquery.avatarSpec.js
+++ b/core/js/tests/specs/jquery.avatarSpec.js
@@ -186,7 +186,7 @@ describe('jquery.avatar tests', function() {
});
it('with ie8 fix', function() {
- sinon.stub(Math, 'random', function() {
+ sinon.stub(Math, 'random').callsFake(function() {
return 0.5;
});
diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js
index 307adea85ff..95349bc4875 100644
--- a/core/js/tests/specs/sharedialogviewSpec.js
+++ b/core/js/tests/specs/sharedialogviewSpec.js
@@ -19,7 +19,7 @@
*
*/
-/* global oc_appconfig */
+/* global oc_appconfig, sinon */
describe('OC.Share.ShareDialogView', function() {
var $container;
var oldAppConfig;
@@ -90,7 +90,7 @@ describe('OC.Share.ShareDialogView', function() {
linkShare: {isLinkShare: false}
});
- autocompleteStub = sinon.stub($.fn, 'autocomplete', function() {
+ autocompleteStub = sinon.stub($.fn, 'autocomplete').callsFake(function() {
// dummy container with the expected attributes
if (!$(this).length) {
// simulate the real autocomplete that returns