置顶公告:【置顶】关于临时开启评论区所有功能的公告(2022.10.22) | 【置顶】关于本站Widget恢复使用的公告
  • 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
  • 本镜像站和其他萌娘百科的镜像站无关,请注意分别。

幫助:Popups小工具

萌娘百科,萬物皆可萌的百科全書!轉載請標註來源頁面的網頁連結,並聲明引自萌娘百科。內容不可商用。
跳至導覽 跳至搜尋
Circle-icons-tools-light blue.svg
這個頁面「Help:Popups小工具」是萌娘百科的小工具說明文檔

Navigation popups 是一個可在將光標懸停在鏈接上時出現的彈出窗口中輕鬆訪問文章預覽的小工具。它不應與一般的頁面預覽混淆,後者是所有用戶無需開啟即可擁有的默認的、更以讀者為中心的預覽窗口。

該工具引自enwp:MediaWiki:Gadget-popups.js,萌百對該版本進行了修改,以適應萌百環境。

功能

  • 鼠標懸停於條目(或用戶頁)上:
    • 當鼠標懸停在一個條目鏈接時,可預覽條目前一部分的文本
    • 預覽條目的第一張圖片
    • 預覽所指向頁面的信息,包括頁面大小、鏈接數、所含圖像和分類的數目,以及頁面建立至今的時間
    • 如果是重新導向頁或者消歧義頁則會由額外提示
    • 單擊即可進行頁面編輯,查看頁面歷史,查看最近修訂,查看最近的編輯者,查看自我最後更改以來的編輯,移動頁面,查看鏈入,鏈出更改,監視或解除監視頁面,保護、解除保護或更改保護(限管理員),進入討論頁,編輯討論頁及開啟新話題。
  • 鼠標懸停於圖像鏈接時:
    • 預覽圖像
    • 預覽圖像注釋
    • 預覽圖像鏈接
  • 鼠標懸停於用戶相關鏈接時:
    • 單擊可訪問用戶頁,用戶空間,用戶討論頁,編輯用戶討論頁,討論頁添加新話題,給用戶發送電子郵件,用戶貢獻,用戶日誌,封禁用戶(限管理員),封禁日誌等。
  • 鼠標懸停於腳註:
    • 預覽腳註內容。
  • 懸停於任何wiki鏈接:
    • 清除POPUPS緩存
    • 啟用/禁用預覽或POPUPS
  • 在監視列表、頁面歷史和鏈出更改中可預覽歷史版本,並進入任何一個版本。
  • 在編輯時預覽wiki鏈接
  • 在瀏覽歷史時可單擊回退破壞
  • 快捷鍵(可選)
  • 自動修復鏈接以繞過重新導向和消歧頁(可選)

用戶配置

Popups的一些功能可以被自定義配置,完整配置表參見enwp:Wikipedia:Tools/Navigation_popups#Configuration (optional)

您可以從下方的表單中選擇您需要的選項,以window.【option】 = 【value】;的格式每行一個添加到您的common.js或skin.js里。

部分常用選項及示例:

  • 操作下拉欄

預置shortmenus(默認)、menus、lite、original、nostalgia、fancy、fancy2七個可選項
window.popupStructure = 'shortmenus'; //shortmenus應替換成上述7個中的任一值

  • 管理員選項(若用戶為管理員則自動開啟)

window.popupAdminLinks = true;

完整功能選項表

Option Values
默認值以粗体標記
簡介
標準選項
popupDelay 0.5, 一個十進制的數 停留幾秒後導航Popup才顯示。
popupHideDelay 0.5, 一個十進制的數 彈出式窗口延遲幾秒後隱藏。
simplePopups true, false 如果僅僅想要顯示鏈接,可以把這個選項設為true。這樣就不會加載更多數據,poups也僅僅顯示鏈接列表,除非您還將下列選項設為true:: popupUserInfo, popupPreviewDiffs, popupPreviewHistory, popupCategoryMembers, imagePopupsForImages.
popupStructure 'original', 'fancy', 'fancy2', 'menus', 'shortmenus', 'lite', 'nostalgia' 選擇popups的結構。simplePopups選擇true時默認為'original',有所有導航鏈接。'fancy'fancy2'nostalgia''original'的變體。其他情形默認是simplePopups,當鼠標懸停在popup標題上時,會把鏈接列表顯現在菜單欄中。'menus''shortmenus'的增強版本,提供有更多鏈接。'lite'則是一個非常簡單的版本,僅提供預覽,沒有任意導航鏈接。

