From 3f42f8bf671a44cb6662dda98a16454526dd43ba Mon Sep 17 00:00:00 2001 From: Jesse Bickel Date: Fri, 4 Dec 2015 13:03:10 -0600 Subject: [PATCH 1/4] Only load 3rd party JavaScript when config.enableThirdPartyRequests is true. --- config.js | 1 + index.html | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config.js b/config.js index 90bbd6410..1bb3d1563 100644 --- a/config.js +++ b/config.js @@ -69,4 +69,5 @@ var config = { /*noticeMessage: 'Service update is scheduled for 16th March 2015. ' + 'During that time service will not be available. ' + 'Apologise for inconvenience.'*/ + enableThirdPartyRequests: true }; diff --git a/index.html b/index.html index 93681fc6d..facee3d0e 100644 --- a/index.html +++ b/index.html @@ -11,11 +11,9 @@ - - @@ -224,5 +222,20 @@ + From 895bb3fd608a7a13848909538fc957e24aa61383 Mon Sep 17 00:00:00 2001 From: Jesse Bickel Date: Mon, 7 Dec 2015 14:41:35 -0600 Subject: [PATCH 2/4] Use gravatar when enabled. --- index.html | 2 +- modules/UI/avatar/Avatar.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index facee3d0e..8b134f2cc 100644 --- a/index.html +++ b/index.html @@ -201,7 +201,7 @@
- +
diff --git a/modules/UI/avatar/Avatar.js b/modules/UI/avatar/Avatar.js index 6ab1327e4..d59f494c7 100644 --- a/modules/UI/avatar/Avatar.js +++ b/modules/UI/avatar/Avatar.js @@ -1,4 +1,4 @@ -/* global Strophe, APP, MD5 */ +/* global Strophe, APP, MD5, config */ var Settings = require("../../settings/Settings"); var users = {}; @@ -57,12 +57,16 @@ var Avatar = { "No avatar stored yet for " + jid + " - using JID as ID"); id = jid; } - return 'https://www.gravatar.com/avatar/' + - MD5.hexdigest(id.trim().toLowerCase()) + - "?d=wavatar&size=" + (size || "30"); + if (config.enableThirdPartyRequests === true) { + return 'https://www.gravatar.com/avatar/' + + MD5.hexdigest(id.trim().toLowerCase()) + + "?d=wavatar&size=" + (size || "30"); + } else { + return 'images/avatar2.png'; + } } }; -module.exports = Avatar; \ No newline at end of file +module.exports = Avatar; From c2c3d0fd8734c507c75ddd173ca905ddceafa160 Mon Sep 17 00:00:00 2001 From: Jesse Bickel Date: Mon, 7 Dec 2015 15:52:11 -0600 Subject: [PATCH 3/4] Shrink the avatar on contact list to <=30px. --- css/contact_list.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/css/contact_list.css b/css/contact_list.css index 4929cc90b..7dab8a523 100644 --- a/css/contact_list.css +++ b/css/contact_list.css @@ -44,6 +44,8 @@ vertical-align: middle; font-size: 22pt; border-radius: 20px; + max-height: 30px; + max-width: 30px; } #contactlist .clickable { From f42684d7896061580ee10614bb05f8246e676bbc Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Tue, 8 Dec 2015 22:51:29 +0000 Subject: [PATCH 4/4] Changes enableThirdParty requests to disableThirdParty requests, in order to not change existing behaviour (without changes to config.js). --- config.js | 2 +- index.html | 6 ++---- modules/UI/avatar/Avatar.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/config.js b/config.js index 1bb3d1563..f180124f2 100644 --- a/config.js +++ b/config.js @@ -69,5 +69,5 @@ var config = { /*noticeMessage: 'Service update is scheduled for 16th March 2015. ' + 'During that time service will not be available. ' + 'Apologise for inconvenience.'*/ - enableThirdPartyRequests: true + disableThirdPartyRequests: false }; diff --git a/index.html b/index.html index 8b134f2cc..d66835e1d 100644 --- a/index.html +++ b/index.html @@ -223,13 +223,11 @@