-
Notifications
You must be signed in to change notification settings - Fork 5
/
bootstrap.js
executable file
·81 lines (65 loc) · 2.76 KB
/
bootstrap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
This file is part of Ext JS 5.0.0.970
Copyright (c) 2011-2014 Sencha Inc
Contact: http://www.sencha.com/contact
Pre-release code in the Ext repository is intended for development purposes only and will
not always be stable.
Use of pre-release code is permitted with your application at your own risk under standard
Ext license terms. Public redistribution is prohibited.
For early licensing, please contact us at [email protected]
Version: 5.0.0.970 Build date: 2014-06-01 09:03:15 (660862da42511e0f769c1d37b9fd8e156edd73eb)
*/
/**
* Load the library located at the same path with this file
*
* Will automatically load ext-all-dev.js if any of these conditions is true:
* - Current hostname is localhost
* - Current hostname is an IP v4 address
* - Current protocol is "file:"
*
* Will load ext-all.js (minified) otherwise
*/
(function() {
var scripts = document.getElementsByTagName('script'),
localhostTests = [
/^localhost$/,
/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:\d{1,5})?\b/ // IP v4
],
host = window.location.hostname,
isDevelopment = null,
theme,
queryString = window.location.search,
test, path, i, ln, scriptSrc, match;
for (i = 0, ln = scripts.length; i < ln; i++) {
scriptSrc = scripts[i].src;
match = scriptSrc.match(/bootstrap\.js$/);
if (match) {
path = scriptSrc.substring(0, scriptSrc.length - match[0].length);
break;
}
}
theme = 'ext-theme-neptune-touch';
theme = 'ext-theme-crisp-touch';
theme = 'ext-theme-classic';
if (queryString.match('(\\?|&)debug') !== null) {
isDevelopment = true;
}
else if (queryString.match('(\\?|&)nodebug') !== null) {
isDevelopment = false;
}
if (isDevelopment === null) {
for (i = 0, ln = localhostTests.length; i < ln; i++) {
test = localhostTests[i];
if (host.search(test) !== -1) {
isDevelopment = true;
break;
}
}
}
if (isDevelopment === null && window.location.protocol === 'file:') {
isDevelopment = true;
}
document.write('<link rel="stylesheet" type="text/css" href="' + path + 'packages/' + theme + '/build/resources/' + theme + '-all' + (isDevelopment ? '-debug' : '') + '.css">');
document.write('<script type="text/javascript" charset="UTF-8" src="' + path + 'ext-all' + (isDevelopment ? '-debug' : '') + '.js"></script>');
document.write('<script type="text/javascript" src="' + path + 'packages/' + theme + '/build/' + theme + (isDevelopment ? '-debug' : '') + '.js"></script>');
})();