oxjs/source/Ox.js

28 lines
771 B
JavaScript
Raw Normal View History

2011-11-05 17:46:53 +01:00
'use strict';
2026-02-18 17:02:08 +01:00
(async function(global) {
const initLoad = [];
2012-06-20 18:30:06 +02:00
global.Ox = {
2026-02-18 17:02:08 +01:00
load: function(...args) {
initLoad.push(args)
2011-04-27 21:39:56 +02:00
}
2012-06-20 18:30:06 +02:00
};
2011-04-27 21:39:56 +02:00
2026-02-18 17:02:08 +01:00
function getPath() {
var index, regexp = /Ox\.js(\?[\d\.]+|)$/,
scripts = document.getElementsByTagName('script'), src;
for (index = scripts.length - 1; index >= 0; index--) {
src = scripts[index].src;
if (regexp.test(src)) {
return src.replace(regexp, '');
}
}
}
const module = await import('./Ox/Ox.js');
if (Ox.MODE == 'source') {
Ox.MODE = 'dev';
}
console.log("Ox was loaded", Ox.MODE, Ox.PATH);
initLoad.forEach((args) => global.Ox.load.apply(null, args))
}(globalThis));