aboutsummaryrefslogtreecommitdiff
path: root/js/document/views
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-08 17:36:57 -0700
committerValerio Virgillito2012-05-08 17:36:57 -0700
commitf8c467bd268e10d4f07136ca932c6eaffc94bc12 (patch)
tree16c9785629451a461f855cba4b4e36f28e639a8c /js/document/views
parentb425025001c0ef0ea0ea8439d60a133c3fac61b0 (diff)
parentef1daccfad5381badd53b9d045c2687f9b0e090d (diff)
downloadninja-f8c467bd268e10d4f07136ca932c6eaffc94bc12.tar.gz
Merge pull request #204 from joseeight/Document
I/O: Adding Save Functionality
Diffstat (limited to 'js/document/views')
-rwxr-xr-xjs/document/views/design.js7
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 ////////////////////////////////////////////////////////////////////