summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/me2mom/choice.html
blob: 9690159c6c20fc4dd915485854f197113328fe5a (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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!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>
    <meta charset="utf-8" />
    <link href="http://fonts.googleapis.com/css?family=Droid+Sans&amp;v1"
          rel="stylesheet" type="text/css">
    <link rel="shortcut icon" href="chromoting128.png" />
    <link rel="stylesheet" href="debug_log.css" />
    <link rel="stylesheet" href="main.css" />
    <link rel="stylesheet" href="choice.css" />
    <link rel="stylesheet" href="toolbar.css" />
    <script src="client_session.js"></script>
    <script src="debug_log.js"></script>
    <script src="oauth2.js"></script>
    <script src="plugin_settings.js"></script>
    <script src="remoting.js"></script>
    <script src="xhr.js"></script>
    <title>Chromoting</title>
  </head>

  <body onLoad="remoting.init();"
        onUnload="remoting.disconnect();">

    <!-- loading-mode is initially visible, but becomes hidden as soon as an
         AppMode is selected by remoting.init. All other divs are initially
         hidden, but are shown appropriately when the mode changes. -->
    <section id="loading-mode" data-ui-mode="">
      <em>Loading&hellip;</em>
    </section> <!-- loading-mode -->

    <div id="control-panel" data-ui-mode="client host" hidden>
      <span id="email-status">
        <span class="auth-status-label">Email:</span>
        <span id="current-email"></span>
      </span> <!-- email-status -->

      <span id="oauth2-entry">
        <form>
          <span class="auth-status-label">OAuth2 Token:</span>
          <input id="oauth2-token-button" type="button"
                 onclick="remoting.oauth2.doAuthRedirect();"
                 value="Get OAuth2 Token&hellip;" />
          <input id="oauth2-clear-button" type="button"
                 onclick="remoting.clearOAuth2();"
                 value="Revoke" />
        </form>
      </span> <!-- oauth2-entry -->

      <span id="debug-enable">
        <form>
          <input id="debug-log-toggle" type="button" value="Debug log"
                 onclick="remoting.toggleDebugLog();"/>
        </form>
      </span> <!-- debug-enable -->
    </div> <!-- control-panel -->

    <div id="session-toolbar"
         data-ui-mode="in-session"
         class="toolbar-container"
         hidden>
      <div class="toolbar-border">
        <span id="session-status-message">Initialising...</span>
        <strong id="connected-to"></strong>
        <button type="button" onclick="remoting.disconnect();">
          Disconnect
        </button>
        <span class="right-align">
          <button type="button"
                  onclick="remoting.toggleDebugLog();">
            Debug log
          </button>
          <button type="button"
                  onclick="remoting.toggleScaleToFit();">
            Fit screen
          </button>
        </span>
      </div>
      <div class="toolbar-stub">
        <img src="toolbar-stub.png">
      </div>
    </div> <!-- session-toolbar -->

    <section id="choice-mode" data-ui-mode="host client" hidden>
      <header class="choice-header">
        <img id="icon" src="chromoting128.png">
        <h1 data-ui-mode="host" class="icon-label">
          Chromoting&nbsp;&rsaquo;&nbsp;Share
        </h1>
        <h1 data-ui-mode="client" class="icon-label">
          Chromoting&nbsp;&rsaquo;&nbsp;Connect
        </h1>
        <img id="divider-top" src="dividertop.png">
      </header>

      <div id="host-panel" data-ui-mode="host">
        <div data-ui-mode="host.unshared">
          <div class="description">
            With Chromoting you can easily let another Chrome user see and
            control your computer.
          </div>
          <div class="centered-button">
            <button id="share-button" class="auth-status-control big-button"
                    type="button" onclick="remoting.tryShare();">
              Share this computer
            </button>
          </div>
        </div> <!-- host.unshared -->

        <div data-ui-mode="host.waiting-for-code">
          <div class="message">
            Generating access code&hellip;
          </div>
        </div> <!-- host.waiting-for-code -->

        <div data-ui-mode="host.waiting-for-connection">
          <div class="description">
            To begin sharing your desktop, read out the access code below to the
            person who will be assisting you.
          </div>
          <div id="access-code-display">
          </div>
          <div id="access-code-countdown-container">
            <div id="access-code-countdown" class="expiring" hidden>
              This access code will expire in
              0:<span id="seconds-remaining"></span>
            </div>
          </div>
          <div class="description">
            Once they enter the code your sharing session will begin.
          </div>
        </div> <!-- host.waiting-for-connection -->

        <div data-ui-mode="host.shared">
          <div class="message">
            Your desktop is currently being shared.
          </div>
          <div class="centered-button">
            <button type="button" class="big-button"
                    onclick="remoting.cancelShare();">
              Stop sharing
            </button>
          </div>
        </div> <!-- host.shared -->

        <div data-ui-mode="host.share-failed">
          <div id="unable-to-get-token" class="message">
            Unable to get access token.
          </div>
          <div class="centered-button">
            <button type="button" class="big-button"
                    onclick="remoting.setMode('host.unshared');">
              OK
            </button>
          </div>
        </div> <!-- host.share-failed -->
      </div> <!-- host-panel -->

      <div id="client-panel" data-ui-mode="client">
        <div data-ui-mode="client.unconnected">
          <div class="description">
            Have the user whose computer you wish to access click
            ‘Share this computer’ and then have them read
            their access code to you.
          </div>
          <div id="access-code-entry-row">
            <form action="" onsubmit="remoting.tryConnect(); return false;">
              <label class="auth-status-control" for="access-code-entry">
                Access code
              </label>
              <input id="access-code-entry" class="auth-status-control"
                     type="text"/>
              <button id="connect-button" class="auth-status-control big-button"
                      type="submit">
                Connect
              </button>
            </form>
          </div> <!-- code-entry-row -->
        </div> <!-- client.unconnected -->

        <div data-ui-mode="client.connecting">
          <div class="message">
            Verifying access code&hellip;
            <!-- TODO(jamiewalch): Implement Cancel, being careful when ignoring
                 the eventual server response not to ignore responses for any
                 subsequent requests. This should be unified with the host-side
                 Cancel button in the footer.
            -->
          </div>
        </div> <!-- client.connecting -->

        <div data-ui-mode="client.connect-failed"
             class="message">
          <span id="connect-error-message" class="error-state"></span>
        </div> <!-- client.connect-failed -->

        <div data-ui-mode="client.session-finished"
             class="message">
          You are no longer connected to the remote desktop.
        </div> <!-- client.session-finished -->

        <div data-ui-mode="client.connect-failed client.session-finished"
             class="centered-button">
          <button type="button" class="big-button"
                  onclick="remoting.setMode(
                               remoting.AppMode.CLIENT_UNCONNECTED);">
            OK
          </button>
        </div>
      </div> <!-- client-panel -->

      <footer class="choice-footer">
        <img id="divider-bottom" src="dividerbottom.png">

        <div id="client-footer-text" data-ui-mode="client.unconnected">
          Click here to
          <a class="switch-mode"
             href="#"
             onclick="remoting.setAppMode(remoting.AppMode.HOST);">
            share this computer</a>
          with another user.
        </div> <!-- client-footer-text -->

        <div id="client-footer-text-cros" data-ui-mode="client.unconnected">
          Currently Hosting is not supported on Chromebooks. Hosting is
          supported on Win, Mac and Linux.
        </div> <!-- client-footer-text-cros -->

        <div id="host-footer-text" data-ui-mode="host.unshared">
          Click here to <a class="switch-mode"
             href="#"
             onclick="remoting.setAppMode(remoting.AppMode.CLIENT);">
            access a shared computer</a>.
        </div> <!-- host-footer-text -->

        <div id="waiting-footer"
             data-ui-mode="host.waiting-for-connection host.waiting-for-code">
          <img src="spinner.gif">
          <span class="waiting icon-label">waiting for connection&hellip;</span>
          <button id="cancel-button" class="big-button"
                  onclick="remoting.cancelPendingOperation();">
            Cancel
          </button>
        </div> <!-- waiting-footer -->
      </footer>
    </section> <!-- choice-mode -->

    <section id="session-mode" data-ui-mode="in-session client" hidden>
    </section> <!-- session-mode -->

    <div id="host-plugin-container" data-ui-mode="host" hidden>
    </div> <!-- host-plugin-container -->

    <section id="debug-log" hidden>
      <div id="statistics">
      </div>
      <div id="debug-messages">
      </div>
    </section> <!-- debug-log -->

  </body>
</html>