CINXE.COM
View source for MediaWiki:Gadget-AuthorityControl.js - Wikidata
<!DOCTYPE html> <html class="client-nojs" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>View source for MediaWiki:Gadget-AuthorityControl.js - Wikidata</title> <script>(function(){var className="client-js";var cookie=document.cookie.match(/(?:^|; )wikidatawikimwclientpreferences=([^;]+)/);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":true,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"14eeb67a-dfb8-4c09-8410-cd228b3ffc9f","wgCanonicalNamespace":"MediaWiki","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":8,"wgPageName":"MediaWiki:Gadget-AuthorityControl.js","wgTitle":"Gadget-AuthorityControl.js","wgCurRevisionId":2267592219,"wgRevisionId":0,"wgArticleId":6349379,"wgIsArticle":false,"wgIsRedirect":false,"wgAction":"edit","wgUserName": null,"wgUserGroups":["*"],"wgCategories":[],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"javascript","wgRelevantPageName":"MediaWiki:Gadget-AuthorityControl.js","wgRelevantArticleId":6349379,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikidata","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":10000,"wgCodeEditorCurrentLanguage":"javascript","wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"personal","wgULSisCompactLinksEnabled":true,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false, "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.codeEditor.styles":"ready","skins.vector.styles.legacy":"ready","ext.charinsert.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","codex-search-styles":"ready","ext.uls.pt":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.codeEditor","mediawiki.action.edit.collapsibleFooter","site","mediawiki.page.ready","skins.vector.legacy.js","wikibase.ui.entitysearch","ext.centralNotice.geoIP","ext.charinsert","ext.gadget.Search","ext.gadget.ProtectionIndicators","ext.gadget.imagelinks","ext.gadget.formWizard","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader", "ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.wikimediaEvents.wikibase","ext.navigationTiming","ext.uls.compactlinks","ext.uls.interface","ext.checkUser.clientHints"];</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=codex-search-styles%7Cext.charinsert.styles%7Cext.codeEditor.styles%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cskins.vector.styles.legacy&only=styles&skin=vector"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector"> <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="noindex,nofollow,max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//m.wikidata.org/wiki/MediaWiki:Gadget-AuthorityControl.js"> <link rel="apple-touch-icon" href="/static/apple-touch/wikidata.png"> <link rel="icon" href="/static/favicon/wikidata.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikidata (en)"> <link rel="EditURI" type="application/rsd+xml" href="//www.wikidata.org/w/api.php?action=rsd"> <link rel="canonical" href="https://www.wikidata.org/wiki/MediaWiki:Gadget-AuthorityControl.js"> <link rel="license" href="/wiki/Wikidata:Copyright"> <link rel="alternate" type="application/atom+xml" title="Wikidata Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="codeeditor-loading skin-vector-legacy mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-8 ns-subject page-MediaWiki_Gadget-AuthorityControl_js rootpage-MediaWiki_Gadget-AuthorityControl_js skin-vector action-edit"><div id="mw-page-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div> <div id="content" class="mw-body" role="main"> <a id="top"></a> <div id="siteNotice"><!-- CentralNotice --></div> <div class="mw-indicators"> </div> <h1 id="firstHeading" class="firstHeading mw-first-heading">View source for MediaWiki:Gadget-AuthorityControl.js</h1> <div id="bodyContent" class="vector-body"> <div id="contentSub"><div id="mw-content-subtitle">← <a href="/wiki/MediaWiki:Gadget-AuthorityControl.js" title="MediaWiki:Gadget-AuthorityControl.js">MediaWiki:Gadget-AuthorityControl.js</a></div></div> <div id="contentSub2"></div> <div id="jump-to-nav"></div> <a class="mw-jump-link" href="#mw-head">Jump to navigation</a> <a class="mw-jump-link" href="#searchInput">Jump to search</a> <div id="mw-content-text" class="mw-body-content"><p><br /> </p> <ul class="permissions-errors"><li class="mw-permissionerror-protectedinterface"><style data-mw-deduplicate="TemplateStyles:r2202362292">.mw-parser-output th.mbox-text,.mw-parser-output td.mbox-text{border:none;padding:0.25em 0.9em;width:100%}.mw-parser-output td.mbox-image{border:none;padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output td.mbox-imageright{border:none;padding:2px 0.9em 2px 0;text-align:center}.mw-parser-output td.mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output table.ambox{margin:0 10%;border:1px solid var(--border-color-base,#a2a9b1);border-left:10px solid var(--border-color-progressive,#36c);background-color:var(--background-color-interactive-subtle,#f8f9fa);box-sizing:border-box}.mw-parser-output table.ambox+table.ambox{margin-top:-1px}.mw-parser-output .ambox th.mbox-text,.mw-parser-output .ambox td.mbox-text{padding:0.25em 0.5em}.mw-parser-output .ambox td.mbox-image{padding:2px 0 2px 0.5em}.mw-parser-output .ambox td.mbox-imageright{padding:2px 0.5em 2px 0}.mw-parser-output table.ambox-notice{border-left:10px solid var(--border-color-progressive,#36c)}.mw-parser-output table.ambox-speedy{border-left:10px solid var(--border-color-error,#b32424);background-color:#fee7e6}.mw-parser-output table.ambox-delete{border-left:10px solid var(--border-color-error,#b32424)}.mw-parser-output table.ambox-content{border-left:10px solid #f28500}.mw-parser-output table.ambox-style{border-left:10px solid var(--border-color-content-removed,#fc3)}.mw-parser-output table.ambox-move{border-left:10px solid #9932cc}.mw-parser-output table.ambox-protection{border-left:10px solid var(--border-color-base,#a2a9b1)}.mw-parser-output table.imbox{margin:4px 10%;border-collapse:collapse;border:3px solid var(--border-color-progressive,#36c);background-color:var(--background-color-neutral-subtle,#f8f9fa);box-sizing:border-box}.mw-parser-output .imbox .mbox-text .imbox{margin:0 -0.5em;display:block}.mw-parser-output .mbox-inside .imbox{margin:4px}.mw-parser-output table.imbox-notice{border:3px solid var(--border-color-progressive,#36c)}.mw-parser-output table.imbox-speedy{border:3px solid var(--border-color-error,#b32424);background-color:#fee7e6}.mw-parser-output table.imbox-delete{border:3px solid var(--border-color-error,#b32424)}.mw-parser-output table.imbox-content{border:3px solid #f28500}.mw-parser-output table.imbox-style{border:3px solid var(--border-color-content-removed,#fc3)}.mw-parser-output table.imbox-move{border:3px solid #9932cc}.mw-parser-output table.imbox-protection{border:3px solid var(--border-color-base,#a2a9b1)}.mw-parser-output table.imbox-license{border:3px solid #88a;background-color:#f7f8ff}.mw-parser-output table.imbox-featured{border:3px solid #cba135}.mw-parser-output table.cmbox{margin:3px 10%;border-collapse:collapse;border:1px solid var(--border-color-base,#a2a9b1);background-color:#dfe8ff;box-sizing:border-box}.mw-parser-output table.cmbox-notice{background-color:#d8e8ff}.mw-parser-output table.cmbox-speedy{margin-top:4px;margin-bottom:4px;border:4px solid var(--border-color-error,#b32424);background-color:#ffdbdb}.mw-parser-output table.cmbox-delete{background-color:#ffdbdb}.mw-parser-output table.cmbox-content{background-color:#ffe7ce}.mw-parser-output table.cmbox-style{background-color:#fff9db}.mw-parser-output table.cmbox-move{background-color:#e4d8ff}.mw-parser-output table.cmbox-protection{background-color:#efefe1}.mw-parser-output table.ombox{margin:4px 10%;border-collapse:collapse;border:1px solid var(--border-color-base,#a2a9b1);background-color:var(--background-color-neutral-subtle,#f8f9fa);box-sizing:border-box}.mw-parser-output table.ombox-notice{border:1px solid var(--border-color-base,#a2a9b1)}.mw-parser-output table.ombox-speedy{border:2px solid var(--border-color-error,#b32424);background-color:#fee7e6}.mw-parser-output table.ombox-delete{border:2px solid var(--border-color-error,#b32424)}.mw-parser-output table.ombox-content{border:1px solid #f28500}.mw-parser-output table.ombox-style{border:1px solid var(--border-color-content-removed,#fc3)}.mw-parser-output table.ombox-move{border:1px solid #9932cc}.mw-parser-output table.ombox-protection{border:2px solid var(--border-color-base,#a2a9b1)}.mw-parser-output table.tmbox{margin:4px 10%;border-collapse:collapse;border:1px solid var(--border-color-base,#a2a9b1);background-color:var(--background-color-neutral-subtle,#f8f9fa);min-width:80%;box-sizing:border-box}.mw-parser-output .tmbox.mbox-small{min-width:0}.mw-parser-output .mediawiki .mbox-inside .tmbox{margin:2px 0;width:100%}.mw-parser-output .mbox-inside .tmbox.mbox-small{line-height:1.5em;font-size:100%}.mw-parser-output table.tmbox-speedy{border:2px solid var(--border-color-error,#b32424);background-color:#fee7e6}.mw-parser-output table.tmbox-delete{border:2px solid var(--border-color-error,#b32424)}.mw-parser-output table.tmbox-content{border:2px solid #f28500}.mw-parser-output table.tmbox-style{border:2px solid var(--border-color-content-removed,#fc3)}.mw-parser-output table.tmbox-move{border:2px solid #9932cc}.mw-parser-output table.tmbox-protection{border:1px solid #c0c090}.mw-parser-output table.fmbox{clear:both;margin:0.2em 0;width:100%;border:1px solid var(--border-color-base,#a2a9b1);background-color:var(--background-color-neutral-subtle,#f8f9fa);box-sizing:border-box}.mw-parser-output table.fmbox-system{background-color:var(--background-color-neutral-subtle,#f8f9fa)}.mw-parser-output table.fmbox-warning{border:1px solid #bb7070;background-color:#ffdbdb}.mw-parser-output table.fmbox-editnotice{background-color:transparent}html body.mediawiki .mw-parser-output .mbox-small{clear:right;float:right;margin:4px 0 4px 1em;box-sizing:border-box;width:238px;font-size:88%;line-height:1.25em}html body.mediawiki .mw-parser-output .mbox-small-left{margin:4px 1em 4px 0;box-sizing:border-box;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}</style><table class="plainlinks fmbox fmbox-editnotice" role="presentation"><tbody><tr><td class="mbox-image"><span typeof="mw:File"><a href="/wiki/File:MediaWiki_Namespace.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/f/fd/MediaWiki_Namespace.svg/45px-MediaWiki_Namespace.svg.png" decoding="async" width="45" height="45" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/f/fd/MediaWiki_Namespace.svg/68px-MediaWiki_Namespace.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/f/fd/MediaWiki_Namespace.svg/90px-MediaWiki_Namespace.svg.png 2x" data-file-width="100" data-file-height="100" /></a></span></td><td class="mbox-text"><b>This <a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:System_message" class="extiw" title="mw:Special:MyLanguage/Help:System message">interface message</a> or <a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Skins" class="extiw" title="mw:Special:MyLanguage/Manual:Skins">skin</a> may be documented on <a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Interface/Gadget-AuthorityControl.js" class="extiw" title="mw:Special:MyLanguage/Manual:Interface/Gadget-AuthorityControl.js">MediaWiki.org</a> or <a href="https://translatewiki.net/wiki/MediaWiki:Gadget-AuthorityControl.js/qqq" class="extiw" title="translatewiki:MediaWiki:Gadget-AuthorityControl.js/qqq">translatewiki.net</a>.</b> <br /> The page forms part of the MediaWiki interface, and can only be edited by <a href="/wiki/Special:MyLanguage/Wikidata:Administrators" title="Special:MyLanguage/Wikidata:Administrators">administrators</a>, <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Stewards" class="extiw" title="m:Special:MyLanguage/Stewards">stewards</a>, and <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Interface_editors" class="extiw" title="m:Special:MyLanguage/Interface editors">interface editors</a>. To request a change to the page, add <code>{{<a href="/wiki/Template:Edit_request" title="Template:Edit request">Edit request</a>}}</code> to the <a href="/wiki/MediaWiki_talk:Gadget-AuthorityControl.js" title="MediaWiki talk:Gadget-AuthorityControl.js">talk page</a>, followed by a description of your request.<br />To add or change translations for all wikis, please use <a href="https://translatewiki.net/wiki/" class="extiw" title="translatewiki:">translatewiki.net</a>, the MediaWiki localisation project.</td></tr></tbody></table></li><li class="mw-permissionerror-sitejsprotected">You do not have permission to edit this JavaScript page because it may affect all visitors.</li><li class="mw-permissionerror-globalblocking-blockedtext-range"><b>Your IP address is in a range that has been <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Global_blocks" class="extiw" title="m:Special:MyLanguage/Global blocks">blocked on all Wikimedia Foundation wikis</a>.</b> <p>The block was made by <a href="/wiki/User:Jon_Kolbert" title="User:Jon Kolbert">Jon Kolbert</a>. The reason given is <i><a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/NOP" class="extiw" title="m:Special:MyLanguage/NOP">Open proxy/Webhost</a>: See the <a href="https://meta.wikimedia.org/wiki/WM:OP/H" class="extiw" title="m:WM:OP/H">help page</a> if you are affected </i>. </p> <ul><li>Start of block: 15:12, 27 August 2023</li> <li>Expiry of block: 15:12, 27 August 2028</li></ul> <p>Your current IP address is 8.222.208.146. The blocked range is 8.222.128.0/17. </p><p>Please include all above details in any queries you make. If you believe you were blocked by mistake, you can find additional information and instructions in the <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/No_open_proxies" class="extiw" title="m:Special:MyLanguage/No open proxies">No open proxies</a> global policy. </p> Otherwise, to discuss the block please <a href="https://meta.wikimedia.org/wiki/Steward_requests/Global" class="extiw" title="m:Steward requests/Global">post a request for review on Meta-Wiki</a>. You could also send an email to the <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Stewards" class="extiw" title="m:Special:MyLanguage/Stewards">stewards</a> <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/VRT" class="extiw" title="m:Special:MyLanguage/VRT">VRT</a> queue at <kbd>stewards@wikimedia.org</kbd> including all above details.</li></ul><hr /> <p>You can view and copy the source of this page. </p><textarea readonly="" accesskey="," id="wpTextbox1" cols="80" rows="25" style="" class="mw-editfont-monospace" lang="en" dir="ltr" name="wpTextbox1">/* AuthorityControl.js * Provides a link to various Authority Control tools for some Wikidata statements that * are not external identifiers. * * Original gadget coded by [[User:Ricordisamoa]] */ ( function ( mw, wb, $ ) { 'use strict'; if ( [ 0, 120, 146 ].indexOf( mw.config.get( 'wgNamespaceNumber' ) ) === -1 || !mw.config.exists( 'wbEntityId' ) ) { // Only entity pages feature appropriate statements. return; } var PROPERTIES = {}, specialHandlingProperties = [ 'P426', // aircraft registration ]; /* */ function getGeoHackParams( coord ) { // TODO: individual scale for every precision var globes = { Q2: 'earth', Q111: 'mars', Q308: 'mercury', Q313: 'venus', Q319: 'jupiter', Q339: 'pluto', Q405: 'moon', Q596: 'ceres', Q2565: 'titan', Q3030: 'vesta', Q3123: 'io', Q3134: 'callisto', Q3143: 'europa', Q3169: 'ganymede', Q3303: 'enceladus', Q3322: 'titania', Q3332: 'oberon', Q3338: 'umbriel', Q3343: 'ariel', Q3352: 'miranda', Q3359: 'triton', Q7547: 'phobos', Q7548: 'deimos', Q15034: 'mimas', Q15037: 'hyperion', Q15040: 'dione', Q15047: 'tethys', Q15050: 'rhea', Q16711: 'eros', Q17958: 'iapetus', Q17975: 'phoebe', Q107556: 'lutetia', Q158244: 'gaspra' }; var globeQKey = coord.globe.replace( 'http://www.wikidata.org/entity/', '' ); var globe = globes[ globeQKey ]; return coord.latitude + '_N_' + coord.longitude + '_E_globe:' + globe; } /** * Get the snak value formatted with a link. * * @param {number} numericPropertyId Refers to PROPERTIES. * @param {string} value */ function getLinkValueForString( numericPropertyId, value ) { var linkValue; switch ( Number( numericPropertyId ) ) { default: linkValue = value; } return linkValue; } function makeLink( numericPropertyId, linkValue, displayText ) { var linkTemplate = PROPERTIES[ numericPropertyId ]; switch ( Number( numericPropertyId ) ) { case 426: if ( linkValue.substring( 0, 1 ) === 'N' ) { linkTemplate = 'https://registry.faa.gov/AircraftInquiry/Search/NNumberResult?nNumberTxt=$1'; } else if ( linkValue.substring( 0, 2 ) === 'G-' ) { // FIXME: this is said to be non-functional https://www.wikidata.org/w/index.php?oldid=1808076598#Update_to_FAA_URL linkTemplate = 'https://www.caa.co.uk/application.aspx?catid=60&pagetype=65&appid=1&mode=detailnosummary&fullregmark=$1'; linkValue = linkValue.substring( 2 ); } else { return linkValue; } break; case 625: linkTemplate += '&language=' + mw.config.get( 'wgUserLanguage' ); break; case 1793: case 8460: case 8966: case 10999: case 11707: linkTemplate = PROPERTIES[ numericPropertyId ]; if ( linkTemplate === 'https://regex101.com/?regex=$1' ) { // Escape the character used as the delimiter, which for // regex101.com is slashes. // URL encode the value to avoid problems when a regex contains // characters with a special meaning in URLs, like & and #. try { // try to encode / as \/, if not encoded yet linkValue = (new RegExp(linkValue)).source; } catch (error) { // display anyway } linkValue = encodeURIComponent( linkValue ); } break; case 233: case 2017: case 8533: case 10718: linkValue = encodeURIComponent( linkValue ); break; default: linkTemplate = PROPERTIES[ numericPropertyId ]; } var link = linkTemplate.replace( /\$1/g, linkValue ); try { var prot = (new URL(link)).protocol; // Disallow javascript links to prevent xss. // Use URL parser to handle cases with spaces and other bypasses if (prot === 'javascript:' || prot === 'data:') { return $( '<span>' ).text( displayText ) } } catch (error) { return $( '<span>' ).text( displayText ); } return $( '<a>' ) .text( displayText ) .attr( 'href', link ) // Show the 'external link' icon: .addClass( 'external' ); } function createLinkForString( numericPropertyId, value ) { var linkValue = getLinkValueForString( numericPropertyId, value ); return makeLink( numericPropertyId, linkValue, value ); } function createLinkForSnakValue( numericPropertyId, dataValue, displayText ) { var dataValueType = dataValue.getType(), value = dataValue.toJSON(); // @fixme shouldn't happen but in case of any unexpected data value types, // then there should be better error handling here. var linkValue = ''; if ( dataValueType === 'string' ) { linkValue = getLinkValueForString( numericPropertyId, value ); } else if ( dataValueType === 'globecoordinate' ) { linkValue = getGeoHackParams( value ); } return makeLink( numericPropertyId, linkValue, displayText ); } function linkSnakView( el, propertySelector, valueSelector ) { var $propLink = $( el ).find( propertySelector ); var title = $propLink.attr( 'title' ); if ( title ) { var titleParts = title.split( ':P' ), numericPropertyId = titleParts[ 1 ]; if ( PROPERTIES.hasOwnProperty( numericPropertyId ) ) { var $value = $( el ).find( valueSelector ).first(), $link = createLinkForString( numericPropertyId, $value.text() ); $value.html( $link ); } } } function handleSnak( snak, snakView ) { if ( !( snak.getType && snak.getType() == 'value' ) ) { return; } var numericPropertyId = snak.getPropertyId().slice( 1 ); if ( !( PROPERTIES.hasOwnProperty( numericPropertyId ) ) ) { return; } var $snakValue = $( snakView ).find( '.wikibase-snakview-value' ); if ( $snakValue.find( '.wikibase-kartographer-caption' ).length ) { // If this is a Kartographer map, don't mangle the whole snak value, // but just the caption. $snakValue = $snakValue.find( '.wikibase-kartographer-caption' ); } var displayText = extractDisplayText( $snakValue ), snakLink = createLinkForSnakValue( numericPropertyId, snak.getValue(), displayText ); $snakValue.html( snakLink ); } function extractDisplayText( $snakValue ) { var $snakValueClone = $snakValue.clone(); $snakValueClone.children().remove(); return $snakValueClone.text(); } /** * Initializes the gadget. * This procedure needs to be performed as good as possible. jQuery selector usage should be limited * to a minimum. */ function initGadget() { if ( $.isEmptyObject( PROPERTIES ) ) { return; } $( ':wikibase-statementview' ).each( function () { var statementview = $.data( this, 'statementview' ), statement = statementview.value(), claim = statement.getClaim(), qualifierGroups = claim.getQualifiers().getGroupedSnakLists(); handleSnak( claim.getMainSnak(), statementview.$mainSnak[ 0 ] ); $( '.wikibase-statementview-qualifiers .wikibase-snaklistview', this ).each( function( i ) { var qualifiers = qualifierGroups[i].toArray(); $( '.wikibase-snakview', this ).each( function( n ) { handleSnak( qualifiers[n], this ); } ); } ); } ); $( '.wikibase-referenceview .wikibase-snaklistview-listview' ).each( function () { linkSnakView( this, '.wikibase-snakview-property > a', '.wikibase-snakview-value' ); } ); } function getProperties( entity ) { var api = new mw.Api(), repoApi = new wb.api.RepoApi( api ), propertyIds = [], alreadyLinkedPropertyIds = []; function addSnak( snak ) { var snakPropertyId = snak.property, $firstSnakValue; if ( snak.snaktype !== 'value' || ( snak.datavalue.type !== 'string' && snak.datavalue.type !== 'globecoordinate' ) ) { return; } if ( propertyIds.indexOf( snakPropertyId ) !== -1 ) { return; } if ( specialHandlingProperties.indexOf( snakPropertyId ) === -1 ) { if ( alreadyLinkedPropertyIds.indexOf( snakPropertyId ) !== -1 ) { return; } $firstSnakValue = $( '#' + snakPropertyId ).find( '.wikibase-snakview-variation-valuesnak:first' ); if ( $firstSnakValue.find( '> a:not(.oo-ui-widget)' ).length > 0 || $firstSnakValue.find( '> div.thumb' ).length > 0 ) { alreadyLinkedPropertyIds.push( snakPropertyId ); return; } } propertyIds.push( snakPropertyId ); } function analyzeClaims( claims ) { var prop; for ( prop in claims ) { $.each( claims[ prop ], function ( i, claim ) { addSnak( claim.mainsnak ); $.each( claim.references || [], function ( i, ref ) { for ( prop in ref.snaks ) { $.each( ref.snaks[ prop ], function ( i, cl ) { addSnak( cl ); } ); } } ); for ( prop in claim.qualifiers || {} ) { $.each( claim.qualifiers[ prop ], function ( i, cl ) { addSnak( cl ); } ); } } ); } } analyzeClaims( entity.claims ); $.each( entity.forms || [], function ( _, form ) { analyzeClaims( form.claims || {} ); } ); $.each( entity.senses || [], function ( _, sense ) { analyzeClaims( sense.claims || {} ); } ); if ( !propertyIds.length ) { return $.Deferred().resolve(); } return repoApi.getEntities( propertyIds, 'claims' ) .then( function ( data ) { if ( !data || !data.entities ) { // Unexpected response from the API return; } $.each( data.entities, function ( entityId, entity ) { if ( entity.datatype === 'external-id' && $.inArray( entity.id, specialHandlingProperties ) === -1 ) { // No need to format these return true; } if ( entity.datatype === 'commonsMedia' ) { // No need to format these, but we can't exclude them earlier // as we don't have the property datatype. // XXX: This probably also applies to math etc. return true; } $.each( entity.claims, function ( claimId, claims ) { if ( claimId === 'P1630' ) { var i, len = claims.length; for ( i = 0; i < len; i++ ) { if ( claims[ i ].rank !== 'preferred' ) { continue; } if ( claims[ i ].mainsnak.snaktype === 'value' ) { PROPERTIES[ entityId.slice( 1 ) ] = claims[ i ].mainsnak.datavalue.value; } return false; } for ( i = 0; i < len; i++ ) { if ( claims[ i ].rank !== 'normal' ) { continue; } if ( claims[ i ].mainsnak.snaktype === 'value' ) { PROPERTIES[ entityId.slice( 1 ) ] = claims[ i ].mainsnak.datavalue.value; break; } } return false; } } ); } ); } ); } var rendered = $.Deferred(), loaded = $.Deferred(); $.when( rendered, loaded, $.ready ).then( function () { initGadget(); } ); mw.hook( 'wikibase.entityPage.entityLoaded' ).add( function ( entity ) { getProperties( entity ).then( function () { loaded.resolve(); } ); } ); mw.hook( 'wikibase.entityPage.entityView.rendered' ).add( function () { rendered.resolve(); } ); }( mediaWiki, wikibase, jQuery ) ); </textarea><div class="templatesUsed"></div><p id="mw-returnto">Return to <a href="/wiki/MediaWiki:Gadget-AuthorityControl.js" title="MediaWiki:Gadget-AuthorityControl.js">MediaWiki:Gadget-AuthorityControl.js</a>.</p> <!--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.wikidata.org/wiki/MediaWiki:Gadget-AuthorityControl.js">https://www.wikidata.org/wiki/MediaWiki:Gadget-AuthorityControl.js</a>"</div></div> <div id="catlinks" class="catlinks catlinks-allhidden" data-mw="interface"></div> </div> </div> <div id="mw-navigation"> <h2>Navigation menu</h2> <div id="mw-head"> <nav id="p-personal" class="mw-portlet mw-portlet-personal vector-user-menu-legacy vector-menu" aria-labelledby="p-personal-label" > <h3 id="p-personal-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Personal tools</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-uls" class="mw-list-item active"><a class="uls-trigger" href="#"><span>English</span></a></li><li id="pt-anonuserpage" class="mw-list-item"><span title="The user page for the IP address you are editing as">Not logged in</span></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><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-createaccount" class="mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=MediaWiki%3AGadget-AuthorityControl.js&returntoquery=action%3Dedit" title="You are encouraged to create an account and log in; however, it is not mandatory"><span>Create account</span></a></li><li id="pt-login" class="mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=MediaWiki%3AGadget-AuthorityControl.js&returntoquery=action%3Dedit" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span>Log in</span></a></li> </ul> </div> </nav> <div id="left-navigation"> <nav id="p-namespaces" class="mw-portlet mw-portlet-namespaces vector-menu-tabs vector-menu-tabs-legacy vector-menu" aria-labelledby="p-namespaces-label" > <h3 id="p-namespaces-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Namespaces</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-mediawiki" class="selected mw-list-item"><a href="/wiki/MediaWiki:Gadget-AuthorityControl.js" title="View the system message [c]" accesskey="c"><span>Message</span></a></li><li id="ca-talk" class="mw-list-item"><a href="/wiki/MediaWiki_talk:Gadget-AuthorityControl.js" rel="discussion" title="Discussion about the content page [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </nav> <nav id="p-variants" class="mw-portlet mw-portlet-variants emptyPortlet vector-menu-dropdown vector-menu" aria-labelledby="p-variants-label" > <input type="checkbox" id="p-variants-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-variants" class="vector-menu-checkbox" aria-labelledby="p-variants-label" > <label id="p-variants-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">English</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </nav> </div> <div id="right-navigation"> <nav id="p-views" class="mw-portlet mw-portlet-views vector-menu-tabs vector-menu-tabs-legacy vector-menu" aria-labelledby="p-views-label" > <h3 id="p-views-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Views</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="mw-list-item"><a href="/wiki/MediaWiki:Gadget-AuthorityControl.js"><span>Read</span></a></li><li id="ca-viewsource" class="selected mw-list-item"><a href="/w/index.php?title=MediaWiki:Gadget-AuthorityControl.js&action=edit" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li><li id="ca-history" class="mw-list-item"><a href="/w/index.php?title=MediaWiki:Gadget-AuthorityControl.js&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </nav> <nav id="p-cactions" class="mw-portlet mw-portlet-cactions emptyPortlet vector-menu-dropdown vector-menu" aria-labelledby="p-cactions-label" title="More options" > <input type="checkbox" id="p-cactions-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-cactions" class="vector-menu-checkbox" aria-labelledby="p-cactions-label" > <label id="p-cactions-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">More</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </nav> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box"> <h3 >Search</h3> <form action="/w/index.php" id="searchform" class="vector-search-box-form"> <div id="simpleSearch" class="vector-search-box-inner" data-search-loc="header-navigation"> <input class="vector-search-box-input" type="search" name="search" placeholder="Search Wikidata" aria-label="Search Wikidata" autocapitalize="sentences" title="Search Wikidata [f]" accesskey="f" id="searchInput" > <input type="hidden" name="title" value="Special:Search"> <input id="mw-searchButton" class="searchButton mw-fallbackSearchButton" type="submit" name="fulltext" title="Search the pages for this text" value="Search"> <input id="searchButton" class="searchButton" type="submit" name="go" title="Go to a page with this exact name if it exists" value="Go"> </div> </form> </div> </div> </div> <div id="mw-panel" class="vector-legacy-sidebar"> <div id="p-logo" role="banner"> <a class="mw-wiki-logo" href="/wiki/Wikidata:Main_Page" title="Visit the main page"></a> </div> <nav id="p-navigation" class="mw-portlet mw-portlet-navigation vector-menu-portal portal vector-menu" aria-labelledby="p-navigation-label" > <h3 id="p-navigation-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Navigation</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Wikidata:Main_Page" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Project:Community_portal" title="About the project, what you can do, where to find things"><span>Community portal</span></a></li><li id="n-villagepump" class="mw-list-item"><a href="/wiki/Wikidata:Project_chat"><span>Project chat</span></a></li><li id="n-special-newitem" class="mw-list-item"><a href="/wiki/Special:NewItem"><span>Create a new Item</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-wikibase-randomitem" class="mw-list-item"><a href="/wiki/Special:Random/Main" title="[x]" accesskey="x"><span>Random Item</span></a></li><li id="n-wikibase-queryservice" class="mw-list-item"><a href="//query.wikidata.org/"><span>Query Service</span></a></li><li id="n-nearby-pages-title" class="mw-list-item"><a href="/wiki/Special:Nearby"><span>Nearby</span></a></li><li id="n-help" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Help:Contents" title="The place to find out"><span>Help</span></a></li><li id="n-sitesupport" class="mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_wikidata.org&uselang=en" title="Support us"><span>Donate</span></a></li> </ul> </div> </nav> <nav id="p-wikibase-lexeme-lexicographical-data" class="mw-portlet mw-portlet-wikibase-lexeme-lexicographical-data vector-menu-portal portal vector-menu" aria-labelledby="p-wikibase-lexeme-lexicographical-data-label" > <h3 id="p-wikibase-lexeme-lexicographical-data-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Lexicographical data</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-special-newlexeme" class="mw-list-item"><a href="/wiki/Special:NewLexeme"><span>Create a new Lexeme</span></a></li><li id="n-recentchanges-lexemes" class="mw-list-item"><a href="https://www.wikidata.org/wiki/Special:RecentChanges?namespace=146%3B147"><span>Recent changes</span></a></li><li id="n-wikibase-lexeme-randomlexeme" class="mw-list-item"><a href="/wiki/Special:Random/Lexeme"><span>Random Lexeme</span></a></li> </ul> </div> </nav> <nav id="p-tb" class="mw-portlet mw-portlet-tb vector-menu-portal portal vector-menu" aria-labelledby="p-tb-label" > <h3 id="p-tb-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Tools</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/MediaWiki:Gadget-AuthorityControl.js" 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/MediaWiki:Gadget-AuthorityControl.js" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</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-info" class="mw-list-item"><a href="/w/index.php?title=MediaWiki:Gadget-AuthorityControl.js&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fwww.wikidata.org%2Fw%2Findex.php%3Ftitle%3DMediaWiki%3AGadget-AuthorityControl.js%26action%3Dedit"><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.wikidata.org%2Fw%2Findex.php%3Ftitle%3DMediaWiki%3AGadget-AuthorityControl.js%26action%3Dedit"><span>Download QR code</span></a></li> </ul> </div> </nav> <nav id="p-wikibase-otherprojects" class="mw-portlet mw-portlet-wikibase-otherprojects emptyPortlet vector-menu-portal portal vector-menu" aria-labelledby="p-wikibase-otherprojects-label" > <h3 id="p-wikibase-otherprojects-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">In other projects</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </nav> </div> </div> <footer id="footer" class="mw-footer" > <ul id="footer-info"> </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/Special:MyLanguage/Project:Introduction">About Wikidata</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Special:MyLanguage/Project:General_disclaimer">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_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.wikidata.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.wikidata.org/w/index.php?title=MediaWiki:Gadget-AuthorityControl.js&action=edit&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> <li id="footer-places-data-access"><a href="/wiki/Special:MyLanguage/Wikidata:Data_access">Data access</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> <script>(RLQ=window.RLQ||[]).push(function(){mw.log.warn("This page is using the deprecated ResourceLoader module \"codex-search-styles\".\n[1.43] Use a CodexModule with codexComponents to set your specific components used: https://www.mediawiki.org/wiki/Codex#Using_a_limited_subset_of_components");mw.config.set({"wgHostname":"mw-web.codfw.main-f69cdc8f6-5w7wd","wgBackendResponseTime":333,"wgPageParseReport":{"limitreport":{"cputime":"0.085","walltime":"0.151","ppvisitednodes":{"value":98,"limit":1000000},"postexpandincludesize":{"value":3230,"limit":2097152},"templateargumentsize":{"value":48,"limit":2097152},"expansiondepth":{"value":8,"limit":100},"expensivefunctioncount":{"value":0,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":5914,"limit":5000000},"entityaccesscount":{"value":0,"limit":500},"timingprofile":["100.00% 136.471 1 -total","100.00% 136.471 1 Template:Fmbox"," 1.80% 2.455 1 Template:Tl"]},"scribunto":{"limitreport-timeusage":{"value":"0.060","limit":"10.000"},"limitreport-memusage":{"value":763030,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-f69cdc8f6-5w7wd","timestamp":"20241125053823","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>