diff options
author | Jose Antonio Marquez | 2012-02-17 13:40:38 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-17 13:40:38 -0800 |
commit | a42c536c2b3209afc058eabd31167bd0aa6f71c8 (patch) | |
tree | 04158cd6136807bd77e8748972e165a5c91ce23b /js/controllers | |
parent | c56673e931e77b0c45b3a1c1112d16be3b599916 (diff) | |
download | ninja-a42c536c2b3209afc058eabd31167bd0aa6f71c8.tar.gz |
Adding webRequest redirects for iFrame templates
Diffstat (limited to 'js/controllers')
-rwxr-xr-x | js/controllers/document-controller.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 9785d824..5e2a6461 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -14,7 +14,7 @@ var Montage = require("montage/core/core").Montage, | |||
14 | DocumentController; | 14 | DocumentController; |
15 | //////////////////////////////////////////////////////////////////////// | 15 | //////////////////////////////////////////////////////////////////////// |
16 | // | 16 | // |
17 | DocumentController = exports.DocumentController = Montage.create(Component, { | 17 | var DocumentController = exports.DocumentController = Montage.create(Component, { |
18 | hasTemplate: { | 18 | hasTemplate: { |
19 | value: false | 19 | value: false |
20 | }, | 20 | }, |
@@ -22,6 +22,10 @@ DocumentController = exports.DocumentController = Montage.create(Component, { | |||
22 | _documents: { | 22 | _documents: { |
23 | value: [] | 23 | value: [] |
24 | }, | 24 | }, |
25 | |||
26 | _hackRootFlag: { | ||
27 | value: false | ||
28 | }, | ||
25 | 29 | ||
26 | _activeDocument: { value: null }, | 30 | _activeDocument: { value: null }, |
27 | _iframeCounter: { value: 1, enumerable: false }, | 31 | _iframeCounter: { value: 1, enumerable: false }, |
@@ -71,11 +75,13 @@ DocumentController = exports.DocumentController = Montage.create(Component, { | |||
71 | 75 | ||
72 | //TODO: Figure out why active document is not available here | 76 | //TODO: Figure out why active document is not available here |
73 | 77 | ||
74 | /* | 78 | if (this._hackRootFlag) { |
75 | if (request.url.indexOf('calculator.css') !== -1) { | 79 | |
76 | return {redirectUrl: this.application.ninja.coreIoApi.rootUrl+'/calculator/components/calculator.reel/calculator.css'}; | 80 | //console.log(request.url.split('/')[request.url.split('/').length-1]); |
81 | //console.log(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+request.url.split('/')[request.url.split('/').length-1]); | ||
82 | |||
83 | 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]}; | ||
77 | } | 84 | } |
78 | */ | ||
79 | } | 85 | } |
80 | } | 86 | } |
81 | }, | 87 | }, |
@@ -205,6 +211,9 @@ if (request.url.indexOf('calculator.css') !== -1) { | |||
205 | // | 211 | // |
206 | openDocument: { | 212 | openDocument: { |
207 | value: function(doc) { | 213 | value: function(doc) { |
214 | |||
215 | // | ||
216 | this.documentHackReference = doc; | ||
208 | // | 217 | // |
209 | switch (doc.extension) { | 218 | switch (doc.extension) { |
210 | case 'html': case 'html': | 219 | case 'html': case 'html': |
@@ -302,7 +311,6 @@ if (request.url.indexOf('calculator.css') !== -1) { | |||
302 | _onOpenDocument: { | 311 | _onOpenDocument: { |
303 | value: function(doc){ | 312 | value: function(doc){ |
304 | //var data = DocumentManager.activeDocument; | 313 | //var data = DocumentManager.activeDocument; |
305 | |||
306 | this._hideCurrentDocument(); | 314 | this._hideCurrentDocument(); |
307 | this.application.ninja.stage.stageView.hideOtherDocuments(doc.uuid); | 315 | this.application.ninja.stage.stageView.hideOtherDocuments(doc.uuid); |
308 | 316 | ||