aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-16 11:42:09 -0700
committerValerio Virgillito2012-05-16 11:42:09 -0700
commit23bf5db97fb24afdb14d02faac1136fc04137e96 (patch)
treeb0d2bb48506cda93e0db62d3e77c4ca9fc7306cf /js/document
parent081d72d145f3b570f0f866802e015527848f690e (diff)
parent78250b70bdf0089e2b8ac56fb77e2f76ab83f34c (diff)
downloadninja-23bf5db97fb24afdb14d02faac1136fc04137e96.tar.gz
Merge pull request #238 from joseeight/Document
Fixing Chrome Preview
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/models/base.js2
-rwxr-xr-xjs/document/templates/html/index.html5
-rw-r--r--js/document/templates/html/main.js14
-rwxr-xr-xjs/document/templates/html/package.json1
-rwxr-xr-xjs/document/views/design.js2
5 files changed, 17 insertions, 7 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js
index f9844b70..033e16f6 100755
--- a/js/document/models/base.js
+++ b/js/document/models/base.js
@@ -93,7 +93,7 @@ exports.BaseDocumentModel = Montage.create(Component, {
93 //Currently only supporting current browser (Chrome, obviously) 93 //Currently only supporting current browser (Chrome, obviously)
94 switch (this.browser) { 94 switch (this.browser) {
95 case 'chrome': 95 case 'chrome':
96 if (this.template.type === 'banner' || this.template.type === 'animation') { 96 if (this.template && (this.template.type === 'banner' || this.template.type === 'animation')) {
97 window.open('/js/document/templates/preview/banner.html?width='+this.template.size.width+'&height='+this.template.size.height+'&url='+this.url); 97 window.open('/js/document/templates/preview/banner.html?width='+this.template.size.width+'&height='+this.template.size.height+'&url='+this.url);
98 } else { 98 } else {
99 window.open(this.url); 99 window.open(this.url);
diff --git a/js/document/templates/html/index.html b/js/document/templates/html/index.html
index a1b8b242..24159841 100755
--- a/js/document/templates/html/index.html
+++ b/js/document/templates/html/index.html
@@ -12,6 +12,9 @@
12 must set the 'data-ninja-template' 12 must set the 'data-ninja-template'
13 data-ninja-template="true" 13 data-ninja-template="true"
14--> 14-->
15
16<!-- TODO: Determine if loading Montage is always needed or if it could be done author-time or on file open -->
17
15<html> 18<html>
16 19
17 <head> 20 <head>
@@ -58,8 +61,6 @@
58 return document.elementFromPoint(x,y); 61 return document.elementFromPoint(x,y);
59 } 62 }
60 </script> 63 </script>
61
62 <!-- TODO: Determine if loading Montage is always needed or if it could be done author-time or on file open -->
63 64
64 <script type="text/javascript" data-package="." src="../../../../node_modules/montage/montage.js" data-ninja-template="true"></script> 65 <script type="text/javascript" data-package="." src="../../../../node_modules/montage/montage.js" data-ninja-template="true"></script>
65 66
diff --git a/js/document/templates/html/main.js b/js/document/templates/html/main.js
index d5ac88d5..f45657bb 100644
--- a/js/document/templates/html/main.js
+++ b/js/document/templates/html/main.js
@@ -3,8 +3,10 @@
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<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. 4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */ 5 </copyright> */
6var Montage = require("montage/core/core").Montage, 6var Montage = require("montage/core/core").Montage,
7 Component = require("montage/ui/component").Component; 7 Component = require("montage/ui/component").Component,
8 Template = require("montage/ui/template").Template,
9 TemplateCreator = require("tools/template/template-creator").TemplateCreator;
8 10
9exports.Main = Montage.create(Component, { 11exports.Main = Montage.create(Component, {
10 12
@@ -18,6 +20,7 @@ exports.Main = Montage.create(Component, {
18 templateDidLoad: { 20 templateDidLoad: {
19 value: function(){ 21 value: function(){
20 var self = this; 22 var self = this;
23 //
21 window.addComponent = function(element, data, callback) { 24 window.addComponent = function(element, data, callback) {
22 var component; 25 var component;
23 26
@@ -36,7 +39,12 @@ exports.Main = Montage.create(Component, {
36 .end(); 39 .end();
37 40
38 }; 41 };
39 42 //
43 window.mjsTemplateCreator = TemplateCreator.create();
44 //
45 window.mjsTemplate = Template.create();
46
47
40 // Dispatch event when this template has loaded. 48 // Dispatch event when this template has loaded.
41 /* 49 /*
42 var newEvent = document.createEvent( "CustomEvent" ); 50 var newEvent = document.createEvent( "CustomEvent" );
diff --git a/js/document/templates/html/package.json b/js/document/templates/html/package.json
index d1e839dc..4f36090a 100755
--- a/js/document/templates/html/package.json
+++ b/js/document/templates/html/package.json
@@ -4,6 +4,7 @@
4 }, 4 },
5 "mappings": { 5 "mappings": {
6 "montage": "../../../../node_modules/montage/", 6 "montage": "../../../../node_modules/montage/",
7 "tools": "../../../../node_modules/tools/",
7 "montage-google": "../../../../node_modules/montage-google/" 8 "montage-google": "../../../../node_modules/montage-google/"
8 } 9 }
9} \ No newline at end of file 10} \ No newline at end of file
diff --git a/js/document/views/design.js b/js/document/views/design.js
index c7aab1d7..3b2eb11f 100755
--- a/js/document/views/design.js
+++ b/js/document/views/design.js
@@ -347,7 +347,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
347 // 347 //
348 initMontage: { 348 initMontage: {
349 value: function () { 349 value: function () {
350 // 350 //initWithDocument(window.document) instantiateWithOwnerAndDocument(null, window.document)
351 } 351 }
352 }, 352 },
353 //////////////////////////////////////////////////////////////////// 353 ////////////////////////////////////////////////////////////////////