Hi, On 4/11/11 10:04 AM, Raluca Stavro wrote:
Hello,
You don't need access to filesystem. See here xwiki.js: https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwik.... Go to line 845 and check 'prepareName' function that is being defined in xwiki.js. Now, what you have to do is to edit XWiki.Registration document (http://<yourserver>/xwiki/bin/edit/XWiki/Registration?editor=wiki) and put your custom function there. You can either override 'prepareName' function, or you can create your own function:
XWiki.Registration: -----------------------------------------------------
1. Override 'prepareName' function: <script type="text/javascript"> function prepareName(form){ ... } </script>
OR
2. Add and use your own function: <script type="text/javascript"> function yourOwnFunction(form){ ... } </script>
You can also store your javascript function inside a skin extension: http://platform.xwiki.org/xwiki/bin/view/DevGuide/SkinExtensionsTutorial) Oana
and at replace the following line: 'onfocus' : 'prepareName(document.forms.register);',
with: 'onfocus' : 'yourOwnFunction(document.forms.register);',
Raluca.
On Fri, Apr 8, 2011 at 10:09 PM, wojtek danilo <[email protected]>wrote:
Hi! Thank you for your reply :)
I would do it if i had access to the server, but I'm using hoosted wiki.
Is there any solution in this case ?
Thank you very much Wojtek
2011/4/8 Elena-Oana Tabaranu<[email protected]>
Hi, d On 04/07/2011 06:18 PM, wojtek danilo wrote:
Hi! Is it possible to change default autocompletion of username in tregistration window?
So when I'm enterning the first name and real name then the username autocompletes to FirstnameLastname (uppercased). I want to change it to first letter of firstnaeme and lastname without uppercase and set it by default so users could not change this pattern.
When I clicked to edit the filds I've found tht this autocompletion is made by javascript script "prepareName(...)"
Where is this script? can I change it when I've got hosted xwiki on myxwiki? If not is there any method to change this behavior as I want? This script is located in xwiki.js : http://<your server>/xwiki/bin/skin/resources/js/xwiki/xwiki.js The best way to do it is to change the registration code on http://<your server>/xwiki/bin/view/XWiki/Registration and use your own javascript function instead of prepareName() when the focus event is fired:
#set($field = {'name' : 'xwikiname', 'label' : $msg.get('core.register.username'), 'params' : { 'type' : 'text', 'onfocus' : 'prepareName(document.forms.register);', 'size' : '20' }, 'validate' : { 'mandatory' : { 'failureMessage' : $msg.get('xe.admin.registration.fieldMandatory') }, 'programmaticValidation' : { 'code' : '#nameAvailable($request.get("xwikiname"))', 'failureMessage' : $msg.get('core.register.userAlreadyExists') } } })
Hope this helps, Oana
Thank you! Wojtek _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Oana Tabaranu