diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index b03c5965bf7..eb9328a6bd1 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1013,7 +1013,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie start: function() { this._super.apply(this, arguments); var self = this; - openerp.connection.bind(function() { + openerp.connection.bind("",function() { var params = {}; if(jQuery.param != undefined && jQuery.deparam(jQuery.param.querystring()).kitten != undefined) { self.$element.addClass("kitten-mode-activated"); @@ -1103,7 +1103,6 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie }, }); - openerp.currentScript = function() { var currentScript = document.currentScript; if (!currentScript) { diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 96e38b4e4d0..55bce373330 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -342,183 +342,6 @@ openerp.web.CallbackEnabled = openerp.web.Class.extend(/** @lends openerp.web.Ca } }); -$.ajaxSetup({ - converters: { - "json oe-jsonp": true, - "json oe-json": true, - } -}); - -// common preconditions checks -$.ajaxPrefilter("oe-json oe-jsonp", function(options, originalOptions, jqXHR) { - if (!$.isPlainObject(options.openerp)) { - console.error(options.openerp); - $.error('"openerp" option is required.'); - } - - if (!$.isPlainObject(options.data)) { - $.error('data must not be serialized'); - } - options.processData = false; -}); - -$.ajaxPrefilter("oe-json", function(options, originalOptions, jqXHR) { - options.data = JSON.stringify({ - jsonrpc: '2.0', - method: 'call', - params: options.data, - id: _.uniqueId('browser-client-') - }); - - return 'json'; -}); - -$.ajaxPrefilter("oe-jsonp", function(options, originalOptions, jqXHR) { - - options.crossDomain = true; - - var data = null; - if (options.data) { - data = $.param({r:JSON.stringify(options.data)}); - } - - - - var max_url_length = options.max_url_length || 1000, - absolute_url, full_url; - /* - var r_has_protocol = /^https?:\/\//, - r_absolute_internal = /^\/[^\/]/; // starts with / (but not //) - - - if (r_has_protocol.test(options.url)) { - if (!_(options.url).startsWith(options.openerp.server + '/')) { - $.error('can only contact openerp.server'); - } - absolute_url = options.url; - } else if (r_absolute_internal.test(options.url)) { - absolute_url = options.openerp.server + options.url; - } else { // relative url - var parts = document.location.pathname.split('/'); - parts.pop(); - parts.push(options.url); - absolute_url = options.openerp.server + parts.join('/'); - } - // */ - - var absolute_url = options.openerp.get_absolute_url(options.url); - - /// now, made the same url changes that jQuery will do... - var rquery = /\?/, - rts = /([?&])_=[^&]*/; - - full_url = absolute_url; - if (data) { - full_url += (rquery.test(full_url) ? "&" : "?") + data; - } - - // Add anti-cache in url if needed - if (!options.cache) { - var ts = $.now(), - // try replacing _= if it is there - ret = full_url.replace(rts, "$1_=" + ts); - - // if nothing was replaced, add timestamp to the end - full_url = ret + ((ret === full_url) ? (rquery.test(full_url) ? "&" : "?") + "_=" + ts : ""); - } - - options.url = absolute_url; - - if (full_url.length < max_url_length) { - options.type = "GET"; - options.data = data; - return "jsonp"; // classic jsonp query... - } -}); - -$.ajaxTransport("oe-jsonp", function(options, originalOptions, jqXHR) { - - var $iframe = null; - var $form = $('