MediaWiki:Common.js: Difference between revisions
MikeSaunders (talk | contribs) No edit summary |
MikeSaunders (talk | contribs) No edit summary |
||
Line 22: | Line 22: | ||
} | } | ||
}); | }); | ||
//datatables | |||
//styles | |||
$('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'https://cdn.datatables.net/1.13.7/css/jquery.dataTables.css') ); | |||
$('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/themes/base/jquery-ui.min.css') ); | |||
$('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'https://cdn.datatables.net/v/ju/jszip-3.10.1/dt-1.13.7/b-2.4.2/b-html5-2.4.2/fh-3.4.0/kt-2.11.0/sp-2.2.0/sl-1.7.0/datatables.min.css') ); | |||
//scripts | |||
$('head').append( $('<script type="text/javascript" />').attr('src', 'https://cdn.datatables.net/1.13.7/js/jquery.dataTables.js') ); | |||
$('head').append( $('<script type="text/javascript" />').attr('src', 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js') ); | |||
$('head').append( $('<script type="text/javascript" />').attr('src', 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js') ); | |||
$('head').append( $('<script type="text/javascript" />').attr('src', 'https://cdn.datatables.net/v/ju/jszip-3.10.1/dt-1.13.7/b-2.4.2/b-html5-2.4.2/fh-3.4.0/kt-2.11.0/sp-2.2.0/sl-1.7.0/datatables.min.js') ); | |||
$('head').append( $('<script type="text/javascript" />').attr('src', 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js') ); | |||
$(document).ready( function () { | |||
$('#table').DataTable( { | |||
paging: false, | |||
ordering: false, | |||
fixedHeader: true, | |||
keys: true, | |||
dom: 'Bfrtip', | |||
buttons: [ | |||
'excelHtml5', | |||
'csvHtml5', | |||
'pdfHtml5' | |||
] | |||
} ); | |||
} ); |
Revision as of 12:46, 14 November 2023
$(document).ready(function(){ $("#bodySearchInputsearchInput").on("keyup", function() { var value = $(this).val().toLowerCase(); $("#table tr").filter(function() { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) }); }); }); $(document).ready(function(){ // Remove the action from the Inputbox search form $("#bodySearchsearchInput").attr('action', 'javascript:void(0);'); }); // content warning message $(function() { if (localStorage.getItem("firstTime") == null) { document.getElementById("siteNotice").style.display = "block"; localStorage.setItem("firstTime", "done"); } }); //datatables //styles $('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'https://cdn.datatables.net/1.13.7/css/jquery.dataTables.css') ); $('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/themes/base/jquery-ui.min.css') ); $('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'https://cdn.datatables.net/v/ju/jszip-3.10.1/dt-1.13.7/b-2.4.2/b-html5-2.4.2/fh-3.4.0/kt-2.11.0/sp-2.2.0/sl-1.7.0/datatables.min.css') ); //scripts $('head').append( $('<script type="text/javascript" />').attr('src', 'https://cdn.datatables.net/1.13.7/js/jquery.dataTables.js') ); $('head').append( $('<script type="text/javascript" />').attr('src', 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js') ); $('head').append( $('<script type="text/javascript" />').attr('src', 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js') ); $('head').append( $('<script type="text/javascript" />').attr('src', 'https://cdn.datatables.net/v/ju/jszip-3.10.1/dt-1.13.7/b-2.4.2/b-html5-2.4.2/fh-3.4.0/kt-2.11.0/sp-2.2.0/sl-1.7.0/datatables.min.js') ); $('head').append( $('<script type="text/javascript" />').attr('src', 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js') ); $(document).ready( function () { $('#table').DataTable( { paging: false, ordering: false, fixedHeader: true, keys: true, dom: 'Bfrtip', buttons: [ 'excelHtml5', 'csvHtml5', 'pdfHtml5' ] } ); } );