WIP: use es-modules

This commit is contained in:
j 2026-02-16 22:16:19 +01:00
commit baef49f116
143 changed files with 738 additions and 55 deletions

65
source/Ox/index.js Normal file
View file

@ -0,0 +1,65 @@
'use strict';
import Ox from './js/Namespace.js';
import * as OxCore from './js/Core.js';
import * as OxFunction from './js/Function.js';
import * as OxPolyfill from './js/Polyfill.js';
import * as OxArray from './js/Array.js';
import * as OxString from './js/String.js';
import * as OxCollection from './js/Collection.js';
import * as OxMath from './js/Math.js';
import * as OxAsync from './js/Async.js';
import * as OxColor from './js/Color.js';
import * as OxConstants from './js/Constants.js';
import * as OxDate from './js/Date.js';
import * as OxDOM from './js/DOM.js';
import * as OxEncoding from './js/Encoding.js';
import * as OxFormat from './js/Format.js';
import * as OxGeo from './js/Geo.js';
import * as OxHash from './js/Hash.js';
import * as OxHTML from './js/HTML.js';
import * as OxJavaScript from './js/JavaScript.js';
import * as OxLocale from './js/Locale.js';
import * as OxObject from './js/Object.js';
import * as OxRegExp from './js/RegExp.js';
import * as OxRequest from './js/Request.js';
import * as OxType from './js/Type.js';
import * as OxVideo from './js/Video.js';
export default Ox;
export { Ox };
// For backward compatibility with global usage
if (typeof globalThis !== 'undefined') {
globalThis.Ox = Ox;
/*@
Ox.documentReady <function> Calls a callback function once the DOM is ready
(callback) -> <b> If true, the document was ready
callback <f> Callback function
@*/
Ox.documentReady = (function() {
var callbacks = [];
document.onreadystatechange = globalThis.onload = function() {
if (document.readyState == 'complete') {
callbacks.forEach(function(callback) {
callback();
});
document.onreadystatechange = globalThis.onload = null;
}
};
return function(callback) {
if (document.readyState == 'complete') {
callback();
return true;
} else {
callbacks.push(callback);
return false;
}
};
}());
}