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:
Alex Monk 2016-09-24 23:38:52 +01:00
parent c0cf9c1e75
commit dd1e4cf8fb

View file

@ -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';