From d8d9a65cd4a5c345be8b749a1277861a49790158 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 7 Mar 2009 08:24:22 +0000 Subject: [PATCH] Checkpoint before final completion. --- Cydia.app/Default.png | Bin 2307 -> 789 bytes Cydia.app/Sections.plist | 6 -- ...{Keyboard Extensions.png => Keyboards.png} | Bin Cydia.app/menes/style.css | 48 ++++++++--- Cydia.app/package.html | 31 ++++--- Cydia.app/package.js | 24 +++--- Cydia.mm | 80 ++++++++++++++++-- control | 2 +- 8 files changed, 136 insertions(+), 55 deletions(-) rename Cydia.app/Sections/{Keyboard Extensions.png => Keyboards.png} (100%) diff --git a/Cydia.app/Default.png b/Cydia.app/Default.png index 3c7762cb38ef68692972a3ff7480eb583dd2ee15..ca46fda08c2c0304a1c60463e4ac9ec4f961f9cd 100644 GIT binary patch literal 789 zcmeAS@N?(olHy`uVBq!ia0y~yU~~ZDGaO7n5$%R&aX^Z(ILO_JVcj{Imp~3%lDE4H zkOqRE&b#Y@6lZ})WHAE+w=f7ZGR&GI0Tg5}@$_|NzsbxjDrCj+^j9+j1JhJb7srr_ zTW{|gavgFIXuIfABpc2DVBY;pw+{I2<_8-w=Btftfj$X^7_ybP0 Hl+XkK@#c+# literal 2307 zcmeAS@N?(olHy`uU|?}hck(n~P+$|E*N_V2^Ll!?1Tio$Isow*4mP03l1GJ{3=AB* zJY5_^-rhawC6FM|`tW{l`GQ3&H2N%bcQ@>rmnN0jVs!e%a1 zyM9ktaqV4G+1%$j^Y3o2*dBkh|9$lS?wOGfw6>Xrv0OM~#JoeZA#Iw}f%W>+SV7z$ zPj60Qm=&4EV833UYr)J^whxytvoe}&KEqHKGh5if_%zRh_N$U$fqm6BszAMx2exYq zGi9XBWUSd-!PjpKzyk8U^C3Du^=^jPW>Mw_w$1yxKlg%}t!xEfra)B2 zSVJs3IuYWom>pFyK$Rv9hmV6Tv8aCvvNVn1d0QXQovmyiJ|%)(buP|I1?)_a2X8R& z$%%kH{N*S!(8h&~GB@F!7iAyXG1vH+~>fcOJd&P4tCD&@~@D9yZ!99EaRV0 zua#@o=q#P`sknN#!Lb|vvzSgu2s^MR_HZspHay01VWUJcP=wZ4*nu$xXk)Vh)W#PP zJ%&ILT4Sh$wrWm2Ev~VM!=AT`?Eyn*bJZutufR_1z0~3wM+4wbjRsH(g8Ngp+fWTCLTe1Qkpmcybg~iTBii`$ zn?Iw@(l@}$B=VHjuiwAHRq2iE*VV!G#l3rR;OgbumoMOIal`K2(F|vO7|xzq#B}58 zRbVBm){vGK$oS^X8*qh_;O^cIuAgq-z6~+y+BKjGVD)+JS{T@*ZCkcLOxn3K5?tx{ z`uc*aq@0`_h!M`t&0r&5zkUriA|gB-;+R{vqQFL6yK)6$#I9XYU?W09L%~Mq$Ss~d hlVR3OVD(Eq>hIfs3{NT#Bmo;U44$rjF6*2UngCxzE|LHM diff --git a/Cydia.app/Sections.plist b/Cydia.app/Sections.plist index 5b03a42c..f5e87975 100644 --- a/Cydia.app/Sections.plist +++ b/Cydia.app/Sections.plist @@ -39,12 +39,6 @@ Carrier_Bundles - Keyboard_Extension - - Rename - Keyboard_Extensions - - Messageing Rename diff --git a/Cydia.app/Sections/Keyboard Extensions.png b/Cydia.app/Sections/Keyboards.png similarity index 100% rename from Cydia.app/Sections/Keyboard Extensions.png rename to Cydia.app/Sections/Keyboards.png diff --git a/Cydia.app/menes/style.css b/Cydia.app/menes/style.css index 174312f4..61a53df3 100644 --- a/Cydia.app/menes/style.css +++ b/Cydia.app/menes/style.css @@ -181,9 +181,17 @@ dialog > toolbar > a.forward-button { /* }}} */ panel > block { - background-color: #c7ced5; + /*background-color: #ccd1d5;*/ + /*background-color: white;*/ + /*background-color: #c7ced5;*/ + background-color: transparent; + //background-color: #ffffff; border-bottom: 1px solid #999999; border-top: 1px solid #999999; + border-left: 1px dotted #999999; + border-right: 1px dotted #999999; + -webkit-border-radius: 9px; + //border: 1px solid #999999; display: block; font-size: 16px; margin: 9px 10px; @@ -267,11 +275,6 @@ fieldset > textarea { padding: 12px 14px 10px 14px; } -fieldset > a:not([type="ad"]):first-child, -fieldset > div:first-child { - padding-top: 13px; -} - /*fieldset > a:not([type="ad"]):last-child, fieldset > div:last-child { padding-bottom: 10px; @@ -312,7 +315,7 @@ panel > fieldset > a[type="comment"] > div:first-of-type { } panel > fieldset > a[type="profile"] > div:first-of-type, -panel > fieldset > a[type="thumb"] > div:first-of-type { +panel > fieldset:not(.header) > a[type="thumb"] > div:first-of-type { border: 1px solid #999999; } @@ -352,7 +355,13 @@ fieldset > a[type="comment"] > div:first-of-type { width: 44px; } +fieldset > a[type="header"] > div:first-of-type { + height: 64px; + width: 64px; +} + fieldset > a[type="profile"] > div:first-of-type { + -webkit-background-size: 50px; height: 50px; width: 50px; } @@ -363,6 +372,7 @@ fieldset > a[type="thumb"] > div:first-of-type { } fieldset > a[type="comment"] > div:first-of-type, +fieldset > a[type="header"] > div:first-of-type, fieldset > a[type="profile"] > div:first-of-type, fieldset > a[type="thumb"] > div:first-of-type { background-repeat: no-repeat; @@ -370,7 +380,7 @@ fieldset > a[type="thumb"] > div:first-of-type { display: inline-block; /* XXX: small differences due to font bugs */ /* XXX: 1px difference due to border stupidity */ - margin: -14px 7px -11px -15px; + margin: -13px 7px -11px -15px; } fieldset > a > img.icon, @@ -517,11 +527,12 @@ fieldset > a:not([type]) > div { width: 250px; } +fieldset > a:not([href]) > img.icon + div, fieldset > div > img.icon + div { width: 244px; } -fieldset > a > img.icon + div { +fieldset > a[href] > img.icon + div { width: 221px; } @@ -560,7 +571,7 @@ fieldset > a[type="thumb"] > div:nth-of-type(2) { } fieldset > a[type="profile"] > div:nth-of-type(2) { - margin: -6px 0 -5px 0; + margin: -5px 0; } fieldset > a[type="profile"] > div:nth-of-type(2), @@ -721,7 +732,11 @@ panel.centered > label { } panel > iframe { - margin: -8px 0; + margin: -9px 0; +} + +panel > iframe + iframe { + margin-top: 0; } /* Rating Stars {{{ */ @@ -776,3 +791,14 @@ panel > iframe { position: absolute; } /* }}} */ + +panel > fieldset.header { + background-color: transparent; + border: none; + margin: -5px 0 -11px 0; +} + +panel > fieldset.header > a > div > label { + color: #4d4d70; + text-shadow: rgba(255, 255, 255, 0.75) 1px 1px 0; +} diff --git a/Cydia.app/package.html b/Cydia.app/package.html index dbf55865..4dc34a85 100644 --- a/Cydia.app/package.html +++ b/Cydia.app/package.html @@ -61,18 +61,6 @@ top: -5px; } - #depiction { - margin: -8px 0; - overflow: hidden; - width: 320px; - } - - #notice { - margin: -8px 0 -9px 0; - overflow: hidden; - width: 320px; - } - #remove > a { color: #335588; text-decoration: none; @@ -260,13 +248,23 @@ -
+> + + -
+> diff --git a/Cydia.app/package.js b/Cydia.app/package.js index c3b361c8..200be8bb 100644 --- a/Cydia.app/package.js +++ b/Cydia.app/package.js @@ -63,7 +63,7 @@ $(function () { $("#name").html(name); space("#latest", package.latest, 96); - $.xhr((api + 'package_/' + idc), 'GET', {}, null, { + $.xhr(cache(api + 'package/' + idc), 'GET', {}, null, { success: function (value) { value = eval(value); @@ -145,19 +145,11 @@ $(function () { } }*/ - var purposes = package.purposes; - var commercial = false; - var _console = false; - if (purposes != null) - for (var i = 0, e = purposes.length; i != e; ++i) { - var purpose = purposes[i]; - if (purpose == "commercial") - commercial = true; - else if (purpose == "console") - _console = true; - } + var commercial = package.hasTag('cydia::commercial'); if (!commercial) $(".commercial").remove(); + + var _console = package.hasTag('purpose::console'); if (!_console) $(".console").remove(); @@ -174,6 +166,14 @@ $(function () { //$("#notice-src").src("http://saurik.cachefly.net/notice/" + idc + ".html"); + /*var store = commercial; + if (!store) + $(".activation").remove(); + else { + var activation = api + 'activation/' + idc; + $("#activation-src").src(activation); + }*/ + var depiction = package.depiction; if (depiction == null) $(".depiction").remove(); diff --git a/Cydia.mm b/Cydia.mm index d898ef3a..ebab2134 100644 --- a/Cydia.mm +++ b/Cydia.mm @@ -383,10 +383,12 @@ extern NSString * const kCAFilterNearest; #define ForRelease 1 #define ForSaurik (1 && !ForRelease) +#define LogBrowser (0 && !ForRelease) +#define ManualRefresh (1 && !ForRelease) #define ShowInternals (1 && !ForRelease) #define IgnoreInstall (0 && !ForRelease) #define RecycleWebViews 0 -#define AlwaysReload (1 && !ForRelease) +#define AlwaysReload (0 && !ForRelease) #if ForRelease #undef _trace @@ -768,6 +770,11 @@ static CGColor Black_; static CGColor Off_; static CGColor White_; static CGColor Gray_; +static CGColor Green_; +static CGColor Purple_; +static CGColor Purplish_; + +static UIColor *CommercialColor_; static NSString *App_; static NSString *Home_; @@ -1416,6 +1423,7 @@ class Progress : - (BOOL) hasTag:(NSString *)tag; - (NSString *) primaryPurpose; - (NSArray *) purposes; +- (bool) isCommercial; - (NSComparisonResult) compareByName:(Package *)package; - (NSComparisonResult) compareBySection:(Package *)package; @@ -1469,6 +1477,17 @@ class Progress : [super dealloc]; } ++ (NSString *) webScriptNameForSelector:(SEL)selector { + if (selector == @selector(hasTag:)) + return @"hasTag"; + else + return nil; +} + ++ (BOOL) isSelectorExcludedFromWebScript:(SEL)selector { + return [self webScriptNameForSelector:selector] == nil; +} + + (NSArray *) _attributeKeys { return [NSArray arrayWithObjects:@"applications", @"author", @"depiction", @"description", @"essential", @"homepage", @"icon", @"id", @"installed", @"latest", @"maintainer", @"name", @"purposes", @"section", @"size", @"source", @"sponsor", @"tagline", @"warnings", nil]; } @@ -2117,6 +2136,10 @@ class Progress : return [purposes count] == 0 ? nil : purposes; } +- (bool) isCommercial { + return [self hasTag:@"cydia::commercial"]; +} + - (NSComparisonResult) compareByName:(Package *)package { NSString *lhs = [self name]; NSString *rhs = [package name]; @@ -3704,12 +3727,14 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { /* }}} */ /* Package Cell {{{ */ -@interface PackageCell : UISimpleTableCell { +@interface PackageCell : UITableCell { UIImage *icon_; NSString *name_; NSString *description_; + bool commercial_; NSString *source_; UIImage *badge_; + bool cached_; #ifdef USE_BADGES UITextLabel *status_; #endif @@ -3779,6 +3804,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { name_ = [[package name] retain]; description_ = [[package tagline] retain]; + commercial_ = [package isCommercial]; NSString *label = nil; bool trusted = false; @@ -3819,6 +3845,29 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [status_ setText:nil]; } #endif + + cached_ = false; +} + +- (void) drawRect:(CGRect)rect { + if (!cached_) { + //[self setBackgroundColor:(commercial_ ? CommercialColor_ : [UIColor whiteColor])]; + cached_ = true; + } + + [super drawRect:rect]; +} + +- (void) drawBackgroundInRect:(CGRect)rect withFade:(float)fade { + if (fade == 0 && commercial_) { + CGContextRef context(UIGraphicsGetCurrentContext()); + [[self backgroundColor] set]; + CGRect back(rect); + back.size.height -= 1; + CGContextFillRect(context, back); + } + + [super drawBackgroundInRect:rect withFade:fade]; } - (void) drawContentInRect:(CGRect)rect selected:(BOOL)selected { @@ -3848,12 +3897,12 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { UISetColor(White_); if (!selected) - UISetColor(Black_); + UISetColor(commercial_ ? Purple_ : Black_); [name_ drawAtPoint:CGPointMake(48, 8) forWidth:240 withFont:Font18Bold_ ellipsis:2]; [source_ drawAtPoint:CGPointMake(58, 29) forWidth:225 withFont:Font12_ ellipsis:2]; if (!selected) - UISetColor(Gray_); + UISetColor(commercial_ ? Purplish_ : Gray_); [description_ drawAtPoint:CGPointMake(12, 46) forWidth:280 withFont:Font14_ ellipsis:2]; [super drawContentInRect:rect selected:selected]; @@ -4121,6 +4170,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { _transient Database *database_; Package *package_; NSString *name_; + bool commercial_; NSMutableArray *buttons_; } @@ -4178,7 +4228,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (bool) _allowJavaScriptPanel { - return false; + return commercial_; } #if !AlwaysReload @@ -4239,6 +4289,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { if (package != nil) { package_ = [package retain]; name_ = [[package id] retain]; + commercial_ = [package isCommercial]; [self loadURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"package" ofType:@"html"]]]; @@ -4254,8 +4305,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } } -- (bool) _loading { - return false; +- (bool) isLoading { + return commercial_ ? [super isLoading] : false; } - (void) reloadData { @@ -5173,7 +5224,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } #endif -- (bool) _loading { +- (bool) isLoading { return false; } @@ -6558,7 +6609,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { // XXX: what is this line of code for? if ([packages count] == 0); - else if (Loaded_ || ForSaurik) loaded: + else if (Loaded_ || ManualRefresh) loaded: [self _loaded]; else { Loaded_ = YES; @@ -7444,6 +7495,17 @@ int main(int argc, char *argv[]) { _pooled Off_.Set(space_, 0.9, 0.9, 0.9, 1.0); White_.Set(space_, 1.0, 1.0, 1.0, 1.0); Gray_.Set(space_, 0.4, 0.4, 0.4, 1.0); + Green_.Set(space_, 0.0, 0.5, 0.0, 1.0); + Purple_.Set(space_, 0.0, 0.0, 0.7, 1.0); + Purplish_.Set(space_, 0.4, 0.4, 0.8, 1.0); + /*Purple_.Set(space_, 1.0, 0.3, 0.0, 1.0); + Purplish_.Set(space_, 1.0, 0.6, 0.4, 1.0); ORANGE */ + /*Purple_.Set(space_, 1.0, 0.5, 0.0, 1.0); + Purplish_.Set(space_, 1.0, 0.7, 0.2, 1.0); ORANGISH */ + /*Purple_.Set(space_, 0.5, 0.0, 0.7, 1.0); + Purplish_.Set(space_, 0.7, 0.4, 0.8, 1.0); PURPLE */ + + CommercialColor_ = [UIColor colorWithRed:0.93f green:1.00f blue:0.88f alpha:1.00f]; Finishes_ = [NSArray arrayWithObjects:@"return", @"reopen", @"restart", @"reload", @"reboot", nil]; diff --git a/control b/control index adafcef0..49534cce 100644 --- a/control +++ b/control @@ -4,7 +4,7 @@ Priority: required Section: Packaging Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 1.0.2769-43 +Version: 1.0.2787-43 Replaces: com.sosiphone.addcydia Depends: apt, darwintools, pcre, shell-cmds Conflicts: com.sosiphone.addcydia -- 2.45.2