diff --git a/reply-link.js b/reply-link.js index cab51d1..76d214b 100644 --- a/reply-link.js +++ b/reply-link.js @@ -186,17 +186,6 @@ function loadReplyLink( $, mw ) { .replace( /([«‹])\xA0/g, "$1 " ); } - /** - * Remove duplicates from an array. - * https://stackoverflow.com/a/9229821/1757964 - */ - function removeDuplicates( array ) { - var seen = {}; - return array.filter( function( item ) { - return seen.hasOwnProperty( item ) ? false : ( seen[ item ] = true ); - } ); - } - /** * Capitalize the first letter of a string. */ @@ -212,13 +201,6 @@ function loadReplyLink( $, mw ) { return mw.config.get( "wgNamespaceIds" )[ nsName.toLowerCase().replace( / /g, "_" ) ]; } - /** - * Canonical-ize a namespace. - */ - function canonicalizeNs( ns ) { - return fmtNs( nsNameToId( ns ) ); - } - /** * This function converts any (index-able) iterable into a list. */ @@ -301,10 +283,6 @@ function loadReplyLink( $, mw ) { .replace( /(.*?)<\/span>/g, "$1" ); } - function wikitextHeaderEqualsDomHeader( wikitextHeader, domHeader ) { - return wikitextToTextContent( wikitextHeader ) === deArmorFrenchSpaces( domHeader ); - } - /** * Finds and returns the div that is the immediate parent of the * first talk page header on the page, so that we can read all the @@ -1858,9 +1836,7 @@ function loadReplyLink( $, mw ) { // This loop adds sigIdx entries in the metadata dictionary var sigIdxEls = iterableToList( mainContent.querySelectorAll( HEADER_SELECTOR + ",span.reply-link-wrapper a" ) ); - var currSigIdx = 0, j, numSigIdxEls, currHeaderEl, currHeaderData; - var headerIdx = 0; // index of the current header - var headerLvl = 0; // level of the current header + var currSigIdx = 0, j, numSigIdxEls, currHeaderEl; for( j = 0, numSigIdxEls = sigIdxEls.length; j < numSigIdxEls; j++ ) { var headerTagNameMatch = /^h(\d+)$/.exec( sigIdxEls[j].tagName.toLowerCase() );