dannys712/Copyvio-Check.js

This page is not available in other languages.

// Based on [[User:FR30799386/copyvio-check.js]] $(document).ready(function() { if ( mw.config.get('wgNamespaceNumber') !== 0 && mw.config.get('wgNamespaceNumber') !== 2 ) { return; } function runCheck() { var checkUrl = '//copyvios.toolforge.org/api.json?version=1&action=search&project=wikipedia&lang=en&title=' + encodeURIComponent(mw.config.get('wgTitle')); $.ajax(checkUrl).then(function(result) { if ((Math.round(result.best.confidence * 100)) < 50) { $('#copyvio-check-report').css('background', '#EFE'); } else if ((Math.round(result.best.confidence * 100)) > 50) { $('#copyvio-check-report').css('background', '#FEE'); } $('#copyvio-check-report').text('').append( document.createTextNode('Around ' + Math.round(result.best.confidence * 100).toString() + '% chance of being a copyvio ('), $('') .attr('id', 'copyvio-report-link') .attr('target', '_blank') .attr('href', '//copyvios.toolforge.org/?lang=en&project=wikipedia&title=' + encodeURIComponent(mw.config.get('wgTitle')) + '&oldid=&action=search&use_engine=1&use_links=1&turnitin=0&noredirect=true') .text('view details'), document.createTextNode(')') ); }); } var counter = 0; setInterval(function() { if ($('.mwe-pt-toolbar-big').length && !counter) { counter++; var $copyvioDisplay = $( '
' ) .attr( 'id', 'copyvio-check-report' ) .css( 'background', '#EFE' ) .css( 'padding', '0.5em' ); var $copyvioCheckTrigger = $( '' ) .attr( 'id', 'copyvio-check-trigger' ) .text( 'Check for copyvio' ); if( $('.redirectMsg').length ) { $copyvioDisplay.append( 'Redirects are not normally copyvios. ' ); $copyvioCheckTrigger.text( 'Check anyway' ); } $copyvioDisplay.append( $copyvioCheckTrigger ); $('#mwe-pt-info > div.mwe-pt-tool-flyout').append( $copyvioDisplay ); $copyvioCheckTrigger.on( 'click', function ( e ) { e.preventDefault(); $copyvioDisplay.css( 'background', '#e8e8e8' ) .text( 'Calculating copyvio percentage...' ); runCheck(); return false; } ); } }, 250); });

Tags:

🔥 Trending searches on Wiki English:

Shohei OhtaniPaul RuddMichael SchumacherClint EastwoodKendrick LamarThe Beekeeper (2024 film)ShyneLewis HamiltonCatherine, Princess of WalesMaundy (foot washing)Aditi Rao HydariJohn LennonHeinrich KlaasenSaudi ArabiaKurt CobainShōgun (novel)Mukhtar Ahmed Ansari50 CentChicago Fire (TV series)OnlyFansTom HollandLady GagaSouth KoreaThe First OmenTeri Baaton Mein Aisa Uljha JiyaIllit (group)Sydney SweeneySophie WillanPhilippinesRita OraHTTP 404Cherry blossomList of bridge failuresConor McGregorDebbie RoweList of Indian Premier League seasons and resultsRebecca HallThe Walking Dead (TV series)Gearbox SoftwareTaylor SwiftMarlo KellyMarcus GarveyLucian GraingeTupac ShakurNetherlandsGenghis KhanPremier LeagueX-Men '97Wiki FoundationRiyan ParagRegina KingKhabib NurmagomedovSam Bankman-FriedRúben AmorimCamila CabelloSri LankaFrank CaprioWorld War IIlia MalininThe Amanda ShowPakistanPablo EscobarSeptember 11 attacksThe Ten Commandments (1956 film)Peter principleHiroyuki SanadaList of Hindi films of 2024Solo LevelingAriana GrandeGoat DaysKinds of KindnessSobáSoviet UnionRobert HanssenConstellation (TV series)Sonam Wangchuk (engineer)GoogleNicola CoughlanJohn Wayne Gacy🡆 More