Jump to content

Extension:全域监视列表

本頁使用了標題或全文手工轉換
From mediawiki.org
This page is a translated version of the page Extension:GlobalWatchlist and the translation is 100% complete.

GlobalWatchlist

2021 Coolest Tool
Award Winner

in the category
Newcomer

MediaWiki扩展手册
GlobalWatchlist
发行状态: 不再維護
实现 特殊页面
描述 建立一个“全域”监视列表
作者 DannyS712留言
兼容性政策 快照跟随MediaWiki发布。 master分支不向后兼容。
MediaWiki 1.36+
  • $wgGlobalWatchlistEnableGuidedTour
  • $wgGlobalWatchlistDevMode
  • $wgGlobalWatchlistSiteLimit
许可证 GNU General Public License 2.0 or later
下載
README
前往translatewiki.net翻譯GlobalWatchlist扩展
問題 开启的任务 · 报告错误

全域监视列表扩展可讓用户同時查看多個網站上受追蹤頁面的變更。

安裝

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

配置

该扩展有以下配置选项
變數名 默认值 描述
$wgGlobalWatchlistWikibaseSite false 应被视为Wikibase Repository的网站,且需为变更项目获取标签。 若为false,则不应用对Wikibase项目的额外处理。
$wgGlobalWatchlistUseVue false 是否使用实验性的Vue.js版本显示
$wgGlobalWatchlistDevMode false 是否将调试日志条目发送至控制台
$wgGlobalWatchlistEnableGuidedTour false 是否在安装GuidedTour扩展后为设置页面启用GuidedTour功能
$wgGlobalWatchlistSiteLimit 5 用户可保存至监视列表的站点数量上限。设置为0则表示无限制。

使用

要查看全局监视列表,请访问其安装有该扩展的维基网站上的Special:GlobalWatchlist页面。 默认情况下,仅显示本地维基的更改,但通过修改Special:GlobalWatchlistSettings处的配置,用户可选择显示其他站点的更新内容,最多可达到配置允许的上限。

警告 警告: 建议与CentralAuth配合使用,并选择用户关联账户的其他站点;此扩展程序未经其他配置测试。

JavaScript hook: ext.globalwatchlist.rebuild

The GlobalWatchlist interface exposes a client-side hook named ext.globalwatchlist.rebuild that is fired after every rebuild of the watchlist display, both after a full browser page load and after internal refreshes triggered by the feature itself. This hook can be used by gadgets and user scripts or other extensions to run custom JavaScript whenever the global watchlist view is redrawn.

The hook callback receives a single object parameter with the following fields:

  • root – The root DOM element of the GlobalWatchlist interface that has just been rebuilt.
  • inLive – Boolean flag indicating whether the interface is currently in “live updates” mode.
  • fastMode – Boolean flag indicating whether the interface is in “fast load” mode.
  • timestamp – A timestamp string representing the moment of the data snapshot for which this rebuild is valid.

A typical usage pattern looks like:

mw.hook( 'ext.globalwatchlist.rebuild' ).add( function ( data ) {
    // data.root is the rebuilt container element
    // data.inLive indicates live updates mode
    // data.fastMode indicates fast load mode
    // data.timestamp is the data timestamp for this view
    // Custom logic can be added here, for example:
    // $( data.root ).addClass( 'my-globalwatchlist-enhancement' );
} );

整合其他擴充功能

  • 安装CentralAuth后,用户仅可在其全域监视列表中添加已关联账户的维基站点。
  • 当全域监视列表中的某些站点安装了Wikibase知识库扩展时,系统可获取并显示项目与属性的标签。若同时安装了WikibaseLexeme,则系统还将获取词汇单元的标签信息。
  • 安装GuidedTour并启用$wgGlobalWatchlistEnableGuidedTour后,在首次访问Special:GlobalWatchlistSettings页面时,会提供一次导览

参见