aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-05-22 18:02:01 -0700
committerJose Antonio Marquez2012-05-22 18:02:01 -0700
commit75fe4f36a6768d688792bc1925cfa4bfa508ac3e (patch)
tree1e7a3360ffbc8044172e136bdf06043cd538fd82
parentb3e85f609f704d668c8022c53418f8056bc71260 (diff)
downloadninja-75fe4f36a6768d688792bc1925cfa4bfa508ac3e.tar.gz
Adding redirect from app folder in templates
This doesn't resolve the issue of XHR requests made in Montage.
-rwxr-xr-xjs/controllers/document-controller.js3
-rwxr-xr-xjs/document/views/design.js1
2 files changed, 3 insertions, 1 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index d99fadbb..2eba556e 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -80,6 +80,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
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]};
81 } else if (request.url.indexOf('js/document/templates/html') !== -1) { 81 } else if (request.url.indexOf('js/document/templates/html') !== -1) {
82 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/html/'))[1]}; 82 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/html/'))[1]};
83 } else if (request.url.indexOf('js/document/templates/app') !== -1) {
84 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/app/'))[1]};
83 } else { 85 } else {
84 //Error, not a valid folder 86 //Error, not a valid folder
85 } 87 }
@@ -103,7 +105,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
103 }, 105 },
104 //////////////////////////////////////////////////////////////////// 106 ////////////////////////////////////////////////////////////////////
105 107
106
107 108
108 109
109 110
diff --git a/js/document/views/design.js b/js/document/views/design.js
index b3887fdf..6da1b2e4 100755
--- a/js/document/views/design.js
+++ b/js/document/views/design.js
@@ -105,6 +105,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
105 // 105 //
106 onTemplateLoad: { 106 onTemplateLoad: {
107 value: function (e) { 107 value: function (e) {
108 //console.log(this.iframe.contentWindow);
108 this.application.ninja.documentController._hackRootFlag = true; 109 this.application.ninja.documentController._hackRootFlag = true;
109 //TODO: Add support to constructing URL with a base HREF 110 //TODO: Add support to constructing URL with a base HREF
110 var basetag = this.content.document.getElementsByTagName('base'); 111 var basetag = this.content.document.getElementsByTagName('base');