summaryrefslogtreecommitdiff
path: root/Cydia.app/package.js
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2008-10-20 20:21:23 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 07:08:51 +0000
commit365d45da86873eab6dd3b3faebb54745e9eae7bb (patch)
treee05c513c8e3b9bf083f881f30124aca822b218e1 /Cydia.app/package.js
parentff0210e56e5eefeff6bfba03e5a07694e7aa0008 (diff)
Initial implementation of rating reports.
Diffstat (limited to 'Cydia.app/package.js')
-rw-r--r--Cydia.app/package.js25
1 files changed, 15 insertions, 10 deletions
diff --git a/Cydia.app/package.js b/Cydia.app/package.js
index 3117a57..cd1667e 100644
--- a/Cydia.app/package.js
+++ b/Cydia.app/package.js
@@ -23,6 +23,17 @@
}
};*/
+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);
@@ -33,7 +44,9 @@ $(function () {
$("#reflection").src("cydia://package-icon/" + idc);
$("#name").html(name);
- $("#latest").html(package.latest);
+ space("#latest", package.latest, 93);
+
+ $("#rating").src("http://cydia.saurik.com/test_.html");
$("#settings").href("cydia://package-settings/" + idc);
@@ -130,15 +143,7 @@ $(function () {
$("#files-href").href("cydia://files/" + idc);
}
- var nid = $("#id");
- nid.html(id);
- var width = nid.width();
-
- var max = 238.0;
- if (width > max) {
- var spacing = (max - nid.width()) / (id.length - 1) + "px";
- nid.css("letter-spacing", spacing);
- }
+ space("#id", id, 238);
var section = package.section;
if (section == null)