From 3ac7a20a89dbc37e4e1839a3a7cc1ee0974fc818 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 17 Mar 2009 23:41:45 +0000 Subject: [PATCH] Some minor popup fixes for mailto URLs. --- Cydia.app/package.html | 4 ++-- UICaboodle/BrowserView.m | 37 +++++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Cydia.app/package.html b/Cydia.app/package.html index fdbc835e..6fcc77c1 100644 --- a/Cydia.app/package.html +++ b/Cydia.app/package.html @@ -227,7 +227,7 @@ - +
@@ -335,7 +335,7 @@
-
+
diff --git a/UICaboodle/BrowserView.m b/UICaboodle/BrowserView.m index 3a4b7793..5cfc3d0c 100644 --- a/UICaboodle/BrowserView.m +++ b/UICaboodle/BrowserView.m @@ -567,25 +567,30 @@ } else if ([name isEqualToString:@"_open"]) [delegate_ openURL:url]; else if ([name isEqualToString:@"_popup"]) { - RVBook *book([[[RVPopUpBook alloc] initWithFrame:[delegate_ popUpBounds]] autorelease]); - [book setHook:indirect_]; - - RVPage *page([delegate_ pageForURL:url hasTag:NULL]); - if (page == nil) { - /* XXX: call createWebViewWithRequest instead? */ + NSString *scheme([[url scheme] lowercaseString]); + if ([scheme isEqualToString:@"mailto"]) + [delegate_ openMailToURL:url]; + else { + RVBook *book([[[RVPopUpBook alloc] initWithFrame:[delegate_ popUpBounds]] autorelease]); + [book setHook:indirect_]; + + RVPage *page([delegate_ pageForURL:url hasTag:NULL]); + if (page == nil) { + /* XXX: call createWebViewWithRequest instead? */ + + [self setBackButtonTitle:title_]; + + BrowserView *browser([[[BrowserView alloc] initWithBook:book] autorelease]); + [browser loadURL:url]; + page = browser; + } - [self setBackButtonTitle:title_]; + [book setDelegate:delegate_]; + [page setDelegate:delegate_]; - BrowserView *browser([[[BrowserView alloc] initWithBook:book] autorelease]); - [browser loadURL:url]; - page = browser; + [book setPage:page]; + [book_ pushBook:book]; } - - [book setDelegate:delegate_]; - [page setDelegate:delegate_]; - - [book setPage:page]; - [book_ pushBook:book]; } else goto unknown; [listener ignore]; -- 2.45.2