From d0b53abc22389a0f48c5a151916bd2b7f52abf3e Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 19 Feb 2011 05:59:46 -0800 Subject: [PATCH] Allow JavaScript to alter and refresh sources. --- MobileCydia.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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]); -- 2.45.2