3e7c9ca34375160d909c08189682fc2058932da0
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 console
.log(width
+ " " + max
+ " " + spacing
);
33 node
.css("letter-spacing", spacing
);
39 var idc
= encodeURIComponent(id
);
40 var name
= package.name
;
41 var regarding
= encodeURIComponent("Cydia/APT: " + name
);
43 $("#icon").src("cydia://package-icon/" + idc
);
44 $("#reflection").src("cydia://package-icon/" + idc
);
46 $("#name").html(name
);
47 space("#latest", package.latest
, 93);
49 var rating
= package.rating
;
51 $(".rating").remove();
53 $.xhr(rating
, 'GET', {}, null, {
54 success: function (value
) {
55 document
.getElementById("rating").contentWindow
.document
.write(value
);
60 $("#settings").href("cydia://package-settings/" + idc
);
62 var warnings
= package.warnings
;
63 var length
= warnings
== null ? 0 : warnings
.length
;
65 $(".warnings").remove();
67 var parent
= $("#warnings");
68 var child
= $("#warning");
71 for (var i
= 0; i
!= length
; ++i
) {
72 var clone
= child
.clone(true);
74 clone
.xpath("./div/label").html($.xml(warnings
[i
]));
78 var applications
= package.applications
;
79 var length
= applications
== null ? 0 : applications
.length
;
81 var child
= $("#application");
85 var parent = $("#actions");
87 for (var i = 0; i != length; ++i) {
88 var application = applications[i];
89 var clone = child.clone(true);
91 clone.href("cydia://launch/" + application[0]);
92 clone.xpath("label").html("Run " + $.xml(application[1]));
93 clone.xpath("img").src(application[2]);
97 var purposes
= package.purposes
;
98 var commercial
= false;
100 if (purposes
!= null)
101 for (var i
= 0, e
= purposes
.length
; i
!= e
; ++i
) {
102 var purpose
= purposes
[i
];
103 if (purpose
== "commercial")
105 else if (purpose
== "console")
109 $(".commercial").remove();
111 $(".console").remove();
113 var author
= package.author
;
115 $(".author").remove();
117 space("#author", author
.name
, 160);
118 if (author
.address
== null)
119 $("#author-icon").remove();
121 $("#author-href").href("mailto:" + author
.address
+ "?subject=" + regarding
);
124 //$("#notice-src").src("http://saurik.cachefly.net/notice/" + idc + ".html");
126 var depiction
= package.depiction
;
127 if (depiction
== null)
128 $(".depiction").remove();
130 $(".description").display("none");
131 $("#depiction-src").src(depiction
);
134 var description
= package.description
;
135 if (description
== null)
136 description
= package.tagline
;
138 description
= description
.replace(/\n/g, "<br/>");
139 $("#description").html(description
);
141 var homepage
= package.homepage
;
142 if (homepage
== null)
143 $(".homepage").remove();
145 $("#homepage-href").href(homepage
);
147 var installed
= package.installed
;
148 if (installed
== null)
149 $(".installed").remove();
151 $("#installed").html(installed
);
152 $("#files-href").href("cydia://files/" + idc
);
155 space("#id", id
, 220);
157 var section
= package.section
;
159 $(".section").remove();
161 $("#section-src").src("cydia://section-icon/" + encodeURIComponent(section
));
162 $("#section").html(section
);
165 var size
= package.size
;
169 $("#size").html(size
/ 1024 + " kB");
171 var maintainer
= package.maintainer
;
172 if (maintainer
== null)
173 $(".maintainer").remove();
175 space("#maintainer", maintainer
.name
, 153);
176 if (maintainer
.address
== null)
177 $("#maintainer-icon").remove();
179 $("#maintainer-href").href("mailto:" + maintainer
.address
+ "?subject=" + regarding
);
182 var sponsor
= package.sponsor
;
184 $(".sponsor").remove();
186 space("#sponsor", sponsor
.name
, 152);
187 $("#sponsor-href").href(sponsor
.address
);
190 var source
= package.source
;
191 if (source
== null) {
192 $(".source").remove();
193 $(".trusted").remove();
195 var host
= source
.host
;
197 $("#source-src").src("cydia://source-icon/" + encodeURIComponent(host
));
198 $("#source-name").html(source
.name
);
201 $("#trusted").href("cydia://package-signature/" + idc
);
203 $(".trusted").remove();
205 var description
= source
.description
;
206 if (description
== null)
207 $(".source-description").remove();
209 $("#source-description").html(description
);