summaryrefslogtreecommitdiff
path: root/Cydia.app/package.js
diff options
context:
space:
mode:
Diffstat (limited to 'Cydia.app/package.js')
-rw-r--r--Cydia.app/package.js52
1 files changed, 48 insertions, 4 deletions
diff --git a/Cydia.app/package.js b/Cydia.app/package.js
index 480ec01..52025a9 100644
--- a/Cydia.app/package.js
+++ b/Cydia.app/package.js
@@ -25,21 +25,62 @@
$(function () {
var id = package.id;
+ var idc = encodeURIComponent(id);
var name = package.name;
var regarding = encodeURIComponent("Cydia/APT: " + name);
+ $("#icon").src("cydia://package-icon/" + idc);
$("#name").html(name);
$("#latest").html(package.latest);
+ var warnings = package.warnings;
+ var length = warnings == null ? 0 : warnings.length;
+ if (length == 0)
+ $(".warnings").remove();
+ else {
+ var parent = $("#warnings");
+ var child = $("#warning");
+ child.remove();
+
+ for (var i = 0; i != length; ++i) {
+ var clone = child.clone(true);
+ parent.append(clone);
+ clone.xpath("label").html($.xml(warnings[i]));
+ }
+ }
+
+ var applications = package.applications;
+ var length = applications == null ? 0 : applications.length;
+ if (length == 0)
+ $(".applications").remove();
+ else {
+ var parent = $("#actions");
+ var child = $("#application");
+ child.remove();
+
+ for (var i = 0; i != length; ++i) {
+ var application = applications[i];
+ var clone = child.clone(true);
+ parent.append(clone);
+ clone.href("cydia://launch/" + application[0]);
+ clone.xpath("label").html("Run " + $.xml(application[1]));
+ clone.xpath("img").src(application[2]);
+ console.log(0);
+ }
+ }
+
var author = package.author;
if (author == null)
$(".author").remove();
else {
$("#author").html(author.name);
- $("#author-href").href("mailto:" + author.address + "?subject=" + regarding);
+ if (author.address == null)
+ $("#author-icon").remove();
+ else
+ $("#author-href").href("mailto:" + author.address + "?subject=" + regarding);
}
- //$("#notice-src").src("http://saurik.cachefly.net/notice/" + encodeURIComponent(id) + ".html");
+ //$("#notice-src").src("http://saurik.cachefly.net/notice/" + idc + ".html");
var depiction = package.depiction;
if (depiction == null)
@@ -67,7 +108,7 @@ $(function () {
$(".installed").remove();
else {
$("#installed").html(installed);
- $("#files-href").href("cydia://files/" + id);
+ $("#files-href").href("cydia://files/" + idc);
}
$("#id").html(id);
@@ -89,7 +130,10 @@ $(function () {
$(".maintainer").remove();
else {
$("#maintainer").html(maintainer.name);
- $("#maintainer-href").href("mailto:" + maintainer.address + "?subject=" + regarding);
+ if (maintainer.address == null)
+ $("#maintainer-icon").remove();
+ else
+ $("#maintainer-href").href("mailto:" + maintainer.address + "?subject=" + regarding);
}
var sponsor = package.sponsor;