diff options
author | Jose Antonio Marquez | 2012-05-08 17:33:13 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-05-08 17:33:13 -0700 |
commit | a1e8540f5656e62db6a89f3af7829be6b259b7ed (patch) | |
tree | 1b8a445cf5c145a9622813da88555596640e7e37 /js/document/views/design.js | |
parent | 4504972c1f3b9bf1d02a4484a07a8a85cf9ccee2 (diff) | |
download | ninja-a1e8540f5656e62db6a89f3af7829be6b259b7ed.tar.gz |
Adding SAVE for I/O
Adding save functionality to new template. Need to implement user UI for prompts and also clean up...
Diffstat (limited to 'js/document/views/design.js')
-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 | //////////////////////////////////////////////////////////////////// |