LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 (function() { | 5 (function() { |
6 "use strict"; | 6 "use strict"; |
7 | 7 |
8 var runFunc; | 8 var runFunc; |
9 var count = 0; | 9 var count = 0; |
10 | 10 |
11 function getId() { | 11 function getId() { |
12 return "code" + (count++); | 12 return "code" + (count++); |
13 } | 13 } |
14 | 14 |
15 function text(node) { | 15 function text(node) { |
16 var s = ""; | 16 var s = ""; |
17 for (var i = 0; i < node.childNodes.length; i++) { | 17 for (var i = 0; i < node.childNodes.length; i++) { |
18 var n = node.childNodes[i]; | 18 var n = node.childNodes[i]; |
19 if (n.nodeType === 1 && n.tagName === "PRE") { | 19 if (n.nodeType === 1 && n.tagName === "SPAN" && n.className != "number") { |
20 var innerText = n.innerText === undefined ? "textContent" : "innerText"; | 20 var innerText = n.innerText === undefined ? "textContent" : "innerText"; |
21 s += n[innerText] + "\n"; | 21 s += n[innerText] + "\n"; |
22 continue; | 22 continue; |
23 } | 23 } |
24 if (n.nodeType === 1 && n.tagName !== "BUTTON") { | 24 if (n.nodeType === 1 && n.tagName !== "BUTTON") { |
25 s += text(n); | 25 s += text(n); |
26 } | 26 } |
27 } | 27 } |
28 return s; | 28 return s; |
29 } | 29 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 if (play.length > 0) { | 107 if (play.length > 0) { |
108 if (window.connectPlayground) { | 108 if (window.connectPlayground) { |
109 runFunc = window.connectPlayground("ws://" + window.location.host + "/sock
et"); | 109 runFunc = window.connectPlayground("ws://" + window.location.host + "/sock
et"); |
110 } else { | 110 } else { |
111 // If this message is logged, | 111 // If this message is logged, |
112 // we have neglected to include socket.js or playground.js. | 112 // we have neglected to include socket.js or playground.js. |
113 console.log("No playground transport available."); | 113 console.log("No playground transport available."); |
114 } | 114 } |
115 } | 115 } |
116 })(); | 116 })(); |
LEFT | RIGHT |