From 1559abff592b976e6b983881fe208da4257e98f7 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 14 May 2012 10:44:42 -0700 Subject: Fixing webRequest URL parsing --- js/controllers/document-controller.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'js/controllers/document-controller.js') 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, value: function (request) { //TODO: Check if frameId is proper if (this._hackRootFlag && request.parentFrameId !== -1) { - //TODO: Optimize creating string - //console.log(request); - //console.log(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1], request.url); - //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]}; - 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]}; + //Checking for proper URL redirect (from different directories) + if (request.url.indexOf('js/document/templates/banner') !== -1) { + 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]}; + } else if (request.url.indexOf('js/document/templates/html') !== -1) { + 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]}; + } else { + //Error, not a valid folder + } } } }, -- cgit v1.2.3 From 734b6ad96d25bb67d0db4a0a75c331468e194809 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 14 May 2012 12:05:41 -0700 Subject: Fixing 3d to work in banner templates. Signed-off-by: Nivesh Rajbhandari --- js/controllers/document-controller.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/controllers/document-controller.js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index d88059ab..3b6eb5bf 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -683,8 +683,11 @@ if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){ } if(needsRule) { - rule = sc.addRule('body{}'); +// rule = sc.addRule('body{}'); +// sc.setStyles(rule, styles); + rule = sc.addRule('.ninjaUserDoc{}'); sc.setStyles(rule, styles); + sc.addClass(docRoot, "ninjaUserDoc"); } } } -- cgit v1.2.3 From cfd3a44bb7aba54c15fab59eff39ecdffcb7ac11 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 14 May 2012 14:38:35 -0700 Subject: Viewport for banner templates so content doesn't push through "body". Signed-off-by: Nivesh Rajbhandari --- js/controllers/document-controller.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'js/controllers/document-controller.js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 3b6eb5bf..3ce4ba81 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -683,11 +683,9 @@ if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){ } if(needsRule) { -// rule = sc.addRule('body{}'); -// sc.setStyles(rule, styles); - rule = sc.addRule('.ninjaUserDoc{}'); + rule = sc.addRule('.ninja-body{}'); sc.setStyles(rule, styles); - sc.addClass(docRoot, "ninjaUserDoc"); + sc.addClass(docRoot, "ninja-body"); } } } -- cgit v1.2.3