From fda7b595c96d99177fdd93de8da9030348a3f8fb Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Sun, 18 Mar 2012 12:34:29 -0700 Subject: Temp I/O functionality for M-JS components Added the ability to save montages component serialization from Ninja. Very rough, but functional. --- node_modules/descriptor.json | 9 ++++----- node_modules/tools/template-creator.js | 12 +++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'node_modules') diff --git a/node_modules/descriptor.json b/node_modules/descriptor.json index c460066c..d5bb81f3 100644 --- a/node_modules/descriptor.json +++ b/node_modules/descriptor.json @@ -169,6 +169,7 @@ "ui/component.js", "ui/composer/composer.js", "ui/composer/long-press-composer.js", + "ui/composer/press-composer.js", "ui/composer/swipe-composer.js", "ui/composer/translate-composer.js", "ui/condition.reel/condition.js", @@ -219,21 +220,19 @@ "ui/popup/popup.reel/popup.css", "ui/popup/popup.reel/popup.html", "ui/popup/popup.reel/popup.js", - "ui/progress.reel/progress.css", - "ui/progress.reel/progress.html", "ui/progress.reel/progress.js", - "ui/progress.reel/rule.png", - "ui/progress.reel/scroll.png", "ui/radio-button.reel/radio-button.js", "ui/range-input.reel/range-input.js", "ui/repetition.reel/repetition.js", "ui/scroll-bars.reel/scroll-bars.html", "ui/scroll-bars.reel/scroll-bars.js", - "ui/scroll.js", "ui/scroller.reel/scroller.html", "ui/scroller.reel/scroller.js", "ui/scrollview.reel/scrollview.js", "ui/select-input.reel/select-input.js", + "ui/skeleton/range-input.reel/range-input.css", + "ui/skeleton/range-input.reel/range-input.html", + "ui/skeleton/range-input.reel/range-input.js", "ui/slot.reel/slot.js", "ui/substitution.reel/substitution.js", "ui/tabs.reel/tabs.css", diff --git a/node_modules/tools/template-creator.js b/node_modules/tools/template-creator.js index 6b50cc1e..ba4cdc7a 100644 --- a/node_modules/tools/template-creator.js +++ b/node_modules/tools/template-creator.js @@ -31,10 +31,10 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le }, initWithHeadAndBodyElements: { - value: function(head, body, montageJsPath) { + value: function(head, body, components, montageJsPath) { var serializer = this.serializer, objects = {}, - components = {}, + //components = {}, doc, script, self = this; @@ -42,7 +42,8 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le this._objectNamesIndex = {}; doc = this._document = document.implementation.createHTMLDocument(""); - function copyNode(sourceNode, targetNode, isRootNode) { + /* +function copyNode(sourceNode, targetNode, isRootNode) { var childNodes = sourceNode.childNodes, childNode, targetChildNode, @@ -54,7 +55,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le label = self._generateLabelForComponent(component); targetNode.setAttribute("id", label); component._element = targetNode; - components[label] = component; + //components[label] = component; } else { for (var i = 0; (childNode = childNodes[i]); i++) { targetChildNode = targetNode.appendChild(childNode.cloneNode(false)); @@ -62,6 +63,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le } } } +*/ if (head) { doc.head.innerHTML = head.innerHTML; @@ -83,7 +85,7 @@ var TemplateCreator = exports.TemplateCreator = Montage.create(Template, /** @le doc.head.insertBefore(doc.createTextNode("\n "), doc.head.firstChild); } - copyNode(body, this._document.body, true); + //copyNode(body, this._document.body, true); this._ownerSerialization = serializer.serialize(components); this._externalObjects = serializer.getExternalObjects(); -- cgit v1.2.3