Commit graph

311 commits

Author SHA1 Message Date
jenkins-bot 6b7fc00f68 Merge "DesktopArticleTarget: Change tab text on server side when possible" 2015-12-16 19:51:03 +00:00
Alex Monk 27822d6612 SET: Always show wikitext editor on action=edit if multiple tabs are in use
VE tab will take you to veaction=edit then instead

Bug: T120987
Change-Id: I6e9bb24199e974435992c3b9a7b87c1b668187b3
2015-12-15 20:12:43 +00:00
Alex Monk c99a5b627e DesktopArticleTarget: Change tab text on server side when possible
Usually. Unless you load VE, because then you might be loading on
`action=edit` in remember-last mode and therefore the tab text needs to
be updated from "Edit source" to "Edit". Or "Create source" to "Create".
Or the equivalent with 'local description' in the case of pages from
foreign file repos, etc.

Bug: T120970
Change-Id: I8f07be6c8e415b40ad134ee82d0bda1d63cc4f96
2015-12-15 10:49:45 -08:00
Alex Monk 76a12f2f9b Try to actually resolve visualeditor-editor preference setting when switching editors
Seems we need to make sure this returns before navigating to the target page.
This reverts commit 40807a0743.

Bug: T121122
Change-Id: I4edf03bc0d57b03897d9f1802eabd8f0dd9962b9
2015-12-15 17:35:22 +00:00
jenkins-bot 33cbf199f1 Merge "Revert "DesktopArticleTarget: Don't abort in SET mode if veswitched is set"" 2015-12-14 20:53:28 +00:00
Jforrester 40807a0743 Revert "DesktopArticleTarget: Don't abort in SET mode if veswitched is set"
This reverts commit 5b083a7272.

Change-Id: Ieac905b80ea219075b4de498d645f22c3e86c5ca
2015-12-14 20:46:08 +00:00
jenkins-bot 51d493918b Merge "DesktopArticleTarget: Don't abort in SET mode if veswitched is set" 2015-12-14 16:46:02 +00:00
Kunal Mehta 7f02824ec4 Remove no longer needed ContentHandlerDefaultModelFor hook
As of 3b44da3261673 in MediaWiki core, all MediaWiki:*.json pages are
given the JSON content model, so our hook that does the same is no
longer needed.

Change-Id: I8b39edf36b479ca22d74481c3d571d15db69aa1e
2015-12-12 13:34:11 -08:00
James D. Forrester 5b083a7272 DesktopArticleTarget: Don't abort in SET mode if veswitched is set
Bug: T121122
Change-Id: I6dca85361be0c1c1c0d39b12b167af813706ae0b
2015-12-11 18:15:25 -08:00
Alex Monk 98a456b189 Single edit tab: Fall back to the wikitext editor when certain parameters show up
We can't handle these yet. There's also 'preview' but I think we probably
qualify as supporting that.

Bug: T121126
Change-Id: I4602992a77f460b9bfcbad0eac1bdd79d67df04d
2015-12-10 23:13:25 +00:00
James D. Forrester 705199753c Let the feedback tool be configured for a remote wiki
Bug: T92661
Change-Id: Id48729c89db208714f67fec1eabafe577a834b51
2015-12-10 12:12:59 -08:00
jenkins-bot 0d9643e9e2 Merge "Single edit tab: Update preference value" 2015-12-10 01:33:25 +00:00
Alex Monk bca222912c Hide VE tabs preference when user has disabled VE
Bug: T120965
Change-Id: I846124f762d811be4fbfb32c08063fc57a029cb4
2015-12-09 22:54:28 +00:00
Alex Monk e8a682f567 Single edit tab: Update preference value
It's all Timo's fault for suggesting the new values in I65d96627 PS21, obviously.

Bug: T120969
Change-Id: Ib0309342a831ec1950c1be8c7a0c79a31c413163
2015-12-09 22:51:16 +00:00
jenkins-bot 2efbdc670c Merge "Single edit tab and section links" 2015-12-09 00:40:46 +00:00
Alex Monk 748db015b0 Single edit tab and section links
In addition to the couple of TODOs inline, we should do the following in
follow-up commits:
* Prevent FOUC due to changing things only on the client
* Make section link behaviour sensible

Bug: T58337
Change-Id: I65d966270491ffe017cb11a0daa915628fadf65c
2015-12-08 17:47:16 +00:00
Ed Sanders be45a9172e Update VE core submodule to master (d6f2d75)
New changes:
94f2edb Paste sanitization: Check for whitespace *before* newlines
c981b96 Fix-up Ie5414f62c: Fix call to non existant method
d6f2d75 FindAndReplace: Implement whole word matching

