mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-30 11:07:24 +00:00
Use Array#push instead of Array#concat
Change-Id: I605e726fce1cf1acf39ffdcfe8c7cd51c032a372
This commit is contained in:
parent
ea5639b20b
commit
177639f5be
|
@ -251,22 +251,24 @@ function getCheckboxesPromise( pageName, oldId ) {
|
||||||
* @return {string[]}
|
* @return {string[]}
|
||||||
*/
|
*/
|
||||||
function getReplyWidgetModules() {
|
function getReplyWidgetModules() {
|
||||||
const veConf = mw.config.get( 'wgVisualEditorConfig' );
|
const modules = [];
|
||||||
let modules = [ 'ext.discussionTools.ReplyWidget' ]
|
|
||||||
.concat( veConf.pluginModules.filter( mw.loader.getState ) );
|
|
||||||
|
|
||||||
if ( OO.ui.isMobile() ) {
|
if ( OO.ui.isMobile() ) {
|
||||||
modules = [
|
modules.push(
|
||||||
'ext.visualEditor.core.mobile',
|
'ext.visualEditor.core.mobile',
|
||||||
'ext.visualEditor.mwextensions'
|
'ext.visualEditor.mwextensions'
|
||||||
].concat( modules );
|
);
|
||||||
} else {
|
} else {
|
||||||
modules = [
|
modules.push(
|
||||||
'ext.visualEditor.core.desktop',
|
'ext.visualEditor.core.desktop',
|
||||||
'ext.visualEditor.desktopTarget',
|
'ext.visualEditor.desktopTarget',
|
||||||
'ext.visualEditor.mwextensions.desktop'
|
'ext.visualEditor.mwextensions.desktop'
|
||||||
].concat( modules );
|
);
|
||||||
}
|
}
|
||||||
|
modules.push( 'ext.discussionTools.ReplyWidget' );
|
||||||
|
|
||||||
|
const veConf = mw.config.get( 'wgVisualEditorConfig' );
|
||||||
|
modules.push( ...veConf.pluginModules.filter( mw.loader.getState ) );
|
||||||
|
|
||||||
return modules;
|
return modules;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ require( './CommentTarget.js' );
|
||||||
* @param {Object} [config] Configuration options
|
* @param {Object} [config] Configuration options
|
||||||
*/
|
*/
|
||||||
function CommentTargetWidget( replyWidget, config ) {
|
function CommentTargetWidget( replyWidget, config ) {
|
||||||
let excludeCommands = [
|
const excludeCommands = [
|
||||||
'blockquoteWrap', // T258194
|
'blockquoteWrap', // T258194
|
||||||
// Disable to allow Tab/Shift+Tab to move focus out of the widget (T172694)
|
// Disable to allow Tab/Shift+Tab to move focus out of the widget (T172694)
|
||||||
'indent',
|
'indent',
|
||||||
|
@ -26,7 +26,7 @@ function CommentTargetWidget( replyWidget, config ) {
|
||||||
];
|
];
|
||||||
|
|
||||||
if ( !replyWidget.isNewTopic ) {
|
if ( !replyWidget.isNewTopic ) {
|
||||||
excludeCommands = excludeCommands.concat( [
|
excludeCommands.push(
|
||||||
// Disable commands for things whose wikitext markup doesn't work when indented
|
// Disable commands for things whose wikitext markup doesn't work when indented
|
||||||
'heading1',
|
'heading1',
|
||||||
'heading2',
|
'heading2',
|
||||||
|
@ -37,10 +37,10 @@ function CommentTargetWidget( replyWidget, config ) {
|
||||||
'insertTable',
|
'insertTable',
|
||||||
'transclusionFromSequence', // T253667
|
'transclusionFromSequence', // T253667
|
||||||
'preformatted'
|
'preformatted'
|
||||||
] );
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
config = Object.assign( {}, {
|
config = Object.assign( {
|
||||||
excludeCommands: excludeCommands
|
excludeCommands: excludeCommands
|
||||||
}, config );
|
}, config );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue