Modifications pour le document Upload

Modifié par Florent Charton le 2025/07/04 23:28

Depuis la version 2.1
modifié par Florent Charton
sur 2024/08/08 18:44
Commentaire de modification : Install extension [org.xwiki.platform:xwiki-platform-ckeditor-ui/15.10.11]
À la version 3.1
modifié par Florent Charton
sur 2025/07/04 23:28
Commentaire de modification : Install extension [org.xwiki.platform:xwiki-platform-ckeditor-ui/16.10.9]

Résumé

Détails

XWiki.JavaScriptExtension[0]
Code
... ... @@ -48,6 +48,15 @@
48 48   }
49 49  
50 50   init($(document).find('.image-selector'));
51 +
52 + /* Make sure the input is emptied whenever we reload the image selection modal. */
53 + $(document).on('shown.bs.modal', function () {
54 + let fileInput = $(document).find('.image-selector').find("input[type='file']");
55 + if (fileInput.prop('files').length > 0) {
56 + fileInput.val('');
57 + $(document).find('.image-selector').find(".upload form input.button").prop("disabled", true);
58 + }
59 + });
51 51  
52 52   $(document).on('xwiki:dom:updated', (event, data) => {
53 53   data.elements.forEach(element => init($(element)));