Local changes:
* Message and config for FindAndReplace whole word matching

Change-Id: I103b9b1ec92c0aae1e51e1a94db6b8b5e759dbea
2015-12-03 09:40:12 -08:00
Bartosz Dziewoński 9be5c85db4 Provide a tool to insert a signature in namespaces that need it
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
2015-11-16 18:06:32 +01:00
Alex Monk b550323b53 Use mw.loader.using instead of weird hacks to load OOjs UI on action=edit
Change-Id: If03dab6130aed7662b04000b809884a514bb2762
2015-11-03 23:55:17 +00:00
Alex Monk f71a5a5bca Dialog for switching between wikitext and visual editing
Change-Id: I7046ffbe318d046b4baee11f4148ab77fc2af7fd
2015-11-03 01:36:29 +00:00
jenkins-bot a0a0f0e2c0 Merge "Allow switching from wikitext to VE" 2015-11-02 23:18:33 +00:00
Alex Monk 85b745666f Allow switching from wikitext to VE
Just by pressing the VE tab for now

Requires a relatively new version of restbase

Bug: T49779
Change-Id: I2a5294345f5e0f469c1dd1bdd29dbce211571a4e
2015-11-02 20:55:19 +00:00
Alex Monk 9f3864723f Register the preference to hide education popups
This is needed for logged in users

Bug: T117083
Change-Id: I8e214ef2f043c97e387b65f47db6b8d234c55339
2015-10-30 02:10:46 +00:00
jenkins-bot 81a89952ef Merge "Educational popups and highlights for links+citations" 2015-10-14 21:52:50 +00:00
Alex Monk 9d6fbc894e Educational popups and highlights for links+citations
Bug: T108620
Change-Id: I42b0e06f50aca5cb783d88f79a080461e745ceee
2015-10-06 14:33:57 +01:00
Ed Sanders 6c1891c150 Find and replace: Add pref keys for find/replace text inputs
Adds support for storing find and replace text inputs added
in core in I8ae8d49.

Change-Id: I78dea87025e2bfa1b3ff977b16986e8431ddfb22
2015-10-04 13:39:58 +01:00
James D. Forrester 01bd73c808 Update VE core submodule to master (ca4bd8c)
New changes:
8c917a7 Add focused class to surface when focused
04d7f8c Localisation updates from https://translatewiki.net.
dfc71e6 Move cursor offset calc from CE Surface to DM Document
02040d0 Localisation updates from https://translatewiki.net.
7d6d49e IME tests: Add IE11 Win8.1 Korean; name specific Windows versions
7ce9d64 Localisation updates from https://translatewiki.net.
ca4bd8c Update OOjs UI to v0.12.10

Change-Id: I7c04d72cb6bf1d21eb257e2a6cf42c61c7d34eba
2015-09-29 15:14:02 -07:00
Roan Kattouw 28fbf2bcda Update autodisable logic
* Make betatempdisable appear checked if autodisable is true
* Set autodisable=false only if betatempdisable is also false
* On wikis where $wgVisualEditorTransitionDefault=true, set
  autodisable=true when the user disables VE

Change-Id: I3415af4a735afb10cf246f4b22b9d84ef98c882f
2015-09-28 18:19:56 -07:00
jenkins-bot ce8107ec0b Merge "Autodisable preference" 2015-09-28 23:46:59 +00:00
Alex Monk 97e70ba3cc Autodisable preference
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
2015-09-29 00:30:27 +01:00
James D. Forrester c0c5a028cf Add MediaWiki version requirement to extension.json
Remove the now-empty ::onSetup hook.

Change-Id: I67fe9cf9d05a16199a507f99f5ec295ae7e64dc2
2015-09-26 14:27:44 +00:00
eranroz 051066ead6 Server-side replace Edit=>Edit Source on talk NS
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
2015-09-16 00:39:13 +03:00
James D. Forrester f6a706c5f4 Hooks: Respect VisualEditorDisableForAnons for section edit links too
Change-Id: I662652e6a2ae6d04c0e6086240fc5ee63194da3a
2015-09-11 18:23:25 -07:00
jenkins-bot 3a15ef608c Merge "Use RESTBase v1 API" 2015-09-10 20:14:35 +00:00
jenkins-bot 8502d3ea05 Merge "Specialized inspector for ISBN magic links" 2015-09-01 18:34:23 +00:00
C. Scott Ananian 7cc23367f6 Specialized inspector for ISBN magic links
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
2015-09-01 14:25:59 -04:00
James D. Forrester 1aab5a2322 Update VE core submodule to master (62cf769)
New changes:
62cf769 Store find and replace toggle states in user config

