first commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
.clearfix { overflow: hidden; }
|
||||
.results { color: #0073aa; padding: 0 10px; }
|
||||
|
||||
table.dataTable { background: #fff; }
|
||||
table.dataTable thead th { border: none; padding: 10px 18px 0; }
|
||||
table.dataTable thead th,
|
||||
table.dataTable thead td { border-bottom-color: #ddd; border-right: solid 1px #ddd; }
|
||||
table.dataTable thead th:first-child,
|
||||
table.dataTable thead td:first-child { border-left: solid 1px #ddd; }
|
||||
|
||||
.dataTables_wrapper .heading { background: #32373C; padding: 10px; }
|
||||
|
||||
.dataTables_wrapper .dataTables_length,
|
||||
.dataTables_wrapper .dataTables_filter,
|
||||
.dataTables_wrapper .dataTables_info,
|
||||
.dataTables_wrapper .dataTables_processing,
|
||||
.dataTables_wrapper .dataTables_paginate { color: #fff; }
|
||||
|
||||
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
|
||||
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
|
||||
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active { color: #eee !important; }
|
||||
|
||||
.dataTables_wrapper .select-info { color: #eee; font-size: 0.8em; margin: 0 20px; padding: 5px; }
|
||||
|
||||
div.dt-buttons { float: none; padding: 20px; text-align: center; }
|
||||
1
wp-content/plugins/database-for-cf7/resources/css/wpcf7db.min.css
vendored
Normal file
1
wp-content/plugins/database-for-cf7/resources/css/wpcf7db.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.clearfix{overflow:hidden}.results{color:#0073aa;padding:0 10px}table.dataTable{background:#fff}table.dataTable thead th{border:none;padding:10px 18px 0}table.dataTable thead td,table.dataTable thead th{border-bottom-color:#ddd;border-right:solid 1px #ddd}table.dataTable thead td:first-child,table.dataTable thead th:first-child{border-left:solid 1px #ddd}.dataTables_wrapper .heading{background:#32373C;padding:10px}.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_paginate,.dataTables_wrapper .dataTables_processing{color:#fff}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover{color:#eee!important}.dataTables_wrapper .select-info{color:#eee;font-size:.8em;margin:0 20px;padding:5px}div.dt-buttons{float:none;padding:20px;text-align:center}
|
||||
201
wp-content/plugins/database-for-cf7/resources/js/wpcf7db.js
Normal file
201
wp-content/plugins/database-for-cf7/resources/js/wpcf7db.js
Normal file
@@ -0,0 +1,201 @@
|
||||
( function( $ ) {
|
||||
$( '#wpcf7db-table tfoot td' ).each( function () {
|
||||
$( this ).html( '<input type="text" class="large-text" />' );
|
||||
} );
|
||||
|
||||
var table = $( '#wpcf7db-table' ).DataTable( {
|
||||
'dom': '<"clearfix"B><"heading clearfix"lf><t><"heading clearfix"ip>',
|
||||
'pagingType': 'full_numbers',
|
||||
'lengthMenu': [[10, 25, 50, -1], [10, 25, 50, 'All']],
|
||||
'language': {
|
||||
'url': parameters.url + '/libs/datatables/i18n/' + parameters.lang + '.json'
|
||||
},
|
||||
'buttons': [
|
||||
{
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sExport', 'Export' );
|
||||
},
|
||||
'extend': 'collection',
|
||||
'buttons': [
|
||||
{
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sCopy', 'Copy' );
|
||||
},
|
||||
'extend': 'collection',
|
||||
'buttons': [
|
||||
{
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sAll', 'All' );
|
||||
},
|
||||
'extend': 'copyHtml5',
|
||||
'exportOptions': {
|
||||
'columns': ':visible',
|
||||
}
|
||||
}, {
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sSelection', 'Selection' );
|
||||
},
|
||||
'extend': 'copyHtml5',
|
||||
'exportOptions': {
|
||||
'columns': ':visible',
|
||||
'modifier': {
|
||||
'selected': true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}, {
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sExcel', 'Excel' );
|
||||
},
|
||||
'extend': 'collection',
|
||||
'buttons': [
|
||||
{
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sAll', 'All' );
|
||||
},
|
||||
'extend': 'excelHtml5',
|
||||
'exportOptions': {
|
||||
'columns': ':visible',
|
||||
}
|
||||
}, {
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sSelection', 'Selection' );
|
||||
},
|
||||
'extend': 'excelHtml5',
|
||||
'exportOptions': {
|
||||
'columns': ':visible',
|
||||
'modifier': {
|
||||
'selected': true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}, {
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sCsv', 'Csv' );
|
||||
},
|
||||
'extend': 'collection',
|
||||
'buttons': [
|
||||
{
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sAll', 'All' );
|
||||
},
|
||||
'extend': 'csvHtml5',
|
||||
'exportOptions': {
|
||||
'columns': ':visible',
|
||||
}
|
||||
}, {
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sSelection', 'Selection' );
|
||||
},
|
||||
'extend': 'csvHtml5',
|
||||
'exportOptions': {
|
||||
'columns': ':visible',
|
||||
'modifier': {
|
||||
'selected': true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}, {
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sPdf', 'Pdf' );
|
||||
},
|
||||
'extend': 'collection',
|
||||
'buttons': [
|
||||
{
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sAll', 'All' );
|
||||
},
|
||||
'extend': 'pdfHtml5',
|
||||
'exportOptions': {
|
||||
'columns': ':visible',
|
||||
},
|
||||
'download': 'open'
|
||||
}, {
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sSelection', 'Selection' );
|
||||
},
|
||||
'extend': 'pdfHtml5',
|
||||
'exportOptions': {
|
||||
'columns': ':visible',
|
||||
'modifier': {
|
||||
'selected': true
|
||||
}
|
||||
},
|
||||
'download': 'open'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sPrint', 'Print' );
|
||||
},
|
||||
'extend': 'collection',
|
||||
'buttons': [
|
||||
{
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sAll', 'All' );
|
||||
},
|
||||
'extend': 'print',
|
||||
'exportOptions': {
|
||||
'columns': ':visible',
|
||||
},
|
||||
'download': 'open'
|
||||
}, {
|
||||
'text': function ( dt ) {
|
||||
return dt.i18n( 'buttons.sSelection', 'Selection' );
|
||||
},
|
||||
'extend': 'print',
|
||||
'exportOptions': {
|
||||
'columns': ':visible',
|
||||
'modifier': {
|
||||
'selected': true
|
||||
}
|
||||
},
|
||||
'download': 'open'
|
||||
}
|
||||
]
|
||||
},
|
||||
'colvis'
|
||||
],
|
||||
'select': true
|
||||
} );
|
||||
|
||||
$( '#wpcf7db-table tfoot input' ).on( 'keyup change', function () {
|
||||
table
|
||||
.column( $( this ).parent().index() + ':visible' )
|
||||
.search( this.value )
|
||||
.draw();
|
||||
} );
|
||||
|
||||
$( '#wpcf7db-table tfoot tr' ).appendTo( '#wpcf7db-table thead' );
|
||||
|
||||
$( '#delete' ).click( function ( e ) {
|
||||
e.preventDefault();
|
||||
if ( confirm( parameters.confirm ) ) {
|
||||
var selected = $( '.selected' ).map( function() {
|
||||
table.row( '.selected' ).remove().draw( false );
|
||||
return $( this ).attr( 'data-id' );
|
||||
} ).get().join();
|
||||
|
||||
if ( selected.trim() ) {
|
||||
$.ajax({
|
||||
'url' : parameters.ajax_url,
|
||||
'nonce' : parameters.nonce,
|
||||
'type' : 'post',
|
||||
'data' : {
|
||||
'action' : 'wpcf7db_delete',
|
||||
'selected' : selected
|
||||
},
|
||||
success : function( response ) {
|
||||
$( '.results' ).html( response );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
} )( jQuery );
|
||||
1
wp-content/plugins/database-for-cf7/resources/js/wpcf7db.min.js
vendored
Normal file
1
wp-content/plugins/database-for-cf7/resources/js/wpcf7db.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(t){t("#wpcf7db-table tfoot td").each(function(){t(this).html('<input type="text" class="large-text" />')});var e=t("#wpcf7db-table").DataTable({dom:'<"clearfix"B><"heading clearfix"lf><t><"heading clearfix"ip>',pagingType:"full_numbers",lengthMenu:[[10,25,50,-1],[10,25,50,"All"]],language:{url:parameters.url+"/libs/datatables/i18n/"+parameters.lang+".json"},buttons:[{text:function(t){return t.i18n("buttons.sExport","Export")},extend:"collection",buttons:[{text:function(t){return t.i18n("buttons.sCopy","Copy")},extend:"collection",buttons:[{text:function(t){return t.i18n("buttons.sAll","All")},extend:"copyHtml5",exportOptions:{columns:":visible"}},{text:function(t){return t.i18n("buttons.sSelection","Selection")},extend:"copyHtml5",exportOptions:{columns:":visible",modifier:{selected:!0}}}]},{text:function(t){return t.i18n("buttons.sExcel","Excel")},extend:"collection",buttons:[{text:function(t){return t.i18n("buttons.sAll","All")},extend:"excelHtml5",exportOptions:{columns:":visible"}},{text:function(t){return t.i18n("buttons.sSelection","Selection")},extend:"excelHtml5",exportOptions:{columns:":visible",modifier:{selected:!0}}}]},{text:function(t){return t.i18n("buttons.sCsv","Csv")},extend:"collection",buttons:[{text:function(t){return t.i18n("buttons.sAll","All")},extend:"csvHtml5",exportOptions:{columns:":visible"}},{text:function(t){return t.i18n("buttons.sSelection","Selection")},extend:"csvHtml5",exportOptions:{columns:":visible",modifier:{selected:!0}}}]},{text:function(t){return t.i18n("buttons.sPdf","Pdf")},extend:"collection",buttons:[{text:function(t){return t.i18n("buttons.sAll","All")},extend:"pdfHtml5",exportOptions:{columns:":visible"},download:"open"},{text:function(t){return t.i18n("buttons.sSelection","Selection")},extend:"pdfHtml5",exportOptions:{columns:":visible",modifier:{selected:!0}},download:"open"}]}]},{text:function(t){return t.i18n("buttons.sPrint","Print")},extend:"collection",buttons:[{text:function(t){return t.i18n("buttons.sAll","All")},extend:"print",exportOptions:{columns:":visible"},download:"open"},{text:function(t){return t.i18n("buttons.sSelection","Selection")},extend:"print",exportOptions:{columns:":visible",modifier:{selected:!0}},download:"open"}]},"colvis"],select:!0});t("#wpcf7db-table tfoot input").on("keyup change",function(){e.column(t(this).parent().index()+":visible").search(this.value).draw()}),t("#wpcf7db-table tfoot tr").appendTo("#wpcf7db-table thead"),t("#delete").click(function(n){if(n.preventDefault(),confirm(parameters.confirm)){var o=t(".selected").map(function(){return e.row(".selected").remove().draw(!1),t(this).attr("data-id")}).get().join();o.trim()&&t.ajax({url:parameters.ajax_url,nonce:parameters.nonce,type:"post",data:{action:"wpcf7db_delete",selected:o},success:function(e){t(".results").html(e)}})}})}(jQuery);
|
||||
Reference in New Issue
Block a user