From c87e538fdc337639bc4d54bb087dbf2b4f20297f Mon Sep 17 00:00:00 2001
From: Jose Antonio Marquez
Date: Fri, 11 May 2012 14:41:20 -0700
Subject: Adding support for new templates
This is supported for NEW and OPEN, SAVE is not supported yet by I/O. Saving works, but it will not be a banner template.
---
js/document/templates/banner/index.html | 94 +++++++++++++++++++++++++++++++
js/document/templates/banner/main.js | 49 ++++++++++++++++
js/document/templates/banner/package.json | 8 +++
3 files changed, 151 insertions(+)
create mode 100755 js/document/templates/banner/index.html
create mode 100644 js/document/templates/banner/main.js
create mode 100755 js/document/templates/banner/package.json
(limited to 'js/document/templates/banner')
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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 @@
+/*
+ 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/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 @@
+{
+ "directories": {
+ "lib": ""
+ },
+ "mappings": {
+ "montage": "../../../../node_modules/montage/"
+ }
+}
\ No newline at end of file
--
cgit v1.2.3
From d68c1ea5163c67ada54ac24f1da69695cc8dfab5 Mon Sep 17 00:00:00 2001
From: Jose Antonio Marquez
Date: Fri, 11 May 2012 16:22:17 -0700
Subject: Fixing position issue
Need to implement centering document.
---
js/document/templates/banner/index.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'js/document/templates/banner')
diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html
index 2cd82f51..8e8c96d6 100755
--- a/js/document/templates/banner/index.html
+++ b/js/document/templates/banner/index.html
@@ -60,8 +60,8 @@
border: 0;
position: absolute;
overflow: visible;
- top: 50%;
- left: 50%;
+ top: 0;
+ left: 0;
background: #FFF;
}
--
cgit v1.2.3
From 734b6ad96d25bb67d0db4a0a75c331468e194809 Mon Sep 17 00:00:00 2001
From: Nivesh Rajbhandari
Date: Mon, 14 May 2012 12:05:41 -0700
Subject: Fixing 3d to work in banner templates.
Signed-off-by: Nivesh Rajbhandari
---
js/document/templates/banner/index.html | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'js/document/templates/banner')
diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html
index 8e8c96d6..9da6699b 100755
--- a/js/document/templates/banner/index.html
+++ b/js/document/templates/banner/index.html
@@ -27,8 +27,6 @@
margin: 0;
padding: 0;
position: absolute;
- -webkit-transform-style: preserve-3d;
- -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
html {
@@ -63,6 +61,9 @@
top: 0;
left: 0;
background: #FFF;
+ -webkit-transform-style: preserve-3d;
+ -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
+
}
--
cgit v1.2.3
From cfd3a44bb7aba54c15fab59eff39ecdffcb7ac11 Mon Sep 17 00:00:00 2001
From: Nivesh Rajbhandari
Date: Mon, 14 May 2012 14:38:35 -0700
Subject: Viewport for banner templates so content doesn't push through "body".
Signed-off-by: Nivesh Rajbhandari
---
js/document/templates/banner/index.html | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
(limited to 'js/document/templates/banner')
diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html
index 9da6699b..7b29c038 100755
--- a/js/document/templates/banner/index.html
+++ b/js/document/templates/banner/index.html
@@ -50,6 +50,18 @@
.nj-preset-transition {
-webkit-transition: all 450ms linear !important;
}
+
+ ninja-viewport {
+ display: block;
+ margin: 0;
+ padding: 0;
+ border: 0;
+ position: absolute;
+ overflow: visible;
+ top: 0;
+ left: 0;
+ background: #FFF;
+ }
ninja-banner {
display: block;
@@ -60,7 +72,7 @@
overflow: visible;
top: 0;
left: 0;
- background: #FFF;
+ background: transparent;
-webkit-transform-style: preserve-3d;
-webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
@@ -89,7 +101,10 @@
-
+
+
+
+