/**
* This file includes the required ext-all js and css files based upon "theme" and "rtl"
* url parameters. It first searches for these parameters on the page url, and if they
* are not found there, it looks for them on the script tag src query string.
* For example, to include the neptune flavor of ext from an index page in a subdirectory
* of extjs/examples/:
*
*/
(function() {
function getQueryParam(name) {
var regex = RegExp('[?&]' + name + '=([^&]*)');
var match = regex.exec(location.search) || regex.exec(scriptPath);
return match && decodeURIComponent(match[1]);
}
function hasOption(opt, queryString) {
var s = queryString || location.search;
var re = new RegExp('(?:^|[&?])' + opt + '(?:[=]([^&]*))?(?:$|[&])', 'i');
var m = re.exec(s);
return m ? (m[1] === undefined || m[1] === '' ? true : m[1]) : false;
}
function loadCss(url) {
document.write('');
}
function loadScript(url, defer) {
document.write('');
}
Ext = window.Ext || {};
// The value of Ext.repoDevMode gets replaced during a build - do not change this line
// 2 == internal dev mode, 1 == external dev mode, 0 == build mode
Ext.devMode = 0;
var scriptEls = document.getElementsByTagName('script'),
scriptPath = scriptEls[scriptEls.length - 1].src,
rtl = getQueryParam('rtl'),
themeName = getQueryParam('theme') || 'triton',
includeCSS = !hasOption('nocss', scriptPath),
useDebug = hasOption('debug'),
hasOverrides = !hasOption('nooverrides', scriptPath) && !!{
// TODO: remove neptune
neptune: 1,
triton: 1,
classic: 1,
gray: 1,
triton: 1,
'neptune-touch': 1,
crisp: 1,
'crisp-touch': 1
}[themeName],
i = 4,
devMode = Ext.devMode,
extDir = scriptPath,
rtlSuffix = (rtl ? '-rtl' : ''),
debugSuffix = (devMode ? '-debug' : ''),
cssSuffix = rtlSuffix + debugSuffix + '.css',
themePackageDir, chartsJS, uxJS, themeOverrideJS, extPrefix, extPackagesRoot;
rtl = rtl && rtl.toString() === 'true';
while (i--) {
extDir = extDir.substring(0, extDir.lastIndexOf('/'));
}
extPackagesRoot = devMode ? (extDir + '/build') : extDir;
uxJS = extPackagesRoot + '/packages/ux/classic/ux' + debugSuffix + '.js';
chartsJS = extPackagesRoot + '/packages/charts/classic/charts' + debugSuffix + '.js';
themePackageDir = extPackagesRoot + '/classic/theme-' + themeName + '/';
if (includeCSS) {
loadCss(themePackageDir + 'resources/theme-' + themeName + '-all' + cssSuffix);
loadCss(extPackagesRoot + '/packages/charts/classic/' + themeName + '/resources/charts-all' + cssSuffix);
loadCss(extPackagesRoot + '/packages/ux/classic/' + themeName + '/resources/ux-all' + cssSuffix);
}
extPrefix = useDebug ? '/ext' : '/ext-all';
document.write('');
if (hasOverrides) {
// since document.write('