Details
-
Task
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
Description
2/ Add a macro button in the WYSIWYG allowing to insert from a configurable list of macros (this list would come from the preferences field macros_mapping.
You can see the test for macro mapping here:
http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/xwiki/xwiki/trunk/src/test/java/com/xpn/xwiki/test/MacroMappingRenderTest.java?view=auto&rev=943
For example
In macros_mapping put:
hello=velocity:hello4:first_name,last_name
sign=velocity:sign:user
In XWiki.VelocityMacros put
#macro(hello $first_name $last_name)
Hello $name
#end
#macro(sign $user)
Signature by $user
#end
Then in the WYSIWYG Interface you should have a button to insert a Macro. This button should popup a window allowing to choose which macro.
The window should show "hello" and "sign". When you choose "sign" then the popup should ask you to fill in first_name and last_name.
When you click ok the following text should be included in the document
If you click inside this macro and click again on the macro button you should have the form for this macro pre-filled.