* Add ve.init.mw.LinkCache to track page existence and
transparently query it
* Populate it with initial data from the parser cache
if available, obtained in the VE API module
* Use linkCache data in link annotation rendering
This doesn't yet integrate the LinkCache with other
components like the link inspector. That should be
done so we can deduplicate the existence checks.
Additionally, we should generalize LinkCache and use
it for the category existence/status checks as well.
Bug: 37901
Change-Id: I9fd43e8c3864dd375cf6dadfdeedd05e4fe9cf3b
This is the normalized title without the fragment, which is what
should be used for existence check purposes. Also add a test for
an internal link to a page's section.
Change-Id: I0e04f64c1bebeff84a0c17ef9b6c8dc06876f769
Also, we warn the user that Here Be Dragons™ when they're editing a Page
Translation /source/ page.
Bug: 50284
Change-Id: I841ccb8461d31358640a16301a6a78750a660d36
This patch increases the width of the defaultsort field, a problem
identified in bug 51012. It does this by adding a custom class in
/modules/ve-mw/ui/pages/ve.ui.MWCategoriesPage.js called
.ve-ui-mwCategoriesPage-defaultsort and then applying the style in
modules/ve-mw/ui/styles/ve.ui.Page.css.
The patch also increases the width of a field that was not addressed
in the bug report, the page redirect field in the page settings
page in the options dialog. This was done because, like the
defaultsort field, this field takes as input page titles, which
can sometimes be long. This was done by adding a style to
modules/ve-mw/ui/styles/ve.ui.MWWidget using the
.ve-ui-mwTitleInputWidget class, a class which had been added
to the input field but didn't have any styles associated with it
until this commit.
In both fields, the width has been set to 30em.
Bug: 51012
Change-Id: Ic24f0d20256a5d64075f9d2850215a03b8c8ae66
Update MWMediaDialog for .static.config -> .static.dialogData
rename in VE core.
New changes:
61e34f3 Only insert slugs where paragraphs are allowed
f65983d Don't try to return the document in getCoveredNodes
b9313ba Remove incorrect documentation for the .static containers
16874e2 ve.ui.Trigger: Clean up indentation and documentation
0eeba06 Cleanup docs and method of tools
Change-Id: I7bfb500ace1acc360cc24de2763e3f52fbb82a0e
Also update ContentBranchNode test for changes in VE core
New changes:
bdf9a9f Merge two Properties blocks in DesktopContext
d3c22bb Make ContentBranchNode echo suppression work in CBNs that contain inline nodes
aaad03a Localisation updates from https://translatewiki.net.
Change-Id: I3e1757b42307c3bd52ba0571068eb1c6bfb5ab89
TOC Widget is created in the mw target view class.
Adding and removing a heading rebuilds the TOC Widget based
on the the order of the page heading nodes.
TOC Widget considers TOC page settings and displays in the default manor
unless forced or disabled.
TOC Widget still needs to be finalized by being placed in the surface.
This could be a problem until we have a CE node for it to live in or
have some DM work added. Roan and I have discussed how to go forward.
To enable the widget you must add the following to LocalSettings.php:
$wgVisualEditorEnableTocWidget = true;
Change-Id: I488cfbbdb060e50d81f51e0f757e67d0114b8936
New changes:
dd15f23 Split ve.ui.Surface into DesktopSurface and MobileSurface
16283f4 Add OOjs UI's sco.json i18n file
ef94038 Split ve.ui.Context into DesktopContext and MobileContext
Minor adjustments to point to desktop and mobile Surface or Context.
Change-Id: I7cf6f99a5a1216a28a7146afcd4deb68c7eac38e
* Corrected the condition that set default size only if the image
wasn't smaller than the default.
* Added a couple of sanity check conditions for the OO.Compare
condition
Bug: 62586
Bug: 62581
Change-Id: I4db996cec33ac9d53ef485b53568100e3912c4ae
Add meta items for the four remaining mwPageProp behavioural flags from Parsoid
that are added by MediaWiki core. These are each waiting for UX implementation,
based on the lack of context information in MWMetaDialog about the page, or
about the wiki:
* __NOGALLERY__
* __HIDDENCAT__
— These only make sense in a Category: page.
* __NOTITLECONVERT__ // __NOTC__
* __NOCONTENTCONVERT__ // __NOCC__
— These only make sense on wikis that have content or title conversion.
Change-Id: I752705f65cfbd79c7f3f71270659793996868aff
Shown when there's no template data.
Someday in the future, we will support adding a description inline. Not
yet. Calm down.
Change-Id: I18c0a591b60de53bc124d82c688d71d30ad1d5dd
Also update VE-MW for the comment changes in VE core
New changes:
4ad6a3d Add text direction to SA demo
89503e8 ve.ce.Node: Emphasise slug transition with increasing outline offset
864046e Update oojs to v1.0.8
65d1338 Localisation updates from https://translatewiki.net.
b66d482 Stop special-casing comments and recognize them as tagName='#comment' instead
09dda12 ve.ce.getDomText: Document node types and use .data instead of .nodeValue
b0a3b2a Make ve.dm.Converter assertions actually display message
ef791cc Make 'comment' its own metaitem type
d5ef0d7 ve.dm.Converter: Refer to nodes instead of elements where appropiate
c22c8af Fix JS error when pressing Enter with selection across multiple paragraphs
a26a708 Add ve.dm.Transaction.newFromReplacement
a9e136e Don't cause needless surface refreshes on overwriting.
6fd35ee Split part of getOpeningHtmlTag out to getHtmlAttributes
2c31f67 ve.ce.Surface: Document version number in focus workaround for Opera
e069e74 Add some more characters to the special character inserter
Change-Id: I859805fb261468e8fae9454c4992115369066b49
* Add class to items container right at creation time.
* Do handling for individual items when we have a reference to the
item. No need to query for children() afterwards.
Change-Id: I7f5eda3d514da6d7a931bc31090a08b1937ed3e7
Follows-up I260059802379 which removed got rid of
the "ve-init-mw-viewPageTarget-toolbar-editNotices-notice" class
from notices and didn't add something generic in its place.
(There is "ve-ui-mwNoticesPopupTool-item" but that's more an
internal class we don't want gadgets and wiki stylesheets to
rely on.)
Bug: 43013
Change-Id: I8e1e383c2cb3199fe78f45f4feaa24a44126cf0b
* Use "Insert template" when adding a single template
* Use "Insert transclusion" when adding a multi-part template
* Use "Apply changes" when working with an existing tranclusion
* Use "Loading..." and disable while waiting for template data
* Disable when the transclusion has only a template placeholder
Bug: 50998
Change-Id: Ib2fb3d8711ed6d3ef41cc0db55740c95394dd3f9
Store a bit of data with the states we push or replace in the
history so that when the user navigates back to them, we know
for sure this is a state we pushed in the history.
This allows us to filter out popstate events triggered by the
user browsing to states create by other software, as well as
states triggered by the browser that have no state data at all
(Chrome is known to, in contrast with other browsers, trigger a
blank popstate event on load, which we were mistaking for a user
event where the user navigates back to veaction=edit).
Bug: 57901
Change-Id: I142777d0d2ae96d3afee224782f0d2d1522da1eb
The switch to source mode code path was causing onSerializeComplete to
be called, which accesses this.saveDialog because it assumes it's being
called from onSaveDialogReview.
In fact, onSaveDialogReview was calling it twice, once as the callback
it passes to serialize() and once in response to the serializeComplete
event. Cleaned this up by renaming the function and removing the
event binding, so it's now only called once and only for reviewing
changes to new pages, not in the switch to source mode code path.
Bug: 62544
Change-Id: I86eea57806a20408c8dc89a234c39cae1d969bca
When an image is smaller than the default size, the placeholder 'default'
value will be the image's actual size. This means that if a user selects
default thumb size for the image, it won't be changed unless the original
size is bigger than the default. Also adjusted so that default size limits
width only, and doesn't act as a bounding box on size change.
Bug: 62293
Change-Id: I8341776794843ff63a93bedeadf5921851c57a26
This can be overriden in subclasses (such as MobileViewTarget) so that
we can customize the way the surface is created.
Change-Id: Id17695c8c75c7ae6c549f915625667389aad5f2f
Make sure the magnify button in the caption is properly shown or
hidden when image type changes. The magnify icon will always be
built, but will be shown and hidden using CSS rules.
Bug: 62139
Change-Id: Ib9a4569239ed70d16a153fb0823e283203fba1d4
While the documentation is unclear, it seems that the 'thumbsize' in
$wgDefaultUserOptions is setting up width limit rather than a general
bounding box.
Things that are adapted in this fix:
* Only resize the image if the image is bigger than default and marked
as default size.
* Only limit width, even if the image is tall.
* Add rounding to calculated height value.
* Make sure new images follow these rules as well on insertion.
Bug: 62293
Bug: 62279
Change-Id: I37525bf3480bb1da8b0538f9b38576616aabbfa6
The experience should be consistent between mobile and desktop.
We should explore re-styling these buttons to look like
Ib3c94d19231b018a509b78269001223ad0568795 in desktop as well
at a later date.
Change-Id: Ic9e4c5d12c3c75fcb195432c9155ec0a7eecac04
Fix a bug in MediaEditDialog that resulted from sync issues when the
'select' event is fired for OO.ui.ButtonSelectWidget widgets.
Use the details of the selected item given from the event rather than
checking the state of the widget with getSelectedItem().
Change-Id: Ifbbf722ff374e10b680a6b55ab99f5fc86480c40
Split tracking out of the base target and from viewPageTarget
Primary reasons for this change:
* Makes it possible to resolve an issue with tracking in mobile
* Lets us reuse the viewPage save workflow tracking
* Support existing and new targets with tracking
* Simplification of target classes
Change-Id: I036e4f2129d929db0a3b9a4baa87c946a4b194a9
Not removing the existing message for "Transclusion" for now in case
that's needed later.
Bug: 55434
Change-Id: I0ee722e821051970b4a445b5a7a0e93f144f3185
* Automatically select single mode when possible
* Allow dynamic switching when possible
* Hide most of the controls and information when in single mode
* Allow parameter model to be instantiated without name and value args
* Place add param buttons at the bottom of template and param pages
which are only visible when in single mode and on the last page
Change-Id: Iaffbf1863b808c8089dfcf09a976d165f28c8b74
This doesn't really fix the underlying issue that the
width and height are overridden to be the default size
in the DM even if that's wrong (in the case the image's
original size is smaller than the default thumbnail size),
but it fixes the DOM corruption by storing the original
width&height and restoring them if the image still has
defaultSize=true on the way out.
Bug: 62172
Change-Id: Iaee798c5bb501310e52d0ac832b2e7cd833fc438
Also update for dialog size changes on oojs-ui, and make the
save dialog grow from 'medium' to 'large' when viewing a diff.
New changes:
ae195ac Update OOjs UI to v0.1.0-pre (e4f6ce0156)
ab70193 Pass surface set into ve.ui.Dialog and ve.ui.Inspector
Bug: 60494
Change-Id: Ib3065e228459aa00f18c309d234f3324fdb34059
The promote/demote rules in mw.Target had changed, but these changes
weren't copied to MWMediaEditDialog and MWReferenceDialog.
Also, we ideally shouldn't need to maintain these things
completely separately from each other.
Bug: 62286
Change-Id: I459c3310f2ac0d8860a686a05da4f45d9a888801
Fixing several inline comments from the previous commit, and
reorganizing the usability of size select clicks to prevent loop
click bug.
Change-Id: I259d86e9bbe90270d8883b7a3de96979b1d5a156
There are several conditions to defaultSize behavior of thumbnails and
frameless images and other images when it comes to default size. In the
same principle is 'border' which is not quite a type despite the fact
it 'behaves' as such in wikitext (and has a unique identifier that comes
instead of the other types.
This commit aims to organize this behavior for the user in an
understandable manner.
* Add 'basic' image type for images that have no specified type ('none')
* Handle the difference in 'default' size behavior between basic images
and thumbnails/frameless. The thumb/frameless images have the default
wiki size. Other images' default size is their original dimensions.
* Force wiki-configured default size for thumbnails and frameless images
in the DM. This is done because at the moment Parsoid's output is of
Wikipedia's default size rather than the local wiki's. The size is
adapted if needed, directly in the DM.
* Added 'border' as a pseudo-type checkbox flag that sets css class
'mw-image-border' is for parsoid rendering on save.
* Add 'make full size' to the size widget select and treat it as a faux
default button for basic and frame images.
Bug: 62013
Bug: 62024
Bug: 61155
Bug: 61059
Bug: 61282
Change-Id: I6778705306f0dd6bb96afeb91383089a4ddab7ed
Also add MW configuration for ModelRegistry back, was removed in core.
New changes:
564c459 Localisation updates from https://translatewiki.net.
f30e061 Consistency in test header comments
74be717 Remove MW-specific config and genericise tests in ModelRegistry
Bug: 53148
Change-Id: I67e77bd41bbff52f88632ff9e4cf5e4c48251174
Also, use new getClosestPage method in ooui to select which page should
be selected next when a page is removed.
Change-Id: I7ce4d2ca55aac72f3aaa14c98c7189a440598e08
The error occurs when moving an item down (increasing index) which
removes the item, adjusts the index and then inserts the item. The index
shouldn't be adjusted when moving one down, however, because once
removed everything shifts and the +1 index set initially to move it is
still good.
Change-Id: I44bd2b3eb4bbbef58a6ac181e75969ec7c2cab6f
* Show label, input and remove control on a single line
* Right align label to conserve vertical space without sacrificing
fill-out speed
* Show description in gray text below the input
* Show remove button only when page is active
* Make description lighter when page is innactive
Change-Id: Iaa09f3bf909ccd415de7af8f428495fef3046893
Also update template/transclusion code for OOJS UI
OutlineControlWidget changes, and uses some of the new
functionality.
New changes:
ac4b49a Update OOjs UI to v0.1.0-pre (51f922ba17)
Change-Id: Id7a1f60cd6ce3bdaba7ccb8774563b9e81c75cad
Because everything was broken.
Follows-up I6374854eaa1 which split up mwcore into smaller parts but
left MWDialogTool still as one file part of mwcore. Since the various
ve.dm classes are now part of the other modules that depend on mwcore,
the MWDialogTool classes were pointing at classes that don't exist yet
(e.g. ".modelClasses = [ ve.dm.MWBlockImageNode ];").
Change-Id: Ic05b173d730a8a0f6539fdcd818aaf674d2a4019
This gives users a clue to understand why they won't display in the
category box at the foot of the page.
Bug: 50763
Change-Id: I1cf3a76bbf6370e7f67ec16f0a931f6ea4ba9d28
We can't change tooltips once they're set for buttons like this (they're
static), so for values that can change we need to use language that does
not need plurals.
Bug: 61891
Change-Id: I78e5576e348ee92bc39315fd494b3398ae2c14bf
Core retains core functionality, including text styling and architectural
items like dialogs.
The new modules are:
* mwformatting
* mwimage
* mwlink
* mwmeta
* mwreference
* mwtransclusion
The new modules are loaded in ViewPageTarget (for desktop), except for
mwlinks which is included from MWTarget (for desktop and mobile), per the
needs of the Mobile team.
Also, mwgallery was moved to desktop-only loading status.
Some styles which were loaded in mwcore but only used in modules is now
loaded in said modules.
This does not split up ext.visualEditor.core yet, which is left as an
exercise for the fool-hardy.
Bug: 61075
Change-Id: I6374854eaa13af824c11078d2f7004dc8a211a30
Handling a bug where the placeholders weren't set to images that weren't
set to default size. The switch to 'default' failed because there were
no placeholders and data for default to go on. This is now fixed in this
commit; if the image is non-default, the values are given to the media
size widget from the config settings.
Change-Id: I402b8d4de606c0939daa316408fcf5de2f0b2181
Add a dynamic limit to image dimensions; image is limited to its max
size if it is 'thumb' and unlimited in size otherwise.
This change depends on ve-core Scalable/MediaSizeWidget adjustment
https://gerrit.wikimedia.org/r/115306 (merged)
Bug: 61282
Change-Id: I1247b1360ae50af039673fa3f2b3521e457ef578