From fb4ebaf01f60227a9bc542d55ca01b561b668f36 Mon Sep 17 00:00:00 2001 From: KLuka Date: Wed, 17 Jun 2015 18:11:59 +0200 Subject: [PATCH] Improved message passing info and examples --- misc/embedded.html | 57 ++++++++++++++++++++++++--------- shellinabox/shell_in_a_box.jspp | 2 +- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/misc/embedded.html b/misc/embedded.html index a221c21..ebdbc8c 100644 --- a/misc/embedded.html +++ b/misc/embedded.html @@ -1,24 +1,38 @@ + @@ -98,8 +123,8 @@ var output = document.getElementById("output"); var session = document.getElementById("session"); - // Add url to our iframe. We do this, only that variable 'url' is used - // throughout the whole code. + // Add url to our iframe. We do this, only that variable 'url' can be used + // throughout the whole code where needed. iframe.src = url; document.getElementById("execute").addEventListener("click", function() { @@ -127,6 +152,8 @@ data : 'disable' }); iframe.contentWindow.postMessage(message, url); + // Clear output window + output.innerHTML = ''; }); document.getElementById("session-reload").addEventListener("click", function() { diff --git a/shellinabox/shell_in_a_box.jspp b/shellinabox/shell_in_a_box.jspp index 091615b..952decc 100644 --- a/shellinabox/shell_in_a_box.jspp +++ b/shellinabox/shell_in_a_box.jspp @@ -389,7 +389,7 @@ ShellInABox.prototype.messageInit = function() { } }(this), false); } else { - // For IE8 or lower + // For IE8 if (window.attachEvent) { window.attachEvent('onmessage', function(shellInABox) { return function(message) {