diff options
Diffstat (limited to 'node_modules/tools/template/template-creator.js')
-rwxr-xr-x | node_modules/tools/template/template-creator.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/node_modules/tools/template/template-creator.js b/node_modules/tools/template/template-creator.js index 9951fb02..984edd43 100755 --- a/node_modules/tools/template/template-creator.js +++ b/node_modules/tools/template/template-creator.js | |||
@@ -47,13 +47,13 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
47 | return this.initWithHeadAndBodyElements(doc.head, doc.body, montageJsPath); | 47 | return this.initWithHeadAndBodyElements(doc.head, doc.body, montageJsPath); |
48 | } | 48 | } |
49 | }, | 49 | }, |
50 | 50 | ||
51 | initWithBodyElement: { | 51 | initWithBodyElement: { |
52 | value: function(body, montageJsPath) { | 52 | value: function(body, montageJsPath) { |
53 | return this.initWithHeadAndBodyElements(null, body, montageJsPath); | 53 | return this.initWithHeadAndBodyElements(null, body, montageJsPath); |
54 | } | 54 | } |
55 | }, | 55 | }, |
56 | 56 | ||
57 | initWithHeadAndBodyElements: { | 57 | initWithHeadAndBodyElements: { |
58 | value: function(head, body, montageJsPath) { | 58 | value: function(head, body, montageJsPath) { |
59 | var serializer = this.serializer, | 59 | var serializer = this.serializer, |
@@ -64,11 +64,11 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
64 | doc, | 64 | doc, |
65 | script, | 65 | script, |
66 | self = this; | 66 | self = this; |
67 | 67 | ||
68 | this._componentNamesIndex = {}; | 68 | this._componentNamesIndex = {}; |
69 | this._objectNamesIndex = {}; | 69 | this._objectNamesIndex = {}; |
70 | doc = this._document = document.implementation.createHTMLDocument(""); | 70 | doc = this._document = document.implementation.createHTMLDocument(""); |
71 | 71 | ||
72 | function copyNode(sourceNode, targetNode, isRootNode) { | 72 | function copyNode(sourceNode, targetNode, isRootNode) { |
73 | var childNodes = sourceNode.childNodes, | 73 | var childNodes = sourceNode.childNodes, |
74 | childNode, | 74 | childNode, |
@@ -76,7 +76,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
76 | label, | 76 | label, |
77 | script, | 77 | script, |
78 | component = isRootNode ? null : sourceNode.controller; | 78 | component = isRootNode ? null : sourceNode.controller; |
79 | 79 | ||
80 | if (component) { | 80 | if (component) { |
81 | label = self._generateLabelForComponent(component, Object.keys(components)); | 81 | label = self._generateLabelForComponent(component, Object.keys(components)); |
82 | componentsElements[label] = component._element; | 82 | componentsElements[label] = component._element; |
@@ -92,7 +92,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
92 | } | 92 | } |
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | if (head) { | 96 | if (head) { |
97 | doc.head.innerHTML = head.innerHTML; | 97 | doc.head.innerHTML = head.innerHTML; |
98 | } | 98 | } |
@@ -102,7 +102,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
102 | doc.head.appendChild(script); | 102 | doc.head.appendChild(script); |
103 | doc.head.insertBefore(doc.createTextNode("\n "), script); | 103 | doc.head.insertBefore(doc.createTextNode("\n "), script); |
104 | } | 104 | } |
105 | 105 | ||
106 | // try to make things look nice... | 106 | // try to make things look nice... |
107 | var html = doc.documentElement; | 107 | var html = doc.documentElement; |
108 | html.insertBefore(doc.createTextNode("\n"), doc.head); | 108 | html.insertBefore(doc.createTextNode("\n"), doc.head); |
@@ -112,7 +112,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
112 | // the first child is the title | 112 | // the first child is the title |
113 | doc.head.insertBefore(doc.createTextNode("\n "), doc.head.firstChild); | 113 | doc.head.insertBefore(doc.createTextNode("\n "), doc.head.firstChild); |
114 | } | 114 | } |
115 | 115 | ||
116 | copyNode(body, this._document.body, true); | 116 | copyNode(body, this._document.body, true); |
117 | this._ownerSerialization = serializer.serialize(components); | 117 | this._ownerSerialization = serializer.serialize(components); |
118 | for (var label in components) { | 118 | for (var label in components) { |
@@ -121,11 +121,11 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le | |||
121 | } | 121 | } |
122 | components = componentsChildComponents = null; | 122 | components = componentsChildComponents = null; |
123 | this._externalObjects = serializer.getExternalObjects(); | 123 | this._externalObjects = serializer.getExternalObjects(); |
124 | 124 | ||
125 | return this; | 125 | return this; |
126 | } | 126 | } |
127 | }, | 127 | }, |
128 | 128 | ||
129 | _componentNamesIndex: { | 129 | _componentNamesIndex: { |
130 | value: null | 130 | value: null |
131 | }, | 131 | }, |