User:Altt311/railway2.js

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

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

// Check that the toolbar is available
if ( typeof $j != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
	$( function() { // Execute on load
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'railway',
			'groups': {
				'template': {
					'label': ''
				},
				'general': {
					'label': ''  // or use labelMsg for a localized label, see above
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'railway',
			'group': 'template',
			'tools': {
				'stntemp': {
					label: '車站資料模板',
					type: 'select',
					list: {
						'top': {
							label: '頂部簡略',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{日本車站資訊\n|公司色 = grey\n|站名 = \n|圖片 = \n|圖片說明 = \n|日文原名 = \n|平假名 = \n|羅馬拼音 = \n|副站名 = \n|所屬公司 = \n|所在地 = \n|啟用年月日 = \n|廢站年月日 = \n|轉車 = \n|備註 = ',
									post: '\n}\}\n'
								}
							}
						},
						'full': {
							label: '完整模板',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{日本車站資訊\n|公司色 = \n|文字色 = \n|站名 = \n|圖片 = \n|pxl = \n|圖片說明 = \n|日文原名 = \n|平假名 = \n|羅馬拼音 = \n|副站名 = \n|前一站 = \n|前一站距離 = \n|後一站距離 = \n|後一站 = \n|電報略號 = \n|車站編號 = \n|停站路線數 = \n|所屬公司 = \n|所屬路線 = \n|距離 = \n|起點站 = \n|所在地 = \n|車站構造 = \n|月台配置 = \n|啟用年月日 = \n|廢站年月日 = \n|乘客人數 = \n|上下車人次 = \n|統計年度 = \n|轉車 = \n|備註 = ',
									post: '\n}\}\n'
								}
							}
						},
						'subroute1': {
							label: '路線(無編號)',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{subst:User:Altt311/Template/StnRoute|Num = 數字(1-5)\n|Route = \n|Distance = \n|Start = \n|Previous = \n|PreDist = \n|AftDist = \n|After = ',
									post: '\n}\}'
								}
							}
						},
						'subroute2': {
							label: '路線(有編號)',
							action: {
								type: 'encapsulate',
								options: {
									pre: '{\{subst:User:Altt311/Template/StnRouteNum|Num = 數字(1-5)\n|Route = \n|StnNum = \n|Distance = \n|Start = \n|Previous = \n|PreDist = \n|AftDist = \n|After = ',
									post: '\n}\}'
								}
							}
						}
					}
				},
				'areatemp': {
					label: '特定都區市內',
					type: 'select',
					list: {
						'satsu': {
							label: '札幌市內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area SATSU.png|15px|',
									post: '[-{札}-]\]\]\[\[特定都區市內|札幌市內\]\]車站'
								}
							}
						},
						'sen': {
							label: '仙台市內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area SEN.png|15px|',
									post: '[-{仙}-]\]\]\[\[特定都區市內|仙台市內\]\]車站'
								}
							}
						},
						'ku': {
							label: '東京都區內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area KU.svg|15px|',
									post: '[-{?}-]\]\]\[\[特定都區市內|東京都區內\]\]車站'
								}
							}
						},
						'hama': {
							label: '橫濱市內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area HAMA.svg|15px|',
									post: '[-{?}-]\]\]\[\[特定都區市內|橫濱市內\]\]車站'
								}
							}
						},
						'yama': {
							label: '山手線內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area YAMA.svg|15px|',
									post: '[-{山}-]\]\]\[\[File:JR area KU.svg|15px|\[-{?}-]\]\]\[\[東京山手線內\]\]、\[\[特定都區市內|東京都區內\]\]車站'
								}
							}
						},
						'mei': {
							label: '名古屋市內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area MEI.png|15px|',
									post: '[-{名}-]\]\]\[\[特定都區市內|名古屋市內\]\]車站'
								}
							}
						},
						'kyo': {
							label: '京都市內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area KYO.png|15px|',
									post: '[-{京}-]\]\]\[\[特定都區市內|京都市內\]\]車站'
								}
							}
						},
						'han': {
							label: '大阪市內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area HAMA.png|15px|',
									post: '[-{阪}-]\]\]\[\[特定都區市內|大阪市內\]\]車站'
								}
							}
						},
						'shin': {
							label: '神戶市內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area SHIN.png|15px|',
									post: '[-{神}-]\]\]\[\[特定都區市內|神戶市內\]\]車站'
								}
							}
						},
						'hiro': {
							label: '廣島市內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area HIRO.png|15px|',
									post: '[-{?}-]\]\]\[\[特定都區市內|廣島市內\]\]車站'
								}
							}
						},
						'fuku': {
							label: '福岡市內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area FUKU.png|15px|',
									post: '[-{福}-]\]\]\[\[特定都區市內|福岡市內\]\]車站'
								}
							}
						},
						'kyu': {
							label: '北九州市內',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:JR area KYU.png|15px|',
									post: '[-{九}-]\]\]\[\[特定都區市內|北九州市內\]\]車站'
								}
							}
						}
					}
				},
				'stnnotemp': {
					label: '東京地鐵圖標',
					type: 'select',
					list: {
						'ginza': {
							label: '銀座線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoGinza.png|',
									post: '15px]\]'
								}
							}
						},
						'marunouchi': {
							label: '丸之內線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoMarunouchi.png|',
									post: '15px]\]'
								}
							}
						},
						'hibiya': {
							label: '日比谷線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoHibiya.png|',
									post: '15px]\]'
								}
							}
						},
						'tozai': {
							label: '東西線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoTozai.png|',
									post: '15px]\]'
								}
							}
						},
						'chiyoda': {
							label: '千代田線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoChiyoda.png|',
									post: '15px]\]'
								}
							}
						},
						'yurakucho': {
							label: '有樂町線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoYurakucho.png|',
									post: '15px]\]'
								}
							}
						},
						'hanzomon': {
							label: '半藏門線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoHanzomon.png|',
									post: '15px]\]'
								}
							}
						},
						'namboku': {
							label: '南北線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoNamboku.png|',
									post: '15px]\]'
								}
							}
						},
						'fukutoshin': {
							label: '副都心線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoFukutoshin.png|',
									post: '15px]\]'
								}
							}
						},
						'asakusa': {
							label: '淺草線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoAsakusa.png|',
									post: '15px]\]'
								}
							}
						},
						'mita': {
							label: '三田線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoMita.png|',
									post: '15px]\]'
								}
							}
						},
						'shinjuku': {
							label: '新宿線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoShinjuku.png|',
									post: '15px]\]'
								}
							}
						},
						'oedo': {
							label: '大江戶線',
							action: {
								type: 'encapsulate',
								options: {
									pre: '[\[File:Subway_TokyoOedo.png|',
									post: '15px]\]'
								}
							}
						}
					}
				}
			}
		} );
		$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
			'section': 'railway',
			'group': 'general',
			'tools': {
				'stnta': {
					label: '站名繁簡轉換模板',
					type: 'button',
					icon: 'http://upload.wikimedia.org/wikipedia/commons/3/3b/Toolbaricon_regular_a_to_b.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: '{\{subst:User:Altt311/Template/StnNoteTA\n|NameS = \n|NameT = ',
							post: '\n}\}\n'
						}
					}
				},
				'linecolor': {
					label: 'JR路線顏色模板',
					type: 'button',
					icon: 'http://upload.wikimedia.org/wikipedia/commons/2/25/Vector_toolbar_bulleted_list_button.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: '{{RailwayLineColor|',
							periMsg: '顏色',
							post: '|■}}'
						}
					}
				},
				'stnnum': {
					label: '東京地鐵車站編號',
					type: 'button',
					icon: 'http://upload.wikimedia.org/wikipedia/commons/d/db/Button_with_wikinumber_character.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: '{\{車站編號 (東京)|',
							periMsg: '路線名|車站編號',
							post: '}\}'
						}
					}
				},
				'platbl': {
					label: '月台配置基本框架',
					type: 'button',
					icon: 'http://upload.wikimedia.org/wikipedia/commons/3/30/Vector_toolbar_numbered_list_button.png',
					action: {
						type: 'encapsulate',
						options: {
							pre: '{\| border="1" cellspacing="0" cellpadding="3" frame="hsides" rules="rows"\n|-\n!月台編號\|\|路線\|\|行駛方向',
							post: '\n|\}\n'
						}
					}
				}
			}
		} );
	} );
}