]>
git.saurik.com Git - cydia.git/blob - Cydia.app/package.js
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 $("#rating").src(rating
);
55 $("#settings").href("cydia://package-settings/" + idc
);
57 var warnings
= package.warnings
;
58 var length
= warnings
== null ? 0 : warnings
.length
;
60 $(".warnings").remove();
62 var parent
= $("#warnings");
63 var child
= $("#warning");
66 for (var i
= 0; i
!= length
; ++i
) {
67 var clone
= child
.clone(true);
69 clone
.xpath("label").html($.xml(warnings
[i
]));
73 var applications
= package.applications
;
74 var length
= applications
== null ? 0 : applications
.length
;
76 var child
= $("#application");
80 var parent = $("#actions");
82 for (var i = 0; i != length; ++i) {
83 var application = applications[i];
84 var clone = child.clone(true);
86 clone.href("cydia://launch/" + application[0]);
87 clone.xpath("label").html("Run " + $.xml(application[1]));
88 clone.xpath("img").src(application[2]);
92 var purposes
= package.purposes
;
93 var commercial
= false;
96 for (var i
= 0, e
= purposes
.length
; i
!= e
; ++i
) {
97 var purpose
= purposes
[i
];
98 if (purpose
== "commercial")
100 else if (purpose
== "console")
104 $(".commercial").remove();
106 $(".console").remove();
108 var author
= package.author
;
110 $(".author").remove();
112 $("#author").html(author
.name
);
113 if (author
.address
== null)
114 $("#author-icon").remove();
116 $("#author-href").href("mailto:" + author
.address
+ "?subject=" + regarding
);
119 //$("#notice-src").src("http://saurik.cachefly.net/notice/" + idc + ".html");
121 var depiction
= package.depiction
;
122 if (depiction
== null)
123 $(".depiction").remove();
125 $(".description").display("none");
126 $("#depiction-src").src(depiction
);
129 var description
= package.description
;
130 if (description
== null)
131 description
= package.tagline
;
133 description
= description
.replace(/\n/g, "<br/>");
134 $("#description").html(description
);
136 var homepage
= package.homepage
;
137 if (homepage
== null)
138 $(".homepage").remove();
140 $("#homepage-href").href(homepage
);
142 var installed
= package.installed
;
143 if (installed
== null)
144 $(".installed").remove();
146 $("#installed").html(installed
);
147 $("#files-href").href("cydia://files/" + idc
);
150 space("#id", id
, 238);
152 var section
= package.section
;
154 $(".section").remove();
156 $("#section-src").src("cydia://section-icon/" + encodeURIComponent(section
));
157 $("#section").html(section
);
160 var size
= package.size
;
164 $("#size").html(size
/ 1024 + " kB");
166 var maintainer
= package.maintainer
;
167 if (maintainer
== null)
168 $(".maintainer").remove();
170 $("#maintainer").html(maintainer
.name
);
171 if (maintainer
.address
== null)
172 $("#maintainer-icon").remove();
174 $("#maintainer-href").href("mailto:" + maintainer
.address
+ "?subject=" + regarding
);
177 var sponsor
= package.sponsor
;
179 $(".sponsor").remove();
181 $("#sponsor").html(sponsor
.name
);
182 $("#sponsor-href").href(sponsor
.address
);
185 var source
= package.source
;
186 if (source
== null) {
187 $(".source").remove();
188 $(".trusted").remove();
190 var host
= source
.host
;
192 $("#source-src").src("cydia://source-icon/" + encodeURIComponent(host
));
193 $("#source-name").html(source
.name
);
196 $("#trusted").href("cydia://package-signature/" + idc
);
198 $(".trusted").remove();
200 var description
= source
.description
;
201 if (description
== null)
202 $(".source-description").remove();
204 $("#source-description").html(description
);