From cfc2a432323d4620b1f4ca2061bbe57f46e7eaf7 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 16 Feb 2012 23:10:15 -0800 Subject: Moving Ninja iFrame templates --- js/document/html-document.js | 11 +++- .../templates/montage-html/default_html.css | 75 ++++++++++++++++++++++ js/document/templates/montage-html/index.html | 50 +++++++++++++++ .../templates/montage-html/main.reel/main.js | 55 ++++++++++++++++ js/document/templates/montage-html/package.json | 8 +++ js/document/templates/montage-html/styles.css | 5 ++ .../montage-application-cloud/default_html.css | 75 ---------------------- .../montage-application-cloud/index.html | 50 --------------- .../montage-application-cloud/main.reel/main.js | 55 ---------------- .../montage-application-cloud/package.json | 8 --- .../montage-application-cloud/styles.css | 5 -- 11 files changed, 202 insertions(+), 195 deletions(-) create mode 100755 js/document/templates/montage-html/default_html.css create mode 100755 js/document/templates/montage-html/index.html create mode 100644 js/document/templates/montage-html/main.reel/main.js create mode 100755 js/document/templates/montage-html/package.json create mode 100755 js/document/templates/montage-html/styles.css delete mode 100755 user-document-templates/montage-application-cloud/default_html.css delete mode 100755 user-document-templates/montage-application-cloud/index.html delete mode 100644 user-document-templates/montage-application-cloud/main.reel/main.js delete mode 100755 user-document-templates/montage-application-cloud/package.json delete mode 100755 user-document-templates/montage-application-cloud/styles.css diff --git a/js/document/html-document.js b/js/document/html-document.js index 0c8695fb..a5483f40 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -14,7 +14,7 @@ var Montage = require("montage/core/core").Montage, exports.HTMLDocument = Montage.create(TextDocument, { _selectionExclude: { value: null, enumerable: false }, - _htmlTemplateUrl: { value: "user-document-templates/montage-application-cloud/index.html", enumerable: false}, + _htmlTemplateUrl: { value: "js/document/templates/montage-html/index.html", enumerable: false}, _iframe: { value: null, enumerable: false }, _server: { value: null, enumerable: false }, _templateDocument: { value: null, enumerable: false }, @@ -235,6 +235,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { // initialize: { value: function(file, uuid, iframe, callback) { + //console.log('allow'); // this._userDocument = file; // @@ -359,6 +360,8 @@ exports.HTMLDocument = Montage.create(TextDocument, { // handleEvent: { value: function(event){ + //console.log('end'); + //console.log('file content start'); //TODO: Clean up, using for prototyping save this._templateDocument = {}; this._templateDocument.head = this.iframe.contentWindow.document.getElementById("userHead");; @@ -389,6 +392,8 @@ exports.HTMLDocument = Montage.create(TextDocument, { this._stylesheets = this._document.styleSheets; // Entire stlyesheets array this.callback(this); + + //console.log('file content end'); } }.bind(this), 50); @@ -440,7 +445,9 @@ exports.HTMLDocument = Montage.create(TextDocument, { } // Remving this callback and using the callback from the css load - // this.callback(this); + //this.callback(this); + + } }, diff --git a/js/document/templates/montage-html/default_html.css b/js/document/templates/montage-html/default_html.css new file mode 100755 index 00000000..68300edf --- /dev/null +++ b/js/document/templates/montage-html/default_html.css @@ -0,0 +1,75 @@ +/* +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. +
*/ + +* { + -webkit-transition-duration: 0s !important; + -webkit-animation-duration: 0s !important; + -webkit-animation-name: none !important; +} + +html{ + overflow:hidden; +} + +body +{ + background: #808080; +} + +#Viewport +{ + margin: 0px; + padding: 0px; + top: 200px; + left: 700px; + /*position: absolute;*/ + /*height: 600px;*/ + /*width: 800px;*/ + opacity: 0.99; + z-index:2; +} + +#stageBG +{ + background: #ffffff; + top: 200px; + left: 700px; + z-index:1; +} + +.stageDimension +{ + position: absolute; + height: 600px; + width: 800px; +} + +.stageView +{ + border: 1px solid black; + -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); +} + +.stageContentShadow { + -webkit-box-shadow: 3px 5px 4px rgba(0,0,0,.5); + -moz-box-shadow: 3px 5px 4px rgba(0,0,0,.5); + box-shadow: 3px 5px 4px rgba(0,0,0,.5); +} + +#userHead +{ + display: none; +} + +.global3DSettings { + -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); +} + +.elem-red-outline { + outline: red solid thin; +} \ No newline at end of file diff --git a/js/document/templates/montage-html/index.html b/js/document/templates/montage-html/index.html new file mode 100755 index 00000000..8b3d73bb --- /dev/null +++ b/js/document/templates/montage-html/index.html @@ -0,0 +1,50 @@ + + + + + + + + Ninja Prototype + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/js/document/templates/montage-html/main.reel/main.js b/js/document/templates/montage-html/main.reel/main.js new file mode 100644 index 00000000..86871fd3 --- /dev/null +++ b/js/document/templates/montage-html/main.reel/main.js @@ -0,0 +1,55 @@ +/* + 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; + +//var Button = ("montage/ui/button.reel").Button; + +exports.Main = Montage.create(Component, { + + hasTemplate: { + value: false + }, + + /** + * Adding window hooks to callback into this object from Ninja. + */ + templateDidLoad: { + value: function(){ + window.addComponent = this.addComponentToUserDocument; +// window.addBinding = this.addBindingToUserDocument; + + // Dispatch event when this template has loaded. + var newEvent = document.createEvent( "CustomEvent" ); + newEvent.initCustomEvent( "userTemplateDidLoad", false, true ); + + document.body.dispatchEvent( newEvent ); + + } + }, + + addComponentToUserDocument:{ + value: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.deserializedFromTemplate(); + componentInstance.needsDraw = true; + + callback(componentInstance, element); + }) + .end(); + + } + } + +}); \ No newline at end of file diff --git a/js/document/templates/montage-html/package.json b/js/document/templates/montage-html/package.json new file mode 100755 index 00000000..c8bc02fb --- /dev/null +++ b/js/document/templates/montage-html/package.json @@ -0,0 +1,8 @@ +{ + "directories": { + "lib": "" + }, + "mappings": { + "montage": "../../../../node_modules/montage/" + } +} \ No newline at end of file diff --git a/js/document/templates/montage-html/styles.css b/js/document/templates/montage-html/styles.css new file mode 100755 index 00000000..0441c1cf --- /dev/null +++ b/js/document/templates/montage-html/styles.css @@ -0,0 +1,5 @@ +/* + 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. +
*/ \ No newline at end of file diff --git a/user-document-templates/montage-application-cloud/default_html.css b/user-document-templates/montage-application-cloud/default_html.css deleted file mode 100755 index 68300edf..00000000 --- a/user-document-templates/montage-application-cloud/default_html.css +++ /dev/null @@ -1,75 +0,0 @@ -/* -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. -
*/ - -* { - -webkit-transition-duration: 0s !important; - -webkit-animation-duration: 0s !important; - -webkit-animation-name: none !important; -} - -html{ - overflow:hidden; -} - -body -{ - background: #808080; -} - -#Viewport -{ - margin: 0px; - padding: 0px; - top: 200px; - left: 700px; - /*position: absolute;*/ - /*height: 600px;*/ - /*width: 800px;*/ - opacity: 0.99; - z-index:2; -} - -#stageBG -{ - background: #ffffff; - top: 200px; - left: 700px; - z-index:1; -} - -.stageDimension -{ - position: absolute; - height: 600px; - width: 800px; -} - -.stageView -{ - border: 1px solid black; - -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); -} - -.stageContentShadow { - -webkit-box-shadow: 3px 5px 4px rgba(0,0,0,.5); - -moz-box-shadow: 3px 5px 4px rgba(0,0,0,.5); - box-shadow: 3px 5px 4px rgba(0,0,0,.5); -} - -#userHead -{ - display: none; -} - -.global3DSettings { - -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); -} - -.elem-red-outline { - outline: red solid thin; -} \ No newline at end of file diff --git a/user-document-templates/montage-application-cloud/index.html b/user-document-templates/montage-application-cloud/index.html deleted file mode 100755 index 49931969..00000000 --- a/user-document-templates/montage-application-cloud/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - Ninja Prototype - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/user-document-templates/montage-application-cloud/main.reel/main.js b/user-document-templates/montage-application-cloud/main.reel/main.js deleted file mode 100644 index 86871fd3..00000000 --- a/user-document-templates/montage-application-cloud/main.reel/main.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - 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; - -//var Button = ("montage/ui/button.reel").Button; - -exports.Main = Montage.create(Component, { - - hasTemplate: { - value: false - }, - - /** - * Adding window hooks to callback into this object from Ninja. - */ - templateDidLoad: { - value: function(){ - window.addComponent = this.addComponentToUserDocument; -// window.addBinding = this.addBindingToUserDocument; - - // Dispatch event when this template has loaded. - var newEvent = document.createEvent( "CustomEvent" ); - newEvent.initCustomEvent( "userTemplateDidLoad", false, true ); - - document.body.dispatchEvent( newEvent ); - - } - }, - - addComponentToUserDocument:{ - value: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.deserializedFromTemplate(); - componentInstance.needsDraw = true; - - callback(componentInstance, element); - }) - .end(); - - } - } - -}); \ No newline at end of file diff --git a/user-document-templates/montage-application-cloud/package.json b/user-document-templates/montage-application-cloud/package.json deleted file mode 100755 index 5466b3d7..00000000 --- a/user-document-templates/montage-application-cloud/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "directories": { - "lib": "" - }, - "mappings": { - "montage": "../../node_modules/montage/" - } -} \ No newline at end of file diff --git a/user-document-templates/montage-application-cloud/styles.css b/user-document-templates/montage-application-cloud/styles.css deleted file mode 100755 index 0441c1cf..00000000 --- a/user-document-templates/montage-application-cloud/styles.css +++ /dev/null @@ -1,5 +0,0 @@ -/* - 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. -
*/ \ No newline at end of file -- cgit v1.2.3