Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae committed Apr 1, 2024
1 parent d478372 commit 4a466e0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions UserTalkErasedSectionsDetector.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ class ErasedSectionsDetector {
const totalRevisionCount = this.revisions.length;
this.addDiffsToRevisions();
this.filterForRevisionsByThisEditorOnly();
this.filterForNegativeDiffs();
this.filterOutArchiving();
this.addASpaceToBlankEditSummaries();
this.filterForContentRemoval();
this.filterOutReasonableEditSummaries();
this.expandBlankEditSummaries();
const negativeDiffCount = this.revisions.length;
if ( negativeDiffCount > 15 ) {
this.addHtml( negativeDiffCount, totalRevisionCount );
this.listenForShowDiffsClick();
}
this.listenForShowDiffsClick();
}

/**
* Add a message to blank edit summaries. This is so the hyperlink can be clicked.
*/
addASpaceToBlankEditSummaries() {
expandBlankEditSummaries() {
this.revisions = this.revisions.map( function ( revision ) {
if ( revision.comment === '' ) {
revision.comment = '[no edit summary]';
Expand Down Expand Up @@ -79,7 +79,7 @@ class ErasedSectionsDetector {
this.$( '#contentSub2' ).after( html );
}

filterForNegativeDiffs() {
filterForContentRemoval() {
this.revisions = this.revisions.filter( ( revision ) => revision.diff < 0 );
}

Expand All @@ -88,7 +88,7 @@ class ErasedSectionsDetector {
this.revisions = this.revisions.filter( ( revision ) => revision.user === thisEditor );
}

filterOutArchiving() {
filterOutReasonableEditSummaries() {
const keywordsToIgnore = [
'arch', // arch, archive, archiving, OneClickArchiver
'bot mes', // mesg, message
Expand Down

0 comments on commit 4a466e0

Please sign in to comment.