From 075252ad893452df446566f01d0b26eeab08be3d Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 15 Feb 2012 23:07:00 -0800 Subject: Setting up webGL library copy on save --- js/document/html-document.js | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) (limited to 'js/document/html-document.js') diff --git a/js/document/html-document.js b/js/document/html-document.js index bf9bba76..ad5417a9 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -12,7 +12,7 @@ var Montage = require("montage/core/core").Montage, //////////////////////////////////////////////////////////////////////// // exports.HTMLDocument = Montage.create(TextDocument, { - // PRIVATE MEMBERS + _selectionExclude: { value: null, enumerable: false }, _htmlTemplateUrl: { value: "user-document-templates/montage-application-cloud/index.html", enumerable: false}, _iframe: { value: null, enumerable: false }, @@ -41,7 +41,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { _zoomFactor: { value: 100, enumerable: false }, - // PUBLIC MEMBERS cssLoadInterval: { value: null, enumerable: false }, _savedLeftScroll: {value:null}, @@ -53,9 +52,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { value:null }, - /* - * PUBLIC API - */ + // GETTERS / SETTERS @@ -231,9 +228,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { } } }, - - //****************************************// - // PUBLIC METHODS + //////////////////////////////////////////////////////////////////// @@ -357,19 +352,8 @@ exports.HTMLDocument = Montage.create(TextDocument, { return this._window.getElement(x,y); } }, - - /* - // Private - _loadDocument: { - value: function(uri) { - // Load the document into the Iframe - this.iframe.src = uri; - this.iframe.addEventListener("load", this, true); - } - }, -*/ - - + + //////////////////////////////////////////////////////////////////// // @@ -475,11 +459,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { } } }, - - /** - * public method - * - */ + //////////////////////////////////////////////////////////////////// // save: { @@ -487,12 +467,12 @@ exports.HTMLDocument = Montage.create(TextDocument, { value: function () { //TODO: Add code view logic and also styles for HTML if (this.currentView === 'design') { - return {mode: 'html', document: this._userDocument, style: this._styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; + return {mode: 'html', document: this._userDocument, webgl: this.glData, style: this._styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; } else if (this.currentView === "code"){ //TODO: Would this get call when we are in code of HTML? } else { //Error - } + } } } //////////////////////////////////////////////////////////////////// -- cgit v1.2.3 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 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'js/document/html-document.js') 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); + + } }, -- cgit v1.2.3 From 66af1dd3e5aa80b257ba711600d112752ecaf655 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 17 Feb 2012 00:19:48 -0800 Subject: Adding Chrome webRequest intercept Need to add logic to resolve file's actual URL dynamically. --- js/document/html-document.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/document/html-document.js') diff --git a/js/document/html-document.js b/js/document/html-document.js index a5483f40..16595d14 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -355,13 +355,15 @@ 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");; -- cgit v1.2.3 From a42c536c2b3209afc058eabd31167bd0aa6f71c8 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 17 Feb 2012 13:40:38 -0800 Subject: Adding webRequest redirects for iFrame templates --- js/document/html-document.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/document/html-document.js') diff --git a/js/document/html-document.js b/js/document/html-document.js index 16595d14..ae2b4600 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -235,7 +235,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { // initialize: { value: function(file, uuid, iframe, callback) { - //console.log('allow'); + this.application.ninja.documentController._hackRootFlag = false; // this._userDocument = file; // @@ -363,7 +363,8 @@ exports.HTMLDocument = Montage.create(TextDocument, { // handleEvent: { value: function(event){ - + this.application.ninja.documentController._hackRootFlag = true; + //console.log(this._userDocument.root, this); //TODO: Clean up, using for prototyping save this._templateDocument = {}; this._templateDocument.head = this.iframe.contentWindow.document.getElementById("userHead");; -- cgit v1.2.3