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/document/models/base.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'js/document/models') 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; } } -- cgit v1.2.3