Flip the order of the buttons in the alignment widget
so that they display the directions correctly in both
ltr and rtl.
Bug: 69165
Change-Id: I7bd1d6c89aaef09492ae07eadababd68305b245e
Currently it's only being done when applying, caused by Ia74732e6. We
need the teardown event to reach the page so they can do things like
clear categories.
Bug: 68484
Change-Id: I6c31229121c1477a55ce955354770ed7cdde470d
Using the same tricks as ve.ce.MWReferenceListNode... Like listening to list
node updates, which will probably catch unrelated changes? I'm not sure about
this.
Bug: 68890
Change-Id: Id9443c9574063933bc8fb35d09ab8b80b69bcd44
Previously one could select over a link node and linkify the
selection, with tremendously funny results.
Change-Id: Ic5a2132b2d18280099a6024bc4ec2b1333eca98f
This color is chosen because it is already present as a warning color in
other mediawiki elements like remove button in Link Inspector. A font
weight of bold is also given to make it more prominent.
Things done for this commit:
* A new CSS file 've.ui.MWLinkTargetInputWidget.css' is added.
* Warning text style is added to the class
'.ve-ui-mwLinkTargetInputWidget-warning' in this file.
* The CSS file is included in the style resources in the
file 'VisualEditor.php'.
Tested in latest stable firefox, chrome in Ubuntu 14.04.
Bug: 62761
Change-Id: I89e96e0444f8505123f3c653cf2dd6b74fc83623
Use $.when() to check if there were results to the search. This
also makes sure that the 'results not found' message only appears
when it actually should.
Bug: 65321
Bug: 67438
Change-Id: I437ef639918ace1041bb8c9f7fdd04a4e83885eb
Also cleanup redundant overrides, documentation and
unused messages.
Depends on If22a5197 in core.
Change-Id: I533235f4eb5d703783a8fb45dff5e7be465f4ebb
New changes:
76bbf3b [BREAKING CHANGE] Fix camel-casing of countNonInternalElements
Local changes:
Use renamed countNonInternalElements function
Change-Id: Ib5f86ea5cfeb5e577f61349ed4bbb231ea155638
In the media search widget use 'json' for remote searches and
'jsonp' for local searches.
Bug: 64822
Bug: 67749
Change-Id: Iccc9adb1261602f4bc7426f1caf5aed87aad51e5
New changes:
20c220a Remove unused CSS classes
9bdcc65 Comment icon positioning
e50e790 [BREAKING CHANGE] Fix ve.ui.Overlay classes
1ac4927 ve.ce.TextNode: Use getChar() helper
29fd0f8 ve.ce.TextNode: Simplify #getAnnotatedHtml logic
18336eb ve.ce.ResizableNode: Run find() once instead of 4x in showHandles()
febf125 Use getDescription for title attribute
ab3cb6c Localisation updates from https://translatewiki.net.
Local changes:
* Rename overlay class rules
Change-Id: Ia90b6afbd4abdf3267f4ccaac0b2a7d4101ccc7b
Otherwise either the focusing of the surface or the resetting
of the selection seems to cause the viewport to scroll back
up on mobile.
Change-Id: Ie3b104e04800d2753f99739f877c76e334965fc1
Whenever the edit mode is active, focus the caption surface. This
is also true for cases where the dialog starts in the 'insert' mode
and then switches to 'edit'.
Bug: 68806
Change-Id: I60b862dc5738a65a6bb31eb32184c35cc108b232
By searching for CSS classes that don't exist in the code.
In some cases the classes were used but had been renamed.
Change-Id: I76442a632c18d2133cdf78c4555da149c0a7888c
The bottom margin makes refs with name noticeably taller than
others, however a small margin is required to stop the second
line of text wrapping too tightly.
Change-Id: Iae7e1e6ee29d9090e54aa05feda1854828a03d9d
Instead of using ve-ce-noHighlight we can just set and maintain
this.$focusable using getFocusableNode.
Change-Id: I0a6b2d6444df531b7c235ac9ff08a3ed8a0e99b3
We normalize underscores to spaces in sortkeys in toDataElement,
but when toDomElements recomputes the normalization to decide
if the sortkey really changed, it doesn't normalize underscores.
This is broken, both code paths need to use the same normalization;
we do this correctly for the category name.
This bug appears to date back to the introduction of category
support in March 2013 :(
Spotted in https://it.wikipedia.org/?diff=67220927
Change-Id: Ie3257fa335f3bd24a36c8654f3f5a24e89d7a9b9
Trevor promised to do this in Iafe64a6f but never did.
This needs styling changes to look right. It also means that
VE mobile standalone doesn't have a context at all right now,
which is horrible, but at least this makes MW mostly work.
Bug: 68546
Change-Id: Id8cc4b07905f777f667f36cbcc65e821847142d5
The window refactor removed the 'teardown' event from windows,
but ViewPageTarget was still listening to this event on the save dialog.
Instead, use the opening promise to be notified when the save dialog
closes and call onSaveDialogClose() at that time.
Change-Id: I31a9a359eb14a56b214a1240db08632bda6bc8b9
Because this breaks other subtitles such as subpage breadcrumbs
Instead, deal with the #redirectsub (added in I780c965) directly.
Bug: 68432
Change-Id: I646868916a4480404f6d466fd89f84798d0e9df5
Per the comment above, dm doc direction will be a better
estimate of wiki direction than CSS, which is very slow.
Change-Id: I231738d660b429df1598eaaadf7397b47d35ea0c
When I05f11246ca90a1ce3f741fd93194a827528cd597 gets merged, we will need
this to be able to scroll to a section on iOS (where the content will be
scrolled within a div, not as a whole page).
Change-Id: I6e47edfa8c3a3a46fd7a4f11e4a54955f3694b9b
The image model should go by image attributes (whether it comes from
an existing node or a new one) and not a node.
Bug: 68242
Bug: 68000
Change-Id: I4cabd678157619331b3c47d3b44bc16a28fd7bd7
Update tests and VisualEditor.php for comment node.
New changes:
5885b6a Update OOjs to v1.0.11
ab2d4cb [BREAKING CHANGE] Show comments inline to the user
Change-Id: Ie2787c3e29951cb7940f65bf104e7c9cccdbebd1
It can be very slow on pages with lots of references and
isn't required until you click 'Use existing reference'.
What is required is knowing if the list will be empty for
greying out the button, but that can be precomputed very cheaply.
Change-Id: I56909801a5685bb04e0c83cfb95463f705b8dfae
* Each item builds an MWReferenceModel which creates a document
slice clone. This is very expensive and we only use the model
for getting basic attributes, so defer the evaluation of the
document.
* $.show is expensive and, in this case, unnecessary.
Change-Id: I99abc4c1b17f05559a9cae68b15121a8be6d23fb
It's unnecessary, big and ugly, way too close to an actually useful button, and
adds oodles of complexity to the mire that is VPT without significant user benefit
whilst taking up an unjustifiably huge amount of the already-over-burdened space.
This means that the minimum browser width for English on default Vector to show
the toolbar correctly is now 945px, down from 1029px.
Bonuses: fix MWCancelConfirmDialog's cancel button to be destructive (it is) and
remove a now-recently-fixed comment asking for the save button to be styled using
a generic class (provided by the constructive flag).
Change-Id: I30dc7020121f0dd6907b61ef674a7cb14eb00652
Closing a dialog with specific data means closing it again with
potentially different data, while the dialog is already closing, means
someone wins and someone looses. Silently failing in this case is bad,
because if the first close call was a cancel, producing no side effects,
but the second close call would have produced some side effect, the side
effect would never occur.
The problem here really was that the save dialog needs to be closed
before we can destroy the surface so we can uphold the assumption that
hold and teardown processes are operating on an attached DOM.
The solution is to automatically close the save dialog on teardown,
rather than on save. Since save triggers teardown, this has and identical
user experience.
Bug: 68048
Change-Id: I669448739f168737d4eddd6496189a819ce894b1
New changes:
8bb3848 Bring back global/local specific CSS classes
Local changes:
Use global overlay class to target the z-index hack for the Vector skin.
Bug: 68066
Change-Id: If1b6ba0c9035ff32b61d34ee779a95554883a2ec
Attach event listener to the alternate text and the media size widget
in the MediaDialog, so that when either of those are changed the
'Apply Changes' button is enabled.
Related to I88c3f3dcc7667b3ffdd2a8a8433cb47b82ba1531
Bug: 67684
Change-Id: I03efbed2f9b2909b055d96b9ae1e27b6d5e2bdbf
New changes:
65042de Fix alien test data
83dccbe Add toolbar menu labels to each group for consistency
2e40ef9 Move 'language' tool from the insert to the styling menu, like in VE-MW
6fb21b2 Add toolbar action section to SA demo with keyboard shortcuts tool
f3eb000 ve.ui.Toolbar: Optimise onSurfaceViewKeyUp performance
eb4e9eb Make sure the document is focused when setting a selection
48584d3 Fixes to getRelativeOffset and getRelativeRange
fcc427f [BREAKING CHANGE] Remove generatedContents argument from afterRender
825e4be Documentation fixes in test utils
dbbbe0b Unit tests for showSelection
1ba9234 Don't handle up/down on focusableNodes even if backwards
a667b87 Remove label from 'insert' menu, and instead use a large plus icon
88885b1 Localisation updates from https://translatewiki.net.
1f3b79f Initialize data first
18369b1 Add 'clone' and make 'getDimensionsFromValue' static in ve.dm.Scalable
92e6b7b Switch to 'custom' when MediaSizeWidget updates
d0cd87e Localisation updates from https://translatewiki.net.
1ee21ff Remove lies from documentation
164f07f Safely ignore requests to open unrecognized windows
Local changes:
Work on a cloned scalable when editing images
Make sure the image model handles a cloned copy of the node's
scalable object, which is then shared with the media size widget.
Bug: 67687
Change-Id: Ie3676b715f5bae3d83da03d667cef3a6a847e212
Otherwise you get "Uncaught TypeError: Cannot read property 'messages' of null"
if you press the save button late enough in the saving process. The bug refers
to a different error which I have not been able to reproduce.
Bug: 68073
Change-Id: Ia8fa325f1450329b6e0e4ee9af5302aa4857d637
Confirm dialog was replaced in refactor, so until this is merged the 'Cancel'
button is broken.
Bug: 68068
Change-Id: I77d1c82bf0d68013eef361174a134860a197cd44
This was implemented, but didn't work because the node was removed
before its annotations were copied.
Also fixed:
* Don't do an unnecessary transaction to change attributes of a node
we're going to remove anyway.
* Apply the same link href fixups when converting as when not
(previously, changing the href to 'example.com' and clicking "Add
label" would break the link in interesting ways).
* Do a single transaction from replacement instead of removal+insertion
when possible.
Bug: 67377
Change-Id: I0318ae62c799300fb7696506a9736b839e2c8578
LinkNodeInspector was broken when you clicked away/pressed escape, because data was not set.
Normalizing on data being initialized at the top of get*Process methods if used.
Change-Id: I89728ac558545a6f2c325014b6f457ec6bef17b8
New changes:
56de6f5 Localisation updates from https://translatewiki.net.
f8bda64 Widgetise demo menu
6ac48d8 Localisation updates from https://translatewiki.net.
365e131 builderloader: Omit value for boolean "disabled" attribute per HTML5
706e4b3 Prevent double counting of DM nodes in getNodeAndOffset
b141a7d Update OOjs UI to v0.1.0-pre (d2451ac748)
c5b3921 Localisation updates from https://translatewiki.net.
1606983 Update reference to ConfirmationDialog to use MessageDialog
Deletions:
* Styles for ve.ui.MWBetaWelcomeDialog - not needed anymore because
OO.ui.MessageDialog provides them
* Styles for ve.ui.MWGalleryInspector - not needed anymore because
ve.ui.MWExtensionInspector provides part of them and the rest are being
replaced by programatic sizing
Modifications:
* ve.ui.MWLinkTargetInputWidget - Added support for validation and href
getter
* Split message between tool and dialog title for ve.ui.MWEditModeTool
and ve.ui.MWWikitextSwitchConfirmDialog
General changes:
* Updated inheritance.
* Added manager param to constructors of dialogs and inspectors.
* Updated use of show/hide with toggle.
* Added meaningful descriptions of dialog and inspector classes.
* Configured dialog and inspector sizes statically.
* Configured dialog action buttons statically.
* Interfaced with OO.ui.ActionSet to control action buttons.
* Moved applyChanges code into getActionProcess methods.
* Always using .next in setup/ready process getters and .first in
hold/teardown process getters.
Change-Id: Ia74732e6e32c0808eee021f0a26225b9e6c3f971
I1a7fc7f2 broke cite/template dialog - onDescriptionClick is not defined.
I can't find it anywhere in the VE-MW or OOUI source.
Before my change, it was simply a no-op. But now we try to bind it in a way
that breaks everything. This commit just removes that line since it was
apparently not doing anything.
Bug: 67814
Change-Id: I0b9c3318b3de8530e0ba9e355cd73eb7f70a6b5a
Example:
* Transclusion with html comment in target
{{ Unsigned <!-- ignored --> |Example}}.
* Transclusion with wikitext expression as target
{{ {{echo|Unsigned}} <!-- ignored --> |Example}}.
The first case was handled already (Parsoid strips the comment
when it normalises the target title). The second case, however,
is not handled and ends in template.title being null.
This was already documented (MWTemplateModel#getTitle returns
{string|null}), but not used correctly.
The title of the dialog is unaffected as it fallsback to
displaying target.wt instead of target.title.
Bug: 66724
Change-Id: Ib6696ac3538f6cb9e93da2f6f8666f373247eeb4
To use this script:
*Create an environment variable MEDIAWIKI_API_UPLOAD_URL having API URL
of the site where the images are to be uploaded. (Eg: http://commons.wikimedia.beta.wmflabs.org/wiki/api.php)
*LANGUAGE_SCREENSHOT_CODE environment variable should be set.
Run the upload script by: bundle exec ruby upload.rb
Bug: 62737
Change-Id: I1937aa5f02e3bf587ac65d8d11c3ebbb8b1d0528
XML-like tags in wikitext are not actually XML and don't expect their
contents to be escaped. The contents are usually not parsed as
HTML/XML anyway.
It means that it is not possible for a tag '<foo>…</foo>' to contain
the string '</foo>', but that is prevented by change Ia566452a.
Bug: 57429
Change-Id: I2516a897c85b4a3b79a34ff6cad5d124fbc30170
XML-like tags in wikitext are not actually XML and don't expect
their contents to be escaped. This means that (usually) it is not
possible for a tag '<foo>…</foo>' to contain the string '</foo>'
(see bug 57429 comment 4 for details).
Prevent the user from doing that by escaping the first angle bracket
'<' to '<' in such inputs when the inspector closes.
Bug: 57429
Change-Id: Ia566452ae0ffc9caa3ea48a52e5b8032c33fc9c8
The stylesheet contains workarounds for highlights on references
being drawn in the wrong place, resize handles appearing on headings,
and highlights being opaque.
Change-Id: I78da4d6a751429cd160b693b4a524fc7ea1ef76f
Also implement isInternetExplorer() in mw.Platform using jquery.client.
New changes:
9b2102f Skip over nested handlesOwnChildren nodes in getRelativeOffset
30a9835 Localisation updates from https://translatewiki.net.
5d142a0 Restrict get relative offset to movements of +/-1
7a2c984 Check that the surface has a selection after focus
851a63d Remove jquery.client
8786e53 Add evil detection functionality for IE
96f19ad Disable triple-click handling in IE
d746d42 Revert "Restrict get relative offset to movements of +/-1"
859d578 Revert "Skip over nested handlesOwnChildren nodes in getRelativeOffset"
Change-Id: Ib2e6568a862336e2516e4c519468218ec2a84834
The code previously appeared to add 'reference' (no "s"), but was
failing to do so due to passing variadic arguments to a method
that only takes one arguments (jQuery#addClass).
See also Ifae04e48.
Change-Id: Id59673c8033c82e51577f681221dbfd312da7b8d
Right now our system is so horrible that we need three separate
CSS rules to make the icons appear in three separate places:
1. Toolbar (with contextual directionality)
2. Context menu
3. Top-left corner of dialogs
Also, the icons in the context menu should use contextual directionality
but are using the document directionality because the context doesn't
compute and set a class for the context directionality. This is only
done by the toolbar. It used to work because the context menu *was*
a toolbar, but that changed recently.
Change-Id: I3ebc1ba7dfcd384a2a62664e55a4a77c8dedd513
Looks like I messed up in Ia67f9054 and got a setting backwards
Also prefix titles in a couple more places
Bug: 67384
Bug: 66893
Change-Id: Id6d5841ee1645be62a024308da48ddc6769c78b6
"Go back" should only be shown if there's something to go back to.
So it should be visible if you came from "Change image", but not
if you came from "Insert media".
If the "Go back" button is hidden, the footer is empty, so hide it
completely in that case. Hiding the footer is tricky due to how
dialogs position things, so I hacked around OO.ui.Dialog's lack
of an API for toggling the visibility of the footer.
Change-Id: Ic97c4a2bf7beaa240e5a4dfda1e605752e1f4189
In this fix:
* Adding 'go back' button to appear in the search panel.
* Hiding/showing the correct buttons within each panel.
* Disable the 'apply' button, and only enable when changes are done.
* Load the search query API and send API requests only when the
search panel is up.
* Make sure the search query is updated with the page name every
time the search page is loaded
Bug: 67443
Change-Id: I635986f30579c6358e0cc6fe54fbf97f49c83465
The parameter icons are not toolbar-contextual, so don't style them that way.
Instead, have them take their directionality from the .oo-ui-{ltr,rtl} classes.
Change-Id: Ic94b1e854b36542f7bcde97ead60eddcd56ccbea
Merge the media edit and media insert dialogs. Allow editing
of media properties when inserting a new image, and also
allow the user to replace the image on edit.
Bug: 67170
Change-Id: I35bd95503565dbf95090ee8110284db5a8fbba83
Mobile doesn't want the tool+dialog functionality for those yet,
so move them to a separate module and only load the bare bones
for mobile. We did the same with mwimage/mwimage.core.
Change-Id: I9185ce62f458b3de08cbd28f2a41370d2301de9d
Now that we don't wrap generated content nodes
UL.gallery is likely to be the root, so use an
appropriate jQuery selector.
Change-Id: Ic9d9f4c0fc12daae6cf8252e4d6562366b3d2df2