mirror of
https://git.j0bot.ch/admin_j0bot/ploxion-recherche.git
synced 2026-11-29 07:05:09 +00:00
synchro du labo (0bf0da65) : app.blade.php, README.md
This commit is contained in:
parent
8b3d4b5e6f
commit
25507d13ce
22
README.md
22
README.md
@ -1,3 +1,21 @@
|
|||||||
# ploxion-recherche
|
# 🔎 Recherche
|
||||||
|
|
||||||
PLOXION · LA vraie recherche : indexe TOUT le xerboxion (tous les ploxions admin inclus + cubions + quêtes + chaoxion), cherche par nom/id/description/ce-que-ça-fait, ouvre/teste n'importe quoi. · fournit: search, index, browser, admin
|
LA vraie recherche : indexe TOUT le xerboxion (tous les ploxions admin inclus + cubions + quêtes + chaoxion), cherche par nom/id/description/ce-que-ça-fait, ouvre/teste n'importe quoi.
|
||||||
|
|
||||||
|
| | |
|
||||||
|
| --- | --- |
|
||||||
|
| id | `recherche` |
|
||||||
|
| fournit | `search` `index` `browser` `admin` |
|
||||||
|
| bions qu'il nomme | `jOSApps` `jOSMobile` `jOSOp` `jOSPorts` `jOSXerPrefs` |
|
||||||
|
| fichiers | `app.blade.php` |
|
||||||
|
| dans le labo | `resources/views/ploxions/recherche/` (dépôt `my_website2`) |
|
||||||
|
|
||||||
|
## Contribuer
|
||||||
|
|
||||||
|
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=recherche — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
|
||||||
|
- **Dans VS Code** : `xb prendre recherche` (ou l'extension xerboxion › ⇩ Prendre), puis ⧗ Envoyer.
|
||||||
|
- Le chemin complet : https://labo.j0bot.ch/px/contribuer
|
||||||
|
|
||||||
|
Ce dépôt est un **miroir** du labo (synchronisé par `bin/ploxions-forge.mjs`, depuis le commit `0bf0da65`) : une modif se propose par un tsoin ou une branche du labo, pas directement ici.
|
||||||
|
|
||||||
|
© 2026 chill-tekk · ne pas nuire
|
||||||
|
|||||||
169
app.blade.php
Normal file
169
app.blade.php
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
{{-- PL0XION recherche 🔎 — LA VRAIE RECHERCHE : indexe TOUT le xerboxion (tous les ploxions, admin
|
||||||
|
inclus + cubions + quêtes + le catalogue chaoxion) et permet de les ouvrir/tester. RS-7 : « un
|
||||||
|
endroit où je peux checker tous les ploxions en admin et les tester, une vraie recherche qui
|
||||||
|
indexe tout ». Contrat window.jOSApps['recherche']. --}}
|
||||||
|
<style>
|
||||||
|
.px-rech{display:flex;flex-direction:column;height:100%;background:var(--xr-bg,#070b12);color:var(--xr-text,#e7f0ff);font-family:var(--xr-font-ui,system-ui)}
|
||||||
|
.px-rech .rc-top{flex:0 0 auto;padding:12px 12px 8px;border-bottom:1px solid var(--xr-border,#22324f)}
|
||||||
|
.px-rech .rc-in{width:100%;background:var(--xr-surface,#0c1320);border:1px solid var(--xr-border,#22324f);color:var(--xr-text,#e7f0ff);
|
||||||
|
border-radius:12px;padding:13px 14px;font:16px var(--xr-font-ui,system-ui);outline:none}
|
||||||
|
.px-rech .rc-in:focus{border-color:var(--xr-accent,#3fe0d0)}
|
||||||
|
.px-rech .rc-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-top:9px}
|
||||||
|
.px-rech .rc-tab{background:var(--xr-surface,#0c1320);border:1px solid var(--xr-border,#22324f);color:var(--xr-muted,#8aa0c0);
|
||||||
|
border-radius:999px;padding:6px 12px;font-size:.78rem;font-weight:700;cursor:pointer;white-space:nowrap;min-height:34px}
|
||||||
|
.px-rech .rc-tab.on{color:var(--xr-bg,#071018);background:var(--xr-accent,#3fe0d0);border-color:var(--xr-accent,#3fe0d0)}
|
||||||
|
.px-rech .rc-cnt{font-size:.72rem;color:var(--xr-muted,#8aa0c0);margin-top:7px}
|
||||||
|
.px-rech .rc-body{flex:1;min-height:0;overflow:auto;padding:10px 12px 24px}
|
||||||
|
.px-rech .rc-g{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
|
||||||
|
.px-rech .rc-card{background:var(--xr-surface,#0c1320);border:1px solid var(--xr-border,#22324f);border-radius:14px;padding:11px;
|
||||||
|
cursor:pointer;transition:border-color .12s,transform .12s;display:flex;flex-direction:column;gap:5px;min-height:96px}
|
||||||
|
.px-rech .rc-card:hover{border-color:var(--xr-accent,#3fe0d0)}
|
||||||
|
.px-rech .rc-card:active{transform:scale(.98)}
|
||||||
|
.px-rech .rc-h{display:flex;align-items:center;gap:8px}
|
||||||
|
.px-rech .rc-ic{font-size:1.4rem;flex:0 0 auto;width:30px;text-align:center}
|
||||||
|
.px-rech .rc-nm{font-weight:700;font-size:.92rem;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||||
|
.px-rech .rc-id{font-family:ui-monospace,monospace;font-size:.66rem;color:var(--xr-muted,#8aa0c0)}
|
||||||
|
.px-rech .rc-desc{font-size:.74rem;color:var(--xr-muted,#8aa0c0);line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
|
||||||
|
.px-rech .rc-badges{display:flex;gap:4px;flex-wrap:wrap;margin-top:auto}
|
||||||
|
.px-rech .rc-b{font-size:.6rem;padding:1px 6px;border-radius:7px;border:1px solid var(--xr-border,#22324f);color:var(--xr-muted,#8aa0c0)}
|
||||||
|
.px-rech .rc-b.k{color:#3fe0d0;border-color:#25514c}
|
||||||
|
.px-rech .rc-b.admin{color:#ffb454;border-color:#5a4a1e}
|
||||||
|
.px-rech .rc-b.off{color:#ff6b8a;border-color:#5a2432}
|
||||||
|
.px-rech .rc-b.cub{color:#a85cff;border-color:#3a2a5a}
|
||||||
|
.px-rech .rc-b.q{color:#7cf3a0;border-color:#245a3a}
|
||||||
|
.px-rech .rc-empty{text-align:center;color:var(--xr-muted,#8aa0c0);padding:40px 12px;font-size:.85rem}
|
||||||
|
.px-rech .rc-kbd{font-family:ui-monospace,monospace;font-size:.62rem;opacity:.6}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
function esc(s){var d=document.createElement('div');d.textContent=s==null?'':String(s);return d.innerHTML;}
|
||||||
|
function norm(s){return String(s||'').toLowerCase().normalize('NFD').replace(/[̀-ͯ]/g,'');}
|
||||||
|
|
||||||
|
var LIVE = null; // posé au mount : {count:function()}
|
||||||
|
function describe() {
|
||||||
|
var n = LIVE ? LIVE.count() : 0;
|
||||||
|
return { v: 1, id: 'recherche', title: 'Recherche', icon: '🔎', items: [
|
||||||
|
{ p: 1, kind: 'stat', label: 'items indexés', value: n }
|
||||||
|
] };
|
||||||
|
}
|
||||||
|
|
||||||
|
function mount(container, ctx) {
|
||||||
|
container.innerHTML =
|
||||||
|
'<div class="px-rech">'
|
||||||
|
+ '<div class="rc-top">'
|
||||||
|
+ '<input class="rc-in" type="search" placeholder="🔎 cherche dans tout le xerboxion — nom, id, description, ce que ça fait…" autocapitalize="none" autocomplete="off" spellcheck="false">'
|
||||||
|
+ '<div class="rc-tabs" data-tabs>'
|
||||||
|
+ '<button class="rc-tab on" data-f="all">Tout</button>'
|
||||||
|
+ '<button class="rc-tab" data-f="ploxion">Ploxions</button>'
|
||||||
|
+ '<button class="rc-tab" data-f="admin">Admin</button>'
|
||||||
|
+ '<button class="rc-tab" data-f="off">Désactivés</button>'
|
||||||
|
+ '<button class="rc-tab" data-f="cubion">Cubions</button>'
|
||||||
|
+ '<button class="rc-tab" data-f="quete">Quêtes</button>'
|
||||||
|
+ '<button class="rc-tab" data-f="chaoxion">Chaoxion</button>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<div class="rc-cnt" data-cnt>indexation…</div>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<div class="rc-body"><div class="rc-g" data-g></div></div>'
|
||||||
|
+ '</div>';
|
||||||
|
var root = container.querySelector('.px-rech'),
|
||||||
|
input = root.querySelector('.rc-in'),
|
||||||
|
grid = root.querySelector('[data-g]'),
|
||||||
|
cnt = root.querySelector('[data-cnt]'),
|
||||||
|
tabs = root.querySelector('[data-tabs]');
|
||||||
|
var INDEX = []; // {kind, id, name, icon, desc, admin, enabled, category, hay}
|
||||||
|
LIVE = { count: function () { return INDEX.length; } };
|
||||||
|
var filt = 'all', q = '', alive = true;
|
||||||
|
|
||||||
|
function add(kind, id, name, icon, desc, extra) {
|
||||||
|
var it = { kind: kind, id: id, name: name || id, icon: icon || '▣', desc: desc || '',
|
||||||
|
admin: !!(extra && extra.admin), enabled: extra ? extra.enabled !== false : true, category: (extra && extra.category) || '' };
|
||||||
|
it.hay = norm([id, name, desc, it.category, kind, (extra && extra.provides || []).join(' ')].join(' '));
|
||||||
|
INDEX.push(it);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1) REGISTRY = tous les ploxions (admin inclus) + cubions
|
||||||
|
fetch('/px/registry.json', { credentials: 'same-origin', headers: { Accept: 'application/json' } })
|
||||||
|
.then(function (r) { return r.ok ? r.json() : null; })
|
||||||
|
.then(function (d) {
|
||||||
|
if (!alive || !d) return;
|
||||||
|
(d.ploxions || []).forEach(function (p) {
|
||||||
|
add(p.category === 'cubion' ? 'cubion' : 'ploxion', p.id, p.name, p.icon, p.description,
|
||||||
|
{ admin: p.admin, enabled: p.enabled, category: p.category, provides: p.provides });
|
||||||
|
});
|
||||||
|
render();
|
||||||
|
}).catch(function () {});
|
||||||
|
// 2) QUÊTES
|
||||||
|
fetch('/data/quetes.json', { credentials: 'same-origin' }).then(function (r) { return r.ok ? r.json() : null; })
|
||||||
|
.then(function (d) { if (!alive || !d) return; (d.quetes || []).forEach(function (x) { add('quete', 'q:' + x.id, x.nom, x.icone || '🗺️', x.description, {}); }); render(); }).catch(function () {});
|
||||||
|
// 3) CHAOXION (scout + étoiles)
|
||||||
|
[['/data/inspirations-ploxions.json', 'idees'], ['/data/chaoxion-stars.json', 'idees']].forEach(function (src) {
|
||||||
|
fetch(src[0], { credentials: 'same-origin' }).then(function (r) { return r.ok ? r.json() : null; })
|
||||||
|
.then(function (d) { if (!alive || !d) return; (d[src[1]] || []).forEach(function (x) { add('chaoxion', 'cx:' + (x.ploxion_id || x.titre), x.titre, x.icone || '🌀', x.quoi || x.url || '', {}); }); render(); }).catch(function () {});
|
||||||
|
});
|
||||||
|
|
||||||
|
function match(it) {
|
||||||
|
if (filt === 'admin' && !it.admin) return false;
|
||||||
|
if (filt === 'off' && it.enabled) return false;
|
||||||
|
if (filt !== 'all' && filt !== 'admin' && filt !== 'off' && it.kind !== filt) return false;
|
||||||
|
if (!q) return true;
|
||||||
|
return it.hay.indexOf(q) !== -1;
|
||||||
|
}
|
||||||
|
function open(it) {
|
||||||
|
try {
|
||||||
|
if (it.kind === 'quete') { try { if (window.jOS && window.jOS.openPloxion) window.jOS.openPloxion('quetes'); } catch (e) {} return; }
|
||||||
|
if (it.kind === 'chaoxion') { try { if (window.jOS && window.jOS.openPloxion) window.jOS.openPloxion('chaoxion'); } catch (e) {} return; }
|
||||||
|
var id = it.id;
|
||||||
|
try { if (window.jOSOp && jOSOp.openPloxion && jOSOp.openPloxion(id) && jOSOp.openPloxion(id).ok) return; } catch (e) {}
|
||||||
|
try { if (window.jOSMobile && jOSMobile.open) { jOSMobile.open(id, it.name); return; } } catch (e) {}
|
||||||
|
try { if (window.jOS && jOS.openPloxion) { jOS.openPloxion(id); return; } } catch (e) {}
|
||||||
|
location.href = '/local#px=' + id;
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
function render() {
|
||||||
|
var res = INDEX.filter(match);
|
||||||
|
cnt.innerHTML = res.length + ' résultat' + (res.length > 1 ? 's' : '') + ' · ' + INDEX.length + ' éléments indexés '
|
||||||
|
+ '<span class="rc-kbd">(' + INDEX.filter(function (x) { return x.kind === 'ploxion' || x.kind === 'cubion'; }).length + ' ploxions/cubions · '
|
||||||
|
+ INDEX.filter(function (x) { return x.admin; }).length + ' admin)</span>';
|
||||||
|
if (!res.length) { grid.innerHTML = '<div class="rc-empty">rien pour « ' + esc(q) + ' »</div>'; return; }
|
||||||
|
res.sort(function (a, b) { return a.name.localeCompare(b.name); });
|
||||||
|
grid.innerHTML = res.slice(0, 400).map(function (it) {
|
||||||
|
var b = '';
|
||||||
|
if (it.kind === 'cubion') b += '<span class="rc-b cub">cubion</span>';
|
||||||
|
if (it.kind === 'quete') b += '<span class="rc-b q">quête</span>';
|
||||||
|
if (it.kind === 'chaoxion') b += '<span class="rc-b">chaoxion</span>';
|
||||||
|
if (it.admin) b += '<span class="rc-b admin">admin</span>';
|
||||||
|
if (!it.enabled) b += '<span class="rc-b off">off</span>';
|
||||||
|
if (it.category && it.kind === 'ploxion') b += '<span class="rc-b">' + esc(it.category) + '</span>';
|
||||||
|
return '<div class="rc-card" data-i="' + INDEX.indexOf(it) + '">'
|
||||||
|
+ '<div class="rc-h"><span class="rc-ic">' + esc(it.icon) + '</span><span class="rc-nm">' + esc(it.name) + '</span></div>'
|
||||||
|
+ '<div class="rc-id">' + esc(it.id) + '</div>'
|
||||||
|
+ (it.desc ? '<div class="rc-desc">' + esc(it.desc) + '</div>' : '')
|
||||||
|
+ '<div class="rc-badges">' + b + '</div>'
|
||||||
|
+ '</div>';
|
||||||
|
}).join('');
|
||||||
|
}
|
||||||
|
grid.addEventListener('click', function (e) { var c = e.target.closest('.rc-card'); if (!c) return; var it = INDEX[+c.getAttribute('data-i')]; if (it) open(it); });
|
||||||
|
tabs.addEventListener('click', function (e) { var t = e.target.closest('.rc-tab'); if (!t) return; filt = t.getAttribute('data-f'); [].forEach.call(tabs.children, function (x) { x.classList.toggle('on', x === t); }); render(); });
|
||||||
|
var deb; input.addEventListener('input', function () { clearTimeout(deb); deb = setTimeout(function () { q = norm(input.value); render(); }, 90); });
|
||||||
|
setTimeout(function () { try { input.focus(); } catch (e) {} }, 60);
|
||||||
|
// LE XW (docs/dev/42-lanceurs.md) : « 🔎 chercher « mot » » — la recherche arrive en demande (lue une fois au montage, via le décideur des ouvertures),
|
||||||
|
// ou ?q= sur la page seule ; déjà ouvert : le bus ploxion.recherche.cmd {cmd:'chercher', q} (ou {cmd:'params', params:{q}})
|
||||||
|
function poser(t) { t = String(t == null ? '' : t).slice(0, 120); input.value = t; q = norm(t); render(); }
|
||||||
|
try { var XP = window.jOSXerPrefs, d = (XP && typeof XP.params === 'function') ? XP.params('recherche', ctx) : ((ctx && ctx.params) || {});
|
||||||
|
var q0 = (d && typeof d.q === 'string') ? d.q : ((ctx && ctx.standalone) ? (new URLSearchParams(window.location.search).get('q') || '') : '');
|
||||||
|
if (q0) poser(q0); } catch (e0) {}
|
||||||
|
var offCmd = null;
|
||||||
|
try { if (window.jOSPorts && typeof window.jOSPorts.on === 'function') offCmd = window.jOSPorts.on('ploxion.recherche.cmd', function (p) {
|
||||||
|
if (typeof p === 'string') { try { p = JSON.parse(p); } catch (eJ) { p = null; } }
|
||||||
|
if (!alive || !p || typeof p !== 'object') return;
|
||||||
|
var t = p.cmd === 'chercher' ? p.q : (p.cmd === 'params' && p.params && typeof p.params === 'object' ? p.params.q : null);
|
||||||
|
if (typeof t === 'string') poser(t);
|
||||||
|
}); } catch (eB) {}
|
||||||
|
|
||||||
|
return { unmount: function () { alive = false; LIVE = null; if (offCmd) { try { offCmd(); } catch (e) {} offCmd = null; } container.innerHTML = ''; } };
|
||||||
|
}
|
||||||
|
window.jOSApps = window.jOSApps || {};
|
||||||
|
window.jOSApps['recherche'] = { manifest: { id: 'recherche', name: 'Recherche', icon: '🔎' }, mount: mount, describe: describe };
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user