]> git.saurik.com Git - cydia.git/blobdiff - Cydia.app/package.js
I hate subtle issues.
[cydia.git] / Cydia.app / package.js
index de1343c60b08b11913f8903eec5fd4ad373b2455..200be8bb702d7f9fa452bbc5125bddf3ed9eda5f 100644 (file)
@@ -63,33 +63,37 @@ $(function () {
     $("#name").html(name);
     space("#latest", package.latest, 96);
 
-    $.xhr(api + 'package/' + idc, 'GET', {}, null, {
+    $.xhr(cache(api + 'package/' + idc), 'GET', {}, null, {
         success: function (value) {
             value = eval(value);
 
-            $("#rating-load").remove();
+            if (typeof value.rating == "undefined")
+                $(".rating").remove();
+            else {
+                $("#rating-load").remove();
+                $("#rating-href").href(value.reviews);
 
-            var href = $("#rating-href");
-            href.href(value.reviews);
+                var none = $("#rating-none");
+                var done = $("#rating-done");
 
-            var none = $("#rating-none");
-            var done = $("#rating-done");
+                if (value.rating == null) {
+                    done.remove();
+                    none.css("display", "block");
+                } else {
+                    none.remove();
+                    done.css("display", "block");
 
-            if (value.rating == null) {
-                done.remove();
-                none.css("display", "block");
-            } else {
-                none.remove();
-                done.css("display", "block");
-
-                $("#rating-value").css('width', 16 * value.rating);
+                    $("#rating-value").css('width', 16 * value.rating);
+                }
             }
 
             if (typeof value.icon != "undefined" && value.icon != null) {
                 var icon = $("#icon");
                 var thumb = $("#thumb");
+
                 icon[0].className = 'flip-180';
                 thumb[0].className = 'flip-360';
+
                 thumb.css("background-image", 'url("' + value.icon + '")');
 
                 setTimeout(function () {
@@ -141,19 +145,11 @@ $(function () {
         }
     }*/
 
-    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;
-        }
+    var commercial = package.hasTag('cydia::commercial');
     if (!commercial)
         $(".commercial").remove();
+
+    var _console = package.hasTag('purpose::console');
     if (!_console)
         $(".console").remove();
 
@@ -170,6 +166,14 @@ $(function () {
 
     //$("#notice-src").src("http://saurik.cachefly.net/notice/" + idc + ".html");
 
+    /*var store = commercial;
+    if (!store)
+        $(".activation").remove();
+    else {
+        var activation = api + 'activation/' + idc;
+        $("#activation-src").src(activation);
+    }*/
+
     var depiction = package.depiction;
     if (depiction == null)
         $(".depiction").remove();