diff options
author | Valerio Virgillito | 2012-05-10 15:40:52 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-10 15:40:52 -0700 |
commit | c23c4bad96ebc4c2f85070e4cc2511030cac05fc (patch) | |
tree | c6b05f10925c9612925bc77712e2cd0eda9e179d | |
parent | 9ace5e2348ead2cd40542531c54b4a243974d266 (diff) | |
parent | de7a9dd3cfe090362957d4fa7250e290c7aba20c (diff) | |
download | ninja-c23c4bad96ebc4c2f85070e4cc2511030cac05fc.tar.gz |
Merge pull request #214 from joseeight/Document
Adding webRequest API
-rwxr-xr-x | js/controllers/document-controller.js | 6 | ||||
-rwxr-xr-x | js/document/views/design.js | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 58fa4de7..84e9f4fc 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -89,8 +89,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
89 | 89 | ||
90 | 90 | ||
91 | //TODO: Ensure these APIs are not needed | 91 | //TODO: Ensure these APIs are not needed |
92 | /* | 92 | //////////////////////////////////////////////////////////////////// |
93 | //////////////////////////////////////////////////////////////////// | ||
94 | // | 93 | // |
95 | handleWebRequest: { | 94 | handleWebRequest: { |
96 | value: function (request) { | 95 | value: function (request) { |
@@ -100,7 +99,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
100 | //console.log(request); | 99 | //console.log(request); |
101 | //console.log(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1], request.url); | 100 | //console.log(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1], request.url); |
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('/')[request.url.split('/').length-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]}; |
103 | 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/montage-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/montage-web/'))[1]}; |
104 | } | 103 | } |
105 | } | 104 | } |
106 | }, | 105 | }, |
@@ -120,7 +119,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
120 | } | 119 | } |
121 | }, | 120 | }, |
122 | //////////////////////////////////////////////////////////////////// | 121 | //////////////////////////////////////////////////////////////////// |
123 | */ | ||
124 | 122 | ||
125 | 123 | ||
126 | 124 | ||
diff --git a/js/document/views/design.js b/js/document/views/design.js index 1a8f4986..321f93e8 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -71,6 +71,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
71 | // | 71 | // |
72 | render: { | 72 | render: { |
73 | value: function (callback, template) {//TODO: Add support for templates | 73 | value: function (callback, template) {//TODO: Add support for templates |
74 | this.application.ninja.documentController._hackRootFlag = false; | ||
74 | //Storing callback for dispatch ready | 75 | //Storing callback for dispatch ready |
75 | this._callback = callback; | 76 | this._callback = callback; |
76 | //Adding listener to know when template is loaded to then load user content | 77 | //Adding listener to know when template is loaded to then load user content |
@@ -83,6 +84,7 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
83 | // | 84 | // |
84 | onTemplateLoad: { | 85 | onTemplateLoad: { |
85 | value: function (e) { | 86 | value: function (e) { |
87 | this.application.ninja.documentController._hackRootFlag = true; | ||
86 | //TODO: Add support to constructing URL with a base HREF | 88 | //TODO: Add support to constructing URL with a base HREF |
87 | var basetag = this.content.document.getElementsByTagName('base'); | 89 | var basetag = this.content.document.getElementsByTagName('base'); |
88 | //Removing event | 90 | //Removing event |