]> git.saurik.com Git - cydia.git/blob - Cydia.app/package.js
Moved /notice/ to somewhere with more bandwidth, fixed a typo in Information, updated...
[cydia.git] / Cydia.app / package.js
1 /*var package = {
2 "name": "MobileTerminal",
3 "latest": "286u-5",
4 "author": {
5 "name": "Allen Porter",
6 "address": "allen.porter@gmail.com"
7 },
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",
15 "size": 552*1024,
16 "maintainer": {
17 "name": "Jay Freeman",
18 "address": "saurik@saurik.com"
19 },
20 "source": {
21 "name": "Telesphoreo Tangelo",
22 "description": "Distribution of Unix Software for the iPhone"
23 }
24 };*/
25
26 $(function () {
27 var id = package.id;
28 var name = package.name;
29 var regarding = encodeURIComponent("Cydia/APT: " + name);
30
31 $("#name").html(name);
32 $("#latest").html(package.latest);
33
34 var author = package.author;
35 if (author == null)
36 $(".author").remove();
37 else {
38 $("#author").html(author.name);
39 $("#author-href").href("mailto:" + author.address + "?subject=" + regarding);
40 }
41
42 $("#notice-src").src("http://apt.saurik.com/notice/" + encodeURIComponent(id) + ".html");
43
44 var depiction = package.depiction;
45 if (depiction == null)
46 $(".depiction").remove();
47 else {
48 $(".description").display("none");
49 $("#depiction-src").src(depiction);
50 }
51
52 var description = package.description;
53 if (description == null)
54 description = package.tagline;
55 else
56 description = description.replace(/\n/g, "<br/>");
57 $("#description").html(description);
58
59 var homepage = package.homepage;
60 if (homepage == null)
61 $(".homepage").remove();
62 else
63 $("#homepage-href").href(homepage);
64
65 var installed = package.installed;
66 if (installed == null)
67 $(".installed").remove();
68 else {
69 $("#installed").html(installed);
70 $("#files-href").href("cydia://files/" + id);
71 }
72
73 $("#id").html(id);
74
75 var section = package.section;
76 if (section == null)
77 $(".section").remove();
78 else
79 $("#section").html(package.section);
80
81 var size = package.size;
82 if (size == 0)
83 $(".size").remove();
84 else
85 $("#size").html(size / 1024 + " kB");
86
87 var maintainer = package.maintainer;
88 if (maintainer == null)
89 $(".maintainer").remove();
90 else {
91 $("#maintainer").html(maintainer.name);
92 $("#maintainer-href").href("mailto:" + maintainer.address + "?subject=" + regarding);
93 }
94
95 var sponsor = package.sponsor;
96 if (sponsor == null)
97 $(".sponsor").remove();
98 else {
99 $("#sponsor").html(sponsor.name);
100 $("#sponsor-href").href(sponsor.address);
101 }
102
103 var source = package.source;
104 if (source == null) {
105 $(".source").remove();
106 $(".trusted").remove();
107 } else {
108 $("#source-name").html(source.name);
109
110 if (!source.trusted)
111 $(".trusted").remove();
112
113 var description = source.description;
114 if (description == null)
115 $(".source-description").remove();
116 else
117 $("#source-description").html(description);
118 }
119 });