nodebb-plugin-onekite-calendar 2.0.78 → 2.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/client.js +16 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-onekite-calendar",
3
- "version": "2.0.78",
3
+ "version": "2.0.80",
4
4
  "description": "FullCalendar-based equipment reservation workflow with admin approval & HelloAsso payment for NodeBB",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/public/client.js CHANGED
@@ -1241,7 +1241,10 @@ function toDatetimeLocalValue(date) {
1241
1241
  <div class="mb-2" id="onekite-period"><strong>Période</strong><br>${formatDt(start)} → ${formatDt(endDisplay)} <span class="text-muted" id="onekite-days">(${days} jour${days > 1 ? 's' : ''})</span></div>
1242
1242
  ${shortcutsHtml}
1243
1243
  ${forUserHtml}
1244
- <div class="mb-2"><strong>Matériel</strong></div>
1244
+ <div class="mb-1"><strong>Matériel</strong></div>
1245
+ <div class="mb-2">
1246
+ <input type="text" id="onekite-item-search" class="form-control form-control-sm" placeholder="Rechercher un matériel…" autocomplete="off">
1247
+ </div>
1245
1248
  <div id="onekite-items" class="mb-2" style="max-height: 320px; overflow: auto; border: 1px solid var(--bs-border-color, #ddd); border-radius: 6px; padding: 6px;">
1246
1249
  ${rows}
1247
1250
  </div>
@@ -1359,6 +1362,18 @@ function toDatetimeLocalValue(date) {
1359
1362
  document.querySelectorAll('.onekite-item-cb').forEach(cb => cb.addEventListener('change', refreshTotal));
1360
1363
  refreshTotal();
1361
1364
 
1365
+ const searchEl = document.getElementById('onekite-item-search');
1366
+ if (searchEl) {
1367
+ searchEl.addEventListener('input', () => {
1368
+ const normalize = (s) => String(s || '').normalize('NFD').replace(/[̀-ͯ]/g, '').toLowerCase();
1369
+ const q = normalize(searchEl.value.trim());
1370
+ document.querySelectorAll('#onekite-items [data-itemid]').forEach((row) => {
1371
+ const name = normalize(row.querySelector('input.onekite-item-cb')?.getAttribute('data-name'));
1372
+ row.style.display = (!q || name.includes(q)) ? '' : 'none';
1373
+ });
1374
+ });
1375
+ }
1376
+
1362
1377
  // Duration shortcuts (single-day selections): update end/days + refresh blocked items
1363
1378
  const shortcutsWrap = document.getElementById('onekite-duration-shortcuts');
1364
1379
  if (shortcutsWrap) {