]>
git.saurik.com Git - cydia.git/blob - Cydia.app/package.js
1a78a8bbf914cf94db75b0b78cf943a4d614afd7
2 "name": "MobileTerminal",
5 "name": "Allen Porter",
6 "address": "allen.porter@gmail.com"
8 //"depiction": "http://planet-iphones.com/repository/info/chromium1.3.php",
9 "depiction": "http://cydia.saurik.com/terminal.html",
10 "description": "this is a sample description",
11 "homepage": "http://cydia.saurik.com/terminal.html",
12 "installed": "286u-4",
13 "id": "mobileterminal",
14 "section": "Terminal Support",
17 "name": "Jay Freeman",
18 "address": "saurik@saurik.com"
21 "name": "Telesphoreo Tangelo",
22 "description": "Distribution of Unix Software for the iPhone"
26 function space(selector
, html
, max
) {
27 var node
= $(selector
);
29 var width
= node
.width();
31 var spacing
= (max
- node
.width()) / (html
.length
- 1) + "px";
32 node
.css("letter-spacing", spacing
);
37 return url
.replace('://', '://ne.edgecastcdn.net/8003A4/');
40 var swap_
, swap = function (on
, off
, time
) {
41 setTimeout(swap_(on
, off
, time
), time
);
44 swap_ = function (on
, off
, time
) {
46 on
.className
= 'fade-out';
47 off
.className
= 'fade-in';
54 var idc
= encodeURIComponent(id
);
55 var name
= package.name
;
56 var icon
= 'cydia://package-icon/' + idc
;
57 var api
= 'http://cydia.saurik.com/api/';
59 var regarding = function (type
) {
60 return encodeURIComponent("Cydia/APT(" + type
+ "): " + name
);
63 $("#icon").css("background-image", 'url("' + icon
+ '")');
64 //$("#reflection").src("cydia://package-icon/" + idc);
66 $("#name").html(name
);
67 space("#latest", package.latest
, 96);
69 $.xhr(cache(api
+ 'package/' + idc
), 'GET', {}, null, {
70 success: function (value
) {
73 if (typeof value
.rating
== "undefined")
74 $(".rating").remove();
76 $("#rating-load").remove();
77 $("#rating-href").href(value
.reviews
);
79 var none
= $("#rating-none");
80 var done
= $("#rating-done");
82 if (value
.rating
== null) {
84 none
.css("display", "block");
87 done
.css("display", "block");
89 $("#rating-value").css('width', 16 * value
.rating
);
93 if (typeof value
.icon
!= "undefined" && value
.icon
!= null) {
94 var icon
= $("#icon");
95 var thumb
= $("#thumb");
97 icon
[0].className
= 'flip-180';
98 thumb
[0].className
= 'flip-360';
100 thumb
.css("background-image", 'url("' + value
.icon
+ '")');
102 setTimeout(function () {
103 icon
.css("display", "none");
104 thumb
[0].className
= 'flip-0';
109 failure: function (status
) {
110 $(".rating").remove();
114 $("#settings").href("cydia://package-settings/" + idc
);
116 var mode
= package.mode
;
120 $("#mode").html(mode
);
121 $("#mode-src").src("Modes/" + mode
+ ".png");
124 var warnings
= package.warnings
;
125 var length
= warnings
== null ? 0 : warnings
.length
;
127 $(".warnings").remove();
129 var parent
= $("#warnings");
130 var child
= $("#warning");
133 for (var i
= 0; i
!= length
; ++i
) {
134 var clone
= child
.clone(true);
135 parent
.append(clone
);
136 clone
.xpath("./div/label").html($.xml(warnings
[i
]));
140 var applications
= package.applications
;
141 var length
= applications
== null ? 0 : applications
.length
;
143 var child
= $("#application");
147 var parent = $("#actions");
149 for (var i = 0; i != length; ++i) {
150 var application = applications[i];
151 var clone = child.clone(true);
152 parent.append(clone);
153 clone.href("cydia://launch/" + application[0]);
154 clone.xpath("label").html("Run " + $.xml(application[1]));
155 clone.xpath("img").src(application[2]);
159 var commercial
= package.hasTag('cydia::commercial');
161 $(".commercial").remove();
163 var _console
= package.hasTag('purpose::console');
165 $(".console").remove();
167 var author
= package.author
;
169 $(".author").remove();
171 space("#author", author
.name
, 160);
172 if (author
.address
== null)
173 $("#author-icon").remove();
175 var support
= package.support
;
177 $("#author-href").href("mailto:" + author
.address
+ "?subject=" + regarding("A"));
179 $("#author-href").href(support
);
183 //$("#notice-src").src("http://saurik.cachefly.net/notice/" + idc + ".html");
185 /*var store = commercial;
187 $(".activation").remove();
189 var activation = api + 'activation/' + idc;
190 $("#activation-src").src(activation);
193 var depiction
= package.depiction
;
194 if (depiction
== null)
195 $(".depiction").remove();
197 $(".description").css("display", "none");
198 $("#depiction-src").src(depiction
);
201 var description
= package.description
;
202 if (description
== null)
203 description
= package.tagline
;
205 description
= description
.replace(/\n/g, "<br/>");
206 $("#description").html(description
);
208 var homepage
= package.homepage
;
209 if (homepage
== null)
210 $(".homepage").remove();
212 $("#homepage-href").href(homepage
);
214 var installed
= package.installed
;
215 if (installed
== null)
216 $(".installed").remove();
218 $("#installed").html(installed
);
219 $("#files-href").href("cydia://files/" + idc
);
222 space("#id", id
, 220);
224 var section
= package.section
;
226 $(".section").remove();
228 $("#section-src").src("cydia://section-icon/" + encodeURIComponent(section
));
229 $("#section").html(section
);
232 var size
= package.size
;
236 $("#size").html(size
/ 1024 + " kB");
238 var maintainer
= package.maintainer
;
239 if (maintainer
== null)
240 $(".maintainer").remove();
242 space("#maintainer", maintainer
.name
, 153);
243 if (maintainer
.address
== null)
244 $("#maintainer-icon").remove();
246 $("#maintainer-href").href("mailto:" + maintainer
.address
+ "?subject=" + regarding("M"));
249 var sponsor
= package.sponsor
;
251 $(".sponsor").remove();
253 space("#sponsor", sponsor
.name
, 152);
254 $("#sponsor-href").href(sponsor
.address
);
257 var source
= package.source
;
258 if (source
== null) {
259 $(".source").remove();
260 $(".trusted").remove();
262 var host
= source
.host
;
264 $("#source-src").src("cydia://source-icon/" + encodeURIComponent(host
));
265 $("#source-name").html(source
.name
);
268 $("#trusted").href("cydia://package-signature/" + idc
);
270 $(".trusted").remove();
272 var description
= source
.description
;
273 if (description
== null)
274 $(".source-description").remove();
276 $("#source-description").html(description
);