注意,設定此變量需使用引號。

popupActionsMenu true, false 默認為存在一個單獨的「操作」下拉欄,當禁用時,將在彈窗中使用標題鏈接生成菜單。
popupAdminLinks true, false 選擇true 後,操作下拉欄可使用封禁,刪除、保護或解除保護頁面。
popupShortcutKeys true, false 如果設置此變量為true,可以使用快捷鍵快速鎖定popups中的鏈接。將鼠標懸停在popups內的鏈接上可以查看對應的快捷鍵。比如,在Firefox或Opera瀏覽器中,可以通過按下'e Control-Enter'在新選項卡中快速編輯頁面。按下Esc也會隱藏popups。
popupHistoricalLinks true, false When hovering over links to old revisions and diff links, extra links such as "editOld" are generated if this is true. Otherwise, you get the same links as when hovering over an ordinary link.
popupOnlyArticleLinks true, false 如果設置此變量為true,則僅會在正文中的內鏈上彈出popups。否則,許多其他鏈接(比如「編輯」、「查看歷史」)也會彈出。
popupMaxWidth 350, an integer or false popups的最大寬度(像素數),如果設置為false,popups會為了容納其內容而擴展。
popupInitialWidth an integer or false popup的初始寬度(px)。設為false意味着popup將會根據內容確定需要的初始寬度。
popupTocLinks true, false 是否為目錄項彈出popups。設置為true時,目錄項也會彈出popups。
popupSubpopups true, false 如果設置此變量為true,popups會在頁面預覽中的鏈接上彈出。
popupDragHandle false, 'popupTopLinks', ... The name of an element by which the popup can be dragged without holding the shift key. If false, then the popup can be dragged using the shift key instead.
popupAllDabsStubs true, false If this variable is set to false then only pages that look like stubs or disambiguation pages in the article namespace are treated specially. (Setting this to true can lead to lots of false positives).
popupAdjustDiffDates true, false If true, then dates in history, diff and user contributions previews are adjusted according to the settings in your user preferences.
popupModifier false (default), 'ctrl', 'shift', 'alt', 'meta' Lets popups only appear when pushing a modifier key while hovering over the links. This prevents unintentional popups that hide page content.
圖像選項
popupImages true, false 設置為false則不顯示圖像。
imagePopupsForImages true, false 默認情況下,即使某個圖像可見,popups也會在鼠標懸浮時顯示該圖像的預覽。設為false可以關閉它。當simplePopups被設為true時,這個選項默認關閉。
popupThumbAction "imagepage", "sizetoggle", "linkfull" 這個選項控制的是點擊預覽中的圖像時的動作。"imagepage":跳轉到圖像說明頁面(當鼠標懸浮到圖像上,則會生成一個子popup),除非你預覽的就是圖像頁面;"sizetoggle":點擊圖像後會放大/縮小它;"linkfull":直接跳轉到圖像的完整尺寸版本。
重新導向、消歧義、監視選項
popupFixRedirs true, false 設為true,則當你預覽重新導向鏈接時,通過一次點擊即可自動「修復」它。注意:你可能並不想每次碰到重新導向鏈接就去「修復」它,而且你肯定不會專門逮着這種鏈接去「修復」。刷編輯量警告。
popupRedirAutoClick 'wpDiff', 'wpPreview', 'wpSave' 當你點擊「修復重新導向」後,後續的操作。這三個分別是「差異」、「預覽」、「保存」。如果設為'wpSave',將不會有任何確認步驟而是直接保存。
popupFixDabs true, false 設為true後,可以在popup底部選擇其中的一個鏈接,來消歧義某個有歧義的鏈接。
popupDabsAutoClick 'wpDiff', 'wpPreview', 'wpSave' 當你消歧義(或移除)某個鏈接後,後續的操作。如果設為'wpSave',將不會有任何確認步驟而是直接保存。
popupRedlinkRemoval true, false 設為true後,遇到紅鏈時,你可以通過選擇「移除此鏈接」來移除它。(但是需要注意紅鏈有時是有用的)
popupRedlinkAutoClick 'wpDiff', 'wpPreview', 'wpSave' 點擊移除紅鏈後,後續的操作。如果設為'wpSave',將不會有任何確認步驟而是直接保存。
popupWatchDisambiggedPages true, false, null 設為true,則修復歧義鏈接後會自動監視被修復的頁面;設為false,則會自動取消監視;設為null,則行為取決於你的偏好設置。(似乎只在popupDabsAutoClick = 'wpSave'時生效)
popupWatchRedirredPages true, false, null 設為true,則修復重新導向鏈接後會自動監視被修復的頁面;設為false,則會自動取消監視;設為null,則行為取決於你的偏好設置
導航選項
popupNavLinks true, false If this is true then navigation links are displayed. If false, then these are switched off.
popupLastEditLink true, false Whether the popup should contain a "most recent edit" link.
popupEditCounterTool "supercount", "custom" The edit counter tool to use or a custom url defined by popupEditCounterUrl.
popupEditCounterUrl "" The url for a custom edit counter. You can use replaceable parameters in this url: $1 will be replaced with the username, and $2 with the database name (for example, enwiki_p).
預覽選項
popupPreviews true, false 如果這個選項被設為true並且你沒有設置simplePopups,那麼將會顯示文章第一段的預覽;設為false則不顯示。
popupSummaryData true, false 設為true可以顯示頁面的概要;設為false則不顯示。
popupUserInfo true, false 設為true,則當目標頁面在User、User_talk名字空間時,會顯示所屬用戶的信息。當simplePopups被設為true時,這個選項默認關閉。
popupLastModified true, false 設為true可以在頁面概要顯示該頁面最後一次編輯距今的時間。
差異選項
popupDiffDates true, false 設為true可以在預覽差異時顯示兩個版本的編輯時間。
其他選項
popupOnEditSelection true, false, 'cursor', boxpreview If this is true then popups are generated for selected wikilinks when editing.
popupImageLinks true, false 設為true會在預覽中顯示鏈接到一個圖像的頁面。暫時不適用於共享站的圖像。
popupShowGender true, false 設為true可在用戶信息中加上性別符號。
編輯摘要選項
popupRevertSummaryPrompt true, false 設為true,每次撤銷時可以自定義摘要。
popupRevertSummary 字符串 沒有使用queried revert summary(見下)時,摘要為'回退到修訂版本%s ——Popups'。string中的第一個%s將會被替換為被恢復的版本ID。
popupExtendedRevertSummary 字符串 默認:'回退到$2在$1時製作的修訂版本$3 ——Popups'
popupRevertToPreviousSummary 字符串 默認:'回退到修訂版本%s的上一個版本 ——Popups'
popupQueriedRevertSummary 字符串 The edit summary used when reverting and using the query interface to get information about the reversion. A $1, $2, $3 in the string are replaced with the revision ID, the timestamp and the editor corresponding to the revision being reverted to. 默認:'回退到$3在$2時製作的修訂版本$1 ——Popups'
popupQueriedRevertToPreviousSummary 字符串 The edit summary used when reverting using diff links such as those found on user contributions pages and using the query interface to get information about the reversion. A $1, $2, $3 in the string are replaced with the revision ID, the timestamp and the editor corresponding to the revision immediately after the revision being reverted to. 默認:'回退到修訂版本$1的上一個版本,由$3在$2時製作 ——Popups'
popupFixDabsSummary 字符串 消歧義時使用的編輯摘要。字符串中第一個 %s 為消歧義頁面,第二個 %s 為目標頁面。默認:'消歧義%s%s ——Popups'
popupFixRedirsSummary 字符串 修復重新導向時使用的編輯摘要。字符串中顯示的第一個 %s 為重新導向,第二個 %s 為目標頁面。默認:'忽略從%s%s的重新導向 ——Popups'
popupRedlinkSummary 字符串 移除紅鏈時使用的編輯摘要,此字符串中顯示的 %s 為紅色鏈接的名稱。默認:'取消到空頁面%s的鏈接 ——Popups'
popupRmDabLinkSummary 字符串 默認:'移除到消歧義頁%s的鏈接 ——Popups'
編輯預覽選項
popupHistoryPreviewLimit 25, an integer 版本歷史預覽的最大顯示數量。
popupCategoryMembers true, false 是否預覽分類中的成員。當simplePopups被設為true時,這個選項默認關閉。
popupPreviewDiffs true, false 是否顯示差異鏈接的預覽。當simplePopups被設為true時,這個選項默認關閉。
popupPreviewHistory true, false 是否對頁面歷史的鏈接生成特殊預覽。當simplePopups被設為true時,這個選項默認關閉。
popupContribsPreviewLimit 25, an integer 用戶貢獻預覽的最大顯示數量。
popupPreviewKillTemplates true, false 設為true,則頁面使用的模板將從預覽中被刪除;否則模板會顯示為wikitext源代碼。
popupPreviewRawTemplates true, false 設為true,則對模板頁面的預覽將會顯示為源代碼;否則將會嘗試解析它們。
popupPreviewFirstParOnly true, false 設為true,則預覽被限制在條目第一段。
popupMaxPreviewSentences 5, an integer 在預覽中最大的句數,從近似條目開頭的地方開始計數。
popupMaxPreviewCharacters 600, an integer 在預覽中最大的字母數量,從近似條目開頭的地方開始計數。
技術選項
removeTitles true, false 設為true,則移除預覽主界面的標題部分。
popupAppendRedirNavLinks true, false 設為true,對於重新導向鏈接,會生成一個到重新導向目標的鏈接;設為false,僅會提示這是一個重新導向。這個選項在popupNavLinks被設為false時無效。
popupNavLinkSeparator string,
' ⋅ '
插入到導航鏈接兩兩之間的HTML代碼。默認是' ⋅ '(⋅)。
popupLazyDownloads true, false 設為true時,只有在popup出現時才會加載對應頁面內容;設為false時,當鼠標懸浮在鏈接上時就會加載。
popupLazyPreviews true, false 設為true時,在popup出現之前,預覽不會後台生成;設為false時,只要所需要的數據可用,預覽就會開始生成。
測試性功能
popupReview true, false 增加一個「標記為已巡查」的鏈接。
popupSetupMenu true, false 一個附加的菜單,可以用來禁用或者重置pupups本身。
popupSimplifyMainLink true, false 對於主名字空間之外的頁面,標題中不顯示名字空間前綴。
popupDebugging true, false
popupActiveNavlinks true, false
popupModifierAction 'enable', 'disable'
popupDraggable true, false
popupNeverGetThumbs true, false
popupImageSize 60, an integer
popupImageSizeLarge 200, an integer
popupMinorReverts true, false 標記回退/編輯為小編輯。
popupDabWiktionary 'last', 'first' Determine position of the option to disambiguate the link to point to wiktionary instead.
popupPreviewCutHeadings true, false
popupPreviewButton true, false
popupPreviewButtonEvent 'click'
popupDiffMaxLines 100, an integer 進行差異睡覺對比的最大行數
popupDiffContextLines 2, an integer 每筆更改之前和之後要包含在差異中的行數
popupDiffContextCharacters 40, an integer
popupDiffDatePrinter 'toLocaleString', a string
popupHistoryLimit 50, an integer The maximum amount of history to search through for the changes since my last edit. NOTE: misnomer
popupFilters array default: [popupFilterStubDetect, popupFilterDisambigDetect, popupFilterPageSize, popupFilterCountLinks, popupFilterCountImages, popupFilterCountCategories, popupFilterLastModified]
extraPopupFilters [], an array
popupRevDelUrl string default: '//en.wikipedia.org/wiki/Wikipedia:Revision_deletion' Determines where to link to when showing revision deleted versions in the history
popupNewWindows true, false popups中的鏈接是否在新標籤頁/新窗口中打開。
popupLinksNewWindow string default: {'lastContrib': true, 'sinceMe': true}

