User:SlowPhoton/Script/BengaliRChecker.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
$(document).ready(function () {
/* Check in the title of the page */
var str = $("#firstHeading").text();
if (str.includes("র")) {
$("#firstHeading").css("color", "red");
mw.notify("এই পৃষ্ঠাৰ শিৰোনামত বঙালী ৰ লুকাই আছে। অনুগ্ৰহ কৰি প্ৰবন্ধটো সঠিক নামলৈ স্থানান্তৰ কৰক।", {type: "error", autoHide: false});
}
/* Check in the body of the page */
var bodytext = $(".mw-parser-output").text();
if (bodytext.includes("র")) {
mw.notify("এই পৃষ্ঠাটোত বঙালী ৰ লুকাই আছে। অনুগ্ৰহ কৰি সংলগ্ন 'লাচিত' সঁজুলিৰে সকলো বৰ্ণাশুদ্ধি নিবাৰণ কৰক।", {type: "error", autoHide: false});
}
/* Check in any supported list*/
tag1 = $(".mw-contributions-title");
$(tag1).each( function( index, element ){
if ($( this ).text().includes("র")) {
console.log( $( this ).text() );
$( this ).css("background-color", "red");
$( this ).css("color", "white");
}
});
tag2 = $(".mw-changeslist-line-inner-articleLink");
$(tag2).each( function( index, element ){
if ($( this ).text().includes("র")) {
console.log( $( this ).text() );
$( this ).css("background-color", "red");
$( this ).css("color", "white");
}
});
tag3 = $(".mw-redirect");
$(tag3).each( function( index, element ){
if ($( this ).text().includes("র")) {
console.log( $( this ).text() );
$( this ).css("background-color", "red");
$( this ).css("color", "white");
}
});
tag4 = $("a");
$(tag4).each( function( index, element ){
if ($( this ).text().includes("র")) {
console.log( $( this ).text() );
$( this ).css("background-color", "red");
$( this ).css("color", "white");
}
});
});