Skip to content

Commit c592cfc

Browse files
committed
v3.3.2 - fix critical AMD bug, add version to TE prototype, and reformat JS.
1 parent 1dfd4db commit c592cfc

10 files changed

Lines changed: 57 additions & 39 deletions

File tree

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "tableexport.js",
3-
"version": "3.3.1",
3+
"version": "3.3.2",
44
"authors": [
55
"clarketm <travis.m.clarke@gmail.com>"
66
],
77
"description": "The simple, easy-to-implement plugin to export HTML tables to xlsx, xls, csv, and txt files",
8-
"main": "dist/js/tableexport.min.js",
8+
"main": "dist/js/tableexport.js",
99
"keywords": [
1010
"table",
1111
"export",
@@ -22,7 +22,7 @@
2222
"bootstrap": "~3.3.5",
2323
"jquery": "~1.11.3",
2424
"js-xlsx": "0.8.0",
25-
"file-saver": "^1.3.3",
25+
"file-saverjs": "^1.3.3",
2626
"blobjs": "^1.0.0"
2727
},
2828
"license": "MIT",

dist/css/tableexport.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* TableExport.js 3.3.1 (https://www.travismclarke.com)
2+
* TableExport.js v3.3.2 (https://www.travismclarke.com)
33
* Copyright 2016 Travis Clarke
44
* Licensed under the MIT license
55
*/

dist/css/tableexport.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/tableexport.js

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* TableExport.js 3.3.1 (https://www.travismclarke.com)
2+
* TableExport.js v3.3.2 (https://www.travismclarke.com)
33
* Copyright 2016 Travis Clarke
44
* Licensed under the MIT license
55
*/
@@ -79,12 +79,12 @@
7979
}
8080
if (val.hasAttribute('colspan')) {
8181
rcMap[ir] = rcMap[ir] || {};
82-
rcMap[ir][ic+1] = val.getAttribute('colspan') - 1
82+
rcMap[ir][ic + 1] = val.getAttribute('colspan') - 1
8383
}
8484
if (val.hasAttribute('rowspan')) {
85-
for(var i = 1; i < val.getAttribute('rowspan'); i++) {
86-
rcMap[ir+i] = rcMap[ir+i] || {};
87-
rcMap[ir+i][ic] = 1
85+
for (var i = 1; i < val.getAttribute('rowspan'); i++) {
86+
rcMap[ir + i] = rcMap[ir + i] || {};
87+
rcMap[ir + i][ic] = 1
8888
}
8989
}
9090
if (rcMap[ir] && rcMap[ir][ic]) {
@@ -120,12 +120,12 @@
120120
}
121121
if (val.hasAttribute('colspan')) {
122122
rcMap[ir] = rcMap[ir] || {};
123-
rcMap[ir][ic+1] = val.getAttribute('colspan') - 1
123+
rcMap[ir][ic + 1] = val.getAttribute('colspan') - 1
124124
}
125125
if (val.hasAttribute('rowspan')) {
126-
for(var i = 1; i < val.getAttribute('rowspan'); i++) {
127-
rcMap[ir+i] = rcMap[ir+i] || {};
128-
rcMap[ir+i][ic] = 1
126+
for (var i = 1; i < val.getAttribute('rowspan'); i++) {
127+
rcMap[ir + i] = rcMap[ir + i] || {};
128+
rcMap[ir + i][ic] = 1
129129
}
130130
}
131131
if (rcMap[ir] && rcMap[ir][ic]) {
@@ -233,7 +233,7 @@
233233

234234
self.settings.formats.forEach(
235235
function (key) {
236-
XLSX && key === 'xls' ? key ='xlsm' : false;
236+
XLSX && key === 'xls' ? key = 'xlsm' : false;
237237
!XLSX && key === 'xlsx' ? key = null : false;
238238
key && exporters[key](rowD, fileName);
239239
}
@@ -266,6 +266,11 @@
266266

267267

268268
TableExport.prototype = {
269+
/**
270+
* Version.
271+
* @memberof TableExport.prototype
272+
*/
273+
version: "3.3.3",
269274
/**
270275
* Default plugin options.
271276
* @memberof TableExport.prototype
@@ -442,13 +447,17 @@
442447
* @param extension {String} file extension
443448
*/
444449
export2file: function (data, mime, name, extension) {
445-
if (XLSX && extension.substr(0, 4) ==(".xls")) {
450+
if (XLSX && extension.substr(0, 4) == (".xls")) {
446451
var wb = new this.Workbook(),
447452
ws = this.createSheet(data);
448453

449454
wb.SheetNames.push(name);
450455
wb.Sheets[name] = ws;
451-
var wopts = {bookType: extension.substr(1, 3) + (extension.substr(4) || 'm'), bookSST: false, type: 'binary'},
456+
var wopts = {
457+
bookType: extension.substr(1, 3) + (extension.substr(4) || 'm'),
458+
bookSST: false,
459+
type: 'binary'
460+
},
452461
wbout = XLSX.write(wb, wopts);
453462

454463
data = this.string2ArrayBuffer(wbout);
@@ -497,7 +506,7 @@
497506
$.fn.tableExport[prop] = TableExport.prototype[prop];
498507
}
499508

500-
exports.default = exports.TableExport = TableExport;
509+
return exports.default = exports.TableExport = TableExport;
501510

502511
}
503512
));

0 commit comments

Comments
 (0)