From 4b7939aba8dac640da67d031d76e7b994473e786 Mon Sep 17 00:00:00 2001 From: Maxim Dolgolyov Date: Sat, 30 May 2026 13:29:22 +0300 Subject: [PATCH] =?UTF-8?q?fix(lab):=20=D0=B2=D0=BE=D1=81=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=20=5Fpilots.js=20(?= =?UTF-8?q?=D1=81=D0=BB=D1=83=D1=87=D0=B0=D0=B9=D0=BD=D0=BE=20=D1=83=D0=B4?= =?UTF-8?q?=D0=B0=D0=BB=D1=91=D0=BD=20=D0=B8=D0=B7=20=D0=BE=D0=B1=D1=89?= =?UTF-8?q?=D0=B5=D0=B3=D0=BE=20=D0=B8=D0=BD=D0=B4=D0=B5=D0=BA=D1=81=D0=B0?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lab.html подключает _pilots.js; файл попал в предыдущий коммит как удаление (был в общем индексе от параллельной сессии). Возвращаю, чтобы не ломать ссылку. Впредь коммичу строго по путям. Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/js/labs/_pilots.js | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 frontend/js/labs/_pilots.js diff --git a/frontend/js/labs/_pilots.js b/frontend/js/labs/_pilots.js new file mode 100644 index 0000000..e897b8e --- /dev/null +++ b/frontend/js/labs/_pilots.js @@ -0,0 +1,45 @@ +'use strict'; +/* + * Пилотная регистрация в LabRegistry (Фаза 0 контент-движка). + * + * Доказывает паритет: каталог/открытие/теория этих 3 симуляций идут через реестр. + * Загружается ПОСЛЕДНИМ среди labs-скриптов, поэтому P_* (lab-glue.js), + * THEORY (lab-init.js) и _openXxx (graph/quadratic/pendulum.js) уже определены. + * preview задан функцией (ленивое вычисление в renderSims) — безопасно к порядку. + * + * В Фазе 1 регистрация переедет в сами sim-файлы, а этот файл будет удалён. + */ +(function () { + if (!window.LabRegistry) return; + var R = window.LabRegistry; + + R.register({ + id: 'graph', cat: 'math', + title: 'График функции', desc: 'Постройте и исследуйте графики функций', + preview: function () { return (typeof P_GRAPH !== 'undefined') ? P_GRAPH : ''; }, + theory: (typeof THEORY !== 'undefined') ? THEORY.graph : null, + open: function () { _openGraph(); }, + stop: function () { /* нет анимационного цикла */ }, + destroy: function () { /* нет ресурсов для освобождения */ } + }); + + R.register({ + id: 'quadratic', cat: 'math', + title: 'Квадратное уравнение', desc: 'Дискриминант, корни, теорема Виета', + preview: function () { return (typeof P_QUADRATIC !== 'undefined') ? P_QUADRATIC : ''; }, + theory: (typeof THEORY !== 'undefined') ? THEORY.quadratic : null, + open: function () { _openQuadratic(); }, + stop: function () { /* нет анимационного цикла */ }, + destroy: function () { /* нет ресурсов для освобождения */ } + }); + + R.register({ + id: 'pendulum', cat: 'phys', + title: 'Маятник', desc: 'Колебания, период, затухание', + preview: function () { return (typeof P_PENDULUM !== 'undefined') ? P_PENDULUM : ''; }, + theory: (typeof THEORY !== 'undefined') ? THEORY.pendulum : null, + open: function () { _openPendulum(); }, + stop: function () { if (typeof pendSim !== 'undefined' && pendSim && pendSim.stop) pendSim.stop(); }, + destroy: function () { if (typeof pendSim !== 'undefined' && pendSim && pendSim.stop) pendSim.stop(); } + }); +})();