From: Jay Freeman (saurik) Date: Sat, 19 Feb 2011 13:59:46 +0000 (-0800) Subject: Allow JavaScript to alter and refresh sources. X-Git-Tag: v1.1.0%b1~297 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/b088c0cd13cb6e102a96f02cb176537883421d93 Allow JavaScript to alter and refresh sources. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 69872303..73d84483 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -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]);