From 08c18f646598bca1c0b6bdfef2400bed6b64cc88 Mon Sep 17 00:00:00 2001 From: ingeniarius Date: Wed, 9 Jan 2013 17:47:47 +0400 Subject: [PATCH] Added html config option to specify HTML markup in sandboxed iframe --- src/dom/sandbox.js | 8 ++++---- src/views/composer.js | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/dom/sandbox.js b/src/dom/sandbox.js index 64d590f0..4521c90c 100644 --- a/src/dom/sandbox.js +++ b/src/dom/sandbox.js @@ -153,10 +153,10 @@ iframeWindow = iframe.contentWindow, iframeDocument = iframe.contentWindow.document, charset = doc.characterSet || doc.charset || "utf-8", - sandboxHtml = this._getHtml({ - charset: charset, - stylesheets: this.config.stylesheets - }); + sandboxHtml = this.config.html || this._getHtml({ + charset: charset, + stylesheets: this.config.stylesheets + }); // Create the basic dom tree including proper DOCTYPE and charset iframeDocument.open("text/html", "replace"); diff --git a/src/views/composer.js b/src/views/composer.js index 752aafa6..ea28e8ad 100644 --- a/src/views/composer.js +++ b/src/views/composer.js @@ -112,7 +112,8 @@ this.sandbox = new dom.Sandbox(function() { that._create(); }, { - stylesheets: this.config.stylesheets + stylesheets: this.config.stylesheets, + html: this.config.html }); this.iframe = this.sandbox.getIframe();