]> git.saurik.com Git - cydia.git/blob - Cydia.app/package.js
Forgot the Sponsor field.
[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 }
21 };*/
22
23 $(function () {
24 var id = package.id;
25 var name = package.name;
26 var regarding = encodeURIComponent("Cydia/APT: " + name);
27
28 $("#name").html(name);
29 $("#latest").html(package.latest);
30
31 var author = package.author;
32 if (author == null)
33 $(".author").remove();
34 else {
35 $("#author").html(author.name);
36 $("#author-link").href("mailto:" + author.address + "?subject=" + regarding);
37 }
38
39 var description = package.description;
40 if (description == null)
41 description = package.tagline;
42 else
43 description = description.replace(/\n/g, "<br/>");
44 $("#description").html(description);
45
46 var homepage = package.homepage;
47 if (homepage == null)
48 $(".homepage").remove();
49 else
50 $("#homepage-link").href(homepage);
51
52 var installed = package.installed;
53 if (installed == null)
54 $(".installed").remove();
55 else {
56 $("#installed").html(installed);
57 $("#files-link").href("cydia://files/" + id);
58 }
59
60 $("#id").html(id);
61
62 var section = package.section;
63 if (section == null)
64 $(".section").remove();
65 else
66 $("#section").html(package.section);
67
68 var size = package.size;
69 if (size == 0)
70 $(".size").remove();
71 else
72 $("#size").html(size / 1024 + " kB");
73
74 var maintainer = package.maintainer;
75 if (maintainer == null)
76 $(".maintainer").remove();
77 else {
78 $("#maintainer").html(maintainer.name);
79 $("#maintainer-link").href("mailto:" + maintainer.address + "?subject=" + regarding);
80 }
81
82 var sponsor = package.maintainer;
83 if (sponsor == null)
84 $(".sponsor").remove();
85 else {
86 $("#sponsor").html(sponsor.name);
87 $("#sponsor-link").href(sponsor.address);
88 }
89
90 var source = package.source;
91 if (source == null)
92 $(".source").remove();
93 else
94 $("#origin").html(source.name);
95 });