share/views/public/js/rbbt.basic.js in rbbt-rest-1.6.9 vs share/views/public/js/rbbt.basic.js in rbbt-rest-1.6.10

- old
+ new

@@ -1,20 +1,26 @@ rbbt.mlog = function(data){ console.log(data) } +rbbt.ajax = function(params){ + params.config = function(xhr, options){ xhr.setRequestHeader( "X-Requested-With", "XMLHttpRequest"); return xhr; } + return m.request(params) +} + rbbt.insist_request = function(params, deferred, timeout, missing){ if (undefined === deferred) deferred = m.deferred() if (undefined === timeout) timeout = 1000 if (timeout > 20000) timeout = 20000 params.extract = function(xhr, xhrOptions){ if (xhr.status != '200') throw(xhr) return xhr.responseText } - m.request(params).then( + + rbbt.ajax(params).then( function(res){ deferred.resolve(res) }, function(xhr){ m.redraw()