mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-09 02:11:00 +00:00
make #debug work in urls for registering cplog
This commit is contained in:
1 parent
40a647f80c
commit
8c1b217c7a
1 file changed
+22
@@ -717,6 +717,28 @@ function CPApplicationMain(args, namedArgs)
|
||||
//[NSBundle loadNibNamed:@"myMain" owner:NSApp];
|
||||
|
||||
//FIXME?
|
||||
if (!args && !namedArgs)
|
||||
{
|
||||
var args = window.location.hash.replace("#", "").split("/").slice(0),
|
||||
searchParams = window.location.search.substring(1).split("&");
|
||||
namedArgs = [CPDictionary dictionary];
|
||||
|
||||
for(var i=0, count = args.length; i<count; i++)
|
||||
args[i] = decodeURIComponent(args[i]);
|
||||
|
||||
if([args containsObject:"debug"])
|
||||
CPLogRegister(CPLogPopup);
|
||||
|
||||
for(var i=0; i<searchParams.length; i++)
|
||||
{
|
||||
var index = searchParams[i].indexOf('=');
|
||||
if(index == -1)
|
||||
[namedArgs setObject: "" forKey:searchParams[i]];
|
||||
else
|
||||
[namedArgs setObject: searchParams[i].substring(index+1) forKey: searchParams[i].substring(0, index)];
|
||||
}
|
||||
}
|
||||
|
||||
CPApp._args = args;
|
||||
CPApp._namedArgs = namedArgs;
|
||||
|
||||
|
||||
Reference in new issue
Block a user