diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2008-12-28 05:00:26 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:09:22 +0000 |
commit | aa5d0de7a71977eaf42728cfe4ab8ae31d1133a9 (patch) | |
tree | 5bc7f53cc3ee436e178ff0490d13ab0729e05e52 | |
parent | 7594e0d2038278ab851fbb19521586a4a6fe6b97 (diff) |
Doing another beta release.
-rw-r--r-- | Cydia.app/confirm.html | 6 | ||||
-rw-r--r-- | Cydia.app/confirm.js | 10 | ||||
-rw-r--r-- | Cydia.app/menes/style.css | 151 | ||||
-rw-r--r-- | Cydia.app/package.html | 16 | ||||
-rw-r--r-- | Cydia.app/package.js | 2 | ||||
-rw-r--r-- | Cydia.mm | 70 | ||||
-rw-r--r-- | UICaboodle/BrowserView.m | 79 | ||||
-rw-r--r-- | UICaboodle/RVBook.h | 21 | ||||
-rw-r--r-- | UICaboodle/RVBook.mm | 38 | ||||
-rw-r--r-- | control | 2 |
10 files changed, 282 insertions, 113 deletions
diff --git a/Cydia.app/confirm.html b/Cydia.app/confirm.html index 4dcd005..00c3d06 100644 --- a/Cydia.app/confirm.html +++ b/Cydia.app/confirm.html @@ -17,17 +17,17 @@ <fieldset class="_issues"> <div class="downloading"><div> <label>Downloading</label> - <div id="downloading"></div> + <label id="downloading"></label> </div></div> <div class="resuming"><div> <label>Resuming At</label> - <div id="resuming"></div> + <label id="resuming"></label> </div></div> <div><div> <label id="disk-key"></label> - <div id="disk-value"></div> + <label id="disk-value"></label> </div></div> </fieldset> diff --git a/Cydia.app/confirm.js b/Cydia.app/confirm.js index 75fe70b..41f7a0d 100644 --- a/Cydia.app/confirm.js +++ b/Cydia.app/confirm.js @@ -34,7 +34,7 @@ $(function () { var issue = issues[i]; $("#issues").append( - "<label style=\"color: #704d4d\">" + issue[0] + "</label>" + + "<label style=\"color: #704d4d\">" + $.xml(issue[0]) + "</label>" + "<fieldset style=\"background-color: #dddddd\" class=\"clearfix\" id=\"i" + i + "\"></fieldset>" ); @@ -44,8 +44,8 @@ $(function () { if (type == "PreDepends") type = "Depends"; $("#i" + i).append("<div><div>" + - "<label>" + type + "</label>" + - "<div>" + entry[1] + " " + entry[3] + "</div>" + + "<label>" + $.xml(type) + "</label>" + + "<labe>" + $.xml(entry[1] + " " + entry[3]) + "</label>" + "</div></div>"); } } @@ -64,8 +64,8 @@ $(function () { if (length != 0) { $("#modifications").append("<div class=\"clearfix\"><div>" + - "<label>" + keys[i] + "</label>" + - "<div id=\"c" + i + "\"></div>" + + "<label>" + $.xml(keys[i]) + "</label>" + + "<label id=\"c" + i + "\"></label>" + "</div></div>"); var value = ""; diff --git a/Cydia.app/menes/style.css b/Cydia.app/menes/style.css index 66bc265..a7e1949 100644 --- a/Cydia.app/menes/style.css +++ b/Cydia.app/menes/style.css @@ -89,6 +89,10 @@ body { -webkit-user-select: none; } +body.white { + background-color: #ffffff; +} + body.pinstripe { background: #c7ced5 url(cydia://uikit-image/UIPinstripe.png); } @@ -101,7 +105,6 @@ dialog { dialog > panel { display: block; - padding: 1px 0; } a { @@ -176,7 +179,7 @@ dialog > toolbar > a.forward-button { } /* }}} */ /* fieldset {{{ */ -dialog > panel > block { +panel > block { background-color: #c7ced5; border-bottom: 1px solid #999999; border-top: 1px solid #999999; @@ -186,12 +189,12 @@ dialog > panel > block { padding: 0 10px; } -dialog > panel > fieldset > div > hr, -dialog > panel > block > hr { +panel > fieldset > div > hr, +panel > block > hr { border-top: 1px dashed #999999; } -dialog > panel > fieldset { +panel > fieldset { background-color: #ffffff; border: 1px solid #999999; -webkit-border-radius: 9px; @@ -199,7 +202,7 @@ dialog > panel > fieldset { margin: 9px; } -dialog > panel > input[type="submit"] { +panel > input[type="submit"] { /*-webkit-border-image: url(whiteButton.png) 0 12 0 12; -webkit-border-radius: 0; border-width: 0px 12px;*/ @@ -215,7 +218,19 @@ dialog > panel > input[type="submit"] { width: 302px; } -dialog > panel > label { +list > label { + background: #a7b3bc url(cydia://uikit-image/UISectionListHeaderBackground.png); + background-repeat: repeat-x no-repeat-y; + margin-bottom: 1px; + padding: 4px 15px 1px 15px; + display: block; + color: white; + font-size: inherit; + font-weight: bold; + text-shadow: rgba(0, 0, 0, 0.5) 0px 1px 0; +} + +panel > label { display: block; margin: 13px 0 -4px 24px; line-height: 24px; @@ -225,22 +240,55 @@ dialog > panel > label { text-shadow: rgba(255, 255, 255, 0.75) 1px 1px 0; } +panel > fieldset > a:not(:last-child), +panel > fieldset > div:not(:last-child), +panel > fieldset > textarea:not(:last-child) { + border-bottom: 1px solid #999999; +} + +list > fieldset > a, +list > fieldset > div, +list > fieldset > textarea { + border-bottom: 1px solid #e0e0e0; +} + fieldset > a, fieldset > div, fieldset > textarea { - border-top: 1px solid #999999; min-height: 42px; /* XXX: small differences due to font bugs */ padding: 13px 14px 11px 14px; } -fieldset > a:first-child, -fieldset > div:first-child { - border-top: none; +panel > fieldset > a.thumb:first-child > div:first-of-type { + -webkit-border-top-left-radius: 9px; +} + +panel > fieldset > a.thumb:last-child > div:first-of-type { + -webkit-border-bottom-left-radius: 9px; +} + +list > fieldset > a.thumb > div:first-of-type { + border: 1px solid #e0e0e0; +} + +panel > fieldset > a.thumb > div:first-of-type { + border: 1px solid #999999; +} + +fieldset > a.thumb > div:first-of-type { + background-repeat: no-repeat; + background-position: center center; + display: inline-block; + height: 64px; + /* XXX: small differences due to font bugs */ + /* XXX: 1px difference due to border stupidity */ + margin: -14px 7px -12px -15px; + width: 64px; } -fieldset > a img.icon, -fieldset > div img.icon { +fieldset > a > img.icon, +fieldset > div > img.icon { height: auto; /* XXX: small differences due to font bugs */ margin: -7px 6px -9px -8px; @@ -296,31 +344,35 @@ fieldset > a { background-position-y: 13px; } +fieldset > a.thumb { + background-position-y: 24px; +} + fieldset > div > select { background-position-y: 11px; } -dialog > fieldset > a { +list > fieldset > a { background-position-x: 295px; } -dialog > panel > fieldset > a { +panel > fieldset > a { background-position-x: 275px; } -dialog > fieldset > div > select { +list > fieldset > div > select { background-position-x: 192px; } -dialog > panel > fieldset > div > select { +panel > fieldset > div > select { background-position-x: 163px; } fieldset > textarea, fieldset > div > input, fieldset > div > select, -fieldset > a > div > label + div, -fieldset > div > div > label + div { +fieldset > a > div > label:nth-of-type(2), +fieldset > div > div > label:nth-of-type(2) { color: #193250; } @@ -343,13 +395,13 @@ fieldset > div > input { margin: -11px -13px -11px -14px; } -dialog > panel > fieldset > div > select, -dialog > panel > fieldset > div > input { +panel > fieldset > div > select, +panel > fieldset > div > input { width: 187px; } -dialog > fieldset > div > select, -dialog > fieldset > div > input { +list > fieldset > div > select, +list > fieldset > div > input { width: 207px; } @@ -379,28 +431,63 @@ fieldset > a > img.icon + div { width: 221px; } -fieldset > a > label, -fieldset > a > div > label, -fieldset > div > label, -fieldset > div > div > label { +fieldset > a.thumb > div:nth-of-type(2) > label:only-of-type { + position: relative; + top: 10px; +} + +fieldset > a.thumb > div:nth-of-type(2) > label:nth-of-type(2) { + display: block; + margin-top: 2px; +} + +fieldset > a.thumb > div:nth-of-type(2) { + vertical-align: top; + width: 193px; +} + +fieldset > a > label:first-of-type, +fieldset > a > div > label:first-of-type, +fieldset > div > label:first-of-type, +fieldset > div > div > label:first-of-type { font-weight: bold; } -dialog > fieldset > a > div > label + div, -dialog > fieldset > div > div > label + div { +list > fieldset > a:not(.thumb) > div > label:nth-of-type(2), +list > fieldset > div > div > label:nth-of-type(2) { margin-left: 94px; } -dialog > panel > fieldset > a > div > label + div, -dialog > panel > fieldset > div > div > label + div { +panel > fieldset > a:not(.thumb) > div > label:nth-of-type(2), +panel > fieldset > div > div > label:nth-of-type(2) { float: right; text-align: right; } -dialog > panel > img { +panel > img { display: block; margin: 9px auto 4px auto; height: auto; width: 300px; } + +fieldset > a.thumb:first-child > back { + -webkit-border-top-right-radius: 9px; +} + +fieldset > a.thumb:last-child > back { + -webkit-border-bottom-right-radius: 9px; +} + +fieldset > a.thumb > back { + background-repeat: no-repeat; + border: 1px solid #999999; + display: block; + height: 64px; + left: 62px; + position: absolute; + opacity: 0.2; + top: -1px; + width: 237px; +} /* }}} */ diff --git a/Cydia.app/package.html b/Cydia.app/package.html index 6c227f9..952256c 100644 --- a/Cydia.app/package.html +++ b/Cydia.app/package.html @@ -180,7 +180,7 @@ <a id="author-href" class="author"> <img id="author-icon" class="icon" src="email.png"/><div> <label>Author</label> - <div id="author"></div> + <label id="author"></label> </div></a> <div class="commercial"> @@ -244,7 +244,7 @@ <fieldset class="installed"> <div><div> <label>Version</label> - <div id="installed"></div> + <label id="installed"></label> </div></div> <a id="files-href"> @@ -257,31 +257,31 @@ <fieldset> <div><div> <label>ID</label> - <div id="id"></div> + <label id="id"></label> </div></div> <div class="section"> <img id="section-src" class="icon"/><div> <label>Section</label> - <div id="section"></div> + <label id="section"></label> </div></div> <div class="size"> <img class="icon" src="expanded.png"/><div> <label>Expanded Size</label> - <div id="size"></div> + <label id="size"></label> </div></div> <a id="maintainer-href" class="maintainer"> <img id="maintainer-icon" class="icon" src="email.png"/><div> <label>Contact</label> - <div id="maintainer"></div> + <label id="maintainer"></label> </div></a> <a id="sponsor-href" class="sponsor"> <img class="icon" src="web.png"/><div> <label>Sponsor</label> - <div id="sponsor"></div> + <label id="sponsor"></label> </div></a> <!--a class="trusted" id="trusted"> @@ -292,7 +292,7 @@ <div class="trusted"> <img class="icon" src="trusted.png"><div> <label> </label> - <div>This package has been signed.</div> + <label>This package has been signed.</label> </div></div> </fieldset> diff --git a/Cydia.app/package.js b/Cydia.app/package.js index 4f0e5a0..0954380 100644 --- a/Cydia.app/package.js +++ b/Cydia.app/package.js @@ -71,7 +71,7 @@ $(function () { for (var i = 0; i != length; ++i) { var clone = child.clone(true); parent.append(clone); - clone.xpath("div/label").html($.xml(warnings[i])); + clone.xpath("./div/label").html($.xml(warnings[i])); } } @@ -236,11 +236,6 @@ extern NSString * const kCAFilterNearest; @end -@interface UIView (PopUpView) -- (void) popFromSuperviewAnimated:(BOOL)animated; -- (void) popSubview:(UIView *)view; -@end - @implementation UIView (PopUpView) - (void) popFromSuperviewAnimated:(BOOL)animated { @@ -622,9 +617,7 @@ static NSString *Home_; static BOOL Sounds_Keyboard_; static BOOL Advanced_; -#if !ForSaurik static BOOL Loaded_; -#endif static BOOL Ignored_; static UIFont *Font12_; @@ -4862,43 +4855,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @end /* }}} */ -/* Indirect Delegate {{{ */ -@interface IndirectDelegate : NSProxy { - _transient volatile id delegate_; -} - -- (void) setDelegate:(id)delegate; -- (id) initWithDelegate:(id)delegate; -@end - -@implementation IndirectDelegate - -- (void) setDelegate:(id)delegate { - delegate_ = delegate; -} - -- (id) initWithDelegate:(id)delegate { - delegate_ = delegate; - return self; -} - -- (NSMethodSignature*) methodSignatureForSelector:(SEL)sel { - if (delegate_ != nil) - if (NSMethodSignature *sig = [delegate_ methodSignatureForSelector:sel]) - return sig; - // XXX: I fucking hate Apple so very very bad - return [NSMethodSignature signatureWithObjCTypes:"v@:"]; -} - -- (void) forwardInvocation:(NSInvocation *)inv { - SEL sel = [inv selector]; - if (delegate_ != nil && [delegate_ respondsToSelector:sel]) - [inv invokeWithTarget:delegate_]; -} - -@end -/* }}} */ - #include <BrowserView.m> /* Cydia Book {{{ */ @@ -6282,17 +6238,21 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [self updateData]; -#if !ForSaurik + // XXX: what is this line of code for? if ([packages count] == 0); - else if (Loaded_) -#endif + else if (Loaded_) loaded: [self _loaded]; -#if !ForSaurik else { Loaded_ = YES; + + if (NSDate *update = [Metadata_ objectForKey:@"LastUpdate"]) { + NSTimeInterval interval([update timeIntervalSinceNow]); + if (interval <= 0 && interval > -600) + goto loaded; + } + [book_ update]; } -#endif /*[hud show:NO]; [hud removeFromSuperview];*/ @@ -6369,17 +6329,25 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { _error->Discard(); } +- (void) popUpBook:(RVBook *)book { + [underlay_ popSubview:book]; +} + +- (CGRect) popUpBounds { + return [underlay_ bounds]; +} + - (void) perform { [database_ prepare]; - confirm_ = [[RVBook alloc] initWithFrame:[underlay_ bounds]]; + confirm_ = [[RVBook alloc] initWithFrame:[self popUpBounds]]; [confirm_ setDelegate:self]; ConfirmationView *page([[[ConfirmationView alloc] initWithBook:confirm_ database:database_] autorelease]); [page setDelegate:self]; [confirm_ setPage:page]; - [underlay_ popSubview:confirm_]; + [self popUpBook:confirm_]; } - (void) installPackage:(Package *)package { diff --git a/UICaboodle/BrowserView.m b/UICaboodle/BrowserView.m index 8734fe5..61a21c9 100644 --- a/UICaboodle/BrowserView.m +++ b/UICaboodle/BrowserView.m @@ -1,5 +1,46 @@ #include <BrowserView.h> +/* Indirect Delegate {{{ */ +@interface IndirectDelegate : NSProxy { + _transient volatile id delegate_; +} + +- (void) setDelegate:(id)delegate; +- (id) initWithDelegate:(id)delegate; +@end + +@implementation IndirectDelegate + +- (void) setDelegate:(id)delegate { + delegate_ = delegate; +} + +- (id) initWithDelegate:(id)delegate { + delegate_ = delegate; + return self; +} + +- (BOOL) respondsToSelector:(SEL)sel { + return delegate_ == nil ? FALSE : [delegate_ respondsToSelector:sel]; +} + +- (NSMethodSignature *) methodSignatureForSelector:(SEL)sel { + if (delegate_ != nil) + if (NSMethodSignature *sig = [delegate_ methodSignatureForSelector:sel]) + return sig; + // XXX: I fucking hate Apple so very very bad + return [NSMethodSignature signatureWithObjCTypes:"v@:"]; +} + +- (void) forwardInvocation:(NSInvocation *)inv { + SEL sel = [inv selector]; + if (delegate_ != nil && [delegate_ respondsToSelector:sel]) + [inv invokeWithTarget:delegate_]; +} + +@end +/* }}} */ + @interface WebView (Cydia) - (void) setScriptDebugDelegate:(id)delegate; - (void) _setFormDelegate:(id)delegate; @@ -309,8 +350,12 @@ } /* }}} */ +- (void) webViewClose:(WebView *)sender { + [book_ close]; +} + - (void) webView:(WebView *)sender didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame { - [window setValue:self forKey:@"cydia"]; + [window setValue:indirect_ forKey:@"cydia"]; } - (void) webView:(WebView *)sender unableToImplementPolicyWithError:(NSError *)error frame:(WebFrame *)frame { @@ -319,16 +364,30 @@ - (void) webView:(WebView *)sender decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id<WebPolicyDecisionListener>)listener { if (NSURL *url = [request URL]) { - if (name != nil && [name isEqualToString:@"_open"]) + if (name == nil) unknown: { + NSLog(@"win:%@:%@", url, [action description]); + if (![self getSpecial:url]) { + NSString *scheme([[url scheme] lowercaseString]); + if ([scheme isEqualToString:@"mailto"]) + [delegate_ openMailToURL:url]; + else goto use; + } + } else if ([name isEqualToString:@"_open"]) [delegate_ openURL:url]; + else if ([name isEqualToString:@"_popup"]) { + RVBook *book([[[RVPopUpBook alloc] initWithFrame:[delegate_ popUpBounds]] autorelease]); + [book setDelegate:self]; + + RVPage *page([delegate_ pageForURL:url hasTag:NULL]); + if (page == nil) { + BrowserView *browser([[[BrowserView alloc] initWithBook:book] autorelease]); + [browser loadURL:url]; + page = browser; + } - NSLog(@"win:%@:%@", url, [action description]); - if (![self getSpecial:url]) { - NSString *scheme([[url scheme] lowercaseString]); - if ([scheme isEqualToString:@"mailto"]) - [delegate_ openMailToURL:url]; - else goto use; - } + [book setPage:page]; + [book_ pushBook:book]; + } else goto unknown; [listener ignore]; } else use: @@ -359,7 +418,9 @@ if (request_ != nil) [request_ autorelease]; request_ = [request retain]; +#if ForSaurik NSLog(@"dpn:%@", request_); +#endif } [listener use]; diff --git a/UICaboodle/RVBook.h b/UICaboodle/RVBook.h index 88a5191..a7781e7 100644 --- a/UICaboodle/RVBook.h +++ b/UICaboodle/RVBook.h @@ -1,12 +1,18 @@ #import "UICaboodle.h" -#import <UIKit/UIView.h> +#import <UIKit/UIKit.h> @class NSMutableArray; +@class RVBook; @class RVPage; @class UINavigationBar; @class UITransitionView; +@interface UIView (PopUpView) +- (void) popFromSuperviewAnimated:(BOOL)animated; +- (void) popSubview:(UIView *)view; +@end + @protocol RVNavigationBarDelegate @end @@ -14,6 +20,8 @@ - (void) setPageActive:(BOOL)active with:(id)object; - (void) resetViewAnimated:(BOOL)animated with:(id)object; - (void) reloadDataWith:(id)object; +- (void) popUpBook:(RVBook *)book; +- (CGRect) popUpBounds; @end @interface RVBook : UIView < @@ -24,6 +32,7 @@ UITransitionView *transition_; BOOL resetting_; _transient id delegate_; + UIToolbar *toolbar_; } - (UINavigationBar *) navigationBar; @@ -36,6 +45,8 @@ - (void) pushPage:(RVPage *)page; - (void) popPages:(unsigned)pages; +- (void) pushBook:(RVBook *)book; + - (void) resetViewAnimated:(BOOL)animated; - (void) resetViewAnimated:(BOOL)animated toPage:(RVPage *)page; @@ -47,5 +58,13 @@ - (void) reloadData; - (CGRect) pageBounds; +- (void) close; + +@end + +@interface RVPopUpBook : RVBook { + _transient RVBook *parent_; + bool cancel_; +} @end diff --git a/UICaboodle/RVBook.mm b/UICaboodle/RVBook.mm index a6f5318..b1bbce6 100644 --- a/UICaboodle/RVBook.mm +++ b/UICaboodle/RVBook.mm @@ -52,7 +52,6 @@ - (id) createButtonWithContents:(id)contents width:(float)width barStyle:(int)barStyle buttonStyle:(int)style isRight:(BOOL)right { float adjust = [contents widthForButtonContents:width]; - NSLog(@"cc:%@:%g:%g", contents, width, adjust); width = adjust; return [super createButtonWithContents:contents width:width barStyle:barStyle buttonStyle:style isRight:right]; } @@ -63,10 +62,14 @@ - (void) dealloc { [navbar_ setDelegate:nil]; + if (toolbar_ != nil) + [toolbar_ setDelegate:nil]; [pages_ release]; [navbar_ release]; [transition_ release]; + if (toolbar_ != nil) + [toolbar_ release]; [super dealloc]; } @@ -157,6 +160,10 @@ [navbar_ setAccessoryView:[page accessoryView] animate:animated removeOnPop:NO]; } +- (void) pushBook:(RVBook *)book { + [delegate_ popUpBook:book]; +} + - (void) popPages:(unsigned)pages { if (pages == 0) return; @@ -213,10 +220,14 @@ [navitem setTitle:title]; } +- (NSString *) _leftButtonTitleForPage:(RVPage *)page { + return [page leftButtonTitle]; +} + - (void) reloadButtonsForPage:(RVPage *)page { if ([pages_ count] == 0 || page != [pages_ lastObject]) return; - NSString *leftButtonTitle([page leftButtonTitle]); + NSString *leftButtonTitle([self _leftButtonTitleForPage:page]); UINavigationButtonStyle leftButtonStyle = [page leftButtonStyle]; UINavigationButtonStyle rightButtonStyle = [page rightButtonStyle]; //[navbar_ showButtonsWithLeftTitle:leftButtonTitle rightTitle:[page rightButtonTitle] leftBack:(leftButtonTitle == nil)]; @@ -244,4 +255,27 @@ return [transition_ bounds]; } +- (void) close { +} + +@end + +@implementation RVPopUpBook + +- (NSString *) _leftButtonTitleForPage:(RVPage *)page { + NSString *title([super _leftButtonTitleForPage:page]); + return (cancel_ = title == nil && [pages_ count] == 1) ? @"Cancel" : title; +} + +- (void) navigationBar:(UINavigationBar *)navbar buttonClicked:(int)button { + if (button == 1 && cancel_) + [self close]; + else + [super navigationBar:navbar buttonClicked:button]; +} + +- (void) close { + [self popFromSuperviewAnimated:YES]; +} + @end @@ -4,7 +4,7 @@ Priority: required Section: Packaging Maintainer: Jay Freeman (saurik) <saurik@saurik.com> Architecture: iphoneos-arm -Version: 1.0.2673-38 +Version: 1.0.2675-38 Replaces: com.sosiphone.addcydia Depends: apt, darwintools, pcre, shell-cmds Conflicts: com.sosiphone.addcydia |