Modifications pour le document Confluence bridge for Attachments
Modifié par Admin le 21/07/2025 - 09:06
Résumé
-
Objets (2 modifications, 0 ajouts, 0 suppressions)
Détails
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -8,6 +8,12 @@ 8 8 }); 9 9 10 10 require(['jquery', 'xwiki-l10n!xwiki-confluence-attachments-messages'], function($, l10n) { 11 + 12 + // Trigger Collabora integration. 13 + $(document).on('xwiki:livedata:entriesUpdated', function(){ 14 + $(document).trigger('xwiki:collabora:addButtons'); 15 + }); 16 + 11 11 var enhanceUploadInputs = function(liveDataElems) { 12 12 $.each(liveDataElems.find('input[type=file]'), function() { 13 13 // Since the attachments liveData is refreshed on file upload, there is no need for a response container.
- XWiki.WikiMacroClass[0]
-
- Code de la macro
-
... ... @@ -118,29 +118,14 @@ 118 118 } 119 119 }) 120 120 121 - #if ("$!wikimacro.parameters.patterns" != '') 122 - #set ($liveDataConfig.query = {}) 123 - #set ($liveDataConfig.query.filters = [ 124 - { 125 - "property": "filename", 126 - "matchAll": true, 127 - "constraints": [] 128 - } 129 - ]) 130 - #set ($filters = $stringtool.split($wikimacro.parameters.patterns, ',')) 131 - #foreach ($filter in $filters) 132 - #set ($discard = $liveDataConfig.query.filters[0].constraints.add( 133 - { "operator": "contains", "value": "$!filter.trim()" } 134 - )) 135 - #end 136 - #end 137 137 #set ($sourceParams = { 138 138 'translationPrefix': 'core.viewers.attachments.livetable.', 139 139 'className': 'XWiki.AllAttachments', 140 - "\$doc": "$attachmentsDoc" 124 + "\$doc": "$attachmentsDoc", 125 + 'patterns': "$!wikimacro.parameters.patterns" 141 141 }) 142 142 #set ($discard = $sourceParams.put('template', 'xpart.vm')) 143 - #set ($discard = $sourceParams.put('vm', ' attachmentsjson.vm'))128 + #set ($discard = $sourceParams.put('vm', 'filteredAttachments.vm')) 144 144 #getLiveDataSort($liveDataSort) 145 145 #if ($invalidSortBy) 146 146 {{warning}} ... ... @@ -184,7 +184,7 @@ 184 184 #end 185 185 186 186 {{html clean="false" wiki="true"}} 187 - <div class='confluenceAttachmentsMacro'> 172 + <div class='attachments confluenceAttachmentsMacro'> 188 188 #showConfluenceAttachments($document) 189 189 </div> 190 190 {{/html}} ... ... @@ -196,7 +196,7 @@ 196 196 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 197 197 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 198 198 ## don't have view right on those pages. 199 -#if ($services. promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))184 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 200 200 #executeMacro 201 201 #else 202 202 {{missingLicenseMessage extensionName="proMacros.extension.name"/}}