]> git.saurik.com Git - cydia.git/blobdiff - CyteKit/WebViewController.mm
Allow users to click loading customized buttons.
[cydia.git] / CyteKit / WebViewController.mm
index e5cfbb47d9f825e277f40814d7f3e9b34e998ce8..5d15213964fa0512b5e4ceabe68d28159948c3f2 100644 (file)
@@ -59,6 +59,10 @@ float CYScrollViewDecelerationRateNormal;
 /* Indirect Delegate {{{ */
 @implementation IndirectDelegate
 
+- (id) delegate {
+    return delegate_;
+}
+
 - (void) setDelegate:(id)delegate {
     delegate_ = delegate;
 }
@@ -534,7 +538,7 @@ float CYScrollViewDecelerationRateNormal;
 
     if ([frame parentFrame] == nil) {
         if (DOMDocument *document = [frame DOMDocument])
-            if (DOMNodeList<NSFastEnumeration> *bodies = [document getElementsByTagName:@"body"])
+            if (DOMNodeList *bodies = [document getElementsByTagName:@"body"])
                 for (DOMHTMLBodyElement *body in (id) bodies) {
                     DOMCSSStyleDeclaration *style([document getComputedStyle:body pseudoElement:nil]);
 
@@ -630,7 +634,7 @@ float CYScrollViewDecelerationRateNormal;
 // }}}
 
 - (void) close {
-    [[[self navigationController] parentViewController] dismissModalViewControllerAnimated:YES];
+    [[[self navigationController] parentOrPresentingViewController] dismissModalViewControllerAnimated:YES];
 }
 
 - (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button {
@@ -697,7 +701,7 @@ float CYScrollViewDecelerationRateNormal;
 - (UIBarButtonItem *) customButton {
     if (custom_ == nil)
         return nil;
-    else if (custom_ == [NSNull null])
+    else if ((/*clang:*/id) custom_ == [NSNull null])
         return (UIBarButtonItem *) [NSNull null];
 
     return [[[UIBarButtonItem alloc]
@@ -714,7 +718,7 @@ float CYScrollViewDecelerationRateNormal;
         return nil;
 
     if (UINavigationController *navigation = [self navigationController])
-        if ([[navigation parentViewController] modalViewController] == navigation)
+        if ([[navigation parentOrPresentingViewController] modalViewController] == navigation)
             return [[[UIBarButtonItem alloc]
                 initWithTitle:UCLocalize("CLOSE")
                 style:UIBarButtonItemStylePlain