aboutsummaryrefslogtreecommitdiff
path: root/js/document/templates/app
diff options
context:
space:
mode:
authorJonathan Duran2012-05-31 08:54:48 -0700
committerJonathan Duran2012-05-31 08:54:48 -0700
commitf297093b5bfa62c9832829751a12f0e556bb5cc0 (patch)
tree6e04cdf142cb1b36e2197970c9dc2141017a2be7 /js/document/templates/app
parent9253e2ce98d748edd8c3929f113a597923960387 (diff)
parentd49c909cff7f0c5e5d0b127ad84a2fefc6677dc6 (diff)
downloadninja-f297093b5bfa62c9832829751a12f0e556bb5cc0.tar.gz
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Conflicts: js/panels/Timeline/Layer.reel/Layer.js js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js js/panels/properties.reel/properties.js Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/document/templates/app')
-rw-r--r--js/document/templates/app/main.js61
-rwxr-xr-xjs/document/templates/app/package.json10
2 files changed, 71 insertions, 0 deletions
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 @@
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> */
6var Montage = require("montage/core/core").Montage,
7 Component = require("montage/ui/component").Component,
8 Template = require("montage/ui/template").Template,
9 TemplateCreator = require("tools/template/template-creator").TemplateCreator;
10
11exports.Main = Montage.create(Component, {
12
13 hasTemplate: {
14 value: false
15 },
16
17 /**
18 * Adding window hooks to callback into this object from Ninja.
19 */
20 templateDidLoad: {
21 value: function(){
22 var self = this;
23 //
24 window.addComponent = function(element, data, callback) {
25 var component;
26
27 component = require.async(data.path)
28 .then(function(component) {
29 var componentRequire = component[data.name];
30 var componentInstance = componentRequire.create();
31
32 componentInstance.element = element;
33
34 componentInstance.needsDraw = true;
35 componentInstance.ownerComponent = self;
36
37 callback(componentInstance, element);
38 })
39 .end();
40
41 };
42 //
43 window.mjsTemplateCreator = TemplateCreator;
44 //
45 window.mjsTemplate = Template;
46 //
47 var templateEvent = document.createEvent("CustomEvent");
48 templateEvent.initCustomEvent("mjsTemplateReady", false, true);
49 document.body.dispatchEvent(templateEvent);
50
51
52 // Dispatch event when this template has loaded.
53 /*
54 var newEvent = document.createEvent( "CustomEvent" );
55 newEvent.initCustomEvent( "userTemplateDidLoad", false, true );
56 document.body.dispatchEvent( newEvent );
57 */
58
59 }
60 }
61}); \ 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 @@
1{
2 "directories": {
3 "lib": ""
4 },
5 "mappings": {
6 "montage": "../../../../node_modules/montage/",
7 "tools": "../../../../node_modules/tools/",
8 "montage-google": "../../../../node_modules/montage-google/"
9 }
10} \ No newline at end of file