Diffstat (limited to 'frontend/delta/js/Clipperz/PM/Proxy.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/delta/js/Clipperz/PM/Proxy.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/frontend/delta/js/Clipperz/PM/Proxy.js b/frontend/delta/js/Clipperz/PM/Proxy.js index 2ac684a..71c784f 100644 --- a/frontend/delta/js/Clipperz/PM/Proxy.js +++ b/frontend/delta/js/Clipperz/PM/Proxy.js | |||
@@ -123,64 +123,65 @@ Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, { | |||
123 | 123 | ||
124 | 'message': function (someParameters) { | 124 | 'message': function (someParameters) { |
125 | return this.processMessage('message', someParameters, 'MESSAGE'); | 125 | return this.processMessage('message', someParameters, 'MESSAGE'); |
126 | }, | 126 | }, |
127 | 127 | ||
128 | 'logout': function (someParameters) { | 128 | 'logout': function (someParameters) { |
129 | return this.processMessage('logout', someParameters, 'MESSAGE'); | 129 | return this.processMessage('logout', someParameters, 'MESSAGE'); |
130 | }, | 130 | }, |
131 | 131 | ||
132 | //========================================================================= | 132 | //========================================================================= |
133 | 133 | ||
134 | 'processMessage': function (aFunctionName, someParameters, aRequestType) { | 134 | 'processMessage': function (aFunctionName, someParameters, aRequestType) { |
135 | vardeferredResult; | 135 | vardeferredResult; |
136 | 136 | ||
137 | deferredResult = new Clipperz.Async.Deferred("Proxy.processMessage", {trace:false}); | 137 | deferredResult = new Clipperz.Async.Deferred("Proxy.processMessage", {trace:false}); |
138 | deferredResult.addMethod(this, 'payToll', aRequestType); | 138 | deferredResult.addMethod(this, 'payToll', aRequestType); |
139 | deferredResult.addMethod(this, 'sendMessage', aFunctionName); | 139 | deferredResult.addMethod(this, 'sendMessage', aFunctionName); |
140 | deferredResult.addMethod(this, 'setTollCallback'); | 140 | deferredResult.addMethod(this, 'setTollCallback'); |
141 | deferredResult.callback(someParameters); | 141 | deferredResult.callback(someParameters); |
142 | 142 | ||
143 | return deferredResult; | 143 | return deferredResult; |
144 | }, | 144 | }, |
145 | 145 | ||
146 | //========================================================================= | 146 | //========================================================================= |
147 | 147 | ||
148 | '_sendMessage': function (aFunctionName, aVersion, someParameters) { | 148 | '_sendMessage': function (aFunctionName, aVersion, someParameters) { |
149 | throw Clipperz.Base.exception.AbstractMethod; | 149 | throw Clipperz.Base.exception.AbstractMethod; |
150 | }, | 150 | }, |
151 | 151 | ||
152 | 'sendMessage': function (aFunctionName, someParameters) { | 152 | 'sendMessage': function (aFunctionName, someParameters) { |
153 | var deferredResult; | 153 | var deferredResult; |
154 | 154 | ||
155 | console.log("PROXY.sendMessage", aFunctionName, someParameters); | ||
155 | //TODO: read actual application version for a property set at build time | 156 | //TODO: read actual application version for a property set at build time |
156 | deferredResult = new Clipperz.Async.Deferred("Proxy.sendMessage", {trace:false}); | 157 | deferredResult = new Clipperz.Async.Deferred("Proxy.sendMessage", {trace:false}); |
157 | deferredResult.addMethod(this, '_sendMessage', aFunctionName, 'fake-app-version'); | 158 | deferredResult.addMethod(this, '_sendMessage', aFunctionName, 'fake-app-version'); |
158 | deferredResult.addErrback(MochiKit.Base.method(this, 'handleError')); | 159 | deferredResult.addErrback(MochiKit.Base.method(this, 'handleError')); |
159 | deferredResult.callback(someParameters); | 160 | deferredResult.callback(someParameters); |
160 | 161 | ||
161 | return deferredResult; | 162 | return deferredResult; |
162 | }, | 163 | }, |
163 | 164 | ||
164 | //------------------------------------------------------------------------- | 165 | //------------------------------------------------------------------------- |
165 | 166 | ||
166 | 'handleError': function (anError) { | 167 | 'handleError': function (anError) { |
167 | if (anError['message'] == 'Wrong application version') { | 168 | if (anError['message'] == 'Wrong application version') { |
168 | anError['isPermanent'] = true; | 169 | anError['isPermanent'] = true; |
169 | } | 170 | } |
170 | return anError; | 171 | return anError; |
171 | }, | 172 | }, |
172 | 173 | ||
173 | //========================================================================= | 174 | //========================================================================= |
174 | 175 | ||
175 | 'isReadOnly': function () { | 176 | 'isReadOnly': function () { |
176 | return false; | 177 | return false; |
177 | }, | 178 | }, |
178 | 179 | ||
179 | 'canRegisterNewUsers': function () { | 180 | 'canRegisterNewUsers': function () { |
180 | return true; | 181 | return true; |
181 | }, | 182 | }, |
182 | 183 | ||
183 | //========================================================================= | 184 | //========================================================================= |
184 | __syntaxFix__: "syntax fix" | 185 | __syntaxFix__: "syntax fix" |
185 | 186 | ||
186 | }); | 187 | }); |