mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 03:08:42 +00:00
When we have multiple tabs and NWE enabled, set the edit tab's URL to NWE
For middle click/ctrl+click Bug: T146323 Change-Id: I66d75d222cad2183beebd49759a35ee8d85969b2
This commit is contained in:
parent
c0cf9c1e75
commit
dd1e4cf8fb
|
@ -330,6 +330,17 @@ class VisualEditorHooks {
|
|||
$user->getOption( 'visualeditor-tabs' ) === 'multi-tab'
|
||||
)
|
||||
) {
|
||||
if (
|
||||
$config->get( 'VisualEditorEnableWikitext' ) &&
|
||||
$user->getOption( 'visualeditor-newwikitext' )
|
||||
) {
|
||||
$parsed = wfParseUrl( wfExpandUrl( $editTab['href'] ) );
|
||||
$q = wfCgiToArray( $parsed['query'] );
|
||||
unset( $q['action'] );
|
||||
$q['veaction'] = 'editsource';
|
||||
$parsed['query'] = wfArrayToCgi( $q );
|
||||
$editTab['href'] = wfAssembleUrl( $parsed );
|
||||
}
|
||||
// Inject the VE tab before or after the edit tab
|
||||
if ( $config->get( 'VisualEditorTabPosition' ) === 'before' ) {
|
||||
$editTab['class'] .= ' collapsible';
|
||||
|
|
Loading…
Reference in a new issue