Alex Monk has uploaded a new change for review.
https://gerrit.wikimedia.org/r/312710
Change subject: When we have multiple tabs and NWE enabled, set the edit tab's
URL to NWE
......................................................................
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
---
M VisualEditor.hooks.php
1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/10/312710/1
diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 0d6dc14..5a170b6 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -330,6 +330,17 @@
$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';
--
To view, visit https://gerrit.wikimedia.org/r/312710
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I66d75d222cad2183beebd49759a35ee8d85969b2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits