From ebbd2888f02d8e94c6033ae4323da65490cfa4d5 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 4 Jan 2021 15:40:53 -0600 Subject: [PATCH] tableExport plugin is no longer used --- web/skins/classic/includes/functions.php | 1 - web/skins/classic/js/tableExport.min.js | 93 ------------------------ 2 files changed, 94 deletions(-) delete mode 100644 web/skins/classic/js/tableExport.min.js diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index 49c40373d..e468a0e10 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -875,7 +875,6 @@ function xhtmlFooter() { e&&"undefined"!==typeof T[e]&&-1!==c.inArray(T[e],a.ignoreColumn))&&(p=!0):p=!0;return p}function B(b,d,e,p,f){if("function"===typeof f){var l=!1;"function"===typeof a.onIgnoreRow&&(l=a.onIgnoreRow(c(b),e));if(!1===l&&(0===a.ignoreRow.length||-1===c.inArray(e,a.ignoreRow)&&-1===c.inArray(e-p,a.ignoreRow))&&I(c(b))){var q=A(c(b),d),h=0;q.each(function(b){var a=c(this),d,l=O(this),p=U(this);c.each(G, -function(){if(e>=this.s.r&&e<=this.e.r&&h>=this.s.c&&h<=this.e.c)for(d=0;d<=this.e.c-this.s.c;++d)f(null,e,h++)});if(!1===sa(a,q.length,b)){if(p||l)l=l||1,G.push({s:{r:e,c:h},e:{r:e+(p||1)-1,c:h+l-1}});f(this,e,h++)}if(l)for(d=0;d=this.s.r&&e<=this.e.r&&h>=this.s.c&&h<=this.e.c)for(da=0;da<=this.e.c-this.s.c;++da)f(null,e,h++)})}}}function ta(b,a,e,c){if("undefined"!==typeof c.images&&(e=c.images[e],"undefined"!==typeof e)){a=a.getBoundingClientRect(); -var d=b.width/b.height,l=a.width/a.height,p=b.width,h=b.height,z=19.049976/25.4,g=0;l<=d?(h=Math.min(b.height,a.height),p=a.width*h/a.height):l>d&&(p=Math.min(b.width,a.width),h=a.height*p/a.width);p*=z;h*=z;hb.textPos.x&&p+g>b.textPos.x+b.width&&(0<=".,!%*;:=-".indexOf(z.charAt(0))&&(k=z.charAt(0),g=e.doc.getStringUnitWidth(k)*e.doc.internal.getFontSize(),p+g<=b.textPos.x+b.width&&(e.doc.autoTableText(k,p,f,l),z=z.substring(1,z.length)),g=e.doc.getStringUnitWidth(z)*e.doc.internal.getFontSize()),p=b.textPos.x,f+=e.doc.internal.getFontSize());if("visible"!==b.styles.overflow)for(;z.length&&p+g>b.textPos.x+b.width;)z=z.substring(0,z.length-1),g=e.doc.getStringUnitWidth(z)*e.doc.internal.getFontSize(); -e.doc.autoTableText(z,p,f,l);p+=g}if(q||h)c(d).is("b")?q=!1:c(d).is("i")&&(h=!1),e.doc.setFontType(q||h?q?"bold":"italic":"normal");d=d.nextSibling}b.textPos.x=p;b.textPos.y=f}else e.doc.autoTableText(b.text,b.textPos.x,b.textPos.y,l)}}function W(b,a,e){return null==b?"":b.toString().replace(new RegExp(null==a?"":a.toString().replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),e)}function ka(b){return null==b?"":b.toString().replace(/^\s+/,"")}function la(b){return null==b?"":b.toString().replace(/\s+$/, -"")}function La(b){if(0===a.date.html.length)return!1;a.date.pattern.lastIndex=0;var d=a.date.pattern.exec(b);if(null==d)return!1;b=+d[a.date.match_y];if(0>b||8099]*)>)/gi,"\u2060"),n=c("
").html(m).contents();b=!1;m="";c.each(n.text().split("\u2028"),function(b,d){0b?1:0)).split(".");1===n.length&&(n[1]="");var t=3b?"-":"")+(a.numbers.output.thousandsSeparator?(t?n[0].substr(0,t)+a.numbers.output.thousandsSeparator:"")+n[0].substr(t).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):n[0])+(n[1].length?a.numbers.output.decimalMark+n[1]:"")}}else f=h;!0===a.escape&&(f=escape(f));"function"===typeof a.onCellData&&(f=a.onCellData(q,d,e,f,l),q.data("teUserDefText",1))}void 0!== -p&&(p.type=l);return f}function Aa(b){return 0l?f+=String.fromCharCode(l):(127l?f+=String.fromCharCode(l>>6|192):(f+=String.fromCharCode(l>>12|224),f+=String.fromCharCode(l>>6&63|128)),f+=String.fromCharCode(l& -63|128))}a=f}for(;p>2;q=(q&3)<<4|f>>4;var h=(f&15)<<2|b>>6;var g=b&63;isNaN(f)?h=g=64:isNaN(b)&&(g=64);c=c+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(q)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)}return c} -var a={csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,date:{html:"dd/mm/yyyy"},displayTableName:!1,escape:!1,exportHiddenCells:!1,fileName:"tableExport",htmlContent:!1,htmlHyperlink:"content",ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4",margins:{left:20,right:10,top:10,bottom:10},onDocCreated:null,autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"inherit",valign:"middle"}, -headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"inherit",valign:"middle"},alternateRowStyles:{fillColor:245},tableExport:{doc:null,onAfterAutotable:null,onBeforeAutotable:null,onAutotableText:null,onTable:null,outputImages:!0}}},mso:{fileFormat:"xlshtml",onMsoNumberFormat:null,pageFormat:"a4",pageOrientation:"portrait",rtl:!1,styles:[],worksheetName:"",xslx:{formatId:{date:14,numbers:2}}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}}, -onAfterSaveToFile:null,onBeforeSaveToFile:null,onCellData:null,onCellHtmlData:null,onCellHtmlHyperlink:null,onIgnoreRow:null,onTableExportBegin:null,onTableExportEnd:null,outputMode:"file",pdfmake:{enabled:!1,docDefinition:{pageOrientation:"portrait",defaultStyle:{font:"Roboto"}},fonts:{}},preserve:{leadingWS:!1,trailingWS:!1},preventInjection:!0,sql:{tableEnclosure:"`",columnEnclosure:"`"},tbodySelector:"tr",tfootSelector:"tr",theadSelector:"tr",tableName:"Table",type:"csv"},N={a0:[2383.94,3370.39], -a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13, -918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]},C=this,ha=null,u=[],w=[],n=0,t="",T=[],G=[],Da,J=[],V=!1;c.extend(!0,a,k);"xlsx"===a.type&&(a.mso.fileFormat=a.type,a.type="excel");"undefined"!==typeof a.excelFileFormat&&"undefined"===a.mso.fileFormat&&(a.mso.fileFormat= -a.excelFileFormat);"undefined"!==typeof a.excelPageFormat&&"undefined"===a.mso.pageFormat&&(a.mso.pageFormat=a.excelPageFormat);"undefined"!==typeof a.excelPageOrientation&&"undefined"===a.mso.pageOrientation&&(a.mso.pageOrientation=a.excelPageOrientation);"undefined"!==typeof a.excelRTL&&"undefined"===a.mso.rtl&&(a.mso.rtl=a.excelRTL);"undefined"!==typeof a.excelstyles&&"undefined"===a.mso.styles&&(a.mso.styles=a.excelstyles);"undefined"!==typeof a.onMsoNumberFormat&&"undefined"===a.mso.onMsoNumberFormat&& -(a.mso.onMsoNumberFormat=a.onMsoNumberFormat);"undefined"!==typeof a.worksheetName&&"undefined"===a.mso.worksheetName&&(a.mso.worksheetName=a.worksheetName);a.mso.pageOrientation="l"===a.mso.pageOrientation.substr(0,1)?"landscape":"portrait";a.date.html=a.date.html||"";if(a.date.html.length){k=[];k.dd="(3[01]|[12][0-9]|0?[1-9])";k.mm="(1[012]|0?[1-9])";k.yyyy="((?:1[6-9]|2[0-2])\\d{2})";k.yy="(\\d{2})";var r=a.date.html.match(/[^a-zA-Z0-9]/)[0];r=a.date.html.toLowerCase().split(r);a.date.regex="^\\s*"; -a.date.regex+=k[r[0]];a.date.regex+="(.)";a.date.regex+=k[r[1]];a.date.regex+="\\2";a.date.regex+=k[r[2]];a.date.regex+="\\s*$";a.date.pattern=new RegExp(a.date.regex,"g");k=r.indexOf("dd")+1;a.date.match_d=k+(1"+E(a,c,e)+""});n++});Q+="";var Ea=1;w=v(c(C));c(w).each(function(){var a=1;t="";B(this,"td,th",n,u.length+w.length,function(b,c,g){t+=""+E(b,c,g)+"";a++});0"!==t&&(Q+=''+t+"",Ea++);n++}); -Q+="";if("string"===a.outputMode)return Q;if("base64"===a.outputMode)return K(Q);M(Q,a.fileName+".xml","application/xml","utf-8","base64",!1)}else if("excel"===a.type&&"xmlss"===a.mso.fileFormat){var ra=[],F=[];c(C).filter(function(){return I(c(this))}).each(function(){function b(a,b,d){var f=[];c(a).each(function(){var b=0,e=0;t="";B(this,"td,th",n,d+a.length,function(a,d,l){if(null!==a){var h="";d=E(a,d,l);l="String";if(!1!==jQuery.isNumeric(d))l="Number";else{var g=Ma(d);!1!== -g&&(d=g,l="Number",h+=' ss:StyleID="pct1"')}"Number"!==l&&(d=d.replace(/\n/g,"
"));g=O(a);a=U(a);c.each(f,function(){if(n>=this.s.r&&n<=this.e.r&&e>=this.s.c&&e<=this.e.c)for(var a=0;a<=this.e.c-this.s.c;++a)e++,b++});if(a||g)a=a||1,g=g||1,f.push({s:{r:n,c:e},e:{r:n+a-1,c:e+g-1}});1'+c("
").text(d).html()+"\r"; -e++}});0\r'+t+"\r");n++});return a.length}var d=c(this),e="";"string"===typeof a.mso.worksheetName&&a.mso.worksheetName.length?e=a.mso.worksheetName+" "+(F.length+1):"undefined"!==typeof a.mso.worksheetName[F.length]&&(e=a.mso.worksheetName[F.length]);e.length||(e=d.find("caption").text()||"");e.length||(e="Table "+(F.length+1));e=c.trim(e.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));F.push(c("
").text(e).html());!1===a.exportHiddenCells&&(J= -d.find("tr, th, td").filter(":hidden"),V=0\r";e=b(y(d),"th,td",0);b(v(d),"td,th",e);H+="\r";ra.push(H)});k={};r={};for(var m,R,Y=0,da=F.length;Y\r\r\r\r '+ -(new Date).toISOString()+'\r\r\r \r\r\r 9000\r 13860\r 0\r 0\r False\r False\r\r\r \r \r \r\r'; -for(r=0;r\r'+ra[r],k=a.mso.rtl?k+'\r\r\r':k+'\r',k+="\r";k+="\r";if("string"===a.outputMode)return k;if("base64"===a.outputMode)return K(k);M(k,a.fileName+".xml","application/xml","utf-8","base64",!1)}else if("excel"=== -a.type&&"xlsx"===a.mso.fileFormat){var aa=[],Fa=XLSX.utils.book_new();c(C).filter(function(){return I(c(this))}).each(function(){for(var b=c(this),d={},e=this.getElementsByTagName("tr"),g={s:{r:0,c:0},e:{r:0,c:0}},f=[],l,q=[],h=0,k=0,m,n,t,u,r,w=XLSX.SSF.get_table();hk;++h)if(m=e[h],n=!1,"function"===typeof a.onIgnoreRow&&(n=a.onIgnoreRow(c(m),h)),!0!==n&&(0===a.ignoreRow.length||-1===c.inArray(h,a.ignoreRow)&&-1===c.inArray(h-e.length,a.ignoreRow))&&!1!==I(c(m))){var y=m.children, -C=0;for(m=0;mx||36x||48===x)B="n";else if("date"===D.type||13x||44x||56===x)B="d"}else B="s";if(null!=l)if(0===l.length)v.t="z";else if(0!==l.trim().length&&"s"!==B)if("function"===D.type)v={f:l};else if("TRUE"===l)v={t:"b",v:!0};else if("FALSE"===l)v={t:"b",v:!1};else if(""===B&&c(r).find("a").length)l= -"href"!==a.htmlHyperlink?l:"",v={f:'=HYPERLINK("'+c(r).find("a").attr("href")+(l.length?'","'+l:"")+'")'};else if("n"===B||isFinite(Ca(l,a.numbers.output))){if(r=Ca(l,a.numbers.output),0===x&&"function"!==typeof a.mso.xslx.formatId.numbers&&(x=a.mso.xslx.formatId.numbers),isFinite(r)||isFinite(l))v={t:"n",v:isFinite(r)?r:l,z:"string"===typeof x?x:x in w?w[x]:"0.00"}}else if(!1!==(r=La(l))||"d"===B)0===x&&"function"!==typeof a.mso.xslx.formatId.date&&(x=a.mso.xslx.formatId.date),v={t:"d",v:!1!==r? -r:l,z:"string"===typeof x?x:x in w?w[x]:"m/d/yy"};d[na({c:n,r:k})]=v;g.e.c";u=y(b);c(u).each(function(){var b=c(this);t="";B(this,"th,td",n,u.length,function(c,d,f){if(null!==c){var e="";t+=""}});0"+t+"");n++});H+="";w=v(b);c(w).each(function(){var b=c(this);t="";B(this,"td,th",n,u.length+ -w.length,function(d,g,f){if(null!==d){var e=E(d,g,f),q="",h=c(d).attr("data-tableexport-msonumberformat");"undefined"===typeof h&&"function"===typeof a.mso.onMsoNumberFormat&&(h=a.mso.onMsoNumberFormat(d,g,f));"undefined"!==typeof h&&""!==h&&(q="style=\"mso-number-format:'"+h+"'");if(a.mso.styles.length){g=document.defaultView.getComputedStyle(d,null);f=document.defaultView.getComputedStyle(b[0],null);for(var k in a.mso.styles)h=g[a.mso.styles[k]],""===h&&(h=f[a.mso.styles[k]]),""!==h&&"0px none rgb(0, 0, 0)"!== -h&&"rgba(0, 0, 0, 0)"!==h&&(q+=""===q?'style="':";",q+=a.mso.styles[k]+":"+h)}t+=""));t+=">"+e+""}});0"+t+"");n++});a.displayTableName&&(H+=""+E(c("

"+a.tableName+"

"))+"");H+=""});m=''+('');m+="";"excel"===k&&(m+="\x3c!--[if gte mso 9]>",m+="",m+="",m+="",m+="",m+="",m+=ba,m+="",m+="",m+="",a.mso.rtl&&(m+=""),m+="",m+="",m+="",m+="", -m+="",m+="";m+="@page { size:"+a.mso.pageOrientation+"; mso-page-orientation:"+a.mso.pageOrientation+"; }";m+="@page Section1 {size:"+N[a.mso.pageFormat][0]+"pt "+N[a.mso.pageFormat][1]+"pt";m+="; margin:1.0in 1.25in 1.0in 1.25in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";m+="div.Section1 {page:Section1;}";m+="@page Section2 {size:"+N[a.mso.pageFormat][1]+"pt "+N[a.mso.pageFormat][0]+"pt";m+=";mso-page-orientation:"+a.mso.pageOrientation+ -";margin:1.25in 1.0in 1.25in 1.0in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";m+="div.Section2 {page:Section2;}";m+="br {mso-data-placement:same-cell;}";m+="";m+="";m+="";m+='
';m+=H;m+="
";m+="";m+="";if("string"===a.outputMode)return m;if("base64"===a.outputMode)return K(m);M(m,a.fileName+"."+r,"application/vnd.ms-"+k,"","base64",!1)}else if("png"===a.type)html2canvas(c(C)[0]).then(function(b){b= -b.toDataURL();for(var c=atob(b.substring(22)),e=new ArrayBuffer(c.length),g=new Uint8Array(e),f=0;fIa){a>N.a0[0]&&(ia="a0",ca="l");for(var d in N)N.hasOwnProperty(d)&& -N[d][1]>a&&(ia=d,ca="l",N[d][0]>a&&(ca="p"));Ia=a}}});a.jspdf.format=""===ia?"a4":ia;a.jspdf.orientation=""===ca?"w":ca}if(null==g.doc&&(g.doc=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format),g.wScaleFactor=1,g.hScaleFactor=1,"function"===typeof a.jspdf.onDocCreated))a.jspdf.onDocCreated(g.doc);!0===g.outputImages&&(g.images={});"undefined"!==typeof g.images&&(c(C).filter(function(){return I(c(this))}).each(function(){var b=0;G=[];!1===a.exportHiddenCells&&(J=c(this).find("tr, th, td").filter(":hidden"), -V=0a.styles.rowHeight&&(a.styles.rowHeight=f)}a.styles.halign= -"inherit"===d.headerStyles.halign?"center":d.headerStyles.halign;a.styles.valign=d.headerStyles.valign;"undefined"!==typeof e.style&&!0!==e.style.hidden&&("inherit"===d.headerStyles.halign&&(a.styles.halign=e.style.align),"inherit"===d.styles.fillColor&&(a.styles.fillColor=e.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=e.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=e.style.fstyle))}});"function"!==typeof d.createdCell&&(d.createdCell=function(a,b){b=g.teCells[b.row.index+ -":"+b.column.dataKey];a.styles.halign="inherit"===d.styles.halign?"center":d.styles.halign;a.styles.valign=d.styles.valign;"undefined"!==typeof b&&"undefined"!==typeof b.style&&!0!==b.style.hidden&&("inherit"===d.styles.halign&&(a.styles.halign=b.style.align),"inherit"===d.styles.fillColor&&(a.styles.fillColor=b.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=b.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=b.style.fstyle))});"function"!==typeof d.drawHeaderCell&& -(d.drawHeaderCell=function(a,b){var c=g.columns[b.column.dataKey];return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&&0<=c.rowIndex?va(a,b,c):!1});"function"!==typeof d.drawCell&&(d.drawCell=function(a,b){var d=g.teCells[b.row.index+":"+b.column.dataKey];if(!0!==("undefined"!==typeof d&&d.isCanvas))va(a,b,d)&&(g.doc.rect(a.x,a.y,a.width,a.height,a.styles.fillStyle),"undefined"===typeof d||"undefined"!==typeof d.hasUserDefText&&!0===d.hasUserDefText||"undefined"===typeof d.elements|| -!d.elements.length?za(a,{},g):(b=a.height/d.rect.height,b>g.hScaleFactor&&(g.hScaleFactor=b),g.wScaleFactor=a.width/d.rect.width,b=a.textPos.y,ya(a,d.elements,g),a.textPos.y=b,za(a,d.elements,g)));else{d=d.elements[0];var e=c(d).attr("data-tableexport-canvas"),f=d.getBoundingClientRect();a.width=f.width*g.wScaleFactor;a.height=f.height*g.hScaleFactor;b.row.height=a.height;ta(a,d,e,g)}return!1});g.headerrows=[];u=y(c(this));c(u).each(function(){b=0;g.headerrows[n]=[];B(this,"th,td",n,u.length,function(a, -c,d){var e=Ba(a);e.title=E(a,c,d);e.key=b++;e.rowIndex=n;g.headerrows[n].push(e)});n++});if(0