< Requests for comment
Request for comment (RFC)
Live preview
Component General
Creation date
Author(s) Quiddity
Document status Declined
See Phabricator.

A proposal to update the code in the UserPreference "Use live preview (experimental)".

Background

We currently have Live preview as a default part of MediaWiki. It was created in 2007 (?) and hasn't changed much since. There are various newer and better userscripts.

Proposal

I suggest merging the best bits of all the alternatives, into a single [gadget/extension/core feature] that can be used at all wikis (WMF and elsewhere).

I also suggest renaming it (because it's not "live" in the sense of concurrent, it's just quicker than default) to "fast preview" or similar.

A table comparing features.

Featurestandard previewManual:Live preview (code: git)w:User:Js/ajaxPreview (code: .js)w:User:Anomie/ajaxpreview.jswikEd code: [1]w:User:Pilaf/InstaView
Preserve undo historyYesYesYesYesYes
Retain cursor positionYesYesYesYes
<ref>, <references />YesYesYes
<ref name=""> defined outside edited sectionYesYes
Configurable button locationn/aTakes over the default submit buttonsYes (config)Yes
Not scrolling to top on previewYes configurable, on by defaultYes (see wikEd help for scrolling buttons and shortcuts) ?
<syntaxhighlight> (GeSHi) on non-.js/.css pagesYesYesYesYes
<categorytree>YesYesYesYesYes
<math>YesYesYesYesYes
Raw watchlist editing previewYes
Hovercards (beta)YesYesYesYes (upcoming version)
Media viewer (video clip) supportYes WIP, see T74675Yes (upcoming version)
Server interaction methodfull page reload1 json POST to api.php1 json POST to api.php1 json POST to api.php1 html POST to api.php or 1 html non-API POST to index.php, uses Live preview if possiblelocal
Remarks----gadget on many Wikimedia wikis
(incl. up to ~56,000 users on Wikipedias, per m:Gadgets)
- Internet Explorer not supported
outdated code, not actively developed

Notes

  • Most of the other variants I can find - e.g. w:User:CBM/quickpreview.js, fr:MediaWiki:Gadget-QPreview.js, etc - are based on Alex Smotrov's original script, which is what "User:Js/ajaxPreview" is from. Alex seems to have not edited in ~1 year, but I'll email him for feedback (and to thank him for the excellent scripts :).
  • There are two comments by TheDJ and Anomie in this 2012 thread that might be relevant, specifically:
    "The problem with all of them, is that they are unable to load JS and CSS that is specific to your view. So for instance, if you add a video, then preview, the JS code to handle the video won't be loaded. This is one of the primary reasons this functionality isn't on by default yet I presume. —TheDJ (talk • contribs) 23:23, 15 September 2012 (UTC)"
    "AFAIK, all of the currently available options do in fact use the servers anyway; most are posting to the MediaWiki API, while the "live preview" option in the preferences seems to contact its own private "API" on the servers. The VisualEditor and Parsoid projects may change this. Anomie⚔ 02:20, 16 September 2012 (UTC)"

Please add/fix further details or scripts, to the table. Thanks!

No script can reliably activate video clips, please help fixing this (see bug 72675). Cacycle (talk) 10:06, 4 November 2014 (UTC)
  • RFC was removed from consideration. The reason being that it is mostly already implemented or underway to being implemented.

References

  1. wikEd code: User:Cacycle/wikEd.js, see the following consecutive functions: wikEd.LocalPreview(), wikEd.LocalPreviewAjaxHandler(), wikEd.GetArticleText(), wikEd.GetArticleTextAjaxHandler(), wikEd.ParseNamedRefs(), and wikEd.FilePreviewAjaxHandler()
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.