Jump to content

User:SoledadKabocha/linkclassifier

From Wikipedia, the free encyclopedia

This has been superseded by User:SoledadKabocha/linkclassifier2. See that page for changes. This script has been redirected to User:SoledadKabocha/linkclassifier2.js via an importScript call, so it will continue to work, but you should update your user skin to import the new script directly.


User:SoledadKabocha/linkclassifier.js is a copy of User:Anomie/linkclassifier.js, modified to call the function defined at window.LinkClassifierChainedFunc with the argument window.LinkClassifierChainedFuncArg (if they exist) once it is finished processing all links. markBlockedPlus uses this feature to ensure that it executes only after linkclassifier has finished.

If you wish to install my version of linkclassifier, please include both [[User:Anomie/linkclassifier.js]] and [[User:SoledadKabocha/linkclassifier.js]] in the "Linkback" comment. (TODO: Reevaluate this; Anomie may not be happy about people linking back to his script if they're not using his original version. I ought to ask him sooner or later. I myself don't particuarly care about linkbacks anyway)

Additional classes

[edit]

Additional classes are supported corresponding to the following categories:

On-demand mode

[edit]

The on-demand mode (enabled via window.LinkClassifierOnDemand=true) has been changed so that it no longer requires the user to manually add code to the common.js/skin.js to display the portlet link.

The text of the portlet link can be configured via window.LinkClassifierOnDemandText (default is linkclassifier). Its location can be configured via window.LinkClassifierOnDemandLoc (the default p-cactions puts it near the "Move" link; p-tb would put it in the "Toolbox" section of the sidebar).

Uncategorized pages

[edit]

If a non-redirect page or redirect target is uncategorized, the link will be given the class uncategorized. Known issue: This currently has many false positives and rare false negatives (I suspect the API is working off an outdated database version or is buggy in some other way, or I'm hitting API parameter limits for some tricky reason). As of 19:54, 24 August 2014 (UTC), this will only be enabled if you manually set window.LinkClassifierReallyEnableUncategorized = true; in your user skin.

If a redirect itself (not its target) is uncategorized, the link will be given the class redir-uncategorized. (This seems to work more reliably than the above and so is enabled regardless of window.LinkClassifierReallyEnableUncategorized.)

See also

[edit]

For all other information on the linkclassifier functionality, see User:Anomie/linkclassifier.