aboutsummaryrefslogtreecommitdiff
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2013-11-26 17:32:43 -0500
committerHakim El Hattab <hakim.elhattab@gmail.com>2013-11-26 17:32:48 -0500
commit3be84bcbe3095d80766cf63a84cb677387687ce7 (patch)
tree014dd411f5d85fda16b44b32706a2eb7bd291442 /js/reveal.js
parent75845a92c3a134e79853e00efa66585313c127d4 (diff)
downloadfosdem-2018-presentation-3be84bcbe3095d80766cf63a84cb677387687ce7.tar
fosdem-2018-presentation-3be84bcbe3095d80766cf63a84cb677387687ce7.tar.gz
code format tweaks
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js113
1 files changed, 57 insertions, 56 deletions
diff --git a/js/reveal.js b/js/reveal.js
index f077b78..5de3912 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -250,62 +250,63 @@ var Reveal = (function(){
* Some dependencies may have an 'async' flag, if so they
* will load after reveal.js has been started up.
*/
- function load() {
- var scripts = [],
- scriptsAsync = [],
- scriptsToApply = 0;
-
- // Called once synchronous scripts finish loading
- function proceed() {
- if( scriptsAsync.length ) {
- // Load asynchronous scripts
- head.js.apply( null, scriptsAsync );
- }
-
- start();
- }
-
- function loadDependency(s) {
- 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--;
- if (scriptsToApply === 0) {
- proceed();
- }
- });
- }
-
- for( var i = 0, len = config.dependencies.length; i < len; i++ ) {
- var s = config.dependencies[i];
-
- // 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 );
- }
-
- loadDependency(s);
- }
- }
-
- if( scripts.length ) {
- scriptsToApply = scripts.length;
-
- // Load synchronous scripts
- head.js.apply( null, scripts );
- }
- else {
- proceed();
- }
-
- }
+ function load() {
+
+ var scripts = [],
+ scriptsAsync = [],
+ scriptsToPreload = 0;
+
+ // Called once synchronous scripts finish loading
+ function proceed() {
+ console.log(111);
+ if( scriptsAsync.length ) {
+ // Load asynchronous scripts
+ head.js.apply( null, scriptsAsync );
+ }
+
+ start();
+ }
+
+ function loadScript( s ) {
+ 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);
+ }
+
+ if( --scriptsToPreload === 0 ) {
+ proceed();
+ }
+ });
+ }
+
+ for( var i = 0, len = config.dependencies.length; i < len; i++ ) {
+ var s = config.dependencies[i];
+
+ // 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 );
+ }
+
+ loadScript( s );
+ }
+ }
+
+ if( scripts.length ) {
+ scriptsToPreload = scripts.length;
+
+ // Load synchronous scripts
+ head.js.apply( null, scripts );
+ }
+ else {
+ proceed();
+ }
+
+ }
/**
* Starts up reveal.js by binding input events and navigating