go.tools: sync play.js with go.talks

R=golang-dev
CC=golang-dev
https://golang.org/cl/14167044
This commit is contained in:
Andrew Gerrand 2013-10-01 10:43:07 +10:00
parent c92471fb85
commit c635598ddf
2 changed files with 14 additions and 12 deletions

View File

@ -13,14 +13,15 @@ function initPlayground(transport) {
var s = ""; var s = "";
for (var i = 0; i < node.childNodes.length; i++) { for (var i = 0; i < node.childNodes.length; i++) {
var n = node.childNodes[i]; var n = node.childNodes[i];
if (n.nodeType === 1 && n.tagName === "SPAN" && n.className != "number") { if (n.nodeType !== 1) continue;
var innerText = n.innerText === undefined ? "textContent" : "innerText"; if (n.tagName === "BUTTON") continue;
s += n[innerText] + "\n"; if (n.tagName === "SPAN" && n.className === "number") continue;
if (n.tagName === "PRE"){
s += text(n);
continue; continue;
} }
if (n.nodeType === 1 && n.tagName !== "BUTTON") { var innerText = n.innerText === undefined ? "textContent" : "innerText";
s += text(n); s += n[innerText] + "\n";
}
} }
return s; return s;
} }

View File

@ -847,14 +847,15 @@ function initPlayground(transport) {
var s = ""; var s = "";
for (var i = 0; i < node.childNodes.length; i++) { for (var i = 0; i < node.childNodes.length; i++) {
var n = node.childNodes[i]; var n = node.childNodes[i];
if (n.nodeType === 1 && n.tagName === "SPAN" && n.className != "number") { if (n.nodeType !== 1) continue;
var innerText = n.innerText === undefined ? "textContent" : "innerText"; if (n.tagName === "BUTTON") continue;
s += n[innerText] + "\n"; if (n.tagName === "SPAN" && n.className === "number") continue;
if (n.tagName === "PRE"){
s += text(n);
continue; continue;
} }
if (n.nodeType === 1 && n.tagName !== "BUTTON") { var innerText = n.innerText === undefined ? "textContent" : "innerText";
s += text(n); s += n[innerText] + "\n";
}
} }
return s; return s;
} }