Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Eliminated use of non-standard innerText property.

  • Loading branch information...
commit 47a93d7fd7324ea6cfdd8405726e327732c24a78 1 parent af3be87
@dgchurchill authored
Showing with 9 additions and 4 deletions.
  1. +2 −2 debugger.js
  2. +2 −2 nanowasp.js
  3. +5 −0 utils.js
View
4 debugger.js
@@ -26,7 +26,7 @@ nanowasp.Debugger = function (registersElementName) {
nanowasp.Debugger.prototype = {
update: function () {
- this._registersElement.innerText =
+ utils.setTextContent(this._registersElement,
"PC: " + this._formatHex(z80.pc, 4) + " " +
"SP: " + this._formatHex(z80.sp, 4) + "\n" +
"AF: " + this._formatHex(z80.a, 2) + this._formatHex(z80.f, 2) + " " +
@@ -36,7 +36,7 @@ nanowasp.Debugger.prototype = {
"IX: " + this._formatHex(z80.ixh, 2) + this._formatHex(z80.ixl, 2) + " " +
"IY: " + this._formatHex(z80.iyh, 2) + this._formatHex(z80.iyl, 2) + "\n" +
"\n" +
- disassemble(z80.pc, 5);
+ disassemble(z80.pc, 5));
},
_formatHex: function (data, length) {
View
4 nanowasp.js
@@ -180,7 +180,7 @@ nanowasp.NanoWasp.prototype = {
debug.update();
});
var button = document.getElementById("debugger_button");
- button.innerText = "Hide Debugger";
+ utils.setTextContent(button, "Hide Debugger");
button.onclick = utils.bind(this._hide_debugger, this);
},
@@ -188,7 +188,7 @@ nanowasp.NanoWasp.prototype = {
utils.addHtmlClass("debugger", "hidden");
this.microbee.setSliceDoneCallback(null);
var button = document.getElementById("debugger_button");
- button.innerText = "Show Debugger";
+ utils.setTextContent(button, "Show Debugger");
button.onclick = utils.bind(this._show_debugger, this);
}
};
View
5 utils.js
@@ -84,6 +84,11 @@ var utils = {
return !wasActive;
},
+ setTextContent: function (element, text) {
+ element.innerHTML = "";
+ element.appendChild(document.createTextNode(text));
+ },
+
// Missing feature implementation
bind: (function () {}).bind == undefined
Please sign in to comment.
Something went wrong with that request. Please try again.