remove unused imports. prevent multiple interval timers

This commit is contained in:
Stewart Allen 2025-12-24 15:55:44 -05:00
commit 8349fcb65e
3 changed files with 11 additions and 20 deletions

View file

@ -38,8 +38,7 @@ let { CAM, SLA, FDM, LASER, DRAG, WJET, WEDM } = MODES,
FDM_CAM = [ FDM, CAM ],
proto = location.protocol,
platformColor,
separator = true,
hideable = true,
statsTimer,
inline = true,
driven = true,
trigger = true,
@ -183,9 +182,11 @@ function updateStats() {
if (self.debug !== true) {
return;
}
console.log('updateStats()');
let { div, fps, rms, rnfo } = ui.stats;
div.style.display = 'flex';
setInterval(() => {
clearTimeout(statsTimer);
statsTimer = setInterval(() => {
const nrms = space.view.getRMS().toFixed(1);
const nfps = space.view.getFPS().toFixed(1);
const rend = space.renderInfo();
@ -1414,18 +1415,6 @@ function init_one() {
// default show gcode pre
ui.gcodePre.button.click();
function mksvg(src) {
let svg = DOC.createElement('svg');
svg.innerHTML = src;
return svg;
}
function mklbl(src) {
let lbl = DOC.createElement('label');
lbl.innerText = src;
return lbl;
}
api.platform.update_size();
function mouseOnHover(int, event, ints) {
@ -1444,6 +1433,11 @@ function init_one() {
space.platform.onHover(enable ? platformOnHover : undefined);
});
// prevent safari from exiting full screen mode
DOC.onkeydown = function (evt) {
if (evt.code == 27) evt.preventDefault()
}
// block standard browser context menu
DOC.oncontextmenu = (event) => {
let et = event.target;

View file

@ -3,7 +3,6 @@
import './frame.js';
import '../../ext/base64.js';
import lang from './lang.js';
import STACKS from './stacks.js';
import { $ } from '../../moto/webui.js';
@ -26,7 +25,6 @@ import { showTools } from '../mode/cam/tools.js';
let { parseOpt, o2js, js2o, ls2o } = utils,
{ COLOR, MODES, VIEWS } = consts,
LANG = lang.current,
WIN = self.window,
DOC = self.document,
LOC = self.location,
@ -912,7 +910,4 @@ function downloadBlob(data, filename) {
$('_dexport_').click();
}
// prevent safari from exiting full screen mode
DOC.onkeydown = function (evt) { if (evt.keyCode == 27) evt.preventDefault() }
export { FILES as catalog, LOCAL, SETUP, SECURE };

View file

@ -1,3 +1,5 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
/**
* QuickJS VM Wrapper
* Provides a simplified interface for working with QuickJS contexts