code format tweaks
This commit is contained in:
parent
75845a92c3
commit
3be84bcbe3
93
js/reveal.js
93
js/reveal.js
@ -250,62 +250,63 @@ var Reveal = (function(){
|
|||||||
* 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 = [],
|
|
||||||
scriptsAsync = [],
|
|
||||||
scriptsToApply = 0;
|
|
||||||
|
|
||||||
// Called once synchronous scripts finish loading
|
var scripts = [],
|
||||||
function proceed() {
|
scriptsAsync = [],
|
||||||
if( scriptsAsync.length ) {
|
scriptsToPreload = 0;
|
||||||
// Load asynchronous scripts
|
|
||||||
head.js.apply( null, scriptsAsync );
|
|
||||||
}
|
|
||||||
|
|
||||||
start();
|
// Called once synchronous scripts finish loading
|
||||||
}
|
function proceed() {
|
||||||
|
console.log(111);
|
||||||
|
if( scriptsAsync.length ) {
|
||||||
|
// Load asynchronous scripts
|
||||||
|
head.js.apply( null, scriptsAsync );
|
||||||
|
}
|
||||||
|
|
||||||
function loadDependency(s) {
|
start();
|
||||||
head.ready( s.src.match( /([\w\d_\-]*)\.?js$|[^\\\/]*$/i )[0], function() {
|
}
|
||||||
// Extension may contain callback functions
|
|
||||||
if( typeof s.callback === 'function' ) {
|
|
||||||
s.callback.apply(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
scriptsToApply--;
|
function loadScript( s ) {
|
||||||
if (scriptsToApply === 0) {
|
head.ready( s.src.match( /([\w\d_\-]*)\.?js$|[^\\\/]*$/i )[0], function() {
|
||||||
proceed();
|
// Extension may contain callback functions
|
||||||
}
|
if( typeof s.callback === 'function' ) {
|
||||||
});
|
s.callback.apply(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
for( var i = 0, len = config.dependencies.length; i < len; i++ ) {
|
if( --scriptsToPreload === 0 ) {
|
||||||
var s = config.dependencies[i];
|
proceed();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Load if there's no condition or the condition is truthy
|
for( var i = 0, len = config.dependencies.length; i < len; i++ ) {
|
||||||
if( !s.condition || s.condition() ) {
|
var s = config.dependencies[i];
|
||||||
if( s.async ) {
|
|
||||||
scriptsAsync.push( s.src );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
scripts.push( s.src );
|
|
||||||
}
|
|
||||||
|
|
||||||
loadDependency(s);
|
// Load if there's no condition or the condition is truthy
|
||||||
}
|
if( !s.condition || s.condition() ) {
|
||||||
}
|
if( s.async ) {
|
||||||
|
scriptsAsync.push( s.src );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
scripts.push( s.src );
|
||||||
|
}
|
||||||
|
|
||||||
if( scripts.length ) {
|
loadScript( s );
|
||||||
scriptsToApply = scripts.length;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Load synchronous scripts
|
if( scripts.length ) {
|
||||||
head.js.apply( null, scripts );
|
scriptsToPreload = scripts.length;
|
||||||
}
|
|
||||||
else {
|
|
||||||
proceed();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
// Load synchronous scripts
|
||||||
|
head.js.apply( null, scripts );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
proceed();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts up reveal.js by binding input events and navigating
|
* Starts up reveal.js by binding input events and navigating
|
||||||
|
6
js/reveal.min.js
vendored
6
js/reveal.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user