aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/document-controller.js6
-rwxr-xr-xjs/document/views/base.js2
-rwxr-xr-xjs/document/views/design.js4
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,
22 value: [] 22 value: []
23 }, 23 },
24 24
25 _hackRootFlag: { 25 redirectRequests: {
26 value: false 26 value: false
27 }, 27 },
28 28
@@ -74,7 +74,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
74 handleWebRequest: { 74 handleWebRequest: {
75 value: function (request) { 75 value: function (request) {
76 //TODO: Check if frameId is proper 76 //TODO: Check if frameId is proper
77 if (this._hackRootFlag && request.parentFrameId !== -1) { 77 if (this.redirectRequests && request.parentFrameId !== -1) {
78 //Checking for proper URL redirect (from different directories) 78 //Checking for proper URL redirect (from different directories)
79 if (request.url.indexOf('js/document/templates/banner') !== -1) { 79 if (request.url.indexOf('js/document/templates/banner') !== -1) {
80 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]}; 80 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,
330 } 330 }
331 331
332 //Open in designer view 332 //Open in designer view
333 this._hackRootFlag = false; 333 this.redirectRequests = false;
334 Montage.create(HTMLDocument).init(file, this, this._onOpenDocument, 'design', template); 334 Montage.create(HTMLDocument).init(file, this, this._onOpenDocument, 'design', template);
335 break; 335 break;
336 default: 336 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, {
28 value: null 28 value: null
29 }, 29 },
30 //////////////////////////////////////////////////////////////////// 30 ////////////////////////////////////////////////////////////////////
31 // 31 //TODO: This should be renamed to better illustrate it's a container (iframe for design, div for code view)
32 iframe: { 32 iframe: {
33 get: function() {return this._iframe;}, 33 get: function() {return this._iframe;},
34 set: function(value) {this._iframe= value;} 34 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, {
87 render: { 87 render: {
88 value: function (callback, template) { 88 value: function (callback, template) {
89 //TODO: Remove, this is a temp patch for webRequest API gate 89 //TODO: Remove, this is a temp patch for webRequest API gate
90 this.application.ninja.documentController._hackRootFlag = false; 90 this.application.ninja.documentController.redirectRequests = false;
91 //Storing callback for dispatch ready 91 //Storing callback for dispatch ready
92 this._callback = callback; 92 this._callback = callback;
93 this._template = template; 93 this._template = template;
@@ -106,7 +106,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
106 onTemplateLoad: { 106 onTemplateLoad: {
107 value: function (e) { 107 value: function (e) {
108 //console.log(this.iframe.contentWindow); 108 //console.log(this.iframe.contentWindow);
109 this.application.ninja.documentController._hackRootFlag = true; 109 this.application.ninja.documentController.redirectRequests = true;
110 //TODO: Add support to constructing URL with a base HREF 110 //TODO: Add support to constructing URL with a base HREF
111 var basetag = this.content.document.getElementsByTagName('base'); 111 var basetag = this.content.document.getElementsByTagName('base');
112 //Removing event 112 //Removing event