Local changes:
* Register new visualeditor-findAndReplace-* options

Change-Id: I5934882f25614bd79488fff7e8fa0af5ede0af38
2015-09-01 10:50:06 -07:00
C. Scott Ananian 96e330650d Use RESTBase v1 API
This requires https://gerrit.wikimedia.org/r/214351 in core, which adds
support for emulating the RESTBase v1 API to the
ParsoidVirtualRESTService.

$wgVisualEditorPrefix is now deprecated.  Parsoid is configured using
VRS (preferred) or $wgVisualEditorDomain, which defaults to
$wgCanonicalServer.

This bumps our MW-core dependency to 1.26wmf21.

Bug: T110780
Change-Id: I9175ac8db8310f0c9574c8272b5e39932557d57e
2015-08-29 02:12:29 +00:00
jenkins-bot c010450e08 Merge "Move MWReferenceSourceSelectWidget out to Citoid" 2015-08-26 15:40:19 +00:00
James D. Forrester ea950aba3f Hooks: Don't show the tab just to hide it when 'DisableForAnons' is true
Change-Id: I11cca7e0acbce52335dfadcead97303329d9a33f
2015-08-25 15:55:04 +00:00
Timo Tijhof d97f85019c Fix flash of bad ve-edit tab on non-wikitext page in enabled namespacea
E.g. when viewing User:Example/common.js there was previously
both Edit and Edit source (or Create and Create source) and the
client-side JavaScript then removed the ve-edit tab after checking
the content model for 've.isAvailable'.

Change-Id: Ic2daeefa439648ef0602f8606773655cf9ab188a
2015-08-25 15:45:06 +02:00
Timo Tijhof 7825293849 Fix flash of wrong Edit tab in non-VE namespaces
Follows-up 6bc797f which added an early return in namespaces
where VE is not enabled. However, just like the init-init JS code
does already, we should still update the Edit tab message to say
"Edit source" regardless of whether VE is enabled.

After 6bc797f this started to cause a flash where the tab first
says "Edit" and then becomes "Edit source" client-side.

And since the Title::isKnown logic is not available client-side,
this actually exposed a bug with regards to MediaWiki-namespage
messages. Currently the client-side considers these "Create source"
when they are in fact "Edit" (or "Edit source").

Change-Id: If88d648b657d8a571beb7991805f8af8bd547975
2015-08-25 05:50:16 +02:00
Ed Sanders a67965a888 MWInternalLinkAnnotation: Override new getDisplayTitle method
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
2015-08-24 14:29:49 -07:00
Alex Monk b0507f692d Move MWReferenceSourceSelectWidget out to Citoid
Merge after Iaca69f17

Bug: T109988
Change-Id: I80c1be419e545aecdc9f7db98133776d4b4cc326
2015-08-24 15:24:17 +01:00
Ed Sanders e59ee87887 Add spacer above basic reference option
Also add classes to basic/reuse so they can be differently styled.

Bug: T108725
Change-Id: I4d128afe86c7fae2d8cbd8a57749970942e39e76
2015-08-23 20:06:35 +01:00
C. Scott Ananian a6775796fe Detect paste of wikitext and convert it
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
2015-08-18 15:16:06 +00:00
C. Scott Ananian 550a979fdb Update VE core submodule to master (0bf4ce7)
New changes:
44f8204 Autolink pasted links

Local changes:
* Add UrlStringTransferHandler from core

Change-Id: I7eae6da2739fa47b22ed1e7fbf53e9473e037c5b
2015-08-18 07:20:29 -07:00
C. Scott Ananian c197d0b075 Update VE core submodule to master (d020898)
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
2015-08-17 10:01:54 -07:00
James D. Forrester 1d6085b801 Update VE core submodule to master (e61ebf2)
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
2015-08-12 14:31:06 -07:00
James D. Forrester 6bc797f34e Only add tab on the server-side if we're in a VE-namespace
Prevents flash-of-unwanted-VE.

Change-Id: Iecc3eba39fb10ee3aa3efd70630867a4c53fef77
2015-08-11 01:33:11 +01:00