Wikipedia:WikiProject User scripts/Scripts
From Wikipedia, the free encyclopedia
This is a list of scripts for WikiProject User scripts. See also Techniques for a list of commonly used techniques.
Scripts can build upon each other, so libraries, below, are a collection of scripts that can be used by other scripts. In some cases, specific libraries are required by other scripts below. Remember to put the libraries before the code that requires them.
Contents |
[edit] Installing scripts in your session
There are two ways to get these scripts into your browser sessions: you either copy the content into your own javascript page, or (in some cases) you can import the functions from the pages into your javascript page.
[edit] Importing
To import one of the scripts below, add the following line to your monobook.js:
importScript('Wikipedia:WikiProject User scripts/Scripts/<script>');
For example:
importScript('Wikipedia:WikiProject User scripts/Scripts/Show last diff');
However, this will work only if the relevant script file is entirely valid Javascript, i.e. all non-Javascript content, such as explanatory text and wiki markup, is protected by Javascript comment delimeters ('/*' and '*/'). Some of the scripts listed on this page satisfy this requirement, but others do not.
If you import a file which is not valid Javascript, nothing serious will happen, but your Javascript, and any Javascript you have below that, will not work. If your browser is set to inform you about Javascript errors, you will see these errors; otherwise you will see nothing except that the scripts you have tried to add do not work.
Alternatively, you can add a script to your monobook.js by placing {{subst:js|name_of_script.js}} at the bottom, and saving the page. This method also only works on scripts that are entirely valid Javascript.
After installing a script, you will need to bypass your cache.
[edit] Copying
If you cannot get a script to work by importing it, you can copy the Javascript code from it directly into your script page. You will thereafter have your own copy of the script, and will not be updated automatically; you must do it yourself.
[edit] Modules
(Template)
Documentation | Summary | Dependencies | |
---|---|---|---|
[edit] Navigating to Edit page |
|||
Add edit section 0 | Add '0' tab to edit section of page before headings | ||
Edit Top | Similar functionality to Add edit section 0, but adds a conventional [edit] link below the page heading | ||
Gerbrant.edit.top | Similar to Edit Top, but as an includable module. Exports nothing. | ||
Simple EditTop | Another Edit Top, adds [edit] link above page heading | ||
Talk page section tabs | Replace link to empty talk-page by new section link | ||
[edit] Editing |
|||
User:Cacycle/wikEd.js | A full-featured in-browser text editor for Wikipedia edit pages. Provides wikicode syntax highlighting, regular expression search and replace, MS Word and HTML to wikicode conversion, server-independent Show preview and Show changes, fullscreen editing mode, and single-click fixing of common mistakes. See the wikEd homepage for detailed installation instructions. | ||
Force edit summary | Force user to make an edit summary if none is given (there is an option in the edit tab of Special:Preferences for the same purpose). | ||
Force edit summary alternative | Flash summary box if no summary is given. | ||
Sigdash | Change the Your signature with timestamp edit button to use a real em dash instead of two hyphens. | ||
Replace | allows for regexp inline replacing in textboxes | ||
Formatter | Formats the article by removing excess whitespace and simplifying links. | ||
QuickEdit (inline section editing) | Inline editing of sections in articles (see de:Image:QuickEdit.png) | ||
Inline section editor | Inline section editor – also supports previewing and viewing changes inline! | ||
Gerbrant.edit.regexReplace | Selectively replace regex matches, possibly based on the text of the match. (documentation) | See doc. | |
Gerbrant.edit.autoReplace | Make a standard, configurable set of regular expression based replacements each time you start editing a page, using the interface of regexReplace. (documentation) | See doc. | |
defaultsort | Edits the category links to make use of the new {{DEFAULTSORT:sortkey}} keyword. | ||
qPreview | Preview edited page AJAX-style, a lot quicker than standard «Preview» button. | ||
qSig | Smart signature button next to «Save page» button — reminds you when to sign | ||
[edit] Page appearance |
|||
Fix lowercase first letter problem | When a page has the lowercase template, changes the page to show the correct title and removes the template. | ||
Duplicate tabs at bottom | Duplicate the tabs at the top on the bottom of the page | ||
hideOwn.js | Obsolete script. There is an option in "Special:Preferences" under "Watchlist" that does the same thing. |
||
New message history | Append the new messages warning with a link to your talk page history | ||
HistoryCount | Change the default amount of history entries on the history tab | ||
Single column diffs | Makes the diff page appear as a single column | ||
Fix diff width | Adds scroll bars to wide diffs (such as [1]). Fixes Bug 1229. Now works in IE too! | ||
Time | Adds the current date and time (UTC) to the top right, after the "log out" link (or anywhere else up there) | ||
Signature contraction | Hides the code for complicated signatures in the edit window | ||
Highlight your comments | A modified signature, user CSS and JavaScript to highlight your comments (or at least the last paragraphs of them). | ||
!Vote symbols | Add symbols to !votes in discussions | ||
Color-coded contribs | Color-codes contributions pages based on whether you have the top contribution | ||
Username highlighter | Highlights all occurences of your username on pages (even in edit boxes!). | ||
Username highlighter | Highlights all occurences of your username on pages (a modified version that avoids edit pages; the above version causes errors in some browsers). | ||
Set Book Source | Rewrites ISBN links to the book source of your choice | ||
Comment localization | Changes the times in signatures to the local time. | ||
Sidebar translator | Translates the 'in other languages' box on the sidebar to English | ||
Selfrefs as a tab | Changes selfref disambiguation headers to a tab marked 'wp'. | ||
HighlightRedirects | Recolors all links green that are pointing to redirect pages. | ||
[edit] Deletion and other processes |
|||
Easy db | Adds tabs when viewing the article (not in the edit form) to tag an article for speedy deletion | ||
Easy prod | Add tab for proposing pages for deletion when viewing articles and user pages. | ||
AutoAFD.js | Adds 'AfD' tab to edit page to nominate an article for deletion | ||
CloseAFD.js | Adds 'close' and 'relist' tabs to edit page of AfD debates to close/relist them. | addLink | |
afd helper | Adds 'vote' links to all edit-AFD-page links which make voting on an AFD a one-click process; also AFD-nomination feature like AutoAFD (link in toolbox on left when viewing page, not editing) | ||
Autocopyvio.js | Add 'copyvio' tab on Edit page to mark a page as a copyright violation and submit it to the Copyright problems page | ||
AIV Helper | Adds [ipvandal] and [vandal] buttons when editing WP:AIV to facilitate listing vandals | ||
CommonsHelper Helper | Expedites the process of moving free images to the Commons with CommonsHelper and tagging them for deletion with {{NowCommons}} | ||
gallery.js | Add edit • talk • history • logs • delete links to image galleries, including thumbnails and category pages. | ||
[edit] Tagging |
|||
Quick wikify | Add 'wikify' tab on Edit pages to add {{wikify-date}} to top of page and save | ||
CleanupTab.js | Add 'cleanup' tab on Edit pages to add {{cleanup}} to top of page and save | ||
Orphan.js | Add 'orphan' tab on Edit pages to add {{orphan}} to the top of page and save | ||
test-n.js | Add tabs that automate the adding of {{test-n}} templates when editing user talk pages. | ||
test-enhanced | Enhanced version of the above. | ||
Tag unverified image | Adds an {{unverified}} tag to an image when you press the tab. Could be modified to put any tag. | ||
Revert tools | Adds links to the top of diff pages to revert the edit and/or warn the user. | ||
quickimgdelete | Script to simply IFD nominations and marking images as no source/license/rationale or orphaned/replaceable fair use. | ||
welcome new user | Script that adds a welcome template to a new user's talk page | ||
Tags | Script adds various frequently used maintenance templates (e.g. cleanup, wikify, etc.) at the top of articles | see doc | |
[edit] Shortcuts for commands |
|||
Add purge to tabs | Add 'purge' tab to clear Wikipedia cache of page | ||
Changes since I last edited | Add 'since' tab to show changes since user last edited given page | ||
Show last diff | Add 'last' tab to show diff of last edit to this page | ||
External editor | Add a tab that will edit the current page with an external editor. | ||
User tabs | Adds tabs for edit count, page moves, contribs, and block logs when viewing user or user talk pages. | ||
User Contribs Tabs | Shows contribs, edit count & edit summary usage when veiwing user or user talk pages. | ||
Wikipedia:Tools/Navigation popups | Navigation popups offer easy access to several Wikipedia functions in popups which appear when you hover the mouse over links | ||
Navigation shortcuts | Navigation shortcuts offer adding personal links into the left sidebar menu, below the navigation, search and toolbox portlets. | ||
godmode-light.js from Sam Hocevar | A rollback button on a user's contributions page and on an article’s latest diff page. | ||
godmode-light variation | Modified for use with Wikipedia:Tools/Navigation popups. (UNMAINTAINED) | ||
Logs link | Add a 'Logs' link to the toolbox, which links to Special:Log for that page. If the page is a user page, user talk page or a user subpage, the link goes to logs for that user. | ||
Compare link | Makes the "compare selected versions" button on history pages into a link (allows diffs in new windows, tabs, etc.) | ||
Autolink | Makes plaintext [[wikilinks]] and {{templates}} clickable (especially useful on monobook.js pages and the like). | ||
View source | Adds a [view source] button to the left of [edit this page]. | ||
RBL check | Adds an "RBL check" link to the toolbox on IP user/talk/contribs pages. | ||
WP cactions | Adds menus of page & user options to the cactions bar. Option to also replace standard history, watch, move, undelete etc. links | ||
What links here watchlist | See the backlinks for multiple pages | ||
Gerbrant.edit.linksInDiff | Makes internal links in the side-by-side comparisons (diffs) clickable. Exports nothing. | ||
Barticus88/WhatLinksHere.js | Add selection tabs to WhatLinksHere pages. | ||
EcceNux/replylinks.js | Adds reply links near user links, automatically inserts a backtrack link (with section anchor) to the message area | ||
[edit] Searching |
|||
Google link | Add toolbox links to search Google and Yahoo! for the title of the page. | ||
Multi-NS search | Adds a drop-down menu to the search box to choose the namespace to search in. | ||
Google search | Show a google sitesearch box instead of, or beside, the wikipedia search. | ||
[edit] Administrative |
|||
ubergodmode.js from Sam Hocevar | A compilation of Javascript helpers that help with the administration of Wikipedia. You need to be already a sysop for it to be useful. | ||
(assessment) metadata.js | Displays an article's talk-page assessment on the article page. Data includes current assessment and FAC/GAC/FFA indicators. | ||
[edit] Personal |
|||
Status switcher | A simple, but functional Wikipedia-status-switcher. | ||
Wikibreak Enforcer | Prevents user from logging in before a certain date+time, to enforce a wikibreak. | ||
[edit] Watchlist |
|||
Watchlist since | Adds a link to your watchlist which loads only new changes to watched items. | ||
All diffs above here | Add 'adah' links next to each watchlist entry which opens all diffs from that shown in the watchlist in separate windows | ||
Unwatch | Adds unwatch links next to each item in your watchlist. | ||
Watchfilter | Lets you filter your watchlist by namespace, similar to recent changes. Please note that namespace filtering has just been added to watchlist, rendering this slightly less useful. | ||
Watchlist sorter | Alternative to Watchfilter. Doesn't filter edits, but rather sorts them by namespace. | ||
User watchlist | Watch the contributions of specified users | ||
Category watchlist | Enhances the watchlist to show the addition of pages to specified categories. | ||
Autowatch | Changes the watch tab to allow you to watch and unwatch an article in-place, without going to the confirmation screen. | ||
[edit] Miscellaneous |
|||
User:Voice of All/Useful | Several scripts there. Automatic WP:PP (de)listing/ history and user anaylsis/ admin script/ RC patrol script | Add tab | |
A collection of some useful scripts | A bunch of different scripts. (they are listed there because it is easier to update, as they change alot) | ||
Wikipedia Bilingual | Display a Wikipedia article in 2 of the languages in which it is available, side by side (for example, Russian and Spanish) | ||
[edit] Meta-scriptsThese are scripts that help develop or use other scripts. |
|||
Syntax highlighter | Meta-script highlights anything that looks like css code inside pre tags by giving a class to each bit. Makes it much easier to read. Use your monobook.css to format your monobook.css. :-) Now for js code it's also available. | ||
Inclusion | Use these short commands to include scripts and css from other places (like synchronizing your accounts on all wikis). | ||
Gerbrant.mng.decache | Selectively remove one or more user scripts from your browser cache. Needs external application. (documentation) | See doc. |
[edit] Libraries
These functions can be included directly in a script but don't do anything unless called by some other code. The functions marked as deprecated have been rendered obsolete by new features added to MediaWiki, and only exist now as wrappers for compatibility with existing code.
(Template)
Documentation | Summary | Dependencies |
---|---|---|
Add LI link (mostly deprecated) | Add a hyperlinked list-item as the last child of a given element | |
Add toolbox link (deprecated) | Add a link to the toolbox (on the left) | |
Add tab (deprecated) | Add a tab to the page bar | |
Add LI menu | Allow "tabs" to be placed in drop-down menus (can be nested) | Some CSS customisations |
Get Page Name (deprecated) | Get the title of the current page | |
Get tidy title (deprecated) | Gets the URL version of a page title | |
addLink (deprecated) | an extended (maybe improved) version of Add LI link | |
warn.js | Gives a prompt to add any template (supposed to be used for warning vandals) | |
Get user name | Gets the username corresponding to the current page | |
MD5 2.2-alpha | Calculates the RSA Data Security, Inc. MD5 Message Digest of a string. Supports UTF-8. | |
Gerbrant.gui.htmlEdit | A WYSIWYG HTML editing control. | See documentation |
Gerbrant.edit.multiReplace | Class to simplify the replacement of several different regular expressions, each with its own substitution. | See documentation |
[edit] Incomplete things
- Show recent comments
- meta:Help:User style/floating quickbar could be made into a self-contained script. Might be slower that way, though. — Omegatron 21:29, 4 February 2006 (UTC)
- Not necessarily; you could simply put the scrollbars on the content area instead of on the whole window. The real problem is that often you have to scroll down to see the rest of the the left pane. So it would need it's own scrollbar or a similar solution. Shinobu 13:07, 27 December 2006 (UTC)
- WikiMiniAtlas adds draggable maps with clickable wikilinks to geocoded articles. Note that this is not GoogleMaps, but home-brew javascript. --Dschwen 12:18, 16 May 2006 (UTC)