summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/chat_manager/central_roster.html
blob: 34fd788691b8875771a9a3d7f9569633e5233d90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html>
<!--

Copyright (c) 2010 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.

Central roster: hosting all Google Talk chats in ChromeOS.

-->
<body>
<style>
  .talk_roster {
    position: fixed;
    left: 0px;
    top: 0px;
  }
  .talk_iframe {
    width: 100%;
    height: 100%;
    border: none;
    overflow-x: hidden;
    overflow-y: hidden;
  }
</style>
<script>
  var args = {
    'protocol': 'https',
    'host': 'talkgadget.google.com',
    'jsmode': 'pre',
    'hl': 'en',
  };
  // Read args.
  var urlParts = window.location.href.split(/[?&#]/);
  for (var i = 1; i < urlParts.length; i++) {
    var argParts = urlParts[i].split('=');
    if (argParts.length == 2) {
      args[argParts[0]] = argParts[1];
    }
  }
  document.write('<script src="' +
      args['protocol'] + '://' + args['host'] +
      '/talkgadget/notifier-js?silent=true&host=' +
      args['protocol'] + '://' + args['host'] +
      '/talkgadget/notifier-js' +
      (args['jsmode'] != '' ? ('&jsmode=' + args['jsmode']) : '') +
      '"></scr' + 'ipt>');
</script>
<script>
  var reloadTime = 60000;
  var reloadTimer;
  function reloadPage() {
    if (reloadTimer) {
      clearTimeout(reloadTimer);
      reloadTimer = null;
    }
    window.location.reload(true);
  }
  function reloadPageCountdown() {
    document.getElementById('reloadStatus').textContent =
        'Retrying in ' + reloadTime / 1000 + ' seconds';
    if (reloadTime <= 0) {
      reloadPage();
    } else {
      reloadTimer = setTimeout(reloadPageCountdown, 1000);
    }
    reloadTime -= 1000;
  }
  var chatClient = null;
  if (window.GTalkNotifier) {
    chatClient = new GTalkNotifier(
        args['protocol'] + '://' + args['host'] + '/talkgadget/',
        'notifierclient' +
            (args['jsmode'] != '' ? ('?jsmode=' + args['jsmode']) : ''),
        'ifpc_relay',
        'ifpc.js',
        'Google Talk',
        {
          hostCallback: function(){},
          xpcRelay: 'xpc_relay',
          xpcBlank: 'xpc_blank',
          locale: args['hl'],
          isCentralRoster: true,
          hideProfileCard: true,
          isFullFrame: true
        }
    );
  } else {
    reloadTimer = setTimeout(reloadPageCountdown, 0);
    document.write(
        '<style>' +
          'body {' +
            'text-align: center;' +
          '}' +
        '</style>' +
        '<p>Could not connect to Google Talk</p>' +
        '<p id="reloadStatus"></p>' +
        '<input type="button" value="Retry Now" onclick="reloadPage()"/>'
    );
  }
</script>
</body>
</html>