UI tweaks

This commit is contained in:
Brad Fitzpatrick 2011-06-04 10:58:13 -07:00
parent 1ed6a4a50c
commit b02806c301
3 changed files with 15 additions and 9 deletions

View File

@ -7,11 +7,13 @@
</head>
<body>
<h1>Blob Contents</h1>
<div id="blobdownload"></div>
<span id="editspan" style="display: none;">[<a href="#" id="editlink">edit</a>]</span>
<span id="blobdownload"></span>
<pre id="blobdata" style="overflow: auto; max-width: 800px"></pre>
<h1>Indexer Metadata</h1>
<pre id="blobpre"></pre>
<pre id="blobmeta"></pre>
<div id="claimsdiv" style='visibility: hidden'>
<h1>Mutation Claims</h1>

View File

@ -21,7 +21,7 @@ function getBlobParam() {
}
function blobInfoUpdate(bmap) {
var blobpre = document.getElementById('blobpre');
var blobmeta = document.getElementById('blobmeta');
var bd = document.getElementById("blobdownload")
bd.innerHTML = "";
var blobref = getBlobParam();
@ -31,10 +31,10 @@ function blobInfoUpdate(bmap) {
}
var binfo = bmap[blobref];
if (!binfo) {
blobpre.innerHTML = "(not found)";
blobmeta.innerHTML = "(not found)";
return;
}
blobpre.innerHTML = JSON.stringify(binfo, null, 2);
blobmeta.innerHTML = JSON.stringify(binfo, null, 2);
if (binfo.camliType || (binfo.type && binfo.type.indexOf("text/") == 0)) {
camliGetBlobContents(
blobref,
@ -48,7 +48,7 @@ function blobInfoUpdate(bmap) {
var fileName = finfo.fileName || blobref;
bd.firstChild.href = "./download/" + blobref + "/" + fileName;
bd.firstChild.innerText = fileName;
bd.innerHTML = "Download: " + bd.innerHTML;
bd.innerHTML = "[download: " + bd.innerHTML + "]";
} catch (x) {
}
}
@ -58,9 +58,12 @@ function blobInfoUpdate(bmap) {
} else {
document.getElementById("blobdata").innerHTML = "<i>Unknown/binary data</i>";
}
bd.innerHTML = "<a href='" + camliBlobURL(blobref) + "'>download</a>";
bd.innerHTML = "[<a href='" + camliBlobURL(blobref) + "'>download blob</a>]";
if (binfo.camliType && binfo.camliType == "permanode") {
document.getElementById("editspan").style.display = "inline";
document.getElementById("editlink").href = "./?p=" + blobref;
var claims = document.getElementById("claimsdiv");
claims.style.visibility = "";
camliGetPermanodeClaims(
@ -82,8 +85,8 @@ function blobInfoOnLoad() {
if (!blobref) {
return
}
var blobpre = document.getElementById('blobpre');
blobpre.innerText = "(loading)";
var blobmeta = document.getElementById('blobmeta');
blobmeta.innerText = "(loading)";
camliDescribeBlob(
blobref,
{

View File

@ -12,3 +12,4 @@ function search() {
xhr.send();
}
window.addEventListener("load", search);