Bläddra i källkod

Merge branch 'third-party-requests'

master
Boris Grozev 10 år sedan
förälder
incheckning
a647400cb8
4 ändrade filer med 26 tillägg och 8 borttagningar
  1. 1
    0
      config.js
  2. 2
    0
      css/contact_list.css
  3. 14
    3
      index.html
  4. 9
    5
      modules/UI/avatar/Avatar.js

+ 1
- 0
config.js Visa fil

@@ -69,4 +69,5 @@ var config = {
69 69
     /*noticeMessage: 'Service update is scheduled for 16th March 2015. ' +
70 70
     'During that time service will not be available. ' +
71 71
     'Apologise for inconvenience.'*/
72
+    disableThirdPartyRequests: false
72 73
 };

+ 2
- 0
css/contact_list.css Visa fil

@@ -44,6 +44,8 @@
44 44
     vertical-align: middle;
45 45
     font-size: 22pt;
46 46
     border-radius: 20px;
47
+    max-height: 30px;
48
+    max-width: 30px;
47 49
 }
48 50
 
49 51
 #contactlist .clickable {

+ 14
- 3
index.html Visa fil

@@ -11,11 +11,9 @@
11 11
     <meta itemprop="image" content="/images/jitsilogo.png?v=1"/>
12 12
       <link rel="stylesheet" href="css/all.css"/>
13 13
     <script>console.log("(TIME) index.html loaded:\t", window.performance.now());</script>
14
-    <script src="https://api.callstats.io/static/callstats.min.js"></script>
15 14
     <script src="config.js?v=15"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
16 15
     <script src="interface_config.js?v=6"></script>
17 16
     <script src="libs/app.bundle.min.js?v=139"></script>
18
-    <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
19 17
     <!--
20 18
         Link used for inline installation of chrome desktop streaming extension,
21 19
         is updated automatically from the code with the value defined in config.js -->
@@ -203,7 +201,7 @@
203 201
         </div>
204 202
         <div id="settingsmenu" class="right-panel">
205 203
             <div class="icon-settings" data-i18n="settings.title"></div>
206
-            <img id="avatar" src="https://www.gravatar.com/avatar/87291c37c25be69a072a4514931b1749?d=wavatar&size=30"/>
204
+            <img id="avatar" src="images/avatar2.png"/>
207 205
             <div class="arrow-up"></div>
208 206
             <input type="text" id="setDisplayName" data-i18n="[placeholder]settings.name" placeholder="Name">
209 207
             <input type="text" id="setEmail" placeholder="E-Mail">
@@ -224,5 +222,18 @@
224 222
             <a id="feedbackButton" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[data-content]feedback"><i class="fa fa-heart"></i></a>
225 223
         </div>
226 224
     </div>
225
+    <script type="text/javascript">
226
+      if (!config.disableThirdPartyRequests) {
227
+        [
228
+          'https://api.callstats.io/static/callstats.min.js',
229
+          'analytics.js?v=1'
230
+        ].forEach(function(extSrc) {
231
+          var extScript = document.createElement('script');
232
+          extScript.src = extSrc;
233
+          extScript.async = false;
234
+          document.head.appendChild(extScript);
235
+        });
236
+      }
237
+    </script>
227 238
   </body>
228 239
 </html>

+ 9
- 5
modules/UI/avatar/Avatar.js Visa fil

@@ -1,4 +1,4 @@
1
-/* global Strophe, APP, MD5 */
1
+/* global Strophe, APP, MD5, config */
2 2
 var Settings = require("../../settings/Settings");
3 3
 
4 4
 var users = {};
@@ -57,12 +57,16 @@ var Avatar = {
57 57
                 "No avatar stored yet for " + jid + " - using JID as ID");
58 58
             id = jid;
59 59
         }
60
-        return 'https://www.gravatar.com/avatar/' +
61
-            MD5.hexdigest(id.trim().toLowerCase()) +
62
-            "?d=wavatar&size=" + (size || "30");
60
+        if (!config.disableThirdPartyRequests) {
61
+            return 'https://www.gravatar.com/avatar/' +
62
+                MD5.hexdigest(id.trim().toLowerCase()) +
63
+                "?d=wavatar&size=" + (size || "30");
64
+        } else {
65
+            return 'images/avatar2.png';
66
+        }
63 67
     }
64 68
 
65 69
 };
66 70
 
67 71
 
68
-module.exports = Avatar;
72
+module.exports = Avatar;

Laddar…
Avbryt
Spara