From 876e49bf1abc587e8529cdf52bd2a0b0bc6fbbf9 Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 23 May 2014 07:46:10 -0500 Subject: [PATCH 1/4] Docs: reflow demo now uses css transitions --- docs/example-widget-reflow.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/example-widget-reflow.html b/docs/example-widget-reflow.html index f95eef79..7d1a6140 100644 --- a/docs/example-widget-reflow.html +++ b/docs/example-widget-reflow.html @@ -77,8 +77,9 @@ .columnSelector .disabled { color: #ddd; } - #table1, #table2, #table3 { + .frame-wrapper { max-width: 100%; + transition: all 1s ease 0s; } iframe { width: 100%; @@ -506,7 +507,7 @@ table.ui-table-reflow .ui-table-cell-label.ui-table-cell-label-top {
  • -
    +
    @@ -521,7 +522,7 @@ table.ui-table-reflow .ui-table-cell-label.ui-table-cell-label-top {
  • -
    +
    @@ -536,7 +537,7 @@ table.ui-table-reflow .ui-table-cell-label.ui-table-cell-label-top {
  • -
    +
    From ff46cccb9dbad27e94a9bff62d9a9b186786b566 Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 23 May 2014 07:48:23 -0500 Subject: [PATCH 2/4] Math: values are now obtained from data-attributes first --- docs/example-widget-math.html | 12 +++++++++--- js/widgets/widget-math.js | 24 +++++++++++++++++++----- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/docs/example-widget-math.html b/docs/example-widget-math.html index 74b0e2cf..c21ca9e5 100644 --- a/docs/example-widget-math.html +++ b/docs/example-widget-math.html @@ -181,6 +181,12 @@

    Notes

      +
    • In v2.17.1, +
        +
      • Values added to the data-attribute set by the textAttribute option will now be used in the calculation instead of the actual cell content.
      • +
      • The Grand Total cells now shows a higher precision value to emphasize this point.
      • +
      +
    • In v2.16.4, added:
      • Two new options: math_prefix and math_suffix, which will be added before or after the prefix or suffix, respectively.
      • @@ -513,7 +519,7 @@ BAD => No minus (-) here! $#,###.00 or [-] here either <= BAD Grand Total - all-sum + all-sum @@ -536,8 +542,8 @@ BAD => No minus (-) here! $#,###.00 or [-] here either <= BAD NorthJoseph$ 3,643$ 5,846$ 6,574row-sum - NorthLawrence$ 4,456$ 6,658$ 7,685row-sum - NorthMaria$ 6,235$ 4,616.99$ 3,612.33row-sum + NorthLawrence$ 4,456$ 6,658$ 7,685row-sum + NorthMaria$ 6,235$ 4,616.99$ 3,612.33row-sum NorthMatt$ 3,868$ 3,926$ 3,254row-sum diff --git a/js/widgets/widget-math.js b/js/widgets/widget-math.js index 42c33984..947ba3ba 100644 --- a/js/widgets/widget-math.js +++ b/js/widgets/widget-math.js @@ -12,7 +12,8 @@ // get all of the row numerical values in an arry getRow : function(table, wo, $el, dataAttrib) { - var txt, + var $t, txt, + c = table.config, arry = [], $row = $el.closest('tr'), $cells = $row.children(); @@ -21,7 +22,11 @@ $cells = $cells.not('[' + dataAttrib + '=ignore]').not('[data-column=' + wo.math_ignore.join('],[data-column=') + ']'); } arry = $cells.not($el).map(function(){ - txt = this.textContent || $(this).text(); + $t = $(this); + txt = $t.attr(c.textAttribute); + if (typeof txt === "undefined") { + txt = this.textContent || $t.text(); + } txt = ts.formatFloat(txt.replace(/[^\w,. \-()]/g, ""), table); return isNaN(txt) ? 0 : txt; }).get(); @@ -52,7 +57,10 @@ if (mathAbove) { i = 0; } else if ($t.length) { - txt = $t[0].textContent || $t.text(); + txt = $t.attr(c.textAttribute); + if (typeof txt === "undefined") { + txt = $t[0].textContent || $t.text(); + } txt = ts.formatFloat(txt.replace(/[^\w,. \-()]/g, ""), table); arry.push(isNaN(txt) ? 0 : txt); } @@ -63,7 +71,10 @@ $rows.each(function(){ $t = $(this).children().filter('[data-column=' + cIndex + ']'); if (!$(this).hasClass(filtered) && $t.not('[' + dataAttrib + '^=above],[' + dataAttrib + '^=col]').length && !$t.is($el)) { - txt = ($t[0] ? $t[0].textContent : '') || $t.text(); + txt = $t.attr(c.textAttribute); + if (typeof txt === "undefined") { + txt = ($t[0] ? $t[0].textContent : '') || $t.text(); + } txt = ts.formatFloat(txt.replace(/[^\w,. \-()]/g, ""), table); arry.push(isNaN(txt) ? 0 : txt); } @@ -85,7 +96,10 @@ $t = $(this); col = parseInt( $t.attr('data-column'), 10); if (!$t.filter('[' + dataAttrib + ']').length && $.inArray(col, wo.math_ignore) < 0) { - txt = ($t[0] ? $t[0].textContent : '') || $t.text(); + txt = $t.attr(c.textAttribute); + if (typeof txt === "undefined") { + txt = ($t[0] ? $t[0].textContent : '') || $t.text(); + } txt = ts.formatFloat(txt.replace(/[^\w,. \-()]/g, ""), table); arry.push(isNaN(txt) ? 0 : txt); } From d77dc71d559fbee0ab293809fe3747af8ce56af5 Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 23 May 2014 11:21:07 -0500 Subject: [PATCH 3/4] Docs: add output widget .htaccess note for IE & FF --- docs/example-widget-output.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/example-widget-output.html b/docs/example-widget-output.html index a36bc7da..4f4fbff8 100644 --- a/docs/example-widget-output.html +++ b/docs/example-widget-output.html @@ -287,6 +287,12 @@ widgets: ['zebra', 'output'] }); }); +

        .htaccess

        + Do not forget to set Content-disposition headers in order to make downloads work properly in IE and FF. So .htaccess can look like: +
        <FilesMatch "\.(?i:csv|txt)$">
        +    ForceType application/octet-stream
        +    Header set Content-Disposition attachment
        +</FilesMatch>

    Rowspan and colspan

    From a3615b3910575a31dd2e329eec39792ffa437394 Mon Sep 17 00:00:00 2001 From: Mottie Date: Sat, 24 May 2014 10:37:28 -0500 Subject: [PATCH 4/4] Core: allow use of select & buttons in the header. Fixes #625 --- js/jquery.tablesorter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index c58d1105..14726d29 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -1225,7 +1225,7 @@ // set timer on mousedown if (type === 'mousedown') { downTime = new Date().getTime(); - return e.target.tagName === "INPUT" ? '' : !c.cancelSelection; + return /(input|select|button|textarea)/i.test(e.target.tagName) ? '' : !c.cancelSelection; } if (c.delayInit && isEmptyObject(c.cache)) { buildCache(table); } // jQuery v1.2.6 doesn't have closest()