summaryrefslogtreecommitdiff
path: root/Cydia.app/package.js
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2008-08-10 09:26:55 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 07:08:16 +0000
commit6f1a15d92e12b5b0269c978146ea85e4aef919d5 (patch)
tree0325d77a135ecb9bcd3483cc32fbc9d72dbe8264 /Cydia.app/package.js
parent98228790fa473d06469a8d6fee286f66786fadc1 (diff)
The Package Details screen is now pure HTML/JS.
Diffstat (limited to 'Cydia.app/package.js')
-rw-r--r--Cydia.app/package.js87
1 files changed, 87 insertions, 0 deletions
diff --git a/Cydia.app/package.js b/Cydia.app/package.js
new file mode 100644
index 0000000..63ba4d3
--- /dev/null
+++ b/Cydia.app/package.js
@@ -0,0 +1,87 @@
+/*var package = {
+ "name": "MobileTerminal",
+ "latest": "286u-5",
+ "author": {
+ "name": "Allen Porter",
+ "address": "allen.porter@gmail.com"
+ },
+ "description": "this is a sample description",
+ "homepage": "http://cydia.saurik.com/terminal.html",
+ "installed": "286u-4",
+ "id": "mobileterminal",
+ "section": "Terminal Support",
+ "size": 552*1024,
+ "maintainer": {
+ "name": "Jay Freeman",
+ "address": "saurik@saurik.com"
+ },
+ "source": {
+ "name": "Telesphoreo Tangelo"
+ }
+};*/
+
+$(function () {
+ var id = package.id;
+ var name = package.name;
+ var regarding = encodeURIComponent("Cydia/APT: " + name);
+
+ $("#name").html(name);
+ $("#latest").html(package.latest);
+
+ var author = package.author;
+ if (author == null)
+ $(".author").remove();
+ else {
+ $("#author").html(author.name);
+ $("#author-link").href("mailto:" + author.address + "?subject=" + regarding);
+ }
+
+ var description = package.description;
+ if (description == null)
+ description = package.tagline;
+ else
+ description = description.replace(/\n/g, "<br/>");
+ $("#description").html(description);
+
+ var homepage = package.homepage;
+ if (homepage == null)
+ $(".homepage").remove();
+ else
+ $("#homepage-link").href(homepage);
+
+ var installed = package.installed;
+ if (installed == null)
+ $(".installed").remove();
+ else {
+ $("#installed").html(installed);
+ $("#files-link").href("cydia://files/" + id);
+ }
+
+ $("#id").html(id);
+
+ var section = package.section;
+ if (section == null)
+ $(".section").remove();
+ else
+ $("#section").html(package.section);
+
+ var size = package.size;
+ if (size == 0)
+ $(".size").remove();
+ else
+ $("#size").html(size / 1024 + " kB");
+
+ var maintainer = package.maintainer;
+ if (maintainer == null)
+ $(".maintainer").remove();
+ else {
+ $("#maintainer").html(maintainer.name);
+ $("#maintainer-link").href("mailto:" + maintainer.address + "?subject=" + regarding);
+ }
+
+ var source = package.source;
+ if (source == null)
+ $(".source").remove();
+ else
+ $("#origin").html(source.name);
+});