維基百科:維基百科工具/導航Popup

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書
Navigation popups 圖示
中文維基百科的navigation popups

Navigation popups(譯名:彈出式導航)提供一個使用很多維基百科功能的彈出標籤,只要將滑鼠懸停在內部連結上就能非常方便地使用這個功能。原始碼在MediaWiki:Gadget-popups.js

特性[編輯]

條目中的小圖片預覽(經典外觀的截圖,但完全相容Monobook)
點擊可以放大預覽
  • 滑鼠懸停於條目(及用戶頁)上:
    • 當滑鼠懸停在一個條目連結時,可預覽條目前一部分的文字
    • 預覽條目的第一張圖片
    • 預覽所指向頁面的資訊,包括頁面大小、連結數、所含圖像和分類的數目,以及頁面建立至今的時間
    • 如果是重新導向頁面、小作品或是消歧義頁則會提示
    • 單擊即可進行頁面編輯,檢視頁面歷史,檢視最近的版本,檢視最近的編輯者[1],檢視自我最後變更以來的編輯[1],移動頁面,檢視連入,鏈出變更,監視或解除監視頁面,保護、解除保護或變更保護(限管理員),進入討論頁,編輯討論頁及開啟新話題。
  • 滑鼠懸停於圖像連結時:
    • 預覽圖像
    • 預覽圖像註釋
    • 預覽圖像連結
    • 如果圖像位於commons上時會有提示
  • 滑鼠懸停於用戶相關連結時:
    • 單擊可訪問用戶頁,用戶空間,用戶討論頁,編輯用戶討論頁,討論頁開啟新對話,電郵用戶,貢獻與貢獻樹,用戶紀錄檔,刪除用戶(限管理員),封鎖用戶(限管理員),用戶貢獻統計(X!'s Edit Counter),封鎖紀錄檔。
  • 滑鼠懸停於註腳:
    • 預覽註腳內容。
  • 懸停於任何wiki連結:
    • 清除POPUPS快取[2]
    • 啟用/禁用預覽[2]
    • 啟用/禁用預覽POPUPS[2]
  • 在監視清單、頁面歷史和鏈出變更中可預覽歷史版本,並進入任何一個版本。
  • 在編輯時預覽wiki連結(使用滑鼠選定一個wiki連結)。
  • 在瀏覽歷史時可單擊回退破壞。
  • 維基搜尋,global Wikipedia searchGoogle搜尋。
  • 快速鍵(可選)。
  • 自動修復連結以繞過重新導向和消歧頁(可選)。
  • 應能工作於所有維基媒體站點。

安裝[編輯]

安裝之前,您必須擁有一個中文維基百科的帳號,這樣您才可以使用彈出式導航選單的功能。如果您沒有帳號,那麼您需要申請一個然後登入。

在註冊以後,請點擊右上角「偏好設定」,選擇「小工具」頁籤,勾選「導航Popup」的相關專案頁面以啟用Popup工具。

也可以直接參照load.php的檔案,但不建議使用:

mw.loader.load('//zh.wikipedia.org/w/load.php?modules=ext.gadget.Navigation_popups');
如果您曾經使用其他方法參照導航Popup,這些方法已過時,請解除安裝曾經加上的相關JavaScript指令碼,然後儲存並清除瀏覽器快取。
下面列出了使用不同面板下您需要修改原有編輯的頁面:

可選組態[編輯]

改變你的 popups 的外觀[編輯]

只要修改個人的CSS檔,您就可以變更popups的外觀(默認根據Mediawiki:Gadget-popups.css),您個人的CSS檔如下: User:您的用戶名/vector.css.

此為其中一個範例,background-color為背景顏色、font-family為字型種類、color為文字顏色、font-size為文字大小。

.navpopup { 
  background-color: #BFFF00  !important;
  font-family:      arial    !important;
  color:            #008000  !important;
  font-size:        13px;
}
span.popup_contribs > a.popupNavLink {
        display:    block; /* 加寬“貢獻”,使得懸浮更加方便 */
}

選項[編輯]

您可以自行設定一些選項。從下面的表格中選擇選項以及,每項屬性單獨一行添加到您的用戶自訂JavaScript頁面

window.選項 = 值;

舉例來說,要打開管理員功能的屬性,您需要修改您的JavaScript檔案如下:

window.popupStructure = 'menus';
window.popupAdminLinks = true;
組態選項
選項 (Option) 值 (Value)
預設值是粗体
描述
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不為true時預設是simplePopups,當滑鼠懸停在popup標題上時,會把連結列表顯現在選單欄中。'menus''shortmenus'的增強版本,提供有更多連結。 最後,'lite'是一個非常簡單的版本,僅提供預覽,沒有導航連結。

注意,設定此變數需使用單引號,例如popupStructure='fancy';

popupActionsMenu true, false When using menus, you can either have the title link in the popup generating a menu (if this is set to false) or a separate "actions" menu (if this is set to true, the default).
popupImages true, false 值設為 false ,則不顯示圖像。
popupAdminLinks true, false 值設為 true ,則管理員可使用Popup執行封鎖,刪除頁面,保護或解除保護頁面。
popupShortcutKeys true, false If this variable is set to true then you can focus some of the links in the popups quickly by pressing keys. When you hover the mouse over a link with a shortcut, the shortcut key appears at the end of the popup hint. For example, in Firefox or Opera, to quickly edit an article in a new tab you can type 'e Control-Enter'. Internet Explorer users beware: shortcut keys don't work and turning this option on will reveal various bugs, so it's not recommended.
popupDragging true, false 值設為true ,則能夠按住shift鍵不放,用滑鼠拖曳popups視窗。
popupFixRedirs true, false 值設為true ,則能夠以點擊"Redirects"連結而自動地修正重新導向頁面。
popupRedirAutoClick 'wpSave', 'wpPreview', 'wpDiff' The button which is automatically pressed when fixing redirects.
popupFixDabs true, false 值設為true ,則能夠以點擊Popup上的一個連結自動修正連向消歧義頁的錯誤。
popupNavLinks true, false 值設為true ,則popups會顯示導航連結,false則關閉此功能。
popupLastEditLink true, false 值設為true,則popus會顯示最近一次編輯連結,false則關閉此功能。
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.
popupPreviews true, false If this is true and you haven't set simplePopups, then a preview of the first part of the article will appear. (Reports of pages for which this is done badly are most welcome). If false, then this is switched off.
popupSummaryData true, false 值設為true,則popups會顯示目標頁的摘要,false則關閉此功能。
popupLastModified true, false 值設為true,則popups會顯示該頁面最後一次編輯距今的時間。
popupOnlyArticleLinks true, false 值設為true, 則popups只在連往頁面的連結才會啟動。否則,許多連結(例如編輯,說明)均會啟動popups。
imagePopupsForImages true, false By default, preview images are loaded even when hoving over visible images. Setting this to false turns that off.
popupMaxWidth 300,整數或者false Popup視窗的最大寬度的像素。若設為false 則Popup視窗將擴展至容納它所含有的內容。
popupInitialWidth 整數或者false The initial width of the popup in pixels. Setting this to false means the popup will initially be the size needed to accommodate its initial contents.
popupRevertSummary 字串 回復時的編輯摘要。 %s 為回復的版本ID。
popupFixRedirsSummary 字串 修正重新導向時的編輯摘要。 第一個 %s 為置換的重向定頁名稱,第二個 %s 為置換的目標頁面名稱。
popupFixDabsSummary 字串 The edit summary used when disambiguating links. The first %s appearing in this string is replaced with the disambiguation page, and the second %s is replaced with the target page.
預覽選項(preview options)
popupHistoryPreviewLimit 25, an integer
popupCategoryMembers true, false
popupPreviewHistory true, false
popupContribsPreviewLimit 25, 一個整數 貢獻預覽限制
popupPreviewKillTemplates true, false 如果為true,文章中提到的模板只是從預覽刪除了。否則,他們以原始的維基文字形式出現。
popupPreviewRawTemplates true, false
popupPreviewFirstParOnly true, false
popupMaxPreviewSentences 5, 一個整數
popupMaxPreviewCharacters 600, 一個整數 預覽文章的第一段的摘錄的長度。
技術選項
popupNavLinkSeparator 字串,
' ⋅ '
HTML inserted between the navigation links. This defaults to ' • ' in Konqueror and to ' · ' in Microsoft browsers, as they don't appear to like the ⋅ character.
popupAppendRedirNavLinks true, false If true, then a new set of navigation links is generated for the target of redirects; if false, then you're warned about the redirect but no navigation links are generated. This does nothing if popupNavLinks is false.
removeTitles true, false 此標題(popup的預設提示)of links are moved to the main link of the popup if this is true. If this is false then they're not.
實驗選項
下列選項還未經過充分測試,並且未歸檔:popupLiveOptions, popupCookies, popupUnsimplifyLink。想要測試它們(以及其它未歸檔選項)的最簡單互動辦法就是做如下設定:popupLiveOptions=true.

可能更多的選項,也歡迎建議更多設定需求。

進階設定[編輯]

您能夠為文章定義客製化的過濾。這些是javascript在頁面統計產生後執行的功能,它們的輸出將附加(as HTML)為popup視窗的一部份。 (Note that if simplePopups is true or popupSummaryData is false, then nothing will be displayed).

The way to set this up is to write a filter function which accepts a string (the wikitext of the article) as input, and returns a fragment of HTML. Repeat for as many filters as you want, and then create an array extraPopupFilters which contains all of the functions, in the order in which you want them to be run.

For example, let's say you want to be told whenever the wikitext of an article contains a table written using HTML tags rather than wiki markup. One way to do this is to add the following to your user javascript file:

// initialize the array - only do this once
extraPopupFilters=new Array();

// define the function
function popupFilterHtmlTable (wikiText) {
  if (/<table/i.test(wikiText)) return '&lt;table&gt;';
  else return '';
};

// add the function to the array (you can repeat this for lots of functions)
extraPopupFilters.push(popupFilterHtmlTable);

Then when a popup is generated for a page containing an HTML table, you should see <table> in the popup. (It may also appear for other pages, such as this page. Correcting this defect is left as an exercise for the reader).

瀏覽器問題[編輯]

如果哪位能找出這些問題的原因,麻煩請告訴我(英文)。中文版可以和維遊聯繫。

  • 某些人發現使用此指令碼時,會使 Safari 的許多功能出現故障。
  • 在某些版本的 Internet Explorer,當 popupFixDabs 的選項為「true」時,消歧義頁如 mummification 無法顯示所有的它應有的連結。
  • 在 Internet Explorer裏,鍵盤快捷鍵失效,彈出窗口也無法拖曳。有人發現快捷鍵絲毫無損
  • 指針移動到貢獻上,不顯示彈窗。但是可以依次將指針移動到用戶乙 > 用戶 > 貢獻來顯示貢獻的彈窗。

反饋[編輯]

發現任何漏洞、問題,或者有任何建議或改進,請聯絡en:Wikipedia_talk:Tools/Navigation_popups

中文版因為由維游漢化,所以請直接和維游聯絡。

參看[編輯]

製作人員名單和外部連結[編輯]

此工具有賴於許多其他的付出者:

註釋[編輯]

  1. ^ 1.0 1.1 On selected browsers, including Microsoft Internet Explorer
  2. ^ 2.0 2.1 2.2 On selected browsers, including Mozilla Firefox