Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:remy/jsconsole

  • Loading branch information...
commit 4a78abff2d877978e553b3fd6f34969ba282a67f 2 parents bfff167 + 43a9d71
@remy remy authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 console.js
View
15 console.js
@@ -69,7 +69,7 @@ function stringify(o, simple) {
}
function cleanse(s) {
- return (s||'').replace(/[<>&]/g, function (m) { return {'&':'&amp;','>':'&gt;','<':'&lt;'}[m];});
+ return (s||'').replace(/[<&]/g, function (m) { return {'&':'&amp;','<':'&lt;'}[m];});
}
function run(cmd) {
@@ -173,12 +173,13 @@ function echo(cmd) {
logAfter = null;
- if (document.querySelectorAll) {
- logAfter = output.querySelectorAll('li.echo')[0] || null;
+ if (output.querySelector) {
+ logAfter = output.querySelector('li.echo') || null;
} else {
var lis = document.getElementsByTagName('li'),
- len = lis.length;
- for (var i = 0; i < len; i++) {
+ len = lis.length,
+ i;
+ for (i = 0; i < len; i++) {
if (lis[i].className.indexOf('echo') !== -1) {
logAfter = lis[i];
break;
@@ -186,7 +187,7 @@ function echo(cmd) {
}
}
- // logAfter = output.querySelectorAll('li.echo')[0] || null;
+ // logAfter = output.querySelector('li.echo') || null;
appendLog(li, true);
}
@@ -196,7 +197,7 @@ window.info = function(cmd) {
li.className = 'info';
li.innerHTML = '<span class="gutter"></span><div>' + cleanse(cmd) + '</div>';
- // logAfter = output.querySelectorAll('li.echo')[0] || null;
+ // logAfter = output.querySelector('li.echo') || null;
// appendLog(li, true);
appendLog(li);
}
Please sign in to comment.
Something went wrong with that request. Please try again.