X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/f79a451249afae7da9887ff92f0d9d1d70c92dd4..b46737032fdf79efd25b8bb022af6e9f1181ff61:/Cydia.app/package.js diff --git a/Cydia.app/package.js b/Cydia.app/package.js index 418e44a2..6e091cf2 100644 --- a/Cydia.app/package.js +++ b/Cydia.app/package.js @@ -7,7 +7,7 @@ }, //"depiction": "http://planet-iphones.com/repository/info/chromium1.3.php", "depiction": "http://cydia.saurik.com/terminal.html", - "description": "this is a sample description", + "longDescription": "this is a sample description", "homepage": "http://cydia.saurik.com/terminal.html", "installed": "286u-4", "id": "mobileterminal", @@ -33,10 +33,6 @@ 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); }; @@ -57,7 +53,11 @@ var special_ = function () { var idc = encodeURIComponent(id); var name = package.name; var icon = 'cydia://package-icon/' + idc; + var api = 'http://cydia.saurik.com/api/'; + var capi = 'http://cache.cydia.saurik.com/api/'; + + var support = package.support; var regarding = function (type) { return encodeURIComponent("Cydia/APT(" + type + "): " + name); @@ -69,10 +69,15 @@ var special_ = function () { $("#name").html(name); space("#latest", package.latest, 96); - $.xhr(cache(api + 'package/' + idc), 'GET', {}, null, { + $.xhr(capi + 'package/' + idc, 'GET', {}, null, { success: function (value) { value = eval(value); + if (typeof value.notice == "undefined") + $(".notice").addClass("deleted"); + else + $("#notice-src").src(value.notice); + if (typeof value.rating == "undefined") $(".rating").addClass("deleted"); else { @@ -175,17 +180,12 @@ var special_ = function () { space("#author", author.name, 160); if (author.address == null) $("#author-icon").addClass("deleted"); - else { - var support = package.support; - if (support == null) - $("#author-href").href("mailto:" + author.address + "?subject=" + regarding("A")); - else - $("#author-href").href(support); - } + else if (support == null) + $("#author-href").href("mailto:" + author.address + "?subject=" + regarding("A")); + else + $("#author-href").href(support); } - //$("#notice-src").src("http://saurik.cachefly.net/notice/" + idc + ".html"); - /*var store = commercial; if (!store) $(".activation").addClass("deleted"); @@ -202,9 +202,9 @@ var special_ = function () { $("#depiction-src").src(depiction); } - var description = package.description; + var description = package.longDescription; if (description == null) - description = package.tagline; + description = package.shortDescription; else description = description.replace(/\n/g, "
"); $("#description").html(description); @@ -225,7 +225,7 @@ var special_ = function () { space("#id", id, 220); - var section = package.section; + var section = package.longSection; if (section == null) $(".section").addClass("deleted"); else { @@ -246,8 +246,10 @@ var special_ = function () { space("#maintainer", maintainer.name, 153); if (maintainer.address == null) $("#maintainer-icon").addClass("deleted"); - else + else if (support == null) $("#maintainer-href").href("mailto:" + maintainer.address + "?subject=" + regarding("M")); + else + $("#maintainer-href").href(support); } var sponsor = package.sponsor; @@ -291,9 +293,21 @@ var special = function () { $("#thumb")[0].className = 'flip-180'; /* XXX: this could be better */ + $("#rating-href").href(null); $("#rating-none").css("display", "none"); $("#rating-done").css("display", "none"); + var notice = $("#notice-src"); + + notice[0].outerHTML = ''; + var depiction = $("#depiction-src"); depiction[0].outerHTML = '