Fandom Developers Wiki

本脚本/样式表仅限个人使用!

你可以随便安装本脚本/样式表供自己使用,但不可以安装在社区范围(如安装在MediaWiki:Common.js、MediaWiki:Common.css、MediaWiki:Fandomdesktop.js或MediaWiki:Fandomdesktop.css中),因为这将违反Fandom的使用条款
(详情请见定制化原则

最后编辑可将有关最后一次编辑的详细信息添加到页面上。上述的详细信息具有最后一次编辑的时间(分钟/小时/天/月/年)、进行编辑的用户、编辑摘要(在给出的情况下)、当前页面大小(以字节为单位)以及用于打开可查看更改差异的模态框链接。其模态框具有可前往实际差异页面的链接、用于撤消编辑的链接以及用户在具有其所需权限的情况下对编辑进行回退。

日期和时间为默认添加不能进行更改,除此之外的其他选项可以进行配置

安装[]

配置[]

选项 说明 类型 许可值 默认
avatar 编辑者头像 布尔值 true
false
true
avatarsize 头像大小 整数 非特定 15
size 当前页面大小(以字节为单位) 布尔值 true
false
true
diff 附加最后编辑的差异链接
diffModal 是否应在最后编辑的差异模态框中加载差异链接。在用户喜欢在快速查看差异中打开对比链接的情况下非常有用。
comment 给出的编辑摘要*
newpage 决定最后编辑是否将在没有任何编辑(页面创建编辑除外)的情况下在新创建页面上显示
mainpage 决定最后编辑是否将在主页上呈现
time 决定提到的时间必须采用“于...前”时间格式或时间戳 字符串 timestamp
timeago
timeago
timezone 确定显示的时间戳是本地格式还是UTC格式* UTC
locale
local
lang 更改语言显示* 任何有效的语言代码 非特定
position.element 控制将在何处添加详细信息 对象 页面上存在的任何有效元素
position.method 控制是否需要在position.element中定义的元素上附加或前置细节。 字符串 append
prepend
namespaces.exclude 要排除的名字空间ID列表 数组 非特定 []
pages 要排除的页面列表

对脚本进行的所有配置都将存储在lastEdited对象中。这是设置语言显示为日语的示例:

window.lastEdited = {
	avatar: true,
	avatarsize: 20,
	size: false,
	diff: true,
	comment: false,
	newpage: false,
	mainpage: true,
	time: 'timestamp',
	timezone: 'UTC',
	lang: 'ja',
	position: {
		element: document.getElementById('WikiaPageHeader'),
		method: 'append'
	},
	namespaces: {
		exclude: []
	},
	pages: []
};

工具栏示例[]

以下内容可用于将脚本添加到工具栏,而不是将其附加到标题。

// Create the element we're attaching to
$('.toolbar .tools').append('<li id="lastedited" />');
// Attach to the element, as well as make the script only show one line
window.lastEdited = {
	size: false,
	comment: false,
	position: {
		element: 'li#lastedited',
		method: 'append'
	}
};
// Change how the links look (JustLeafy's suggestion, is optional)
mw.util.addCSS('#lastEdited a { color: ' + $('.lastEdited-timeago').css('color') + '; text-decoration: underline }');

备注[]

  • 如果未提供编辑摘要,则无论comment值如何,整个部分都将被省略。
  • lang仅供个人设置使用。请不要在站点范围内进行设置。
  • timezone仅在time设置为timestamp时可用。
  • 对于任何样式,外层div的类是lastEdited,头像图标的类是lastEdited-avatar
  • 设置position.element时,请确保遵循定制化政策。若未提供设置,则默认位置在页面标题下方和用户页编辑按钮左下方。
    • 如果您不知道如何获取详细信息以显示在特定位置,请到讨论页询问。
  • 下表显示了可与脚本一起使用的默认名字空间的完整列表,其ID可用于排除:
ID Namespace Description
-2 Media Used for direct linking to images. For example, Media:Wiki.png links directly to the image page.
-1 Special Special pages. Used by MediaWiki code and extensions
0 Mainspace Articles
1 Talk Article discussion
2 User Personal user pages
3 User talk Pages for discussion with users
4 Project/Sitename Wiki-related content
5 Project talk/Sitename talk Discussion of Project pages'
6 Image/File File descriptions
7 Image talk/File talk File discussion
8 MediaWiki System messages and configuration
9 MediaWiki talk Discussion of MediaWiki pages
10 Template Templates
11 Template talk Template discussion
12 Help Help pages, also see Shared Help
13 Help talk Discussion about Help pages
14 Category Categories
15 Category talk Category discussion
110 Forum Old forum pages
111 Forum talk Discussion about old forum pages
500 User blog Blog pages
501 User blog comment User blog comments
502 Blog Blog listing pages
503 Blog Blog listing pages
828 Module Lua module pages
829 Module talk Lua module discussion pages
1200 Message Wall Pages used for the Wall extension. Touch only if you know what are you doing.
1201 Thread Message Wall thread namespace
1202 Message Wall Greeting Pages used for content above message boxes on Message Walls
2000 Board Board namespace. Used for storing board descriptions
2001 Board Thread Forum threads

计划[]

  • Handle errors if rollback fails

更新日志[]

Date Description
November 1st, 2017 Script rewritten to use jQuery functions instead of DOM API.

Added a diffModal configuration option.
No longer throwing errors on ?action=edit.
Extracted CSS to a separate stylesheet.
mw.config caching.
Extracted translation data to JSON to support the translations editor.
Finding a user's avatar is no longer requiring another HTTP request.
Script is showing a throbber before it finishes loading.
Diff modal is loading faster.

November 27th, 2016 Added a few requested features.
October 14th, 2016 Script rewritten; added functionalities:
  • Minor edits are now marked.
  • Change in size is indicated.
  • Position of the details can be configured.
  • More responsive modal.
  • Edits can be rollbacked from the modal.
July 9th, 2015 Added Monobook support.
April 4th, 2015 Date and time merged together to give an approximate time since the last edit using timeago.
April 3rd, 2015 Added i18n support.

Redid namespace support; added options to include/exclude namespaces and exclude pages.

April 2nd, 2015 Re-added previously removed editor's avatar.
December 30th, 2014 Added editor's avatar, per request.
December 1st, 2014 Namespace support.
November 15th, 2014 Features updated.
October 8th, 2014 Initial release.