diff options
| author | Frédéric van der Essen <fvdessen@gmail.com> | 2015-05-27 13:46:26 +0200 |
|---|---|---|
| committer | Frédéric van der Essen <fvdessen@gmail.com> | 2015-05-27 13:46:26 +0200 |
| commit | da378722cc3f64aec01252caa2017e1024fa87d4 (patch) | |
| tree | 2c28a2f32e6d29036cc4f9baed474b12d1920324 /addons/web/static/src/js | |
| parent | f7a1ac8b0696ec7e61f3ef394983ec8713da2274 (diff) | |
Revert "[IMP] web, point_of_sale: basic implementation of the cordova integration."
This reverts commit f7a1ac8b0696ec7e61f3ef394983ec8713da2274.
The commit introduced a change that required a database update,
which should not be required in a stable version.
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 6 | ||||
| -rw-r--r-- | addons/web/static/src/js/cordova.js | 78 |
2 files changed, 0 insertions, 84 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 07b756d991a..0a35bfd1244 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1202,7 +1202,6 @@ instance.web.WebClient = instance.web.Client.extend({ this.on("change:title_part", this, this._title_changed); this._title_changed(); - return $.when(this._super()).then(function() { if (jQuery.deparam !== undefined && jQuery.deparam(jQuery.param.querystring()).kitten !== undefined) { self.to_kitten(); @@ -1214,10 +1213,6 @@ instance.web.WebClient = instance.web.Client.extend({ self.action_manager.do_action(self.client_options.action); delete(self.client_options.action); } - instance.web.cordova.ready(); - instance.web.cordova.on('back', self, function() { - self.do_action('history_back'); - }); }); }, to_kitten: function() { @@ -1373,7 +1368,6 @@ instance.web.WebClient = instance.web.Client.extend({ on_logout: function() { var self = this; if (!this.has_uncommitted_changes()) { - instance.web.cordova.logout(); self.action_manager.do_action('logout'); } }, diff --git a/addons/web/static/src/js/cordova.js b/addons/web/static/src/js/cordova.js deleted file mode 100644 index b907d04c8a8..00000000000 --- a/addons/web/static/src/js/cordova.js +++ /dev/null @@ -1,78 +0,0 @@ -(function() { -"use strict"; - -var instance = openerp; -var Class = instance.web.Class; - -// The Android/iPhone App is a JS/HTML app that launches the -// Odoo webclient in an iframe, using the Cordova framework. -// -// This class acts as a link between the webclient and the -// Odoo Android/iPhone App implemented with cordova. - -instance.web.Cordova = Class.extend({}, instance.web.PropertiesMixin, { - init: function(parent) { - var self = this; - instance.web.PropertiesMixin.init.call(this, parent); - - window.addEventListener('message', function(event) { - self.receive(event); - }, false); - - }, - // odoo.send('foobar') in cordova will call messages.foobar() - messages: { - // launch the POS ! - pos: function() { - if (window.location.href.indexOf('/pos/web') < 0) { - window.location.href = "/pos/web"; - } - }, - }, - // what happens when we receive an event from cordova - // -> call messages[event.data]() - // -> selfs trigger(event.data) - receive: function(event) { - if (event.origin !== 'file://') { - return; - } - - if (typeof event.data === 'string') { - this.trigger(event.data); - if (this.messages[event.data]) { - this.messages[event.data].call(this); - } - } - }, - // send a message to cordova - send: function(message) { - function inIframe(){ - try { - return window.self !== window.top; - } catch (e) { - return true; - } - } - if (inIframe()) { - window.parent.postMessage(message,'file://'); - } - }, - - - // notifies cordova that the webclient is ready. - ready: function() { this.send('ready'); }, - // notifies cordova that we want to exit the app. - logout: function() { this.send('logout'); }, - // notifies cordova that the point of sale is ready. - posready: function() { this.send('posready'); }, - // notifies cordova that we want to exit the point of sale. - poslogout: function() { this.send('poslogout'); }, - // asks cordova to emit a beep. - beep: function() { this.send('beep'); }, - // ask cordova to vibrate the phone. - vibrate: function() { this.send('vibrate'); }, -}); - -// Singleton module -instance.web.cordova = new instance.web.Cordova(); -})(); |
