summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/me2mom/choice.html
blob: 421d286b355ae9479090f6466c18a4da7b69e027 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!doctype html>
<!--
Copyright (c) 2011 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.
-->

<html>

  <head>
    <link rel="stylesheet" type="text/css" href="main.css" />
    <script type="text/javascript" src="remoting.js"></script>
    <title>Select Role</title>
  </head>

  <body onload="init();">

    <!-- Auth panel -->
    <div id="auth_panel">
      Chromoting OAuth1 Token: <span id="oauth1_status"></span>
      <button onclick="authorizeOAuth1();">Authorize</button>
      <button onclick="clearOAuth1();">Clear</button >
      <br />
      XMPP Token: <span id="xmpp_status"></span>
      <button onclick="clearXmpp();" id="xmpp_clear" style="display:none;">
        Clear
      </button>
      <form id='xmpp_form' action=""
        onsubmit="authorizeXmpp(this); return false;">
        <label for="xmpp_username">Email:</label>
        <input type="text" name="xmpp_username" id="xmpp_username" />
        <label for="xmpp_password">App-specific Password:</label>
        <input type="password" name="xmpp_password" id="xmpp_password" />
        <div id="xmpp_captcha" style="display:none;">
          <img style="display:block;" id="xmpp_captcha_img" />
          <input type="hidden" name="xmpp_captcha_token" />
          <input type="text" name="xmpp_captcha_result" />
        </div>
        <input type="submit"/>
      </form>
      <span id="xmpp_last_error" style="display:none"></span>
      <iframe id="xmpp_error" style="display:none">
        <p> No iframe support
      </iframe>
    </div>

    <!-- Host UI -->
    <div id="host">
      <div id="plugin_wrapper">
      </div>

      <div id="unshared">
        <p class="message">
          Your desktop is currently unshared.
        </p>
        <button type="button"
                class="ok"
                onclick="tryShare();">
          Start sharing
        </button>
        <p>
          <a class="switch_mode"
             href="#c"
             onclick="setGlobalModePersistent('client');">
            I want to connect to another computer instead...
          </a>
        </p>
      </div>

      <div id="preparing_to_share">
        <p class="message">
          Connecting...
        </p>
      </div>

      <div id="ready_to_share">
        <p class="message">
          To begin sharing your desktop, read out the access code below to the
          person who will be assisting you.
        </p>
        <p id="access_code_display">
          FAILED!
        </p>
        <p class="message">
          Waiting for connection...
          <button type="button"
                  class="cancel"
                  onclick="cancelShare();">
            Cancel
          </button>
        </p>
        <p class="message mock">
          (For this mock-up, this message will disappear automatically.)
        </p>
      </div>

      <div id="shared">
        <p class="message">
          Your desktop is currently being shared.
        </p>
        <button type="button"
                class="cancel"
                onclick="cancelShare();">
          Stop sharing
        </button>
      </div>

    </div>

    <!-- Client UI -->
    <div id="client">

      <div id="unconnected">
        <p class="message">
          To connect to another computer, enter the access code provided to you
          by that computer's user.
        </p>
        <form action="" onsubmit="tryConnect(this); return false;">
          <input type="text"
                 id="access_code_entry"/>
          <button type="submit">
            Connect
          </button>
        </form>
        <a class="switch_mode"
           href="#h"
           onclick="setGlobalModePersistent('host');">
          I want to share this computer instead...
        </a>
      </div>

      <div id="connecting">
        <p class="message">
          Verifying access code...
          <!-- TODO(jamiewalch): Implement Cancel, being careful when ignoring
               the eventual server response not to ignore responses for any
               subsequent requests.
          <button type="button"
                  class="cancel"
                  onclick="cancelConnect();">
            Cancel
          </button>
          -->
        </p>
      </div>

      <div id="connect_failed">
        <p class="message"
           id="invalid_access_code">
          Invalid access code.
        </p>
        <p class="message"
           id="other_connect_error">
          An error occurred. The server response was
          <strong id="server_response"></strong>.
        </p>
        <button type="button"
                class="ok"
                onclick="setClientMode('unconnected');">
          OK
        </button>
      </div>

    </div>

    <!-- In-session UI -->
    <div id="session">
      <p class="message">
        Congratulations! You have connected successfully. The JID corresponding
        to your access code is
        <strong id="host_jid_debug"></strong>.
      </p>
      <div id="plugin_container">
        <!-- The plugin will be placed here once a JID has been obtained. -->
      </div>
    </div>

  </body>

</html>