aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-14 10:47:05 -0700
committerValerio Virgillito2012-05-14 10:47:05 -0700
commit05db3c7df3126cbd770112cd26a39aab91a95c17 (patch)
tree18d6069617d3a895c61c4732838f7b46fef0ad07 /js
parent3b158d7368a41a634b839281fede96445907d15b (diff)
parent1559abff592b976e6b983881fe208da4257e98f7 (diff)
downloadninja-05db3c7df3126cbd770112cd26a39aab91a95c17.tar.gz
Merge pull request #225 from joseeight/Document
Fixing URL bug
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/document-controller.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index d88059ab..e6b543d7 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -95,11 +95,14 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
95 value: function (request) { 95 value: function (request) {
96 //TODO: Check if frameId is proper 96 //TODO: Check if frameId is proper
97 if (this._hackRootFlag && request.parentFrameId !== -1) { 97 if (this._hackRootFlag && request.parentFrameId !== -1) {
98 //TODO: Optimize creating string 98 //Checking for proper URL redirect (from different directories)
99 //console.log(request); 99 if (request.url.indexOf('js/document/templates/banner') !== -1) {
100 //console.log(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1], request.url); 100 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]};
101 //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]}; 101 } else if (request.url.indexOf('js/document/templates/html') !== -1) {
102 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/'))[1]}; 102 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]};
103 } else {
104 //Error, not a valid folder
105 }
103 } 106 }
104 } 107 }
105 }, 108 },