]>
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 $("#rating").src("http://cydia.saurik.com/test_.html");
51 $("#settings").href("cydia://package-settings/" + idc
);
53 var warnings
= package.warnings
;
54 var length
= warnings
== null ? 0 : warnings
.length
;
56 $(".warnings").remove();
58 var parent
= $("#warnings");
59 var child
= $("#warning");
62 for (var i
= 0; i
!= length
; ++i
) {
63 var clone
= child
.clone(true);
65 clone
.xpath("label").html($.xml(warnings
[i
]));
69 var applications
= package.applications
;
70 var length
= applications
== null ? 0 : applications
.length
;
72 var child
= $("#application");
76 var parent = $("#actions");
78 for (var i = 0; i != length; ++i) {
79 var application = applications[i];
80 var clone = child.clone(true);
82 clone.href("cydia://launch/" + application[0]);
83 clone.xpath("label").html("Run " + $.xml(application[1]));
84 clone.xpath("img").src(application[2]);
88 var purposes
= package.purposes
;
89 var commercial
= false;
92 for (var i
= 0, e
= purposes
.length
; i
!= e
; ++i
) {
93 var purpose
= purposes
[i
];
94 if (purpose
== "commercial")
96 else if (purpose
== "console")
100 $(".commercial").remove();
102 $(".console").remove();
104 var author
= package.author
;
106 $(".author").remove();
108 $("#author").html(author
.name
);
109 if (author
.address
== null)
110 $("#author-icon").remove();
112 $("#author-href").href("mailto:" + author
.address
+ "?subject=" + regarding
);
115 //$("#notice-src").src("http://saurik.cachefly.net/notice/" + idc + ".html");
117 var depiction
= package.depiction
;
118 if (depiction
== null)
119 $(".depiction").remove();
121 $(".description").display("none");
122 $("#depiction-src").src(depiction
);
125 var description
= package.description
;
126 if (description
== null)
127 description
= package.tagline
;
129 description
= description
.replace(/\n/g, "<br/>");
130 $("#description").html(description
);
132 var homepage
= package.homepage
;
133 if (homepage
== null)
134 $(".homepage").remove();
136 $("#homepage-href").href(homepage
);
138 var installed
= package.installed
;
139 if (installed
== null)
140 $(".installed").remove();
142 $("#installed").html(installed
);
143 $("#files-href").href("cydia://files/" + idc
);
146 space("#id", id
, 238);
148 var section
= package.section
;
150 $(".section").remove();
152 $("#section-src").src("cydia://section-icon/" + encodeURIComponent(section
));
153 $("#section").html(section
);
156 var size
= package.size
;
160 $("#size").html(size
/ 1024 + " kB");
162 var maintainer
= package.maintainer
;
163 if (maintainer
== null)
164 $(".maintainer").remove();
166 $("#maintainer").html(maintainer
.name
);
167 if (maintainer
.address
== null)
168 $("#maintainer-icon").remove();
170 $("#maintainer-href").href("mailto:" + maintainer
.address
+ "?subject=" + regarding
);
173 var sponsor
= package.sponsor
;
175 $(".sponsor").remove();
177 $("#sponsor").html(sponsor
.name
);
178 $("#sponsor-href").href(sponsor
.address
);
181 var source
= package.source
;
182 if (source
== null) {
183 $(".source").remove();
184 $(".trusted").remove();
186 var host
= source
.host
;
188 $("#source-src").src("cydia://source-icon/" + encodeURIComponent(host
));
189 $("#source-name").html(source
.name
);
192 $("#trusted").href("cydia://package-signature/" + idc
);
194 $(".trusted").remove();
196 var description
= source
.description
;
197 if (description
== null)
198 $(".source-description").remove();
200 $("#source-description").html(description
);