Browse Source

2.0+

pull/64/head
Mathias Markl 7 years ago
parent
commit
6cccc78769
  1. 2
      muk_web_utils/__manifest__.py
  2. 19
      muk_web_utils/static/lib/SheetJS/xlsx.js
  3. 52
      muk_web_utils/static/lib/jQueryBinaryTransport/jquery-binarytransport.js

2
muk_web_utils/__manifest__.py

@ -20,7 +20,7 @@
{
"name": "MuK Web Utils",
"summary": """Utility Features""",
"version": "11.0.2.0.7",
"version": "11.0.2.0.8",
"category": "Extra Tools",
"license": "AGPL-3",
"website": "http://www.mukit.at",

19
muk_web_utils/static/lib/SheetJS/xlsx.js
File diff suppressed because it is too large
View File

52
muk_web_utils/static/lib/jQueryBinaryTransport/jquery-binarytransport.js

@ -0,0 +1,52 @@
/**
*
* jquery.binarytransport.js
*
* @description. jQuery ajax transport for making binary data type requests.
* @version 1.0
* @author Henry Algus <henryalgus@gmail.com>
*
*/
// use this transport for "binary" data type
$.ajaxTransport("+binary", function(options, originalOptions, jqXHR){
// check for conditions and support for blob / arraybuffer response type
if (window.FormData && ((options.dataType && (options.dataType == 'binary')) || (options.data && ((window.ArrayBuffer && options.data instanceof ArrayBuffer) || (window.Blob && options.data instanceof Blob)))))
{
return {
// create new XMLHttpRequest
send: function(headers, callback){
// setup all variables
var xhr = new XMLHttpRequest(),
url = options.url,
type = options.type,
async = options.async || true,
// blob or arraybuffer. Default is blob
dataType = options.responseType || "blob",
data = options.data || null,
username = options.username || null,
password = options.password || null;
xhr.addEventListener('load', function(){
var data = {};
data[options.dataType] = xhr.response;
// make callback and send data
callback(xhr.status, xhr.statusText, data, xhr.getAllResponseHeaders());
});
xhr.open(type, url, async, username, password);
// setup custom headers
for (var i in headers ) {
xhr.setRequestHeader(i, headers[i] );
}
xhr.responseType = dataType;
xhr.send(data);
},
abort: function(){
jqXHR.abort();
}
};
}
});
Loading…
Cancel
Save