version bump 0.2.6: IE10 Drag and Drop support

This commit is contained in:
SheetJS 2013-04-13 09:56:25 -04:00
parent 1dc777f521
commit 5341a85f55
4 changed files with 9 additions and 6 deletions

@ -79,7 +79,6 @@ function sheet_to_csv(sheet) {
var row = [];
for(var C = r.s.c; C <= r.e.c; ++C) {
var val = sheet[utils.encode_cell({c:C,r:R})];
console.error(val);
row.push(val ? stringify(val).replace(/\\r\\n/g,"\n").replace(/\\t/g,"\t").replace(/\\\\/g,"\\") : "");
}
out += row.join(",") + "\n";

@ -1,3 +1,4 @@
<!DOCTYPE html>
<style>
#drop{
border:2px dashed #bbb;
@ -88,10 +89,13 @@ function handleDrop(e) {
var name = f.name;
reader.onload = function(e) {
var data = e.target.result;
var xlsx = XLSX.read(data, {type: 'binary'});
//var xlsx = XLSX.read(data, {type: 'binary'});
var arr = String.fromCharCode.apply(null, new Uint8Array(data));
var xlsx = XLSX.read(btoa(arr), {type: 'base64'});
process_xlsx(xlsx);
};
reader.readAsBinaryString(f);
//reader.readAsBinaryString(f);
reader.readAsArrayBuffer(f);
}
}
@ -101,7 +105,8 @@ function handleDragover(e) {
e.dataTransfer.dropEffect = 'copy';
}
if(drop.addEventListener) { // IE compatibility
if(drop.addEventListener) {
drop.addEventListener('dragenter', handleDragover, false);
drop.addEventListener('dragover', handleDragover, false);
drop.addEventListener('drop', handleDrop, false);
}

@ -1,6 +1,6 @@
{
"name": "xlsx",
"version": "0.2.5",
"version": "0.2.6",
"author": "Niggler",
"description": "(one day) a full-featured XLSX parser and writer. For now, primitive parser",
"keywords": [

@ -906,7 +906,6 @@ function sheet_to_csv(sheet) {
var row = [];
for(var C = r.s.c; C <= r.e.c; ++C) {
var val = sheet[utils.encode_cell({c:C,r:R})];
console.error(val);
row.push(val ? stringify(val).replace(/\\r\\n/g,"\n").replace(/\\t/g,"\t").replace(/\\\\/g,"\\") : "");
}
out += row.join(",") + "\n";