跳转到内容

User:Peacearth/DisamAssist.js

维基百科,自由的百科全书
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
//<source lang="javascript">

//DisamAssist
//由[[User:Qwertyytrewqqwerty]]最初設計:[[es:Usuario:Qwertyytrewqqwerty/DisamAssist.js]]
//由[[User:GZWDer]]本地化:[[User:GZWDer/DisamAssist.js]] 2020-08-19
//由[[User:Peacearth]] 稍作翻譯 2021-05-15
//由[[User:落花有意12138]]提供改善與修正建議 2023-07-15
//由[[User:Peacearth]]擴展使用範圍至全部同類索引條目 2023-07-15

window.DisamAssist = jQuery.extend( true, {
	cfg: {
		/*
		 * Categories where disambiguation pages are added (usually by a template like {{Disambiguation}}
		 */
		disamCategories: ['全部消歧義頁面','全部同類索引條目'],
		
		/*
		 * "Canonical names" of the templates that may appear after ambiguous links
		 * and which should be removed when fixing those links
		 */
		disamLinkTemplates: [
			'Disambiguation needed',
			'Dn',
			'連結消歧義',
			'链接消歧义',
			'需要消歧义',
			'需要消歧義'
		],
		
		/*
		 * "Canonical names" of the templates that designate intentional links to
		 * disambiguation pages
		 */
		disamLinkIgnoreTemplates: [
			'R from ambiguous page',
			'R to disambiguation page',
			'R from incomplete disambiguation'
		],
		
		/*
		 * Format string for "Foo (disambiguation)"-style pages
		 */
		 disamFormat: '$1',
		
		/*
		 * Regular expression matching the titles of disambiguation pages (when they are different from
		 * the titles of the primary topics)
		 */
		disamRegExp: '^(.*) \\(消歧[义義]\\)$',
		
		/*
		 * Text that will be inserted after the link if the user requests help. If the value is null,
		 * the option to request help won't be offered
		 */
		disamNeededText: '{{dn|date={{subst:CURRENTYEAR}}年{{subst:CURRENTMONTHNAME}}}}',
		
		/*
		 * Content of the "Foo (disambiguation)" pages that will be created automatically when using
		 * DisamAssist from a "Foo" page
		 */
		redirectToDisam: '',
		
		/*
		 * Whether intentional links to disambiguation pages can be explicitly marked by adding " (disambiguation)"
		 */
		intentionalLinkOption: true,
		
		/*
		 * Namespaces that will be searched for incoming links to the disambiguation page (pages in other
		 * namespaces will be ignored)
		 */
		targetNamespaces: [6, 10, 14, 100, 108, 0],
		
		/*
		 * Number of backlinks that will be downloaded at once
		 * When using blredirect, the maximum limit is supposedly halved
		 * (see http://www.mediawiki.org/wiki/API:Backlinks)
		 */
		backlinkLimit: 250,
		
		/*
		 * Number of titles we can query for at once
		 */
		queryTitleLimit: 50,
	
		/*
		 * Number of characters before and after the incoming link that will be displayed
		 */
		radius: 300,
	
		/*
		 * Height of the context box, in lines
		 */
		numContextLines: 4,
	
		/*
		 * Number of pages that will be stored before saving, so that changes to them can be
		 * undone if need be
		 */
		historySize: 2,
		
		/*
		 * Minimum time in seconds since the last change was saved before a new edit can be made. A
		 * negative value or 0 disables the cooldown. Users with the "bot" right won't be affected by
		 * the cooldown
		 */
		editCooldown: 0,
		
		/*
		 * Specify how the watchlist is affected by DisamAssist edits. Possible values: "watch", "unwatch",
		 * "preferences", "nochange"
		 */
		watch: 'nochange'
	},

	txt: {
		start: '消歧義連入連結',
		startMain: '消歧義連入主條目之連結',
		startSame: '消歧義連入本頁面之連結',
		close: '關閉',
		undo: '復原',
		omit: '跳過',
		refresh: '重新整理',
		titleAsText: '其他目標',
		disamNeeded: '標示{{dn}}',
		intentionalLink: '有意連到消歧義頁的連結',
		titleAsTextPrompt: '請輸入新的連結目標:',
		removeLink: '去除連結',
		optionMarker: ' [連到這裡]',
		targetOptionMarker: ' [當前目標]',
		redirectOptionMarker: ' [當前目標(已重定向)]',
		pageTitleLine: '<a href="$1">$2</a>:',
		noMoreLinks: '沒有需要消歧義的連結了。',
		pendingEditCounter: '$1個頁面儲存中,$2個頁面佇列中',
		pendingEditBox: 'DisamAssist正在儲存您的編輯($1)。',
		pendingEditBoxTimeEstimation: '$1;估計剩餘時間:$2',
		pendingEditBoxLimited: '在所有待定變更保存完成之前,請不要關閉此分頁。'
			+ '您可以在其他分頁繼續編輯維基百科,但請注意,我們並不鼓勵同時在多個頁面使用'
			+ 'DisamAssist小工具,因為在短時間內進行大量編輯可能會對維基百科造成干擾。',
		error: '錯誤:$1',
		fetchRedirectsError: '無法獲取重定向:"$1".',
		getBacklinksError: '無法下載反向連結:"$1".',
		fetchRightsError: '無法獲取用戶權限:"$1",',
		loadPageError: '無法載入$1:"$2".',
		savePageError: '無法將變更儲存至$1:"$2".',
		dismissError: '忽略',
		pending: 'DisamAssist尚有未儲存的編輯。如欲儲存之,請按「關閉」。',
		editInProgress: 'DisamAssist正在進行編輯。如果您將本分頁關閉,可能會喪失您的編輯。',
		ellipsis: '...',
		notifyCharacter: '✔',
		summary: '使用[[User:Peacearth/DisamAssist.js|DisamAssist]]清理[[WP:DAB|消歧義]]連結:[[$1]]($2)。',
		summaryChanged: '改連結至[[$1]]',
		summaryOmitted: '連結已跳過',
		summaryRemoved: '連結已移除',
		summaryIntentional: '刻意連至消歧義頁面',
		summaryHelpNeeded: '需要幫助',
		summarySeparator: ';',
		redirectSummary: '使用[[User:Peacearth/DisamAssist.js|DisamAssist]]創建目標為[[$1]]的重定向。'
	}
}, window.DisamAssist || {} );

mw.loader.load( '//es.wikipedia.org/w/index.php?title=Usuario:Qwertyytrewqqwerty/DisamAssist-core.js&action=raw&ctype=text/javascript' );
mw.loader.load( '//es.wikipedia.org/w/index.php?title=Usuario:Qwertyytrewqqwerty/DisamAssist.css&action=raw&ctype=text/css', 'text/css' );

//</source>