]> git.saurik.com Git - cydia.git/blame - Cydia.app/package.js
Porting, webkit stability.
[cydia.git] / Cydia.app / package.js
CommitLineData
ad554f10
JF
1/*var package = {
2 "name": "MobileTerminal",
3 "latest": "286u-5",
4 "author": {
5 "name": "Allen Porter",
6 "address": "allen.porter@gmail.com"
7 },
853d14d3
JF
8 //"depiction": "http://planet-iphones.com/repository/info/chromium1.3.php",
9 "depiction": "http://cydia.saurik.com/terminal.html",
ad554f10 10 "description": "this is a sample description",
853d14d3 11 "homepage": "http://cydia.saurik.com/terminal.html",
ad554f10
JF
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": {
1eb0c554
JF
21 "name": "Telesphoreo Tangelo",
22 "description": "Distribution of Unix Software for the iPhone"
ad554f10
JF
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);
0235116c 39 $("#author-href").href("mailto:" + author.address + "?subject=" + regarding);
ad554f10
JF
40 }
41
87c76914 42 //$("#notice-src").src("http://saurik.cachefly.net/notice/" + encodeURIComponent(id) + ".html");
853d14d3 43
0235116c 44 var depiction = package.depiction;
853d14d3 45 if (depiction == null)
0235116c 46 $(".depiction").remove();
853d14d3
JF
47 else {
48 $(".description").display("none");
49 $("#depiction-src").src(depiction);
0235116c 50 }
ad554f10 51
853d14d3
JF
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
ad554f10
JF
59 var homepage = package.homepage;
60 if (homepage == null)
61 $(".homepage").remove();
62 else
0235116c 63 $("#homepage-href").href(homepage);
ad554f10
JF
64
65 var installed = package.installed;
66 if (installed == null)
67 $(".installed").remove();
68 else {
69 $("#installed").html(installed);
0235116c 70 $("#files-href").href("cydia://files/" + id);
ad554f10
JF
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);
0235116c 92 $("#maintainer-href").href("mailto:" + maintainer.address + "?subject=" + regarding);
ad554f10
JF
93 }
94
1eb0c554 95 var sponsor = package.sponsor;
6bffd7b7
JF
96 if (sponsor == null)
97 $(".sponsor").remove();
98 else {
99 $("#sponsor").html(sponsor.name);
0235116c 100 $("#sponsor-href").href(sponsor.address);
6bffd7b7
JF
101 }
102
ad554f10 103 var source = package.source;
0235116c 104 if (source == null) {
ad554f10 105 $(".source").remove();
0235116c
JF
106 $(".trusted").remove();
107 } else {
1eb0c554
JF
108 $("#source-name").html(source.name);
109
0235116c
JF
110 if (!source.trusted)
111 $(".trusted").remove();
112
1eb0c554
JF
113 var description = source.description;
114 if (description == null)
115 $(".source-description").remove();
116 else
117 $("#source-description").html(description);
118 }
ad554f10 119});