change popup to div

This commit is contained in:
Dennis Brown 2017-03-29 16:40:22 -05:00
parent 90a8026bc8
commit c3af6eac0d

View File

@ -8,6 +8,7 @@
* Released under the GNU General Public License * Released under the GNU General Public License
* see http://gnu.org/licenses/gpl.html * see http://gnu.org/licenses/gpl.html
*/ */
/* eslint no-use-before-define: 0 */ // --> OFF
'use strict'; 'use strict';
@ -2435,24 +2436,21 @@ function SimulatorWidget(node) {
pushByte((value >> 8) & 0xff); pushByte((value >> 8) & 0xff);
} }
function openPopup(content, title) { function openDiv(content, title) {
var w = window.open('', title, 'width=500,height=300,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no'); var w = document.querySelector('.banner');
var ele = document.createElement('div');
var html = "<html><head>"; // var html = "<link href='style.css' rel='stylesheet' type='text/css' />";
html += "<link href='style.css' rel='stylesheet' type='text/css' />"; // html += "<title>" + title + "</title></head><body>";
html += "<title>" + title + "</title></head><body>"; // html += "<pre><code>";
html += "<pre><code>"; // html += content;
// html += "</code></pre></body></html>";
html += content; ele.innerHTML = '<code>' + content + '</code>';
w.appendChild(ele);
html += "</code></pre></body></html>";
w.document.write(html);
w.document.close();
} }
// Dump binary as hex to new window // Dump binary as hex to new window
function hexdump() { function hexdump() {
openPopup(memory.format(0x600, codeLen), 'Hexdump'); openDiv(memory.format(0x600, codeLen), 'Hexdump');
} }
// TODO: Create separate disassembler object? // TODO: Create separate disassembler object?
@ -2616,7 +2614,7 @@ function SimulatorWidget(node) {
var html = 'Address Hexdump Dissassembly\n'; var html = 'Address Hexdump Dissassembly\n';
html += '-------------------------------\n'; html += '-------------------------------\n';
html += instructions.join('\n'); html += instructions.join('\n');
openPopup(html, 'Disassembly'); openDiv(html, 'Disassembly');
} }
return { return {