[broadway] Make the toplevel mode a url parameter

This commit is contained in:
Alexander Larsson 2011-04-08 15:36:07 +02:00
parent fe79bbd618
commit d6beabbff2
2 changed files with 12 additions and 1 deletions

View File

@ -1078,6 +1078,13 @@ function setupDocument(document)
function connect()
{
var url = window.location.toString();
var query_string = url.split("?");
if (query_string.length > 1) {
var params = query_string[1].split("&");
if (params[0].indexOf("toplevel") != -1)
useToplevelWindows = true;
}
var xhr = createXHR();
if (xhr) {
if (typeof xhr.multipart == 'undefined') {

View File

@ -750,7 +750,7 @@ send_data (HttpRequest *request,
static void
got_request (HttpRequest *request)
{
char *start, *escaped, *tmp, *version;
char *start, *escaped, *tmp, *version, *query;
if (!g_str_has_prefix (request->request->str, "GET "))
{
@ -777,6 +777,10 @@ got_request (HttpRequest *request)
version = g_strndup (start, tmp - start);
}
query = strchr (escaped, '?');
if (query)
*query = 0;
if (strcmp (escaped, "/client.html") == 0 || strcmp (escaped, "/") == 0)
send_data (request, "text/html", client_html, G_N_ELEMENTS(client_html) - 1);
else if (strcmp (escaped, "/broadway.js") == 0)