From c58dc96130c7eb5d964af53e9ad6e80bba5e647f Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 18 Apr 2012 17:24:40 -0700 Subject: initial stage web template Signed-off-by: Valerio Virgillito --- js/document/templates/montage-web/default_html.css | 30 ++++++++++++++ js/document/templates/montage-web/index.html | 41 ++++++++++++++++++ .../templates/montage-web/main.reel/main.js | 48 ++++++++++++++++++++++ js/document/templates/montage-web/package.json | 8 ++++ 4 files changed, 127 insertions(+) create mode 100755 js/document/templates/montage-web/default_html.css create mode 100755 js/document/templates/montage-web/index.html create mode 100644 js/document/templates/montage-web/main.reel/main.js create mode 100755 js/document/templates/montage-web/package.json (limited to 'js/document/templates') diff --git a/js/document/templates/montage-web/default_html.css b/js/document/templates/montage-web/default_html.css new file mode 100755 index 00000000..05165898 --- /dev/null +++ b/js/document/templates/montage-web/default_html.css @@ -0,0 +1,30 @@ +/* +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. +
*/ + +* { + -webkit-transition-duration: 0s !important; + -webkit-animation-duration: 0s !important; + -webkit-animation-name: none !important; +} + +html{ + /*overflow:hidden;*/ +} + +body +{ + width: 100%; + height: 100%; + background: pink; +} + +.active-element-outline { + outline: #adff2f solid 2px; +} + +.nj-preset-transition { + -webkit-transition: all 450ms linear !important; +} \ No newline at end of file diff --git a/js/document/templates/montage-web/index.html b/js/document/templates/montage-web/index.html new file mode 100755 index 00000000..60946aac --- /dev/null +++ b/js/document/templates/montage-web/index.html @@ -0,0 +1,41 @@ + + + + + + + + Ninja Prototype + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/js/document/templates/montage-web/main.reel/main.js b/js/document/templates/montage-web/main.reel/main.js new file mode 100644 index 00000000..019c675e --- /dev/null +++ b/js/document/templates/montage-web/main.reel/main.js @@ -0,0 +1,48 @@ +/* + 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; + +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(); + + }; + + // 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/montage-web/package.json b/js/document/templates/montage-web/package.json new file mode 100755 index 00000000..c8bc02fb --- /dev/null +++ b/js/document/templates/montage-web/package.json @@ -0,0 +1,8 @@ +{ + "directories": { + "lib": "" + }, + "mappings": { + "montage": "../../../../node_modules/montage/" + } +} \ No newline at end of file -- cgit v1.2.3