diff options
Diffstat (limited to 'js/document/views')
-rwxr-xr-x | js/document/views/design.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js index df6e9b53..9ad088cb 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -100,6 +100,13 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
100 | this._observer.body.observe(this.document.body, {childList: true}); | 100 | this._observer.body.observe(this.document.body, {childList: true}); |
101 | //Inserting <body> HTML and parsing URLs via mediator method | 101 | //Inserting <body> HTML and parsing URLs via mediator method |
102 | this.document.body.innerHTML += '<ninjaloadinghack></ninjaloadinghack>'+(this.content.body.replace(/\b(href|src)\s*=\s*"([^"]*)"/g, this.application.ninja.ioMediator.getNinjaPropUrlRedirect.bind(this.application.ninja.ioMediator))).replace(/url\(([^"]*)(.+?)\1\)/g, this.application.ninja.ioMediator.getNinjaPropUrlRedirect.bind(this.application.ninja.ioMediator)); | 102 | this.document.body.innerHTML += '<ninjaloadinghack></ninjaloadinghack>'+(this.content.body.replace(/\b(href|src)\s*=\s*"([^"]*)"/g, this.application.ninja.ioMediator.getNinjaPropUrlRedirect.bind(this.application.ninja.ioMediator))).replace(/url\(([^"]*)(.+?)\1\)/g, this.application.ninja.ioMediator.getNinjaPropUrlRedirect.bind(this.application.ninja.ioMediator)); |
103 | //Copying attributes to maintain same properties as the <body> | ||
104 | for (var n in this.content.document.body.attributes) { | ||
105 | if (this.content.document.body.attributes[n].value) { | ||
106 | this.document.body.setAttribute(this.content.document.body.attributes[n].name, this.content.document.body.attributes[n].value); | ||
107 | } | ||
108 | } | ||
109 | //TODO: Add attribute copying for <HEAD> and <HTML> | ||
103 | } | 110 | } |
104 | }, | 111 | }, |
105 | //////////////////////////////////////////////////////////////////// | 112 | //////////////////////////////////////////////////////////////////// |