]>
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"
28 var idc
= encodeURIComponent(id
);
29 var name
= package.name
;
30 var regarding
= encodeURIComponent("Cydia/APT: " + name
);
32 $("#icon").src("cydia://package-icon/" + idc
);
33 $("#reflection").src("cydia://package-icon/" + idc
);
35 $("#name").html(name
);
36 $("#latest").html(package.latest
);
38 $("#settings").href("cydia://package-settings/" + idc
);
40 var warnings
= package.warnings
;
41 var length
= warnings
== null ? 0 : warnings
.length
;
43 $(".warnings").remove();
45 var parent
= $("#warnings");
46 var child
= $("#warning");
49 for (var i
= 0; i
!= length
; ++i
) {
50 var clone
= child
.clone(true);
52 clone
.xpath("label").html($.xml(warnings
[i
]));
56 var applications
= package.applications
;
57 var length
= applications
== null ? 0 : applications
.length
;
59 var child
= $("#application");
63 var parent = $("#actions");
65 for (var i = 0; i != length; ++i) {
66 var application = applications[i];
67 var clone = child.clone(true);
69 clone.href("cydia://launch/" + application[0]);
70 clone.xpath("label").html("Run " + $.xml(application[1]));
71 clone.xpath("img").src(application[2]);
75 var purposes
= package.purposes
;
76 var commercial
= false;
79 for (var i
= 0, e
= purposes
.length
; i
!= e
; ++i
) {
80 var purpose
= purposes
[i
];
81 if (purpose
== "commercial")
83 else if (purpose
== "console")
87 $(".commercial").remove();
89 $(".console").remove();
91 var author
= package.author
;
93 $(".author").remove();
95 $("#author").html(author
.name
);
96 if (author
.address
== null)
97 $("#author-icon").remove();
99 $("#author-href").href("mailto:" + author
.address
+ "?subject=" + regarding
);
102 //$("#notice-src").src("http://saurik.cachefly.net/notice/" + idc + ".html");
104 var depiction
= package.depiction
;
105 if (depiction
== null)
106 $(".depiction").remove();
108 $(".description").display("none");
109 $("#depiction-src").src(depiction
);
112 var description
= package.description
;
113 if (description
== null)
114 description
= package.tagline
;
116 description
= description
.replace(/\n/g, "<br/>");
117 $("#description").html(description
);
119 var homepage
= package.homepage
;
120 if (homepage
== null)
121 $(".homepage").remove();
123 $("#homepage-href").href(homepage
);
125 var installed
= package.installed
;
126 if (installed
== null)
127 $(".installed").remove();
129 $("#installed").html(installed
);
130 $("#files-href").href("cydia://files/" + idc
);
135 var width
= nid
.width();
139 var spacing
= (max
- nid
.width()) / (id
.length
- 1) + "px";
140 nid
.css("letter-spacing", spacing
);
143 var section
= package.section
;
145 $(".section").remove();
147 $("#section-src").src("cydia://section-icon/" + encodeURIComponent(section
));
148 $("#section").html(section
);
151 var size
= package.size
;
155 $("#size").html(size
/ 1024 + " kB");
157 var maintainer
= package.maintainer
;
158 if (maintainer
== null)
159 $(".maintainer").remove();
161 $("#maintainer").html(maintainer
.name
);
162 if (maintainer
.address
== null)
163 $("#maintainer-icon").remove();
165 $("#maintainer-href").href("mailto:" + maintainer
.address
+ "?subject=" + regarding
);
168 var sponsor
= package.sponsor
;
170 $(".sponsor").remove();
172 $("#sponsor").html(sponsor
.name
);
173 $("#sponsor-href").href(sponsor
.address
);
176 var source
= package.source
;
177 if (source
== null) {
178 $(".source").remove();
179 $(".trusted").remove();
181 $("#source-name").html(source
.name
);
184 $("#trusted").href("cydia://package-signature/" + idc
);
186 $(".trusted").remove();
188 var description
= source
.description
;
189 if (description
== null)
190 $(".source-description").remove();
192 $("#source-description").html(description
);