[self loadURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy];
}
-- (id) init {
+- (id) initWithURL:(NSURL *)url {
CGRect frame = [[UIScreen mainScreen] bounds];
if (kCFCoreFoundationVersionNumber < 800)
frame.size.height -= 20; //[[[$SBStatusBarController sharedStatusBarController] statusBarView] frame].size.height;
[webview_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
NSDictionary *configuration([$CydgetController currentConfiguration]);
-
cycript_ = [configuration objectForKey:@"CycriptURLs"];
[scroller_ setScrollingEnabled:[[configuration objectForKey:@"Scrollable"] boolValue]];
- NSString *homepage([configuration objectForKey:@"Homepage"]);
- [self loadURL:[NSURL URLWithString:homepage]];
+ [self loadURL:url];
} return self;
}
@end
@interface WebCycriptLockScreenController : SBAwayViewPluginController {
+ NSDictionary *configuration_;
+ WebCydgetLockScreenView *background_;
}
@end
return [[[self alloc] init] autorelease];
}
+- (void) dealloc {
+ [configuration_ release];
+ [background_ release];
+ [super dealloc];
+}
+
+- (id) init {
+ if ((self = [super init]) != nil) {
+ configuration_ = [[$CydgetController currentConfiguration] retain];
+ } return self;
+}
+
- (void) loadView {
- [self setView:[[[WebCydgetLockScreenView alloc] init] autorelease]];
+ if (NSString *homepage = [configuration_ objectForKey:@"Homepage"])
+ [self setView:[[[WebCydgetLockScreenView alloc] initWithURL:[NSURL URLWithString:homepage]] autorelease]];
+
+ if (NSString *background = [configuration_ objectForKey:@"Background"])
+ background_ = [[WebCydgetLockScreenView alloc] initWithURL:[NSURL URLWithString:background]];
+}
+
+- (void) purgeView {
+ [background_ removeFromSuperview];
+ [background_ release];
+ background_ = nil;
+ [super purgeView];
+}
+
+- (UIView *) backgroundView {
+ return background_;
}
- (BOOL) showAwayItems {
return YES;
}
+- (BOOL) showDateView {
+ return [configuration_ objectForKey:@"Homepage"] == nil;
+}
+
+/*- (BOOL) showHeaderView {
+ return YES;
+}*/
+
+- (NSUInteger) presentationStyle {
+ return 1;
+}
+
+- (NSUInteger) overlayStyle {
+ if ([configuration_ objectForKey:@"Background"] == nil)
+ return 1;
+ return 4;
+}
+
- (BOOL) viewWantsFullscreenLayout {
return kCFCoreFoundationVersionNumber >= 800;
}
+/*- (BOOL) viewWantsOverlayLayout {
+ return kCFCoreFoundationVersionNumber >= 800;
+}*/
+
- (BOOL) shouldDisableOnUnlock {
return YES;
}
return YES;
}
+/*- (BOOL) wantsSwipeGestureRecognizer {
+ return YES;
+}
+
+- (BOOL) handleGesture:(int)arg1 fingerCount:(NSUInteger)fingers {
+ return NO;
+ return YES;
+}*/
+
@end
MSClassHook(WebView)