]> git.saurik.com Git - cydia.git/commitdiff
Allow JavaScript to alter and refresh sources.
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 19 Feb 2011 13:59:46 +0000 (05:59 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 19 Feb 2011 13:59:46 +0000 (05:59 -0800)
MobileCydia.mm

index 69872303017f5314e410b231a76f410e7d9dd392..73d84483c44f61c4ad6f0fb715f98abfe3b6d41a 100644 (file)
@@ -3904,6 +3904,8 @@ static NSString *Warning_;
 
 + (NSString *) webScriptNameForSelector:(SEL)selector {
     if (false);
+    else if (selector == @selector(addTrivialSource:))
+        return @"addTrivialSource";
     else if (selector == @selector(close))
         return @"close";
     else if (selector == @selector(du:))
@@ -3918,6 +3920,8 @@ static NSString *Warning_;
         return @"installPackages";
     else if (selector == @selector(localizedStringForKey:value:table:))
         return @"localize";
+    else if (selector == @selector(refreshSources))
+        return @"refreshSources";
     else if (selector == @selector(setButtonImage:withStyle:toFunction:))
         return @"setButtonImage";
     else if (selector == @selector(setButtonTitle:withStyle:toFunction:))
@@ -3946,6 +3950,14 @@ static NSString *Warning_;
     return [feature isEqualToString:@"window.open"];
 }
 
+- (void) addTrivialSource:(NSString *)href {
+    [delegate_ addTrivialSource:href];
+}
+
+- (void) refreshSources {
+    [delegate_ performSelectorOnMainThread:@selector(syncData) withObject:nil waitUntilDone:NO];
+}
+
 - (NSArray *) getInstalledPackages {
     NSArray *packages([[Database sharedInstance] packages]);
     NSMutableArray *installed([NSMutableArray arrayWithCapacity:1024]);