| 1 | /* Copyright (c) 2010 by Michael J. Roberts. All Rights Reserved. */ |
| 2 | /* |
| 3 | * Debug log window scripts for TADS 3 Web UI. |
| 4 | */ |
| 5 | |
| 6 | function debugLogInit() |
| 7 | { |
| 8 | // initialize the utilities package |
| 9 | utilInit(); |
| 10 | |
| 11 | // tell our parent window that we're done loading |
| 12 | if (window.opener) |
| 13 | window.opener.debugLogLoaded.fire(); |
| 14 | } |
| 15 | |
| 16 | function debugLogPrint(msg) |
| 17 | { |
| 18 | // add the message to the debug log division |
| 19 | var d = $("debugLogDiv"); |
| 20 | var s = document.createElement("SPAN"); |
| 21 | s.innerHTML = msg; |
| 22 | d.appendChild(s); |
| 23 | |
| 24 | // scroll the window to the bottom |
| 25 | var ht = d.offsetHeight; |
| 26 | var wrc = getWindowRect(); |
| 27 | var y = ht - wrc.height; |
| 28 | if (y > 0) |
| 29 | window.scrollTo(0, y); |
| 30 | } |