This page, or parts of it, are still untranslated. Please translate it to the appropriate language (español).
UserAvatarLink es un script que convierte la imagen de avatar insertada por User Avatar Finder en un enlace en el que se puede hacer clic. El enlace es a una página específica del usuario que pertenece al mismo usuario que el avatar (por ejemplo, página de usuario o muro de mensajes). Para hacer esto, se deben agregar como máximo dos atributos adicionales a un marcador de posición de User Avatar Finder.
Installation
Dependencies
- Necesita User Avatar Finder.
Configuration
The configuration option (namespace) for this script simply provides a means of altering the default namespace associated with the data-useravatarlink-namespace attribute. The option is a property of the script's configuration object which can be created in a community's JS with the following lines of code.
if (!window.andrewds1021) {
window.andrewds1021 = {
user_avatar_link: {}
};
} else if (!window.andrewds1021.user_avatar_link) {
window.andrewds1021.user_avatar_link = {};
}
The configuration option should be set to a string that matches a namespace such that Namespace + ":" + Username is a valid page. To set the default namespace, place a line of code like the following below the code creating the script's configuration object.
window.andrewds1021.user_avatar_link.namespace = "Message Wall";
In the above example, the default namespace is set to Message Wall. Therefore, the script will attempt to link to the user's message wall. If the configuration setting is not set, the script will use User as the default namespace.
Usage
In order to create the link, the script must know the namespace and user to link to. This information is provided by adding two attributes to the User Avatar Finder placeholder.
data-useravatarlink-namespace
This attribute is used to change the target namespace to something other than the default. As with the configuration setting, the value should a a string that matches a recognized namespace such that Namepsace + ":" + Username is a valid page.
data-useravatarlink-username
This attribute is used to specify the target user. It should be the target user's username as a string such that Namepsace + ":" + Username is a valid page.
Template:UserAvatarLink
Template:UserAvatarLink is a template that may be copied to a wiki to increase the ease of using this script. The template is a modified version of the template provided for User Avatar Link. The template uses unnamed parameters as summarized in the following table.
| Parameter | Use |
|---|---|
| 1 | target user |
| 2 | size of avatar |
| 3 | target namespace |
Note that this template does not perfectly replicate the behavior of the template for User Avatar Finder. The reason is that a correction has been incorporated for when the template is called without a specified size.
Example
The following examples assume that the script's configuration setting has not been set and, therefore, that User is the default namespace. If you are not able to see the results, you may have disabled the DemoScripts gadget. Go to your preferences and verify that DemoScripts is enabled (the box should have a check mark in it).
Example Default
Template call:
{{UserAvatarLink}}
Result:
Example 1
Template call:
{{UserAvatarLink|Andrewds1021}}
Result:
Example 2
Template call:
{{UserAvatarLink|Andrewds1021|100}}
Result:
Example 3
Template call:
{{UserAvatarLink|Andrewds1021||User_talk}}
Result:
Example 4
Template call:
{{UserAvatarLink|Andrewds1021|100|User_talk}}
Result: