🎨 add eslint
This commit is contained in:
parent
829a2e4cfc
commit
b0893113b3
88 changed files with 376 additions and 370 deletions
|
@ -3,11 +3,11 @@ function has (browser) {
|
|||
if (browser === 'ie') {
|
||||
const isIE = ua.indexOf('compatible') > -1 && ua.indexOf('MSIE') > -1;
|
||||
if (isIE) {
|
||||
const reIE = new RegExp("MSIE (\\d+\\.\\d+);");
|
||||
const reIE = new RegExp('MSIE (\\d+\\.\\d+);');
|
||||
reIE.test(ua);
|
||||
return parseFloat(RegExp["$1"]);
|
||||
return parseFloat(RegExp['$1']);
|
||||
} else {
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return ua.indexOf(browser) > -1;
|
||||
|
@ -19,12 +19,12 @@ const csv = {
|
|||
let iev = 0;
|
||||
const ieold = (/MSIE (\d+\.\d+);/.test(navigator.userAgent));
|
||||
const trident = !!navigator.userAgent.match(/Trident\/7.0/);
|
||||
const rv = navigator.userAgent.indexOf("rv:11.0");
|
||||
const rv = navigator.userAgent.indexOf('rv:11.0');
|
||||
|
||||
if (ieold) {
|
||||
iev = Number(RegExp.$1);
|
||||
}
|
||||
if (navigator.appVersion.indexOf("MSIE 10") !== -1) {
|
||||
if (navigator.appVersion.indexOf('MSIE 10') !== -1) {
|
||||
iev = 10;
|
||||
}
|
||||
if (trident && rv !== -1) {
|
||||
|
@ -39,7 +39,7 @@ const csv = {
|
|||
},
|
||||
|
||||
_getDownloadUrl (text) {
|
||||
const BOM = "\uFEFF";
|
||||
const BOM = '\uFEFF';
|
||||
// Add BOM to text for open in excel correctly
|
||||
if (window.Blob && window.URL && window.URL.createObjectURL && !has('Safari')) {
|
||||
const csvData = new Blob([BOM + text], { type: 'text/csv' });
|
||||
|
@ -52,14 +52,14 @@ const csv = {
|
|||
download (filename, text) {
|
||||
if (has('ie') && has('ie') < 10) {
|
||||
// has module unable identify ie11 and Edge
|
||||
const oWin = window.top.open("about:blank", "_blank");
|
||||
const oWin = window.top.open('about:blank', '_blank');
|
||||
oWin.document.charset = 'utf-8';
|
||||
oWin.document.write(text);
|
||||
oWin.document.close();
|
||||
oWin.document.execCommand('SaveAs', filename);
|
||||
oWin.close();
|
||||
} else if (has("ie") === 10 || this._isIE11() || this._isEdge()) {
|
||||
const BOM = "\uFEFF";
|
||||
} else if (has('ie') === 10 || this._isIE11() || this._isEdge()) {
|
||||
const BOM = '\uFEFF';
|
||||
const csvData = new Blob([BOM + text], { type: 'text/csv' });
|
||||
navigator.msSaveBlob(csvData, filename);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue