-
Notifications
You must be signed in to change notification settings - Fork 4
/
code-min.js
7 lines (7 loc) · 1.9 KB
/
code-min.js
1
2
3
4
5
6
7
function listEntries(a) { removeOldResults(); var b = document.createElement("dl"); b.setAttribute("id", "output"); for (var e = 0; e < a.feed.entry.length; e++) { var c = a.feed.entry[e], g = document.createElement("dt"), d = document.createTextNode(c.title.$t); g.appendChild(d); d = document.createElement("dd"); c = document.createTextNode(c.content.$t); d.appendChild(c); b.appendChild(g); b.appendChild(d) } document.getElementById("data").appendChild(b) }
function cellEntries(a) {
removeOldResults(); var b = document.createElement("table"); b.setAttribute("id", "output"); for (var e = document.createElement("tbody"), c, g = 0; g < a.feed.entry.length; g++) { var d = a.feed.entry[g], f = d.gs$cell.col; if (f == 2 || f == 3 || f == 6 || f == 7) d.gs$cell.col == "2" && (c != null && e.appendChild(c), c = document.createElement("tr")), f = document.createElement("td"), f.appendChild(document.createTextNode(d.content.$t)), c.appendChild(f) } e.appendChild(c); b.appendChild(e); document.getElementById("data").appendChild(b);
$("#output tr:first").addClass("Hig"); $("#output tr:first td:first").css("width", "200px")
}
function displayResults() { removeOldJSONScriptNodes(); removeOldResults(); var a = document.getElementById("data"), b = document.createElement("p"); b.appendChild(document.createTextNode("Loading...")); a.appendChild(b); a = document.createElement("script"); a.setAttribute("src", "http://spreadsheets.google.com/feeds/cells/0Amb0BYy0MWESdHd6Uy04QVR1bnJYWkxqcV9xNE5TaGc/oD6/public/values?alt=json-in-script&callback=cellEntries"); a.setAttribute("id", "jsonScript"); a.setAttribute("type", "text/javascript"); document.documentElement.firstChild.appendChild(a) }
function removeOldJSONScriptNodes() { var a = document.getElementById("jsonScript"); a && a.parentNode.removeChild(a) } function removeOldResults() { var a = document.getElementById("data"); a.firstChild && a.removeChild(a.firstChild) };