diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 8387e527f4..f60968616a 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -23,9 +23,7 @@ var EDIT_COMMENT_TEMPLATE = '
' ; @@ -93,17 +91,14 @@ } this.$el.html(reshareTemplate({ - avatarEnabled: this.configModel.areAvatarsEnabled(), reshareOwner: this.model.getReshareOwner(), sharedByText: sharedByText })); - if(this.configModel.areAvatarsEnabled()) { - this.$el.find('.avatar').each(function() { - var $this = $(this); - $this.avatar($this.data('username'), 32); - }); - } + this.$el.find('.avatar').each(function() { + var $this = $(this); + $this.avatar($this.data('username'), 32); + }); return this; }, diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 4647dedd72..47dc62d14f 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -21,9 +21,7 @@ '
' + '{{#each sharees}}' + '- ' +
- '{{#if avatarEnabled}}' +
'' +
- '{{/if}}' +
'{{shareWithDisplayName}}' +
'' +
'{{#if editPermissionPossible}}' +
@@ -41,9 +39,7 @@
'{{/each}}' +
'{{#each linkReshares}}' +
'
- ' +
- '{{#if avatarEnabled}}' +
'' +
- '{{/if}}' +
'' + t('core', '{{shareInitiatorDisplayName}} shared via link') + '' +
'' +
@@ -193,7 +189,6 @@
getShareProperties: function() {
return {
- avatarEnabled: this.configModel.areAvatarsEnabled(),
unshareLabel: t('core', 'Unshare'),
canShareLabel: t('core', 'can reshare'),
canEditLabel: t('core', 'can edit'),
@@ -247,7 +242,6 @@
getLinkReshares: function() {
var universal = {
unshareLabel: t('core', 'Unshare'),
- avatarEnabled: this.configModel.areAvatarsEnabled(),
};
if(!this.model.hasUserShares()) {
@@ -281,18 +275,16 @@
linkReshares: this.getLinkReshares()
}));
- if (this.configModel.areAvatarsEnabled()) {
- this.$('.avatar').each(function () {
- var $this = $(this);
- if ($this.hasClass('imageplaceholderseed')) {
- $this.css({width: 32, height: 32});
- $this.imageplaceholder($this.data('seed'));
- } else {
- // user, size, ie8fix, hidedefault, callback, displayname
- $this.avatar($this.data('username'), 32, undefined, undefined, undefined, $this.data('displayname'));
- }
- });
- }
+ this.$('.avatar').each(function () {
+ var $this = $(this);
+ if ($this.hasClass('imageplaceholderseed')) {
+ $this.css({width: 32, height: 32});
+ $this.imageplaceholder($this.data('seed'));
+ } else {
+ // user, size, ie8fix, hidedefault, callback, displayname
+ $this.avatar($this.data('username'), 32, undefined, undefined, undefined, $this.data('displayname'));
+ }
+ });
this.$('.has-tooltip').tooltip({
placement: 'bottom'
diff --git a/core/js/tests/specs/sharedialogviewSpec.js b/core/js/tests/specs/sharedialogviewSpec.js
index cbb74714ff..307adea85f 100644
--- a/core/js/tests/specs/sharedialogviewSpec.js
+++ b/core/js/tests/specs/sharedialogviewSpec.js
@@ -24,7 +24,6 @@ describe('OC.Share.ShareDialogView', function() {
var $container;
var oldAppConfig;
var autocompleteStub;
- var oldEnableAvatars;
var avatarStub;
var placeholderStub;
var oldCurrentUser;
@@ -103,8 +102,6 @@ describe('OC.Share.ShareDialogView', function() {
return $el;
});
- oldEnableAvatars = oc_config.enable_avatars;
- oc_config.enable_avatars = false;
avatarStub = sinon.stub($.fn, 'avatar');
placeholderStub = sinon.stub($.fn, 'imageplaceholder');
@@ -123,7 +120,6 @@ describe('OC.Share.ShareDialogView', function() {
autocompleteStub.restore();
avatarStub.restore();
placeholderStub.restore();
- oc_config.enable_avatars = oldEnableAvatars;
});
describe('Share with link', function() {
// TODO: test ajax calls
@@ -440,18 +436,13 @@ describe('OC.Share.ShareDialogView', function() {
describe('avatars enabled', function() {
beforeEach(function() {
- oc_config.enable_avatars = true;
avatarStub.reset();
dialog.render();
});
- afterEach(function() {
- oc_config.enable_avatars = false;
- });
-
it('test correct function calls', function() {
expect(avatarStub.calledTwice).toEqual(true);
- expect(placeholderStub.calledTwice).toEqual(true);
+ expect(placeholderStub.callCount).toEqual(4);
expect(dialog.$('.shareWithList').children().length).toEqual(3);
expect(dialog.$('.avatar').length).toEqual(4);
});
@@ -481,18 +472,6 @@ describe('OC.Share.ShareDialogView', function() {
expect(args[0]).toEqual('foo@bar.com/baz ' + OC.Share.SHARE_TYPE_REMOTE);
});
});
-
- describe('avatars disabled', function() {
- beforeEach(function() {
- dialog.render();
- });
-
- it('no avatar classes', function() {
- expect($('.avatar').length).toEqual(0);
- expect(avatarStub.callCount).toEqual(0);
- expect(placeholderStub.callCount).toEqual(0);
- });
- });
});
describe('remote sharing', function() {
it('shows remote share info when allowed', function() {
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 4842a94897..e9a9b042e0 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -73,7 +73,6 @@
-
-
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php
index f17c6a1619..1c241989fd 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -204,7 +204,7 @@ class JSConfigHelper {
'session_keepalive' => $this->config->getSystemValue('session_keepalive', true),
'version' => implode('.', \OCP\Util::getVersion()),
'versionstring' => \OC_Util::getVersionString(),
- 'enable_avatars' => $this->config->getSystemValue('enable_avatars', true) === true,
+ 'enable_avatars' => true, // here for legacy reasons - to not crash existing code that relies on this value
'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null),
'modRewriteWorking' => (\OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'),
]),
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index 19fc946218..f162136323 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -100,7 +100,6 @@ class TemplateLayout extends \OC_Template {
$this->assign('user_displayname', $userDisplayName);
$this->assign('user_uid', \OC_User::getUser());
$this->assign('appsmanagement_active', $appsMgmtActive);
- $this->assign('enableAvatars', $this->config->getSystemValue('enable_avatars', true) === true);
if (\OC_User::getUser() === false) {
$this->assign('userAvatarSet', false);
diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php
index a07bf214f3..09e3d130f4 100644
--- a/lib/private/legacy/template.php
+++ b/lib/private/legacy/template.php
@@ -121,10 +121,8 @@ class OC_Template extends \OC\Template\Base {
OC_Util::addStyle("styles",null,true);
// avatars
- if (\OC::$server->getSystemConfig()->getValue('enable_avatars', true) === true) {
- \OC_Util::addScript('jquery.avatar', null, true);
- \OC_Util::addScript('placeholder', null, true);
- }
+ \OC_Util::addScript('jquery.avatar', null, true);
+ \OC_Util::addScript('placeholder', null, true);
OC_Util::addVendorScript('select2/select2');
OC_Util::addVendorStyle('select2/select2', null, true);
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php
index 43a3843249..719b6eb68f 100644
--- a/settings/Controller/UsersController.php
+++ b/settings/Controller/UsersController.php
@@ -188,12 +188,10 @@ class UsersController extends Controller {
}
$avatarAvailable = false;
- if ($this->config->getSystemValue('enable_avatars', true) === true) {
- try {
- $avatarAvailable = $this->avatarManager->getAvatar($user->getUID())->exists();
- } catch (\Exception $e) {
- //No avatar yet
- }
+ try {
+ $avatarAvailable = $this->avatarManager->getAvatar($user->getUID())->exists();
+ } catch (\Exception $e) {
+ //No avatar yet
}
return [
diff --git a/settings/js/personal.js b/settings/js/personal.js
index f9a4517633..89491b9665 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -334,15 +334,13 @@ $(document).ready(function () {
});
// Load the big avatar
- if (oc_config.enable_avatars) {
- $('#avatarform .avatardiv').avatar(OC.currentUser, 145, true, null, function() {
- if($('#displayavatar img').length === 0) {
- $('#removeavatar').removeClass('inlineblock').addClass('hidden');
- } else {
- $('#removeavatar').removeClass('hidden').addClass('inlineblock');
- }
- });
- }
+ $('#avatarform .avatardiv').avatar(OC.currentUser, 145, true, null, function() {
+ if($('#displayavatar img').length === 0) {
+ $('#removeavatar').removeClass('inlineblock').addClass('hidden');
+ } else {
+ $('#removeavatar').removeClass('hidden').addClass('inlineblock');
+ }
+ });
// Show token views
diff --git a/settings/personal.php b/settings/personal.php
index a79e9764a6..a1fcd10e0a 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -57,10 +57,8 @@ OC_Util::addStyle( 'settings', 'settings' );
\OC_Util::addVendorScript('strengthify/jquery.strengthify');
\OC_Util::addVendorStyle('strengthify/strengthify');
\OC_Util::addScript('files', 'jquery.fileupload');
-if ($config->getSystemValue('enable_avatars', true) === true) {
- \OC_Util::addVendorScript('jcrop/js/jquery.Jcrop');
- \OC_Util::addVendorStyle('jcrop/css/jquery.Jcrop');
-}
+\OC_Util::addVendorScript('jcrop/js/jquery.Jcrop');
+\OC_Util::addVendorStyle('jcrop/css/jquery.Jcrop');
\OC::$server->getEventDispatcher()->dispatch('OC\Settings\Personal::loadAdditionalScripts');
@@ -182,7 +180,6 @@ $tmpl->assign('websiteScope', $userData[\OC\Accounts\AccountManager::PROPERTY_WE
$tmpl->assign('twitterScope', $userData[\OC\Accounts\AccountManager::PROPERTY_TWITTER]['scope']);
$tmpl->assign('addressScope', $userData[\OC\Accounts\AccountManager::PROPERTY_ADDRESS]['scope']);
-$tmpl->assign('enableAvatars', $config->getSystemValue('enable_avatars', true) === true);
$tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser()));
$tmpl->assign('certs', $certificateManager->listCertificates());
$tmpl->assign('showCertificates', $enableCertImport);
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index 65ce3751b9..ecbf1ff5c5 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -35,7 +35,6 @@
-
-
diff --git a/settings/templates/users/part.userlist.php b/settings/templates/users/part.userlist.php
index bab68e5a76..4cf395ff62 100644
--- a/settings/templates/users/part.userlist.php
+++ b/settings/templates/users/part.userlist.php
@@ -1,9 +1,7 @@
-
-
t('Username'))?>
t( 'Full name' )); ?>
t( 'Password' )); ?>
@@ -22,9 +20,7 @@