Follows-up I55ef2622c9eacc which activated code introduced in
mw.Target in commits before that one that caused a change in the
execution order.
Hiding of page content (regular wiki page content provided by
original view request) must happen before the surface document is
focussed.
We used to hide the content from mw.ViewPageTarget#setUpSurface,
which is called from #onReady, which focusses the document after
setUpSurface is done.
Most of this code was moved to mw.ViewPageTarget#onSurfaceReady
which is the listener for the surfaceReady event emitted from
If our surface document gets focus while the original wikipage
content container is still there, the view port is forced to
scroll down because our surface is the next element sibling after
the wikipage container in the DOM.
And browsers (apparently Chrome is not affected) naturally retain
scroll position even if the elements above the one you "scrolled to"
disappear.
We can't (and shouldn't) move the hidePageContent call because
that's the responsibility of the Target subclass, so instead
moved the document focus to below the hidePageContent which is
now also part of the responsibility of the Target subclass.
Also:
* Removed target.surfaceOptions reference because that property
does not exist. We never passed a second argument here, and
whatever this was intended for, doesn't exist.
Bug: 58089
Change-Id: I230fbd5401cbd6e3b9450c7f156650409be8ef16
Let's experiment with this via our local Gruntfile. If it works
fine we can install it in Jenkins (similar to node-csslint).
Verify through $ npm install && npm test;
Fixed all outstanding violations.
Also:
* Added syntaxhighight to ignore.
* Added imetests (which contain unformatted JSON) to ignore.
* In ve.dm.ModelRegistry#matchTypeRegExps, removed redundant
!! cast from the [+!!withFunc] statement which was hitting
a bug in node-jscs. All callers to this local private function
pass a literal boolean true/false so no need to cast it.
* Removed "/* key .. , value */" from ve.setProp, though this
wasn't caught by node-jscs, found it when searching for " , ".
* Made npm.devDependencies fixed instead of using tilde-ranges.
This too often leads to strange bugs or sudden changes. Fixed
them at the version they were currently ranging to.
Bug: 54218
Change-Id: Ib2630806f3946874c8b01e58cf171df83a28da29
1) Added another sleep statement which seems to fix the issue locally.
2) Modified a link page element identifier.
Change-Id: Ic0006f18752d3625bc244d924a7a8a9fac2d5221
A tool to add special characters and diacritics to text.
Also added a new button type ve.ui.GroupButtonWidget that includes a
group of PushButtonWidget objects and returna the individual button's
value upon click
Wikis can edit <visualeditor-specialcharinspector-characterlist-insert>,
a JSON string, to include their own desird special characters to insert
through the tool.
Bug: 50296
Change-Id: I26d1f437feef1c8b61ed3be5f74ef524b33baf49
The CategoryPopupWidget's popupClose() method was checking for the
category having changed by comparing its sort key value to the existing
one, but it failed to account that null !== ''.
Change-Id: Idb6a84dc32706d90dea70dceb0b9b3a26ed70110
Use OOJS-UI's newly-extended paged dialogs (in e08eb2a03b) to refactor
how the Transclusion and Meta dialogs work, splitting out the code for
each of the panels into its own file and simplifying extensibility.
The Meta dialog (ve.ui.MWMetaDialog) now has two self-managing panels:
* ve.ui.MWCategoriesPage for categories and the default sort key
* ve.ui.MWLanguagesPage for language links
The Transclusion dialog (ve.ui.MWTransclusionDialog) now has four:
* ve.ui.MWTemplatePage for a template's primary panel
* ve.ui.MWTemplateParameterPage for each parameter of a template
* ve.ui.MWTemplatePlaceholderPage for a placeholder to insert a template
* ve.ui.MWTransclusionContentPage for non-template transclusion
Additionally, the Transclusion dialog has been slightly cleaned up:
* Replace add/remove events with replace events in transclusion model
* Actually return and resolve a promise (as documented)
* Get rid of "origin" info in template models
* Add method for adding required parts
TODO:
* Decide how and when we will choose between advanced transclusion and
template dialogs
* Work out design issues with how template descriptions will be visible
and how adding parameters will work if only showing parameters in
outline
* Add preview to template dialog
* Consider ways to further improve pages for use in continuous mode
WARNING:
* Right now the template dialog gets overridden by the advanced
transclusion dialog because they have the same symbolic name and the
latter is registered later than the former. To test the template
dialog, just change the symbolic name of the advanced transclusion
dialog.
Change-Id: I51e74b322aec9a4c3918e6f792bdb3d318060979
Now getDataFromDom is no longer called externally, we can merge these two
methods to provide one API endpoint. Also now we have deleted getDataFromDom
we can remove the 'Recursion' disambiguator from the internal function.
Also now that the whitespace info doesn't need to be passed around, implement
it as a simple return value get function.
Change-Id: I9c667e9b90443d12660b731347d7535ccb1a17cd
It's not much of an optimisation to combine these loops but
separating them gives us greater flexibility.
Move the building of the node tree to happen lazily when
getDocumentNode is called.
In the rich paste path we can now create the DM without building
the node tree and remove the metadata.
Change-Id: I10b4bc486ff8ff8037158aa6dfd45aac87557d42
The delete logic sees the caption inside the image as a valid place to
put a cursor and therefore a valid range to delete up to. This means
paragraphs can be merged into image captions by backspacing them in.
Add in a flag that keeps track of whether we are in a handlesOwnChildren
node so we can skip over them.
Bug: 57927
Change-Id: I19e91d2d3a871806d207cbd419f4a45e41d69dc0
The new form was implemented in Parsoid and deployed in October, so enough time
has passed that there is no longer any need for VisualEditor to support the old
type.
Bug: 56009
Change-Id: Ief2e584345ccdb0e7eb44ab16c4bc14f7c14f5ec
Still broken, this time because PagedOutlineLayout / BookletLayout
usage wasn't updated.
This reverts commit c6cfe763bb.
Change-Id: If0d37d396ecf3bb09f026d4432c5d7e30f040085
Following on from getDomFromModel, this returns a document model
instead of element linear data. The only instance that hasn't been
replaced is in rich paste, where we need to sanitize the converted
data before constructing the document model.
This should be cleaned up in a later commit.
Change-Id: I37a2b641632af2cb515e3409deed5cd1fa358af5
Was already implemented in the parent class. Moved setPasteRules() so it
would still get run, everything else had already been moved.
Change-Id: I55ef2622c9eacc8b46bd3487919165bccfc347d5
Also, as OOjs UI's StackPanelLayout was renamed to StackLayout, and the
showItem() function to setItem(), fix uses in VisualEditor.
Change-Id: If153e5e7c3a7c60e3d62e20aac8fabd4eaaa73c2
Currently it takes 4 arguments which are all properties
of the document model, so just pass the model instead and
access the properties later. Rename to getDomFromModel.
Change-Id: I0c378a04dc08b9b90bdc3984f8fa8c4acfe0b667
Earlier check-in for a VE media interface test
inadvertently re-named a page element that
should not have changed.
Change-Id: Iac1ef365e9cb3912977c8a89f3158ad9d122c93d
Add rtl/ltr-related classes to the toolbar based on cursor context, so
certain icons can change based on inline and block directions.
Change-Id: I1b6e450226bf8da820fb622f28c1c3062c534bb0
Moving items around in the MetaList only works if all deletions are
done before all insertions. This was almost but not completely true:
when moving an existing item we would delete it and immediately re-
insert it, meaning that if there were multiple items being moved
there would be a removal after an insertion.
Instead, let the insertion loop re-insert the moved items while
making sure not to emit insert events for them. This is how I
originally intended the code to be structured, but I thought that
duplicating the insertion would be equivalent to protecting the
emission of the insertion event. Clearly I was wrong.
This fixes weird bugs where categories sometimes appeared twice
in the category dialog depending on where the category was in
the list and what the exact length of the list was (i.e., whether
the binary search in the MetaList found the first or second item
with identical offset and index).
Change-Id: I4cd131052dda396add7a0e2dbe2383bb5c1b5721
Sometimes a save is not a save, but a switch to the wikitext editor; in this
case, the save dialog doesn't exist, so don't assume that it does.
Bug: 57947
Change-Id: Ic2df7d2066ba03564ed531e1d31351cd27441abe
Also:
* Added modules/syntaxhighlight to csslintignore because
it is broken right now, so it's hard to fix those warnings
without being able to verify it.
* Fixed a typo in the grunt-watch config that accessed an
inexistent property.
Change-Id: Ib81572506786b6a1203c454d1b2b91bb6ae2a3de