Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

User:PrimeHunter/Source links.js

    From Wikipedia, the free encyclopedia
    <User:PrimeHunter
    Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes.A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at theappropriate village pump.
    This codewill be executed when previewing this page.
    Documentation for thisuser script can be added atUser:PrimeHunter/Source links.
    Note: After saving, you have to bypass your browser's cache to see the changes.Google Chrome,Firefox,Microsoft Edge andSafari: Hold down the⇧ Shift key and click theReload toolbar button. For details and instructions about other browsers, seeWikipedia:Bypass your cache.
    /* This script adds "Source links" below "What links here" in the sidebar.   "What links here" will include pages using a template with the link.   "Source links" tries to search for pages where the link is in the source.   To use the script, add the following line to [[Special:MyPage/common.js]]:importScript('User:PrimeHunter/Source links.js'); // Linkback: [[User:PrimeHunter/Source links.js]]*/mw.loader.using(['mediawiki.util'],function(){varname=mw.config.get('wgPageName').replace("Special:WhatLinksHere/","");varurl;try{url=mw.util.getUrl('Special:Search')+'?trimsearch=1&profile=all&search='+encodeURIComponent('linksto:"'+name+'" '+'insource:"'+name+'" '+'insource:/\\[\\[:?['+name[0]+name.charAt(0).toLowerCase()+']'+name.substring(1).replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,'\\$&')+'[\\]\\|#]/').replace(/_/g," ");}catch(e){url='#error';// EXAMPLE URL: https://en.wikipedia.org/w/index.php?title=%F0%9F%91%A9%F0%9F%8F%BF&action=history}mw.util.addPortletLink('p-tb',url,'Source links','pt-sourcelinks','What links here in the source',null,'#t-recentchangeslinked');});/* The url generated above adds the parameter trimsearch=1 when "Source links" is clicked.   If it's present then trim search results by hiding two classes for images and data. */constqueryString=window.location.search;consturlParams=newURLSearchParams(queryString);consttrimsearch=urlParams.get('trimsearch');if(trimsearch==='1'){varsearchimages=document.getElementsByClassName('searchResultImage-thumbnail');for(vari=0;i<searchimages.length;i++){searchimages[i].style.display='none';}varsearchdata=document.getElementsByClassName('mw-search-result-data');for(vari=0;i<searchdata.length;i++){searchdata[i].style.display='none';}}
    Retrieved from "https://en.wikipedia.org/w/index.php?title=User:PrimeHunter/Source_links.js&oldid=1278331093"

    [8]ページ先頭

    ©2009-2025 Movatter.jp