code format tweaks

This commit is contained in:
Hakim El Hattab 2013-11-26 17:32:43 -05:00
parent 75845a92c3
commit 3be84bcbe3
2 changed files with 50 additions and 49 deletions

View File

@ -251,12 +251,14 @@ var Reveal = (function(){
* 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 = [],
scriptsAsync = [], scriptsAsync = [],
scriptsToApply = 0; scriptsToPreload = 0;
// Called once synchronous scripts finish loading // Called once synchronous scripts finish loading
function proceed() { function proceed() {
console.log(111);
if( scriptsAsync.length ) { if( scriptsAsync.length ) {
// Load asynchronous scripts // Load asynchronous scripts
head.js.apply( null, scriptsAsync ); head.js.apply( null, scriptsAsync );
@ -265,15 +267,14 @@ var Reveal = (function(){
start(); start();
} }
function loadDependency(s) { function loadScript( s ) {
head.ready( s.src.match( /([\w\d_\-]*)\.?js$|[^\\\/]*$/i )[0], function() { head.ready( s.src.match( /([\w\d_\-]*)\.?js$|[^\\\/]*$/i )[0], function() {
// Extension may contain callback functions // Extension may contain callback functions
if( typeof s.callback === 'function' ) { if( typeof s.callback === 'function' ) {
s.callback.apply(this); s.callback.apply(this);
} }
scriptsToApply--; if( --scriptsToPreload === 0 ) {
if (scriptsToApply === 0) {
proceed(); proceed();
} }
}); });
@ -291,12 +292,12 @@ var Reveal = (function(){
scripts.push( s.src ); scripts.push( s.src );
} }
loadDependency(s); loadScript( s );
} }
} }
if( scripts.length ) { if( scripts.length ) {
scriptsToApply = scripts.length; scriptsToPreload = scripts.length;
// Load synchronous scripts // Load synchronous scripts
head.js.apply( null, scripts ); head.js.apply( null, scripts );

6
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long