diff options
author | Nivesh Rajbhandari | 2012-05-14 14:39:13 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-05-14 14:39:13 -0700 |
commit | a0cca95a60e71b4c35c097e0be4be9cf0814e987 (patch) | |
tree | 46afb3964a0bf7a09b148fe210467bf45c1274bd /js | |
parent | cfd3a44bb7aba54c15fab59eff39ecdffcb7ac11 (diff) | |
parent | 8d367ec7b4749ad390a0e15bb0418efc60970b54 (diff) | |
download | ninja-a0cca95a60e71b4c35c097e0be4be9cf0814e987.tar.gz |
Merge branch 'refs/heads/dom-architecture-master' into Dom-Architecture
Diffstat (limited to 'js')
-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 3ce4ba81..48033b61 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 | }, |