@@ -679,6 +679,7 @@ MathJax.cdnFileVersions = {}; // can be used to specify revisions for individua
679
679
root : "" , // URL of root directory to load from
680
680
path : PATH // paths to named URL's (e.g., [MathJax]/...)
681
681
} ,
682
+ params : { } , // filled in from MathJax.js?...
682
683
683
684
STATUS : {
684
685
OK : 1 , // file is loading or did load OK
@@ -728,13 +729,17 @@ MathJax.cdnFileVersions = {}; // can be used to specify revisions for individua
728
729
for ( var i in file )
729
730
{ if ( file . hasOwnProperty ( i ) ) { type = i . toUpperCase ( ) ; file = file [ i ] } }
730
731
} else { type = file . split ( / \. / ) . pop ( ) . toUpperCase ( ) }
731
- file = this . fileURL ( file ) ;
732
- // FIXME: check that URL is OK
733
- if ( this . loaded [ file ] ) {
734
- callback ( this . loaded [ file ] ) ;
732
+ if ( this . params . noContrib && file . substr ( 0 , 9 ) === "[Contrib]" ) {
733
+ callback ( this . STATUS . ERROR ) ;
735
734
} else {
736
- var FILE = { } ; FILE [ type ] = file ;
737
- this . Load ( FILE , callback ) ;
735
+ file = this . fileURL ( file ) ;
736
+ // FIXME: check that URL is OK
737
+ if ( this . loaded [ file ] ) {
738
+ callback ( this . loaded [ file ] ) ;
739
+ } else {
740
+ var FILE = { } ; FILE [ type ] = file ;
741
+ this . Load ( FILE , callback ) ;
742
+ }
738
743
}
739
744
return callback ;
740
745
} ,
@@ -3123,12 +3128,14 @@ MathJax.Hub.Startup = {
3123
3128
for ( var j = 0 , m = params . length ; j < m ; j ++ ) {
3124
3129
var KV = params [ j ] . match ( / ( .* ) = ( .* ) / ) ;
3125
3130
if ( KV ) { STARTUP . params [ unescape ( KV [ 1 ] ) ] = unescape ( KV [ 2 ] ) }
3131
+ else { STARTUP . params [ params [ j ] ] = true }
3126
3132
}
3127
3133
}
3128
3134
CONFIG . root = scripts [ i ] . src . replace ( / ( ^ | \/ ) [ ^ \/ ] * ( \? .* ) ? $ / , '' )
3129
3135
// convert mathjax/latest to mathjax/x.y-latest so that all files are the same version
3130
3136
. replace ( / ^ ( h t t p s ? : \/ \/ c d n .m a t h j a x .o r g \/ m a t h j a x \/ ) ( l a t e s t ) / , "$1" + BASE . version . split ( / \. / ) . slice ( 0 , 2 ) . join ( "." ) + "-$2" ) ;
3131
3137
BASE . Ajax . config . root = CONFIG . root ;
3138
+ BASE . Ajax . params = STARTUP . params ;
3132
3139
break ;
3133
3140
}
3134
3141
}
0 commit comments