~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/media/console/console.js

  • Committer: mattgiuca
  • Date: 2008-01-15 03:06:54 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:229
Images: Reduced "small" icons from 22x22 to 16x16. Reduced "large" icons from
    128x128 to 96x96.
Changed some of the icons for Subversion so they make a bit more sense.
    (Missing and deleted are now distinct).
Modified JavaScript and CSS so the interface flows with 16x16 icons instead of
22. This makes each file vertically a lot shorter.
Made the bands of colour in the file listing much closer together in colour.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
digest_constant = "hello";
 
2
 
 
3
/* Starts the console server.
 
4
 * Returns an object with fields "host", "port", "magic" describing the
 
5
 * server.
 
6
 */
 
7
function start_server()
 
8
{
 
9
    var xhr = ajax_call("consoleservice", "", "", "POST");
 
10
    var json_text = xhr.responseText;
 
11
    return JSON.parse(json_text);
 
12
}
 
13
 
 
14
function onload()
 
15
{
 
16
    var consolebody = document.getElementById("consolebody");
 
17
    var iframe = document.createElement("iframe");
 
18
    consolebody.appendChild(iframe);
 
19
    iframe.setAttribute("width", "100%");
 
20
    /* TODO: Height 100%, once CSS is working */
 
21
    iframe.setAttribute("height", "600px");
 
22
 
 
23
    /* Start the server */
 
24
    var server_info = start_server();
 
25
 
 
26
    var digest = hex_md5(digest_constant + server_info.magic);
 
27
 
 
28
    var url = "http://"
 
29
        + server_info.host.toString() + ":"
 
30
        + server_info.port.toString() + "?digest=" + digest;
 
31
 
 
32
    iframe.setAttribute("src", url);
 
33
}