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.js40
1 files changed, 21 insertions, 19 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index e279d5c5..3cd2c254 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -66,35 +66,37 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
66 66
67 67
68 68
69
70
71
72
73 ////////////////////////////////////////////////////////////////////
74 //
69 handleWebRequest: { 75 handleWebRequest: {
70 value: function (request) { 76 value: function (request) {
71 if (request.url.indexOf('js/document/templates/montage-html') !== -1) { 77 if (this._hackRootFlag && request.url.indexOf('js/document/templates/montage-html') !== -1) {
72 78 //TODO: Optimize creating string
73 //console.log(request); 79 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]};
74
75 //TODO: Figure out why active document is not available here
76
77 if (this._hackRootFlag) {
78
79 //console.log(request.url.split('/')[request.url.split('/').length-1]);
80 //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]);
81
82 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]};
83 }
84 } 80 }
85 } 81 }
86 }, 82 },
87 83 ////////////////////////////////////////////////////////////////////
88 84 //
89 handleAppLoaded: { 85 handleAppLoaded: {
90 value: function() { 86 value: function() {
91 // 87 //Adding an intercept to resources loaded to ensure user assets load from cloud simulator
92
93 chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: ["<all_urls>"]}, ["blocking"]); 88 chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: ["<all_urls>"]}, ["blocking"]);
94
95 } 89 }
96 }, 90 },
97 91 ////////////////////////////////////////////////////////////////////
92
93
94
95
96
97
98
99
98 handleExecuteFileOpen: { 100 handleExecuteFileOpen: {
99 value: function(event) { 101 value: function(event) {
100 var pickerSettings = event._event.settings || {}; 102 var pickerSettings = event._event.settings || {};