MediaWiki:Gadget-PrintSubmission.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
$( function () {
var printtoPDFbutton = new OO.ui.ButtonWidget( {
label: 'Save Application as PDF',
flags: 'progressive',
icon: 'article'
} );
var printbutton = new OO.ui.ButtonWidget( {
label: 'Print Your Submitted Application',
flags: 'progressive',
icon: 'printer'
} );
$( '#printSubmission' ).append( printtoPDFbutton.$element ).append( printbutton.$element );
printtoPDFbutton.on( 'click', function() {
$.getScript( "/extensions/TsadraWikiStyles/scripts/html2pdf.bundle.min.js", function (){
var printtopdf = document.getElementById('print-to-pdf');
html2pdf(printtopdf).set({
pagebreak: { mode: 'avoid-all' }
});
});
});
printbutton.on( 'click', function() {
window.print();
return false;
});
});