diff options
-rwxr-xr-x | js/controllers/document-controller.js | 13 |
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 | }, |