mirror of
https://git.j0bot.ch/admin_j0bot/ploxion-test-atelier.git
synced 2026-11-29 07:15:09 +00:00
36 lines
1.5 KiB
PHP
36 lines
1.5 KiB
PHP
{{-- PL0XION test-atelier ✨ — né dans l'atelier 🛠 (décris-le ici). window.jOSApps['test-atelier'] = { manifest, mount -> { unmount }, describe }. --}}
|
|
<script>
|
|
(function () {
|
|
'use strict';
|
|
var ID = 'test-atelier';
|
|
window.jOSApps = window.jOSApps || {};
|
|
if (window.jOSApps[ID]) return; // idempotent
|
|
|
|
function mount(container, ctx) {
|
|
container.innerHTML =
|
|
'<div style="padding:16px;font-family:system-ui;display:flex;flex-direction:column;gap:10px">' +
|
|
'<div style="font-weight:800;color:#3fe0d0">✨ test-atelier</div>' +
|
|
'<button data-go style="padding:9px;border-radius:8px;border:1px solid #3fe0d0;background:rgba(63,224,208,.12);color:#3fe0d0;font-weight:700;cursor:pointer">dire bonjour</button>' +
|
|
'<div data-msg style="font-family:monospace;color:#3fe0d0">salut, toi.</div>' +
|
|
'</div>';
|
|
|
|
var msg = container.querySelector('[data-msg]');
|
|
container.querySelector('[data-go]').addEventListener('click', function () {
|
|
msg.textContent = 'oh mon dieu ! un xerboxion !';
|
|
if (window.jOSPorts) { jOSPorts.emit(ID, 'bonjour', {}); } // parle au bus
|
|
});
|
|
|
|
return { unmount: function () { container.innerHTML = ''; } };
|
|
}
|
|
|
|
window.jOSApps[ID] = {
|
|
manifest: { id: ID, name: 'test-atelier', icon: '✨' },
|
|
mount: mount,
|
|
describe: function () {
|
|
return { v: 1, id: ID, title: 'test-atelier', icon: '✨', items: [
|
|
{ p: 1, kind: 'text', label: 'né dans l\'atelier' }
|
|
] };
|
|
}
|
|
};
|
|
})();
|
|
</script> |