This page is a translated version of the page Manual:Live preview and the translation is 85% complete.

实时预览是MediaWiki的一项用以预览的功能,它可以在不重新加载原有HTML代码的情况下显示条目或章节的预览。

它含有一些錯誤,請參閱實時預覽跟踪錯誤以獲取最新列表。

启用实时预览

实时预览的启用与否取决于您参数设置的“编辑”頁籤中的設定,預設為關閉。

优点

  • 传入流量更少:不会再次从服务器获取wiki代码和所有菜单
  • 响应时间更短
  • 编辑窗体中的光标位置不变。
  • undo/redo history in the editing window is kept

缺点

只更新预览区域,这意味着:

  • 如果腳本不使用wikipage.content鉤子,則不會執行。
  • 介面中的某些部分(如跨語言鏈接、嵌入列表等)可能不會正確地更新。
  • 在瀏覽器歷史記錄中的導航(對此預覽)不再起作用

技术细节

實時預覽使用解析API修訂版本APIdifftotext-選項,送出新版本文字以獲取在編輯頁面中的已解析預覽或差異集合。

Since it is dynamic on the client side, it requires JavaScript to work. Should JavaScript be deactivated, the edit will preview traditionally (with page reload), even if this feature is activated. This is an instance of progressive enhancement.

参见