fix loading, minify with rollup

This commit is contained in:
j 2026-02-18 17:02:08 +01:00
commit dd5237e4ed
156 changed files with 794 additions and 971 deletions

View file

@ -1,6 +1,6 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.api <f> Turns an array into a list API

View file

@ -1,6 +1,6 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
(function() {

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.avg <f> Returns the average of an array's values, or an object's properties

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.hsl <f> Takes RGB values and returns HSL values

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
//@ Ox.AMPM <[s]> ['AM', 'PM']
Ox.AMPM = ['AM', 'PM'];

View file

@ -2,7 +2,7 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.load <f> Loads OxJS and, optionally, one or more modules
@ -79,7 +79,7 @@ Ox.load = function() {
fn(function() {
Ox.forEach(modules, async function(options, module) {
console.log("load module!", module, options)
const obj = await import('../../' + module + '/index.js?' + Ox.VERSION);
const obj = await import(Ox.PATH + module + '/' + module + '.js?' + Ox.VERSION);
Ox.load[module](options, function(success) {
succeeded += success;
if (++loaded == length) {

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.$ <f> Generic HTML element, mimics jQuery

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
//@ Ox.getDate <f> Get the day of a date, optionally UTC
// see Ox.setSeconds for source code

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.encodeBase26 <b> Encode a number as bijective base26

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.formatArea <f> Formats a number of meters as square meters or kilometers

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.cache <f> Memoize a function

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
(function() {

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
(function() {

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.oshash <f> Calculates oshash for a given file or blob object. Async.

View file

@ -1,5 +1,7 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
var globalEval = eval;
/*@
Ox.doc <f> Generates documentation for annotated JavaScript
@ -828,7 +830,7 @@ Ox.test = function(argument, callback) {
);
}
Ox.Log('TEST', statement);
actual = eval(statement);
actual = globalEval(statement);
if (!isAsync && test.expected) {
Ox.test.data[id].results.push({
actual: stringifyResult(actual),
@ -837,7 +839,7 @@ Ox.test = function(argument, callback) {
section: item.section,
statement: statement,
passed: Ox.isEqual(
actual, eval('(' + test.expected + ')')
actual, globalEval('(' + test.expected + ')')
)
});
}

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
(function() {

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.acosh <f> Inverse hyperbolic cosine

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.extend <function> Extends an object with one or more other objects

View file

@ -1,5 +1,7 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
var globalEval = eval;
(function(window) {
@ -210,7 +212,7 @@ import Ox from './Namespace.js';
}
return {
parse: function parse(string) {
return eval('(' + string + ')');
return globalEval('(' + string + ')');
},
stringify: function stringify(value) {
var ret = 'null', type = Ox.typeOf(value);
@ -397,7 +399,7 @@ import Ox from './Namespace.js';
].forEach(function(item) {
var object = item[0], keys = item[1];
keys.forEach(function(key) {
if (!key in object) {
if (!(key in object)) {
if (canDefineProperty) {
Object.defineProperty(object, key, {
configurable: true,

View file

@ -1,4 +1,4 @@
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.escapeRegExp <f> Escapes a string for use in a regular expression

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.get <f> Get a remote resource

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.char <f> Alias for String.fromCharCode

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.checkType <f> Throws a TypeError if a value is not of a given type

View file

@ -1,5 +1,5 @@
'use strict';
import Ox from './Namespace.js';
import Ox from './Ox.Global.js';
/*@
Ox.getVideoFormat <f> Get supported video format