From d47c4c0f6053fb8390526f32c2ee08dee0bdec20 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 17 Feb 2012 15:22:23 -0800 Subject: Chrome Preview --- js/document/html-document.js | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'js/document') diff --git a/js/document/html-document.js b/js/document/html-document.js index ae2b4600..77cc711d 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -363,6 +363,9 @@ exports.HTMLDocument = Montage.create(TextDocument, { // handleEvent: { value: function(event){ + //TODO: Remove + window.hackPreview = this.livePreview.bind(this); + this.application.ninja.documentController._hackRootFlag = true; //console.log(this._userDocument.root, this); //TODO: Clean up, using for prototyping save @@ -471,6 +474,48 @@ exports.HTMLDocument = Montage.create(TextDocument, { } }, + + + + + + + + + + + + + + + + + + + + + + + //////////////////////////////////////////////////////////////////// + // + livePreview: { + enumerable: false, + value: function () { + //this.application.ninja.documentController + //console.log(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]); + chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]}); + } + }, + //////////////////////////////////////////////////////////////////// + + + + + + + + + //////////////////////////////////////////////////////////////////// // save: { -- cgit v1.2.3