Go to file
Timo Tijhof 7dae6496b3 mw.ViewPageTarget: Get rid of FOUC on edit section brackets
We don't have a FOUC on the appearing of the 'edit' link. That
one is handled quite intelligently:
* Via the stylesheet that is also loaded in noscript mode, its
  (hidden) appearance is already predetermined. So as soon as
  those elements are seen by the browser they style correctly
  for users without JavaScript (display: none).
* This same stylesheet also hides it for users with JavaScript
  but where VE is not available (e.g. due to browser support).
  While ve-not-available is added very early on (before
  document ready), it could in theory cause a short FOUC, but
  that's okay. We simply don't know that VE isn't supported
  until then. We optimise for the common case (JavaScript
  enabled, VE available), while still ensuring that it is
  always hidden in noscript, and is hidden as soon as possible
  when VE turns out not to be available.

For some reason, one small detail (the little bit of whitespace
added inside the brackets), was left out of this and was
implemented by adding the class 'mw-editsection-expanded' to them
from a document ready handler.

* First step, get rid of the script that adds this class and
  use ve-available instead. That means they're styled
  correctly much earlier (we add the class to <html> before
  document ready). This can still cause a brief FOUC, though
  in most cases they're correct from the start.

* Step two, make brackets expand by default for script users,
  and let ve-not-available reset it. This way, like with edit tabs,
  a FOUC will never happen for ve-available. And even for
  ve-not-available, a FOUC is rare since we add it before
  document ready via <html> look-ahead styling.

There was still a brief reflow jump because of negative margins
between two paint events. One was undoing the other at a later
time. These negative margins are a remnant of when we were doing
animations (follows-up I4b9c47fd65a70). They were added to reduce
reflows and content shift, but were now actually causing them.

Removed "padding-right" from mw-editsection, and negative margin
from the brackets.

Also:

* Don't add inline 'style="direction: ltr;"' on every single
  editsection throughout the DOM. This was the only operation we
  were doing unconditionally. While I doubt the need of it in
  general, we can at least allow MediaWiki to do it right, and
  only add the override if needed. This saves quite a few DOM
  operations.

Change-Id: I7a729edc2cd4a66ebc0ad6935ffd02cb9b948bff
2014-05-09 12:20:24 +02:00
.docs Add MobileSurface to .docs/eg-iframe.html 2014-05-08 02:25:22 -04:00
bin generateDocs.sh: Simplify 2014-05-03 21:16:24 +02:00
build/tasks Use submodule for VisualEditor core 2013-12-20 09:18:41 +00:00
lib Update VE core submodule to master (f855dbb) 2014-05-06 13:18:36 -07:00
modules mw.ViewPageTarget: Get rid of FOUC on edit section brackets 2014-05-09 12:20:24 +02:00
.csslintrc Add .csslintrc file and fix remaining warnings 2013-06-05 11:07:00 +00:00
.gitignore Implement Grunt support (grunt jshint,csslint,qunit,watch) 2013-06-05 11:10:23 +00:00
.gitmodules Use submodule for VisualEditor core 2013-12-20 09:18:41 +00:00
.gitreview Set defaultrebase=0 2012-06-20 16:27:40 -07:00
.jscsrc Bump jscs to 0.4.1 2014-04-01 14:39:03 -07:00
.jshintignore Move libraries to the lib/ directory 2013-12-19 23:02:52 +01:00
.jshintrc oojs: Integrate with OOJS v1.0.0 2013-06-06 17:29:55 +02:00
ApiVisualEditor.php Add class name to protected pages, to allow for specific CSS styling of edit area 2014-04-30 13:59:30 -07:00
ApiVisualEditorEdit.php Remove useless isset 2014-04-17 08:17:16 +00:00
AUTHORS.txt Add Moriel Schottlender to AUTHORS.txt and authors string 2013-10-23 11:24:03 -07:00
betafeatures-icon-VisualEditor-language-ltr.svg Enable the language tool as a Beta Feature 2014-04-23 17:46:27 -07:00
betafeatures-icon-VisualEditor-language-rtl.svg Enable the language tool as a Beta Feature 2014-04-23 17:46:27 -07:00
betafeatures-icon-VisualEditor-ltr.svg Adapt beta features icons for RTL 2013-11-08 18:33:53 +02:00
betafeatures-icon-VisualEditor-rtl.svg Adapt beta features icons for RTL 2013-11-08 18:33:53 +02:00
CONTRIBUTING.md Fix dead links in README.md and CONTRIBUTING.md 2014-03-10 18:26:30 +01:00
Gruntfile.js Fix watch list 2014-05-06 23:12:39 +01:00
LICENSE.txt Fix more copyright headers not updated to 2014 2014-01-13 15:08:24 +00:00
package.json Use new banana checker as a linter to avoid lacking qqq messages 2014-04-04 15:22:57 -07:00
README.md Fix dead links in README.md and CONTRIBUTING.md 2014-03-10 18:26:30 +01:00
VisualEditor.hooks.php Merge "Generate PHP VE edit section with correct parameter, vesection" 2014-05-05 17:58:56 +00:00
VisualEditor.i18n.php Adding a comment explaining where the i18n messages are 2014-03-12 17:41:42 -07:00
VisualEditor.php Update VE core submodule to master (f855dbb) 2014-05-06 13:18:36 -07:00
VisualEditorDataModule.php Moving citation tool code in API module into its own function 2014-05-09 08:56:40 +00:00

VisualEditor

VisualEditor provides a visual editor for wiki pages. It is written in JavaScript and runs in a web browser.

It uses the Parsoid parser to convert wikitext documents to annotated HTML which the VisualEditor is able to load, modify and emit back to Parsoid at which point it is converted back into wikitext.

For more information about these projects, check out the VisualEditor and Parsoid pages on mediawiki.

Developing and installing

For information on installing VisualEditor on a local wiki, please see https://www.mediawiki.org/wiki/Extension:VisualEditor

For information about running tests and contributing code to VisualEditor, see CONTRIBUTING.md. Patch submissions are reviewed and managed with Gerrit. There is also API documentation available for the VisualEditor.