User:Altt311/edittools2.js

维基百科,自由的百科全书

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。

if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
	$( function() { // Execute on load
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'commonedit',
			'groups': {
				'section': {
					'label': ''
				},
				'wordings': {
					'label': ''
				},
				'content': {
					'label': ''
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'commonedit',
			'group': 'section',
			'tools': {
				'articleEdit': {
					label: '分段',
					type: 'select',
					list: {
						'seealso': {
							label: '參見',
							action: {
								type: 'encapsulate',
								options: {
									pre: '==相關條目==\n*[[',
									periMsg: '相關條目名稱' ,
									post: ']]\n'
								}
							}
						},
						'ref': {
							label: '參考資料',
							action: {
								type: 'encapsulate',
								options: {
									pre: '==參考文獻==\n',
									post: '{\{reflist}\}\n'
								}
							}
						},
						'extlink': {
							label: '外部連結',
							action: {
								type: 'encapsulate',
								options: {
									pre: '==外部連結==\n*[',
									periMsg: '地址 顯示名稱',
									post: ']\n'
								}
							}
						},
						'current': {
							label: '正在發生',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{Current}\}'
								}
							}
						},
						'defaultsort': {
							label: '索引',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{DEFAULTSORT:',
									post: '}\}\n'
								}
							}
						},
						'commonscat': {
							label: 'Commons分類',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{Commonscat|',
									post: '}\}\n'
								}
							}
						}
					}
				},
				'disambig': {
					label: '消歧義',
					type: 'select',
					list: {
						'article': {
							label: '消歧義條目',
							action: {
								type: 'encapsulate',
								options: {
									pre: "'''{\{subst:PAGENAME}\}'''可以指:\n",
									periMsg: '*[[歧義條目1]],描述1。\n*[[歧義條目2]],描述2。',
									post: '\n{\{disambig|cat=N字消歧義}\}'
								}
							}
						},
						'mainsingle': {
							label: '主副消歧義',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{Otheruses|subject=',
									periMsg: '本條目主題|重定向條目名稱|other=重定向條目主題',
									post: '}\}'
								}
							}
						},
						'mainmultiple': {
							label: '主副(多個)',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{Otheruseslist|',
									periMsg: '本條目主題|重定向條目名稱1|重定向條目主題1|重定向條目名稱2|重定向條目主題2',
									post: '}\}'
								}
							}
						}
					}
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'commonedit',
			'group': 'wordings',
			'tools': {
				'noteTA': {
					label: '繁簡轉換',
					type: 'select',
					list: {
						'fullconv': {
							label: '全文轉換',
							action: {
								type: 'encapsulate',
								options: {
									pre: '-\{T|',
									periMsg: '正确标题名称',
									post: '}\-'
								}
							}
						},
						'convtitle': {
							label: '只轉換標題',
							action: {
								type: 'encapsulate',
								options: {
									pre: '-\{T|',
									periMsg: '正确标题名称',
									post: '}\-'
								}
							}
						},
						'noconvert': {
							label: '不轉換內容',
							action: {
								type: 'encapsulate',
								options: {
									pre: '-\{',
									periMag: '不轉換內容',
									post: '}\-'
								}
							}
						},
						'imgdesc': {
							label: '地區語言圖像',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{Image\n\t|zh=無轉換圖像名\n\t|zh-hans=简体图像名\n\t|zh-hant= 繁体圖像名\n\t|zh-cn=大陆图像名\n\t|zh-tw=臺灣圖像名\n\t|zh-hk=香港圖像名\n\t|zh=马新图像名\n\t|圖像屬性\n',
									post: '}\}'
								}
							}
						}
					}
				},
				'tmpJap': {
					label: '日語名稱標示模板',
					type: 'button',
					icon: 'http://upload.wikimedia.org/wikipedia/commons/f/fb/Template_icon.svg',
					action: {
						type: 'encapsulate',
						options: {
							pre: '{\{Japanese|',
							periMsg: 'japanese=*|kana=|romaji=*|舊寫=|',
							post: '}\}\n'
						}
					}
				},
				'jalongroma': {
					label: '長音',
					type: 'select',
					list: {
						'LLA': {
							label: 'Aa',
							action: {
								type: 'encapsulate',
								options: {
									pre: 'Ā'
								}
							}
						},
						'LLU': {
							label: 'Uu',
							action: {
								type: 'encapsulate',
								options: {
									pre: 'Ū'
								}
							}
						},
						'LLE': {
							label: 'Ee',
							action: {
								type: 'encapsulate',
								options: {
									pre: 'Ē'
								}
							}
						},
						'LLO': {
							label: 'Oo',
							action: {
								type: 'encapsulate',
								options: {
									pre: 'Ō'
								}
							}
						},
						'LSA': {
							label: 'aa',
							action: {
								type: 'encapsulate',
								options: {
									pre: 'ā'
								}
							}
						},
						'LSU': {
							label: 'uu',
							action: {
								type: 'encapsulate',
								options: {
									pre: 'ū'
								}
							}
						},
						'LSE': {
							label: 'ee',
							action: {
								type: 'encapsulate',
								options: {
									pre: 'ē'
								}
							}
						},
						'LSO': {
							label: 'oo',
							action: {
								type: 'encapsulate',
								options: {
									pre: 'ō'
								}
							}
						}
					}
				},
				'langtag': {
					label: '非中文',
					type: 'select',
					list: {
						'en': {
							label: '英語',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{lang|en|',
									periMsg: '英語',
									post: '}\}'
								}
							}
						},
						'de': {
							label: '德語',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{lang|de|',
									periMsg: '德語',
									post: '}\}'
								}
							}
						},
						'fr': {
							label: '法語',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{lang-fr|',
									periMsg: '法語',
									post: '}\}'
								}
							}
						},
						'ja': {
							label: '日語',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{lang|ja|',
									periMsg: '日語',
									post: '}\}'
								}
							}
						},
						'ru': {
							label: '俄語',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{lang|ru|',
									periMsg: '俄語',
									post: '}\}'
								}
							}
						},
						'langcode': {
							label: '其他語言',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{lang\|語言代碼|',
									periMsg: '其他語言',
									post: '}\}'
								}
							}
						}
					}
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'commonedit',
			'group': 'content',
			'tools': {
				'coltags': {
					label: '分隔數欄',
					type: 'select',
					list: {
						'colBegin': {
							label: '開始',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{col-begin\}\}',
									post: '\n'
								}
							}
						},
						'colEnd': {
							label: '完結',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{col-end}\}',
									post: '\n'
								}
							}
						},
						'colTwo': {
							label: '分兩欄',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{col-2}\}',
									post: '\n'
								}
							}
						},
						'colThree': {
							label: '分三欄',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{col-3}\}',
									post: '\n'
								}
							}
						},
						'colFour': {
							label: '分四欄',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{col-4}\}',
									post: '\n'
								}
							}
						},
						'colFive': {
							label: '分五欄',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{col-5}\}',
									post: '\n'
								}
							}
						},
						'colSix': {
							label: '分為六欄',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{col-6}\}',
									post: '\n'
								}
							}
						},
						'colX': {
							label: '自訂',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{col-x|\}\}',
									post: '\n'
								}
							}
						}
					}
				},
				'navboxSep': {
					label: '導航分隔',
					type: 'select',
					list: {
						'dash': {
							label: '-',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{\-w}\}'
								}
							}
						},
						'dash2': {
							label: '—',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{\—w}\}'
								}
							}
						},
						'dot': {
							label: '·',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{·w}\}'
								}
							}
						},
						'slash': {
							label: '/',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{\\w}\}'
								}
							}
						},
						'pipe': {
							label: '|',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{!w}\}'
								}
							}
						}
					}
				},
				'extlinktag': {
					label: '連結語言',
					type: 'select',
					list: {
						'enlink': {
							label: '英語',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{en}\}'
								}
							}
						},
						'jalink': {
							label: '日語',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{ja}\}'
								}
							}
						},
						'sclink': {
							label: '簡中',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{zh-hans}\}'
								}
							}
						},
						'tclink': {
							label: '繁中',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{zh-hant}\}'
								}
							}
						},
						'otherlanglink': {
							label: '其他語言',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{',
									periMsg: '語言代碼',
									post: '}\}'
								}
							}
						}
					}
				},
				'nowcommons': {
					label: '已上載到Commons的檔案',
					type: 'button',
					icon: 'http://upload.wikimedia.org/wikipedia/commons/b/b7/Button_nowcommons.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: '{\{Nowcommons|',
							periMsg: 'Commons檔案名稱',
							post: '}\}\n'
						}
					}
				}
			}
		} );
	} );
}