Changes for page Icon Picker Macro

Last modified by Thomas Coelho (local) on 2023/07/26 11:22

From version 4.1
edited by Thomas Coelho (local)
on 2022/08/02 15:10
Change comment: Install extension [org.xwiki.platform:xwiki-platform-icon-ui/14.6]
To version 6.1
edited by Thomas Coelho
on 2023/07/26 11:05
Change comment: Migrated property [type] from class [XWiki.WikiMacroParameterClass]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.coelho
1 +XWiki.thw
XWiki.WikiMacroClass[0]
Macro code
... ... @@ -19,13 +19,13 @@
19 19   require(['jquery', 'xwiki-icon-picker'], function($) {
20 20   var options = {};
21 21   #if($xcontext.macro.params.parameterNames.contains('prefix'))
22 - options['prefix'] = '$escapetool.javascript($xcontext.macro.params.prefix)';
22 + options['prefix'] = $jsontool.serialize($xcontext.macro.params.prefix);
23 23   #end
24 24   #if("$!xcontext.macro.params.id" != '')
25 - $('#${escapetool.javascript(${xcontext.macro.params.id})}').xwikiIconPicker(options);
25 + $($jsontool.serialize("#$escapetool.css($xcontext.macro.params.id)")).xwikiIconPicker(options);
26 26   #end
27 27   #if("$!xcontext.macro.params.get('class')" != '')
28 - $('.${escapetool.javascript(${xcontext.macro.params.get('class')})}').xwikiIconPicker(options);
28 + $($jsontool.serialize(".$escapetool.css($xcontext.macro.params.get('class'))")).xwikiIconPicker(options);
29 29   #end
30 30   });
31 31  </script>