]> git.saurik.com Git - cydia.git/blob - Cydia.app/confirm.js
9210295d033072a0adc60ffd706dac7b6bc604e5
[cydia.git] / Cydia.app / confirm.js
1 $(function () {
2 if (issues == null) {
3 $(".issues").remove();
4
5 var downloading = sizes[0];
6 if (downloading == "0.0 B")
7 $(".downloading").remove();
8 else
9 $("#downloading").html($.xml(downloading));
10
11 var resuming = sizes[1];
12 if (resuming == "0.0 B")
13 $(".resuming").remove();
14 else
15 $("#resuming").html($.xml(resuming));
16
17 var size = sizes[2];
18 var negative;
19
20 if (size.charAt(0) != '-')
21 negative = false;
22 else {
23 negative = true;
24 size = size.substr(1);
25 }
26
27 $("#disk-key").html(negative ? "Disk Freeing" : "Disk Using");
28 $("#disk-value").html($.xml(size));
29 } else for (var i = 0; i != issues.length; ++i) {
30 $("._issues").remove();
31
32 var issue = issues[i];
33
34 $("#issues").append(
35 "<label style=\"color: #704d4d\">" + issue[0] + "</label>" +
36 "<fieldset style=\"background-color: #dddddd\" class=\"clearfix\" id=\"i" + i + "\"></fieldset>"
37 );
38
39 for (var j = 1; j != issue.length; ++j) {
40 var entry = issue[j];
41 var type = entry[0];
42 if (type == "PreDepends")
43 type = "Depends";
44 $("#i" + i).append("<div>" +
45 "<label>" + type + "</label>" +
46 "<div>" + entry[1] + " " + entry[3] + "</div>" +
47 "</div>");
48 }
49 }
50
51 var keys = [
52 "Install",
53 "Reinstall",
54 "Upgrade",
55 "Downgrade",
56 "Remove"
57 ];
58
59 for (var i = 0; i != 5; ++i) {
60 var list = changes[i];
61 var length = list.length;
62
63 if (length != 0) {
64 $("#modifications").append("<div class=\"clearfix\">" +
65 "<label>" + keys[i] + "</label>" +
66 "<div id=\"c" + i + "\"></div>" +
67 "</div>");
68
69 var value = "";
70 for (var j = 0; j != length; ++j) {
71 if (j != 0)
72 value += "<br/>";
73 value += $.xml(list[j]);
74 }
75
76 $("#c" + i).html(value);
77 }
78 }
79 });