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

« back to all changes in this revision

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

  • Committer: drtomc
  • Date: 2008-01-31 08:11:37 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:352
Changed console so it no longer uses HTTP, just sends JSON over a normal socket.
Reason: Easier to control (since web.py offered limited control over *when* to Daemonise). Ultimately, this was necessary to get the port allocation strategy working.

* Replaced the HTTP / web.py code with socket code. (Web.py is no longer a dependency).
* Sundry bug fixes.
* Daemonization code - moved out of a Shell "&" call on the Apache side to a proper Daemon code on the spawned server side.

The upshot is we can now spawn any number of servers. Console is DONE for Alpha release.


YOU HAVE NO IDEA HOW TRICKY THIS WAS!!!

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
    console_filler.setAttribute("class", "windowpane maximal");
100
100
}
101
101
 
102
 
/* Below here imported from trunk/console/console.js
103
 
 * (Tom Conway)
104
 
 */
105
 
 
106
 
var magic = 'xyzzy';
107
 
 
108
102
/* current_text is the string currently on the command line.
109
103
 * If non-empty, it will be stored at the bottom of the history.
110
104
 */
213
207
{
214
208
    /* Start the server if it hasn't already been started */
215
209
    start_server();
216
 
    var digest = hex_md5(inputline + magic);
 
210
    var digest = hex_md5(inputline + server_magic);
217
211
    var args = {"host": server_host, "port": server_port,
218
212
                    "digest":digest, "text":inputline};
219
213
    var xmlhttp = ajax_call("consoleservice", "chat", args, "POST");