Cleanup code style.

This commit is contained in:
Benjamin Tan 2018-02-08 11:22:01 +08:00
parent fb97d99bff
commit 18e7dd2173
3 changed files with 99 additions and 101 deletions

View File

@ -403,13 +403,13 @@
} }
/** /**
* Loads the dependencies of reveal.js. Dependencies are * Loads the dependencies of reveal.js. Dependencies are
* defined via the configuration option 'dependencies' * defined via the configuration option 'dependencies'
* and will be loaded prior to starting/binding reveal.js. * and will be loaded prior to starting/binding reveal.js.
* Some dependencies may have an 'async' flag, if so they * Some dependencies may have an 'async' flag, if so they
* will load after reveal.js has been started up. * will load after reveal.js has been started up.
*/ */
function load() { function load() {
var scripts = [], var scripts = [],

View File

@ -42,28 +42,26 @@ probePage.open( inputFile, function( status ) {
printPage.open( inputFile, function( status ) { printPage.open( inputFile, function( status ) {
console.log( 'Export PDF: Preparing pdf [3/4]') console.log( 'Export PDF: Preparing pdf [3/4]')
printPage.evaluate(function() { printPage.evaluate( function() {
Reveal.isReady() ? window.callPhantom() : Reveal.addEventListener( 'pdf-ready', window.callPhantom ); Reveal.isReady() ? window.callPhantom() : Reveal.addEventListener( 'pdf-ready', window.callPhantom );
}); } );
} ); } );
printPage.onCallback = function(data) { printPage.onCallback = function( data ) {
// For some reason we need to "jump the queue" for syntax highlighting to work. // For some reason we need to "jump the queue" for syntax highlighting to work.
// See: http://stackoverflow.com/a/3580132/129269 // See: http://stackoverflow.com/a/3580132/129269
setTimeout(function() { setTimeout( function() {
console.log( 'Export PDF: Writing file [4/4]' ); console.log( 'Export PDF: Writing file [4/4]' );
printPage.render( outputFile ); printPage.render( outputFile );
console.log( 'Export PDF: Finished successfully!' ); console.log( 'Export PDF: Finished successfully!' );
phantom.exit(); phantom.exit();
}, 0); }, 0 );
}; };
} }
else { else {
console.log( 'Export PDF: Unable to read reveal.js config. Make sure the input address points to a reveal.js page.' ); console.log( 'Export PDF: Unable to read reveal.js config. Make sure the input address points to a reveal.js page.' );
phantom.exit(1); phantom.exit( 1 );
} }
} ); } );

File diff suppressed because one or more lines are too long