Skip to content
This repository was archived by the owner on Jul 25, 2021. It is now read-only.

Commit 4c4d9ee

Browse files
author
Travis Clarke
committed
v4.0.1 - fix: file format and extension don't match, closes #57
1 parent bb84153 commit 4c4d9ee

File tree

11 files changed

+29
-27
lines changed

11 files changed

+29
-27
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tableexport.js",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"authors": [
55
"clarketm <travis.m.clarke@gmail.com>"
66
],

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 4.0.0 (https://www.travismclarke.com)
2+
* TableExport.js v4.0.1 (https://www.travismclarke.com)
33
* Copyright 2017 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: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* TableExport.js 4.0.0 (https://www.travismclarke.com)
2+
* TableExport.js v4.0.1 (https://www.travismclarke.com)
33
* Copyright 2017 Travis Clarke
44
* Licensed under the MIT license
55
*/
@@ -99,7 +99,7 @@
9999
function (key) {
100100
var before = key;
101101
(XLSX && !isMobile) && key === _type.xls
102-
? key = _type.xlsm
102+
? key = _type.biff2
103103
: false;
104104

105105
(!XLSX || isMobile) && key === _type.xlsx
@@ -125,7 +125,7 @@
125125
* Version.
126126
* @memberof TableExport.prototype
127127
*/
128-
version: '4.0.0',
128+
version: '4.0.1',
129129
/**
130130
* Default library options.
131131
* @memberof TableExport.prototype
@@ -330,7 +330,7 @@
330330
_store.getInstance().setItem(hashKey, dataObject, true);
331331
return hashKey;
332332
},
333-
xlsm: function (context) {
333+
biff2: function (context) {
334334
var self = this;
335335
var settings = self.settings;
336336
var rcMap = {},
@@ -691,14 +691,15 @@
691691
* @param extension {String} file extension
692692
*/
693693
export2file: function (data, mime, name, extension) {
694-
if (XLSX && !isMobile && extension.substr(0, 4) === ('.xls')) {
694+
if (XLSX && !isMobile && extension.substr(0, 4) === '.xls') {
695695
var wb = new this.Workbook(),
696-
ws = this.createSheet(data);
696+
ws = this.createSheet(data),
697+
bookType = extension.substr(1) === _type.xls ? _type.biff2 : _type.xlsx;
697698

698699
wb.SheetNames.push(name);
699700
wb.Sheets[name] = ws;
700701
var wopts = {
701-
bookType: extension.substr(1, 3) + (extension.substr(4) || 'm'),
702+
bookType: bookType,
702703
bookSST: false,
703704
type: 'binary'
704705
},
@@ -814,7 +815,7 @@
814815
var _type = (function () {
815816
return {
816817
xlsx: 'xlsx',
817-
xlsm: 'xlsm',
818+
biff2: 'biff2',
818819
xls: 'xls',
819820
csv: 'csv',
820821
txt: 'txt'

dist/js/tableexport.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ gulp.task('bump-js', function () {
4444
.pipe(replace(/(v\d+\.\d+\.)(\d+)/g, function (matches, match1, match2) {
4545
return match1 + (Number(match2)+1);
4646
}))
47-
.pipe(replace(/(version: "\d+\.\d+\.)(\d+)/g, function (matches, match1, match2) {
47+
.pipe(replace(/(version: ["']\d+\.\d+\.)(\d+)/g, function (matches, match1, match2) {
4848
return match1 + (Number(match2)+1);
4949
}))
5050
.pipe(gulp.dest('src/stable/js/'))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tableexport",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"authors": [
55
"clarketm <travis.m.clarke@gmail.com>"
66
],

src/stable/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 4.0.0 (https://www.travismclarke.com)
2+
* TableExport.js v4.0.1 (https://www.travismclarke.com)
33
* Copyright 2017 Travis Clarke
44
* Licensed under the MIT license
55
*/

src/stable/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.

src/stable/js/tableexport.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* TableExport.js 4.0.0 (https://www.travismclarke.com)
2+
* TableExport.js v4.0.1 (https://www.travismclarke.com)
33
* Copyright 2017 Travis Clarke
44
* Licensed under the MIT license
55
*/
@@ -99,7 +99,7 @@
9999
function (key) {
100100
var before = key;
101101
(XLSX && !isMobile) && key === _type.xls
102-
? key = _type.xlsm
102+
? key = _type.biff2
103103
: false;
104104

105105
(!XLSX || isMobile) && key === _type.xlsx
@@ -125,7 +125,7 @@
125125
* Version.
126126
* @memberof TableExport.prototype
127127
*/
128-
version: '4.0.0',
128+
version: '4.0.1',
129129
/**
130130
* Default library options.
131131
* @memberof TableExport.prototype
@@ -330,7 +330,7 @@
330330
_store.getInstance().setItem(hashKey, dataObject, true);
331331
return hashKey;
332332
},
333-
xlsm: function (context) {
333+
biff2: function (context) {
334334
var self = this;
335335
var settings = self.settings;
336336
var rcMap = {},
@@ -691,14 +691,15 @@
691691
* @param extension {String} file extension
692692
*/
693693
export2file: function (data, mime, name, extension) {
694-
if (XLSX && !isMobile && extension.substr(0, 4) === ('.xls')) {
694+
if (XLSX && !isMobile && extension.substr(0, 4) === '.xls') {
695695
var wb = new this.Workbook(),
696-
ws = this.createSheet(data);
696+
ws = this.createSheet(data),
697+
bookType = extension.substr(1) === _type.xls ? _type.biff2 : _type.xlsx;
697698

698699
wb.SheetNames.push(name);
699700
wb.Sheets[name] = ws;
700701
var wopts = {
701-
bookType: extension.substr(1, 3) + (extension.substr(4) || 'm'),
702+
bookType: bookType,
702703
bookSST: false,
703704
type: 'binary'
704705
},
@@ -814,7 +815,7 @@
814815
var _type = (function () {
815816
return {
816817
xlsx: 'xlsx',
817-
xlsm: 'xlsm',
818+
biff2: 'biff2',
818819
xls: 'xls',
819820
csv: 'csv',
820821
txt: 'txt'

0 commit comments

Comments
 (0)