diff --git a/browser-extensions/chrome/manifest.json b/browser-extensions/chrome/manifest.json index d3dda95..a874769 100644 --- a/browser-extensions/chrome/manifest.json +++ b/browser-extensions/chrome/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "author": "Lee Wannacott", "name": "table-sort-js", - "version": "1.15.0", + "version": "1.15.1", "description": "Makes tables sortable using table-sort-js: https://github.com/LeeWannacott/table-sort-js", "icons": { "48": "icons/t.png" }, "browser_action": { diff --git a/browser-extensions/chrome/table-sort-js.zip b/browser-extensions/chrome/table-sort-js.zip index c95f984..0d0ed48 100644 Binary files a/browser-extensions/chrome/table-sort-js.zip and b/browser-extensions/chrome/table-sort-js.zip differ diff --git a/browser-extensions/chrome/table-sort.js b/browser-extensions/chrome/table-sort.js index 79bf2c6..05ad269 100644 --- a/browser-extensions/chrome/table-sort.js +++ b/browser-extensions/chrome/table-sort.js @@ -141,7 +141,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { const dataAttributeTd = tr.querySelectorAll("td").item(columnIndex) .dataset.sort; columnData.push(`${dataAttributeTd}#${i}`); - columnIndexAndTableRow[columnData[i]] = tr.innerHTML; + columnIndexAndTableRow[columnData[i]] = tr.outerHTML; } } @@ -206,7 +206,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { timeinSeconds = hours + minutesInSeconds + seconds; } columnData.push(`${timeinSeconds}#${i}`); - columnIndexAndTableRow[columnData[i]] = tr.innerHTML; + columnIndexAndTableRow[columnData[i]] = tr.outerHTML; } } catch (e) { console.log(e); @@ -244,7 +244,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { ); } columnData.push(`${numberToSort}#${i}`); - columnIndexAndTableRow[columnData[i]] = tr.innerHTML; + columnIndexAndTableRow[columnData[i]] = tr.outerHTML; } } catch (e) { console.log(e); @@ -302,7 +302,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { } if (tdTextContent.trim() !== "") { if (isFileSize) { - fileSizeColumnTextAndRow[columnData[i]] = tr.innerHTML; + fileSizeColumnTextAndRow[columnData[i]] = tr.outerHTML; } // These classes already handle pushing to column and setting the tr html. if ( @@ -314,12 +314,12 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { !isSortDateMonthDayYear ) { columnData.push(`${tdTextContent}#${i}`); - columnIndexAndTableRow[`${tdTextContent}#${i}`] = tr.innerHTML; + columnIndexAndTableRow[`${tdTextContent}#${i}`] = tr.outerHTML; } } else { // Fill in blank table cells dict key with filler value. columnData.push(`${fillValue}#${i}`); - columnIndexAndTableRow[`${fillValue}#${i}`] = tr.innerHTML; + columnIndexAndTableRow[`${fillValue}#${i}`] = tr.outerHTML; } } @@ -423,7 +423,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { tr.querySelectorAll("td").item(columnIndex).innerHTML = fileSizeInBytesHTML; } else if (!isFileSize) { - tr.innerHTML = columnIndexAndTableRow[columnData[i]]; + tr.outerHTML = columnIndexAndTableRow[columnData[i]]; } } } diff --git a/browser-extensions/firefox/manifest.json b/browser-extensions/firefox/manifest.json index c1897f8..93f9e9d 100644 --- a/browser-extensions/firefox/manifest.json +++ b/browser-extensions/firefox/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "author": "Lee Wannacott", "name": "table-sort-js", - "version": "1.15.0", + "version": "1.15.1", "description": "Makes tables sortable using table-sort-js: https://github.com/LeeWannacott/table-sort-js", "icons": { "48": "icons/t.png" }, "browser_action": { diff --git a/browser-extensions/firefox/table-sort-js.zip b/browser-extensions/firefox/table-sort-js.zip index d2353ef..c65d5a7 100644 Binary files a/browser-extensions/firefox/table-sort-js.zip and b/browser-extensions/firefox/table-sort-js.zip differ diff --git a/browser-extensions/firefox/table-sort.js b/browser-extensions/firefox/table-sort.js index 79bf2c6..05ad269 100644 --- a/browser-extensions/firefox/table-sort.js +++ b/browser-extensions/firefox/table-sort.js @@ -141,7 +141,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { const dataAttributeTd = tr.querySelectorAll("td").item(columnIndex) .dataset.sort; columnData.push(`${dataAttributeTd}#${i}`); - columnIndexAndTableRow[columnData[i]] = tr.innerHTML; + columnIndexAndTableRow[columnData[i]] = tr.outerHTML; } } @@ -206,7 +206,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { timeinSeconds = hours + minutesInSeconds + seconds; } columnData.push(`${timeinSeconds}#${i}`); - columnIndexAndTableRow[columnData[i]] = tr.innerHTML; + columnIndexAndTableRow[columnData[i]] = tr.outerHTML; } } catch (e) { console.log(e); @@ -244,7 +244,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { ); } columnData.push(`${numberToSort}#${i}`); - columnIndexAndTableRow[columnData[i]] = tr.innerHTML; + columnIndexAndTableRow[columnData[i]] = tr.outerHTML; } } catch (e) { console.log(e); @@ -302,7 +302,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { } if (tdTextContent.trim() !== "") { if (isFileSize) { - fileSizeColumnTextAndRow[columnData[i]] = tr.innerHTML; + fileSizeColumnTextAndRow[columnData[i]] = tr.outerHTML; } // These classes already handle pushing to column and setting the tr html. if ( @@ -314,12 +314,12 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { !isSortDateMonthDayYear ) { columnData.push(`${tdTextContent}#${i}`); - columnIndexAndTableRow[`${tdTextContent}#${i}`] = tr.innerHTML; + columnIndexAndTableRow[`${tdTextContent}#${i}`] = tr.outerHTML; } } else { // Fill in blank table cells dict key with filler value. columnData.push(`${fillValue}#${i}`); - columnIndexAndTableRow[`${fillValue}#${i}`] = tr.innerHTML; + columnIndexAndTableRow[`${fillValue}#${i}`] = tr.outerHTML; } } @@ -423,7 +423,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { tr.querySelectorAll("td").item(columnIndex).innerHTML = fileSizeInBytesHTML; } else if (!isFileSize) { - tr.innerHTML = columnIndexAndTableRow[columnData[i]]; + tr.outerHTML = columnIndexAndTableRow[columnData[i]]; } } } diff --git a/npm/package.json b/npm/package.json index 05bf712..bedd0de 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "table-sort-js", - "version": "1.15.0", + "version": "1.15.1", "description": "A JavaScript client-side HTML table sorting library with no dependencies required.", "license": "MIT", "repository": "LeeWannacott/table-sort-js", diff --git a/npm/table-sort.js b/npm/table-sort.js index 79bf2c6..05ad269 100644 --- a/npm/table-sort.js +++ b/npm/table-sort.js @@ -141,7 +141,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { const dataAttributeTd = tr.querySelectorAll("td").item(columnIndex) .dataset.sort; columnData.push(`${dataAttributeTd}#${i}`); - columnIndexAndTableRow[columnData[i]] = tr.innerHTML; + columnIndexAndTableRow[columnData[i]] = tr.outerHTML; } } @@ -206,7 +206,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { timeinSeconds = hours + minutesInSeconds + seconds; } columnData.push(`${timeinSeconds}#${i}`); - columnIndexAndTableRow[columnData[i]] = tr.innerHTML; + columnIndexAndTableRow[columnData[i]] = tr.outerHTML; } } catch (e) { console.log(e); @@ -244,7 +244,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { ); } columnData.push(`${numberToSort}#${i}`); - columnIndexAndTableRow[columnData[i]] = tr.innerHTML; + columnIndexAndTableRow[columnData[i]] = tr.outerHTML; } } catch (e) { console.log(e); @@ -302,7 +302,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { } if (tdTextContent.trim() !== "") { if (isFileSize) { - fileSizeColumnTextAndRow[columnData[i]] = tr.innerHTML; + fileSizeColumnTextAndRow[columnData[i]] = tr.outerHTML; } // These classes already handle pushing to column and setting the tr html. if ( @@ -314,12 +314,12 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { !isSortDateMonthDayYear ) { columnData.push(`${tdTextContent}#${i}`); - columnIndexAndTableRow[`${tdTextContent}#${i}`] = tr.innerHTML; + columnIndexAndTableRow[`${tdTextContent}#${i}`] = tr.outerHTML; } } else { // Fill in blank table cells dict key with filler value. columnData.push(`${fillValue}#${i}`); - columnIndexAndTableRow[`${fillValue}#${i}`] = tr.innerHTML; + columnIndexAndTableRow[`${fillValue}#${i}`] = tr.outerHTML; } } @@ -423,7 +423,7 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { tr.querySelectorAll("td").item(columnIndex).innerHTML = fileSizeInBytesHTML; } else if (!isFileSize) { - tr.innerHTML = columnIndexAndTableRow[columnData[i]]; + tr.outerHTML = columnIndexAndTableRow[columnData[i]]; } } } diff --git a/public/table-sort.js b/public/table-sort.js index e8b2496..05ad269 100644 --- a/public/table-sort.js +++ b/public/table-sort.js @@ -386,7 +386,6 @@ function tableSortJs(testingTableSortJS = false, domDocumentWindow = document) { } } - function updateTable(tableProperties) { const { tableRows, columnData, isFileSize } = tableProperties; for (let [i, tr] of tableRows.entries()) {