diff options
author | Valerio Virgillito | 2012-05-14 17:28:00 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-14 17:28:00 -0700 |
commit | 8009663c4f1bbf5ae457393fb8a3454df2625071 (patch) | |
tree | 65ece2e94092cc5a177f830858008478df09d6d9 /js/controllers | |
parent | 8f8eb57f4506987942745c3325492e939ed3caa8 (diff) | |
parent | 6fe05fc4f518000cf9a7af3c34381af16579a6d6 (diff) | |
download | ninja-8009663c4f1bbf5ae457393fb8a3454df2625071.tar.gz |
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into dom-architecture
Diffstat (limited to 'js/controllers')
-rwxr-xr-x | js/controllers/document-controller.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 0a91ae29..48ceb21b 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 | }, |
@@ -683,8 +686,9 @@ if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){ | |||
683 | } | 686 | } |
684 | 687 | ||
685 | if(needsRule) { | 688 | if(needsRule) { |
686 | rule = sc.addRule('body{}'); | 689 | rule = sc.addRule('.ninja-body{}'); |
687 | sc.setStyles(rule, styles); | 690 | sc.setStyles(rule, styles); |
691 | sc.addClass(docRoot, "ninja-body"); | ||
688 | } | 692 | } |
689 | } | 693 | } |
690 | } | 694 | } |