Merge "Making missing old files not try to render a thumbnail"
[lhc/web/wiklou.git] / resources / src / startup.js
1 /**
2 * This script provides a function which is run to evaluate whether or not to
3 * continue loading jQuery and the MediaWiki modules. This code should work on
4 * even the most ancient of browsers, so be very careful when editing.
5 */
6
7 var mediaWikiLoadStart = ( new Date() ).getTime();
8
9 /**
10 * Returns false when run in a black-listed browser
11 *
12 * This function will be deleted after it's used, so do not expand it to be
13 * generally useful beyond startup.
14 *
15 * See also:
16 * - https://www.mediawiki.org/wiki/Compatibility#Browser
17 * - http://jquerymobile.com/gbs/
18 * - http://jquery.com/browser-support/
19 */
20
21 /*jshint unused: false */
22 function isCompatible( ua ) {
23 if ( ua === undefined ) {
24 ua = navigator.userAgent;
25 }
26
27 // Browsers with outdated or limited JavaScript engines get the no-JS experience
28 return !(
29 // Internet Explorer < 7
30 ( ua.indexOf( 'MSIE' ) !== -1 && parseFloat( ua.split( 'MSIE' )[1] ) < 7 ) ||
31 // Firefox < 3
32 ( ua.indexOf( 'Firefox/' ) !== -1 && parseFloat( ua.split( 'Firefox/' )[1] ) < 3 ) ||
33 // Opera < 12
34 ( ua.indexOf( 'Opera/' ) !== -1 && ( ua.indexOf( 'Version/' ) === -1 ?
35 // "Opera/x.y"
36 parseFloat( ua.split( 'Opera/' )[1] ) < 10 :
37 // "Opera/9.80 ... Version/x.y"
38 parseFloat( ua.split( 'Version/' )[1] ) < 12
39 ) ) ||
40 // "Mozilla/0.0 ... Opera x.y"
41 ( ua.indexOf( 'Opera ' ) !== -1 && parseFloat( ua.split( ' Opera ' )[1] ) < 10 ) ||
42 // BlackBerry < 6
43 ua.match( /BlackBerry[^\/]*\/[1-5]\./ ) ||
44 // Open WebOS < 1.5
45 ua.match( /webOS\/1\.[0-4]/ ) ||
46 // Anything PlayStation based.
47 ua.match( /PlayStation/i ) ||
48 // Any Symbian based browsers
49 ua.match( /SymbianOS|Series60/ ) ||
50 // Any NetFront based browser
51 ua.match( /NetFront/ ) ||
52 // Opera Mini, all versions
53 ua.match( /Opera Mini/ ) ||
54 // Nokia's Ovi Browser
55 ua.match( /S40OviBrowser/ ) ||
56 // Google Glass browser groks JS but UI is too limited
57 ( ua.match( /Glass/ ) && ua.match( /Android/ ) )
58 );
59 }
60
61 /**
62 * The startUp() function will be auto-generated and added below.
63 */