From d75aff9e251f84a13c326668a5271b5852dcde53 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 10 May 2012 15:36:24 -0700 Subject: Adding webRequest API Adding webRequest API to handle local URLs intercepting. Should be a temp fix. --- js/controllers/document-controller.js | 6 ++---- js/document/views/design.js | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 58fa4de7..84e9f4fc 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -89,8 +89,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, //TODO: Ensure these APIs are not needed - /* -//////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// // handleWebRequest: { value: function (request) { @@ -100,7 +99,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, //console.log(request); //console.log(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1], request.url); //return {redirectUrl: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+request.url.split('/')[request.url.split('/').length-1]}; - return {redirectUrl: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+request.url.split(chrome.extension.getURL('js/document/templates/montage-html/'))[1]}; + return {redirectUrl: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+request.url.split(chrome.extension.getURL('js/document/templates/montage-web/'))[1]}; } } }, @@ -120,7 +119,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component, } }, //////////////////////////////////////////////////////////////////// -*/ diff --git a/js/document/views/design.js b/js/document/views/design.js index 1a8f4986..321f93e8 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -71,6 +71,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { // render: { value: function (callback, template) {//TODO: Add support for templates + this.application.ninja.documentController._hackRootFlag = false; //Storing callback for dispatch ready this._callback = callback; //Adding listener to know when template is loaded to then load user content @@ -83,6 +84,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { // onTemplateLoad: { value: function (e) { + this.application.ninja.documentController._hackRootFlag = true; //TODO: Add support to constructing URL with a base HREF var basetag = this.content.document.getElementsByTagName('base'); //Removing event -- cgit v1.2.3