mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
c1ea21739f
Objective: * Provide quick access to section edit links for both source and visual editing Story: After using this prototype of my mockup, I realized how bad my mockup was. Hooray for prototyping! The issues were twofold: 1. Adding down-arrows to the edit links made the page look worse, and was sure to incite rage and panic throughout the community. 2. The menu was just too heavy. Matmarex made an observation early on after seeing it, that it wasn't very "Vector", and while I agreed, at the time I didn't have any better ideas. Thank you to Matma Rex for prototyping this feature. Aparently there was also a previous attempt (I13bbb9549). We appreciate your help. The new design is simple. * Section edit links look normal * On hover or focus, the edit source link also appears next to it To make the two links look separate, we needed a divider. To make the divider look good we needed to add space around it. To balance the space, we needed to add space to the brackets. To avoid changing the view, we needed to only add space to the brackets on hover. To avoid the text moving around, we needed to make the brackets move away from the text, rather than the text move away from the brackets. To make this change smooth, we needed to use transitions. To make the links not force the heading to wrap in one state but not the other, we needed to reserve the space, using visibility rather than display. To reserve the space we had to use closing brackets as spacers, hiding/showing one of them on mouse enter/leave and leaving the other always hidden. To avoid the right bracket from getting clipped by the edge of the screen when in expanded mode, we needed to add a bit of padding to the right side of the section edit link top level span. To prevent the extra links from flashing as you move your mouse down the page, we needed to wait 100ms before showing or hiding them due to mouse enter/leave. We use negative margins to move the brackets. Animation implemented using CSS transitions. We bring the pipe divider in from the core 'pipe-separator' message. To style the brackets independently we needed to wrap them in spans and add classes to them. Change Id27555c6 in core will make the wrapping unnecessary, but the two should still get along just fine. Interestingly, we needed to @noflip the bracket styles because CSS Janus flipping is triggered on UI language, but the brackets need to be styled according to the content language. Changes: ve.init.mw.ViewPageTarget.css * Add styles for extra section edit link components ve.init.mw.ViewPageTarget.js * Add edit source link, and make it visible when the mouse is over the heading or either section edit link is focused *.php * Links to new messages Bug: 48429 Change-Id: I4b9c47fd65a700a81c880144247fec524edff7e5 |
||
---|---|---|
.. | ||
ce | ||
dm | ||
init | ||
test | ||
ui | ||
ve.BranchNode.js | ||
ve.debug.js | ||
ve.Document.js | ||
ve.Element.js | ||
ve.EventEmitter.js | ||
ve.Factory.js | ||
ve.js | ||
ve.LeafNode.js | ||
ve.NamedClassFactory.js | ||
ve.Node.js | ||
ve.Range.js | ||
ve.Registry.js |