summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-19 05:59:46 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-02-19 05:59:46 -0800
commitb088c0cd13cb6e102a96f02cb176537883421d93 (patch)
tree5a4ba45304358d13e0f3635e79983a184f280872 /MobileCydia.mm
parent516d1d40fc53f44909477149aa7d16ebbb24dc7e (diff)
Allow JavaScript to alter and refresh sources.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 6987230..73d8448 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]);