This is not trivial because Ace selections are
[column,row] tuples, so we need to translate to
one dimensional offsets.
Change-Id: I901b025b3747d61c74f49038fe4a65ed75758211
Ace is clever about not updating the rendering of elements
which aren't visible, so allow users to force an update, for
example if they changed the value while the whole widget
was hidden.
Change-Id: I7bbbffd17489bc80fe5fa80911f29d7223e125a3
VisualEditor is usually not enabled in talk namespaces... but
sometimes it is. And when users see the button to edit with VE,
they're going to click it and expect to be able to sign their posts.
This tool is only loaded on talk pages and pages in additional
namespaces defined in $wgExtraSignatureNamespaces.
Code adapted with small tweaks from my own gadget
<https://meta.wikimedia.org/wiki/User:Matma_Rex/visualeditor-signature.js?oldid=13461327>,
which is already available under the MIT license.
Changes include:
* The tool is now always visible if the wiki allows signatures in any
VE namespaces, but disabled when not allowed in the current namespace.
* Register '~~~~' sequence to insert the signature.
* Code style tweaks for stricter lint checks in this repository.
* Documentation corrections.
Swedish translation provided by André Costa (already credited
as a translator as Lokal_Profil).
Depends on changes in VisualEditor core:
* I89fe53890ab59d12260ea6b41de802c38c24e8b9
* I14cd7efac521687ea38580341ae08ddc522edeeb
Bug: T53154
Change-Id: I6be5fb2118cf3eef5098d4c5320228aa81411ccb
If you create an autolink in the middle of bolded text, the magic link
should also be bolded. Similarly, if you convert a bolded simple link
to a magic link, the magic link should stay bolded.
Change-Id: I38c7f3c0c275851049088a37f3b37d815ed38e4e
New changes:
95589a6 test: Add a Rakefile for new CI requirement
1a4497e ve.ui.DialogTool: Do not require that a command is set
cbf1bff ve.ui.Tool: Fix documentation for getCommandName
530022d Localisation updates from https://translatewiki.net.
9529093 Update OOjs UI to v0.13.2
b8d6c15 Add icon: Rename 'insert' to 'add'
2f3015b Update OOjs to v1.1.10
78ceb18 Fix deletion inside a structural node at start/end of document
ce3e9a4 ve.utils: Use binarySearch from OOjs
Local change:
* MW test cases for new structural deletion logic
Bug: T52250
Change-Id: I643449c1fa08ea12c8c3aa13f4a4b97d8876990d
Ensures that these styles are loaded *after* OOUI by making
them dependent on it, unlike DesktopArticleTarget.init
which isn't.
Change-Id: Ia1fff16432d20fb56707c5e21c6a930d2478e311
No point showing the icon if we don't have the functionality to
make it do anything. Also this reduces the number of RL requests
made as we never fetch OOUI separately.
Change-Id: Iac9aa6f34c485223e73981b3377c7d0cfd31dae9
Work around RESTBase problem that causes errors if we try to switch to
VE when the wikitext is empty. This would prevent non-power-users from
opening VE entirely.
This only solves the issue for new empty pages, and not when the user
intentionally empties the edit box. In that case, though, they get a
dialog where they can choose to "keep" or "discard" changes, and
discarding lets you open the editor.
Bug: T118152
Change-Id: Ie808bcaa9826deacac392dd6cbc90a9446602b79
This wasn't as bad as T112401 (that was blocking render), but we
still shouldn't be loading the module on page views.
Bug: T118088
Change-Id: If86701ed7ff4e8d6defb1c682aa9a38c211be0fa
The error code has changed after T115258 and is now consistently
'titleblacklist-forbidden' for all TitleBlacklist errors.
The API now also provides information about the exact error message to
display (error.message) and the TitleBlacklist rule that matched
(error.line), but we probably don't have that message client-side, so
we're not trying to display it. Maybe when we can load it (T40280).
Bug: T116198
Change-Id: I32fccc7d0b2b66c739d59db05c568a56d9f07eec
This is now a candidate for upstreaming to OOUI as the
'wikitext' icon, which is slightly larger.
Bug: T111038
Change-Id: I19a287926d6f100d2cb5ed1d713387a2dac56b37
VE already has a a switch icon in the options menu, so bring that
up to the main toolbar.
Append an OOUI button to the WikiEditor toolbar if present, and bind
to the same functon as the edit tab.
Bug: T49779
Change-Id: Ic1e83ea7b13c4fef68024bf05ffc244060666103
After the widget is initialised the caller will probably
want to clear the undo stack, so that the first state
is the initial value provided.
Bonus: Add documentation for the widget.
Change-Id: Ia331acc4177e32784061cae55c450eb0f83fd744
New changes:
6cae77b ElementLinearData: Add another case to hasContent
d2e15f2 SurfaceFragment: Improve handling of delete all
16db2a3 Return 'null' instead of null in ve.Filibuster observers
24de6b2 Introduce key down handlers to separate logic from ce surface
f77fe99 Localisation updates from https://translatewiki.net.
062cb26 Localisation updates from https://translatewiki.net.
Change-Id: I61c94983c7898af219266af3022761638c7578b7
Remove bottom border radii from the <textarea> and apply to
the options bar instead.
Apply different values for Apex and MediaWiki themes.
Change-Id: If727863a87547692ee499d2141c0418658609412
The extension registers a lot of sequences that don't apply to core
VisualEditor. Pretty much the opposite of the trigger situation, where
almost all are in core. So, merge them into the help dialog.
Update VE core submodule to master (be148ae)
New changes:
7380244 [BREAKING CHANGE] Include sequences in the command help dialog
Bug: T116013
Change-Id: I5ad2939c10140b954fb29e1e50414ab7d79aeab7
siteSub and contentSub are both children of bodyContent so
no need to give them opacity directly.
Bonus: Make them user-select:none to avoid confusion as they
are in the edit area.
Bug: T116755
Change-Id: Iea4c35abc1eedb892e02c54b61e40726fa2b096e
Follows-up 28f3a02e56.
* Use mw.loader#getState() instead of private 'moduleRegistry'.
This property is not a supported API and may change at any time.
* Use plain push() instead of splice(). The order of modules
is insignificant as dependencies are enforced by module registry
only. Besides, the order is additionally normalised both
client-side and server-side by ResourceLoader.
Change-Id: Id9291c97c3bfc01c4cf203aa7b15629fb8412f5b
When the tab is switched, we already set a mode that doesn't allow
using these actions.
Bug: T116299
Change-Id: Ib3ba50f578face3d49bcd14e41afe01a3b3d15af
The first time this is called, it will try to switch panels, so it has
to be done before we switch to the right panel.
Bug: T116217
Bug: T116219
Change-Id: I22411024995e22ae65bde1e6418748aedf026b1b
If a command is not registered because a file/module is not
loaded, the sequence should not be loaded either.
Change-Id: I45d86ad371c7b717601b6593eaa573292ebdd4ed
The widget attempts to load the ext.codeEditor.ace.modes module
and if it fails, will fall back to regular TextWidget behaviour.
Bug: T49742
Change-Id: Ie483f6eba25e3732a396c18decc0e1844b806b23
If a tool had an education popup bound to it, but it was
suppressed because the user has already seen it (according to
the cookie or localStorage), then clicking that tool would
cause a JS error.
Also remove a workaround for a ClippableElement problem
that appears to be unnecessary.
Change-Id: I73a3f5f9cc1726e28e70fc545b72960afc5ac41c
In some tests the save button won't be available for a few ms
until the latest transaction has been pushed to the undo stack.
Change-Id: If03f03b033a21a039a322ca32983d0302e44efbb
Calling initialize will clear all fields including the
OO.ui.SelectFileWidget that was just set.
Follows up I521909d27c390faad7d62f717f2b97b7676e5a63.
Bug: T40031
Change-Id: Ibc7ddafae9cb7718372520245a356938f4731479
The bug in jqueryMsg that required this is now fixed. Depends on
I56d8f7ec03a70f5c2360d9c5099496ecb2f668ad and
Icc360724c75755a6ffc31792d8439cba142642ae in MediaWiki core.
Changes to messages were done with search-and-replace:
<a $2> ---> [[{{ns:template}}:$1|
</a> ---> ]]
{{GENDER:$3 ---> {{GENDER:$2
Bug: T87131
Change-Id: I67475edb75fb5192a76fbe629d735d1f2dcd1d48
* translate method can be called to translate a particular string to a
specific language.
Bug: T90577
Change-Id: I7852ee0b0009e70bd9decef0dd317055d91a06a6
New changes:
63c5f67 [BREAKING CHANGE] GeneratedContentNode: Introduce new hash for rendering
6dd1cb2 Add ve.dm.Surface#selectLastContentOffset
Local changes:
* Use new getHashForRendering in GeneratedContentNode users
As we no longer have a model hash, remove the originalIndex check
and just rely on the deep comparison of mwData (trading a deep copy
for a hash computation should result in similar performance).
Bug: T114689
Change-Id: Ida0ee0234418408b735232c633d41908a424a9ff
Applying staging doesn't emit an update event on the node, so
forcefully emit one with 'staged' equal to false, so the full
error is rendered (if present).
Logically depends on I8ebb26d4bc in core.
Bug: T114480
Change-Id: I7ba54b67982fc5b10839426cdc216e14c0e33c01
As part of the plan to render extension errors in the
inspector instead of the view, append an element to
contain the error. More specifically, the element is
a div that contains a LabelWidget (in which the error
message is displayed) and a ButtonWidget (to expand
and collapse the error).
Initially the error element is hidden, but if Parsoid
returns an error, the element will be shown. If the
error is longer than 1 line, it is truncated but can
be expanded. On closing the inspector, any remaining
error is collapsed and hidden.
Depends on I6002d9870d2b to work
Bug: T113172
Change-Id: Ie84130d4ac0da9a738bf98ad0a3677d47566d585
OO.ui.BookletLayout does not respect tabindices when trying to focus
the first focusable element after a page is switched. Remove the need
for manually set tabindices in ve.ui.MWTemplateDialog by using natural
DOM order and absolutely positioning things to keep current design.
Bug: T114562
Change-Id: I7a18a455f9fa80eb3d2ea17bff8139e0194c0fbf
Mobile target, for example, has events logged in the MobileFrontend extension instead
(which covers both the wikitext editor there and the VE integration)
Bug: T110272
Bug: T109525
Change-Id: I521f1825dc9c0a135db54cd005cda723908f14bc
Call updatePreview in insertOrUpdate node, when closing the
inspector. If edits have only been made to attributes that
don't affect the rendering, updatePreview will not have been
called, so the model won't have changed. Therefore
updatePreview should be called every time the inspector is
closed to make sure such edits are applied.
Bug: T113078
Change-Id: I48fb291487f76fc515f122646d205366a60dca62
We don't expect users not to alter the hash (subclasses may delete items)
so make a copy of any objects we put in it.
Change-Id: I6274f47e02b9f2d53864d4a2ae80df42e6c89867
MWExtensionNodes currently don't call afterRender if the image
is already loaded, which can happen if we decide not to rerender
after an update (e.g. when the response is an error).
Change-Id: Ic9c11e446a7cc789bb20680466709ff2ad5cb22e
We want to flip the default of visualeditor-enable to true, but don't
necessarily want to turn it on for users who already have contributions but who
haven't already enabled it. Therefore we're considering adding such users to
this autodisable preference which they can self-remove (by explicitly enabling
VE) or we can target later, separate from betatempdisable users.
Bug: T112352
Change-Id: I1ce5e6c92055e30fdc82bc912a767e913b190ef6
New changes:
18e46b6 [BREAKING CHANGE] LinkAnnotationWidget: Abstract .text property to getTextInputWidget
Local channges:
* MWLinkAnnotationInspector: Use new getTextInputWidget method
Change-Id: Ia33797d612be7b4521e7212047a38480ee2520df
Disambiguator extension adds the .mw-disambig CSS class to internal
disambiguation links since 8cc16d021410f49fa12a2f35c97cdac51adf4380.
Change-Id: If32bcb8867a874ee4127593f58619d059fe691b0
Add zero-width space to make span-like tags non-empty, so that the browser won't
merge their cursoring positions with the following character.
ve.ce.MWNumberedExternalLinkNode:
* Insert U+200B ZERO WIDTH SPACE inside span (before 'a' tag).
Bug: T96307
Change-Id: Ib07f732043eae4640e3dcfdc06015bcf8897c7b4
It's just as usable as the alien extension inspector which
is currently shown, and has better messages.
Change-Id: Ifbce9df4aff77cf76a8445158987be716ba45302
This was causing a regression in the behaviour that takes you
to the external link tab automatically when 'http://' is typed,
as internally it is normalised to 'Http://'.
Bug: T112158
Change-Id: Id7cff07e89caafe5b350f4fb27b99c6c89498990
New changes:
184f952 [BREAKING CHANGE] ve.dm.Converter: Put static things in .static
a4c1e1e Localisation updates from https://translatewiki.net.
Local changes:
* Switch to using Converter's newly-static methods
Change-Id: If30f7b2a0de92c4c7f4d5ca57663251c132eeed2
If VE is enabled for consistency edit section links become edit source in all NS.
This patch fixes it to be done on the backend for namespaces where VE is not enabled
(instead of user side) to avoid noticeable flickers on page load.
Bug: T112366
Change-Id: Iba090bfc1b2ff4886fb0cf2b37db7870b6be792d
Drop beta-ness as users don't care and it confuses them. Leaving the preference
alone for now.
Bug: T99963
Bug: T112354
Change-Id: I0e039dec54d528fce24226e76b931b593dd13a9e
The loading progress would not be reset upon failure, causing issues
when you tried to start loading again.
Bug: T96437
Change-Id: I7ec4be82304c101fa1bd634f60bc6b0047e2d53d
This only comes back in results from certain modules, so I'm not entirely
sure whether we want to do this in here or mw.widgets.TitleInputWidget.
Bug: T111598
Change-Id: If2916706db359d520c41c2dec7ded44e0d3a56a9
So many old keys not yet removed. Oy. Also, disable disallowDuplicateTranslations
for now as this fails so much.
Change-Id: I52e1555335a6e64b1e9db541ba726cf6ce8c7dd0
Right now .initialize() doesn't do anything other than enable
the window resize handler for toggling the "narrow" styling,
but as a matter of principle we should call .initialize()
on toolbars after attaching them.
Change-Id: I419c943d1d20af2105b84b8f5fbccc7070af601b
* Remove page.length
* Add action.abort.type = switchnochange
Needs to be deployed at the same time as Ib99700ac
Bug: T111420
Change-Id: I7ee245157d4de6c220d7cdf54cd1dd69ff836f15
* Don't insert/update/remove nodes on cancel in MWExtensionInspector
* Don't forget to popStaging on cancel in MWLiveExtensionInspector
Bug: T110992
Change-Id: I1e30206595e304eb502c7e745bf5e00d145d12d7
Implement a special node type, context item, and inspector for
ISBN/PMID/RFC magic links. Add buttons to the link inspectors
to convert back and forth between "simple" links, and magic links.
Depends on I5d000d8b63dafdfe0a2753069d3f0ac5b03b8829 in Parsoid
for clean round-tripping of localized ISBN magic links.
Bug: T63558
Change-Id: Id5b7a2ae3c80b0e5eed598f0bd024d3e94f7e9aa
Add a parentDoc parameter to the MWImageModel constructor and use
it to inherit language, direction and HTML document. Remove
getLang(), setLang(), getDir() and setDir() whose only purpose
was to propagate the language and direction from the parent document
in a hacky way.
Also add a parentDoc parameter to newFromImageAttributes(), replacing
the lang and dir parameters. Remove the unused and ill-conceived
caption parameter.
This causes caption documents to always have an HTML document
for URL resolution. Previously, this worked when editing existing
images because a document generated by cloneFromRange() (which
propagates the HTML document) was passed into setCaptionDocument(),
but it didn't work when creating new images.
Bug: T109599
Change-Id: Ida36862092cd779ffc2f04c0ecbc1164f8d71453
Add a parentDoc parameter to the MWReferenceModel constructor and use
it to inherit language, direction and HTML document. Remove
getLang(), setLang(), getDir() and setDir() whose only purpose
was to propagate the language and direction from the parent document
in a hacky way.
This causes ReferenceModel documents to always have an HTML document
for URL resolution. Previously, this worked when editing existing
references because the newFromReferenceNode() code path calls
cloneFromRange() which propagates the HTML document, but it didn't work
when creating new references.
Bug: T109599
Change-Id: I5d9d34d4343be8428318fa0b795fa54c110e34f4
Collapsible relates to the Vector menu behaviour where an item
is moved into the dropdown menu if the window is narrow.
This should only apply to the secondary tab when there are two tabs.
If there is only one tab (non-VE, e.g. in a non-VE namespace) then
this tab should not be collapsible.
Server-side code handled this correctly, but client-side was
adding the class unconditionally.
Change-Id: Iecd195e92f43fe9f11b3938a1a24caed7b331e5f
This allows the URL paste handler to use the normalized title
as the text content. Add a test to cover this behaviour.
Depends on Ica48fea69cc in core.
Bug: T109980
Change-Id: I2784adaf2949a73256049921227dde0917ef9aef
Fix the back-reference to \1 (1st set of brakcets).
Add an test to make sure the example sequences actually trigger the
wikitextString handler, and tweak test to ensure that the start-of-line
restriction in the heading regexp doesn't affect link matches.
Change-Id: I76187a12292a4923d1ee2505cfb955431ac252bb
Also store the abortable API request so it can be cancelled
by the dialog.
To test this, put sleep(4); in ApiVisualEditor.php.
Depends on Ied21e574baa in core.
Change-Id: I83ffa9e0b7164ca4a34eae86cde452d8f38dc853
New changes:
89f6c2d Strip trailing quotes when autolinking URLs
Local changes:
* Strip trailing quotes and non-URL characters when auto-linking
Update ve-mw to match I58a9c7f97ef10d9f495e65da17f208b9fc431aa4 in core,
since otherwise the ve.ui.LinkAction.test.js case with a quoted link
will begin to fail.
Make the set of stripped characters better match the combination of
EXT_LINK_URL_CLASS in the PHP parser and the explicitly-stripped
trailing punctuation in Parser.php::makeFreeExternalLink().
Add some international quotation marks while we're at it to make
everyone equally happy.
Change-Id: Iaffac4b073aeafa4f1137265c2d95e425c24d553
Depends on Ibdad2fa98fca08eeaa96bf33a08dd7723c1edb8c in Parsoid.
Depends on I3dcd289ed7b565b9162ee671038eeb45449e1215 in ve-core.
Bug: T109498
Change-Id: I5650410d7fca30c90baddd4f0c3f6d80e6b39042
Upgraded mw-selenium to 1.x, following the docs at
https://doc.wikimedia.org/rubygems/mediawiki-selenium/file.UPGRADE.html
Created an `environments.yml` file, converted page object definitions to
use relative paths, and refactored references to the global `ENV` using
methods of `MediawikiSelenium::Environment`.
Upgraded commons_upload as well to resolve a dependency conflict on
mediawiki_api.
Paired with: Rummana Yasmeen <ryasmeen@wikimedia.org>
Bug: T99661
Change-Id: I2a05cd816ea43afb48157e5dbe1ae42c6c124f6b
You can now do this from the context menu. No need to have extra buttons, and
this makes it consistent with the MWInternal/MWExternal link inspector.
Bug: T109646
Change-Id: Ifd4b3645c66ba2f32ccee7e2848967cf5e7ec82e
Add ve.dm.MWInternalLinkAnnotation.static.newFromTitle to build an
appropriate internal link annotation from a mw.Title. Tweaked some
method signatures to avoid repeated reparsing of the title text.
Also refactor ve.dm.MWInternalLinkAnnotation.static.getTargetDataFromHref
to explicitly return a boolean indicating whether the result was determined
to be an internal link.
Bug: T64816
Change-Id: I74385d7b3ede1794398dabb749185f4080509b99
checkboxFields in the setup data is optional, it's only actually set up by
DesktopArticleTarget's overridden openSaveDialog function, not mobile's
(or presumably other Target classes).
Bug: T109501
Change-Id: Ibc5f821be822fa3704bbfb55345687dd7795e203
New changes:
de69c36 Fix typos in function names
fa80099 [BREAKING CHANGE] Split out linear context from context
db1d28c Only show alien context for focusable nodes
1191940 build: Bump grunt-jscs to 2.0.0 and make pass
Local changes:
* Update context inheritance
Change-Id: I284e2b30cd1903770482ee1c554687b676a2d626
This invokes Parsoid to convert likely wikitext pastes.
This addresses about 20% of the <nowiki> insertion quantified at
https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:%C3%89diteurVisuel/Avis/Nowiki
for 2015-04-08 which were due to inadvertent pastes of wikitext.
For a better user experience, suppress Parsoid's P-wrapping if the
output consists of a single top-level P element. This ensures that
pasting '[[Foo]]' won't add an unexpected newline before the paste.
Bug: T54204
Bug: T109449
Change-Id: I26a4cd8dc5b7e7caf16ca081dbe7baf6a7db8e5c
New changes:
263b4fc Localisation updates from https://translatewiki.net.
0487dcc ve.dm.CommentNode: Add space to comments' clipboard html
3a5422b DebugBar: Add a close button
Change-Id: I9ff3a77a3eb8d2d9a9dc61aa6cb52db577d1592e
Anything with type=checkbox is coverted, and its label is found,
either by for=id or by finding a wrapping label.
All other inputs are stored in $otherFields for form building.
Bug: T86617
Bug: T70572
Change-Id: I94376fef18d02d2058bb548c11ae17f3dec7268c
New changes:
985edd2 Localisation updates from https://translatewiki.net.
9883b44 Follow-up 985edd24: Fix build for added language 'shn'
b0d5ee2 Localisation updates from https://translatewiki.net.
18ca837 Localisation updates from https://translatewiki.net.
f6a0945 Don't include trailing punctuation in autolinked typed text
Local changes:
* Add MW-specific trailing punctuation rules for autolinking
Change-Id: Iaa620142222f47e9fde2d03b935f38c24d38800b
* Rename the actions toolbar the 'pageToolbar', and place the save button in
its actions section.
* Inject the title amongst the pageToolbar tools, so we can have tools either
side of it.
* Don't use the hamburger icon, as this has a (different) expected behaviour
in MF. Replace it with a back button, and move the edit switch action over
to the right in an 'advanced' group.
The toolbar is back to being laid out like the source editing toolbar in MF.
Change-Id: I4e00a8cdf603968ee32872323c88e587c1e1a487
When the MWMediaResultWidget receives a file that has no graphical
represenation (width:0 height:0) it uses minWidth of 30px for width of the
thumbnail.
This is, for example, the case with PDF files if the PdfHandler extension is
not active.
This patch solves the issue by falling back to the thumbwidth/thumbheight
values if width/height are 0.
Change-Id: I6bdaf1aafc0c45e26d31cd9dd9504e193f04e717
We were checking 'local' in config to determine whether a repo was local or not,
but config.local *will be set* to undefined in cases where it isn't.
Change-Id: Ic203b6e8204b95a644672790a2836d6e4709d218
New changes:
61d20a1 Hide on-screen keyboard when selecting nodes on all mobile platforms
e5aff79 Localisation updates from https://translatewiki.net.
a99a897 Update OOjs UI to v0.12.3
3c01a14 Make DM nodes sensibly hashable
a611eb9 Make ve.dm.example.postprocessAnnotations fluent
496c895 Update ve.dm.ElementLinearData#hasContent documentation
fcaa035 Support RegExp sequences; trigger sequence matcher after newline
edda1d4 Add a mechanism to wait until ve.init.platform has been created
e174155 Autolink URLs when typing
ac9248f Allow drag and drop of links (and subsequent autolinking)
c88fad6 Localisation updates from https://translatewiki.net.
Local changes:
* Define `ve.init.platform.getUnanchoredExternalLinkUrlProtocolsRegexp`.
* Make `ve.ui.MWLinkAction` extend `ve.ui.LinkAction`.
* Override `ve.ui.LinkAction.getLinkAnnotation` so auto-links use the proper
`ve.ui.MWExternalLinkAnnotation` type.
Change-Id: I934f76158512e2e89b614ed92fef6481f70728e7