21 lines
613 B
JavaScript
21 lines
613 B
JavaScript
/**
|
|
* config.js — auto-detects base paths based on current page location.
|
|
* Must be loaded before workspace.js and other navigation-using scripts.
|
|
*/
|
|
(function() {
|
|
var p = window.location.pathname;
|
|
// html/wizard/ is two levels deep from root
|
|
if (/\/html\/wizard\//.test(p)) {
|
|
window.APP_BASE = '../../';
|
|
window.DATA_URL = '../../data/';
|
|
// html/*.html is one level deep from root
|
|
} else if (/\/html\//.test(p)) {
|
|
window.APP_BASE = '../';
|
|
window.DATA_URL = '../data/';
|
|
// root level (index.html)
|
|
} else {
|
|
window.APP_BASE = '';
|
|
window.DATA_URL = 'data/';
|
|
}
|
|
}());
|