Wiktionary:User scripts
|
User scripts | |
---|---|
preferences. This page provides a list of available scripts and instructions on installing them. User scripts are written in JavaScript.
| User scripts are powerful customizations, authored by the community, that allow registered Wiktionarians to change Wiktionary's interface beyond the options available in |
How to install user scripts: (Simple method for scripts located on English Wiktionary)
| |
Automatic installer: Script Installer makes script installations fully automatic. The installer itself must first be installed manually. Afterwards, scripts can be installed with a single click. | |
| |
|
This is a portal about user scripts. The main purpose of this page is to list all of the useful userscripts that exist. Feel free to add a new userscript.
If you want to request a userscript or discuss a development-related stuff or just have an idea refer to here.
Wiktionary-specific
[edit]Viewing
[edit]- script titles[1] (source) – Beautifies entry and talk page headers by adding script classes to them. This makes them display in more appropriate fonts and sometimes fixes jumbling of right-to-left characters. Buggy.
- s to search[2] (source) – Focuses the search input on pressing 's'.
- gadgets definition[3] (source) – Beautifies MediaWiki:Gadgets-definition and adds links to the relevant code and gadget message pages.
- Custom Languages[4] (source) – Displays only the language(s) that the user is interested in. Auto collapses all languages. The user can toggle any language(s) and the script remembers. Can't be use together with TabbedLanguages.
Creation
[edit]- nymReferer[5] (source) - adds several parameters to redlinks so that after clicking it wikitext will be automatically filled with some initial text
- Tbot (greenify)[6] (source) - changes redlinks in translation tables to greenlinks enabling accelerated creation
- Add auto cat[7] (source) - On redlinked category pages, adds two links below the header that allow you to add
{{auto cat}}
and save the page, or add it and preview.
Editing
[edit]Scripts that add to or refine editors' toolsets.
- expandASADRS[8] (source) - helps you expand several headers (particularly "Alternative forms", "Synonyms", "Antonyms", "Derived terms", "Related terms", "See also").
- Edittols character names[9] (source) – adds tooltips showing the names of the non-ASCII characters in the Edittools box below the editing area
Inline
[edit]- AddAudio[10] (source) - facilitates recording and adding audio. As of yet works in Firefox only
- AjaxEdit[11] (source) - Inline editing of a section without the need to reload the whole page. Also does live previewing as you type.
- Template parameters wizard[12] (source) – Helps fill parameters of templates.
- Autocomplete[13] (source) – Offers a popup suggestions menu whenever you start typing a link or template in the main edit box.
- autocompleter[14] (source) – Tab-based, context-sensitive autocompletion of usernames, page titles, and more, directly in the edit window
Previewing
[edit]- ajaxPreview[15] (source) – Allows editing preview and changes without page reloading.
- An alternative is to turn on "Use live preview" option in Preferences, but it loads whole HTML so no performance gain is achieved. Also while previewing a page with Use live preview option, it won't show show/hide buttons in tables.
- UniversalTransclusionPreviews[16] (source) – Preview transclusions from any namespace. No longer works.
- templatePreview[17] (source) – Saves the name of the last page that you previewed using the "Preview page with this template" feature. Requires localStorage; sends an error message to the console if localStorage is not available in your browser.
Cleanup
[edit]- Minor edits[18] (source) – Cleanup various problems with markup, headlines, templates. Similar to Wikipedia's AutoEd[19] (source).
- Strip it down. We only need subset of it.
- AutoWikiBrowser script[20] (source) - Script with similar functionality to the downloadable AutoWikiBrowser, but loaded within the web browser.
Other
[edit]- history[21] (source) - Remembers visited entries. Language-learners can use it as a flashcard system.
- search lang[22] (source) – Search Wiktionary languages from the toolbox in the sidebar.
- ledokol[23] (source) – 1) Language title headers are supplied with language codes and links to language description, 2) Language-marked words (
{{m}}
,{{l}}
) can display tooltip with link to references if hovered, 3) Language bibliography page (Appendix:Church Slavonic bibliography) can replace marked queries (orange color) by known word (hash in address or search input at screen bottom). Language codes are stored in browser local storage.See also:
-- 2004: List of languages
-- 2008: MediaWiki:Gadget-langcode2name.js
-- 2011: List of languages
-- 2013: Module:languages
-- 2014: Wiktionary:List of languages, csv format
-- 2014: Module:languages/JSON, Grease pit/2014/August, User:CodeCat/language lookup.js, Thread:User_talk:CodeCat/User:CodeCat/lookup_language
-- 2017: Module:languages/documentation, Module:languages/canonical names, Module:languages/code to canonical name, Template:language data search
-- 2017: Module:languages/javascript-interface, MediaWiki:Gadget-LanguageUtils.js, MediaWiki:Gadget-StorageUtils.js
-- 2018: Module:languages/print
-- 2019: User:Erutuon/scripts/searchLang.js, User:Erutuon/scripts/LanguageSearcher.js - TranslationAdder-InputFiller[24] (source) – A tool that fills the TranslationAdder with some of the already translated words from other languages onmouseover. The languages can be customized easily.
- FilterTranslations[25] (source) – Filter list of languages to hide clutter and long listings thus preventing that TranslationAdder-InputFiller jumps when hovering over a translation. The languages can be customized easily.
Diffs
[edit]- inlineDiff[26] (source) – Adds buttons to each line on the Recent Changes screen, the watchlist, the contributions screen, and article history screens, allowing one to load (and show/hide after loading) an individual diff without moving to another page and view multiple diffs at once.
- NOTE: does not seem to be compatible with AJAX watchlist. For a script that solves this problem, see User:Sunrise/Scripts/AjaxInlineDiffs.
- IDEA: integrate with
{{diff}}
- WhoDidThat?[27] (source) - Searches the last revision that did not include the selected text, thus shows the edit that introduced some text
User pages
[edit]- userinfo (source) - Shows user groups, edit count, and time registered.
Listings
[edit]Watchlist
[edit]- SkipToPost[28] (source) – Makes links from 'User contributions' and 'Watchlist' pages that are posts in one of the discussion pages (GP, TR, etc.) go directly to the actual post (does have some limitations though)
- catwatch[29] (source) – Shows the addition of pages to specified categories on your watchlist.
- customWatchlists[30] (source) – Create and manage your own custom watchlists.
- Smart Watchlist[31] (source) – Watchlist customization and organization.
- Watchlist Links[32] (source) – Adds some useful links to your Watchlist.
- RemoveMarkAll[33] (source) – Completely disables the recent Watchlist and History page changes that highlight updates to pages since your last visit.
- Watchlist mark[34] (source) – Bolds watched pages in Category and "User Contributions" listings. Also adds a "Show watchlist controls" link to enable watching and unwatching directly from these listings.
- Hollis[35] (source) – show a "since last seen" link which gives you the diff of the page since you have last looked at it.
- unwatch[36] (source) - adds unwatch button between "diff" and "hist"
- Watchlist Script Tagging[37] (source) - Adds nicer fonts to non-Latin-script links in Watchlist, Recent changes, and Related changes by detecting the script and adding script classes.
History
[edit]- DynaThank – Hides "thank" links on History pages until you choose to display them.
- Remove thanks[38] (source) – Removes all "thank" links from History pages.
- highlight me[39] (source) - highlights one's username in the history page.
Categories
[edit]- Clean up Reconstructed categories[40] (source) – Replaces
Reconstructed:language name/
with an asterisk in category pages containing reconstructed terms (such as Category:Proto-Indo-European nouns), making the list much easier to read.
What links here
[edit]- What links here filter[41] (source) – Adds an additional filter on What Links Here pages allowing you to, in effect, exclude pages transcluding given template.
- NOTE: very very slow.
Contribution
[edit]- Hide Top Contribs[42] (source) – Shows only noncurrent pages
- NOTE: does not work with MediaWiki:Gadget-vectorTabs.js.
Recent changes
[edit]- GlobalRecentChanges[43] (source) - Allows you to monitor recent changes across various wikis (*.wikimedia, *.wikipedia, *.wiktionary).
Wanted categories
[edit]- Hide unwanted categories[44] (source) – Hides categories in Special:WantedCategories that have been crossed out (which indicates that they have either been created or no longer have any pages in them).
Other
[edit]- expandabledotjs[45] (source) - using this and the template
{{User:Dixtosa/expandable}}
now it is supereasy to create expandable lists. The template also has prefix and suffix parameters. see it for details.
Meta-scripts
[edit]- ScriptInstaller[46] (source) – An automated installer for user scripts.
- userscriptInterwikiLink[48] (source) – Shows the line of code that can be inserted into common.js (supports interwiki links)
For creators
[edit]Snippets
[edit]The template Template:navbox does not use the parameter(s): groupstyle=background-color: #DFEFFF; listclass=vlist liststyle=background-color: #E8F3FF; text-align:left; name=Snippets navbar=plain style=border: 2px ridge #CAE1FF; titlestyle=background-color: #BADFEB;Please see Module:checkparams for help with this warning. Snippets This list is transcluded from Wiktionary:User scripts/Snippets. Here are the list of snippets that are proof of concepts. They are supposed to be useful for creators.
Get wikitext[edit]
function get_wikitext(pageTitle) {
var wikitext = "";
$.ajax({
url: mw.util.wikiScript( 'index' ),
data: {
action: 'raw',
title: pageTitle
},
type: 'GET',
success: function( result ) {
wikitext = result;
},
error: function( xhr ) {
alert( 'Error.\nRequest failed.' );
},
async: false
});
return wikitext;
}
Editing page[edit]function addNewSection( pageTitle, summary, content, editToken ) {
$.ajax({
url: mw.util.wikiScript( 'api' ),
data: {
format: 'json',
action: 'edit',
title: pageTitle,
section: 'new',
summary: summary,
text: content,
token: editToken
},
dataType: 'json',
type: 'POST',
success: function( data ) {
if ( data && data.edit && data.edit.result == 'Success' ) {
window.location.reload(); // reload page if edit was successful
} else if ( data && data.error ) {
alert( 'Error: API returned error code "' data.error.code '": ' data.error.info );
} else {
alert( 'Error: Unknown result from API.' );
}
},
error: function( xhr ) {
alert( 'Error: Request failed.' );
}
});
}
Current
LangName → LangCode[edit]new LanguageUtilsAsync().GetWiktionaryCodeByCanonicalName("Georgian").then(function(langcode){
//do something with langcode
});
LangCode → Canonical name[edit]new LanguageUtilsAsync().GetCanonicalNameByWiktionaryCode("ka").then(function(langname){
//do something with langname. Here it is "Georgian"
});
|
For more take a look at here.
Libraries
[edit]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.
Documentation | Summary |
---|---|
User:Dixtosa/XMLize.js | (de)XMLization of wikitext. Good for wikitext processing. |
morebits.js | A collection of wiki-related functions (such as editing via the API and displaying Twinkle-style windows), maintained as part of Twinkle (but usable separately) |
|
See also
[edit]Install code
[edit]- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Erutuon/scripts/scriptTitles.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Swalladge/scripts/sToSearch.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Erutuon/scripts/gadgets-definition.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Betty/custom_languages.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/nymReferer.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Ruakh/Tbot.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Erutuon/scripts/addAutoCat.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/expandASADRS.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Erutuon/scripts/Edittools-character-names.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Yair rand/AddAudio.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/AjaxEdit.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:קיפודנחש/TemplateParamWizard.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:ערן/autocomplete.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:Theopolisme/Scripts/autocompleter.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=en:w:User:Js/ajaxPreview.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=en:w:User:Equazcion/UniversalTransclusionPreviews.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Erutuon/scripts/templatePreview.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/minorEdits.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:Wikipedia:AutoEd/basic.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:Joeytje50/AWB.js/load.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/history.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Erutuon/scripts/searchLang.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Useigor/Gadget-Ledokol.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:So9q/TranslationAdder-InputFiller.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:So9q/FilterTranslations.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:Writ Keeper/Scripts/commonHistory.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/WhoDidThat.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/skipToPost.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/catwatch.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:MusikAnimal/customWatchlists.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:UncleDouggie/smart watchlist.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:Js/watchlist.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:Equazcion/RemoveMarkAll.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:קיפודנחש/watchlistMark.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:Kephir/gadgets/hollis.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/unwatch.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Erutuon/scripts/watchlistScriptTagging.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=en:w:User:Epicgenius/nothanks.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/highlightme.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Erutuon/scripts/reconstructedCategories.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:V111P/js/wlhFilters.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:Markhurd/hidetopcontrib.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=meta:User:Dentonius/scripts/GlobalRecentChanges.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Erutuon/scripts/hideUnwantedCategories.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Dixtosa/expandable.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=en:w:User:Equazcion/ScriptInstaller.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=User:Erutuon/scripts/ScriptInstaller.js}}
- ^ Copy the following code, click here, then paste:
{{subst:iusc|1=w:en:User:Dixtosa/userscriptInterwikiLink.js}}