diff options
author | Ananya Sen | 2012-02-23 13:52:32 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-23 13:52:32 -0800 |
commit | ec3d07c2fea4e79c68606234074f43d694982e5b (patch) | |
tree | dc7c830c361d35c04a4d9b6d55c6c36d7a5d61cd /js/controllers/document-controller.js | |
parent | 7283884c39df537694b21419a3ea9e3ca7793b4b (diff) | |
parent | 287a0bad5b774a380ec6c8b3ddf24dc03234e248 (diff) | |
download | ninja-ec3d07c2fea4e79c68606234074f43d694982e5b.tar.gz |
Merge branch 'refs/heads/FileIO-jose' into FileIO
Conflicts:
js/document/html-document.js
js/helper-classes/3D/snap-manager.js
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-x | js/controllers/document-controller.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index f323ed99..6f7d098f 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -59,6 +59,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
59 | this.eventManager.addEventListener("executeNewFile", this, false); | 59 | this.eventManager.addEventListener("executeNewFile", this, false); |
60 | this.eventManager.addEventListener("executeSave", this, false); | 60 | this.eventManager.addEventListener("executeSave", this, false); |
61 | this.eventManager.addEventListener("executeSaveAs", this, false); | 61 | this.eventManager.addEventListener("executeSaveAs", this, false); |
62 | this.eventManager.addEventListener("executeSaveAll", this, false); | ||
62 | 63 | ||
63 | this.eventManager.addEventListener("recordStyleChanged", this, false); | 64 | this.eventManager.addEventListener("recordStyleChanged", this, false); |
64 | 65 | ||
@@ -85,8 +86,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
85 | // | 86 | // |
86 | handleAppLoaded: { | 87 | handleAppLoaded: { |
87 | value: function() { | 88 | value: function() { |
88 | //Adding an intercept to resources loaded to ensure user assets load from cloud simulator | 89 | //Checking for app not to be loaded via http/https to add app only listener |
89 | chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: ["<all_urls>"]}, ["blocking"]); | 90 | if (window.location.protocol !== 'http:' && window.location.protocol !== 'https:') { |
91 | //Adding an intercept to resources loaded to ensure user assets load from cloud simulator | ||
92 | chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: ["<all_urls>"]}, ["blocking"]); | ||
93 | } | ||
90 | } | 94 | } |
91 | }, | 95 | }, |
92 | //////////////////////////////////////////////////////////////////// | 96 | //////////////////////////////////////////////////////////////////// |
@@ -130,6 +134,16 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
130 | } | 134 | } |
131 | }, | 135 | }, |
132 | //////////////////////////////////////////////////////////////////// | 136 | //////////////////////////////////////////////////////////////////// |
137 | //TODO: Check for appropiate structures | ||
138 | handleExecuteSaveAll: { | ||
139 | value: function(event) { | ||
140 | if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ | ||
141 | //Text and HTML document classes should return the same save object for fileSave | ||
142 | this.application.ninja.ioMediator.fileSave(this.activeDocument.saveAll(), this.fileSaveResult.bind(this)); | ||
143 | } | ||
144 | } | ||
145 | }, | ||
146 | //////////////////////////////////////////////////////////////////// | ||
133 | handleExecuteSaveAs: { | 147 | handleExecuteSaveAs: { |
134 | value: function(event) { | 148 | value: function(event) { |
135 | var saveAsSettings = event._event.settings || {}; | 149 | var saveAsSettings = event._event.settings || {}; |