It used to be that when you closed a dialog, the thing that the dialog
inspected or inserted would be selected. For insertions, the selection
will now be collapsed immediately after the inserted node.
For modifications, the original behavior was kept, as it makes sense to
keep selecting the node that the user had to select in order to access
the dialog. For removals (only possible in the transclusion dialog),
the selection ends up as a collapsed selection at the location where
the removed node used to be; this was already behaving correctly,
as we get this behavior for free with offset translation.
Bug: 54957
Change-Id: Ibd14e8084d67a9ee85e3bac075c3fb50f27b05b2
And other focus behavior fixes.
ve.ce.Surface.prototype.focus:
* Restore focus to the pasteTarget if a focusedNode was selected.
This function is invoked when a dialog is closed, and we were
always focusing the documentNode, which means the selection was
restored incorrectly when the selection was really in the pasteTarget.
ve.ce.Surface.prototype.documentOnFocus:
* Don't rerender the model selection if the documentNode was focused but
a focusedNode is selected. Otherwise the user can never deselect a
focusedNode.
ve.ce.Surface.prototype.onModelSelect:
* Rerender the selection even if prev === next. This function was
already called as a means to rerender a lost selection, and it didn't
work if it so happened that the selection was still the same and was
on a focusedNode.
* Clear the surfaceObserver state when moving focus from the
documentNode to the pasteTarget. If we don't do this, then placing
the selection back in the documentNode at the exact same place where
it was before will not be noticed by the observer.
ve.ui.Context.prototype.onSurfaceFocus:
* Hide the context only when an inspector is open, not just when the
context popup is visible. This ensures that the context is still
hidden when the user clicks out of an inspector, but fixes a bug
where the context was hidden when the selection was restored on
an inspectable focusedNode.
Bug: 58090
Change-Id: I0658f025a9c6005d769fd0291380fcb9c1ba4f32
This is a full export of the recently converteted i18n of
VisualEditor. The conversion script should generate output in
this format, so that future diffs for localisation updates
remain as small as possible.
Change-Id: I03c3223f51027b97d7962553e80afd741991c9af
Stripping all HTML atributes (to avoid CE-added styles such as
'font-size: 1em;') also strips data-parsoid which can cause
round trip errors. As an improvement only strip the style
attribute.
Bug: 58136
Change-Id: I34386bd847d1cf0583317a8b07916e43ff7af029
For performance we might also want to provide a conversion script
that generates a static PHP file.
Change-Id: I6a72bb3ec23c90fc5740327a7e46b4d805562779
These were accidentally dropped when I rebased my commit
that imported all i18n messages into the JSON files.
Change-Id: I2f5611f3dbe1a31134426184a9d5648ffc751947
Split the i18n messages into four groups:
* oojs-ui (moved to the oojs-ui repo in a separate commit)
* VE core
* VE-MW (MediaWiki-specific things)
* VE-WMF (Wikimedia-specific things)
The VE-WMF group is new, and we'll split WMF-specific code out into
it later, for now it's just messages associated with that code.
Each language has its own JSON file at modules/MODULE/i18n/LANG.json
Kept messages in VisualEditor.i18n.php as the master copy, because
TranslateWiki can't deal with the JSON files just yet. Added a script
to rebuild the JSON files from the PHP file.
Change-Id: I94e084b2f10994f41324fd08a05ff7f8391ea2eb
These aren't optional in SVG files. Browsers will display them without,
but dropping them breaks MIME type detection, which breaks data URI
embedding: the underline-u icon was being embedded as data:text/plain,...
Bug: 58119
Change-Id: Ia790877fcd536f2714626ccf47beadd09cb4fac9
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
The Parsoid team says the cache is clean of old language /
category types, and would like us to use the new types
for newly generates languages/categories.
This reverts commit d8dcafe25b.
Change-Id: I0cffd5d299624230f3805f9468b2497f392c12c0
Also...
* Update OOjs UI to v0.1.0-pre (5ffe63d088)
* Make template parameter text boxes shorter (3em down from 10em)
* Reorder extendObject calls to not modify incoming config objects
* Allow level option to default to 0, rather than specifically defining it
* Use icon button widgets with remove icons for parameter, placeholder,
template and content removal buttons
Change-Id: I29db9d814fab5cf4debd0fc7bab6f51475cb0f94
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
Previously worked by checking for the UniversalLanguageSelector
extension, now actually checks for the modules themselves.
Change-Id: I99b1bfabb1953579d3aaa661ab0a4d824a7fe656
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