]> git.saurik.com Git - cydia.git/blob - Cydia.app/package.js
Themes, automagic SpringBoard, and source data fixes.
[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 "description": "this is a sample description",
9 "homepage": "http://cydia.saurik.com/terminal.html",
10 "installed": "286u-4",
11 "id": "mobileterminal",
12 "section": "Terminal Support",
13 "size": 552*1024,
14 "maintainer": {
15 "name": "Jay Freeman",
16 "address": "saurik@saurik.com"
17 },
18 "source": {
19 "name": "Telesphoreo Tangelo",
20 "description": "Distribution of Unix Software for the iPhone"
21 }
22 };*/
23
24 $(function () {
25 var id = package.id;
26 var name = package.name;
27 var regarding = encodeURIComponent("Cydia/APT: " + name);
28
29 $("#name").html(name);
30 $("#latest").html(package.latest);
31
32 var author = package.author;
33 if (author == null)
34 $(".author").remove();
35 else {
36 $("#author").html(author.name);
37 $("#author-link").href("mailto:" + author.address + "?subject=" + regarding);
38 }
39
40 var description = package.description;
41 if (description == null)
42 description = package.tagline;
43 else
44 description = description.replace(/\n/g, "<br/>");
45 $("#description").html(description);
46
47 var homepage = package.homepage;
48 if (homepage == null)
49 $(".homepage").remove();
50 else
51 $("#homepage-link").href(homepage);
52
53 var installed = package.installed;
54 if (installed == null)
55 $(".installed").remove();
56 else {
57 $("#installed").html(installed);
58 $("#files-link").href("cydia://files/" + id);
59 }
60
61 $("#id").html(id);
62
63 var section = package.section;
64 if (section == null)
65 $(".section").remove();
66 else
67 $("#section").html(package.section);
68
69 var size = package.size;
70 if (size == 0)
71 $(".size").remove();
72 else
73 $("#size").html(size / 1024 + " kB");
74
75 var maintainer = package.maintainer;
76 if (maintainer == null)
77 $(".maintainer").remove();
78 else {
79 $("#maintainer").html(maintainer.name);
80 $("#maintainer-link").href("mailto:" + maintainer.address + "?subject=" + regarding);
81 }
82
83 var sponsor = package.sponsor;
84 if (sponsor == null)
85 $(".sponsor").remove();
86 else {
87 $("#sponsor").html(sponsor.name);
88 $("#sponsor-link").href(sponsor.address);
89 }
90
91 var source = package.source;
92 if (source == null)
93 $(".source").remove();
94 else {
95 $("#source-name").html(source.name);
96
97 var description = source.description;
98 if (description == null)
99 $(".source-description").remove();
100 else
101 $("#source-description").html(description);
102 }
103 });