VE recreates the tab from scratch and deletes the old one
so as not to copy over access key settings. This fix
copies over classes from the old tab.
Bug: 47452
Change-Id: Ic2d42bb3034be25f388b587a00c3f523cfcc163c
Currently this code is unreachable as line 27 of the hooks file
checks the user's options for 'visualeditor-enable' before allowing
VE to load. For testing just comment out that line.
Bug: 47842
Change-Id: Ib5c3284c646ebcc0a8cad0b02de559d7820e05a0
The EventEmitter API we inherited from Node.js and then bastardized was
getting awkward and cumbersome. The number of uses of ve.bind was getting
out of control, and removing events meant caching the bound method in a
property. Many of the "features" of EventEmitter wasn't even being used,
some causing overhead, others just causing bloat. This change cleans up
how EventEmitter is used throughout the codebase.
The new event emitter API includes:
* emit - identical to the previous API, no longer throws an error if you
emit error without a handler
* once - identical to the previous API, still introduces a wrapper* on -
compatible with the previous API but has some new features
* off - identical to removeListener in the previous API
* connect - very similar to addListenerMethods but doesn't wrap callbacks
in closures anymore
* disconnect - new, basically the opposite of addListenerMethods
Another change that is made in this commit is mixing in rather than
inheriting from EventEmitter.
Finally, there are changes throughout the codebase anywhere
connect/disconnect could be used.
Change-Id: Ic3085d39172a8a719ce7f036690f673e59848d3a
The purpose is to flip the direction of the input inside
the link widget for RTL wikis, but flip it again to LTR
if the user inserts an external URL. This is my first VE
fix, I tried to follow conventions and avoid touching the
parent objects that are unrelated to URLs.
Bug: 47717
Change-Id: Ic13b9c3b155ce2979298cac9518c7419b9d45bac
.getClientRects() somestimes returns an empty collection which causes an
exception to be thrown by rangy. This corresponds to
.getBoundingDocumentRect() returning a hash full of zeroes.
Detect this and handle such ranges separately, by inserting dummy DOM
elements at the selection's beginning and end, then using their
position to determine where the actual selection was.
This behavior is seen sometimes in Opera, and in Chrome by using the link tool on text at the beginning of the document.
Bug: 47772
Change-Id: I4bad882d1d6fb83bcdcfd0de3bfc9af52960c2ff
Specifically by looking for "data-ve-changed",
"ChangeMarker*" and internal.changed.
Various tests, test counters and unused variables also
affected.
Bug: 45061
Change-Id: Ibd1ee68e0d650979d40574eff9cebded1a28499f
This changeset addresses a problem of pressing backspace in empty list item in order to merge it with list item above it.
Change-Id: I598da6ef24de97b0a7a7bbab6c9ee775aaab460b
Aliens now listen for surface model change events in order to
adjust the position of the phantoms.
Change-Id: I1e8bfba331a10678e9ca7e64b7818197237eb0a2
Modifications:
VisualEditor.php
* Added links to new widgets
VisualEditor.i18n.php
* Added placeholder text for category input
ve.ui.Widget.css
* Added styles for new widgets
New:
ve.ui.MWMetaDialog.js
* Create category widget with categories from dm.
* Listen to metaList for insert and remove events
** insert / remove bound methods to be improved upon additional meta groups
* Add listeners to mwCategoryWidget for new categories and updates
ve.ui.MWCategoryWidget.js
* Top-level category editing widget
ve.ui.MWCategoryItemWidget.js
* Items within a category widget
ve.ui.MWCategoryInputWidget.js
* Input for new categories, handles menu and API requests
ve.ui.MWCategoryPopupWidget.js
* Mini-inspector for a category item
Bug: 39597
Change-Id: I5eafaa484a1924a566d3a1ee1d869293089d0ecf
By making the API for adding/removing/clearing always plural, it greatly
simplifies the interfaces and reduces function call overhead in most
situations.
Change-Id: Ia8f23a373a01a8f6d5081587a591563e4f25ea42
ve.dm.Surface.js
* Allow manual truncation of the undo stack to prevent redoing something
that's been undone
Change-Id: I17534d6724fc2b325152cb2f665c6816f44232c1
Refactoring of externally sourced suggestions for text inputs.
*.php
* Added links to new file
ve.ui.InputLabelWidget.js
* Changed to focus input element, not wrapper div
ve.ui.InputWidget.js
* Fixed incorrect documentation
ve.ui.LookupInputWidget.js
* New mixing that abstracts placing a menu of options below a text input
and filling it with data from an external source
ve.ui.MenuWidget.js
* Fixed to get reference to input element, no wrapper div
ve.ui.MWLinkTargetInputWidget.js
* Moved pending and lookup functionality to mixing
* Implemented menu population using only matching pages, rather than a
combination of that and page existence checks (fewer API calls)
ve.ui.TextInputMenuWidget.js
* Added configurable container to render underneath, rather than assuming
this.input.$
* Added auto-position-on-window-resize functionality
* Fixed frame position correction to ensure that it only is used when the
overlay is in a different frame from the container to position
underneath
ve.ui.TextInputWidget.js
* Added placeholder text feature
Change-Id: If5ed1b64fd15982807691ce8bb0362970633108a
Remove all manual changes to SF ranges as these are not
undoable. Instead change translate range to default to
outer expand and build functionality around that behaviour
never changing.
As translate range is always outer I don't think we need to
check for start and end crossing over?
Added more undo tests to assert these selections are maintained
properly, and added the test case to 'update' for when and undo
point is overwritten.
Insert content now results in a selection over the inserted
content. Most usages were expecting this anyway and were
followed up with an adjustRange(-length,0) which is no longer
necessary.
Noticed that the link inspector case was never being triggered
as word boundary was always expanding to at least one char (mainly
for Hanzi selection). This doesn't make much sense as single
spaces get auto selected so removed this functionality.
Split collapseRange out into collapseRangeToStart and
collapseRangeToEnd as this may be required to get the old
behaviour (range moves to end after insert).
Change-Id: I3dc0b4d00d37bad1ca3076a69b41c5f0b3fa0570
Takes a path as input, reads it in and replaces the
"Generated by" sections and writes it back to disk.
:
Change-Id: Idd68032ba5b621958a353582ea994acd0c4cfbd3
instanceof Node doesn't work with nodes generated by the iframe hack
for some reason. Instead, use duck typing by checking for a .cloneNode
method.
>>> ve.createDocumentFromHTML('<body><tt>Foo</tt></body>').body.childNodes[0]
<tt>Foo</tt>
>>> ve.createDocumentFromHTML('<body><tt>Foo</tt></body>').body.childNodes[0] instanceof Node
false
Change-Id: I1ea1253bd204d1070cd01b666b8a90f1cb7e5e14
CSSJanus flips left for right for RTL languages. To ensure proper positioning of phantoms, the phantom container must actually be set to left:0, not right:0. Added the @noflip option before the phantoms selector to prevent CSSJanus from modifying it.
Change-Id: Id7662362d117d6c5719b9b98d7a0dbf62e9ba3ff