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
The UI still needs a simplified version of annotation comparison
so it can clear/set annotations, whereas for serailisation we need
to compare selected HTML attributes (and once Parsoid is fixed,
compare all attributes).
Change-Id: I1a5521a3f51ea373a21cfbc9a007a2381c12f4fe
This was a big gaping DOM diff that's been in there since the beginning,
but which we only found today.
Change-Id: Ie4e791b212ddd3210bc1d5c11308452bb57ae3ce
There is still a problem that those images would get inspector for opening media edit dialog
displayed, and that dialog let's edit caption, which does not make sense in this case, however
that should be a separated bug.
Change-Id: I24491979bc7a27d2380924e48cb677b01e9f8f9b
Remove enableAboutGrouping from GCNode and move it to the subclasses
so we can have GCNodes without grouping.
Having matchTagNames there doesn't make sense now that GCNode is a
mixin rather than a base class.
Also removed unused .static.generatedContent property.
Change-Id: I2b5350e70b7829cf009c752d066919e5a3593db0
Also checks for subheadings, i.e. we keep moving forward one sibling
as long as the next sibling is a heading of higher order than the
previous one. If the heading is of the same or lower order then we
assume there is an empty section, so we just stop.
Bug: 49563
Change-Id: I6fcc463aeeae40278f5caf04ae251c8ecfe65472
Build the new set of classes as an array (avoiding the leading space),
and only set it if it differs from what was there before. This avoids
reordering the class attribute.
Change-Id: I863ec8de2e7637f76690c4e0b7db5e153fb7e408
Prevents changing of DOM attributes on unmodified transclusions
as they can clash in the store.
Also use 'original' over 'orig' consistently.
Bug: 50079
Change-Id: Ib13bb206c49b1f5b186e40632a5c109def0f042e
Due to some sort of mysterious race condition (probably deferred reflow)
calling this.$menu.show() set style="" rather than style="display:block;"
because Firefox believed the parent was still hidden.
Work around this by removing display:none; from the context's CSS rules.
We don't need it because we always manually .hide() these things anyway.
Bug: 50073
Change-Id: I29e210aba9a6265d8364ff8ae49408cb4c2428b9
Previously we were just passing a slice of the visible data, instead
of using getFullData.
Bug: 50059
Change-Id: I3bbea49132ef4a720a147ba9b170c39a0c00f711
Previously we would reserialize the JSON blob in data-mw even if we
didn't change it, which potentially reordered keys and caused a DOM
diff.
Bug: 50066
Change-Id: If0a5bcc67d3a172de0e8839cfda11efacfbf36ff
We were previously ignoring this data leading to situations
where a template that can be invoked like {{foo|1=bar}} and
{{foo|thing=bar}} (where the template data documents param
thing with alias '1') will show up in the editor with no
parameter information or label for the 1= call, but will show
up for the thing= call.
Now they are properly aliases so both will appear the same
in the editor dialog.
Bug: 49838
Change-Id: I37ec0e152df905844ac58ed1834fca29dccb4eec
These 3 mw-notify message keys:
* visualeditor-notification-saved
* visualeditor-notification-created
* visualeditor-notification-restored
Are only used by ve.init.mw.ViewPageTarget.js, which is part
of ext.visualEditor.viewPageTarget, not ext.visualEditor.core.
Change-Id: Ib094c0a2934856b90349a9f8890a20feebf0837c