Skip to content

Commit

Permalink
Remove page title and blank line when copying tables; convert hr tags…
Browse files Browse the repository at this point in the history
… in table cells to commas when copying worksets table
  • Loading branch information
aanil committed Jan 16, 2025
1 parent b029e9d commit d91914c
Show file tree
Hide file tree
Showing 12 changed files with 171 additions and 24 deletions.
14 changes: 12 additions & 2 deletions run_dir/design/element_flowcells.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,18 @@ <h1>
dom: 'Bfrti',
colReorder: true,
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
]
});

Expand Down
14 changes: 12 additions & 2 deletions run_dir/design/flowcells.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,18 @@ <h1><span id="illumina_page_title">Illumina flowcells</span>
colReorder: true,
dom: 'Bfrti',
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
]
});
//Keep markdown format when dragging around the columns
Expand Down
14 changes: 12 additions & 2 deletions run_dir/design/ont_flowcells.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,18 @@ <h1>
dom: 'Bfrti',
colReorder: true,
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
]
});

Expand Down
14 changes: 12 additions & 2 deletions run_dir/static/js/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,18 @@ function init_datatable_controls(table_name) {
"destroy": true,
dom: 'Bfrti',
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
]
});

Expand Down
14 changes: 12 additions & 2 deletions run_dir/static/js/libpooling_queues.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,18 @@ function init_listjs() {
"order": [],
dom: 'Bfrti',
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
],
"drawCallback": function ( settings ) {
var api = this.api();
Expand Down
14 changes: 12 additions & 2 deletions run_dir/static/js/project_samples_old.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,18 @@ function init_datatable() {
"order": [[ 0, "asc" ]],
dom: 'Bfrti',
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
]
});
//Add the bootstrap classes to the search thingy
Expand Down
14 changes: 12 additions & 2 deletions run_dir/static/js/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,18 @@ function init_listjs(no_items, columns) {
"order": [[ 0, "desc" ]],
dom: 'Bfrti',
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
],
"stateSave"true,
"stateLoadCallback": function () {
Expand Down
14 changes: 12 additions & 2 deletions run_dir/static/js/qpcr_pools.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,18 @@ function init_listjs() {
"order": [],
dom: 'Bfrti',
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
],
"drawCallback": function ( settings ) {
var api = this.api();
Expand Down
14 changes: 12 additions & 2 deletions run_dir/static/js/sequencing_queues.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,18 @@ function init_listjs() {
"order": [],
dom: 'Bfrti',
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
],
"drawCallback": function ( settings ) {
var api = this.api();
Expand Down
14 changes: 12 additions & 2 deletions run_dir/static/js/smartseq3_progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,18 @@ function init_datatable() {
dom: 'Bfrti',
colReorder: true,
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
]
});
//Add the bootstrap classes to the search thingy
Expand Down
14 changes: 12 additions & 2 deletions run_dir/static/js/workset_queues.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,18 @@ function init_listjs() {
"info":false,
dom: 'Bfrti',
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3',
messageTop: null,
title: null,
}
],
"drawCallback": function ( settings ) {
var api = this.api();
Expand Down
41 changes: 39 additions & 2 deletions run_dir/static/js/worksets.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function load_table() {
// Initialize sorting and searching javascript plugin
function init_listjs() {
// Setup - add a text input to each footer cell
console.log('asder')
$('#workset_table tfoot th').each( function () {
var title = $('#workset_table thead th').eq( $(this).index() ).text();
$(this).html( '<input size=10 type="text" placeholder="Search..." />' );
Expand All @@ -45,8 +46,44 @@ function init_listjs() {
dom: 'Bfrti',
colReorder: true,
buttons: [
{ extend: 'copy', className: 'btn btn-outline-dark mb-3' },
{ extend: 'excel', className: 'btn btn-outline-dark mb-3' }
{
extend: 'copy',
className: 'btn btn-outline-dark mb-3',
// Remove top two lines with Page title and blank line in output
messageTop: null,
title: null,
exportOptions: {
format: {
body: function ( data, row, column, node ) {
// Replace <hr> with a comma, remove all other html tags, remove newlines, remove &nbsp;
// These are required since modfying format retains all the html tags
return data.replace(/<hr\s*[^>]*\s*\/?>/gi, ', ')
.replace(/<[^>]*>/g, '')
.replace(/\r?\n|\r/g, '')
.replace(/&nbsp;/g, ' ');
}
}
}
},
{
extend: 'excel',
className: 'btn btn-outline-dark mb-3' ,
// Remove top two lines with Page title and blank line in output
messageTop: null,
title: null,
exportOptions: {
format: {
body: function ( data, row, column, node ) {
// Replace <hr> with a comma, remove all other html tags, remove newlines, remove &nbsp;
// These are required since modfying format retains all the html tags
return data.replace(/<hr\s*[^>]*\s*\/?>/gi, ', ')
.replace(/<[^>]*>/g, '')
.replace(/\r?\n|\r/g, '')
.replace(/&nbsp;/g, ' ');
}
}
}
}
]
});
//Keep markdown format when dragging around the columns
Expand Down

0 comments on commit d91914c

Please sign in to comment.