~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-11 07:10:18 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:185
Integrated the (second) Prototype browser (HTML+CSS but no code) into the main
filebrowser app. Note that this still is non-functional - it looks the same as
the original prototype.
browser: Added the full HTML source (including example rows) into the Python
code. (Note this will be a lot cleaner once example rows are removed).
media: Added "images" directory (copied from the demo). This contains all the
icons needed for the demo.
       browser.css: Pasted the entire CSS from the demo. This styles the
        browser interface.

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
 
}