summaryrefslogtreecommitdiff
path: root/MobileCydia.app/confirm.js
blob: 4c74b43cb93e282e267175e22ca353275bb4fda3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
$(function () {
    if (issues == null) {
        $(".issues").remove();
        var removed = 0;

        var downloading = sizes[0];
        if (downloading == "0.0 B") {
            $(".downloading").remove();
            removed += 1;
        } else {
            $("#downloading").html($.xml(downloading));
        }

        var resuming = sizes[1];
        if (resuming == "0.0 B") {
            $(".resuming").remove();
            removed += 1;
        } else {
            $("#resuming").html($.xml(resuming));
        }

        if (removed >= 2) $(".statistics").remove();
    } else for (var i = 0; i != issues.length; ++i) {
        document.title = cydia.localize("CANNOT_COMPLY");

        $(".queue").remove();

        $("._issues").remove();

        var issue = issues[i];

        $("#issues").append(
            "<label style=\"color: #704d4d\">" + $.xml(issue[0]) + "</label>" +
            "<fieldset style=\"background-color: #dddddd\" class=\"clearfix\" id=\"i" + i + "\"></fieldset>"
        );

        for (var j = 1; j != issue.length; ++j) {
            var entry = issue[j];
            var type = entry[0];
            if (type == "PreDepends")
                type = "Depends";
            var version = entry[1];
            if (entry.length >= 4)
                version += " " + entry[3];
            $("#i" + i).append("<div class=\"clearfix\"><div>" +
                "<label>" + $.xml(type) + "</label>" +
                "<label>" + $.xml(version) + "</label>" +
            "</div></div>");
        }
    }

    var keys = [
        "INSTALL",
        "REINSTALL",
        "UPGRADE",
        "DOWNGRADE",
        "REMOVE"
    ];

    for (var i = 0; i != 5; ++i) {
        var list = changes[i];
        var length = list.length;

        if (length != 0) {
            $("#modifications").append("<div class=\"clearfix\"><div>" +
                "<label>" + cydia.localize($.xml(keys[i])) + "</label>" +
                "<label id=\"c" + i + "\"></label>" +
            "</div></div>");

            var value = "";
            for (var j = 0; j != length; ++j) {
                if (j != 0)
                    value += "<br/>";
                value += $.xml(list[j]);
            }

            $("#c" + i).html(value);
        }
    }
});