nodebb-plugin-calendar-onekite 11.2.31 → 11.2.32
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.
- package/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/plugin.json +1 -2
- package/public/admin.js +22 -1
- package/public/client.js +6 -0
- package/templates/admin/plugins/calendar-onekite.tpl +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
|
|
2
|
+
## 1.0.2
|
|
3
|
+
- Front : empêche la double initialisation du calendrier (évite le clignotement au chargement / après actions).
|
|
4
|
+
- ACP (NodeBB v4) : init robuste via `hooks.on('action:ajaxify.end')` + garde-fou anti double-bind (évite les multi-popups).
|
|
5
|
+
- Maintenance : suppression du mapping module ACP legacy (`../admin/plugins/...`).
|
|
6
|
+
|
|
2
7
|
## 1.0.1.1
|
|
3
8
|
- ACP (NodeBB v4) : empêche l’affichage multiple des popups de succès lors de l’enregistrement (déduplication des alerts).
|
|
4
9
|
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
},
|
|
23
23
|
"templates": "./templates",
|
|
24
24
|
"modules": {
|
|
25
|
-
"../admin/plugins/calendar-onekite.js": "./public/admin.js",
|
|
26
25
|
"admin/plugins/calendar-onekite": "./public/admin.js"
|
|
27
26
|
},
|
|
28
27
|
"scripts": [
|
|
@@ -31,5 +30,5 @@
|
|
|
31
30
|
"acpScripts": [
|
|
32
31
|
"public/admin.js"
|
|
33
32
|
],
|
|
34
|
-
"version": "1.0.
|
|
33
|
+
"version": "1.0.2"
|
|
35
34
|
}
|
package/public/admin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts, bootbox) {
|
|
2
|
+
define('admin/plugins/calendar-onekite', ['alerts', 'bootbox', 'hooks'], function (alerts, bootbox, hooks) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
// Cache of pending reservations keyed by rid so delegated click handlers
|
|
@@ -335,6 +335,12 @@ define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts
|
|
|
335
335
|
const form = document.getElementById('onekite-settings-form');
|
|
336
336
|
if (!form) return;
|
|
337
337
|
|
|
338
|
+
// Avoid duplicate listeners/toasts when revisiting the ACP page via ajaxify.
|
|
339
|
+
if (form.getAttribute('data-onekite-bound') === '1') {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
form.setAttribute('data-onekite-bound', '1');
|
|
343
|
+
|
|
338
344
|
// Make the HelloAsso debug output readable in both light and dark ACP themes.
|
|
339
345
|
// NodeBB 4.x uses Bootstrap variables, so we can rely on CSS variables here.
|
|
340
346
|
(function injectAdminCss() {
|
|
@@ -801,5 +807,20 @@ define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts
|
|
|
801
807
|
}
|
|
802
808
|
}
|
|
803
809
|
|
|
810
|
+
// Auto-init when navigating in ACP via ajaxify.
|
|
811
|
+
try {
|
|
812
|
+
const autoInit = function (data) {
|
|
813
|
+
const tpl = data && data.template ? data.template.name : (window.ajaxify && ajaxify.data && ajaxify.data.template ? ajaxify.data.template.name : '');
|
|
814
|
+
if (tpl === 'admin/plugins/calendar-onekite') {
|
|
815
|
+
init();
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
if (hooks && typeof hooks.on === 'function') {
|
|
819
|
+
hooks.on('action:ajaxify.end', autoInit);
|
|
820
|
+
}
|
|
821
|
+
// Also try once for the initial render.
|
|
822
|
+
setTimeout(() => autoInit({ template: (window.ajaxify && ajaxify.data && ajaxify.data.template) || { name: '' } }), 0);
|
|
823
|
+
} catch (e) {}
|
|
824
|
+
|
|
804
825
|
return { init };
|
|
805
826
|
});
|
package/public/client.js
CHANGED
|
@@ -828,6 +828,12 @@ function toDatetimeLocalValue(date) {
|
|
|
828
828
|
return;
|
|
829
829
|
}
|
|
830
830
|
|
|
831
|
+
// Avoid double init (ajaxify + initial load tick).
|
|
832
|
+
if (el.getAttribute('data-onekite-initialised') === '1') {
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
el.setAttribute('data-onekite-initialised', '1');
|
|
836
|
+
|
|
831
837
|
if (typeof FullCalendar === 'undefined') {
|
|
832
838
|
showAlert('error', 'FullCalendar non chargé');
|
|
833
839
|
return;
|
|
@@ -180,11 +180,14 @@
|
|
|
180
180
|
</div>
|
|
181
181
|
|
|
182
182
|
<script>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
// NodeBB v4: prefer auto-init via ajaxify hook, but keep a safe fallback.
|
|
184
|
+
if (window.require) {
|
|
185
|
+
require(['admin/plugins/calendar-onekite'], function (mod) {
|
|
186
|
+
if (mod && mod.init) {
|
|
187
|
+
mod.init();
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
188
191
|
</script>
|
|
189
192
|
|
|
190
193
|
<!-- IMPORT admin/partials/settings/footer.tpl -->
|