CompareApi
From Project-EPB Commons
- https://common.wjghj.cn/index.php?title=MediaWiki%3AJs-InPageEdit-v2.js&type=revision&diff=1238&oldid=1210
- https://common.wjghj.cn/api.php?action=compare&fromrev=1238&totitle=MediaWiki%3AJs-InPageEdit-v2.js&prop=diff%7Cdiffsize%7Crel%7Cids%7Ctitle%7Cuser%7Ccomment%7Cparsedcomment%7Csize
返回数据如下:
{
"compare": {
"fromid": 50,
"fromrevid": 1210,
"fromns": 8,
"fromtitle": "MediaWiki:Js-InPageEdit-v2.js",
"fromsize": 38138,
"fromuser": "机智的小鱼君",
"fromuserid": 1,
"fromcomment": "[InPageEdit] 没有编辑摘要",
"fromparsedcomment": "[InPageEdit] 没有编辑摘要",
"toid": 50,
"torevid": 1238,
"tons": 8,
"totitle": "MediaWiki:Js-InPageEdit-v2.js",
"tosize": 38285,
"touser": "机智的小鱼君",
"touserid": 1,
"tocomment": "[InPageEdit] 使用严格模式",
"toparsedcomment": "[InPageEdit] 使用严格模式",
"prev": 1204,
"diffsize": 2903,
"*": "这里是diff的表格"
}
}
|
MediaWiki:Js-InPageEdit-v2.js(版本1201) [编辑] 编辑者 (编辑摘要) |
MediaWiki:Js-InPageEdit-v2.js(版本1238) [编辑] [撤销] 编辑者 (编辑摘要) |
||
| 第15行: | 第15行: | ||
**/ | **/ | ||
| + | 'use strict'; | ||
if (InPageEdit) throw '[InPageEdit] 已经有一个IPE插件在执行了'; | if (InPageEdit) throw '[InPageEdit] 已经有一个IPE插件在执行了'; | ||
| + | |||
// 创建全局函数 | // 创建全局函数 | ||
var InPageEdit = {}; | var InPageEdit = {}; | ||
| 第660行: | 第662行: | ||
if (diff === '0') { | if (diff === '0') { | ||
InPageEdit.quickDiff({fromrev:oldid,toid:curid}); | InPageEdit.quickDiff({fromrev:oldid,toid:curid}); | ||
| + | } else if (diff === 'prev' || diff === 'next' || diff === 'cur') { | ||
| + | InPageEdit.quickDiff({fromrev:oldid,torelative:diff}); | ||
} else { | } else { | ||
InPageEdit.quickDiff({fromrev:oldid,torev:diff}); | InPageEdit.quickDiff({fromrev:oldid,torev:diff}); | ||