diff options
author | Valerio Virgillito | 2012-05-11 15:00:36 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-11 15:00:36 -0700 |
commit | f4c4bc7971a50f9e258d1ac23c70f8ea8cfe5dd6 (patch) | |
tree | 297cc2bdd26c5a72bd88edf6d91be8ceef25e98b /js/document/templates/banner | |
parent | 2b718df00eb9f3a3d2ad269fab533967668988bf (diff) | |
parent | 1fb663b5f348fe2ff5ce86a80e8a61be289eba70 (diff) | |
download | ninja-f4c4bc7971a50f9e258d1ac23c70f8ea8cfe5dd6.tar.gz |
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into dom-architecture
Diffstat (limited to 'js/document/templates/banner')
-rwxr-xr-x | js/document/templates/banner/index.html | 94 | ||||
-rw-r--r-- | js/document/templates/banner/main.js | 49 | ||||
-rwxr-xr-x | js/document/templates/banner/package.json | 8 |
3 files changed, 151 insertions, 0 deletions
diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html new file mode 100755 index 00000000..2cd82f51 --- /dev/null +++ b/js/document/templates/banner/index.html | |||
@@ -0,0 +1,94 @@ | |||
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 | |||
9 | <!-- | ||
10 | NOTE(s): | ||
11 | All elements in the head of the document to be exclude from I/O | ||
12 | must set the 'data-ninja-template' | ||
13 | data-ninja-template="true" | ||
14 | --> | ||
15 | <html> | ||
16 | |||
17 | <head> | ||
18 | |||
19 | <style type="text/css" id="nj-stage-stylesheet" data-ninja-template="true"> | ||
20 | * { | ||
21 | -webkit-transition-duration: 0s !important; | ||
22 | -webkit-animation-duration: 0s !important; | ||
23 | -webkit-animation-name: none !important; | ||
24 | } | ||
25 | |||
26 | body { | ||
27 | margin: 0; | ||
28 | padding: 0; | ||
29 | position: absolute; | ||
30 | -webkit-transform-style: preserve-3d; | ||
31 | -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); | ||
32 | } | ||
33 | |||
34 | html { | ||
35 | overflow: scroll; | ||
36 | } | ||
37 | |||
38 | html, body { | ||
39 | width: 100%; | ||
40 | height: 100%; | ||
41 | background: #666; | ||
42 | } | ||
43 | |||
44 | ninjaloadinghack { | ||
45 | display: none; | ||
46 | } | ||
47 | |||
48 | .active-element-outline { | ||
49 | outline: #adff2f solid 2px; | ||
50 | } | ||
51 | |||
52 | .nj-preset-transition { | ||
53 | -webkit-transition: all 450ms linear !important; | ||
54 | } | ||
55 | |||
56 | ninja-banner { | ||
57 | display: block; | ||
58 | margin: 0; | ||
59 | padding: 0; | ||
60 | border: 0; | ||
61 | position: absolute; | ||
62 | overflow: visible; | ||
63 | top: 50%; | ||
64 | left: 50%; | ||
65 | background: #FFF; | ||
66 | } | ||
67 | </style> | ||
68 | |||
69 | <script type="text/javascript" data-ninja-template="true"> | ||
70 | function getElement(x,y) { | ||
71 | return document.elementFromPoint(x,y); | ||
72 | } | ||
73 | </script> | ||
74 | |||
75 | <!-- TODO: Determine if loading Montage is always needed or if it could be done author-time or on file open --> | ||
76 | |||
77 | <script type="text/javascript" data-package="." src="../../../../node_modules/montage/montage.js" data-ninja-template="true"></script> | ||
78 | |||
79 | <script type="text/montage-serialization" data-ninja-template="true"> | ||
80 | { | ||
81 | "owner": { | ||
82 | "prototype": "main" | ||
83 | } | ||
84 | } | ||
85 | </script> | ||
86 | |||
87 | </head> | ||
88 | |||
89 | <body> | ||
90 | <ninjaloadinghack></ninjaloadinghack> | ||
91 | <ninja-banner></ninja-banner> | ||
92 | </body> | ||
93 | |||
94 | </html> \ No newline at end of file | ||
diff --git a/js/document/templates/banner/main.js b/js/document/templates/banner/main.js new file mode 100644 index 00000000..d5ac88d5 --- /dev/null +++ b/js/document/templates/banner/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/banner/package.json b/js/document/templates/banner/package.json new file mode 100755 index 00000000..c8bc02fb --- /dev/null +++ b/js/document/templates/banner/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 | ||