diff options
author | Valerio Virgillito | 2012-04-23 17:09:31 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-04-23 17:09:31 -0700 |
commit | 55e6d621b9555abac06ab4adff44dfe29a78ec4e (patch) | |
tree | 3f383cb4b9e92dcb7f80eed62ff6cbc467062448 /js/document/templates | |
parent | 5a0331fc26fcc2cdc6200086109e34440a2dec6a (diff) | |
parent | 4ab2a55ba2175c72f859c428122a166f8af74140 (diff) | |
download | ninja-55e6d621b9555abac06ab4adff44dfe29a78ec4e.tar.gz |
Merge pull request #173 from mencio/stage-document-architecture
Stage document architecture - Initial commit to support opening Web template
Diffstat (limited to 'js/document/templates')
-rwxr-xr-x | js/document/templates/montage-web/default_html.css | 19 | ||||
-rwxr-xr-x | js/document/templates/montage-web/index.html | 49 | ||||
-rw-r--r-- | js/document/templates/montage-web/main.reel/main.js | 49 | ||||
-rwxr-xr-x | js/document/templates/montage-web/package.json | 8 |
4 files changed, 125 insertions, 0 deletions
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..db069d4e --- /dev/null +++ b/js/document/templates/montage-web/default_html.css | |||
@@ -0,0 +1,19 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | * { | ||
8 | -webkit-transition-duration: 0s !important; | ||
9 | -webkit-animation-duration: 0s !important; | ||
10 | -webkit-animation-name: none !important; | ||
11 | } | ||
12 | |||
13 | .active-element-outline { | ||
14 | outline: #adff2f solid 2px; | ||
15 | } | ||
16 | |||
17 | .nj-preset-transition { | ||
18 | -webkit-transition: all 450ms linear !important; | ||
19 | } \ 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..90b0f7fd --- /dev/null +++ b/js/document/templates/montage-web/index.html | |||
@@ -0,0 +1,49 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
6 | </copyright> --> | ||
7 | |||
8 | <html> | ||
9 | |||
10 | <head> | ||
11 | |||
12 | <title>Ninja Prototype</title> | ||
13 | |||
14 | <link href="default_html.css" id="nj-stage-stylesheet" rel="stylesheet" type="text/css" media="screen"/> | ||
15 | |||
16 | <script type="text/javascript" data-package="." src="../../../../node_modules/montage/montage.js"></script> | ||
17 | |||
18 | <script type="text/javascript"> | ||
19 | function getElement(x,y) { | ||
20 | return document.elementFromPoint(x,y); | ||
21 | } | ||
22 | </script> | ||
23 | |||
24 | <script type="text/montage-serialization"> | ||
25 | { | ||
26 | "owner": { | ||
27 | "module": "main.reel", | ||
28 | "name": "Main" | ||
29 | } | ||
30 | } | ||
31 | </script> | ||
32 | |||
33 | <style> | ||
34 | div { | ||
35 | width: 4000px; | ||
36 | height: 300px; | ||
37 | background: red; | ||
38 | } | ||
39 | </style> | ||
40 | |||
41 | </head> | ||
42 | |||
43 | <body> | ||
44 | |||
45 | <div>IPSUM</div> | ||
46 | |||
47 | </body> | ||
48 | |||
49 | </html> \ 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..d5ac88d5 --- /dev/null +++ b/js/document/templates/montage-web/main.reel/main.js | |||
@@ -0,0 +1,49 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | var Montage = require("montage/core/core").Montage, | ||
7 | Component = require("montage/ui/component").Component; | ||
8 | |||
9 | exports.Main = Montage.create(Component, { | ||
10 | |||
11 | hasTemplate: { | ||
12 | value: false | ||
13 | }, | ||
14 | |||
15 | /** | ||
16 | * Adding window hooks to callback into this object from Ninja. | ||
17 | */ | ||
18 | templateDidLoad: { | ||
19 | value: function(){ | ||
20 | var self = this; | ||
21 | window.addComponent = function(element, data, callback) { | ||
22 | var component; | ||
23 | |||
24 | component = require.async(data.path) | ||
25 | .then(function(component) { | ||
26 | var componentRequire = component[data.name]; | ||
27 | var componentInstance = componentRequire.create(); | ||
28 | |||
29 | componentInstance.element = element; | ||
30 | |||
31 | componentInstance.needsDraw = true; | ||
32 | componentInstance.ownerComponent = self; | ||
33 | |||
34 | callback(componentInstance, element); | ||
35 | }) | ||
36 | .end(); | ||
37 | |||
38 | }; | ||
39 | |||
40 | // Dispatch event when this template has loaded. | ||
41 | /* | ||
42 | var newEvent = document.createEvent( "CustomEvent" ); | ||
43 | newEvent.initCustomEvent( "userTemplateDidLoad", false, true ); | ||
44 | document.body.dispatchEvent( newEvent ); | ||
45 | */ | ||
46 | |||
47 | } | ||
48 | } | ||
49 | }); \ 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 @@ | |||
1 | { | ||
2 | "directories": { | ||
3 | "lib": "" | ||
4 | }, | ||
5 | "mappings": { | ||
6 | "montage": "../../../../node_modules/montage/" | ||
7 | } | ||
8 | } \ No newline at end of file | ||