diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2008-12-31 09:00:05 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:09:33 +0000 |
commit | 59c6ae2287e52da7cf67e7bb8ae3fb53d07ab041 (patch) | |
tree | 382cef549e41497257784b3516ba6be88823283d | |
parent | c37ef8c803fbed03504a12b9e1547af1fc8de358 (diff) |
Welcome to the future.
-rw-r--r-- | Cydia.app/menes/style.css | 33 | ||||
-rw-r--r-- | Cydia.app/package.html | 47 | ||||
-rw-r--r-- | Cydia.app/package.js | 76 | ||||
-rw-r--r-- | Cydia.mm | 22 | ||||
-rw-r--r-- | control | 2 |
5 files changed, 110 insertions, 70 deletions
diff --git a/Cydia.app/menes/style.css b/Cydia.app/menes/style.css index a7e1949..d9915c9 100644 --- a/Cydia.app/menes/style.css +++ b/Cydia.app/menes/style.css @@ -178,7 +178,7 @@ dialog > toolbar > a.forward-button { float: right; } /* }}} */ -/* fieldset {{{ */ + panel > block { background-color: #c7ced5; border-bottom: 1px solid #999999; @@ -335,39 +335,37 @@ fieldset > div > select { -webkit-appearance: none; } -fieldset > a, -fieldset > div > select { - background: no-repeat url(chevron.png); -} - -fieldset > a { - background-position-y: 13px; -} - -fieldset > a.thumb { - background-position-y: 24px; -} +/* Chevrons {{{ */ +fieldset > a[href], fieldset > div > select { - background-position-y: 11px; + background-repeat: no-repeat; + background-image: url(chevron.png); + background-position-y: center; } -list > fieldset > a { +/* Horizontal */ + +list > fieldset > a[href] { background-position-x: 295px; } -panel > fieldset > a { +panel > fieldset > a[href] { background-position-x: 275px; } +list > fieldset > a:not([href]) > select, list > fieldset > div > select { background-position-x: 192px; } +panel > fieldset > a:not([href]) > select, panel > fieldset > div > select { background-position-x: 163px; } +/* }}} */ + fieldset > textarea, fieldset > div > input, fieldset > div > select, @@ -419,7 +417,7 @@ fieldset > div > div { width: 273px; } -fieldset > a > div { +fieldset > a:not(.thumb) > div { width: 250px; } @@ -490,4 +488,3 @@ fieldset > a.thumb > back { top: -1px; width: 237px; } -/* }}} */ diff --git a/Cydia.app/package.html b/Cydia.app/package.html index 3e63475..75b86f0 100644 --- a/Cydia.app/package.html +++ b/Cydia.app/package.html @@ -14,7 +14,7 @@ if (count++ != 0) return; $("#depiction-load").remove(); - $("#depiction-src").css("display" "block"); + $("#depiction-src").css("display", "block"); } var remove = function() { @@ -24,6 +24,32 @@ </script> <style> + .flip-180 { + -webkit-backface-visibility: hidden; + -webkit-transform: rotateY(180deg); + -webkit-transition-duration: 2s; + -webkit-transition-property: transform; + } + + .flip-360 { + -webkit-backface-visibility: hidden; + -webkit-transform: rotateY(360deg); + -webkit-transition-duration: 2s; + -webkit-transition-property: transform; + } + + .fade-out { + opacity: 0; + -webkit-transition-property: opacity; + -webkit-transition-duration: 2s; + } + + .fade-in { + opacity: 1; + -webkit-transition-property: opacity; + -webkit-transition-duration: 2s; + } + #remove { margin-top: 7px; text-align: center; @@ -70,19 +96,25 @@ color: red; } - #boundry { + #boundary { float: left; + height: 64; width: 64px; } + #thumb, #icon { background-position: center center; background-repeat: no-repeat; - -webkit-border-radius: 9px; height: 64px; + position: absolute; width: 64px; } + #thumb { + -webkit-border-radius: 9px; + } + /* XXX: this style is out of date */ #reflection { height: 59px; @@ -118,7 +150,7 @@ } #name { - margin-bottom: 10px; + margin-bottom: 13px; font-weight: bold; font-size: 17px; overflow: hidden; @@ -186,9 +218,10 @@ <dialog><panel> <fieldset id="header"> - <div class="clearfix"> - <div id="boundry"> - <div id="icon"></div> + <div> + <div id="boundary"> + <div class="flip-0" id="icon"></div> + <div class="flip-180" id="thumb"></div> <!--img id="reflection"/--> </div> diff --git a/Cydia.app/package.js b/Cydia.app/package.js index 71ac849..de1343c 100644 --- a/Cydia.app/package.js +++ b/Cydia.app/package.js @@ -33,13 +33,29 @@ function space(selector, html, max) { } } +function cache(url) { + return url.replace('://', '://ne.edgecastcdn.net/8003A4/'); +} + +var swap_, swap = function (on, off, time) { + setTimeout(swap_(on, off, time), time); +}; + +swap_ = function (on, off, time) { + return function () { + on.className = 'fade-out'; + off.className = 'fade-in'; + swap(off, on, time); + }; +}; + $(function () { var id = package.id; var idc = encodeURIComponent(id); var name = package.name; var regarding = encodeURIComponent("Cydia/APT: " + name); var icon = 'cydia://package-icon/' + idc; - var icon = 'http://cydia.saurik.com/thumb/net.ispazio.deeptheme.png'; + var api = 'http://cydia.saurik.com/api/'; $("#icon").css("background-image", 'url("' + icon + '")'); $("#reflection").src("cydia://package-icon/" + idc); @@ -47,36 +63,46 @@ $(function () { $("#name").html(name); space("#latest", package.latest, 96); - var rating = package.rating; - if (rating == null) - $(".rating").remove(); - else { - $.xhr(rating, 'GET', {}, null, { - success: function (value) { - value = eval(value); + $.xhr(api + 'package/' + idc, 'GET', {}, null, { + success: function (value) { + value = eval(value); - $("#rating-load").remove(); - $("#rating-href").href(value.reviews); + $("#rating-load").remove(); - var none = $("#rating-none"); - var done = $("#rating-done"); + var href = $("#rating-href"); + href.href(value.reviews); - if (value.rating == null) { - done.remove(); - none.css("display", "block"); - } else { - none.remove(); - done.css("display", "block"); + var none = $("#rating-none"); + var done = $("#rating-done"); - $("#rating-value").css('width', 16 * value.rating); - } - }, + if (value.rating == null) { + done.remove(); + none.css("display", "block"); + } else { + none.remove(); + done.css("display", "block"); - failure: function (status) { - $(".rating").remove(); + $("#rating-value").css('width', 16 * value.rating); } - }); - } + + if (typeof value.icon != "undefined" && value.icon != null) { + var icon = $("#icon"); + var thumb = $("#thumb"); + icon[0].className = 'flip-180'; + thumb[0].className = 'flip-360'; + thumb.css("background-image", 'url("' + value.icon + '")'); + + setTimeout(function () { + icon.css("display", "none"); + thumb[0].className = 'flip-0'; + }, 2000); + } + }, + + failure: function (status) { + $(".rating").remove(); + } + }); $("#settings").href("cydia://package-settings/" + idc); @@ -638,7 +638,6 @@ bool reload_; static NSDictionary *SectionMap_; static NSMutableDictionary *Metadata_; -static NSMutableDictionary *Indices_; static _transient NSMutableDictionary *Settings_; static _transient NSString *Role_; static _transient NSMutableDictionary *Packages_; @@ -1244,7 +1243,6 @@ class Progress : - (Source *) source; - (NSString *) role; -- (NSString *) rating; - (BOOL) matches:(NSString *)text; @@ -1307,7 +1305,7 @@ class Progress : } + (NSArray *) _attributeKeys { - return [NSArray arrayWithObjects:@"applications", @"author", @"depiction", @"description", @"essential", @"homepage", @"icon", @"id", @"installed", @"latest", @"maintainer", @"name", @"purposes", @"rating", @"section", @"size", @"source", @"sponsor", @"tagline", @"warnings", nil]; + return [NSArray arrayWithObjects:@"applications", @"author", @"depiction", @"description", @"essential", @"homepage", @"icon", @"id", @"installed", @"latest", @"maintainer", @"name", @"purposes", @"section", @"size", @"source", @"sponsor", @"tagline", @"warnings", nil]; } - (NSArray *) attributeKeys { @@ -1838,13 +1836,6 @@ class Progress : return role_; } -- (NSString *) rating { - if (NSString *rating = [Indices_ objectForKey:@"Rating"]) - return [rating stringByReplacingOccurrencesOfString:@"@" withString:[id_ stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; - else - return nil; -} - - (BOOL) matches:(NSString *)text { if (text == nil) return NO; @@ -4095,9 +4086,10 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { return; Package *package = [packages_ objectAtIndex:row]; + package = [database_ packageWithName:[package id]]; PackageView *view = [[[PackageView alloc] initWithBook:book_ database:database_] autorelease]; - [view setDelegate:delegate_]; [view setPackage:package]; + [view setDelegate:delegate_]; [book_ pushPage:view]; } @@ -7059,14 +7051,6 @@ int main(int argc, char *argv[]) { _pooled /*AddPreferences(@"/Applications/Preferences.app/Settings-iPhone.plist"); AddPreferences(@"/Applications/Preferences.app/Settings-iPod.plist");*/ - /*if ((Indices_ = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/lib/cydia/indices.plist"]) == NULL) - Indices_ = [[NSMutableDictionary alloc] init];*/ - - Indices_ = [NSMutableDictionary dictionaryWithObjectsAndKeys: - @"http://"/*"cache.saurik.com/"*/"cydia.saurik.com/rating/@", @"Rating", - //@"http://"/*"cache.saurik.com/"*/"cydia.saurik.com/repotag/@", @"RepoTag", - nil]; - _trace(); Metadata_ = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/lib/cydia/metadata.plist"]; _trace(); @@ -4,7 +4,7 @@ Priority: required Section: Packaging Maintainer: Jay Freeman (saurik) <saurik@saurik.com> Architecture: iphoneos-arm -Version: 1.0.2678-38 +Version: 1.0.2682-38 Replaces: com.sosiphone.addcydia Depends: apt, darwintools, pcre, shell-cmds Conflicts: com.sosiphone.addcydia |