Änderungen von Dokument Anhänge
Zuletzt geändert von Wiki Admin am 2026/08/31 19:18
Von Version 9.1
bearbeitet von Wiki Admin
am 2026/08/31 19:18
am 2026/08/31 19:18
Änderungskommentar:
Install extension [org.xwiki.platform:xwiki-platform-attachment-ui/18.7.0]
Auf Version 6.1
bearbeitet von Wiki Admin
am 2025/09/04 19:39
am 2025/09/04 19:39
Änderungskommentar:
Install extension [org.xwiki.platform:xwiki-platform-attachment-ui/17.7.0]
Zusammenfassung
-
Seiteneigenschaften (1 geändert, 0 hinzugefügt, 0 gelöscht)
-
Objekte (2 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- Seiteneigenschaften
-
- Inhalt
-
... ... @@ -34,7 +34,7 @@ 34 34 #** 35 35 * Displays the attachment gallery as a list of attachment boxes, starting with special boxes for uploading a new attachment and for setting a default value. 36 36 * 37 - * @param $targetDocument the document to rec eive the field value being modified37 + * @param $targetDocument the document to recieve the field value being modified 38 38 * @param $targetAttachDocument the document to list/save attachments to 39 39 * @param $options generic picker options 40 40 *#
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -2,7 +2,6 @@ 2 2 function uploadTemporaryAttachment() { 3 3 // Require jquery locally until we are able to fully migrate this code away from prototype. 4 4 const form = this.property.up('form'); 5 - const propertyReferenceInput = this.property.querySelector('input[type="hidden"].property-reference'); 6 6 require(['jquery'], function ($) { 7 7 const data = new FormData(); 8 8 const uploadedFile = $('#attachfile')[0].files[0]; ... ... @@ -14,7 +14,7 @@ 14 14 "$services.localization.render('xe.attachmentSelector.upload.inProgress')", 'inprogress'); 15 15 const params = { 16 16 'form_token': $(form).find('[name="form_token"]').val(), 17 - 'sheet': ' XWiki.WYSIWYG.FileUploader',16 + 'sheet': 'CKEditor.FileUploader', 18 18 'outputSyntax': 'plain' 19 19 }; 20 20 ... ... @@ -41,7 +41,7 @@ 41 41 .prop('type', 'hidden') 42 42 .prop('name', 'uploadedFiles') 43 43 .prop('value', response.fileName)) 44 - property ReferenceInput.value=response.fileName;43 + $(form).find('input[type="hidden"].property-reference').prop('value', response.fileName); 45 45 this.updateAttachment(response.fileName, response.url); 46 46 this.dialog.closeDialog(); 47 47 }.bind(this)).fail(function () { ... ... @@ -168,7 +168,7 @@ 168 168 /** AJAX deletion of attachments. */ 169 169 onDelete : function(event) { 170 170 event.stop(); 171 - constdeleteTool = event.target.closest('.btn');170 + deleteTool = event.element(); 172 172 if (!deleteTool.disabled) { 173 173 new XWiki.widgets.ConfirmedAjaxRequest( 174 174 deleteTool.readAttribute('href'), ... ... @@ -211,7 +211,7 @@ 211 211 /** Update the property with the selected value without reloading the page. */ 212 212 onSelect : function(event) { 213 213 event.stop(); 214 - consttargetElement = event.target.closest('.btn');213 + var targetElement = event.element(); 215 215 var attachmentName = targetElement.up('.gallery_attachmentbox').down('.gallery_attachmenttitle').title; 216 216 var imageSource = targetElement.up('.gallery_attachmentbox.gallery_image'); 217 217 if (imageSource) { ... ... @@ -226,7 +226,7 @@ 226 226 if (this.directSave) { 227 227 // save via ajax 228 228 if (!targetElement.disabled) { 229 - new Ajax.Request( targetElement.href, {228 + new Ajax.Request(event.element().href, { 230 230 onCreate : function() { 231 231 targetElement.disabled = true; 232 232 targetElement._x_notif = new XWiki.widgets.Notification("$services.localization.render('core.widgets.confirmationBox.notification.inProgress')", 'inprogress'); ... ... @@ -319,8 +319,8 @@ 319 319 document.observe('xwiki:dom:loaded', function() { 320 320 $$('.attachment-picker-start').invoke('observe', 'click', function(event) { 321 321 event.stop(); 322 - consttargetElement = event.target.closest('.attachment-picker-start');323 - leturl = targetElement.dataset.modalUrl;321 + var targetElement = event.element(); 322 + var url = targetElement.href; 324 324 if (url.indexOf('?') < 0) { 325 325 url += '?'; 326 326 }
- XWiki.WikiMacroClass[0]
-
- Makro-Code
-
... ... @@ -121,9 +121,9 @@ 121 121 #set ($attachmentResource = '') 122 122 #end 123 123 #if ($displayImage) 124 - (% class="${ services.rendering.escape($!cssClass, 'xwiki/2.1')}#if (!$attachment) hidden#end" %)(((#if ("$!{attachmentResource}" != '' || $forceElement)#if($withLink)[[#end[[image:$services.rendering.escape(${attachmentResource}, 'xwiki/2.1')$!{imageParams}]]#if($withLink)>>attach:$services.rendering.escape(${attachmentResource},'xwiki/2.1')||rel=lightbox]]#{end}#end)))##124 + (% class="$!{cssClass}#if (!$attachment) hidden#end" %)(((#if ("$!{attachmentResource}" != '' || $forceElement)#if($withLink)[[#end[[image:$services.rendering.escape(${attachmentResource}, 'xwiki/2.1')$!{imageParams}]]#if($withLink)>>attach:$services.rendering.escape(${attachmentResource},'xwiki/2.1')||rel=lightbox]]#{end}#end)))## 125 125 #else 126 - (% class="${ services.rendering.escape($!cssClass, 'xwiki/2.1')}" %)#if ("$!{attachmentResource}" != '' || $forceElement)#if ($withLink)[[attach:${attachmentResource}||rel=__blank]]#{else}(% class="displayed" %)#if($targetPermView)$!{services.rendering.escape($!{attachmentName}, 'xwiki/2.1')}#{else}Access Denied#{end}(% %)#{end}#end(%%)##126 + (% class="$!{cssClass}" %)#if ("$!{attachmentResource}" != '' || $forceElement)#if ($withLink)[[attach:${attachmentResource}||rel=__blank]]#{else}(% class="displayed" %)#if($targetPermView)$!{services.rendering.escape($!{attachmentName}, 'xwiki/2.1')}#{else}Access Denied#{end}(% %)#{end}#end(%%)## 127 127 #end 128 128 #end 129 129 ... ... @@ -146,17 +146,9 @@ 146 146 #if ($hasTargetDoc) 147 147 #set ($queryString.targetdocname = $targetdoc.fullName) 148 148 #end 149 - #set ($linkLabel = $escapetool.xml($buttontext)) 150 - #set ($modalUrl = $escapetool.xml("$xcontext.macro.doc.URL?$escapetool.url($queryString)")) 151 - {{html clean="false"}} 152 - <p> 153 - <span class="buttonwrapper"> 154 - <button type="button" class="attachment-picker-start button" 155 - title="$!{linkLabel}" 156 - data-modal-url="${modalUrl}">$!linkLabel</button> 157 - </span> 158 - </p> 159 - {{/html}}## 149 + #set ($linkLabel = $services.rendering.escape($services.rendering.escape($buttontext, 'xwiki/2.1'), 'xwiki/2.1')) 150 + (% class="buttonwrapper" %)[[$linkLabel>>${xcontext.macro.doc.fullName}||queryString="$escapetool.url($queryString)" 151 + class="attachment-picker-start button" title="$services.rendering.escape($buttontext, 'xwiki/2.1')"]](%%)## 160 160 #end 161 161 #end 162 162 {{/velocity}}