mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
(attempt to) make NWE work with SET
Ugh. Bug: T143578 Change-Id: I71e08508eb0914be9d624202b13a4369df512b80
This commit is contained in:
parent
98a42ad1a9
commit
edf5b60368
|
@ -764,7 +764,8 @@
|
|||
var showWikitextWelcome = true,
|
||||
isLoggedIn = !mw.user.isAnon(),
|
||||
prefSaysShowWelcome = isLoggedIn && !mw.user.options.get( 'visualeditor-hidebetawelcome' ),
|
||||
urlSaysHideWelcome = 'hidewelcomedialog' in new mw.Uri( location.href ).query;
|
||||
urlSaysHideWelcome = 'hidewelcomedialog' in new mw.Uri( location.href ).query,
|
||||
action = 'edit';
|
||||
|
||||
if ( uri.query.action === 'edit' && $( '#wpTextbox1' ).length ) {
|
||||
initialWikitext = $( '#wpTextbox1' ).textSelection( 'getContents' );
|
||||
|
@ -784,7 +785,7 @@
|
|||
// TODO: other params too? See identical list in VisualEditor.hooks.php)
|
||||
) {
|
||||
if (
|
||||
// … if on a ?veaction=edit page
|
||||
// … if on a ?veaction=edit/editsource page
|
||||
( isViewPage && uri.query.veaction in editModes ) ||
|
||||
// … or if on ?action=edit in single edit mode and the user wants it
|
||||
(
|
||||
|
@ -801,9 +802,20 @@
|
|||
tabPreference === 'prefer-ve' &&
|
||||
mw.config.get( 'wgAction' ) !== 'submit'
|
||||
) ||
|
||||
(
|
||||
tabPreference === 'prefer-wte' &&
|
||||
conf.enableWikitext &&
|
||||
mw.user.options.get( 'visualeditor-newwikitext' )
|
||||
) ||
|
||||
(
|
||||
tabPreference === 'remember-last' &&
|
||||
getLastEditor() !== 'wikitext'
|
||||
(
|
||||
getLastEditor() !== 'wikitext' ||
|
||||
(
|
||||
conf.enableWikitext &&
|
||||
mw.user.options.get( 'visualeditor-newwikitext' )
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -815,7 +827,24 @@
|
|||
type: uri.query.vesection === undefined ? 'page' : 'section',
|
||||
mechanism: 'url'
|
||||
} );
|
||||
activateTarget( editModes[ uri.query.veaction ] );
|
||||
if ( isViewPage && uri.query.veaction in editModes ) {
|
||||
activateTarget( editModes[ uri.query.veaction ] );
|
||||
} else {
|
||||
if (
|
||||
conf.enableWikitext &&
|
||||
mw.user.options.get( 'visualeditor-newwikitext' ) &&
|
||||
(
|
||||
tabPreference === 'prefer-ve' ||
|
||||
(
|
||||
tabPreference === 'remember-last' &&
|
||||
getLastEditor() === 'wikitext'
|
||||
)
|
||||
)
|
||||
) {
|
||||
action = 'editsource';
|
||||
}
|
||||
activateTarget( editModes[ action ] );
|
||||
}
|
||||
} else if ( pageCanLoadVE && userPrefEnabled ) {
|
||||
// Page can be edited in VE, parameters are good, user prefs are mostly good
|
||||
// but have visualeditor-tabs=prefer-wt? Add a keyboard shortcut to go to
|
||||
|
|
Loading…
Reference in a new issue