/* @(#)virtualcube.mjs
* Copyright (c) 2023 Werner Randelshofer, Switzerland. MIT License.
*/
/*
This is the main script for the Virtualcube JavaScript applet.
The applet inserts itself into all div elements of the HTML page
with class "virtualcube".
Here is a minimal HTML code that is required to include the applet
into a HTML page:
The div element can have the following attributes:
kind Specifies the cube model to be displayed.
Supported values:
"Rubikscube"
"Pocketcube"
stickersimage Specifies the URL of the stickers image.
See supplied example image.
The applet replaces the content of the div element with the following structure.
............
If the applet fails to run, it leaves the div elements untouched.
You can put a placeholder into the div element.
Legacy Java Applet support:
--------------------------------
To ease the transition from Java Applets to JavaScript, this
applet also replaces applet tags with code="PocketPlayer.class",
"PocketPlayerFlat.class", "RubikPlayer.class", or "RubikPlayerFlat.class".
*/
import virtualcubemain from './virtualcubemain.mjs';
// Performance: Import transitively required modules to reduce loading time.
// With HTML/1.0 and HTML/1.1 only up to 6 TCP connections may be open at the same time.
import webglplayerapplet from "./webglplayerapplet.mjs";
import twodplayerapplet from "./twodplayerapplet.mjs";
import cubemarkup from "./cubemarkup.mjs";
import abstractplayerapplet from "./abstractplayerapplet.mjs";
import node3d from "./node3d.mjs";
import j3di from "./j3di.mjs";
import j3dimath from "./j3dimath.mjs";
import cubeattributes from "./cubeattributes.mjs";
import scriptnotation from "./scriptnotation.mjs";
import preloadwebglshaders from "./preloadwebglshaders.mjs";
import scriptparser from "./scriptparser.mjs";
import tokenizer from "./tokenizer.mjs";
import cube3d from "./cube3d.mjs";
import cube from "./cube.mjs";
import splineinterpolator from "./splineinterpolator.mjs";
// import 3d models of the cubes
import cube2cube3d from "./cube2cube3d.mjs";
import cube3cube3d from "./cube3cube3d.mjs";
import cube4cube3d from "./cube4cube3d.mjs";
import cube5cube3d from "./cube5cube3d.mjs";
import cube6cube3d from "./cube6cube3d.mjs";
import cube7cube3d from "./cube7cube3d.mjs";
// import cached .obj files for 3d models
import abstractcanvas from "./abstractcanvas.mjs";
import scriptast from "./scriptast.mjs";
// try to determine base url
let baseUrl='lib';
{
let scripts = document.getElementsByTagName('script');
for (let i=0; i