Wikipedia:WikiProject User scripts/Scripts/Friendly

From Wikipedia, the free encyclopedia

Jump to: navigation, search


Shortcut:
WP:FRIENDLY
Warning Be advised that even when using these scripts, you take full responsibility for any action done using them. You must understand the Wikipedia policies and use this tool within that policy, or risk being blocked for its misuse.

Contents

Welcome to Friendly.

[edit] What is Friendly?

Friendly is a collection of JavaScripts that provide an interface similar to Twinkle (by using the morebits JavaScript library) for Wikipedia's more friendly, collaboration oriented tasks.

Currently, the implemented features are welcome templates, shared IP address, tagging, and article space templates, provided via tabs labeled "welcome" and "shared ip" when on a user talk page and "tag" when in article space. A "welcome" link is also placed on diff pages next to users that have empty talk pages.

More features are always in the pipeline and Friendly is under ongoing development, so be sure to report any bugs or request new features on Friendly's talk page.

[edit] Notes

  • All scripts on this page are only tested on Mozilla Firefox 2. They may not work on other browsers.
  • The script is compatible with Twinkle, and will add additional Twinkle style function tabs.
  • If using Windows, ZoneAlarm might break these scripts.
  • Norton Internet Security (specifically, AntiSpam) will hijack the HTTP stream and append data, with the result that the data is malformed XML (the XML standard requires one root node only), breaking Friendly. This can be fixed by disabling popup blocking.

[edit] Functionality

Friendly adds additional features to various parts of Wikipedia. Each tab's ID is given to assist with further customization via additional user CSS or JavaScript.

[edit] User Talk Namespace

[edit] "welcome" Tab

Friendly's welcome functionality.
Friendly's welcome functionality.

The welcome tab will welcome the user with selected template.

If an article is specified in the input field, and the template supports an article link, Friendly will automatically link the template to the article you specified. All templates that support this are marked with an asterisk ("*"). In the case of normal welcome templates, the article would be one that the user contributed positively to. In the case of problem user welcome templates, the article would be one that the user vandalized or did not contribute positively to. This input field is automatically populated if the vanarticle URL parameter is found, which is populated by Twinkle after doing a rollback.

Tab element ID: friendly-welcome

[edit] "welcome" from Diff

A welcome link will appear next to a user in a diff view if the user's talk page is empty. This allows you to quickly welcome the user with the template specified in the quickWelcomeTemplate parameter (by default) or easily open the user's talk page with Friendly's welcome tab already visible (if the quickWelcomeMode parameter is set to semiauto).

[edit] "shared ip" Tab

Friendly's shared IP functionality.
Friendly's shared IP functionality.

The shared ip tab will tag the IP as a shared IP address.

Most of the Shared IP templates require that the name of the organization that owns or operates the IP address be input. If one of these templates is selected, Friendly will require that you fill in the "Organization name" input field, which does support wikitext.

Tab element ID: friendly-shared

[edit] Article Namespace

[edit] "tag" tab

Friendly's tag functionality.
Friendly's tag functionality.

The tag tab will tag the article with the template(s) of your choice.

All templates that are checked will be added to the article in their proper respective locations. Templates that support it will automatically be added with the date parameter populated to the current month and year. If the "Group into {{articleissues}} if possible" checkbox is ticked, Friendly will group templates supported by {{articleissues}} into an {{articleissues}} template, if there are four or more. All other selected templates are then added to the article normally. If there are three or fewer selected templates that are supported by the {{articleissues}} template, the setting is ignored, and all templates are added to the article normally.

Three templates in the list, {{notability}}, {{current}}, and {{future}}, allow you to select from a list of subcategories of the respective templates. The standard template is the default, and selecting a subcategory is not required, but it does place a more specific version of the template on the article. If a {{notability}} subcategory is selected and templates are being grouped into {{articleissues}}, the subcategory is ignored as {{articleissues}} only supports the standard {{notability}} template.

Tab element ID: friendly-tag

[edit] Installation

To install all Friendly modules, including all future updates and additions:

  1. copy the text below and paste it into the bottom of your monobook.js file:
    importScript('User:Ioeth/friendly.js');
    
  2. save the new monobook.js page, and
  3. completely refresh your browser by bypassing your cache (hit Control-Shift-R in Firefox).

You may wish to re-configure Friendly's default settings after installation. See below for instructions.

[edit] Individual Modules

If you just want to use one or more of the individual modules, here they are listed with their dependencies. The line importScript('User:AzaToth/morebits.js'); is only needed once in your monobook.js, and Twinkle already includes it (so you don't need it if you're a Twinkle user already). It is recommended that you do not import any script more than once, as it would just be a duplicate, but the importScript(); function has a check to make sure that a script is not imported more than once.

For the welcome functionality, add:

importScript('User:AzaToth/morebits.js');
importScript('User:Ioeth/friendlywelcome.js');

For the shared IP tagging functionality, add:

