பயனர்:Shrikarsan/common.js: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
No edit summary
No edit summary
வரிசை 1:
mw.loader.using( 'mediawiki.util', function () {
var showNotice = function () {
// Stick a "Watchlist update!" notice after the notification count
$( "#pt-notifications" ).after(
$( "<li>" ).append( $( "<a>" )
.text( "Watchlist update!" )
.css( {
"background-color": "green",
"color": "white",
"border-radius": "2px",
"padding": "0.25em 0.45em 0.2em",
"cursor": "pointer",
"font-weight": "bold",
"transition": "background-color 0.5s"
} )
.attr( "href", "/wiki/Special:Watchlist" )
.mouseover( updateNotice )
)
.attr( "id", "watchlist-update-notice" )
);
};
var updateNotice = function() {
// Lighten the background color so the user knows we're updating
$( "#watchlist-update-notice a" ).css( "background-color", "#7bff7b" );
// Update the notice
$.getJSON(
mw.util.wikiScript( 'api' ),
{
format: "json",
action: "query",
list: "watchlist",
wlshow: "unread",
wllimit: 1 // Because we're checking if there are *any* entries
} ).done(function( data ) {
if( !data.query ) return;
if( data.query.watchlist.length ) {
// There are new watchlist diffs to read, so show notice
if( !$( "#watchlist-update-notice" ).length ) {
// That is, if it isn't shown already
showNotice();
} else {
// There's already a notice, so change background
$( "#watchlist-update-notice a" ).css( "background-color", "green" );
}
} else {
// No new watchlist diffs to read, so hide notice
$( "#watchlist-update-notice" ).remove();
}
}
);
};
$( document ).ready( function () {
updateNotice();
} );
} );
 
importScriptURI('//tools.wmflabs.org/imagemapedit/ime.js');
/**
"https://ta.wikiquote.org/wiki/பயனர்:Shrikarsan/common.js" இலிருந்து மீள்விக்கப்பட்டது