User:机智的小鱼君/common.js

/** Quick add zh interwiki links **/ $('.page-header__contribution-buttons ul.wds-list').prepend( $('').append( $('', {     id: 'add-zh-link',      text: '添加中文链接',      href: '#'    }) ) ); $('#add-zh-link').click(function{ var zhpage = prompt('本页面对应的中文页面名？',);  if ( zhpage === null || zhpage === ) {    return;  }  new mw.Api.post({ action: 'edit', title: wgPageName, summary: 'quick add zh link', appendtext: + zhpage + , token: mw.user.tokens.get('editToken') }) .done(function  { location.href='/index.php?action=purge&title=' + wgPageName; }); });

/*========== 自定义工具列 ==========*/ if (mwCustomEditButtons.length) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "//images.wikia.com/central/images/c/c8/Button_redirect.png", "speedTip": "重定向", "tagOpen": "#REDIRECT [" + "[", "tagClose": "]]", "sampleText": "重定向到" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "//images.wikia.com/central/images/c/c9/Button_strike.png", "speedTip": "删除线", "tagOpen": " ", "tagClose": " ", "sampleText": "删除线" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "//vignette.wikia.nocookie.net/central/images/f/fd/Button_underline.png", "speedTip": "下划线", "tagOpen": " ", "tagClose": " ", "sampleText": "下划线" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "//images.wikia.com/central/images/1/13/Button_enter.png", "speedTip": "换行符号", "tagOpen": " ", "tagClose": "", "sampleText": "" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "//images.wikia.com/central/images/7/74/Button_comment.png", "speedTip": "写入一段不被读取的提示", "tagOpen": "", "sampleText": "独立行" }; } ////////////////////////////// // /////////////////// //////////////////////////////