From 4504972c1f3b9bf1d02a4484a07a8a85cf9ccee2 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 8 May 2012 10:37:38 -0700 Subject: Adding Chrome Preview --- js/controllers/document-controller.js | 4 +++- js/document/models/base.js | 11 ++++++++--- js/document/views/design.js | 2 +- js/ninja.reel/ninja.js | 9 +++++++-- 4 files changed, 19 insertions(+), 7 deletions(-) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 803519a7..6a25420a 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -88,7 +88,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component, - + //TODO: Ensure these APIs are not needed + /* //////////////////////////////////////////////////////////////////// // handleWebRequest: { @@ -119,6 +120,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, } }, //////////////////////////////////////////////////////////////////// +*/ diff --git a/js/document/models/base.js b/js/document/models/base.js index 746922ad..5667fb24 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -68,19 +68,24 @@ exports.BaseDocumentModel = Montage.create(Component, { //////////////////////////////////////////////////////////////////// // switchViewTo: { - value: function () { + value: function (view) { // } }, //////////////////////////////////////////////////////////////////// - // + //TODO: Add API to allow other browser support browserPreview: { value: function (browser) { - // + + //TODO: Add file save before previewing + + //Currently only supporting current browser (Chrome, obviously) switch (browser) { case 'chrome': + window.open(this.application.ninja.coreIoApi.rootUrl + this.file.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]); break; default: + window.open(this.application.ninja.coreIoApi.rootUrl + this.file.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]); break; } } diff --git a/js/document/views/design.js b/js/document/views/design.js index b23ebe78..df6e9b53 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -230,7 +230,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { initWebGl: { value: function (scripttags) { // - var i, n, webgldata; + var n, webgldata; //Setting the iFrame property for reference in helper class this.model.webGlHelper.iframe = this.model.views.design.iframe; //Checking for webGL Data diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index edc1efa4..4d7d883d 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -173,12 +173,17 @@ exports.Ninja = Montage.create(Component, { } }, + + //////////////////////////////////////////////////////////////////// + //TODO: Expand method to allow other browsers for preview executeChromePreview: { value: function () { - this.application.ninja.documentController.activeDocument.livePreview(); + this.application.ninja.documentController.activeDocument.model.browserPreview('chrome'); } }, - + //////////////////////////////////////////////////////////////////// + + handleResize: { value: function() { this.stage.resizeCanvases = true; -- cgit v1.2.3