]> git.saurik.com Git - cydia.git/blobdiff - Cydia.app/confirm.js
Fixed memory retain issue in _H<> and a crash bug in sources_ (causing nils).
[cydia.git] / Cydia.app / confirm.js
index 579c3f5fef442c026032ab34f6ab8a5da7ee1b6c..bd78c2e5da8022c714853809218b3ed5c1927a42 100644 (file)
@@ -1,35 +1,61 @@
 $(function () {
-    var downloading = sizes[0];
-    if (downloading == "0.0B")
-        $(".downloading").remove();
-    else
-        $("#downloading").html($.xml(downloading));
+    if (issues == null) {
+        $(".issues").remove();
 
-    var resuming = sizes[1];
-    if (resuming == "0.0B")
-        $(".resuming").remove();
-    else
+        var downloading = sizes[0];
+        if (downloading == "0.0 B")
+            $(".downloading").remove();
+        else
+        $("#downloading").html($.xml(downloading));
+    
+        var resuming = sizes[1];
+        if (resuming == "0.0 B")
+            $(".resuming").remove();
+        else
         $("#resuming").html($.xml(resuming));
 
-    var size = sizes[2];
-    var negative;
+        var size = sizes[2];
+        var negative;
 
-    if (size.charAt(0) != '-')
-        negative = false;
-    else {
-        negative = true;
-        size = size.substr(1);
-    }
+        if (size.charAt(0) != '-')
+            negative = false;
+        else {
+            negative = true;
+            size = size.substr(1);
+        }
+
+        $("#disk-key").html(cydia.localize(negative ? "DISK_FREEING" : "DISK_USING"));
+        $("#disk-value").html($.xml(size));
+    } else for (var i = 0; i != issues.length; ++i) {
+        document.title = cydia.localize("CANNOT_COMPLY");
 
-    $("#disk-key").html(negative ? "Disk Freeing" : "Disk Using");
-    $("#disk-value").html($.xml(size));
+        $("._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";
+            $("#i" + i).append("<div class=\"clearfix\"><div>" +
+                "<label>" + $.xml(type) + "</label>" +
+                "<label>" + $.xml(entry[1] + " " + entry[3]) + "</label>" +
+            "</div></div>");
+        }
+    }
 
     var keys = [
-        "Install",
-        "Reinstall",
-        "Upgrade",
-        "Downgrade",
-        "Remove"
+        "INSTALL",
+        "REINSTALL",
+        "UPGRADE",
+        "DOWNGRADE",
+        "REMOVE"
     ];
 
     for (var i = 0; i != 5; ++i) {
@@ -37,10 +63,10 @@ $(function () {
         var length = list.length;
 
         if (length != 0) {
-            $("#modifications").append("<div>" +
-                "<label>" + keys[i] + "</label>" +
-                "<div id=\"i" + i + "\"></div>" +
-            "</div>");
+            $("#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) {
@@ -49,7 +75,7 @@ $(function () {
                 value += $.xml(list[j]);
             }
 
-            $("#i" + i).html(value);
+            $("#c" + i).html(value);
         }
     }
 });