Allow lastContrib or sinceMe links to open in a separate window. NOTE: not functional right now.

popupDabRegexp string default: '(\\{\\{\\s*disambig(?!uation needed)|disambig\\s*\\}\\}|disamb\\s*\\}\\}|dab\\s*\\}\\})|\\{\\{\\s*(((geo|hn|road?|school|number)dis)|[234][lc][acw]|(road|ship)index)(\\s*[|][^}]*)?\\s*[}][}]|is a .*disambiguation.*page'
popupAnchorRegexp 'anchors?', a string
popupStubRegexp string default: '(sect)?stub[}][}]|This .*-related article is a .*stub'
popupImageVarsRegexp string default: 'image|image_(?:file|skyline|name|flag|seal) |cover|badge|logo'

更改工具外觀

Popups的外觀也可以被自定義配置,可通過您的common.css或skin.css修改。

以下為一個案例:

.navpopup { 
	background-color: #FFBE20  !important; /* 更改背景顏色 */
	font-family:      serif    !important; /* 更換字體 */
	color:            #404     !important; /* 更改文字顏色 */
}
span.popup_contribs > a.popupNavLink {
	display:    block; /* 加寬「貢獻」欄 */
}
.navpopup { font-size: 0.875em !important; } /* 增加字號 */
.popup_menu { margin-top: 1.1em !important; } /* 增加字號 */