Extent hosted loader to support debug mode
This commit is contained in:
@@ -1,17 +1,15 @@
|
|||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Loader to add ol.css, ol.js and the example-specific js file to the
|
* Loader to add ol.css, ol.js and the example-specific js file to the
|
||||||
* documents.
|
* documents.
|
||||||
*
|
*
|
||||||
* This loader is used for the hosted examples. It is used in place of the
|
* This loader is used for the hosted examples. It is used in place of the
|
||||||
* development loader (examples/loader.js).
|
* development loader (examples/loader.js).
|
||||||
*
|
*
|
||||||
* ol.css, ol.js, ol-simple.js, and ol-whitespace.js are built with
|
* ol.css, ol.js, ol-simple.js, ol-whitespace.js, and ol-deps.js are built
|
||||||
* Plovr/Closure. `build.py build` builds them. They are located in the
|
* by OL3's build.py script. They are located in the ../build/ directory,
|
||||||
* ../build/ directory, relatively to this script.
|
* relatively to this script.
|
||||||
*
|
*
|
||||||
* The script should be named loader.js. So it needs to be renamed to
|
* The script must be named loader.js.
|
||||||
* loader.js from loader_hosted_examples.js.
|
|
||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
*
|
*
|
||||||
@@ -59,17 +57,23 @@
|
|||||||
var oljs = 'ol.js', mode;
|
var oljs = 'ol.js', mode;
|
||||||
if ('mode' in pageParams) {
|
if ('mode' in pageParams) {
|
||||||
mode = pageParams.mode.toLowerCase();
|
mode = pageParams.mode.toLowerCase();
|
||||||
if (mode != 'advanced') {
|
if (mode == 'debug') {
|
||||||
|
mode = 'raw';
|
||||||
|
}
|
||||||
|
if (mode != 'advanced' && mode != 'raw') {
|
||||||
oljs = 'ol-' + mode + '.js';
|
oljs = 'ol-' + mode + '.js';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.write('<link rel="stylesheet" href="../build/ol.css" '+
|
var scriptId = encodeURIComponent(scriptParams.id);
|
||||||
'type="text/css">');
|
document.write('<link rel="stylesheet" href="../build/ol.css" type="text/css">');
|
||||||
document.write('<scr' + 'ipt type="text/javascript" ' +
|
if (mode != 'raw') {
|
||||||
'src="../build/' + oljs + '">' +
|
document.write('<scr' + 'ipt type="text/javascript" src="../build/' + oljs + '"></scr' + 'ipt>');
|
||||||
'</scr' + 'ipt>');
|
} else {
|
||||||
document.write('<scr' + 'ipt type="text/javascript" ' +
|
window.CLOSURE_NO_DEPS = true; // we've got our own deps file
|
||||||
'src="' + encodeURIComponent(scriptParams.id) + '.js">' +
|
document.write('<scr' + 'ipt type="text/javascript" src="../closure-library/closure/goog/base.js"></scr' + 'ipt>');
|
||||||
'</scr' + 'ipt>');
|
document.write('<scr' + 'ipt type="text/javascript" src="../build/ol-deps.js"></scr' + 'ipt>');
|
||||||
|
document.write('<scr' + 'ipt type="text/javascript" src="' + scriptId + '-require.js"></scr' + 'ipt>');
|
||||||
|
}
|
||||||
|
document.write('<scr' + 'ipt type="text/javascript" src="' + scriptId + '.js"></scr' + 'ipt>');
|
||||||
}());
|
}());
|
||||||
|
|||||||
Reference in New Issue
Block a user