Selaa lähdekoodia

Merge branch 'third-party-requests'

master
Boris Grozev 10 vuotta sitten
vanhempi
commit
a647400cb8
4 muutettua tiedostoa jossa 26 lisäystä ja 8 poistoa
  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 Näytä tiedosto

69
     /*noticeMessage: 'Service update is scheduled for 16th March 2015. ' +
69
     /*noticeMessage: 'Service update is scheduled for 16th March 2015. ' +
70
     'During that time service will not be available. ' +
70
     'During that time service will not be available. ' +
71
     'Apologise for inconvenience.'*/
71
     'Apologise for inconvenience.'*/
72
+    disableThirdPartyRequests: false
72
 };
73
 };

+ 2
- 0
css/contact_list.css Näytä tiedosto

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

+ 14
- 3
index.html Näytä tiedosto

11
     <meta itemprop="image" content="/images/jitsilogo.png?v=1"/>
11
     <meta itemprop="image" content="/images/jitsilogo.png?v=1"/>
12
       <link rel="stylesheet" href="css/all.css"/>
12
       <link rel="stylesheet" href="css/all.css"/>
13
     <script>console.log("(TIME) index.html loaded:\t", window.performance.now());</script>
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
     <script src="config.js?v=15"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
14
     <script src="config.js?v=15"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
16
     <script src="interface_config.js?v=6"></script>
15
     <script src="interface_config.js?v=6"></script>
17
     <script src="libs/app.bundle.min.js?v=139"></script>
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
         Link used for inline installation of chrome desktop streaming extension,
18
         Link used for inline installation of chrome desktop streaming extension,
21
         is updated automatically from the code with the value defined in config.js -->
19
         is updated automatically from the code with the value defined in config.js -->
203
         </div>
201
         </div>
204
         <div id="settingsmenu" class="right-panel">
202
         <div id="settingsmenu" class="right-panel">
205
             <div class="icon-settings" data-i18n="settings.title"></div>
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
             <div class="arrow-up"></div>
205
             <div class="arrow-up"></div>
208
             <input type="text" id="setDisplayName" data-i18n="[placeholder]settings.name" placeholder="Name">
206
             <input type="text" id="setDisplayName" data-i18n="[placeholder]settings.name" placeholder="Name">
209
             <input type="text" id="setEmail" placeholder="E-Mail">
207
             <input type="text" id="setEmail" placeholder="E-Mail">
224
             <a id="feedbackButton" data-container="body" data-toggle="popover" data-placement="right" data-i18n="[data-content]feedback"><i class="fa fa-heart"></i></a>
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
         </div>
223
         </div>
226
     </div>
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
   </body>
238
   </body>
228
 </html>
239
 </html>

+ 9
- 5
modules/UI/avatar/Avatar.js Näytä tiedosto

1
-/* global Strophe, APP, MD5 */
1
+/* global Strophe, APP, MD5, config */
2
 var Settings = require("../../settings/Settings");
2
 var Settings = require("../../settings/Settings");
3
 
3
 
4
 var users = {};
4
 var users = {};
57
                 "No avatar stored yet for " + jid + " - using JID as ID");
57
                 "No avatar stored yet for " + jid + " - using JID as ID");
58
             id = jid;
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;

Loading…
Peruuta
Tallenna