summaryrefslogtreecommitdiff
path: root/Cydia.app
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2008-08-19 11:24:01 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 07:08:24 +0000
commit7d2ac47f3369cf198f78970363f0f31bd3cd44ee (patch)
tree440a777ee279b5055ba4714942a1352217bf68f9 /Cydia.app
parenta954357579aa1fc2d03610d97d30a09156af7276 (diff)
Added custom depictions and better webview support.
Diffstat (limited to 'Cydia.app')
-rw-r--r--Cydia.app/menes/menes.js16
-rw-r--r--Cydia.app/menes/style.css8
-rw-r--r--Cydia.app/package.html79
-rw-r--r--Cydia.app/package.js30
4 files changed, 111 insertions, 22 deletions
diff --git a/Cydia.app/menes/menes.js b/Cydia.app/menes/menes.js
index 64ec5d0..f0070bc 100644
--- a/Cydia.app/menes/menes.js
+++ b/Cydia.app/menes/menes.js
@@ -27,9 +27,10 @@ var $ = function (arg, doc) {
if (arg.charAt(0) == '#') {
var node = doc.getElementById(arg.substring(1));
return $(node == null ? [] : [node]);
- } else if (arg.charAt(0) == '.')
- return new $(doc.getElementsByClassName(arg.substring(1)));
- else
+ } else if (arg.charAt(0) == '.') {
+ var nodes = doc.getElementsByClassName(arg.substring(1));
+ return $(nodes == null ? [] : nodes);
+ } else
return $([doc]).descendants(arg);
} else {
_assert(doc == undefined);
@@ -184,6 +185,15 @@ $.inject = function (a, b) {
};
$.inject({
+ display: {
+ get: function (node) {
+ return node.style.display;
+ },
+ set: function (node, value) {
+ node.style.display = value;
+ }
+ },
+
html: {
get: function (node) {
return node.innerHTML;
diff --git a/Cydia.app/menes/style.css b/Cydia.app/menes/style.css
index ffae721..e5e2264 100644
--- a/Cydia.app/menes/style.css
+++ b/Cydia.app/menes/style.css
@@ -44,7 +44,7 @@ body {
}
hr {
- margin-top: 10px;
+ margin: 0;
}
.dialog > .panel {
@@ -155,7 +155,7 @@ strong {
}
.dialog > .panel > fieldset > div > p {
- margin-top: .5em;
+ margin: 11px 0;
text-align: center;
}
@@ -163,6 +163,10 @@ strong {
margin-top: 0;
}
+.dialog > .panel > fieldset > div > p:last-child {
+ margin-bottom: 0;
+}
+
.dialog > .panel > fieldset > a {
background: 275px 11px no-repeat url(listArrow.png);
color: inherit;
diff --git a/Cydia.app/package.html b/Cydia.app/package.html
index c545802..c5acc6a 100644
--- a/Cydia.app/package.html
+++ b/Cydia.app/package.html
@@ -7,6 +7,61 @@
<script type="text/javascript" src="menes/menes.js"></script>
<script type="text/javascript" src="package.js"></script>
<base target="_blank"/>
+
+ <script type="text/javascript">
+ var count = -1;
+ var loaded = function() {
+ if (count++ != 0)
+ return;
+ $("#depiction-load").remove();
+ $.each($("#depiction-src"), function (node) {
+ node.style.display = "block";
+ });
+ }
+
+ var remove = function() {
+ $(".description").display("block");
+ $(".depiction").remove();
+ }
+ </script>
+
+ <style>
+ body {
+ background: #c8c8c8 url(menes/pinstripes.png);
+ }
+
+ #remove {
+ margin-top: 7px;
+ text-align: center;
+ }
+
+ #indicator {
+ left: 20px;
+ position: relative;
+ top: -5px;
+ }
+
+ #notice {
+ margin-bottom: -14px;
+ overflow: hidden;
+ width: 320px;
+ }
+
+ #remove > a {
+ color: #335588;
+ text-decoration: none;
+ }
+
+ #upper-bar {
+ margin-bottom: 0;
+ margin-top: 10px;
+ }
+
+ #lower-bar {
+ margin-bottom: 10px;
+ margin-top: 0;
+ }
+ </style>
</head><body><div class="page">
<div class="dialog">
<div class="panel">
@@ -23,17 +78,35 @@
</a>
</fieldset>
+<div id="notice" class="notice"><iframe
+ id="notice-src"
+ frameborder="0"
+ width="320"
+ height="0"
+ target="_top"
+></iframe></div>
+
+<div id="remove" class="depiction">
+ <a href="javascript:remove()">Remove Custom Depiction</a>
+</div>
+
+<hr id="upper-bar" class="depiction"/>
+
<div style="width: 320px; overflow: hidden" class="depiction"><iframe
id="depiction-src"
frameborder="0"
- width="300"
+ width="320"
+ height="0"
target="_top"
+ onLoad="loaded()"
></iframe></div>
+<hr id="lower-bar" class="depiction"/>
+
<fieldset class="description">
<div id="description"></div>
- <a id="homepage-href">
+ <a class="homepage" id="homepage-href">
<label>More Information</label>
</a>
</fieldset>
@@ -85,7 +158,7 @@
<label class="source">Source Infomation</label>
<fieldset class="source">
<div><label id="source-name"></label></div>
- <div id="source-description"></div>
+ <div class="source-description" id="source-description"></div>
</fieldset>
</div>
diff --git a/Cydia.app/package.js b/Cydia.app/package.js
index aec8141..0dfa6dc 100644
--- a/Cydia.app/package.js
+++ b/Cydia.app/package.js
@@ -5,10 +5,10 @@
"name": "Allen Porter",
"address": "allen.porter@gmail.com"
},
- "depiction": "http://planet-iphones.com/repository/info/chromium1.3.php",
+ //"depiction": "http://planet-iphones.com/repository/info/chromium1.3.php",
+ "depiction": "http://cydia.saurik.com/terminal.html",
"description": "this is a sample description",
- //"homepage": "http://cydia.saurik.com/terminal.html",
- "homepage": "http://planet-iphones.com/repository/info/chromium1.3.php",
+ "homepage": "http://cydia.saurik.com/terminal.html",
"installed": "286u-4",
"id": "mobileterminal",
"section": "Terminal Support",
@@ -39,21 +39,23 @@ $(function () {
$("#author-href").href("mailto:" + author.address + "?subject=" + regarding);
}
+ $("#notice-src").src("http://cydia.saurik.com/notice/" + encodeURIComponent(id) + ".html");
+
var depiction = package.depiction;
- if (depiction != null) {
- $(".description").remove();
- $("#depiction-src").src(depiction);
- } else {
+ if (depiction == null)
$(".depiction").remove();
-
- var description = package.description;
- if (description == null)
- description = package.tagline;
- else
- description = description.replace(/\n/g, "<br/>");
- $("#description").html(description);
+ else {
+ $(".description").display("none");
+ $("#depiction-src").src(depiction);
}
+ var description = package.description;
+ if (description == null)
+ description = package.tagline;
+ else
+ description = description.replace(/\n/g, "<br/>");
+ $("#description").html(description);
+
var homepage = package.homepage;
if (homepage == null)
$(".homepage").remove();