MediaWiki:Group-sysop.js:修订间差异
MediaWiki界面页面
更多操作
无编辑摘要 |
无编辑摘要 |
||
| (未显示同一用户的2个中间版本) | |||
| 第31行: | 第31行: | ||
try { | try { | ||
var self = $(that), | var self = $(that), | ||
href = self.attr('href'), | href = decodeURI(self.attr('href')), | ||
userName = | userName = href.match(/(?=用户讨论\:)[^\&]+/i)[0].replace(/用户讨论\:/i, ''); | ||
} catch (e) { | } catch (e) { | ||
return; | return; | ||
| 第64行: | 第64行: | ||
'format': 'json', | 'format': 'json', | ||
'title': '用户讨论:' + userName, | 'title': '用户讨论:' + userName, | ||
'summary': 'Welcome to | 'summary': 'Welcome to ZJSNR Wiki', | ||
'text': message | 'text': message | ||
}).then(function(data) { | }).then(function(data) { | ||
$('#welcomeAsk').empty().append('<span id="welcomeAskFinished">通信成功!继续努力哦~</span>'); | $('#welcomeAsk').empty().append('<span id="welcomeAskFinished">通信成功!继续努力哦~</span>'); | ||
console.debug('和萌百服务器通信成功,编辑成功! \n' + (data.error != 'internal_api_error_Exception' ? ('编辑详情:' + JSON.stringify(data).replace(/[{}\"]/g, '').replace(/\:\,/, ',')) : '萌百服务器返回"internal_api_error_Exception",你们都懂的_(:3 」∠ )_ ') + '。'); | console.debug('和萌百服务器通信成功,编辑成功! \n' + (data.error != 'internal_api_error_Exception' ? ('编辑详情:' + JSON.stringify(data).replace(/[{}\"]/g, '').replace(/\:\,/, ',')) : '萌百服务器返回"internal_api_error_Exception",你们都懂的_(:3 」∠ )_ ') + '。'); | ||
unbindFun(); | unbindFun(); | ||
$('#mw-content-text a.new[href="' + href + '"]').removeClass('new sendWelcomeMessageLink unsend').attr('href', '/User_talk:' + userName).unbind('click.sendWelcomeMessage'); //js<a>对象的href是绝对url…… | $('#mw-content-text a.new[href="' + encodeURI(href) + '"]').removeClass('new sendWelcomeMessageLink unsend').attr('href', '/User_talk:' + userName).unbind('click.sendWelcomeMessage'); //js<a>对象的href是绝对url…… | ||
}, function( | }, function(textStatus, status) { | ||
if ( | if (textStatus === 'internal_api_error_Exception') { | ||
$('#welcomeAsk').empty().append('<span id="welcomeAskFinished">通信成功!继续努力哦~</span>'); | $('#welcomeAsk').empty().append('<span id="welcomeAskFinished">通信成功!继续努力哦~</span>'); | ||
console.debug('和萌百服务器通信成功,编辑成功! \ | console.debug('和萌百服务器通信成功,编辑成功! \n萌百服务器返回"internal_api_error_Exception",你们都懂的_(:3 」∠ )_ 。'); | ||
unbindFun(); | unbindFun(); | ||
$('#mw-content-text a.new[href="' + href + '"]').removeClass('new sendWelcomeMessageLink unsend').attr('href', '/User_talk:' + userName).unbind('click.sendWelcomeMessage'); //js<a>对象的href是绝对url…… | $('#mw-content-text a.new[href="' + encodeURI(href) + '"]').removeClass('new sendWelcomeMessageLink unsend').attr('href', '/User_talk:' + userName).unbind('click.sendWelcomeMessage'); //js<a>对象的href是绝对url…… | ||
} else if ($.isPlainObject( | } else if ($.isPlainObject(status)) { | ||
$('#welcomeAsk').empty().append('<span id="welcomeAskFinished">正在通信中(2/2)……失败!请重试!</span>'); | $('#welcomeAsk').empty().append('<span id="welcomeAskFinished">正在通信中(2/2)……失败!请重试!</span>'); | ||
errorFun('和萌百服务器通信成功,但编辑失败!\n编辑详情:' + JSON.stringify( | errorFun('和萌百服务器通信成功,但编辑失败!\n编辑详情:' + JSON.stringify(status).replace(/[{}\"]/g, '').replace(/\:\,/g, ',')); | ||
unbindFun(); | unbindFun(); | ||
self.addClass('unsend'); | self.addClass('unsend'); | ||