Jump to content

Extension:修订滑块

本頁使用了標題或全文手工轉換
From mediawiki.org
This page is a translated version of the page Extension:RevisionSlider and the translation is 72% complete.
MediaWiki扩展手册
RevisionSlider
发行状态: 稳定版
实现 用户界面
描述 添加滑块界面至差異视图可以更容易地在修订版本之间移动
作者 德国维基媒体协会(WMDE)
兼容性政策 快照跟随MediaWiki发布。 master分支不向后兼容。
MediaWiki 1.25+
数据库更改
许可协议 GNU通用公眾授權條款2.0或更新版本
下載
前往translatewiki.net翻譯RevisionSlider扩展
問題 开启的任务 · 报告错误

修订滑块(RevisionSlider)扩展添加滑块界面至差異视图,这样您可以更容易地在修订版本间移动。

安装

  • 下载文件,并解压RevisionSlider文件夹到extensions/目录中。
    开发者和代码贡献人员应改从Git安装此扩展,输入:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
    
  • 請新增下列代码到您的LocalSettings.php 文件的底部:
    wfLoadExtension( 'RevisionSlider' );
    
  • Yes 完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。

用法

在差异页面时,滑块默认被折叠,并只能在页面顶部看见一行称作“浏览历史”的下拉栏。点击该栏以展开修订滑块。

一旦展开,修订滑块会取得有关修订版本的数据,并允许您在差异页面上导航并比较修订版本。

每个竖条代表页面的修订版本。

上方的竖条显示页面大小的增长,下方的竖条则显示其减小。
在图片中,修订版本1代表添加的内容,而修订版本2代表移除内容。

要选择要比较的修订版本,可使用黄色和蓝色旋钮。 蓝色的旋钮控制新修订版本,黄色的旋钮责映射到旧修订版本。

There are several ways to do this:
  • You can drag and drop the knob to the desired position on the slider.
  • You can click on the desired position on the slider line.
To select the newer revision, click on the blue line, and for selecting the older revision, click on the yellow line. To indicate which revision you're about to select, a preview of a blue or yellow knob appears and the bar turns blue or yellow.
  • You can click into the bar above the middle line (to select the newer revision) or below the line (to select the older revision). This also gives you a preview of the knob on the middle line.

If you move the blue knob to a position left of the yellow knob, the yellow knob is automatically moved along, and vice versa if you move the yellow knob to a position right of the blue knob.

使用向后和向前箭头以在修订版本历史间移动,并显示新旧修订版本。

Opt-out

If you are not using the RevisionSlider at all and also don't want to see the collapsed RevisionSlider bar at the top of the diff page, you can opt-out by checking "不显示修订滑块" in your preferences under "外观" → "差异".

技术背景

JavaScript钩

修訂滑塊會使用AJAX,在選取新修訂版本時重新載入差異頁面。頁面重新載入後,wikipage.contentwikipage.diff鉤子皆會觸發。若使用者JavaScript或擴充功能JavaScript需對差異頁面進行操作,您可能需要監聽這些鉤子。

例子

API调用和取得数据

除非您展开了该工具栏,工具不会进行任何API调用。只有当用户展开了滑块时,它才取得有关修订版本的数据(修订版本id、时间戳、用户、摘要、大小和标记)。工具只取得当前屏幕上可用修订版本的数据(最多500个修订版本),且有关额外修订版本的数据只当用户使用箭头在时间轴上向前或向后导航时才会加载。

背景

修订滑块[1]是实现德语社群愿望单[2]最大愿望之一的功能,并由德国维基媒体协会(WMDE)的TCB团队开发。它受DerHexer的revisionjumper小工具启发,并基于维基媒体基金会社群技术团队原型

Notes (for rather technical audience) on RTL issues discovered while developing the extension have been published on the separate subpage.

參考資料