mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 09:43:30 +00:00
ESLint: Replace some lets with consts by moving declarations
Change-Id: I710bff5fe04268172a40af75eb6ff5910eaf0255
This commit is contained in:
parent
dda9227947
commit
44303de9cf
|
@ -1105,9 +1105,8 @@ Parser.prototype.buildThreads = function ( result ) {
|
|||
let lastHeading = null;
|
||||
const replies = [];
|
||||
|
||||
let i, threadItem;
|
||||
for ( i = 0; i < result.threadItems.length; i++ ) {
|
||||
threadItem = result.threadItems[ i ];
|
||||
for ( let i = 0; i < result.threadItems.length; i++ ) {
|
||||
const threadItem = result.threadItems[ i ];
|
||||
|
||||
if ( replies.length < threadItem.level ) {
|
||||
// Someone skipped an indentation level (or several). Pretend that the previous reply
|
||||
|
|
|
@ -40,13 +40,12 @@ DmMWPingNode.static.matchFunction = function () {
|
|||
DmMWPingNode.static.disallowedAnnotationTypes = [ 'link' ];
|
||||
|
||||
DmMWPingNode.static.toDomElements = function ( dataElement, doc, converter ) {
|
||||
let domElements,
|
||||
prefix = mw.msg( 'discussiontools-replywidget-mention-prefix' ),
|
||||
const prefix = mw.msg( 'discussiontools-replywidget-mention-prefix' ),
|
||||
suffix = mw.msg( 'discussiontools-replywidget-mention-suffix' ),
|
||||
title = mw.Title.makeTitle( mw.config.get( 'wgNamespaceIds' ).user, dataElement.attributes.user );
|
||||
|
||||
dataElement = ve.dm.MWInternalLinkAnnotation.static.dataElementFromTitle( title );
|
||||
domElements = ve.dm.MWInternalLinkAnnotation.static.toDomElements( dataElement, doc, converter );
|
||||
const domElements = ve.dm.MWInternalLinkAnnotation.static.toDomElements( dataElement, doc, converter );
|
||||
domElements[ 0 ].appendChild(
|
||||
doc.createTextNode( title.getMainText() )
|
||||
);
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
// Adapted from ve.ui.MWWikitextDataTransferHandlerFactory
|
||||
function importRegistry( parent, child ) {
|
||||
let name;
|
||||
// Copy existing items
|
||||
for ( name in parent.registry ) {
|
||||
for ( const name in parent.registry ) {
|
||||
child.register( parent.registry[ name ] );
|
||||
}
|
||||
// Copy any new items when they're added
|
||||
|
|
Loading…
Reference in a new issue