importScript('User:AzaToth/morebits.js');
importScript('User:Ioeth/friendlyshared.js');

For the tagging functionality, add:

importScript('User:AzaToth/morebits.js');
importScript('User:Ioeth/friendlytag.js');

[edit] Configuration

Optionally, to configure Friendly, copy the text below called FriendlyConfig, and paste it in your monobook.js file. (Per temporal disalignment it should not matter if you put the config before or after the includes). Each line in the object contains a specific setting which is described below. When changing settings, make sure not to remove the comma from the end of each line, and remember that some browsers dislike a comma on the last line.

[edit] Default Configuration

This is the default configuration:

FriendlyConfig = {
        summaryAd                       :       " using [[WP:FRIENDLY|Friendly]]",
        topWelcomes                     :       false,
        watchWelcomes                   :       true,
        markWelcomesAsMinor             :       true,
        insertHeadings                  :       true,
        welcomeHeading                  :       "== Welcome ==",
        insertUsername                  :       true,
        insertSignature                 :       true,
        quickWelcomeMode                :       "auto",
        quickWelcomeTemplate            :       "Welcome",
        maskTemplateInSummary           :       true,
        markSharedAsMinor               :       true,
        groupByDefault                  :       true,
        watchTaggedPages                :       true,
        markTaggedPagesAsMinor          :       true
};

[edit] Custom Configuration

Alternatively, you may wish to only copy the settings you wish to change.

FriendlyConfig = {
        key     :       value,
        key     :       value,
        ...
        key     :       value
};

[edit] Parameter Descriptions

[edit] summaryAd

Defines what summary Ad to be added.

Argument is a string, default to using [[WP:FRIENDLY|Friendly]].

[edit] topWelcomes

Defines if the welcome should be added to the top or bottom of the user's talk page.

Argument is a boolean, default to false.

[edit] watchWelcomes

Defines if adding a welcome should add page to watchlist.

Argument is a boolean, default to true.

[edit] groupByDefault

Defines if the checkbox for template grouping should be checked by default.

It is recommended that you not change this option.

Argument is a boolean, default to true.

[edit] markWelcomesAsMinor

Defines if adding a welcome should be marked as a minor edit.

Argument is a boolean, default to true.

[edit] insertHeadings

Defines whether a heading is added to a welcome template that does not already contain one.

Argument is a boolean, default to true.

[edit] welcomeHeading

Defines what heading is to be added to welcome templates if insertHeadings is true and the welcome template has no heading.

Argument is a string, default to == Welcome ==.

[edit] insertUsername

Defines if your username should be added to the template, if the template supports it. Example: {{welcome|Ioeth}}.

Argument is a boolean, default to true.

[edit] insertSignature

Defines whether a signature (~~~~) is added after the welcome template if the template has no signature.

It is recommended that you not change this option.

Argument is a boolean, default to true.

[edit] quickWelcomeMode

Defines which quick welcome mode Friendly will operate in when welcoming a new user directly from a historical diff page. Automatic mode will add the template defined in the quickWelcomeTemplate variable to the user's talk page with no user intervention. Semi-automatic mode will load the user's talk page and then prompt you with the welcome template list as if you clicked the "welcome" tab.

The value of this argument must either be auto or semiauto.

Argument is a string, default to auto.

[edit] quickWelcomeTemplate

Defines which welcome template Friendly will use when welcoming a new user directly from a historical diff page.

The value of this argument must exactly match one of the templates available from the "welcome" tab on a user talk page. Do not include the curly braces, only the template name, and make sure the capitalization matches.

Argument is a string, default to Welcome.

[edit] maskTemplateInSummary

Defines whether Friendly will reference the specific template you used in the edit summary. This is useful if you do not want welcomed users to see that you welcomed them with {{welcomevandal}}, for instance.

Argument is a boolean, default to true.

[edit] markSharedIPAsMinor

Defines if adding a shared IP template should be marked as a minor edit.

Argument is a boolean, default to true.

[edit] watchTaggedPages

Defines if adding a tag should add a page to watchlist.

Argument is a boolean, default to true.

[edit] markTaggedPagesAsMinor

Defines if adding a tag should be marked as a minor edit.

Argument is a boolean, default to true.

[edit] Troubleshooting

After installing friendly, new tabs will be added to the top of the page. If there aren't, try installing each script separately (copy from User:Ioeth/friendly.js). Remember, this script won't work unless you're using Firefox.

[edit] Userboxes

Friendly users may add these userboxes to their userpage.

This user welcomes new users with Friendly!

Image:Face-smile.svg

This user welcomes new users with Friendly!

{{wikify}}

This user tags articles for maintenance with Friendly!

{{User:NASCAR Fan24/Userboxes/Friendly}} {{User:NASCAR Fan24/Userboxes/Friendly2}} {{User:NASCAR Fan24/Userboxes/Friendly3}}
Personal tools