Skip to content

Commit

Permalink
show copyvio warning
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Nov 12, 2021
1 parent 0c98677 commit 2e643b3
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/modules/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1114,11 +1114,28 @@
return deferred;
}

function checkForCopyvio() {
return AFCH.api.get( {
action: 'pagetriagelist',
page_id: mw.config.get( 'wgArticleId' )
} ).then( function ( json ) {
var triageInfo = json.pagetriagelist.pages[ 0 ];
if ( triageInfo && triageInfo.copyvio === mw.config.get( 'wgCurRevisionId' ) ) {
addWarning( 'This submission may contain copyright violations', 'CopyPatrol', function () {
window.open( 'https://copypatrol.toolforge.org/en?filter=all&searchCriteria=page_exact&searchText=' +
encodeURIComponent( afchPage.rawTitle ) + '&drafts=1&revision=' +
mw.config.get( 'wgCurRevisionId' ), '_blank' );
} );
}
} );
}

$.when(
checkReferences(),
checkDeletionLog(),
checkReviewState(),
checkLongComments()
checkLongComments(),
checkForCopyvio()
).then( function () {
deferred.resolve( warnings );
} );
Expand Down

0 comments on commit 2e643b3

Please sign in to comment.