diff options
author | Jose Antonio Marquez | 2012-05-09 16:28:13 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-05-09 16:28:13 -0700 |
commit | 3811f72f8cd8caaa2d13fa695b918f25facb85c5 (patch) | |
tree | 4198a41aacf42d16d2d0c75574c98d4ec299390e /js/document/views | |
parent | 258f006074616f1c654125059e73d94752afb896 (diff) | |
download | ninja-3811f72f8cd8caaa2d13fa695b918f25facb85c5.tar.gz |
Preliminary Montage Template Cleanup
The template creator is currently not returning serializing code, but does clean the document. Need to investigate reason why, currently all components are removed on save.
Diffstat (limited to 'js/document/views')
-rwxr-xr-x | js/document/views/design.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js index 9ad088cb..765099e6 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -42,6 +42,11 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
42 | value: null | 42 | value: null |
43 | }, | 43 | }, |
44 | //////////////////////////////////////////////////////////////////// | 44 | //////////////////////////////////////////////////////////////////// |
45 | //TODO: Remove usage | ||
46 | model: { | ||
47 | value: null | ||
48 | }, | ||
49 | //////////////////////////////////////////////////////////////////// | ||
45 | // | 50 | // |
46 | document: { | 51 | document: { |
47 | get: function() {return this._document;}, | 52 | get: function() {return this._document;}, |
@@ -78,6 +83,8 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
78 | // | 83 | // |
79 | onTemplateLoad: { | 84 | onTemplateLoad: { |
80 | value: function (e) { | 85 | value: function (e) { |
86 | //TODO: Add support to constructing URL with a base HREF | ||
87 | var basetag = this.content.document.getElementsByTagName('base'); | ||
81 | //Removing event | 88 | //Removing event |
82 | this.iframe.removeEventListener("load", this.onTemplateLoad.bind(this), false); | 89 | this.iframe.removeEventListener("load", this.onTemplateLoad.bind(this), false); |
83 | //TODO: Improve usage of this reference | 90 | //TODO: Improve usage of this reference |
@@ -88,6 +95,13 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
88 | this.document.styleSheets[k].ownerNode.setAttribute('data-ninja-template', 'true'); | 95 | this.document.styleSheets[k].ownerNode.setAttribute('data-ninja-template', 'true'); |
89 | } | 96 | } |
90 | } | 97 | } |
98 | //Checking for a base URL | ||
99 | if (basetag.length) { | ||
100 | if (basetag[basetag.length-1].getAttribute && basetag[basetag.length-1].getAttribute('href')) { | ||
101 | //Setting base HREF in model | ||
102 | this.model.baseHref = basetag[basetag.length-1].getAttribute('href'); | ||
103 | } | ||
104 | } | ||
91 | //Creating temp code fragement to load head | 105 | //Creating temp code fragement to load head |
92 | this._headFragment = this.document.createElement('head'); | 106 | this._headFragment = this.document.createElement('head'); |
93 | //Adding event listener to know when head is ready, event only dispatched once when using innerHTML | 107 | //Adding event listener to know when head is ready, event only dispatched once when using innerHTML |