Commit graph

4586 commits

Author SHA1 Message Date
MatmaRex 7a2811b6de Remove the preference to use the wikitext editor for editing sections
No longer useful now that I4b9c47fd exposes both ways of section
editing.

Change-Id: I93958413b4b6ad870306d9f06f540cdde47f7499
2013-06-26 19:25:29 +00:00
Trevor Parscal c1ea21739f Show "edit source" section edit links in addition to VE ones
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
2013-06-26 12:13:44 -07:00
Translation updater bot 8a28dbf48b Merge "Localisation updates from http://translatewiki.net." 2013-06-25 19:59:52 +00:00
Translation updater bot 7e7410ec79 Localisation updates from http://translatewiki.net.
Change-Id: Ief601e0ee402b3cedbb654f06434217f24e6c1a5
2013-06-25 19:58:57 +00:00
Ed Sanders 29d61dbea4 Only use HTML attributes when comparing annotations for serialisation
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
2013-06-25 17:57:08 +01:00
Inez Korczyński d31918d145 Proper handling for block level frameless images
Change-Id: Idd438dd256e1877ee7c18b8286a2c32fe2326f23
2013-06-24 17:47:03 -07:00
Inez Korczyński 58d752331e Do not add empty <figcaption> to <figure> tag
Change-Id: I7527f88e05318bfa6f0dbd5663294e7f0dd31a3e
2013-06-24 17:22:03 -07:00
jenkins-bot 12bd0ab325 Merge "Don't set rel="mw:thumb" on the <a> inside a block image" 2013-06-25 00:05:25 +00:00
jenkins-bot 3e6db2cb19 Merge "Use this.$$ for $relocatableMarker" 2013-06-25 00:03:42 +00:00
Roan Kattouw c48af4de1f Don't set rel="mw:thumb" on the <a> inside a block image
Causes DOM diffs

Change-Id: I54bd90cfcbdff4baa06f67cbeb2865dca357be19
2013-06-24 17:02:54 -07:00
jenkins-bot 1a8bb8c6ab Merge "(bug 50113) Do not display captions for block images which are neither frame nor thumb" 2013-06-24 23:57:28 +00:00
jenkins-bot eea2f640d7 Merge "Preserve the class attribute for block images" 2013-06-24 23:51:51 +00:00
jenkins-bot 904cdbbb79 Merge "Preserve the <a> inside of a reference <span>" 2013-06-24 23:46:17 +00:00
Roan Kattouw eafbac3412 Preserve the <a> inside of a reference <span>
This was a big gaping DOM diff that's been in there since the beginning,
but which we only found today.

Change-Id: Ie4e791b212ddd3210bc1d5c11308452bb57ae3ce
2013-06-24 16:20:45 -07:00
Inez Korczyński 4ddf123b7c (bug 50113) Do not display captions for block images which are neither frame nor thumb
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
2013-06-24 15:40:30 -07:00
jenkins-bot 0c13ca6780 Merge "Don't put slugs after internal nodes." 2013-06-24 22:22:17 +00:00
Rob Moen 8f005fa1ae Don't put slugs after internal nodes.
Bug: 50132
Change-Id: I3818ebe9816e7d781233f087b15694bf7ba12965
2013-06-24 15:20:08 -07:00
jenkins-bot 809579a4e4 Merge "Clean up static stuff in dm.GeneratedContentNode" 2013-06-24 21:52:08 +00:00
Roan Kattouw e9395273de Clean up static stuff in dm.GeneratedContentNode
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
2013-06-24 21:50:38 +00:00
jenkins-bot 0c094837fb Merge "Place cursor at start of paragraph, not heading, when section-editing" 2013-06-24 21:30:18 +00:00
jenkins-bot 488664e3d2 Merge "Scroll to correct offset after using a section edit link" 2013-06-24 21:29:31 +00:00
Ed Sanders 138b9365c2 Place cursor at start of paragraph, not heading, when section-editing
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
2013-06-24 22:27:01 +01:00
Ed Sanders 983847bfbc Setup section edit links again after page save
Bug: 49620
Change-Id: Idf938c0dc8535c30ce63a05d56abeee210a67380
2013-06-24 22:22:54 +01:00
Translation updater bot 9fcd7fc6fe Localisation updates from http://translatewiki.net.
Change-Id: I09ab01a8a27702ad56f7e26938f4dd8fa7519bd5
2013-06-24 19:57:27 +00:00
Roan Kattouw 5212505648 Preserve the class attribute for block images
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
2013-06-24 12:34:15 -07:00
Ed Sanders 1889495aa2 Scroll to correct offset after using a section edit link
Needs to wait 200ms so it account for toolbar height.

