From 36c7e9a31e5197fee6824ffe746d715b24bcadcb Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 24 May 2012 00:25:14 -0700 Subject: Renaming variable as it will now be used This is no longer a temp fix, it might be a permanent boolean to open/close web-request API gates. --- js/controllers/document-controller.js | 6 +++--- js/document/views/base.js | 2 +- js/document/views/design.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index f84e4da5..c61441b7 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -22,7 +22,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, value: [] }, - _hackRootFlag: { + redirectRequests: { value: false }, @@ -74,7 +74,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, handleWebRequest: { value: function (request) { //TODO: Check if frameId is proper - if (this._hackRootFlag && request.parentFrameId !== -1) { + if (this.redirectRequests && request.parentFrameId !== -1) { //Checking for proper URL redirect (from different directories) if (request.url.indexOf('js/document/templates/banner') !== -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/banner/'))[1]}; @@ -330,7 +330,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, } //Open in designer view - this._hackRootFlag = false; + this.redirectRequests = false; Montage.create(HTMLDocument).init(file, this, this._onOpenDocument, 'design', template); break; default: diff --git a/js/document/views/base.js b/js/document/views/base.js index db72cc60..d13dce1a 100755 --- a/js/document/views/base.js +++ b/js/document/views/base.js @@ -28,7 +28,7 @@ exports.BaseDocumentView = Montage.create(Component, { value: null }, //////////////////////////////////////////////////////////////////// - // + //TODO: This should be renamed to better illustrate it's a container (iframe for design, div for code view) iframe: { get: function() {return this._iframe;}, set: function(value) {this._iframe= value;} diff --git a/js/document/views/design.js b/js/document/views/design.js index a69b7a81..d1c75c01 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js @@ -87,7 +87,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { render: { value: function (callback, template) { //TODO: Remove, this is a temp patch for webRequest API gate - this.application.ninja.documentController._hackRootFlag = false; + this.application.ninja.documentController.redirectRequests = false; //Storing callback for dispatch ready this._callback = callback; this._template = template; @@ -106,7 +106,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { onTemplateLoad: { value: function (e) { //console.log(this.iframe.contentWindow); - this.application.ninja.documentController._hackRootFlag = true; + this.application.ninja.documentController.redirectRequests = true; //TODO: Add support to constructing URL with a base HREF var basetag = this.content.document.getElementsByTagName('base'); //Removing event -- cgit v1.2.3