Skip to content

Commit

Permalink
919d14b1f89aba2f84090b4a174f07bb3af23402 Dev: Correct place for the D…
Browse files Browse the repository at this point in the history
…T stripHtml util

Sync to source repo @919d14b1f89aba2f84090b4a174f07bb3af23402
  • Loading branch information
dtbuild committed Apr 10, 2024
1 parent a8fee93 commit 015eb13
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
],
"src-repo": "http://github.com/DataTables/Buttons",
"last-tag": "3.0.1",
"last-sync": "12b7a82fe5ce2d000285e6a99d39fa826ccf477a"
"last-sync": "919d14b1f89aba2f84090b4a174f07bb3af23402"
}
2 changes: 1 addition & 1 deletion js/buttons.colVis.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ $.extend(DataTable.ext.buttons, {
title = DataTable.Buttons.stripHtmlComments(title);

// Use whatever HTML stripper DataTables is configured for
title = DataTable.stripHtml(title).trim();
title = DataTable.util.stripHtml(title).trim();

return conf.columnText ? conf.columnText(dt, idx, title) : title;
}
Expand Down
2 changes: 1 addition & 1 deletion js/buttons.colVis.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/buttons.colVis.min.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* Column visibility buttons for Buttons and DataTables.
* © SpryMedia Ltd - datatables.net/license
*/
import jQuery from"jquery";import DataTable from"datatables.net";import Buttons from"datatables.net-buttons";let $=jQuery;$.extend(DataTable.ext.buttons,{colvis:function(n,t){var i=null,o={extend:"collection",init:function(n,t){i=t},text:function(n){return n.i18n("buttons.colvis","Column visibility")},className:"buttons-colvis",closeButton:!1,buttons:[{extend:"columnsToggle",columns:t.columns,columnText:t.columnText}]};return n.on("column-reorder.dt"+t.namespace,function(){n.button(null,n.button(null,i).node()).collectionRebuild([{extend:"columnsToggle",columns:t.columns,columnText:t.columnText}])}),o},columnsToggle:function(n,t){return n.columns(t.columns).indexes().map(function(n){return{extend:"columnToggle",columns:n,columnText:t.columnText}}).toArray()},columnToggle:function(n,t){return{extend:"columnVisibility",columns:t.columns,columnText:t.columnText}},columnsVisibility:function(n,t){return n.columns(t.columns).indexes().map(function(n){return{extend:"columnVisibility",columns:n,visibility:t.visibility,columnText:t.columnText}}).toArray()},columnVisibility:{columns:void 0,text:function(n,t,i){return i._columnText(n,i)},className:"buttons-columnVisibility",action:function(n,t,i,o){var t=t.columns(o.columns),e=t.visible();t.visible(void 0!==o.visibility?o.visibility:!(e.length&&e[0]))},init:function(i,n,o){var e=this;n.attr("data-cv-idx",o.columns),i.on("column-visibility.dt"+o.namespace,function(n,t){t.bDestroying||t.nTable!=i.settings()[0].nTable||e.active(i.column(o.columns).visible())}).on("column-reorder.dt"+o.namespace,function(){o.destroying||1===i.columns(o.columns).count()&&(e.text(o._columnText(i,o)),e.active(i.column(o.columns).visible()))}),this.active(i.column(o.columns).visible())},destroy:function(n,t,i){n.off("column-visibility.dt"+i.namespace).off("column-reorder.dt"+i.namespace)},_columnText:function(n,t){var i,o;return"string"==typeof t.text?t.text:(o=n.column(t.columns).title(),i=n.column(t.columns).index(),o=o.replace(/\n/g," ").replace(/<br\s*\/?>/gi," ").replace(/<select(.*?)<\/select\s*>/gi,""),o=DataTable.Buttons.stripHtmlComments(o),o=DataTable.stripHtml(o).trim(),t.columnText?t.columnText(n,i,o):o)}},colvisRestore:{className:"buttons-colvisRestore",text:function(n){return n.i18n("buttons.colvisRestore","Restore visibility")},init:function(n,t,i){n.columns().every(function(){var n=this.init();void 0===n.__visOriginal&&(n.__visOriginal=this.visible())})},action:function(n,t,i,o){t.columns().every(function(n){var t=this.init();this.visible(t.__visOriginal)})}},colvisGroup:{className:"buttons-colvisGroup",action:function(n,t,i,o){t.columns(o.show).visible(!0,!1),t.columns(o.hide).visible(!1,!1),t.columns.adjust()},show:[],hide:[]}});export default DataTable;
import jQuery from"jquery";import DataTable from"datatables.net";import Buttons from"datatables.net-buttons";let $=jQuery;$.extend(DataTable.ext.buttons,{colvis:function(n,t){var i=null,o={extend:"collection",init:function(n,t){i=t},text:function(n){return n.i18n("buttons.colvis","Column visibility")},className:"buttons-colvis",closeButton:!1,buttons:[{extend:"columnsToggle",columns:t.columns,columnText:t.columnText}]};return n.on("column-reorder.dt"+t.namespace,function(){n.button(null,n.button(null,i).node()).collectionRebuild([{extend:"columnsToggle",columns:t.columns,columnText:t.columnText}])}),o},columnsToggle:function(n,t){return n.columns(t.columns).indexes().map(function(n){return{extend:"columnToggle",columns:n,columnText:t.columnText}}).toArray()},columnToggle:function(n,t){return{extend:"columnVisibility",columns:t.columns,columnText:t.columnText}},columnsVisibility:function(n,t){return n.columns(t.columns).indexes().map(function(n){return{extend:"columnVisibility",columns:n,visibility:t.visibility,columnText:t.columnText}}).toArray()},columnVisibility:{columns:void 0,text:function(n,t,i){return i._columnText(n,i)},className:"buttons-columnVisibility",action:function(n,t,i,o){var t=t.columns(o.columns),e=t.visible();t.visible(void 0!==o.visibility?o.visibility:!(e.length&&e[0]))},init:function(i,n,o){var e=this;n.attr("data-cv-idx",o.columns),i.on("column-visibility.dt"+o.namespace,function(n,t){t.bDestroying||t.nTable!=i.settings()[0].nTable||e.active(i.column(o.columns).visible())}).on("column-reorder.dt"+o.namespace,function(){o.destroying||1===i.columns(o.columns).count()&&(e.text(o._columnText(i,o)),e.active(i.column(o.columns).visible()))}),this.active(i.column(o.columns).visible())},destroy:function(n,t,i){n.off("column-visibility.dt"+i.namespace).off("column-reorder.dt"+i.namespace)},_columnText:function(n,t){var i,o;return"string"==typeof t.text?t.text:(o=n.column(t.columns).title(),i=n.column(t.columns).index(),o=o.replace(/\n/g," ").replace(/<br\s*\/?>/gi," ").replace(/<select(.*?)<\/select\s*>/gi,""),o=DataTable.Buttons.stripHtmlComments(o),o=DataTable.util.stripHtml(o).trim(),t.columnText?t.columnText(n,i,o):o)}},colvisRestore:{className:"buttons-colvisRestore",text:function(n){return n.i18n("buttons.colvisRestore","Restore visibility")},init:function(n,t,i){n.columns().every(function(){var n=this.init();void 0===n.__visOriginal&&(n.__visOriginal=this.visible())})},action:function(n,t,i,o){t.columns().every(function(n){var t=this.init();this.visible(t.__visOriginal)})}},colvisGroup:{className:"buttons-colvisGroup",action:function(n,t,i,o){t.columns(o.show).visible(!0,!1),t.columns(o.hide).visible(!1,!1),t.columns.adjust()},show:[],hide:[]}});export default DataTable;
2 changes: 1 addition & 1 deletion js/buttons.colVis.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ $.extend(DataTable.ext.buttons, {
title = DataTable.Buttons.stripHtmlComments(title);

// Use whatever HTML stripper DataTables is configured for
title = DataTable.stripHtml(title).trim();
title = DataTable.util.stripHtml(title).trim();

return conf.columnText ? conf.columnText(dt, idx, title) : title;
}
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,7 @@ Buttons.stripData = function (str, config) {
str = Buttons.stripHtmlComments(str);

if (!config || config.stripHtml) {
str = DataTable.stripHtml(str);
str = DataTable.util.stripHtml(str);
}

if (!config || config.trim) {
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.buttons.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.buttons.min.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.buttons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ Buttons.stripData = function (str, config) {
str = Buttons.stripHtmlComments(str);

if (!config || config.stripHtml) {
str = DataTable.stripHtml(str);
str = DataTable.util.stripHtml(str);
}

if (!config || config.trim) {
Expand Down

0 comments on commit 015eb13

Please sign in to comment.