Bug: 49563
Change-Id: I3a57e64f54289a3263814b4fbfe00c63de4a490b
2013-06-24 19:52:24 +01:00
Roan Kattouw 89c45edda1 Use this.$$ for $relocatableMarker
Change-Id: I39d4b8bc4f7c88068ad7e290130389f6c532743d
2013-06-24 11:01:14 -07:00
Ed Sanders 2352613b66 Code style fix: (X) -> ( X )
Change-Id: I7f3ac95621f70d9a89e70e9a51905673240cb51f
2013-06-24 18:51:59 +01:00
jenkins-bot 4c792ba385 Merge "Implement triple click functionality" 2013-06-24 16:04:59 +00:00
jenkins-bot 281f91d581 Merge "Store original DOM elements of transclusions" 2013-06-24 16:02:32 +00:00
Ed Sanders 7cc8e495aa Store original DOM elements of transclusions
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
2013-06-24 15:50:52 +00:00
jenkins-bot 1176f69887 Merge "ve.dm.Transaction: Implement newFromDocumentInsertion" 2013-06-24 14:22:08 +00:00
Ed Sanders 89e1bd1a51 Implement triple click functionality
On detecting a triple click the nearest non-content node
is selected.

Bug: 38011
Change-Id: Ic80d24581535766714d80104222924f7a0d20f1a
2013-06-24 12:10:13 +01:00
jenkins-bot 37f11e03e2 Merge "Clean up inconsistent variables in ReferenceNode/TransclusionNode" 2013-06-24 02:40:52 +00:00
Timo Tijhof c4f1b5eaf4 Clean up inconsistent variables in ReferenceNode/TransclusionNode
Made them match the local variable names in MWRefereneListNode.

Change-Id: Id314779323c3a7347cfcd6f40b0e2b63e4d9b0c5
2013-06-23 19:17:29 -07:00
Roan Kattouw 0bf155bb36 Fix empty inspector popout bug in Firefox
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
2013-06-23 19:12:13 -07:00
jenkins-bot cf062adbfc Merge "Pass full data (including meta) to converter in references" 2013-06-24 02:07:01 +00:00
jenkins-bot e8dabd8f37 Merge "Preserve data-mw verbatim if unchanged" 2013-06-24 02:05:44 +00:00
Ed Sanders b963747a45 Pass full data (including meta) to converter in references
Previously we were just passing a slice of the visible data, instead
of using getFullData.

Bug: 50059
Change-Id: I3bbea49132ef4a720a147ba9b170c39a0c00f711
2013-06-24 02:04:57 +00:00
Roan Kattouw 5a70aa5685 Preserve data-mw verbatim if unchanged
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
2013-06-23 19:02:54 -07:00
jenkins-bot 2502f2e3ac Merge "mw.ViewPageTarget: Blacklist IE9/IE10 until blocking issues are resolved" 2013-06-24 01:31:43 +00:00
jenkins-bot a8590c8ba2 Merge "Allow metadata to be annotated" 2013-06-24 01:13:27 +00:00
jenkins-bot 0a0265cb77 Merge "ve.dm.MWTemplateSpecModel: Expand parameter aliases" 2013-06-24 01:02:56 +00:00
Timo Tijhof 947da63502 mw.ViewPageTarget: Clear slide history when closing the save dialog
Bug: 49481
Change-Id: I297a7d1458e5a1c33b9dcb85272fe5f40893dd88
2013-06-23 17:35:04 -07:00
Timo Tijhof 49179c7c31 ve.dm.MWTemplateSpecModel: Expand parameter aliases
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
2013-06-23 17:25:52 -07:00
Timo Tijhof ef6fae606f mw.ViewPageTarget: Blacklist IE9/IE10 until blocking issues are resolved
Bug: 49187
Change-Id: I2ee2e33c89cac58863c9911fc3ad250c72a46206
2013-06-23 17:04:44 -07:00
jenkins-bot b48ff35827 Merge "Remove unused mw.notify msg keys from ext.visualEditor.core module" 2013-06-23 22:12:44 +00:00
Translation updater bot 8de1234759 Localisation updates from http://translatewiki.net.
Change-Id: Id326581d28c047d89b520c166774eeb001a76911
2013-06-23 20:27:08 +00:00
Ed Sanders 4bcc07b120 Allow metadata to be annotated
To prevent dirty diffs when inline metadata appears inside annotations.

Bug: 50060
Change-Id: I40da3d5e8e987571195142304b1a853e177e36ff
2013-06-23 18:48:32 +01:00
Timo Tijhof a16b55fc3b Remove unused mw.notify msg keys from ext.visualEditor.core module
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
2013-06-23 02:37:32 -07:00