}
};*/
+function space(selector, html, max) {
+ var node = $(selector);
+ node.html(html);
+ var width = node.width();
+ if (width > max) {
+ var spacing = (max - node.width()) / (html.length - 1) + "px";
+ console.log(width + " " + max + " " + spacing);
+ node.css("letter-spacing", spacing);
+ }
+}
+
$(function () {
var id = package.id;
var idc = encodeURIComponent(id);
var regarding = encodeURIComponent("Cydia/APT: " + name);
$("#icon").src("cydia://package-icon/" + idc);
+ $("#reflection").src("cydia://package-icon/" + idc);
+
$("#name").html(name);
- $("#latest").html(package.latest);
+ space("#latest", package.latest, 93);
+
+ var rating = package.rating;
+ if (rating == null)
+ $(".rating").remove();
+ else
+ $("#rating").src(rating);
+
+ $("#settings").href("cydia://package-settings/" + idc);
var warnings = package.warnings;
var length = warnings == null ? 0 : warnings.length;
var applications = package.applications;
var length = applications == null ? 0 : applications.length;
- if (length == 0)
- $(".applications").remove();
- else {
+
+ var child = $("#application");
+ child.remove();
+
+ /*if (length != 0) {
var parent = $("#actions");
- var child = $("#application");
- child.remove();
for (var i = 0; i != length; ++i) {
var application = applications[i];
clone.href("cydia://launch/" + application[0]);
clone.xpath("label").html("Run " + $.xml(application[1]));
clone.xpath("img").src(application[2]);
- console.log(0);
}
- }
+ }*/
+
+ var purposes = package.purposes;
+ var commercial = false;
+ var _console = false;
+ if (purposes != null)
+ for (var i = 0, e = purposes.length; i != e; ++i) {
+ var purpose = purposes[i];
+ if (purpose == "commercial")
+ commercial = true;
+ else if (purpose == "console")
+ _console = true;
+ }
+ if (!commercial)
+ $(".commercial").remove();
+ if (!_console)
+ $(".console").remove();
var author = package.author;
if (author == null)
$("#files-href").href("cydia://files/" + idc);
}
- $("#id").html(id);
+ space("#id", id, 238);
var section = package.section;
if (section == null)
$(".section").remove();
- else
- $("#section").html(package.section);
+ else {
+ $("#section-src").src("cydia://section-icon/" + encodeURIComponent(section));
+ $("#section").html(section);
+ }
var size = package.size;
if (size == 0)
$(".source").remove();
$(".trusted").remove();
} else {
+ var host = source.host;
+
+ $("#source-src").src("cydia://source-icon/" + encodeURIComponent(host));
$("#source-name").html(source.name);
- if (!source.trusted)
+ if (source.trusted)
+ $("#trusted").href("cydia://package-signature/" + idc);
+ else
$(".trusted").remove();
var description = source.description;