From 620ae8f53d4da25c65adb675c0b0ee187e5754fc Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 15 May 2012 16:49:32 -0700 Subject: Adding special preview for templates --- js/document/templates/preview/banner.html | 64 +++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 js/document/templates/preview/banner.html (limited to 'js/document/templates') diff --git a/js/document/templates/preview/banner.html b/js/document/templates/preview/banner.html new file mode 100755 index 00000000..5838ec91 --- /dev/null +++ b/js/document/templates/preview/banner.html @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From f9f8fdc3000042ba5b4504d91870dc9a32ef25eb Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 01:00:22 -0700 Subject: Squashed master into dom-architecture Signed-off-by: Valerio Virgillito --- js/document/templates/banner/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/document/templates') diff --git a/js/document/templates/banner/package.json b/js/document/templates/banner/package.json index c8bc02fb..d1e839dc 100755 --- a/js/document/templates/banner/package.json +++ b/js/document/templates/banner/package.json @@ -3,6 +3,7 @@ "lib": "" }, "mappings": { - "montage": "../../../../node_modules/montage/" + "montage": "../../../../node_modules/montage/", + "montage-google": "../../../../node_modules/montage-google/" } } \ No newline at end of file -- cgit v1.2.3 From b2c8041058ab8d16ca49d70ed24ddd29e79f51d2 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 01:06:05 -0700 Subject: Fixing the package file for the new dom template Signed-off-by: Valerio Virgillito --- js/document/templates/html/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/document/templates') diff --git a/js/document/templates/html/package.json b/js/document/templates/html/package.json index c8bc02fb..d1e839dc 100755 --- a/js/document/templates/html/package.json +++ b/js/document/templates/html/package.json @@ -3,6 +3,7 @@ "lib": "" }, "mappings": { - "montage": "../../../../node_modules/montage/" + "montage": "../../../../node_modules/montage/", + "montage-google": "../../../../node_modules/montage-google/" } } \ No newline at end of file -- cgit v1.2.3 From 5de553a1b3bdd8783ab6ce017ae70369ad92a890 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 16 May 2012 11:37:05 -0700 Subject: Fixing preview bug Also setting up for Montage component serialization. --- js/document/templates/html/index.html | 5 +++-- js/document/templates/html/main.js | 14 +++++++++++--- js/document/templates/html/package.json | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'js/document/templates') diff --git a/js/document/templates/html/index.html b/js/document/templates/html/index.html index a1b8b242..24159841 100755 --- a/js/document/templates/html/index.html +++ b/js/document/templates/html/index.html @@ -12,6 +12,9 @@ must set the 'data-ninja-template' data-ninja-template="true" --> + + + @@ -58,8 +61,6 @@ return document.elementFromPoint(x,y); } - - diff --git a/js/document/templates/html/main.js b/js/document/templates/html/main.js index d5ac88d5..f45657bb 100644 --- a/js/document/templates/html/main.js +++ b/js/document/templates/html/main.js @@ -3,8 +3,10 @@ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component, + Template = require("montage/ui/template").Template, + TemplateCreator = require("tools/template/template-creator").TemplateCreator; exports.Main = Montage.create(Component, { @@ -18,6 +20,7 @@ exports.Main = Montage.create(Component, { templateDidLoad: { value: function(){ var self = this; + // window.addComponent = function(element, data, callback) { var component; @@ -36,7 +39,12 @@ exports.Main = Montage.create(Component, { .end(); }; - + // + window.mjsTemplateCreator = TemplateCreator.create(); + // + window.mjsTemplate = Template.create(); + + // Dispatch event when this template has loaded. /* var newEvent = document.createEvent( "CustomEvent" ); diff --git a/js/document/templates/html/package.json b/js/document/templates/html/package.json index d1e839dc..4f36090a 100755 --- a/js/document/templates/html/package.json +++ b/js/document/templates/html/package.json @@ -4,6 +4,7 @@ }, "mappings": { "montage": "../../../../node_modules/montage/", + "tools": "../../../../node_modules/tools/", "montage-google": "../../../../node_modules/montage-google/" } } \ No newline at end of file -- cgit v1.2.3 From ac750fd9b9c311dcd48c6ee309607edc6fa048e1 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 16 May 2012 14:22:18 -0700 Subject: Adding basic montage components I/O Only for saving basic components without a reel. --- js/document/templates/html/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/document/templates') diff --git a/js/document/templates/html/main.js b/js/document/templates/html/main.js index f45657bb..2696dfa0 100644 --- a/js/document/templates/html/main.js +++ b/js/document/templates/html/main.js @@ -42,7 +42,7 @@ exports.Main = Montage.create(Component, { // window.mjsTemplateCreator = TemplateCreator.create(); // - window.mjsTemplate = Template.create(); + window.mjsTemplate = Template.create(); // Dispatch event when this template has loaded. -- cgit v1.2.3 From 5cc5d29736d8bf253e3a168cdd6443e839ffb23c Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 16 May 2012 15:42:09 -0700 Subject: Fixing serialization referencing (new object per save) --- js/document/templates/html/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/document/templates') diff --git a/js/document/templates/html/main.js b/js/document/templates/html/main.js index 2696dfa0..ffa3fab2 100644 --- a/js/document/templates/html/main.js +++ b/js/document/templates/html/main.js @@ -40,9 +40,9 @@ exports.Main = Montage.create(Component, { }; // - window.mjsTemplateCreator = TemplateCreator.create(); + window.mjsTemplateCreator = TemplateCreator; // - window.mjsTemplate = Template.create(); + window.mjsTemplate = Template; // Dispatch event when this template has loaded. -- cgit v1.2.3 From 6ce2f2a5af1bc66d8dbec04abfae2e07f43afcfe Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 17 May 2012 11:22:03 -0700 Subject: Fixed chrome preview for banner templates. Signed-off-by: Nivesh Rajbhandari --- js/document/templates/banner/main.js | 8 +++++++- js/document/templates/banner/package.json | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'js/document/templates') diff --git a/js/document/templates/banner/main.js b/js/document/templates/banner/main.js index d5ac88d5..2acbe8f3 100644 --- a/js/document/templates/banner/main.js +++ b/js/document/templates/banner/main.js @@ -4,7 +4,9 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; + Component = require("montage/ui/component").Component, + Template = require("montage/ui/template").Template, + TemplateCreator = require("tools/template/template-creator").TemplateCreator; exports.Main = Montage.create(Component, { @@ -37,6 +39,10 @@ exports.Main = Montage.create(Component, { }; + window.mjsTemplateCreator = TemplateCreator; + // + window.mjsTemplate = Template; + // Dispatch event when this template has loaded. /* var newEvent = document.createEvent( "CustomEvent" ); diff --git a/js/document/templates/banner/package.json b/js/document/templates/banner/package.json index d1e839dc..4f36090a 100755 --- a/js/document/templates/banner/package.json +++ b/js/document/templates/banner/package.json @@ -4,6 +4,7 @@ }, "mappings": { "montage": "../../../../node_modules/montage/", + "tools": "../../../../node_modules/tools/", "montage-google": "../../../../node_modules/montage-google/" } } \ No newline at end of file -- cgit v1.2.3 From e713d437a3918b9e417d1a0bc9f11275fc9e6634 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 17 May 2012 12:16:43 -0700 Subject: Sharing app data in banner and html templates Syncing the files to avoid duplicates and ensure consistency. --- js/document/templates/app/main.js | 61 +++++++++++++++++++++++++ js/document/templates/app/package.json | 10 ++++ js/document/templates/banner/index.html | 2 +- js/document/templates/banner/main.js | 55 ---------------------- js/document/templates/banner/package.json | 10 ---- js/document/templates/html/index.html | 2 +- js/document/templates/html/main.js | 57 ----------------------- js/document/templates/html/package.json | 10 ---- js/document/templates/montage-html/package.json | 9 ---- 9 files changed, 73 insertions(+), 143 deletions(-) create mode 100644 js/document/templates/app/main.js create mode 100755 js/document/templates/app/package.json delete mode 100644 js/document/templates/banner/main.js delete mode 100755 js/document/templates/banner/package.json delete mode 100644 js/document/templates/html/main.js delete mode 100755 js/document/templates/html/package.json delete mode 100755 js/document/templates/montage-html/package.json (limited to 'js/document/templates') diff --git a/js/document/templates/app/main.js b/js/document/templates/app/main.js new file mode 100644 index 00000000..a406abdb --- /dev/null +++ b/js/document/templates/app/main.js @@ -0,0 +1,61 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component, + Template = require("montage/ui/template").Template, + TemplateCreator = require("tools/template/template-creator").TemplateCreator; + +exports.Main = Montage.create(Component, { + + hasTemplate: { + value: false + }, + + /** + * Adding window hooks to callback into this object from Ninja. + */ + templateDidLoad: { + value: function(){ + var self = this; + // + window.addComponent = function(element, data, callback) { + var component; + + component = require.async(data.path) + .then(function(component) { + var componentRequire = component[data.name]; + var componentInstance = componentRequire.create(); + + componentInstance.element = element; + + componentInstance.needsDraw = true; + componentInstance.ownerComponent = self; + + callback(componentInstance, element); + }) + .end(); + + }; + // + window.mjsTemplateCreator = TemplateCreator; + // + window.mjsTemplate = Template; + // + var templateEvent = document.createEvent("CustomEvent"); + templateEvent.initCustomEvent("mjsTemplateReady", false, true); + document.body.dispatchEvent(templateEvent); + + + // Dispatch event when this template has loaded. + /* + var newEvent = document.createEvent( "CustomEvent" ); + newEvent.initCustomEvent( "userTemplateDidLoad", false, true ); + document.body.dispatchEvent( newEvent ); + */ + + } + } +}); \ No newline at end of file diff --git a/js/document/templates/app/package.json b/js/document/templates/app/package.json new file mode 100755 index 00000000..4f36090a --- /dev/null +++ b/js/document/templates/app/package.json @@ -0,0 +1,10 @@ +{ + "directories": { + "lib": "" + }, + "mappings": { + "montage": "../../../../node_modules/montage/", + "tools": "../../../../node_modules/tools/", + "montage-google": "../../../../node_modules/montage-google/" + } +} \ No newline at end of file diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html index 91ef06de..f1ee3d98 100755 --- a/js/document/templates/banner/index.html +++ b/js/document/templates/banner/index.html @@ -81,7 +81,7 @@ - + - +