CINXE.COM
ResourceLoader/Core modules - MediaWiki
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>ResourceLoader/Core modules - MediaWiki</title> <script>(function(){var className="client-js vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )mediawikiwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"45db54d4-7794-4c60-b687-761f6466f651","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"ResourceLoader/Core_modules","wgTitle":"ResourceLoader/Core modules","wgCurRevisionId":6860134,"wgRevisionId":6860134,"wgArticleId":52788,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Languages pages","ResourceLoader","JavaScript"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"ResourceLoader/Core_modules","wgRelevantArticleId":52788,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"mediawiki","wgCiteReferencePreviewsActive":true,"wgMediaViewerOnClick":true, "wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":50000,"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgDiscussionToolsFeaturesEnabled":{"replytool":true,"newtopictool":true,"sourcemodetoolbar":true,"topicsubscription":false,"autotopicsub":false,"visualenhancements":false,"visualenhancements_reply":false,"visualenhancements_pageframe":false},"wgDiscussionToolsFallbackEditMode":"source","wgULSPosition":"personal","wgULSisCompactLinksEnabled":true,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q115519963","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"]};RLSTATE={ "ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.pygments":"ready","ext.discussionTools.init.styles":"ready","oojs-ui-core.styles":"ready","oojs-ui.styles.indicators":"ready","mediawiki.widgets.styles":"ready","oojs-ui-core.icons":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","jquery.tablesorter.styles":"ready","jquery.makeCollapsible.styles":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.pt":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.pygments.view","site","mediawiki.page.ready","jquery.tablesorter","jquery.makeCollapsible","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.syntaxhighlight-copy","ext.urlShortener.toolbar","ext.centralauth.centralautologin", "ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.discussionTools.init","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.compactlinks","ext.uls.interface","wikibase.client.vector-2022","ext.checkUser.clientHints","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.discussionTools.init.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cjquery.makeCollapsible.styles%7Cjquery.tablesorter.styles%7Cmediawiki.widgets.styles%7Coojs-ui-core.icons%2Cstyles%7Coojs-ui.styles.indicators%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:site_name" content="MediaWiki"> <meta property="og:title" content="ResourceLoader/Core modules - MediaWiki"> <meta property="og:type" content="website"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//m.mediawiki.org/wiki/ResourceLoader/Core_modules"> <link rel="alternate" type="application/x-wiki" title="Edit" href="/w/index.php?title=ResourceLoader/Core_modules&action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/mediawiki.png"> <link rel="icon" href="/static/favicon/mediawiki.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="MediaWiki (en)"> <link rel="EditURI" type="application/rsd+xml" href="//www.mediawiki.org/w/api.php?action=rsd"> <link rel="canonical" href="https://www.mediawiki.org/wiki/ResourceLoader/Core_modules"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"> <link rel="alternate" type="application/atom+xml" title="MediaWiki Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="ext-discussiontools-replytool-enabled ext-discussiontools-newtopictool-enabled ext-discussiontools-sourcemodetoolbar-enabled skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-ResourceLoader_Core_modules rootpage-ResourceLoader skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/MediaWiki" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-mw-download" class="mw-list-item"><a href="/wiki/Download"><span>Get MediaWiki</span></a></li><li id="n-mw-extensions" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Category:Extensions"><span>Get extensions</span></a></li><li id="n-blog-text" class="mw-list-item"><a href="https://techblog.wikimedia.org/"><span>Tech blog</span></a></li><li id="n-mw-contribute" class="mw-list-item"><a href="/wiki/Special:MyLanguage/How_to_contribute"><span>Contribute</span></a></li> </ul> </div> </div> <div id="p-support" class="vector-menu mw-portlet mw-portlet-support" > <div class="vector-menu-heading"> Support </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Help:Contents" title="The place to find out"><span>User help</span></a></li><li id="n-mw-faq" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:FAQ"><span>FAQ</span></a></li><li id="n-mw-manual" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:Contents"><span>Technical manual</span></a></li><li id="n-mw-supportdesk" class="mw-list-item"><a href="/wiki/Project:Support_desk"><span>Support desk</span></a></li><li id="n-mw-communication" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Communication"><span>Communication</span></a></li> </ul> </div> </div> <div id="p-development" class="vector-menu mw-portlet mw-portlet-development" > <div class="vector-menu-heading"> Development </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mw-developerportal" class="mw-list-item"><a href="https://developer.wikimedia.org/"><span>Developer portal</span></a></li><li id="n-svn-statistics" class="mw-list-item"><a href="/wiki/Development_statistics"><span>Code statistics</span></a></li> </ul> </div> </div> <div id="p-mediawiki.org" class="vector-menu mw-portlet mw-portlet-mediawiki_org" > <div class="vector-menu-heading"> mediawiki.org </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-portal" class="mw-list-item"><a href="/wiki/Project:Help" title="About the project, what you can do, where to find things"><span>Community portal</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-mw-translate" class="mw-list-item"><a href="/wiki/Special:LanguageStats"><span>Translate content</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Load a random page [x]" accesskey="x"><span>Random page</span></a></li><li id="n-mw-discussion" class="mw-list-item"><a href="/wiki/Project:Village_Pump"><span>Village pump</span></a></li><li id="n-Sandboxlink-portlet-label" class="mw-list-item"><a href="/wiki/Project:Sandbox"><span>Sandbox</span></a></li> </ul> </div> </div> <div id="p-lang" class="vector-menu mw-portlet mw-portlet-lang" > <div class="vector-menu-heading"> In other languages </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-add wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q115519963#sitelinks-wikipedia" title="Add interlanguage links" class="wbc-editpage">Add links</a></span></div> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/MediaWiki" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/mediawikiwiki.svg" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="MediaWiki" src="/static/images/mobile/copyright/mediawikiwiki-wordmark.svg" style="width: 7.5em; height: 1.125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Search" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search MediaWiki [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search MediaWiki" aria-label="Search MediaWiki" autocapitalize="sentences" title="Search MediaWiki [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-uls" class="mw-list-item active user-links-collapsible-item"><a data-mw="interface" href="#" class="uls-trigger cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet"><span class="vector-icon mw-ui-icon-wikimedia-language mw-ui-icon-wikimedia-wikimedia-language"></span> <span>English</span></a> </li> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/?utm_source=donate&utm_medium=sidebar&utm_campaign=spontaneous&uselang=en" class=""><span>Donate</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:CreateAccount&returnto=ResourceLoader%2FCore+modules" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:UserLogin&returnto=ResourceLoader%2FCore+modules" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o" class=""><span>Log in</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="More options" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/?utm_source=donate&utm_medium=sidebar&utm_campaign=spontaneous&uselang=en"><span>Donate</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=ResourceLoader%2FCore+modules" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=ResourceLoader%2FCore+modules" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Pages for logged out editors <a href="/wiki/Help:Introduction" aria-label="Learn more about editing"><span>learn more</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Contents" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Contents</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">hide</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Beginning</div> </a> </li> <li id="toc-mediawiki" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>mediawiki</span> </div> </a> <button aria-controls="toc-mediawiki-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle mediawiki subsection</span> </button> <ul id="toc-mediawiki-sublist" class="vector-toc-list"> <li id="toc-mw.config" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.config"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.1</span> <span>mw.config</span> </div> </a> <ul id="toc-mw.config-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.hook" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.hook"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.2</span> <span>mw.hook</span> </div> </a> <ul id="toc-mw.hook-sublist" class="vector-toc-list"> <li id="toc-hook_execution_order" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#hook_execution_order"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.2.1</span> <span>hook execution order</span> </div> </a> <ul id="toc-hook_execution_order-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-mw.html" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.html"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.3</span> <span>mw.html</span> </div> </a> <ul id="toc-mw.html-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.inspect" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.inspect"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.4</span> <span>mw.inspect</span> </div> </a> <ul id="toc-mw.inspect-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.log" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.log"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.5</span> <span>mw.log</span> </div> </a> <ul id="toc-mw.log-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.message" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.message"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.6</span> <span>mw.message</span> </div> </a> <ul id="toc-mw.message-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.now" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.now"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.7</span> <span>mw.now</span> </div> </a> <ul id="toc-mw.now-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.track" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.track"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.8</span> <span>mw.track</span> </div> </a> <ul id="toc-mw.track-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.notify" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.notify"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.9</span> <span>mw.notify</span> </div> </a> <ul id="toc-mw.notify-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-mw.loader" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mw.loader"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>mw.loader</span> </div> </a> <button aria-controls="toc-mw.loader-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle mw.loader subsection</span> </button> <ul id="toc-mw.loader-sublist" class="vector-toc-list"> <li id="toc-mw.loader.load" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.loader.load"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.1</span> <span>mw.loader.load</span> </div> </a> <ul id="toc-mw.loader.load-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.loader.using" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.loader.using"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2</span> <span>mw.loader.using</span> </div> </a> <ul id="toc-mw.loader.using-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.loader.getScript" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.loader.getScript"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.3</span> <span>mw.loader.getScript</span> </div> </a> <ul id="toc-mw.loader.getScript-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-mediawiki.user" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.user"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>mediawiki.user</span> </div> </a> <button aria-controls="toc-mediawiki.user-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle mediawiki.user subsection</span> </button> <ul id="toc-mediawiki.user-sublist" class="vector-toc-list"> <li id="toc-mw.user.clientPrefs" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.user.clientPrefs"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1</span> <span>mw.user.clientPrefs</span> </div> </a> <ul id="toc-mw.user.clientPrefs-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-user.options" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#user.options"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>user.options</span> </div> </a> <button aria-controls="toc-user.options-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle user.options subsection</span> </button> <ul id="toc-user.options-sublist" class="vector-toc-list"> <li id="toc-mw.user.options" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.user.options"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.1</span> <span>mw.user.options</span> </div> </a> <ul id="toc-mw.user.options-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.user.tokens" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#mw.user.tokens"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.2</span> <span>mw.user.tokens</span> </div> </a> <ul id="toc-mw.user.tokens-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-mediawiki.api" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.api"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>mediawiki.api</span> </div> </a> <ul id="toc-mediawiki.api-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.cookie" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.cookie"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>mediawiki.cookie</span> </div> </a> <ul id="toc-mediawiki.cookie-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.errorLogger" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.errorLogger"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>mediawiki.errorLogger</span> </div> </a> <ul id="toc-mediawiki.errorLogger-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.feedback" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.feedback"> <div class="vector-toc-text"> <span class="vector-toc-numb">8</span> <span>mediawiki.feedback</span> </div> </a> <ul id="toc-mediawiki.feedback-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.ForeignApi" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mw.ForeignApi"> <div class="vector-toc-text"> <span class="vector-toc-numb">9</span> <span>mw.ForeignApi</span> </div> </a> <ul id="toc-mw.ForeignApi-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.ForeignRest" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mw.ForeignRest"> <div class="vector-toc-text"> <span class="vector-toc-numb">10</span> <span>mw.ForeignRest</span> </div> </a> <ul id="toc-mw.ForeignRest-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mw.ForeignUpload" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mw.ForeignUpload"> <div class="vector-toc-text"> <span class="vector-toc-numb">11</span> <span>mw.ForeignUpload</span> </div> </a> <ul id="toc-mw.ForeignUpload-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.jqueryMsg" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.jqueryMsg"> <div class="vector-toc-text"> <span class="vector-toc-numb">12</span> <span>mediawiki.jqueryMsg</span> </div> </a> <ul id="toc-mediawiki.jqueryMsg-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.router" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.router"> <div class="vector-toc-text"> <span class="vector-toc-numb">13</span> <span>mediawiki.router</span> </div> </a> <ul id="toc-mediawiki.router-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.storage" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.storage"> <div class="vector-toc-text"> <span class="vector-toc-numb">14</span> <span>mediawiki.storage</span> </div> </a> <ul id="toc-mediawiki.storage-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.ui" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.ui"> <div class="vector-toc-text"> <span class="vector-toc-numb">15</span> <span>mediawiki.ui</span> </div> </a> <ul id="toc-mediawiki.ui-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.widgets" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.widgets"> <div class="vector-toc-text"> <span class="vector-toc-numb">16</span> <span>mediawiki.widgets</span> </div> </a> <ul id="toc-mediawiki.widgets-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.util" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.util"> <div class="vector-toc-text"> <span class="vector-toc-numb">17</span> <span>mediawiki.util</span> </div> </a> <button aria-controls="toc-mediawiki.util-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle mediawiki.util subsection</span> </button> <ul id="toc-mediawiki.util-sublist" class="vector-toc-list"> <li id="toc-addCSS" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#addCSS"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.1</span> <span>addCSS</span> </div> </a> <ul id="toc-addCSS-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-addPortlet" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#addPortlet"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.2</span> <span>addPortlet</span> </div> </a> <ul id="toc-addPortlet-sublist" class="vector-toc-list"> <li id="toc-Styling_portlets" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Styling_portlets"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.2.1</span> <span>Styling portlets</span> </div> </a> <ul id="toc-Styling_portlets-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Appending_portlets_in_different_locations" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Appending_portlets_in_different_locations"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.2.2</span> <span>Appending portlets in different locations</span> </div> </a> <ul id="toc-Appending_portlets_in_different_locations-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Dropdowns_(Vector-only)" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Dropdowns_(Vector-only)"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.2.3</span> <span>Dropdowns (Vector-only)</span> </div> </a> <ul id="toc-Dropdowns_(Vector-only)-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-addPortletLink" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#addPortletLink"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.3</span> <span>addPortletLink</span> </div> </a> <ul id="toc-addPortletLink-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-hidePortlet" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#hidePortlet"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.4</span> <span>hidePortlet</span> </div> </a> <ul id="toc-hidePortlet-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-addSubtitle" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#addSubtitle"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.5</span> <span>addSubtitle</span> </div> </a> <ul id="toc-addSubtitle-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-clearSubtitle" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#clearSubtitle"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.6</span> <span>clearSubtitle</span> </div> </a> <ul id="toc-clearSubtitle-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-$content" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#$content"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.7</span> <span>$content</span> </div> </a> <ul id="toc-$content-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-getParamValue" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#getParamValue"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.8</span> <span>getParamValue</span> </div> </a> <ul id="toc-getParamValue-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-isIPv4Address" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#isIPv4Address"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.9</span> <span>isIPv4Address</span> </div> </a> <ul id="toc-isIPv4Address-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-messageBox" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#messageBox"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.10</span> <span>messageBox</span> </div> </a> <ul id="toc-messageBox-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-isIPv6Address" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#isIPv6Address"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.11</span> <span>isIPv6Address</span> </div> </a> <ul id="toc-isIPv6Address-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-rawurlencode" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#rawurlencode"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.12</span> <span>rawurlencode</span> </div> </a> <ul id="toc-rawurlencode-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-wikiScript" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#wikiScript"> <div class="vector-toc-text"> <span class="vector-toc-numb">17.13</span> <span>wikiScript</span> </div> </a> <ul id="toc-wikiScript-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-mediawiki.RegExp" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.RegExp"> <div class="vector-toc-text"> <span class="vector-toc-numb">18</span> <span>mediawiki.RegExp</span> </div> </a> <ul id="toc-mediawiki.RegExp-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.Title" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.Title"> <div class="vector-toc-text"> <span class="vector-toc-numb">19</span> <span>mediawiki.Title</span> </div> </a> <ul id="toc-mediawiki.Title-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-mediawiki.Uri" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#mediawiki.Uri"> <div class="vector-toc-text"> <span class="vector-toc-numb">20</span> <span>mediawiki.Uri</span> </div> </a> <ul id="toc-mediawiki.Uri-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-moment" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#moment"> <div class="vector-toc-text"> <span class="vector-toc-numb">21</span> <span>moment</span> </div> </a> <ul id="toc-moment-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-oojs" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#oojs"> <div class="vector-toc-text"> <span class="vector-toc-numb">22</span> <span>oojs</span> </div> </a> <ul id="toc-oojs-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-oojs-ui" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#oojs-ui"> <div class="vector-toc-text"> <span class="vector-toc-numb">23</span> <span>oojs-ui</span> </div> </a> <ul id="toc-oojs-ui-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery"> <div class="vector-toc-text"> <span class="vector-toc-numb">24</span> <span>jquery</span> </div> </a> <ul id="toc-jquery-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.chosen" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.chosen"> <div class="vector-toc-text"> <span class="vector-toc-numb">25</span> <span>jquery.chosen</span> </div> </a> <ul id="toc-jquery.chosen-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.client" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.client"> <div class="vector-toc-text"> <span class="vector-toc-numb">26</span> <span>jquery.client</span> </div> </a> <button aria-controls="toc-jquery.client-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle jquery.client subsection</span> </button> <ul id="toc-jquery.client-sublist" class="vector-toc-list"> <li id="toc-jQuery.client.profile" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#jQuery.client.profile"> <div class="vector-toc-text"> <span class="vector-toc-numb">26.1</span> <span>jQuery.client.profile</span> </div> </a> <ul id="toc-jQuery.client.profile-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-jquery.color" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.color"> <div class="vector-toc-text"> <span class="vector-toc-numb">27</span> <span>jquery.color</span> </div> </a> <ul id="toc-jquery.color-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.cookie" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.cookie"> <div class="vector-toc-text"> <span class="vector-toc-numb">28</span> <span>jquery.cookie</span> </div> </a> <ul id="toc-jquery.cookie-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.i18n" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.i18n"> <div class="vector-toc-text"> <span class="vector-toc-numb">29</span> <span>jquery.i18n</span> </div> </a> <ul id="toc-jquery.i18n-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.makeCollapsible" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.makeCollapsible"> <div class="vector-toc-text"> <span class="vector-toc-numb">30</span> <span>jquery.makeCollapsible</span> </div> </a> <ul id="toc-jquery.makeCollapsible-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.suggestions" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.suggestions"> <div class="vector-toc-text"> <span class="vector-toc-numb">31</span> <span>jquery.suggestions</span> </div> </a> <ul id="toc-jquery.suggestions-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.spinner" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.spinner"> <div class="vector-toc-text"> <span class="vector-toc-numb">32</span> <span>jquery.spinner</span> </div> </a> <ul id="toc-jquery.spinner-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.tabIndex" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.tabIndex"> <div class="vector-toc-text"> <span class="vector-toc-numb">33</span> <span>jquery.tabIndex</span> </div> </a> <ul id="toc-jquery.tabIndex-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.tablesorter" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.tablesorter"> <div class="vector-toc-text"> <span class="vector-toc-numb">34</span> <span>jquery.tablesorter</span> </div> </a> <ul id="toc-jquery.tablesorter-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.textSelection" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.textSelection"> <div class="vector-toc-text"> <span class="vector-toc-numb">35</span> <span>jquery.textSelection</span> </div> </a> <ul id="toc-jquery.textSelection-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.tipsy" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.tipsy"> <div class="vector-toc-text"> <span class="vector-toc-numb">36</span> <span>jquery.tipsy</span> </div> </a> <ul id="toc-jquery.tipsy-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-jquery.ui" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#jquery.ui"> <div class="vector-toc-text"> <span class="vector-toc-numb">37</span> <span>jquery.ui</span> </div> </a> <ul id="toc-jquery.ui-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-site" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#site"> <div class="vector-toc-text"> <span class="vector-toc-numb">38</span> <span>site</span> </div> </a> <ul id="toc-site-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-user" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#user"> <div class="vector-toc-text"> <span class="vector-toc-numb">39</span> <span>user</span> </div> </a> <ul id="toc-user-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-See_also" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#See_also"> <div class="vector-toc-text"> <span class="vector-toc-numb">40</span> <span>See also</span> </div> </a> <ul id="toc-See_also-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">ResourceLoader/Core modules</span></h1> <div class="mw-indicators"> <div id="mw-indicator-tpl-shortcut" class="mw-indicator"><div class="mw-parser-output"><div class="mw-parser-output"><style data-mw-deduplicate="TemplateStyles:r6605561">.mw-parser-output .tpl-badge{background-color:var(--background-color-progressive-subtle,#eaf3ff);color:var(--color-base,#202122);border-radius:10px;display:inline-block;font-size:90%;padding:5px 8px}</style><div class="tpl-badge">shortcuts: <a href="/wiki/RL/CM" class="mw-redirect" title="RL/CM"><b>RL/CM</b></a>  <a href="/wiki/RL/DM" class="mw-redirect" title="RL/DM"><b>RL/DM</b></a></div></div></div></div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/ResourceLoader/Core_modules" title="View the content page [c]" accesskey="c"><span>Page</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Talk:ResourceLoader/Core_modules" rel="discussion" title="Discussion about the content page [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/ResourceLoader/Core_modules"><span>Read</span></a></li><li id="ca-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit" title="Edit the source code of this page [e]" accesskey="e"><span>Edit source</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=ResourceLoader/Core_modules&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Tools</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options" > <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/ResourceLoader/Core_modules"><span>Read</span></a></li><li id="ca-more-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit" title="Edit the source code of this page [e]" accesskey="e"><span>Edit source</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=ResourceLoader/Core_modules&action=history"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/ResourceLoader/Core_modules" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/ResourceLoader/Core_modules" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=ResourceLoader/Core_modules&oldid=6860134" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=ResourceLoader/Core_modules&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Special:CiteThisPage&page=ResourceLoader%2FCore_modules&id=6860134&wpFormIdentifier=titleform" title="Information on how to cite this page"><span>Cite this page</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FResourceLoader%2FCore_modules"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FResourceLoader%2FCore_modules"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Print/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=Special:Book&bookcmd=book_creator&referer=ResourceLoader%2FCore+modules"><span>Create a book</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=ResourceLoader%2FCore_modules&action=show-download-screen"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=ResourceLoader/Core_modules&printable=yes" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q115519963" title="Link to connected data repository item [g]" accesskey="g"><span>Wikidata item</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Appearance</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div id="siteSub" class="noprint">From mediawiki.org</div> </div> <div id="contentSub"><div id="mw-content-subtitle"><div class="subpages">< <bdi dir="ltr"><a href="/wiki/ResourceLoader" title="ResourceLoader">ResourceLoader</a></bdi></div></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><style data-mw-deduplicate="TemplateStyles:r6651103">.mw-parser-output .nmbox{background:#f8f9fa;border:1px solid #AAA;box-sizing:border-box;margin:2px 0;padding:0}.mw-parser-output .nmbox *{box-sizing:border-box}.mw-parser-output .nmbox-header{background:#eaecf0;padding:4px 0.5em;font-weight:bold;text-align:center;white-space:nowrap}.mw-parser-output .nmbox .mbox-image{display:inline-block;padding-right:1em}.mw-parser-output .nmbox-text{border-top:1px solid #AAA;width:100%;padding:4px 0.5em}@media screen and (min-width:768px){.mw-parser-output .nmbox-header{display:table-cell;border-right:1px solid #AAA;width:1%}.mw-parser-output .nmbox-text{border-top:none;display:table-cell}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .nmbox-header,html.skin-theme-clientpref-night .mw-parser-output .nmbox{background:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .nmbox-header,html.skin-theme-clientpref-os .mw-parser-output .nmbox{background:transparent;color:inherit}}</style> <div class="nmbox noprint mw-content-ltr"><div class="nmbox-header"><a href="/wiki/Special:MyLanguage/Project:Language_policy" title="Special:MyLanguage/Project:Language policy">Languages:</a><span style="display:none"><a href="/wiki/Project:Language_policy" title="Project:Language policy"> </a></span> </div> <div class="nmbox-text mbox-text"><b><a class="mw-selflink selflink">English</a></b> • <bdi lang="ja"><span class="plainlinks"><a class="external text" href="https://www.mediawiki.org/wiki/ResourceLoader/Core_modules/ja">日本語</a></span></bdi><span class="autonym"></span><span class="autonym"></span> • <bdi lang="zh"><span class="plainlinks"><a class="external text" href="https://www.mediawiki.org/wiki/ResourceLoader/Core_modules/zh">中文</a></span></bdi></div> </div><style data-mw-deduplicate="TemplateStyles:r6605224">.mw-parser-output .tpl-sidebar{background-color:var(--background-color-interactive-subtle,#f8f9fa);border:1px solid var(--border-color-divider,#a2a9b1);color:var(--color-base,#202122);width:22em;padding:.2em;text-align:center;line-height:1.4em;font-size:88%}.mw-parser-output .tpl-sidebar-pagedir-ltr,.mw-parser-output .tpl-sidebar.tpl-sidebar-floatright{float:right;clear:right;margin:.5em 0 1em 1em}.mw-parser-output .tpl-sidebar-pagedir-rtl,.mw-parser-output .tpl-sidebar.tpl-sidebar-floatleft{float:left;clear:left;margin:.5em 1em 1em 0}.mw-parser-output .tpl-sidebar.tpl-sidebar-floatnone{float:none;clear:both;margin:.5em 0 1em 1em}.mw-parser-output .tpl-sidebar>caption{padding-bottom:.2em;font-size:125%;line-height:1.2em;font-weight:bold}.mw-parser-output .tpl-sidebar>tbody>tr>th,.mw-parser-output .tpl-sidebar>tbody>tr>td{padding:0}.mw-parser-output .tpl-sidebar .tpl-sidebar-topimage>td{padding:.4em 0}.mw-parser-output .tpl-sidebar-imagecaption{padding-top:.2em;line-height:1.2em}.mw-parser-output .tpl-sidebar .tpl-sidebar-pretitle>td{padding-top:.4em;line-height:1.2em}.mw-parser-output .tpl-sidebar .tpl-sidebar-topimage+.tpl-sidebar-pretitle>td{padding-top:.2em}.mw-parser-output .tpl-sidebar .tpl-sidebar-title>th{padding:.2em .4em .2em;font-size:145%;line-height:1.2em}.mw-parser-output .tpl-sidebar .tpl-sidebar-pretitle+.tpl-sidebar-title>th{padding-top:0}.mw-parser-output .tpl-sidebar .tpl-sidebar-image>td{padding:.2em 0 .4em}.mw-parser-output .tpl-sidebar .tpl-sidebar-abovebelow>td{padding:.3em .4em;font-weight:bold}.mw-parser-output .tpl-sidebar .tpl-sidebar-heading>th{padding-top:.2em}.mw-parser-output .tpl-sidebar .tpl-sidebar-image~.tpl-sidebar-heading-first>th{padding-top:.4em}.mw-parser-output .tpl-sidebar .tpl-sidebar-content>td{padding-bottom:.2em}.mw-parser-output .tpl-sidebar :not(.tpl-sidebar-heading)+.tpl-sidebar-content-first>td{padding-top:.2em}.mw-parser-output .tpl-sidebar-navbar>td{font-size:115%}.mw-parser-output .tpl-sidebar-pagedir-ltr .tpl-sidebar-navbar>td{text-align:right}.mw-parser-output .tpl-sidebar-pagedir-rtl .tpl-sidebar-navbar>td{text-align:left}</style><table class="vertical-navbox tpl-sidebar tpl-sidebar-pagedir-ltr nowraplinks" role="navigation" style="width:22em; border-spacing: 0.4em 0; margin-top: 0.5em; width: auto; text-align: left; font-size: 100%;"><tbody><tr class="tpl-sidebar-title"> <th class="" style="text-align: center; font-size: 100%;"><a href="/wiki/Special:MyLanguage/ResourceLoader" title="Special:MyLanguage/ResourceLoader">ResourceLoader</a></th> </tr><tr class="tpl-sidebar-heading tpl-sidebar-heading-first"> <th class="" style="font-weight: normal;;">Reference</th> </tr><tr class="tpl-sidebar-content tpl-sidebar-content-first"> <td class="" style=";"> <ul><li><a href="/wiki/Special:MyLanguage/ResourceLoader/Architecture" title="Special:MyLanguage/ResourceLoader/Architecture">Architecture</a><span style="display:none"><a href="/wiki/ResourceLoader/Architecture" title="ResourceLoader/Architecture"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/ResourceLoader/Vocabulary" title="Special:MyLanguage/ResourceLoader/Vocabulary">Vocabulary</a><span style="display:none"><a href="/wiki/ResourceLoader/Vocabulary" title="ResourceLoader/Vocabulary"> </a></span></li> <li><b><a href="/wiki/Special:MyLanguage/ResourceLoader/Core_modules" title="Special:MyLanguage/ResourceLoader/Core modules">Core modules</a></b><span style="display:none"><a class="mw-selflink selflink"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/ResourceLoader/Presentations" title="Special:MyLanguage/ResourceLoader/Presentations">Tech talks (videos, slides)</a><span style="display:none"><a href="/wiki/ResourceLoader/Presentations" title="ResourceLoader/Presentations"> </a></span></li></ul></td> </tr><tr class="tpl-sidebar-heading"> <th class="" style="font-weight: normal;;">Tutorials</th> </tr><tr class="tpl-sidebar-content"> <td class="" style=";"> <ul><li><a href="/wiki/Special:MyLanguage/ResourceLoader/Developing_with_ResourceLoader" title="Special:MyLanguage/ResourceLoader/Developing with ResourceLoader">Getting started</a><span style="display:none"><a href="/wiki/ResourceLoader/Developing_with_ResourceLoader" title="ResourceLoader/Developing with ResourceLoader"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/ResourceLoader/Package_files" title="Special:MyLanguage/ResourceLoader/Package files">Using package files</a><span style="display:none"><a href="/wiki/ResourceLoader/Package_files" title="ResourceLoader/Package files"> </a></span></li> <li><a href="/wiki/ResourceLoader/Foreign_resources" title="ResourceLoader/Foreign resources">Foreign resources</a></li> <li><a href="/wiki/Special:MyLanguage/ResourceLoader/ES6" title="Special:MyLanguage/ResourceLoader/ES6">Using ES6</a><span style="display:none"><a href="/wiki/ResourceLoader/ES6" title="ResourceLoader/ES6"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/ResourceLoader/Migration_guide_(users)" title="Special:MyLanguage/ResourceLoader/Migration guide (users)">Migrating user scripts</a><span style="display:none"><a href="/wiki/ResourceLoader/Migration_guide_(users)" title="ResourceLoader/Migration guide (users)"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/ResourceLoader/Migration_guide_for_extension_developers" title="Special:MyLanguage/ResourceLoader/Migration guide for extension developers">Migrating extensions</a><span style="display:none"><a href="/wiki/ResourceLoader/Migration_guide_for_extension_developers" title="ResourceLoader/Migration guide for extension developers"> </a></span></li></ul></td> </tr><tr class="tpl-sidebar-navbar"> <td style=""><style data-mw-deduplicate="TemplateStyles:r4692751">.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar ul{display:inline;white-space:nowrap}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em;width:6em}</style><span class="noprint plainlinks navbar" style=""><small><span style="white-space:nowrap;word-spacing:-.12em;"><a href="/wiki/Template:ResourceLoader_navigation" title="Template:ResourceLoader navigation"><span style="" title="View this template">v</span></a><span style=""> <b>·</b> </span><a class="external text" href="https://www.mediawiki.org/wiki/Template_talk:ResourceLoader_navigation"><span style="" title="Discuss this template">d</span></a><span style=""> <b>·</b> </span><a class="external text" href="https://www.mediawiki.org/w/index.php?title=Template:ResourceLoader_navigation&action=edit"><span style="" title="Edit this template">e</span></a></span></small></span></td> </tr> </tbody></table> <style data-mw-deduplicate="TemplateStyles:r6353907">.mw-parser-output .hatnote{font-style:italic;padding-bottom:0.4em;margin-bottom:0.4em;border-bottom:1px solid #ccc}.mw-parser-output .hatnote.no-border{border-bottom:none}</style><div role="note" class="hatnote">See also <a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/">JS documentation on doc.wikimedia.org</a></div> <style data-mw-deduplicate="TemplateStyles:r4577480">.mw-parser-output .toclimit-2 .toclevel-1 ul,.mw-parser-output .toclimit-3 .toclevel-2 ul,.mw-parser-output .toclimit-4 .toclevel-3 ul,.mw-parser-output .toclimit-5 .toclevel-4 ul,.mw-parser-output .toclimit-6 .toclevel-5 ul,.mw-parser-output .toclimit-7 .toclevel-6 ul{display:none}</style><div style="clear: right; margin-bottom: .5em; float: right; margin-left:2em; width: auto;" class="toclimit-2"><meta property="mw:PageProp/toc"/></div> <p>This page lists <b>modules that ship with MediaWiki core</b> by default. It reflects the current development version of MediaWiki and may vary from the latest stable release. It does not claim to be as comprehensive and up to date as <a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/">Wikimedia's JS documentation on doc.wikimedia.org</a>, but offers much additional guidance. For older modules, see the <a href="/wiki/ResourceLoader/Migration_guide_(users)" title="ResourceLoader/Migration guide (users)">Migration guide</a>. </p><p><span class="anchor" id="base-env"></span> The modules <code>jquery</code> and <code>mediawiki</code> together form the base environment ("startup") and are always present. They must not be declared as dependencies. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki" data-mw-thread-id="h-mediawiki"><span data-mw-comment-start="" id="h-mediawiki"></span>mediawiki<span data-mw-comment-end="h-mediawiki"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=1" title="Edit section's source code: mediawiki"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki","replies":["h-mw.config-mediawiki","h-mw.hook-mediawiki","h-mw.html-mediawiki","h-mw.inspect-mediawiki","h-mw.log-mediawiki","h-mw.message-mediawiki","h-mw.now-mediawiki","h-mw.track-mediawiki","h-mw.notify-mediawiki"]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.html">JS Documentation</a></span></li></ul> <p>This is the MediaWiki base module. It initialises the <code>mw</code> global object. </p><p><span class="anchor" id="mediaWiki.config"></span> </p> <div class="mw-heading mw-heading3"><h3 id="mw.config" data-mw-thread-id="h-mw.config-mediawiki"><span data-mw-comment-start="" id="h-mw.config-mediawiki"></span>mw.config<span data-mw-comment-end="h-mw.config-mediawiki"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=2" title="Edit section's source code: mw.config"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.html#.config">JS Documentation</a></span></li></ul> <p>For a list of stable config keys to read from <code>mw.config</code>, see <a href="/wiki/Manual:Interface/JavaScript#mw.config" title="Manual:Interface/JavaScript">Manual:Interface/JavaScript</a>. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// Check existence</span> <span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">exists</span><span class="p">(</span><span class="w"> </span><span class="s1">'wgGlobalGroups'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// CentralNotice has registered this variable...</span> <span class="p">}</span> <span class="c1">// Or just a plain access for comparison.</span> <span class="c1">// (No need to check exists first, it falls back to null).</span> <span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="w"> </span><span class="s1">'wgPageName'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">===</span><span class="w"> </span><span class="s1">'ResourceLoader'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// Do stuff...</span> <span class="p">}</span> <span class="c1">// Access multiple ones for use throughout a larger code base.</span> <span class="c1">// Returns an array containing the variables requested.</span> <span class="kd">var</span><span class="w"> </span><span class="nx">conf</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">get</span><span class="p">([</span> <span class="w"> </span><span class="s1">'wgServer'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'wgPageName'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'wgCanonicalSpecialPageName'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'wgUserLanguage'</span> <span class="p">]);</span> <span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">conf</span><span class="p">.</span><span class="nx">wgCanonicalSpecialPageName</span><span class="w"> </span><span class="o">===</span><span class="w"> </span><span class="s1">'Blankpage'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// Do stuff...</span> <span class="p">}</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="mw.hook" data-mw-thread-id="h-mw.hook-mediawiki"><span data-mw-comment-start="" id="h-mw.hook-mediawiki"></span>mw.hook<span data-mw-comment-end="h-mw.hook-mediawiki"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=3" title="Edit section's source code: mw.hook"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6353907"><div role="note" class="hatnote mw-tpl-seealso">See also: <a href="/wiki/Gadget_kitchen#Running_code_on_page_load" title="Gadget kitchen">Gadget kitchen#Running code on page load</a></div> <style data-mw-deduplicate="TemplateStyles:r4199130">.mw-parser-output .mw-version{border:1px solid #72777d;font-size:80%;line-height:1.2;border-collapse:collapse}.mw-parser-output .mw-version-ltr{float:right;margin:0 0 .5em .5em;text-align:right}.mw-parser-output .mw-version-rtl{float:left;margin:0 .5em .5em 0;text-align:left}.mw-parser-output .mw-version td{padding:.1em .3em}.mw-parser-output .mw-version-versionbox{border:5px solid #00af89;text-align:center}.mw-parser-output .mw-version-versionnumber{font-weight:bold;font-size:180%}.mw-parser-output .mw-version-version .mw-version-versionbox{border-color:#c8ccd1}.mw-parser-output .mw-version.mw-version-version2 .mw-version-versionbox{border-top-color:#c8ccd1;border-right-color:#c8ccd1;border-left-color:#c8ccd1}.mw-parser-output .mw-version-version-unsupported .mw-version-versionbox{border-color:#d33}.mw-parser-output .mw-version.mw-version-version2-unsupported .mw-version-versionbox{border-top-color:#d33;border-right-color:#d33;border-left-color:#d33}.mw-parser-output .mw-version-version-legacy .mw-version-versionbox{border-color:#f93}.mw-parser-output .mw-version.mw-version-version2-legacy .mw-version-versionbox{border-top-color:#f93;border-right-color:#f93;border-left-color:#f93}.mw-parser-output .mw-version-version-stable .mw-version-versionbox,.mw-parser-output .mw-version.mw-version.mw-version-and-later .mw-version-versionbox{border-color:#00af89}.mw-parser-output .mw-version.mw-version-version2-stable .mw-version-versionbox{border-top-color:#00af89;border-right-color:#00af89;border-left-color:#00af89}.mw-parser-output .mw-version-version-future .mw-version-versionbox{border-color:#8080c0}.mw-parser-output .mw-version.mw-version-version2-future .mw-version-versionbox{border-top-color:#8080c0;border-right-color:#8080c0;border-left-color:#8080c0}.mw-parser-output .mw-version-version-alpha .mw-version-versionbox{border-style:dotted}</style> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.22</div><small><span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/56762.html">r56762</a></span></small></td> </tr></tbody></table> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/Hooks.html">JS Documentation</a></span></li></ul> <p>A framework for registering and firing events in JavaScript (as opposed to doing everything on document ready). For example, the snippet below provides a message once the categories on a page load: </p> <div class="mw-highlight mw-highlight-lang-js mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">mw</span><span class="p">.</span><span class="nx">hook</span><span class="p">(</span><span class="w"> </span><span class="s1">'wikipage.categories'</span><span class="w"> </span><span class="p">).</span><span class="nx">add</span><span class="p">(</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">$content</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="w"> </span><span class="s1">'wgCategories'</span><span class="w"> </span><span class="p">).</span><span class="nx">length</span><span class="w"> </span><span class="o">===</span><span class="w"> </span><span class="mf">0</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">alert</span><span class="p">(</span><span class="w"> </span><span class="s1">'Please add categories to this page'</span><span class="w"> </span><span class="p">);</span> <span class="w"> </span><span class="p">}</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <p>In user scripts and gadgets you can fire hooks/events prefixed by "userjs.". E.g.: </p> <div class="mw-highlight mw-highlight-lang-js mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">function</span><span class="w"> </span><span class="nx">MyScriptInit</span><span class="p">()</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">simpleVariable</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'done'</span><span class="p">;</span> <span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">objectPassed</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">me</span><span class="o">:</span><span class="w"> </span><span class="k">this</span><span class="w"> </span><span class="p">};</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">hook</span><span class="p">(</span><span class="w"> </span><span class="s1">'userjs.myScript.postInit'</span><span class="w"> </span><span class="p">).</span><span class="nx">fire</span><span class="p">(</span><span class="w"> </span><span class="nx">simpleVariable</span><span class="p">,</span><span class="w"> </span><span class="nx">objectPassed</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span> <span class="c1">//...</span> </pre></div> <p>Then you subscribe to this event like so: </p> <div class="mw-highlight mw-highlight-lang-js mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// here we receive both variables (but we skip them too)</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">hook</span><span class="p">(</span><span class="w"> </span><span class="s1">'userjs.myScript.postInit'</span><span class="w"> </span><span class="p">).</span><span class="nx">add</span><span class="p">(</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">simple</span><span class="p">,</span><span class="w"> </span><span class="nx">objectPassed</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">//...</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading4"><h4 id="hook_execution_order" data-mw-thread-id="h-hook_execution_order-mw.hook"><span data-mw-comment-start="" id="h-hook_execution_order-mw.hook"></span>hook execution order<span data-mw-comment-end="h-hook_execution_order-mw.hook"></span></h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=4" title="Edit section's source code: hook execution order"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Note that hooks are run in a sequence (and in place where they are fired). </p> <div class="mw-highlight mw-highlight-lang-js mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">function</span><span class="w"> </span><span class="nx">MyGadget</span><span class="p">()</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">objectPassed</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">abc</span><span class="o">:</span><span class="w"> </span><span class="s1">'default'</span> <span class="w"> </span><span class="p">};</span> <span class="w"> </span><span class="k">this</span><span class="p">.</span><span class="nx">objectPassed</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">objectPassed</span><span class="p">;</span> <span class="w"> </span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="w"> </span><span class="s1">'before hooks'</span><span class="p">,</span><span class="w"> </span><span class="nx">objectPassed</span><span class="w"> </span><span class="p">);</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">hook</span><span class="p">(</span><span class="w"> </span><span class="s1">'userjs.MyGadget.postInit'</span><span class="w"> </span><span class="p">).</span><span class="nx">fire</span><span class="p">(</span><span class="w"> </span><span class="nx">objectPassed</span><span class="w"> </span><span class="p">);</span> <span class="w"> </span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="w"> </span><span class="s1">'after hooks'</span><span class="p">,</span><span class="w"> </span><span class="nx">objectPassed</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">hook</span><span class="p">(</span><span class="w"> </span><span class="s1">'userjs.MyGadget.postInit'</span><span class="w"> </span><span class="p">).</span><span class="nx">add</span><span class="p">(</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">objectPassed</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">objectPassed</span><span class="p">.</span><span class="nx">abc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'changed in hook'</span><span class="p">;</span> <span class="w"> </span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="w"> </span><span class="s1">'inside a hook'</span><span class="p">,</span><span class="w"> </span><span class="nx">objectPassed</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> <span class="p">(</span><span class="w"> </span><span class="kd">function</span><span class="p">()</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="w"> </span><span class="s1">'before init'</span><span class="w"> </span><span class="p">);</span> <span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">gadget</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="ow">new</span><span class="w"> </span><span class="nx">MyGadget</span><span class="p">();</span> <span class="w"> </span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="w"> </span><span class="s1">'after init'</span><span class="p">,</span><span class="w"> </span><span class="nx">gadget</span><span class="p">.</span><span class="nx">objectPassed</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">()</span> </pre></div> <p>Above will result in following order: </p> <ol><li>before init</li> <li>before hooks, Object { abc: "default" }</li> <li>inside a hook, Object { abc: "changed in hook" }</li> <li>after hooks, Object { abc: "changed in hook" }</li> <li>after init, Object { abc: "changed in hook" }</li></ol> <div class="mw-heading mw-heading3"><h3 id="mw.html" data-mw-thread-id="h-mw.html-mediawiki"><span data-mw-comment-start="" id="h-mw.html-mediawiki"></span>mw.html<span data-mw-comment-end="h-mw.html-mediawiki"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=5" title="Edit section's source code: mw.html"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.html.html">JS Documentation</a></span></li></ul> <p>Helper functions for escaping and creating strings of HTML. </p> <div class="mw-heading mw-heading3"><h3 id="mw.inspect" data-mw-thread-id="h-mw.inspect-mediawiki"><span data-mw-comment-start="" id="h-mw.inspect-mediawiki"></span>mw.inspect<span data-mw-comment-end="h-mw.inspect-mediawiki"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=6" title="Edit section's source code: mw.inspect"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.32</div></td> </tr></tbody></table> <p>Shortcut for <span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mediawiki.inspect.html#.runReports">mw.inspect.runReports</a></span>. Shows in the console a list of all ResourceLoader modules that are loaded on this page, sorted by the total size of each module's JavaScript, CSS, etc. </p> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.html#.inspect">JS Documentation</a></span></li></ul> <div class="mw-heading mw-heading3"><h3 id="mw.log" data-mw-thread-id="h-mw.log-mediawiki"><span data-mw-comment-start="" id="h-mw.log-mediawiki"></span>mw.log<span data-mw-comment-end="h-mw.log-mediawiki"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=7" title="Edit section's source code: mw.log"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.log.html">JS Documentation</a></span></li></ul> <p>Collection of methods to help log messages to the console. </p><p><span class="anchor" id="mw.msg"></span> </p> <div class="mw-heading mw-heading3"><h3 id="mw.message" data-mw-thread-id="h-mw.message-mediawiki"><span data-mw-comment-start="" id="h-mw.message-mediawiki"></span>mw.message<span data-mw-comment-end="h-mw.message-mediawiki"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=8" title="Edit section's source code: mw.message"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6353907"><div role="note" class="hatnote mw-tpl-seealso">See also: <a href="/wiki/Manual:Messages_API#Using_messages_in_JavaScript" title="Manual:Messages API">Manual:Messages API#Using messages in JavaScript</a></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.Message.html">JS Documentation</a></span></li></ul> <p>If the <code><a href="#mediawiki.jqueryMsg">mediawiki.jqueryMsg</a></code> module is loaded, the behaviour of this module changes significantly. See above link. </p> <div class="mw-heading mw-heading3"><h3 id="mw.now" data-mw-thread-id="h-mw.now-mediawiki"><span data-mw-comment-start="" id="h-mw.now-mediawiki"></span>mw.now<span data-mw-comment-end="h-mw.now-mediawiki"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=9" title="Edit section's source code: mw.now"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.23</div><small><a href="https://gerrit.wikimedia.org/r/99547" class="extiw" title="gerrit:99547">Gerrit change 99547</a></small></td> </tr></tbody></table> <p>Get the current time, measured in milliseconds since January 1, 1970 (UTC). </p><p>On browsers that implement the <a href="https://developer.mozilla.org/docs/Web/API/Navigation_timing_API" class="extiw" title="devmo:Web/API/Navigation timing API">Navigation Timing API</a>, this function will produce floating-point values with microsecond precision that are guaranteed to be monotonic. On all other browsers, it will fall back to using <code>Date</code>. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">totalTime</span><span class="p">,</span><span class="w"> </span><span class="nx">time</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">now</span><span class="p">();</span> <span class="c1">// some expensive code</span> <span class="nx">totalTime</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">now</span><span class="p">()</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="nx">time</span><span class="p">;</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="mw.track" data-mw-thread-id="h-mw.track-mediawiki"><span data-mw-comment-start="" id="h-mw.track-mediawiki"></span>mw.track<span data-mw-comment-end="h-mw.track-mediawiki"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=10" title="Edit section's source code: mw.track"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.23</div><small><a href="https://gerrit.wikimedia.org/r/99547" class="extiw" title="gerrit:99547">Gerrit change 99547</a></small></td> </tr></tbody></table> <p>Track an analytic event. </p><p>This method provides a generic means for MediaWiki JavaScript code to capture state information for analysis. Each logged event specifies a string topic name that describes the kind of event that it is. Topic names consist of dot-separated path components, arranged from most general to most specific. Each path component should have a clear and well-defined purpose. Data handlers are registered via `mw.trackSubscribe`, and receive the full set of events that match their subscription, including those that fired before the handler was bound. </p><p>The <a href="/wiki/Extension:WikimediaEvents" title="Extension:WikimediaEvents">WikimediaEvents</a> extension demonstrates how to add a subscriber for the "timing" and "counter" topics (<a rel="nofollow" class="external text" href="https://github.com/wikimedia/mediawiki-extensions-WikimediaEvents/blob/1e56fd3e03295bcf10078441b75dbb359709c54f/modules/all/ext.wikimediaEvents.statsd.js#L59-L77">example</a>). </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">totalTime</span><span class="p">,</span><span class="w"> </span><span class="nx">time</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">now</span><span class="p">();</span> <span class="c1">// some expensive code</span> <span class="nx">totalTime</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">now</span><span class="p">()</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="nx">time</span><span class="p">;</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">track</span><span class="p">(</span><span class="w"> </span><span class="s1">'timing.MediaWiki.foo.bar'</span><span class="p">,</span><span class="w"> </span><span class="nx">totalTime</span><span class="w"> </span><span class="p">);</span> </pre></div> <p>On Wikimedia wikis, some events tracked this way are published on dashboards, and available for use by gadgets. See <a href="/wiki/Gadget_kitchen:_recording_metrics" title="Gadget kitchen: recording metrics">Gadget kitchen: recording metrics</a>. </p><p><span class="anchor" id="mediaWiki.notify"></span><span class="anchor" id="mediawiki.notify"></span> </p> <div class="mw-heading mw-heading3"><h3 id="mw.notify" data-mw-thread-id="h-mw.notify-mediawiki"><span data-mw-comment-start="" id="h-mw.notify-mediawiki"></span>mw.notify<span data-mw-comment-end="h-mw.notify-mediawiki"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=11" title="Edit section's source code: mw.notify"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.20</div><small><a href="https://gerrit.wikimedia.org/r/19199" class="extiw" title="gerrit:19199">Gerrit change 19199</a></small></td> </tr></tbody></table> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.html#.notify">JS Documentation</a></span></li></ul> <p>Creates <a href="/wiki/Bubble_notifications" title="Bubble notifications">bubble notifications</a>. Basic examples: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">mw</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="w"> </span><span class="s1">'This is a notification.'</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="c1">// Send a plaintext notification</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">message</span><span class="p">(</span><span class="w"> </span><span class="s1">'some-message'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="c1">// Use an i18n message to send a notification</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="w"> </span><span class="nx">$</span><span class="p">(</span><span class="w"> </span><span class="s1">'<span>This is an <u>HTML</u> notification.</span>'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="c1">// Send an HTML notification with a jQuery instance (a DOM node also works)</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="w"> </span><span class="s1">'Test'</span><span class="p">,</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">title</span><span class="o">:</span><span class="w"> </span><span class="s1">'Title!'</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="c1">// Give the notification a title</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="w"> </span><span class="s1">'Test'</span><span class="p">,</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">autoHide</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="c1">// Don't automatically hide the notification</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="w"> </span><span class="s1">'Test'</span><span class="p">,</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">tag</span><span class="o">:</span><span class="w"> </span><span class="s1">'foobar'</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="c1">// Send a notification tagged with a tag</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="w"> </span><span class="s1">'Test 2'</span><span class="p">,</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">tag</span><span class="o">:</span><span class="w"> </span><span class="s1">'foobar'</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="c1">// This one will replace the previous 'foobar' notification.</span> </pre></div> <p>For available options, see <a href="/wiki/Bubble_notifications#API" title="Bubble notifications">Bubble notifications § API</a>. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mw.loader" data-mw-thread-id="h-mw.loader"><span data-mw-comment-start="" id="h-mw.loader"></span>mw.loader<span data-mw-comment-end="h-mw.loader"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=12" title="Edit section's source code: mw.loader"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mw.loader","replies":["h-mw.loader.load-mw.loader","h-mw.loader.using-mw.loader","h-mw.loader.getScript-mw.loader"]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.loader.html">JS Documentation</a></span></li></ul> <div class="mw-heading mw-heading3"><h3 id="mw.loader.load" data-mw-thread-id="h-mw.loader.load-mw.loader"><span data-mw-comment-start="" id="h-mw.loader.load-mw.loader"></span>mw.loader.load<span data-mw-comment-end="h-mw.loader.load-mw.loader"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=13" title="Edit section's source code: mw.loader.load"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Load one or more modules, a script or a stylesheet. To load an external script or stylesheet, the URL must start with either "<code>http://</code>", "<code>https://</code>" or "<code>//</code>" (protocol-relative), or "<code>/</code>" (local path). Provide a MIME-type as second parameter (either "<code>text/javascript</code>" or "<code>text/css</code>"). If no MIME-type is provided, the default "<code>text/javascript</code>" is assumed. <code>mw.loader</code> creates an asynchronous request, if you need to run code that depends on a module, use mw.loader.using instead (which provides a callback). If you need a callback from an external script, use <a href="#mw.loader.getScript">mw.loader.getScript</a> (or <code><a rel="nofollow" class="external text" href="https://api.jquery.com/jQuery.getScript/">jQuery.getScript</a></code>). </p><p>Loader instructions represent the intent that a module by that name should be loaded. It will not load the same module a second time if it has already been loaded previously. This does not apply to scripts and stylesheets – they <i>will</i> be loaded each time, even if loaded previously. If a script defines <code>window.Foo</code>, you can use <code>( window.Foo !== undefined )</code> to check if that script has already been loaded. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// Module by name</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="w"> </span><span class="s1">'oojs'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// Multiple modules</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="s1">'oojs'</span><span class="p">,</span><span class="w"> </span><span class="s1">'mediawiki.Title'</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">);</span> <span class="c1">// Local gadget module. These must be defined in [[MediaWiki:Gadgets-definition]].</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="w"> </span><span class="s1">'ext.gadget.Navigation_popups'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// JavaScript page</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="w"> </span><span class="s1">'https://www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-UTCLiveClock.js&action=raw&ctype=text/javascript'</span><span class="w"> </span><span class="p">);</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="w"> </span><span class="s1">'https://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// CSS stylesheet</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="w"> </span><span class="s1">'https://en.wikipedia.org/w/index.php?title=User:Example/custom-foo.css&action=raw&ctype=text/css'</span><span class="p">,</span><span class="w"> </span><span class="s1">'text/css'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// CSS stylesheet from wiki page using getUrl method</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">getUrl</span><span class="p">(</span><span class="w"> </span><span class="s1">'MediaWiki:Foo.css'</span><span class="p">,</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">action</span><span class="o">:</span><span class="s1">'raw'</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s1">'&ctype=text/css'</span><span class="w"> </span><span class="p">,</span><span class="w"> </span><span class="s1">'text/css'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// External stylesheet</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">load</span><span class="p">(</span><span class="w"> </span><span class="s1">'https://wiki.example/mystyles.css'</span><span class="p">,</span><span class="w"> </span><span class="s1">'text/css'</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="mw.loader.using" data-mw-thread-id="h-mw.loader.using-mw.loader"><span data-mw-comment-start="" id="h-mw.loader.using-mw.loader"></span>mw.loader.using<span data-mw-comment-end="h-mw.loader.using-mw.loader"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=14" title="Edit section's source code: mw.loader.using"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Load one or more modules, and execute a function once those modules are loaded. See <span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.loader.html#.using">JS Documentation</a></span> </p><p>Since MediaWiki 1.28 the promise returned by this function is resolved with a <code>require</code> function, which can be used to access the public interface of <a href="/wiki/ResourceLoader/Package_files" title="ResourceLoader/Package files">package modules</a>. For example: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">using</span><span class="p">(</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="s1">'mediawiki.util'</span><span class="w"> </span><span class="p">],</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">require</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">util</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">require</span><span class="p">(</span><span class="w"> </span><span class="s1">'mediawiki.util'</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="mw.loader.getScript" data-mw-thread-id="h-mw.loader.getScript-mw.loader"><span data-mw-comment-start="" id="h-mw.loader.getScript-mw.loader"></span>mw.loader.getScript<span data-mw-comment-end="h-mw.loader.getScript-mw.loader"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=15" title="Edit section's source code: mw.loader.getScript"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.33</div><small><a href="https://gerrit.wikimedia.org/r/487566" class="extiw" title="gerrit:487566">Gerrit change 487566</a></small></td> </tr></tbody></table> <p>Load a script by URL. Returns a jQuery <a rel="nofollow" class="external text" href="https://api.jquery.com/Types/#Promise">promise object</a> which can be used to specify callbacks. </p><p>Example: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">getScript</span><span class="p">(</span><span class="w"> </span><span class="s1">'https://example.org/x-1.0.0.js'</span><span class="w"> </span><span class="p">)</span> <span class="p">.</span><span class="nx">then</span><span class="p">(</span> <span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// Script succeeded. You can use X now.</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">e</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// Script failed. X is not available</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">log</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="w"> </span><span class="nx">e</span><span class="p">.</span><span class="nx">message</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="c1">// => "Failed to load script"</span> <span class="w"> </span><span class="p">}</span> <span class="p">);</span> </pre></div> <p>To get a single callback from multiple promises, use <code><a rel="nofollow" class="external text" href="https://api.jquery.com/jQuery.when/">jQuery.when</a></code> or Promise.all </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">$</span><span class="p">.</span><span class="nx">when</span><span class="p">(</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">getScript</span><span class="p">(</span><span class="w"> </span><span class="s1">'https://example.org/x-1.0.0.js'</span><span class="w"> </span><span class="p">),</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">getScript</span><span class="p">(</span><span class="w"> </span><span class="s1">'https://example.org/y-2.0.0.js'</span><span class="w"> </span><span class="p">)</span> <span class="p">)</span> <span class="p">.</span><span class="nx">then</span><span class="p">(</span> <span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// Both script succeeded. You can use X and Y now.</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">e</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// A script failed, and is not available</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">log</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="w"> </span><span class="nx">e</span><span class="p">.</span><span class="nx">message</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="c1">// => "Failed to load script"</span> <span class="w"> </span><span class="p">}</span> <span class="p">);</span> </pre></div> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.user" data-mw-thread-id="h-mediawiki.user"><span data-mw-comment-start="" id="h-mediawiki.user"></span>mediawiki.user<span data-mw-comment-end="h-mediawiki.user"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=16" title="Edit section's source code: mediawiki.user"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.user","replies":["h-mw.user.clientPrefs-mediawiki.user"]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.user.html">JS Documentation</a></span></li></ul> <p>Module that represents information about the current user. </p> <div class="mw-heading mw-heading3"><h3 id="mw.user.clientPrefs" data-mw-thread-id="h-mw.user.clientPrefs-mediawiki.user"><span data-mw-comment-start="" id="h-mw.user.clientPrefs-mediawiki.user"></span>mw.user.clientPrefs<span data-mw-comment-end="h-mw.user.clientPrefs-mediawiki.user"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=17" title="Edit section's source code: mw.user.clientPrefs"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Available since <a href="/wiki/MediaWiki_1.41/wmf.20" title="MediaWiki 1.41/wmf.20">1.41.0-wmf.20</a> </p><p>Can be used to manipulate certain classes on the HTML element such that they do not result in a flash of unstyled content. This can be utilized where you need to make render blocking changes for anonymous users. </p><p> By design the only classes that can be manipulated are classes with the suffix <b>-clientpref-[A-Za-z0-9].</b> This is to prevent unintended manipulation of classes as well as serving as an indicator to people viewing the HTML source of what classes are subject to manipulation.</p><div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// Returns the current value of the client preference "foo".</span> <span class="c1">// The value of preference corresponds with a class on the HTML element that matches the</span> <span class="c1">// form foo-clientpref-<value>.</span> <span class="c1">// For example if there is a class on the HTML element foo-clientpref-1 then get will return 1.</span> <span class="c1">// returns false if there is no class on the HTML element e.g. nothing matches the regular</span> <span class="c1">// expression /foo-clientpref-[a-zA-Z0-9]+/</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">user</span><span class="p">.</span><span class="nx">clientPrefs</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">);</span> <span class="c1">// Returns false if no class was found on the HTML element.</span> <span class="c1">// If there is a class foo-clientpref-1 on the HTML element this will be replaced with</span> <span class="c1">// foo-clientpref-5.</span> <span class="c1">// Importantly: This replacement will persist across page views.</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">user</span><span class="p">.</span><span class="nx">clientPrefs</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">,</span><span class="w"> </span><span class="s1">'5'</span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="user.options" data-mw-thread-id="h-user.options"><span data-mw-comment-start="" id="h-user.options"></span>user.options<span data-mw-comment-end="h-user.options"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=18" title="Edit section's source code: user.options"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-user.options","replies":["h-mw.user.options-user.options","h-mw.user.tokens-user.options"]}}--></div> <ul><li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/includes/resourceloader/ResourceLoaderUserOptionsModule.php" class="extiw" title="git:mediawiki/core/+/HEAD/includes/resourceloader/ResourceLoaderUserOptionsModule.php">Source code</a></li></ul> <div class="mw-heading mw-heading3"><h3 id="mw.user.options" data-mw-thread-id="h-mw.user.options-user.options"><span data-mw-comment-start="" id="h-mw.user.options-user.options"></span>mw.user.options<span data-mw-comment-end="h-mw.user.options-user.options"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=19" title="Edit section's source code: mw.user.options"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Contains <a href="/wiki/Manual:$wgDefaultUserOptions" title="Manual:$wgDefaultUserOptions">the preferences of the user</a>, or the defaults when logged out. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// Get a preference option and use it directly</span> <span class="nx">alert</span><span class="p">(</span><span class="w"> </span><span class="s1">'According to your preferences, your gender is '</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">user</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="w"> </span><span class="s1">'gender'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">);</span> <span class="c1">// Get several preferences and compare them</span> <span class="kd">var</span><span class="w"> </span><span class="nx">opts</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">user</span><span class="p">.</span><span class="nx">options</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="s1">'diffonly'</span><span class="p">,</span><span class="w"> </span><span class="s1">'showhiddencats'</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">);</span> <span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">opts</span><span class="p">.</span><span class="nx">diffonly</span><span class="w"> </span><span class="o">===</span><span class="w"> </span><span class="mf">0</span><span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="nx">opts</span><span class="p">.</span><span class="nx">showhiddencats</span><span class="w"> </span><span class="o">===</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// User's preferences match</span> <span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// User's preferences don't match</span> <span class="p">}</span> </pre></div> <p>This module is loaded asynchronously and may depend on a separate HTTP request for the <code>user.defaults</code> module. Always declare the relevant dependencies for your module, or use <code>mw.loader.using()</code>. </p><p><span class="anchor" id="tokens"></span><span class="anchor" id="user.tokens"></span> </p> <div class="mw-heading mw-heading3"><h3 id="mw.user.tokens" data-mw-thread-id="h-mw.user.tokens-user.options"><span data-mw-comment-start="" id="h-mw.user.tokens-user.options"></span>mw.user.tokens<span data-mw-comment-end="h-mw.user.tokens-user.options"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=20" title="Edit section's source code: mw.user.tokens"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.19</div><small><span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/88553.html">r88553</a></span></small></td> </tr></tbody></table> <p>This contains an <span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.Map.html">mw.Map</a></span> object, pre-populated with tokens for use by <a href="#mediawiki.api">#mediawiki.api</a>. </p><p><span class="anchor" id="mediawiki.api.category"></span><span class="anchor" id="mediawiki.api.edit"></span><span class="anchor" id="mediawiki.api.login"></span><span class="anchor" id="mediawiki.api.options"></span><span class="anchor" id="mediawiki.api.upload"></span><span class="anchor" id="mediawiki.api.user"></span><span class="anchor" id="mediawiki.api.watch"></span><span class="anchor" id="mediawiki.api.messages"></span><span class="anchor" id="mediawiki.api.rollback"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.api" data-mw-thread-id="h-mediawiki.api"><span data-mw-comment-start="" id="h-mediawiki.api"></span>mediawiki.api<span data-mw-comment-end="h-mediawiki.api"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=21" title="Edit section's source code: mediawiki.api"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.api","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unknown mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.18.1</div><small><span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/105646.html">r105646</a></span></small></td> </tr></tbody></table> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.Api.html">JS Documentation</a></span></li> <li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/mediawiki.api/" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/mediawiki.api/">Source code</a></li></ul> <p>This module provides the <code>mw.Api</code> and <code>mw.Rest</code> objects. The main methods of the <code>mw.Api</code> object are <code>get()</code>, <code>post()</code>, and <code>ajax()</code>. The <code>mediawiki.api</code> module (and its plugins) return a <i><a rel="nofollow" class="external text" href="https://api.jquery.com/Types/#Promise"><code>Promise</code></a></i> – similar to <code>jQuery.ajax</code> (and its derivatives such as <code>jQuery.get</code>, <code>jQuery.post</code> and <code>jQuery.getJSON</code>). </p><p>Before MediaWiki 1.32 <small>(<a href="https://gerrit.wikimedia.org/r/434179" class="extiw" title="gerrit:434179">Gerrit change 434179</a>)</small>, the methods were part of separate modules named under <code>mediawiki.api.*</code>. These have been merged into the main module <code>mediawiki.api</code>, so you only have to depend on that module. The submodules have been deprecated with warnings. These submodules have been removed in MediaWiki 1.33. </p><p><span class="anchor" id="mw.Api#edit"></span><span class="anchor" id="mw.Api#saveOptions"></span><span class="anchor" id="mw.Api#watch"></span> Examples of methods that are available: </p> <ul><li><code>mw.Api#edit</code> - Edit an existing page.</li> <li><code>mw.Api#saveOptions</code> - Changes one or more user preferences.</li> <li><code>mw.Api#watch</code> - Add a given title (or titles) to the user's <a href="/wiki/Manual:Watchlist" title="Manual:Watchlist">watchlist</a>.</li></ul> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// Example</span> <span class="kd">var</span><span class="w"> </span><span class="nx">api</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="ow">new</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">Api</span><span class="p">();</span> <span class="nx">api</span><span class="p">.</span><span class="nx">watch</span><span class="p">(</span><span class="w"> </span><span class="s1">'Page to watch'</span><span class="w"> </span><span class="p">);</span> </pre></div> <p><span class="anchor" id="mw.cookie"></span><span class="anchor" id="mediaWiki.cookie"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.cookie" data-mw-thread-id="h-mediawiki.cookie"><span data-mw-comment-start="" id="h-mediawiki.cookie"></span>mediawiki.cookie<span data-mw-comment-end="h-mediawiki.cookie"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=22" title="Edit section's source code: mediawiki.cookie"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.cookie","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.24</div><small><a href="https://gerrit.wikimedia.org/r/120806" class="extiw" title="gerrit:120806">Gerrit change 120806</a></small></td> </tr></tbody></table> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.cookie.html">JS Documentation: mw.cookie</a></span></li> <li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.cookie.html#.$.cookie">JS Documentation: $.cookie (jQuery plugin)</a></span></li></ul> <p>Cookie module that uses the same settings as the MediaWiki server-side configuration (except for <code>wgCookieSecure</code>). </p><p>Usage example: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">mw</span><span class="p">.</span><span class="nx">cookie</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="w"> </span><span class="s1">'myCookie'</span><span class="p">,</span><span class="w"> </span><span class="s1">'some-value'</span><span class="w"> </span><span class="p">);</span> <span class="kd">var</span><span class="w"> </span><span class="nx">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">cookie</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="w"> </span><span class="s1">'myCookie'</span><span class="w"> </span><span class="p">);</span> </pre></div> <p>This module prepends the cookie names with <code><a href="/wiki/Special:MyLanguage/Manual:$wgCookiePrefix" title="Special:MyLanguage/Manual:$wgCookiePrefix">$wgCookiePrefix</a><span style="display:none"><a href="/wiki/Manual:$wgCookiePrefix" title="Manual:$wgCookiePrefix"> </a></span></code> (e.g. "<u>enwiki</u>myCookie=some-value"). </p><p>Avoid accessing the same cookie in different ways, for example via <code>mw.cookie</code> and via <code>$.cookie</code>, because you may encounter issues if doing so. </p><p>See the API documentation for available options. </p><p><span class="anchor" id="mw.errorLogger"></span><span class="anchor" id="mediaWiki.errorLogger"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.errorLogger" data-mw-thread-id="h-mediawiki.errorLogger"><span data-mw-comment-start="" id="h-mediawiki.errorLogger"></span>mediawiki.errorLogger<span data-mw-comment-end="h-mediawiki.errorLogger"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=23" title="Edit section's source code: mediawiki.errorLogger"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.errorLogger","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.36</div><small><a href="https://gerrit.wikimedia.org/r/655435" class="extiw" title="gerrit:655435">Gerrit change 655435</a></small></td> </tr></tbody></table> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.errorLogger.html">JS Documentation</a></span></li></ul> <p>Stub for logging Javascript errors; always loaded. Provides a method for logging caught exceptions: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="k">try</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// ...</span> <span class="p">}</span><span class="w"> </span><span class="k">catch</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">e</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">errorLogger</span><span class="p">.</span><span class="nx">logError</span><span class="p">(</span><span class="w"> </span><span class="nx">e</span><span class="p">,</span><span class="w"> </span><span class="s1">'my-component'</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span> </pre></div> <p>Sends two kinds of <a href="#mw.track">#mw.track</a> events: </p> <ul><li><code>error_caught</code>: this is where errors logged via <code>logError</code> go</li> <li><code>global_error</code>: uncaught exceptions reported by the browser</li></ul> <p>By default nothing is done with these events; an <code>mw.trackSubscribe</code> handler can forward them to the appropriate logging API. See e.g. <a class="external text" href="https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikimediaEvents/+/refs/heads/master/modules/ext.wikimediaEvents/clientError.js">clientError.js</a> in <a href="/wiki/Extension:WikimediaEvents" title="Extension:WikimediaEvents">WikimediaEvents</a>, or <a href="/wiki/Extension:Sentry" title="Extension:Sentry">Sentry</a>. </p><p><span class="anchor" id="mw.Debug"></span><span class="anchor" id="mediaWiki.Debug"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.feedback" data-mw-thread-id="h-mediawiki.feedback"><span data-mw-comment-start="" id="h-mediawiki.feedback"></span>mediawiki.feedback<span data-mw-comment-end="h-mediawiki.feedback"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=24" title="Edit section's source code: mediawiki.feedback"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.feedback","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.19</div></td> </tr></tbody></table> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.Feedback.html">JS Documentation</a></span></li> <li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/mediawiki.feedback/" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/mediawiki.feedback/">Source code</a></li></ul> <p>User interface for collecting feedback, particularly on new features. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mw.ForeignApi" data-mw-thread-id="h-mw.ForeignApi"><span data-mw-comment-start="" id="h-mw.ForeignApi"></span>mw.ForeignApi<span data-mw-comment-end="h-mw.ForeignApi"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=25" title="Edit section's source code: mw.ForeignApi"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mw.ForeignApi","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.26</div></td> </tr></tbody></table> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.ForeignApi.html">JS Documentation</a></span></li></ul> <p>Al. <code>mediawiki.ForeignApi</code>, an extension of <code>mediawiki.api</code> specifially geared toward handling everything required to communicate with another MediaWiki wiki via cross-origin requests (CORS). See <a href="/wiki/Manual:CORS" title="Manual:CORS">Manual:CORS</a>. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mw.ForeignRest" data-mw-thread-id="h-mw.ForeignRest"><span data-mw-comment-start="" id="h-mw.ForeignRest"></span>mw.ForeignRest<span data-mw-comment-end="h-mw.ForeignRest"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=26" title="Edit section's source code: mw.ForeignRest"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mw.ForeignRest","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.36</div></td> </tr></tbody></table> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.ForeignRest.html">JS Documentation</a></span></li></ul> <p>Extension of mw.Rest. See <a href="/wiki/Manual:CORS" title="Manual:CORS">Manual:CORS</a>. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mw.ForeignUpload" data-mw-thread-id="h-mw.ForeignUpload"><span data-mw-comment-start="" id="h-mw.ForeignUpload"></span>mw.ForeignUpload<span data-mw-comment-end="h-mw.ForeignUpload"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=27" title="Edit section's source code: mw.ForeignUpload"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mw.ForeignUpload","replies":[]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.ForeignUpload.html">JS Documentation</a></span></li></ul> <p>Extension of mw.Upload. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.jqueryMsg" data-mw-thread-id="h-mediawiki.jqueryMsg"><span data-mw-comment-start="" id="h-mediawiki.jqueryMsg"></span>mediawiki.jqueryMsg<span data-mw-comment-end="h-mediawiki.jqueryMsg"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=28" title="Edit section's source code: mediawiki.jqueryMsg"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.jqueryMsg","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r6353907"><div role="note" class="hatnote mw-tpl-seealso">See also: <a href="/wiki/Manual:Messages_API#Using_messages_in_JavaScript" title="Manual:Messages API">Manual:Messages API#Using messages in JavaScript</a></div> <ul><li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/mediawiki.jqueryMsg/" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/mediawiki.jqueryMsg/">mediawiki.jqueryMsg</a></li></ul> <p>This module upgrades the <code><a href="#mw.message">mw.message</a></code> parser to support basic wikitext localisation and formatting features. For example, <code>mediawiki.jqueryMsg</code> is required for <a href="/wiki/Manual:Messages_API#Notes_about_gender,_grammar,_plural" title="Manual:Messages API">plural and gender support</a>, the <a href="/wiki/Int" class="mw-redirect" title="Int">int: magic word</a> and links. </p><p><span class="anchor" id="mw.storage"></span><span class="anchor" id="mediaWiki.storage"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.router" data-mw-thread-id="h-mediawiki.router"><span data-mw-comment-start="" id="h-mediawiki.router"></span>mediawiki.router<span data-mw-comment-end="h-mediawiki.router"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=29" title="Edit section's source code: mediawiki.router"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.router","replies":[]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.router.html">JS Documentation</a></span></li></ul> <p>Register and match a set of in-page navigation routes (i.e. hash fragments). It is based on <a href="/wiki/OOjs" title="OOjs">OOjs</a>. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.storage" data-mw-thread-id="h-mediawiki.storage"><span data-mw-comment-start="" id="h-mediawiki.storage"></span>mediawiki.storage<span data-mw-comment-end="h-mediawiki.storage"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=30" title="Edit section's source code: mediawiki.storage"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.storage","replies":[]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.storage-SafeStorage.html">JS Documentation</a></span></li> <li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/mediawiki.storage/SafeStorage.js" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/mediawiki.storage/SafeStorage.js">mediawiki.storage</a></li></ul> <p>Wrapper for HTML5 Web Storage (localStorage, and sessionStorage). </p><p>If you are migrating from <code>$.jStorage</code>, note that <code>mw.storage.get()</code> and <code>mw.storage.set()</code> only store string values. Use <code>JSON.stringify()</code> and <code>JSON.parse()</code> or <code>parseInt</code>/<code>parseFloat</code> accordingly when setting and getting non-string values. You may also use <code>mw.storage.getObject()</code> and <code>mw.storage.setObject()</code> (<a href="https://gerrit.wikimedia.org/r/506145" class="extiw" title="gerrit:506145">Gerrit change 506145</a>) so that MediaWiki transparently interleaves a JSON serialization. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.ui" data-mw-thread-id="h-mediawiki.ui"><span data-mw-comment-start="" id="h-mediawiki.ui"></span>mediawiki.ui<span data-mw-comment-end="h-mediawiki.ui"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=31" title="Edit section's source code: mediawiki.ui"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.ui","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.22</div></td> </tr></tbody></table> <ul><li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/mediawiki.ui/" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/mediawiki.ui/">mediawiki.ui</a></li></ul> <p><span style="color:#d33">(deprecated in 1.29)</span> Please use <a href="/wiki/Codex" title="Codex">Codex</a> instead. </p><p>UI module developed as part of the <a href="/wiki/Agora" class="mw-redirect" title="Agora">Agora</a> project. It defines <code>mw-ui-*</code> CSS styles. It is used in the <a href="/wiki/Special:UserLogin" title="Special:UserLogin">Login</a> and <a href="/wiki/Special:UserLogin/signup" title="Special:UserLogin/signup">Create account</a> forms and several extensions. It provides one appearance for Vector and another for the rest of the skins. </p><p><span class="anchor" id="mw.widgets"></span><span class="anchor" id="mediaWiki.widgets"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.widgets" data-mw-thread-id="h-mediawiki.widgets"><span data-mw-comment-start="" id="h-mediawiki.widgets"></span>mediawiki.widgets<span data-mw-comment-end="h-mediawiki.widgets"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=32" title="Edit section's source code: mediawiki.widgets"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.widgets","replies":[]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.widgets.html">JS Documentation</a></span></li></ul> <p>Module providing MediaWiki-specific OOUI widgets like user input widget or namespace input widget. </p><p><span class="anchor" id="mw.util"></span><span class="anchor" id="mediaWiki.util"></span><span class="anchor" id="mw.util.getUrl"></span><span class="anchor" id="mediaWiki.util.getUrl"></span><span class="anchor" id="getUrl"></span><span class="anchor" id="validateEmail"></span><span class="anchor" id="wikiUrlencode"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.util" data-mw-thread-id="h-mediawiki.util"><span data-mw-comment-start="" id="h-mediawiki.util"></span>mediawiki.util<span data-mw-comment-end="h-mediawiki.util"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=33" title="Edit section's source code: mediawiki.util"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.util","replies":["h-addCSS-mediawiki.util","h-addPortlet-mediawiki.util","h-addPortletLink-mediawiki.util","h-hidePortlet-mediawiki.util","h-addSubtitle-mediawiki.util","h-clearSubtitle-mediawiki.util","h-$content-mediawiki.util","h-getParamValue-mediawiki.util","h-isIPv4Address-mediawiki.util","h-messageBox-mediawiki.util","h-isIPv6Address-mediawiki.util","h-rawurlencode-mediawiki.util","h-wikiScript-mediawiki.util"]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.util.html">JS Documentation</a></span></li> <li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/mediawiki.util/util.js" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/mediawiki.util/util.js">mediawiki.util</a></li></ul> <div class="mw-heading mw-heading3"><h3 id="addCSS" data-mw-thread-id="h-addCSS-mediawiki.util"><span data-mw-comment-start="" id="h-addCSS-mediawiki.util"></span>addCSS<span data-mw-comment-end="h-addCSS-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=34" title="Edit section's source code: addCSS"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Adds a <code class="mw-highlight" style="white-space:nowrap"><span class="p"><</span><span class="nt">style</span><span class="p">></span></code> element to the HEAD and returns the CSSStyleSheet object. </p><p>The CSSStyleSheet object can be used to disable the CSS rules at any later time and re-enable them as well. This can be done through the 'disabled' attribute. When setting this to true, the rules no longer apply. When setting to false, the rules apply again. </p><p>See also <a rel="nofollow" class="external text" href="http://dev.w3.org/csswg/cssom/#css">W3 on CSSStyleSheet</a> for more info. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// Add a simple stylesheet rule</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addCSS</span><span class="p">(</span><span class="w"> </span><span class="s1">'.plainlinks { color: green; }'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// Add a rule and set a variable to the sheet</span> <span class="kd">var</span><span class="w"> </span><span class="nx">myCssRules</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addCSS</span><span class="p">(</span><span class="w"> </span><span class="s1">'.plainlinks { color: green; }'</span><span class="w"> </span><span class="p">);</span> <span class="nx">$</span><span class="p">(</span><span class="w"> </span><span class="s1">'#myButton'</span><span class="w"> </span><span class="p">).</span><span class="nx">click</span><span class="p">(</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// When button is clicked, toggle the stylesheet from true to non-true (false), or from false to non-false (true)</span> <span class="w"> </span><span class="nx">myCssRules</span><span class="p">.</span><span class="nx">disabled</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">!</span><span class="nx">myCssRules</span><span class="p">.</span><span class="nx">disabled</span><span class="p">;</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="addPortlet" data-mw-thread-id="h-addPortlet-mediawiki.util"><span data-mw-comment-start="" id="h-addPortlet-mediawiki.util"></span>addPortlet<span data-mw-comment-end="h-addPortlet-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=35" title="Edit section's source code: addPortlet"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.util.html#.addPortlet">JS documentation</a></span></li></ul> <p>This function allows you to create a new portlet in the page. </p><p>Only the first argument is required which is the ID of the new portlet. When only using the first argument, no portlet will be added to the page and you must insert it yourself using the return value. When only specifying the first value, you must append the portlet before using the mw.util.addPortletLink API. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">const</span><span class="w"> </span><span class="nx">p</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortlet</span><span class="p">(</span><span class="w"> </span><span class="s1">'detached'</span><span class="w"> </span><span class="p">);</span> <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">p</span><span class="p">);</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortletLink</span><span class="p">(</span><span class="w"> </span><span class="s1">'detached'</span><span class="p">,</span><span class="w"> </span><span class="s1">'#'</span><span class="p">,</span><span class="w"> </span><span class="s1">'My test link'</span><span class="w"> </span><span class="p">);</span> </pre></div> <p>The second argument allows you to create a label - which is important for menus that appear in the sidebar or as dropdowns. </p><p>The third parameter when used will automatically append the portlet to the page <b>before</b> the provoided selector. It also provides a hint to skins which will make the new portlet mimic the styling of that portlet. </p><p>See the <span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.util.html#.addPortlet">mw.util JS documentation</a></span> for more details. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// create a portlet that is appended before #p-interaction and mimics the styling of #p-interaction.</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortlet</span><span class="p">(</span><span class="w"> </span><span class="s1">'p-mytest'</span><span class="p">,</span><span class="w"> </span><span class="s1">'My test portlet'</span><span class="p">,</span><span class="w"> </span><span class="s1">'#p-interaction'</span><span class="w"> </span><span class="p">);</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortletLink</span><span class="p">(</span><span class="w"> </span><span class="s1">'p-mytest'</span><span class="p">,</span><span class="w"> </span><span class="s1">'#'</span><span class="p">,</span><span class="w"> </span><span class="s1">'My test link'</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading4"><h4 id="Styling_portlets" data-mw-thread-id="h-Styling_portlets-addPortlet"><span data-mw-comment-start="" id="h-Styling_portlets-addPortlet"></span>Styling portlets<span data-mw-comment-end="h-Styling_portlets-addPortlet"></span></h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=36" title="Edit section's source code: Styling portlets"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>For many use cases, the menu may not appear styled as expected and the portlet is provided as is. In these situations you should provide your own styling. </p> <div class="mw-heading mw-heading4"><h4 id="Appending_portlets_in_different_locations" data-mw-thread-id="h-Appending_portlets_in_different_locations-addPortlet"><span data-mw-comment-start="" id="h-Appending_portlets_in_different_locations-addPortlet"></span>Appending portlets in different locations<span data-mw-comment-end="h-Appending_portlets_in_different_locations-addPortlet"></span></h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=37" title="Edit section's source code: Appending portlets in different locations"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Sometimes you will want to use the third parameter to mimic the styling of the portlet, but not to append <i>before.</i> To do this you must use the return value, and relocate it to another location. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">const</span><span class="w"> </span><span class="nx">p</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortlet</span><span class="p">(</span><span class="w"> </span><span class="s1">'p-mytest'</span><span class="p">,</span><span class="w"> </span><span class="s1">'My test portlet'</span><span class="p">,</span><span class="w"> </span><span class="s1">'#p-interaction'</span><span class="w"> </span><span class="p">);</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortletLink</span><span class="p">(</span><span class="w"> </span><span class="s1">'p-mytest'</span><span class="p">,</span><span class="w"> </span><span class="s1">'#'</span><span class="p">,</span><span class="w"> </span><span class="s1">'My test link'</span><span class="w"> </span><span class="p">);</span><span class="w"> </span> <span class="c1">// move portlet to end of list.</span> <span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">p</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nx">p</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">p</span><span class="p">);</span><span class="w"> </span><span class="p">}</span> </pre></div> <div class="mw-heading mw-heading4"><h4 id="Dropdowns_(Vector-only)" data-mw-thread-id="h-Dropdowns_(Vector-only)-addPortlet"><span id="Dropdowns_.28Vector-only.29"></span><span data-mw-comment-start="" id="h-Dropdowns_(Vector-only)-addPortlet"></span>Dropdowns (Vector-only)<span data-mw-comment-end="h-Dropdowns_(Vector-only)-addPortlet"></span></h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=38" title="Edit section's source code: Dropdowns (Vector-only)"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The Vector (2022) and Vector legacy (2010) skins support adding portlets as dropdown menus in the tab bar. This is implemented by trapping requests to create a portlet with the selector <code>#p-cactions</code> in the <i>before</i> argument and mimicking the style the skin uses for its own dropdown menus. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// create a dropdown menu in Vector legacy and Vector</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortlet</span><span class="p">(</span><span class="s1">'p-mytest'</span><span class="p">,</span><span class="w"> </span><span class="s1">'My test dropdown'</span><span class="p">,</span><span class="w"> </span><span class="s1">'#p-cactions'</span><span class="p">);</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortletLink</span><span class="p">(</span><span class="s1">'p-mytest'</span><span class="p">,</span><span class="w"> </span><span class="s1">'#'</span><span class="p">,</span><span class="w"> </span><span class="s1">'My test link'</span><span class="p">);</span> </pre></div> <p>In Monobook this will instead create a regular portlet in the left sidebar. In Timeless it will create one in the right sidebar. In Minerva it is essentially a noop. </p><p>Appending this portlet and moving it to mimick the dropdown style works in Vector legacy (2010), but will not work in Vector (2022) because the skin wraps it in additional markup (your portlet exists inside a dropdown menu the skin created for you, but it is not itself a dropdown menu). So in order to move it elsewhere, for example to get a dropdown next to the main page tabs on the left, you will have to find the DOM node representing the actual dropdown and move that. This is not recommended because it relies on the skin's internal implementation (markup structure and styling) so it <i>will</i> break when the implementation changes, but if you need this you can currently do something like this: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// create a dropdown menu in Vector legacy and Vector</span> <span class="kd">const</span><span class="w"> </span><span class="nx">p</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortlet</span><span class="p">(</span><span class="s1">'p-mytest'</span><span class="p">,</span><span class="w"> </span><span class="s1">'My test dropdown'</span><span class="p">,</span><span class="w"> </span><span class="s1">'#p-cactions'</span><span class="p">);</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortletLink</span><span class="p">(</span><span class="s1">'p-mytest'</span><span class="p">,</span><span class="w"> </span><span class="s1">'#'</span><span class="p">,</span><span class="w"> </span><span class="s1">'My test link'</span><span class="p">);</span> <span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nx">mw</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">"skin"</span><span class="p">)</span><span class="w"> </span><span class="o">===</span><span class="w"> </span><span class="s2">"vector-2022"</span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// rely on Vector using the ID you provided for the portlet and</span> <span class="w"> </span><span class="c1">// appending "-dropdown" to it as the ID for the actual dropdown.</span> <span class="w"> </span><span class="nx">$</span><span class="p">(</span><span class="s1">'#p-mytest'</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s1">'-dropdown'</span><span class="p">).</span><span class="nx">appendTo</span><span class="p">(</span><span class="s2">"#left-navigation"</span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// use the node returned by mw.util.addPortlet()</span> <span class="w"> </span><span class="nx">$</span><span class="p">(</span><span class="nx">p</span><span class="p">).</span><span class="nx">appendTo</span><span class="p">(</span><span class="s2">"#left-navigation"</span><span class="p">);</span> <span class="p">}</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="addPortletLink" data-mw-thread-id="h-addPortletLink-mediawiki.util"><span data-mw-comment-start="" id="h-addPortletLink-mediawiki.util"></span>addPortletLink<span data-mw-comment-end="h-addPortletLink-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=39" title="Edit section's source code: addPortletLink"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>This function is ported from the legacy wikibits keeping it fully backwards compatible, with a few adjustments that support all core skins and with added support for a CSS-selector as <code>nextnode</code>. Note that it doesn't support MobileFrontend with the Minerva skin for logged-out users. </p><p>Only the first three arguments are required. In case you need to execute a custom function when the user clicks on a portlet, use the <a rel="nofollow" class="external text" href="https://api.jquery.com/click/">jQuery(...).on('click', .. )</a> on returned Element object to attach a callback that runs the code that should be executed. </p><p>See the <span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.util.html#.addPortletLink">mw.util documentation</a></span> for details. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// First wait for mediawiki.util to load, and the page to be ready.</span> <span class="nx">$</span><span class="p">.</span><span class="nx">when</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">using</span><span class="p">(</span><span class="w"> </span><span class="s1">'mediawiki.util'</span><span class="w"> </span><span class="p">),</span><span class="w"> </span><span class="nx">$</span><span class="p">.</span><span class="nx">ready</span><span class="w"> </span><span class="p">).</span><span class="nx">then</span><span class="p">(</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span> <span class="w"> </span><span class="c1">// General usage pattern:</span> <span class="w"> </span><span class="c1">// mw.util.addPortletLink( portletId, href, text /* Optional: , id, tooltip, accesskey, nextnode */ );</span> <span class="w"> </span><span class="c1">// Example: Add a link to mediawiki.org to the Tools area, above the "Special pages" link.</span> <span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">newElement</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortletLink</span><span class="p">(</span> <span class="w"> </span><span class="s1">'p-tb'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'https://www.mediawiki.org/'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'Link to mediawiki.org'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'t-mworg'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'Go to www.mediawiki.org'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'m'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'#t-specialpages'</span> <span class="w"> </span><span class="p">);</span> <span class="w"> </span><span class="c1">// The old way of passing a DOM-node also works</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addPortletLink</span><span class="p">(</span> <span class="w"> </span><span class="s1">'p-tb'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'https://www.mediawiki.org/'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'Link to mediawiki.org'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'t-mworg'</span><span class="p">,</span> <span class="w"> </span><span class="s1">'Go to www.mediawiki.org'</span><span class="p">,</span><span class="w"> </span> <span class="w"> </span><span class="s1">'m'</span><span class="p">,</span> <span class="w"> </span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="w"> </span><span class="s1">'t-specialpages'</span><span class="w"> </span><span class="p">)</span> <span class="w"> </span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div><p>Note about icons: The id will be used to construct an icon class in certain skins (for example mw-ui-icon-vector-gadget-cx-language in Vector). Callers are expected to add their own CSS in addition to calling addPortletLink if needed. </p><div class="mw-heading mw-heading3"><h3 id="hidePortlet" data-mw-thread-id="h-hidePortlet-mediawiki.util"><span data-mw-comment-start="" id="h-hidePortlet-mediawiki.util"></span>hidePortlet<span data-mw-comment-end="h-hidePortlet-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=40" title="Edit section's source code: hidePortlet"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div><p> This function allows you to hide a portlet (menu) consistently across skins.</p><div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// First wait for mediawiki.util to load, and the page to be ready.</span> <span class="nx">$</span><span class="p">.</span><span class="nx">when</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">using</span><span class="p">(</span><span class="w"> </span><span class="s1">'mediawiki.util'</span><span class="w"> </span><span class="p">),</span><span class="w"> </span><span class="nx">$</span><span class="p">.</span><span class="nx">ready</span><span class="w"> </span><span class="p">).</span><span class="nx">then</span><span class="p">(</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span> <span class="w"> </span><span class="c1">/// hide toolbox</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">hidePortlet</span><span class="p">(</span><span class="w"> </span><span class="s1">'p-tb'</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="addSubtitle" data-mw-thread-id="h-addSubtitle-mediawiki.util"><span data-mw-comment-start="" id="h-addSubtitle-mediawiki.util"></span>addSubtitle<span data-mw-comment-end="h-addSubtitle-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=41" title="Edit section's source code: addSubtitle"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// First wait for mediawiki.util to load, and the page to be ready.</span> <span class="nx">$</span><span class="p">.</span><span class="nx">when</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">using</span><span class="p">(</span><span class="w"> </span><span class="s1">'mediawiki.util'</span><span class="w"> </span><span class="p">),</span><span class="w"> </span><span class="nx">$</span><span class="p">.</span><span class="nx">ready</span><span class="w"> </span><span class="p">).</span><span class="nx">then</span><span class="p">(</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addSubtitle</span><span class="p">(</span><span class="w"> </span><span class="s1">'Hello'</span><span class="w"> </span><span class="p">);</span> <span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">sub</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">'div'</span><span class="p">);</span> <span class="w"> </span><span class="nx">sub</span><span class="p">.</span><span class="nx">textContent</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">' world'</span><span class="p">;</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">addSubtitle</span><span class="p">(</span><span class="w"> </span><span class="nx">sub</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="clearSubtitle" data-mw-thread-id="h-clearSubtitle-mediawiki.util"><span data-mw-comment-start="" id="h-clearSubtitle-mediawiki.util"></span>clearSubtitle<span data-mw-comment-end="h-clearSubtitle-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=42" title="Edit section's source code: clearSubtitle"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div><p> Usually called alongside addSubtitle when you want to refresh the subtitle contents. Given you can only add to the subtitle, you must clear its existing contents if you want to redraw.</p><div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// First wait for mediawiki.util to load, and the page to be ready.</span> <span class="nx">$</span><span class="p">.</span><span class="nx">when</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">using</span><span class="p">(</span><span class="w"> </span><span class="s1">'mediawiki.util'</span><span class="w"> </span><span class="p">),</span><span class="w"> </span><span class="nx">$</span><span class="p">.</span><span class="nx">ready</span><span class="w"> </span><span class="p">).</span><span class="nx">then</span><span class="p">(</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">clearSubtitle</span><span class="p">();</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="$content" data-mw-thread-id="h-$content-mediawiki.util"><span id=".24content"></span><span data-mw-comment-start="" id="h-$content-mediawiki.util"></span>$content<span data-mw-comment-end="h-$content-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=43" title="Edit section's source code: $content"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>A jQuery object for a page's overall content area regardless of the skin used. This is, for example, <code>#content</code> in the Vector-<a href="/wiki/Help:Skins" title="Help:Skins">skin</a> (before 1.20 it was <code>#bodyContent</code>). </p><p>This does <b>not</b> refer to the area where the page content goes. If you wish to work with that area of the page instead of the overall content area you should use <code>$( '#mw-content-text' )</code> instead. </p><p>This property is populated on document ready. To use it, wait for <code>$.ready</code> and be sure to have a module dependency on <code>mediawiki.util</code> which will ensure your document ready handler fires after initialization. </p><p>Because of the lazy-initialised nature of this property, you are discouraged from using it. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="cm">/* Add some HTML to the page content */</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">$content</span><span class="p">.</span><span class="nx">append</span><span class="p">(</span><span class="w"> </span><span class="s1">'<h2>Lorem ipsum</h2><p>This section was just added to the bottom of the wiki page.</p>'</span><span class="w"> </span><span class="p">);</span> <span class="cm">/* Count number of tables in the page's content with a class of "wikitable" */</span> <span class="kd">var</span><span class="w"> </span><span class="nx">$wikitablesInPage</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">$content</span><span class="p">.</span><span class="nx">find</span><span class="p">(</span><span class="w"> </span><span class="s1">'table.wikitable'</span><span class="w"> </span><span class="p">);</span> <span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">$wikitablesInPage</span><span class="p">.</span><span class="nx">length</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">alert</span><span class="p">(</span><span class="w"> </span><span class="s1">'There are '</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">$wikitablesInPage</span><span class="p">.</span><span class="nx">length</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s1">' wikitables on this page.'</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">alert</span><span class="p">(</span><span class="w"> </span><span class="s1">'There are no wikitables on this page.'</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span> </pre></div> <p>Here is a more advanced example involving loading in extra content with an AJAX request. Run this example on a page other than the main page. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="cm">/* Loads in main page (or any page for that matter) over AJAX (may be useful for Special:BlankPage) */</span> <span class="c1">// Put a loading message on top of the page</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">$content</span><span class="p">.</span><span class="nx">prepend</span><span class="p">(</span><span class="w"> </span><span class="s1">'<p><em>Loading...</em></p><hr/>'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// To get the article contents, use #mw-content-text instead.</span> <span class="nx">$</span><span class="p">(</span><span class="w"> </span><span class="s1">'#mw-content-text'</span><span class="w"> </span><span class="p">).</span><span class="nx">load</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">getUrl</span><span class="p">(</span><span class="w"> </span><span class="s1">''</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s1">' #mw-content-text'</span><span class="p">,</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">notify</span><span class="p">(</span><span class="w"> </span><span class="s1">'Load complete!'</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="getParamValue" data-mw-thread-id="h-getParamValue-mediawiki.util"><span data-mw-comment-start="" id="h-getParamValue-mediawiki.util"></span>getParamValue<span data-mw-comment-end="h-getParamValue-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=44" title="Edit section's source code: getParamValue"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>This function returns the value of the specified URL parameter. By default it uses the current window's address. Optionally you can pass it a custom location. </p><p>It returns <code>null</code> if the parameter is not present. Returns an empty string(<code>""</code>) if it was an empty parameter (such as <code>/page.php?some=parameter<strong>&emptyparameter=</strong>&id=12</code> </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// Location: https://www.mediawiki.org/w/index.php?title=ResourceLoader/Default_modules&action=edit&section=28</span> <span class="c1">// Suppose we're editing a page section, this will return the number of the edit section</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">getParamValue</span><span class="p">(</span><span class="w"> </span><span class="s1">'section'</span><span class="w"> </span><span class="p">);</span><span class="w"> </span><span class="cm">/* returns '28'; */</span> <span class="c1">// Extract a value from a custom url</span> <span class="c1">// For example on a diff page where there is: "← Older edit" and you need the oldid of the previous edit</span> <span class="kd">var</span><span class="w"> </span><span class="nx">oldid</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">getParamValue</span><span class="p">(</span><span class="w"> </span><span class="s1">'oldid'</span><span class="p">,</span><span class="w"> </span><span class="s1">'//www.mediawiki.org/w/index.php?title=ResourceLoader/Default_modules&diff=prev&oldid=365296'</span><span class="w"> </span><span class="p">);</span> <span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">oldid</span><span class="w"> </span><span class="o">!==</span><span class="w"> </span><span class="kc">null</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">alert</span><span class="p">(</span><span class="w"> </span><span class="s1">'The previous text version of this page has id: '</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">oldid</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">alert</span><span class="p">(</span><span class="w"> </span><span class="s1">'No "oldid" parameter found in the given address.'</span><span class="w"> </span><span class="p">);</span> <span class="p">}</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="isIPv4Address" data-mw-thread-id="h-isIPv4Address-mediawiki.util"><span data-mw-comment-start="" id="h-isIPv4Address-mediawiki.util"></span>isIPv4Address<span data-mw-comment-end="h-isIPv4Address-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=45" title="Edit section's source code: isIPv4Address"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.18</div><small><span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/83202.html">r83202</a></span></small></td> </tr></tbody></table> <p>This function returns bool for passed string is valid IPv4 Address or not. </p> <div style="clear: both;"></div> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// true</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">isIPv4Address</span><span class="p">(</span><span class="w"> </span><span class="s1">'192.0.2.0'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// false (range is invalid IPv4 Address)</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">isIPv4Address</span><span class="p">(</span><span class="w"> </span><span class="s1">'192.0.2.0/24'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// false</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">isIPv4Address</span><span class="p">(</span><span class="w"> </span><span class="s1">'string'</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="messageBox" data-mw-thread-id="h-messageBox-mediawiki.util"><span data-mw-comment-start="" id="h-messageBox-mediawiki.util"></span>messageBox<span data-mw-comment-end="h-messageBox-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=46" title="Edit section's source code: messageBox"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-future"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.43</div><small><span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/83202.html">r83202</a></span></small></td> </tr></tbody></table><p> This function allows you to render an error or warning message. This method should only be called in environments where Codex styles have been loaded (for example mediawiki.codex.messagebox.styles module)</p><div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">messageBox</span><span class="p">(</span><span class="w"> </span><span class="s1">'Error occurred'</span><span class="p">,</span><span class="w"> </span><span class="s1">'error'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">);</span> <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">messageBox</span><span class="p">(</span><span class="w"> </span><span class="s1">'Warning occurred'</span><span class="p">,</span><span class="w"> </span><span class="s1">'warning'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">);</span> <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">messageBox</span><span class="p">(</span><span class="w"> </span><span class="s1">'Notice about something.,'</span><span class="p">,</span><span class="w"> </span><span class="s1">'notice'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="isIPv6Address" data-mw-thread-id="h-isIPv6Address-mediawiki.util"><span data-mw-comment-start="" id="h-isIPv6Address-mediawiki.util"></span>isIPv6Address<span data-mw-comment-end="h-isIPv6Address-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=47" title="Edit section's source code: isIPv6Address"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.18</div><small><span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/83202.html">r83202</a></span></small></td> </tr></tbody></table> <p>This function returns bool for passed string is valid IPv6 Address or not. </p> <div style="clear: both;"></div> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// true</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">isIPv6Address</span><span class="p">(</span><span class="w"> </span><span class="s1">'2001:db8:a:0:0:0:0:0'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// true</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">isIPv6Address</span><span class="p">(</span><span class="w"> </span><span class="s1">'2001:db8:a::'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// false (range is invalid IPv6 Address)</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">isIPv6Address</span><span class="p">(</span><span class="w"> </span><span class="s1">'2001:db8:a::/32'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// false</span> <span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">isIPv6Address</span><span class="p">(</span><span class="w"> </span><span class="s1">'string'</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="rawurlencode" data-mw-thread-id="h-rawurlencode-mediawiki.util"><span data-mw-comment-start="" id="h-rawurlencode-mediawiki.util"></span>rawurlencode<span data-mw-comment-end="h-rawurlencode-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=48" title="Edit section's source code: rawurlencode"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>This function returns an encoded string in its raw form for use in urls. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">exFooUrl</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'http://example.org/foo/'</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">rawurlencode</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="w"> </span><span class="s1">'wgPageName'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">);</span> </pre></div> <p>For building query strings, you may want to use <a rel="nofollow" class="external text" href="https://api.jquery.com/jQuery.param/">jQuery.param</a> instead: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">query</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">page</span><span class="o">:</span><span class="w"> </span><span class="s1">'MyPage'</span><span class="p">,</span> <span class="w"> </span><span class="nx">value</span><span class="o">:</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">config</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="w"> </span><span class="s1">'skin'</span><span class="w"> </span><span class="p">),</span> <span class="w"> </span><span class="nx">action</span><span class="o">:</span><span class="w"> </span><span class="s1">'foo'</span> <span class="p">};</span> <span class="kd">var</span><span class="w"> </span><span class="nx">fooQuery</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'http://example.com/stuff.php?'</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">$</span><span class="p">.</span><span class="nx">param</span><span class="p">(</span><span class="w"> </span><span class="nx">query</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="wikiScript" data-mw-thread-id="h-wikiScript-mediawiki.util"><span data-mw-comment-start="" id="h-wikiScript-mediawiki.util"></span>wikiScript<span data-mw-comment-end="h-wikiScript-mediawiki.util"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=49" title="Edit section's source code: wikiScript"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.18</div><small><span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/88513.html">r88513</a></span></small></td> </tr></tbody></table> <p>This function returns the location of a script on the current wiki. Much like <code>wfScript</code> in <a href="/wiki/GlobalFunctions.php" class="mw-redirect" title="GlobalFunctions.php">GlobalFunctions.php</a>. </p><p><b>Parameters:</b> <code>str</code> - Name of the script (e.g. 'api'), defaults to 'index'. </p> <div style="clear: both;"></div> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">jQuery</span><span class="p">.</span><span class="nx">getJSON</span><span class="p">(</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">wikiScript</span><span class="p">(</span><span class="w"> </span><span class="s1">'api'</span><span class="w"> </span><span class="p">),</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">format</span><span class="o">:</span><span class="w"> </span><span class="s1">'json'</span><span class="p">,</span> <span class="w"> </span><span class="nx">action</span><span class="o">:</span><span class="w"> </span><span class="s1">'query'</span><span class="p">,</span> <span class="w"> </span><span class="nx">titles</span><span class="o">:</span><span class="w"> </span><span class="s1">'Main Page'</span><span class="p">,</span> <span class="w"> </span><span class="nx">prop</span><span class="o">:</span><span class="w"> </span><span class="s1">'revisions'</span> <span class="p">}</span><span class="w"> </span><span class="p">).</span><span class="nx">done</span><span class="p">(</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">data</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// data.query</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.RegExp" data-mw-thread-id="h-mediawiki.RegExp"><span data-mw-comment-start="" id="h-mediawiki.RegExp"></span>mediawiki.RegExp<span data-mw-comment-end="h-mediawiki.RegExp"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=50" title="Edit section's source code: mediawiki.RegExp"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.RegExp","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-version2 mw-version-version2-unsupported"><tbody><tr> <td>MediaWiki versions:</td> <td class="mw-version-versionbox" title="MediaWiki 1.35 is an unsupported version"><div class="mw-version-versionnumber"> 1.26 – 1.35</div></td> </tr></tbody></table> <p><span style="color:#d33">(deprecated in 1.34)</span> </p> <dl><dd><i>See <a href="/wiki/ResourceLoader/Migration_guide_(users)#mediawiki.RegExp" title="ResourceLoader/Migration guide (users)">ResourceLoader/Migration guide § mediawiki.RegExp</a></i></dd></dl> <p><span class="anchor" id="mw.Title"></span><span class="anchor" id="mediaWiki.Title"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.Title" data-mw-thread-id="h-mediawiki.Title"><span data-mw-comment-start="" id="h-mediawiki.Title"></span>mediawiki.Title<span data-mw-comment-end="h-mediawiki.Title"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=51" title="Edit section's source code: mediawiki.Title"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.Title","replies":[]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.Title.html">JS Documentation</a></span></li> <li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/mediawiki.Title/" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/mediawiki.Title/">mediawiki.Title</a></li></ul> <p>This sets the <code>mw.Title</code> constructor, which has several methods in its prototype. Basic example: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">t</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="ow">new</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">Title</span><span class="p">(</span><span class="w"> </span><span class="s1">'Image: foo_bar baz.jpg'</span><span class="w"> </span><span class="p">);</span> <span class="nx">t</span><span class="p">.</span><span class="nx">getMain</span><span class="p">();</span><span class="w"> </span><span class="c1">// "Foo_bar_baz.jpg"</span> <span class="nx">t</span><span class="p">.</span><span class="nx">getNamespaceId</span><span class="p">();</span><span class="w"> </span><span class="c1">// 6</span> <span class="nx">t</span><span class="p">.</span><span class="nx">getNamespacePrefix</span><span class="p">();</span><span class="w"> </span><span class="c1">// "File:"</span> </pre></div> <p><span class="anchor" id="mw.Uri"></span><span class="anchor" id="mediaWiki.Uri"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="mediawiki.Uri" data-mw-thread-id="h-mediawiki.Uri"><span data-mw-comment-start="" id="h-mediawiki.Uri"></span>mediawiki.Uri<span data-mw-comment-end="h-mediawiki.Uri"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=52" title="Edit section's source code: mediawiki.Uri"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.Uri","replies":[]}}--></div> <p><span style="color:#d33">(deprecated in 1.43)</span> </p> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/mw.Uri.html">JS Documentation</a></span></li> <li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/mediawiki.Uri/" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/mediawiki.Uri/">mediawiki.Uri</a></li></ul> <p>Use browser's native URL interface instead. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="moment" data-mw-thread-id="h-moment"><span data-mw-comment-start="" id="h-moment"></span>moment<span data-mw-comment-end="h-moment"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=53" title="Edit section's source code: moment"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-moment","replies":[]}}--></div> <ul><li>Upstream documentation: <a rel="nofollow" class="external free" href="https://momentjs.com/">https://momentjs.com/</a></li></ul><p> Moment.js can parse, manipulate, and format date-time timestamps. Localisation is automatically loaded and configured for the current user interface language.</p><div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">moment</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">require</span><span class="p">(</span><span class="w"> </span><span class="s1">'moment'</span><span class="w"> </span><span class="p">);</span> <span class="nx">moment</span><span class="p">(</span><span class="w"> </span><span class="s1">'2011-04-01 09:00'</span><span class="w"> </span><span class="p">).</span><span class="nx">format</span><span class="p">(</span><span class="w"> </span><span class="s1">'LLLL'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// "Friday, 1 April 2011 9:00 AM"</span> <span class="nx">moment</span><span class="p">.</span><span class="nx">version</span> <span class="c1">//> "2.25.2"</span> </pre></div> <p><span class="anchor" id="OOjs"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="oojs" data-mw-thread-id="h-oojs"><span data-mw-comment-start="" id="h-oojs"></span>oojs<span data-mw-comment-end="h-oojs"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=54" title="Edit section's source code: oojs"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-oojs","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.23</div></td> </tr></tbody></table> <ul><li><a href="https://doc.wikimedia.org/oojs/master/OO.html" class="extiw" title="wmdoc:oojs/master/OO.html">JS Documentation</a></li></ul> <p><a href="/wiki/OOjs" title="OOjs">OOjs</a> is a libary that provides a consistent way of implementing object-oriented design in JS. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="oojs-ui" data-mw-thread-id="h-oojs-ui"><span data-mw-comment-start="" id="h-oojs-ui"></span>oojs-ui<span data-mw-comment-end="h-oojs-ui"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=55" title="Edit section's source code: oojs-ui"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-oojs-ui","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.23</div></td> </tr></tbody></table> <ul><li><a href="https://doc.wikimedia.org/oojs-ui/master/js/" class="extiw" title="wmdoc:oojs-ui/master/js/">JS Documentation</a></li></ul> <p><a href="/wiki/OOUI" title="OOUI">OOUI</a> is a user interface toolkit based on OOjs. Note that <code>oojs-ui</code> is just a legacy name for the module. See all the known <a href="/wiki/OOUI/Using_OOUI_in_MediaWiki#JavaScript" title="OOUI/Using OOUI in MediaWiki">OOUI module names</a>. </p><p><span class="anchor" id="jQuery"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery" data-mw-thread-id="h-jquery"><span data-mw-comment-start="" id="h-jquery"></span>jquery<span data-mw-comment-end="h-jquery"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=56" title="Edit section's source code: jquery"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery","replies":[]}}--></div> <ul><li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/lib/jquery/jquery.js" class="extiw" title="git:mediawiki/core/+/HEAD/resources/lib/jquery/jquery.js">jquery</a></li></ul> <p>More information about jQuery's presence in MediaWiki, see <a href="/wiki/JQuery" title="JQuery">jQuery</a>. For more about jQuery in general and all its core functions, refer to <a rel="nofollow" class="external free" href="https://api.jquery.com/">https://api.jquery.com/</a> </p><p>ResourceLoader provides jQuery as part of its <a href="#base-env">base environment</a> (the loader client uses jQuery internally), therefore this module is <em>always</em> loaded and should not (and in fact can not) be loaded through ResourceLoader (as dependency or otherwise). </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.chosen" data-mw-thread-id="h-jquery.chosen"><span data-mw-comment-start="" id="h-jquery.chosen"></span>jquery.chosen<span data-mw-comment-end="h-jquery.chosen"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=57" title="Edit section's source code: jquery.chosen"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.chosen","replies":[]}}--></div> <ul><li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/lib/jquery.chosen/" class="extiw" title="git:mediawiki/core/+/HEAD/resources/lib/jquery.chosen/">jquery.chosen</a></li></ul> <p>“Chosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly.” — <a rel="nofollow" class="external text" href="http://harvesthq.github.io/chosen/">harvesthq.github.io</a> </p><p>In fact, it turns a select into a combo box with <a href="https://en.wikipedia.org/wiki/Autocomplete" class="extiw" title="en:Autocomplete">autocomplete</a> functionality by default but also supports grouping, and "tagging" (i.e. multiple values). </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">$</span><span class="p">(</span><span class="w"> </span><span class="s1">'select'</span><span class="w"> </span><span class="p">).</span><span class="nx">chosen</span><span class="p">(</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="cm">/* options */</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.client" data-mw-thread-id="h-jquery.client"><span data-mw-comment-start="" id="h-jquery.client"></span>jquery.client<span data-mw-comment-end="h-jquery.client"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=58" title="Edit section's source code: jquery.client"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.client","replies":["h-jQuery.client.profile-jquery.client"]}}--></div> <ul><li><a class="external text" href="https://doc.wikimedia.org/jquery-client/master/#!/api/jQuery.client">JS Documentation</a></li></ul> <p>A plugin that extracts information about the client's browser, layout engine, and operating system. </p> <div class="mw-heading mw-heading3"><h3 id="jQuery.client.profile" data-mw-thread-id="h-jQuery.client.profile-jquery.client"><span data-mw-comment-start="" id="h-jQuery.client.profile-jquery.client"></span>jQuery.client.profile<span data-mw-comment-end="h-jQuery.client.profile-jquery.client"></span></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=59" title="Edit section's source code: jQuery.client.profile"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Here a few examples: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">$</span><span class="p">.</span><span class="nx">client</span><span class="p">.</span><span class="nx">profile</span><span class="p">().</span><span class="nx">layout</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s1">'gecko'</span><span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="nx">$</span><span class="p">.</span><span class="nx">client</span><span class="p">.</span><span class="nx">profile</span><span class="p">().</span><span class="nx">platform</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s1">'linux'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// This will only run on Gecko browsers (ie. Mozilla Firefox) on Linux.</span> <span class="p">}</span> <span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">$</span><span class="p">.</span><span class="nx">client</span><span class="p">.</span><span class="nx">profile</span><span class="p">().</span><span class="nx">name</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s1">'msie'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// Only for good ol' Internet Explorer</span> <span class="p">}</span> <span class="c1">// Shortcut</span> <span class="kd">var</span><span class="w"> </span><span class="nx">prof</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">$</span><span class="p">.</span><span class="nx">client</span><span class="p">.</span><span class="nx">profile</span><span class="p">();</span> <span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="nx">prof</span><span class="p">.</span><span class="nx">name</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s1">'firefox'</span><span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="nx">prof</span><span class="p">.</span><span class="nx">versionBase</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s1">'2'</span><span class="w"> </span><span class="o">&&</span><span class="w"> </span><span class="nx">prof</span><span class="p">.</span><span class="nx">platform</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s1">'win'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// Target Mozilla Firefox 2.x on Windows</span> <span class="p">}</span> </pre></div> <p>Check <a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/lib/jquery.client/jquery.client.js" class="extiw" title="git:mediawiki/core/+/HEAD/resources/lib/jquery.client/jquery.client.js">jquery.client.js</a> for possible values of browser names, layout engines and platforms. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.color" data-mw-thread-id="h-jquery.color"><span data-mw-comment-start="" id="h-jquery.color"></span>jquery.color<span data-mw-comment-end="h-jquery.color"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=60" title="Edit section's source code: jquery.color"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.color","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.17</div></td> </tr></tbody></table> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/jQuery.colorUtil.html">JS Documentation: $.colorUtil</a></span></li> <li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/jquery.color" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/jquery.color">Source code</a></li></ul> <div style="clear: both;"></div> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.cookie" data-mw-thread-id="h-jquery.cookie"><span data-mw-comment-start="" id="h-jquery.cookie"></span>jquery.cookie<span data-mw-comment-end="h-jquery.cookie"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=61" title="Edit section's source code: jquery.cookie"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.cookie","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-legacy"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="MediaWiki 1.41 is a legacy version"><div class="mw-version-versionnumber"><small>≤</small> 1.41</div></td> </tr></tbody></table> <p><span style="color:#d33">(deprecated in 1.41)</span> </p> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-mediawiki.cookie.html#.$.cookie">JS Documentation</a></span></li></ul> <p>To use jQuery cookie methods, load the <code><a href="#mediawiki.cookie">mediawiki.cookie</a></code> module. It is recommended that you use <code>mw.cookie</code> interface as it automatically applies appropiate settings based onMediaWiki site configuration (such as domain, path, and retention). </p><p>This plugin allows you to set, get and delete cookies. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// Set cookie (simple, current page/path)</span> <span class="nx">$</span><span class="p">.</span><span class="nx">cookie</span><span class="p">(</span><span class="w"> </span><span class="s1">'myName'</span><span class="p">,</span><span class="w"> </span><span class="s1">'Flower'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// Set cookie (extra options)</span> <span class="nx">$</span><span class="p">.</span><span class="nx">cookie</span><span class="p">(</span><span class="w"> </span><span class="s1">'myName'</span><span class="p">,</span><span class="w"> </span><span class="s1">'Flower'</span><span class="p">,</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">expires</span><span class="o">:</span><span class="w"> </span><span class="mf">7</span><span class="p">,</span><span class="w"> </span><span class="c1">// expires in 7 days</span> <span class="w"> </span><span class="nx">path</span><span class="o">:</span><span class="w"> </span><span class="s1">'/'</span><span class="w"> </span><span class="c1">// domain-wide, entire wiki</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> <span class="c1">// Get cookie</span> <span class="kd">var</span><span class="w"> </span><span class="nx">name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">$</span><span class="p">.</span><span class="nx">cookie</span><span class="p">(</span><span class="w"> </span><span class="s1">'myName'</span><span class="w"> </span><span class="p">);</span> <span class="c1">// Delete cookie</span> <span class="c1">// Deprecated since 1.2 please use $.removeCookie( 'foo' ) instead</span> <span class="nx">$</span><span class="p">.</span><span class="nx">cookie</span><span class="p">(</span><span class="w"> </span><span class="s1">'myName'</span><span class="p">,</span><span class="w"> </span><span class="kc">null</span><span class="w"> </span><span class="p">);</span> <span class="nx">$</span><span class="p">.</span><span class="nx">removeCookie</span><span class="p">(</span><span class="w"> </span><span class="s1">'foo'</span><span class="w"> </span><span class="p">)</span> </pre></div> <p>When deleting a cookie, you must use the same path and domain used when the cookie was set. </p><p>Note that when MediaWiki server-side code sets a cookie it usually prefixes it with the database name; this prefix is available to JavaScript code as the <code>mw.config</code> variable <code>wgCookiePrefix</code>. </p><p>Note that users will likely get separate cookies for <code>/wiki/</code> and <code>/w/</code> paths in page URLs if you do not specify the extra option <code>{ path: '/' }</code> when setting a cookie. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.i18n" data-mw-thread-id="h-jquery.i18n"><span data-mw-comment-start="" id="h-jquery.i18n"></span>jquery.i18n<span data-mw-comment-end="h-jquery.i18n"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=62" title="Edit section's source code: jquery.i18n"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.i18n","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.26</div><small><a href="https://gerrit.wikimedia.org/r/223201" class="extiw" title="gerrit:223201">Gerrit change 223201</a></small></td> </tr></tbody></table> <ul><li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/lib/jquery.i18n/" class="extiw" title="git:mediawiki/core/+/HEAD/resources/lib/jquery.i18n/">jquery.i18n</a></li></ul> <div style="clear: both;"></div> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.makeCollapsible" data-mw-thread-id="h-jquery.makeCollapsible"><span data-mw-comment-start="" id="h-jquery.makeCollapsible"></span>jquery.makeCollapsible<span data-mw-comment-end="h-jquery.makeCollapsible"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=63" title="Edit section's source code: jquery.makeCollapsible"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.makeCollapsible","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.18</div><small><span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/78914.html">r78914</a></span></small></td> </tr></tbody></table> <dl><dd><i>See also <a href="/wiki/Manual:Collapsible_elements" title="Manual:Collapsible elements">Manual:Collapsible elements</a>.</i></dd></dl> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-jquery.makeCollapsible.html">JS Documentation</a></span></li> <li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/jquery/jquery.makeCollapsible.js" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/jquery/jquery.makeCollapsible.js">jquery.makeCollapsible</a></li></ul> <p>Makes elements collapsible. It supports lots of variations such as: </p> <dl><dt>Simple</dt> <dd>Add "<code>mw-collapsible</code>" to an element (a <code><div></code> for example) with some content and save the page. The inner content of this element will be treated as collapsible content. Prepended to the element, before the collapsible content, is a toggle-link with a localized label (<a href="/wiki/MediaWiki:Collapsible-expand" title="MediaWiki:Collapsible-expand">collapsible-expand</a>, <a href="/wiki/MediaWiki:Collapsible-collapse" title="MediaWiki:Collapsible-collapse">collapsible-collapse</a>)</dd> <dt>Initial state</dt> <dd>Adding "<code>mw-collapsed</code>" as additional class will cause the element to be initially collapsed when the page is loaded.</dd> <dt>Custom label</dt> <dd><sup>HTML5 only</sup> Using the <code>data-collapsetext</code> and <code>data-expandtext</code> attributes one can define a custom text for the toggle labels added by the script. When added in wikitext these could be populated by a localized message like:<br/><code class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr"><span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"mw-collapsible"</span> <span class="na">data-expandtext</span><span class="o">=</span><span class="s">"{{int:show}}"</span> <span class="na">data-collapsetext</span><span class="o">=</span><span class="s">"{{int:hide}}"</span><span class="p">></span></code></dd> <dt>Remote toggle</dt> <dd>If you don't want the script to put the default toggle link (whether or not with a custom label) in your element, you can make one of your own. This could reside anywhere inside <i>or</i> outside the collapsible element. Its relationship to the collapsible element is detected by using an ID attribute with the prefix <code>mw-customcollapsible</code> and a corresponding class attribute with prefix <code>mw-customtoggle</code> for the collapsible element and the togglelink respectively.</dd></dl> <div style="font-size: larger;"><b>Example: Simple collapsible div or table</b></div> <p><b>Input:</b> </p> <div class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr"><pre><span></span>{| class="wikitable" ! Foo ! Bar |- | Lorem | Ipsum |- | More info |<span class="cm"><!--</span> <span class="cm">--></span> {| class="wikitable mw-collapsible mw-collapsed" style="width: 100%;" ! Head ! Top |- | Cell | content |- | This table is collapsible | Because it has the "mw-collapsible" class |- | It was initially hidden, because it | had the "mw-collapsed" class |}<span class="cm"><!--</span> <span class="cm">--></span> |- |} <span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"toccolours mw-collapsible"</span> <span class="na">style</span><span class="o">=</span><span class="s">"width: 400px;"</span><span class="p">></span> This is text is collapsible. {{Lorem}} <span class="p"></</span><span class="nt">div</span><span class="p">></span> </pre></div> <p><b>Output:</b> </p> <table class="wikitable"> <tbody><tr> <th>Foo </th> <th>Bar </th></tr> <tr> <td>Lorem </td> <td>Ipsum </td></tr> <tr> <td>More info </td> <td> <table class="wikitable mw-collapsible mw-collapsed" style="width: 100%;"> <tbody><tr> <th>Head </th> <th>Top </th></tr> <tr> <td>Cell </td> <td>content </td></tr> <tr> <td>This table is collapsible </td> <td>Because it has the "mw-collapsible" class </td></tr> <tr> <td>It was initially hidden, because it </td> <td>had the "mw-collapsed" class </td></tr></tbody></table> </td></tr></tbody></table> <div class="toccolours mw-collapsible" style="width: 400px;"> This is text is collapsible. <a href="https://en.wikipedia.org/wiki/Lorem_ipsum" class="extiw" title="w:Lorem ipsum">Lorem ipsum</a> dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<div style="clear: both;"></div> </div> <p><br/> </p> <div style="clear: both;"></div> <hr/> <p><b>Example: Hide the collapsible element by default, the toggle element resides outside of it</b> </p><p><b>Input:</b> </p> <div class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr"><pre><span></span><span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"mw-customtoggle-myDivision"</span> <span class="na">style</span><span class="o">=</span><span class="s">"background:#e0e8ff"</span><span class="p">></span>Click here to toggle the element<span class="p"></</span><span class="nt">div</span><span class="p">></span> <span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"mw-collapsible mw-collapsed"</span> <span class="na">id</span><span class="o">=</span><span class="s">"mw-customcollapsible-myDivision"</span><span class="p">></span> <span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"toccolours mw-collapsible-content"</span><span class="p">></span>Lorem ipsum dolor sit amet...<span class="p"></</span><span class="nt">div</span><span class="p">></span> <span class="p"></</span><span class="nt">div</span><span class="p">></span> <span class="p"><</span><span class="nt">div</span> <span class="na">class</span><span class="o">=</span><span class="s">"mw-customtoggle-myDivision"</span> <span class="na">style</span><span class="o">=</span><span class="s">"background:#e8ffe0"</span><span class="p">></span>Clicking will toggle it also!<span class="p"></</span><span class="nt">div</span><span class="p">></span> </pre></div> <p><b>Output:</b> </p> <div class="mw-customtoggle-myDivision" style="background:#e0e8ff">Click here to toggle the element</div> <div class="mw-collapsible mw-collapsed" id="mw-customcollapsible-myDivision"> <div class="toccolours mw-collapsible-content">Lorem ipsum dolor sit amet...</div> </div> <div class="mw-customtoggle-myDivision" style="background:#e8ffe0">Clicking will toggle it also!</div> <p>For other live examples, see <a href="/wiki/Manual:Collapsible_elements/Demo/Advanced" title="Manual:Collapsible elements/Demo/Advanced">Test Wikipedia - Collapsing Testpage</a>. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.suggestions" data-mw-thread-id="h-jquery.suggestions"><span data-mw-comment-start="" id="h-jquery.suggestions"></span>jquery.suggestions<span data-mw-comment-end="h-jquery.suggestions"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=64" title="Edit section's source code: jquery.suggestions"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.suggestions","replies":[]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-jquery.suggestions.html">JS Documentation</a></span></li></ul> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.spinner" data-mw-thread-id="h-jquery.spinner"><span data-mw-comment-start="" id="h-jquery.spinner"></span>jquery.spinner<span data-mw-comment-end="h-jquery.spinner"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=65" title="Edit section's source code: jquery.spinner"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.spinner","replies":[]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-jquery.spinner.html">JS Documentation</a></span></li></ul> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.tabIndex" data-mw-thread-id="h-jquery.tabIndex"><span data-mw-comment-start="" id="h-jquery.tabIndex"></span>jquery.tabIndex<span data-mw-comment-end="h-jquery.tabIndex"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=66" title="Edit section's source code: jquery.tabIndex"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.tabIndex","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-version2 mw-version-version2-unsupported"><tbody><tr> <td>MediaWiki versions:</td> <td class="mw-version-versionbox" title="MediaWiki 1.35 is an unsupported version"><div class="mw-version-versionnumber"> 1.18 – 1.35</div><small><span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/86088.html">r86088</a></span></small></td> </tr></tbody></table> <p><span style="color:#d33">(deprecated in 1.34)</span> </p> <ul><li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/jquery/jquery.tabIndex.js" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/jquery/jquery.tabIndex.js">jquery.tabIndex</a></li></ul> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.tablesorter" data-mw-thread-id="h-jquery.tablesorter"><span data-mw-comment-start="" id="h-jquery.tablesorter"></span>jquery.tablesorter<span data-mw-comment-end="h-jquery.tablesorter"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=67" title="Edit section's source code: jquery.tablesorter"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.tablesorter","replies":[]}}--></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r4199130"> <table class="mw-version mw-version-ltr mw-version-version mw-version-version-unsupported mw-version-and-later"><tbody><tr> <td>MediaWiki version:</td> <td class="mw-version-versionbox" title="The latest stable version is 1.42"><div class="mw-version-versionnumber"><small>≥</small> 1.18</div><small><span class="plainlinks"><a class="external text" href="https://static-codereview.wikimedia.org/MediaWiki/86088.html">r86088</a></span></small></td> </tr></tbody></table> <ul><li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/jquery.tablesorter/jquery.tablesorter.js" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/jquery.tablesorter/jquery.tablesorter.js">jquery.tablesorter</a></li></ul> <div style="clear: both;"></div> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.textSelection" data-mw-thread-id="h-jquery.textSelection"><span data-mw-comment-start="" id="h-jquery.textSelection"></span>jquery.textSelection<span data-mw-comment-end="h-jquery.textSelection"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=68" title="Edit section's source code: jquery.textSelection"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.textSelection","replies":[]}}--></div> <ul><li><span class="plainlinks"><a class="external text" href="https://doc.wikimedia.org/mediawiki-core/master/js/module-jquery.textSelection.html">JS Documentation</a></span></li> <li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/jquery/jquery.textSelection.js" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/jquery/jquery.textSelection.js">Source code</a></li></ul> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">mw</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">jsMessage</span><span class="p">(</span><span class="w"> </span><span class="s1">'The selected text is "'</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">mw</span><span class="p">.</span><span class="nx">html</span><span class="p">.</span><span class="nx">escape</span><span class="p">(</span><span class="w"> </span><span class="nx">$</span><span class="p">(</span><span class="w"> </span><span class="s1">'#wpTextbox1'</span><span class="w"> </span><span class="p">).</span><span class="nx">textSelection</span><span class="p">(</span><span class="w"> </span><span class="s1">'getSelection'</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s1">'".'</span><span class="w"> </span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.tipsy" data-mw-thread-id="h-jquery.tipsy"><span data-mw-comment-start="" id="h-jquery.tipsy"></span>jquery.tipsy<span data-mw-comment-end="h-jquery.tipsy"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=69" title="Edit section's source code: jquery.tipsy"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.tipsy","replies":[]}}--></div> <p><span style="color:#d33">(deprecated in 1.28)</span> </p> <ul><li><a href="https://gerrit.wikimedia.org/g/mediawiki/core/%2B/HEAD/resources/src/jquery.tipsy/" class="extiw" title="git:mediawiki/core/+/HEAD/resources/src/jquery.tipsy/">jquery.tipsy</a></li></ul> <p>The library will be available for the forseeable future, but overlaps with functionality within <a href="/wiki/OOUI" title="OOUI">OOUI</a> and provides a suboptimal experience to mobile users. Where jQuery.tipsy is being used, we encourage developers to inspect OOUI and feedback on how the library might be improved to support the usecase that jquery.tipsy provides. </p><p><a rel="nofollow" class="external text" href="http://onehackoranother.com/projects/jquery/tipsy">Example page</a>; <a rel="nofollow" class="external text" href="http://plugins.jquery.com/project/tipsy">jQuery project page</a> </p> <table class="wikitable sortable"> <tbody><tr> <th>Option </th> <th>Type </th> <th>Possible values </th> <th>Default </th> <th>Description </th></tr> <tr> <td>gravity </td> <td>string / call-back function </td> <td>'nw' | 'n' | 'ne' | 'w' | 'e' | 'sw' | 's' | 'se' / $.fn.tipsy.autoNS | $.fn.tipsy.autoWE | pointer or anonymous </td> <td>'n' </td> <td>sets the positioning of the tooltip relative to the element </td></tr> <tr> <td>fade </td> <td>bool </td> <td>true | false </td> <td>true </td> <td>use fading effect (fadeIn / fadeOut) </td></tr> <tr> <td>title </td> <td>string (an attribute) / call-back function </td> <td>style, class, id, ..., function () { return 'some string'; } </td> <td>title <small>(or if not specified fallback-value; see below)</small> </td> <td>Which string to display as a "tool-tip"? </td></tr> <tr> <td>fallback </td> <td>string </td> <td>'valid string' </td> <td> </td> <td>used if an element has no tooltip </td></tr> <tr> <td>html </td> <td>bool </td> <td>true | false </td> <td>false </td> <td>interpret the tooltip text as HTML </td></tr> <tr> <td>delayIn </td> <td>number in ms </td> <td>0, 1, 2, ... </td> <td>0 </td> <td>How long to wait after onmouseover to show the tip? </td></tr> <tr> <td>delayOut </td> <td>number in ms </td> <td>0, 1, 2, ... </td> <td>0 </td> <td>How long to wait after onmouseout to close the tip? </td></tr> <tr> <td>trigger </td> <td>string </td> <td>'focus' | 'manual' | 'hover' </td> <td>hover </td> <td>When to show the tooltip (useful for forms) </td></tr> <tr> <td>live </td> <td>bool </td> <td>true | false </td> <td>false </td> <td>dynamical add to selectors- see JQuery's live interpretation </td></tr> <tr> <td>offset </td> <td>number in px </td> <td> </td> <td>0 </td> <td>offset from tooltip to element </td></tr> <tr> <td>opacity </td> <td>number (float) </td> <td> </td> <td>1.0 </td> <td>opacity of the tooltip </td></tr></tbody></table> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">mw</span><span class="p">.</span><span class="nx">loader</span><span class="p">.</span><span class="nx">using</span><span class="p">(</span><span class="w"> </span><span class="s1">'jquery.tipsy'</span><span class="p">,</span><span class="w"> </span><span class="kd">function</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">$someObject</span><span class="p">.</span><span class="nx">prepend</span><span class="p">(</span> <span class="w"> </span><span class="nx">$</span><span class="p">(</span><span class="w"> </span><span class="s1">'<span>'</span><span class="p">,</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">title</span><span class="o">:</span><span class="w"> </span><span class="s1">'Some tipsy test title'</span> <span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">)</span> <span class="w"> </span><span class="p">.</span><span class="nx">append</span><span class="p">(</span><span class="w"> </span><span class="s1">'Hover here'</span><span class="w"> </span><span class="p">)</span> <span class="w"> </span><span class="p">.</span><span class="nx">tipsy</span><span class="p">(</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">option</span><span class="o">:</span><span class="w"> </span><span class="s1">'value'</span><span class="p">,</span> <span class="w"> </span><span class="nx">option2</span><span class="o">:</span><span class="w"> </span><span class="s1">'value2'</span> <span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">)</span> <span class="w"> </span><span class="p">);</span> <span class="p">}</span><span class="w"> </span><span class="p">);</span> </pre></div> <p><span class="anchor" id="jQuery_UI"></span> </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="jquery.ui" data-mw-thread-id="h-jquery.ui"><span data-mw-comment-start="" id="h-jquery.ui"></span>jquery.ui<span data-mw-comment-end="h-jquery.ui"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=70" title="Edit section's source code: jquery.ui"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.ui","replies":[]}}--></div> <p><span style="color:#d33">(deprecated in 1.29)</span> Please use <a href="/wiki/Codex" title="Codex">Codex</a> instead. </p><p>For more information on and demos for jQuery UI, refer to <a rel="nofollow" class="external free" href="http://jqueryui.com/">http://jqueryui.com/</a>. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="site" data-mw-thread-id="h-site"><span data-mw-comment-start="" id="h-site"></span>site<span data-mw-comment-end="h-site"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=71" title="Edit section's source code: site"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-site","replies":[]}}--></div> <p>This module loads site scripts from the pages: </p> <ul><li><code>MediaWiki:Common.js</code>,</li> <li>and <code>MediaWiki:Vector.js</code> (depending on the current skin).</li></ul> <p>If <code><a href="/wiki/Special:MyLanguage/Manual:$wgUseSiteJs" title="Special:MyLanguage/Manual:$wgUseSiteJs">$wgUseSiteJs</a><span style="display:none"><a href="/wiki/Manual:$wgUseSiteJs" title="Manual:$wgUseSiteJs"> </a></span></code> is disabled by configuration, then the module is empty. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="user" data-mw-thread-id="h-user"><span data-mw-comment-start="" id="h-user"></span>user<span data-mw-comment-end="h-user"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=72" title="Edit section's source code: user"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-user","replies":[]}}--></div> <p>This module loads: </p> <ul><li><code>User:<name>/common.js</code>,</li> <li><code>User:<name>/vector.js</code> (depending on current skin),</li> <li><code>MediaWiki:Group-user.js</code>,</li> <li><code>MediaWiki:Group-<groupname>.js</code> (for each group the current user is a member of, e.g. "sysop", "bureaucrat" etc.)</li></ul> <p>If <code><a href="/wiki/Special:MyLanguage/Manual:$wgAllowUserJs" title="Special:MyLanguage/Manual:$wgAllowUserJs">$wgAllowUserJs</a><span style="display:none"><a href="/wiki/Manual:$wgAllowUserJs" title="Manual:$wgAllowUserJs"> </a></span></code> is disabled by configuration, then the "User" sub pages are not included. </p><p>If <code><a href="/wiki/Special:MyLanguage/Manual:$wgUseSiteJs" title="Special:MyLanguage/Manual:$wgUseSiteJs">$wgUseSiteJs</a><span style="display:none"><a href="/wiki/Manual:$wgUseSiteJs" title="Manual:$wgUseSiteJs"> </a></span></code> is disabled by configuration, then the "MediaWiki:Group-" pages are not included. </p> <div class="mw-heading mw-heading2 ext-discussiontools-init-section"><h2 id="See_also" data-mw-thread-id="h-See_also"><span data-mw-comment-start="" id="h-See_also"></span>See also<span data-mw-comment-end="h-See_also"></span></h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=ResourceLoader/Core_modules&action=edit&section=73" title="Edit section's source code: See also"><span>edit source</span></a><span class="mw-editsection-bracket">]</span></span><!--__DTELLIPSISBUTTON__{"threadItem":{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-See_also","replies":[]}}--></div> <ul><li><a rel="nofollow" class="external text" href="https://www.npmjs.com/package/types-mediawiki">TypeScript definitions</a> for the modules listed here (work in JavaScript projects as well in popular IDEs)</li></ul> <!-- NewPP limit report Parsed by mw‐api‐ext.codfw.main‐b68f86986‐s5s77 Cached time: 20241119085927 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] DiscussionTools time usage: 0.122 seconds CPU time usage: 1.200 seconds Real time usage: 5.414 seconds Preprocessor visited node count: 17344/1000000 Post‐expand include size: 105727/2097152 bytes Template argument size: 25113/2097152 bytes Highest expansion depth: 16/100 Expensive parser function count: 127/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 142049/5000000 bytes Lua time usage: 0.281/10.000 seconds Lua memory usage: 1655384/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 5109.903 1 -total 9.18% 468.860 1 Template:Languages 7.70% 393.590 157 Template:Languages/Lang 6.86% 350.407 190 Template:Translatable 6.22% 317.632 173 Template:Pagelang 6.12% 312.676 1 Template:Nmbox 4.30% 219.946 1 Template:MW_1.19 3.61% 184.695 27 Template:MW_version/layout 2.99% 152.718 18 Template:MW_version 2.84% 145.076 14 Template:MWv --> <!-- Saved in parser cache with key mediawikiwiki:pcache:idhash:52788-0!canonical and timestamp 20241119085922 and revision id 6860134. Rendering was triggered because: edit-page --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://www.mediawiki.org/w/index.php?title=ResourceLoader/Core_modules&oldid=6860134">https://www.mediawiki.org/w/index.php?title=ResourceLoader/Core_modules&oldid=6860134</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Special:Categories" title="Special:Categories">Categories</a>: <ul><li><a href="/wiki/Category:ResourceLoader" title="Category:ResourceLoader">ResourceLoader</a></li><li><a href="/wiki/Category:JavaScript" title="Category:JavaScript">JavaScript</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Hidden category: <ul><li><a href="/wiki/Category:Languages_pages" title="Category:Languages pages">Languages pages</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 19 November 2024, at 08:59.</li> <li id="footer-info-copyright">Text is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-ShareAlike License</a>; additional terms may apply. Text in <a class="external text" href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents">the Help: namespace</a> is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/publicdomain/zero/1.0/">Creative Commons CC0 License</a>. By using this site, you agree to the <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Terms of Use</a> and <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy Policy</a>.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Project:About">About mediawiki.org</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Project:General_disclaimer">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/www.mediawiki.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//m.mediawiki.org/w/index.php?title=ResourceLoader/Core_modules&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-66695f89d8-hzsnb","wgBackendResponseTime":162,"wgDiscussionToolsPageThreads":[{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.config-mediawiki","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.hook-mediawiki","replies":[{"headingLevel":4,"name":"h-","type":"heading","level":0,"id":"h-hook_execution_order-mw.hook","replies":[]}]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.html-mediawiki","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.inspect-mediawiki","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.log-mediawiki","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.message-mediawiki","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.now-mediawiki","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.track-mediawiki","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.notify-mediawiki","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mw.loader","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.loader.load-mw.loader","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.loader.using-mw.loader","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.loader.getScript-mw.loader","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.user","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.user.clientPrefs-mediawiki.user","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-user.options","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.user.options-user.options","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-mw.user.tokens-user.options","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.api","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.cookie","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.errorLogger","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.feedback","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mw.ForeignApi","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mw.ForeignRest","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mw.ForeignUpload","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.jqueryMsg","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.router","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.storage","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.ui","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.widgets","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.util","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-addCSS-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-addPortlet-mediawiki.util","replies":[{"headingLevel":4,"name":"h-","type":"heading","level":0,"id":"h-Styling_portlets-addPortlet","replies":[]},{"headingLevel":4,"name":"h-","type":"heading","level":0,"id":"h-Appending_portlets_in_different_locations-addPortlet","replies":[]},{"headingLevel":4,"name":"h-","type":"heading","level":0,"id":"h-Dropdowns_(Vector-only)-addPortlet","replies":[]}]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-addPortletLink-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-hidePortlet-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-addSubtitle-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-clearSubtitle-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-$content-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-getParamValue-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-isIPv4Address-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-messageBox-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-isIPv6Address-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-rawurlencode-mediawiki.util","replies":[]},{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-wikiScript-mediawiki.util","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.RegExp","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.Title","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-mediawiki.Uri","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-moment","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-oojs","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-oojs-ui","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.chosen","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.client","replies":[{"headingLevel":3,"name":"h-","type":"heading","level":0,"id":"h-jQuery.client.profile-jquery.client","replies":[]}]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.color","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.cookie","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.i18n","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.makeCollapsible","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.suggestions","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.spinner","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.tabIndex","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.tablesorter","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.textSelection","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.tipsy","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-jquery.ui","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-site","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-user","replies":[]},{"headingLevel":2,"name":"h-","type":"heading","level":0,"id":"h-See_also","replies":[]}],"wgPageParseReport":{"discussiontools":{"limitreport-timeusage":"0.122"},"limitreport":{"cputime":"1.200","walltime":"5.414","ppvisitednodes":{"value":17344,"limit":1000000},"postexpandincludesize":{"value":105727,"limit":2097152},"templateargumentsize":{"value":25113,"limit":2097152},"expansiondepth":{"value":16,"limit":100},"expensivefunctioncount":{"value":127,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":142049,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 5109.903 1 -total"," 9.18% 468.860 1 Template:Languages"," 7.70% 393.590 157 Template:Languages/Lang"," 6.86% 350.407 190 Template:Translatable"," 6.22% 317.632 173 Template:Pagelang"," 6.12% 312.676 1 Template:Nmbox"," 4.30% 219.946 1 Template:MW_1.19"," 3.61% 184.695 27 Template:MW_version/layout"," 2.99% 152.718 18 Template:MW_version"," 2.84% 145.076 14 Template:MWv"]},"scribunto":{"limitreport-timeusage":{"value":"0.281","limit":"10.000"},"limitreport-memusage":{"value":1655384,"limit":52428800}},"cachereport":{"origin":"mw-api-ext.codfw.main-b68f86986-s5s77","timestamp":"20241119085927","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"ResourceLoader\/Core modules","url":"https:\/\/www.mediawiki.org\/wiki\/ResourceLoader\/Core_modules","sameAs":"http:\/\/www.wikidata.org\/entity\/Q115519963","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q115519963","author":{"@type":"Organization","name":"Contributors to Wikimedia projects"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2010-11-18T22:47:33Z","dateModified":"2024-11-19T08:59:22Z","headline":"part of MediaWiki"}</script> </body> </html>