aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/document-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-xjs/controllers/document-controller.js16
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 }