"மீடியாவிக்கி:Gadget-twinklefluff.js" பக்கத்தின் திருத்தங்களுக்கிடையேயான வேறுபாடு

6,280 பைட்டுகள் சேர்க்கப்பட்டது ,  2 மாதங்களுக்கு முன்
சி
Shanmugamp7 (Talk) பயனரால் செய்யப்பட்ட திருத்தம் 3107244 இல்லாது செய்யப்பட்டது
சி (மதனாஹரன்ஆல் செய்யப்பட்ட கடைசித் தொகுப்புக்கு முன்நிலையாக்கப்பட்டது)
சி (Shanmugamp7 (Talk) பயனரால் செய்யப்பட்ட திருத்தம் 3107244 இல்லாது செய்யப்பட்டது)
// <nowiki>
 
 
(function($) {
 
 
*** twinklefluff.js: Revert/rollback module
****************************************
* Mode of invocation: Links on historycontributions, contributionsrecent changes, history, and diff pages
* Active on: Diff pages, history pages, contributions pagesSpecial:RecentChanges(Linked),
and Special:Contributions
* Config directives in: TwinkleConfig
*/
 
*/
 
Twinkle.fluff = function twinklefluff() {
// Only proceed if the user can actually edit the page in question
auto: function() {
// (see #632 for contribs issue). wgIsProbablyEditable should take
if( parseInt( Morebits.queryString.get('oldid'), 10) !== mw.config.get('wgCurRevisionId') ) {
// care of namespace/contentModel restrictions as well as explicit
// not latest revision
// protections; it won't take care of cascading or TitleBlacklist.
alert("முன்னிலையாக்க முடியாது. இடைநேரத்தில் பக்கம் மாற்றப்பட்டுள்ளது.");
if (mw.config.get('wgIsProbablyEditable')) {
return;
// wgDiffOldId included for clarity in if else loop [[phab:T214985]]
if (mw.config.get('wgDiffNewId') || mw.config.get('wgDiffOldId')) {
// Reload alongside the revision slider
mw.hook('wikipage.diff').add(function () {
Twinkle.fluff.addLinks.diff();
});
} else if (mw.config.get('wgAction') === 'view' && mw.config.get('wgRevisionId') && mw.config.get('wgCurRevisionId') !== mw.config.get('wgRevisionId')) {
Twinkle.fluff.addLinks.oldid();
} else if (mw.config.get('wgAction') === 'history' && mw.config.get('wgArticleId')) {
Twinkle.fluff.addLinks.history();
}
} else if (mw.config.get('wgNamespaceNumber') === -1) {
Twinkle.fluff.skipTalk = !Twinkle.getPref('openTalkPageOnAutoRevert');
Twinkle.fluff.rollbackInPlace = Twinkle.getPref('rollbackInPlace');
 
if (mw.config.get('wgCanonicalSpecialPageName') === 'Contributions') {
var vandal = $("#mw-diff-ntitle2").find("a.mw-userlink").text();
Twinkle.fluff.addLinks.contributions();
} else if (mw.config.get('wgCanonicalSpecialPageName') === 'Recentchanges' || mw.config.get('wgCanonicalSpecialPageName') === 'Recentchangeslinked') {
// Reload with recent changes updates
// structuredChangeFilters.ui.initialized is just on load
mw.hook('wikipage.content').add(function(item) {
if (item.is('div')) {
Twinkle.fluff.addLinks.recentchanges();
}
});
}
}
};
 
// A list of usernames, usually only bots, that vandalism revert is jumped
// over; that is, if vandalism revert was chosen on such username, then its
// target is on the revision before. This is for handling quick bots that
// makes edits seconds after the original edit is made. This only affects
// vandalism rollback; for good faith rollback, it will stop, indicating a bot
// has no faith, and for normal rollback, it will rollback that edit.
Twinkle.fluff.trustedBots = ['AnomieBOT', 'SineBot', 'MajavahBot'];
Twinkle.fluff.skipTalk = null;
Twinkle.fluff.rollbackInPlace = null;
// String to insert when a username is hidden
Twinkle.fluff.hiddenName = 'an unknown user';
 
// Consolidated construction of fluff links
Twinkle.fluff.revert( Morebits.queryString.get( 'twinklerevert' ), vandal, true );
Twinkle.fluff.linkBuilder = {
spanTag: function(color, content) {
var span = document.createElement('span');
span.style.color = color;
span.appendChild(document.createTextNode(content));
return span;
},
normal: function() {
 
var spanTag = buildLink: function( color, content text) {
var spanlink = document.createElement( 'spana' );
link.appendChild(Twinkle.fluff.linkBuilder.spanTag('Black', '['));
span.style.color = color;
spanlink.appendChild( documentTwinkle.createTextNodefluff.linkBuilder.spanTag(color, content text) );
link.appendChild(Twinkle.fluff.linkBuilder.spanTag('Black', ']'));
return span;
link.href = '#';
};
return link;
},
 
/**
if( mw.config.get('wgNamespaceNumber') === -1 && mw.config.get('wgCanonicalSpecialPageName') === "பங்களிப்புகள்" ) {
* @param {string} [vandal=null] - Username of the editor being reverted
//Get the username these contributions are for
* Provide a falsey value if the username is hidden, defaults to null
var logLink = $('#contentSub').find('a[title^="Special:Log"]').last();
* @param {boolean} inline - True to create two links in a span, false
if (logLink.length>0) //#215 -- there is no log link on Special:Contributions with no user
* to create three links in a div (optional)
{
* @param {number|string} [rev=wgCurRevisionId] - Revision ID being reverted (optional)
var username = decodeURIComponent(/wiki\/Special:Log\/(.+)$/.exec(logLink.attr("href").replace(/_/g, "%20"))[1]);
* @param {string} [page=wgPageName] - Page being reverted (optional)
if( Twinkle.getPref('showRollbackLinks').indexOf('contribs') !== -1 ||
*/
( mw.config.get('wgUserName') !== username && Twinkle.getPref('showRollbackLinks').indexOf('others') !== -1 ) ||
rollbackLinks: function(vandal, inline, rev, page) {
( mw.config.get('wgUserName') === username && Twinkle.getPref('showRollbackLinks').indexOf('mine') !== -1 ) ) {
vandal = vandal || null;
var list = $("#mw-content-text").find("ul li:has(span.mw-uctop)");
 
var revNodeelem = document.createElement(inline ? 'span' : 'strongdiv');
var revLinkrevNode = document.createElement('a'elem);
revLink.appendChild( spanTag( 'Black', '[' ) );
revLink.appendChild( spanTag( 'SteelBlue', 'முன்னிலையாக்கு' ) );
revLink.appendChild( spanTag( 'Black', ']' ) );
revNode.appendChild(revLink);
 
rev = parseInt(rev, 10);
var revVandNode = document.createElement('strong');
if (rev) {
var revVandLink = document.createElement('a');
revVandLinkrevNode.appendChildsetAttribute( spanTag( 'Blackid', '[tw-revert' )+ rev);
revVandLink.appendChild( spanTag( 'Red', 'நாசவேலை' ) );
revVandLink.appendChild( spanTag( 'Black', ']' ) );
revVandNode.appendChild(revVandLink);
 
list.each(function(key, current) {
var href = $(current).children("a:eq(1)").attr("href");
current.appendChild( document.createTextNode(' ') );
var tmpNode = revNode.cloneNode( true );
tmpNode.firstChild.setAttribute( 'href', href + '&' + Morebits.queryString.create( { 'twinklerevert': 'norm' } ) );
current.appendChild( tmpNode );
current.appendChild( document.createTextNode(' ') );
tmpNode = revVandNode.cloneNode( true );
tmpNode.firstChild.setAttribute( 'href', href + '&' + Morebits.queryString.create( { 'twinklerevert': 'vand' } ) );
current.appendChild( tmpNode );
});
}
}
} else {
revNode.setAttribute('id', 'tw-revert');
}
 
var normNode = document.createElement('strong');
if( mw.config.get('wgCanonicalSpecialPageName') === "மீட்டெடு" ) {
var vandNode = document.createElement('strong');
//You can't rollback deleted pages!
return;
}
 
var normLink = Twinkle.fluff.linkBuilder.buildLink('SteelBlue', 'rollback');
var firstRev = $("div.firstrevisionheader").length;
var vandLink = Twinkle.fluff.linkBuilder.buildLink('Red', 'vandalism');
if( firstRev ) {
// we have first revision here, nothing to do.
return;
}
 
$(normLink).click(function() {
var otitle, ntitle;
Twinkle.fluff.revert('norm', vandal, rev, page);
try {
Twinkle.fluff.disableLinks(revNode);
var otitle1 = document.getElementById('mw-diff-otitle1');
});
var ntitle1 = document.getElementById('mw-diff-ntitle1');
$(vandLink).click(function() {
if (!otitle1 || !ntitle1) {
Twinkle.fluff.revert('vand', vandal, rev, page);
return;
Twinkle.fluff.disableLinks(revNode);
}
});
otitle = otitle1.parentNode;
ntitle = ntitle1.parentNode;
} catch( e ) {
// no old, nor new title, nothing to do really, return;
return;
}
 
vandNode.appendChild(vandLink);
var old_rev_url = $("#mw-diff-otitle1").find("strong a").attr("href");
normNode.appendChild(normLink);
 
var separator = inline ? ' ' : ' || ';
// Lets first add a [edit this revision] link
var query = new Morebits.queryString( old_rev_url.split( '?', 2 )[1] );
 
if (!inline) {
var oldrev = query.get('oldid');
var agfNode = document.createElement('strong');
var agfLink = Twinkle.fluff.linkBuilder.buildLink('DarkOliveGreen', 'rollback (AGF)');
$(agfLink).click(function() {
Twinkle.fluff.revert('agf', vandal, rev, page);
// Twinkle.fluff.disableLinks(revNode); // rollbackInPlace not relevant for any inline situations
});
agfNode.appendChild(agfLink);
revNode.appendChild(agfNode);
}
revNode.appendChild(document.createTextNode(separator));
revNode.appendChild(normNode);
revNode.appendChild(document.createTextNode(separator));
revNode.appendChild(vandNode);
 
return revNode;
var revertToRevision = document.createElement('div');
revertToRevision.setAttribute( 'id', 'tw-revert-to-orevision' );
revertToRevision.style.fontWeight = 'bold';
 
},
var revertToRevisionLink = revertToRevision.appendChild( document.createElement('a') );
revertToRevisionLink.href = "#";
$(revertToRevisionLink).click(function(){
Twinkle.fluff.revertToRevision(oldrev);
});
revertToRevisionLink.appendChild( spanTag( 'Black', '[' ) );
revertToRevisionLink.appendChild( spanTag( 'SaddleBrown', 'இப்பதிப்புக்கு மீளமை' ) );
revertToRevisionLink.appendChild( spanTag( 'Black', ']' ) );
 
// Build [restore this revision] links
otitle.insertBefore( revertToRevision, otitle.firstChild );
restoreThisRevisionLink: function(revisionRef, inline) {
// If not a specific revision number, should be wgDiffNewId/wgDiffOldId/wgRevisionId
revisionRef = typeof revisionRef === 'number' ? revisionRef : mw.config.get(revisionRef);
 
var elem = inline ? 'span' : 'div';
if( document.getElementById('differences-nextlink') ) {
var revertToRevisionNode = document.createElement(elem);
// Not latest revision
var new_rev_url = $("#mw-diff-ntitle1").find("strong a").attr("href");
query = new Morebits.queryString( new_rev_url.split( '?', 2 )[1] );
var newrev = query.get('oldid');
revertToRevision = document.createElement('div');
revertToRevision.setAttribute( 'id', 'tw-revert-to-nrevision' );
revertToRevision.style.fontWeight = 'bold';
revertToRevisionLink = revertToRevision.appendChild( document.createElement('a') );
revertToRevisionLink.href = "#";
$(revertToRevisionLink).click(function(){
Twinkle.fluff.revertToRevision(newrev);
});
revertToRevisionLink.appendChild( spanTag( 'Black', '[' ) );
revertToRevisionLink.appendChild( spanTag( 'SaddleBrown', 'இப்பதிப்புக்கு மீளமை' ) );
revertToRevisionLink.appendChild( spanTag( 'Black', ']' ) );
ntitle.insertBefore( revertToRevision, ntitle.firstChild );
 
revertToRevisionNode.setAttribute('id', 'tw-revert-to-' + revisionRef);
return;
revertToRevisionNode.style.fontWeight = 'bold';
}
if( Twinkle.getPref('showRollbackLinks').indexOf('diff') !== -1 ) {
var vandal = $("#mw-diff-ntitle2").find("a").first().text();
 
var revertToRevisionLink = Twinkle.fluff.linkBuilder.buildLink('SaddleBrown', 'restore this version');
var revertNode = document.createElement('div');
$(revertToRevisionLink).click(function() {
revertNode.setAttribute( 'id', 'tw-revert' );
Twinkle.fluff.revertToRevision(revisionRef);
});
 
if (inline) {
var agfNode = document.createElement('strong');
var vandNode = revertToRevisionNode.appendChild(document.createElementcreateTextNode('strong '));
}
var normNode = document.createElement('strong');
revertToRevisionNode.appendChild(revertToRevisionLink);
return revertToRevisionNode;
}
};
 
 
Twinkle.fluff.addLinks = {
contributions: function() {
// $('sp-contributions-footer-anon-range') relies on the fmbox
// id in [[MediaWiki:Sp-contributions-footer-anon-range]] and
// is used to show rollback/vandalism links for IP ranges
var isRange = !!$('#sp-contributions-footer-anon-range')[0];
if (mw.config.exists('wgRelevantUserName') || isRange) {
// Get the username these contributions are for
var username = mw.config.get('wgRelevantUserName');
if (Twinkle.getPref('showRollbackLinks').indexOf('contribs') !== -1 ||
(mw.config.get('wgUserName') !== username && Twinkle.getPref('showRollbackLinks').indexOf('others') !== -1) ||
(mw.config.get('wgUserName') === username && Twinkle.getPref('showRollbackLinks').indexOf('mine') !== -1)) {
var $list = $('#mw-content-text').find('ul li:has(span.mw-uctop):has(.mw-changeslist-diff)');
 
$list.each(function(key, current) {
// revid is also available in the href of both
// .mw-changeslist-date or .mw-changeslist-diff
var page = $(current).find('.mw-contributions-title').text();
 
// Get username for IP ranges (wgRelevantUserName is null)
var agfLink = document.createElement('a');
if (isRange) {
var vandLink = document.createElement('a');
// The :not is possibly unnecessary, as it appears that
var normLink = document.createElement('a');
// .mw-userlink is simply not present if the username is hidden
username = $(current).find('.mw-userlink:not(.history-deleted)').text();
}
 
// It's unlikely, but we can't easily check for revdel'd usernames
agfLink.href = "#";
// since only a strong element is provided, with no easy selector [[phab:T255903]]
vandLink.href = "#";
current.appendChild(Twinkle.fluff.linkBuilder.rollbackLinks(username, true, current.dataset.mwRevid, page));
normLink.href = "#";
$(agfLink).click(function(){
Twinkle.fluff.revert('agf', vandal);
});
$(vandLink).click(function(){
Twinkle.fluff.revert('vand', vandal);
});
$(normLink).click(function(){
Twinkle.fluff.revert('norm', vandal);
});
}
}
},
 
recentchanges: function() {
agfLink.appendChild( spanTag( 'Black', '[' ) );
if (Twinkle.getPref('showRollbackLinks').indexOf('recent') !== -1) {
agfLink.appendChild( spanTag( 'DarkOliveGreen', 'முன்னிலையாக்கு (ந. ந.)' ) );
// Latest and revertable (not page creations, logs, categorizations, etc.)
agfLink.appendChild( spanTag( 'Black', ']' ) );
var $list = $('.mw-changeslist .mw-changeslist-last.mw-changeslist-src-mw-edit');
// Exclude top-level header if "group changes" preference is used
// and find only individual lines or nested lines
$list = $list.not('.mw-rcfilters-ui-highlights-enhanced-toplevel').find('.mw-changeslist-line-inner, td.mw-enhanced-rc-nested');
 
$list.each(function(key, current) {
vandLink.appendChild( spanTag( 'Black', '[' ) );
// The :not is possibly unnecessary, as it appears that
vandLink.appendChild( spanTag( 'Red', 'முன்னிலையாக்கு (நாசவேலை)' ) );
// .mw-userlink is simply not present if the username is hidden
vandLink.appendChild( spanTag( 'Black', ']' ) );
var vandal = $(current).find('.mw-userlink:not(.history-deleted)').text();
var href = $(current).find('.mw-changeslist-diff').attr('href');
var rev = mw.util.getParamValue('diff', href);
var page = current.dataset.targetPage;
current.appendChild(Twinkle.fluff.linkBuilder.rollbackLinks(vandal, true, rev, page));
});
}
},
 
history: function() {
normLink.appendChild( spanTag( 'Black', '[' ) );
if (Twinkle.getPref('showRollbackLinks').indexOf('history') !== -1) {
normLink.appendChild( spanTag( 'SteelBlue', 'முன்னிலையாக்கு' ) );
// All revs
normLink.appendChild( spanTag( 'Black', ']' ) );
var histList = $('#pagehistory li').toArray();
 
// On first page of results, so add revert/rollback
agfNode.appendChild(agfLink);
// links to the top revision
vandNode.appendChild(vandLink);
if (!$('.mw-firstlink').length) {
normNode.appendChild(normLink);
var first = histList.shift();
var vandal = $(first).find('.mw-userlink:not(.history-deleted)').text();
 
// Check for first username different than the top user,
revertNode.appendChild( agfNode );
// only apply rollback links if/when found
revertNode.appendChild( document.createTextNode(' || ') );
// for faster than every
revertNode.appendChild( normNode );
for (var i = 0; i < histList.length; i++) {
revertNode.appendChild( document.createTextNode(' || ') );
if ($(histList[i]).find('.mw-userlink').text() !== vandal) {
revertNode.appendChild( vandNode );
first.appendChild(Twinkle.fluff.linkBuilder.rollbackLinks(vandal, true));
break;
}
}
}
 
// oldid
ntitle.insertBefore( revertNode, ntitle.firstChild );
histList.forEach(function(rev) {
// From restoreThisRevision, non-transferable
// If the text has been revdel'd, it gets wrapped in a span with .history-deleted,
// and href will be undefined (and thus oldid is NaN)
var href = rev.querySelector('.mw-changeslist-date').href;
var oldid = parseInt(mw.util.getParamValue('oldid', href), 10);
if (!isNaN(oldid)) {
rev.appendChild(Twinkle.fluff.linkBuilder.restoreThisRevisionLink(oldid, true));
}
});
 
 
}
},
 
diff: function() {
// Autofill user talk links on diffs with vanarticle for easy warning, but don't autowarn
var warnFromTalk = function(xtitle) {
var talkLink = $('#mw-diff-' + xtitle + '2 .mw-usertoollinks a').first();
if (talkLink.length) {
var extraParams = 'vanarticle=' + mw.util.rawurlencode(Morebits.pageNameNorm) + '&' + 'noautowarn=true';
// diffIDs for vanarticlerevid
extraParams += '&vanarticlerevid=';
extraParams += xtitle === 'otitle' ? mw.config.get('wgDiffOldId') : mw.config.get('wgDiffNewId');
 
var href = talkLink.attr('href');
if (href.indexOf('?') === -1) {
talkLink.attr('href', href + '?' + extraParams);
} else {
talkLink.attr('href', href + '&' + extraParams);
}
}
};
 
// Older revision
warnFromTalk('otitle'); // Add quick-warn link to user talk link
// Don't load if there's a single revision or weird diff (cur on latest)
if (mw.config.get('wgDiffOldId') && (mw.config.get('wgDiffOldId') !== mw.config.get('wgDiffNewId'))) {
// Add a [restore this revision] link to the older revision
var oldTitle = document.getElementById('mw-diff-otitle1').parentNode;
oldTitle.insertBefore(Twinkle.fluff.linkBuilder.restoreThisRevisionLink('wgDiffOldId'), oldTitle.firstChild);
}
 
// Newer revision
warnFromTalk('ntitle'); // Add quick-warn link to user talk link
// Add either restore or rollback links to the newer revision
// Don't show if there's a single revision or weird diff (prev on first)
if (document.getElementById('differences-nextlink')) {
// Not latest revision, add [restore this revision] link to newer revision
var newTitle = document.getElementById('mw-diff-ntitle1').parentNode;
newTitle.insertBefore(Twinkle.fluff.linkBuilder.restoreThisRevisionLink('wgDiffNewId'), newTitle.firstChild);
} else if (Twinkle.getPref('showRollbackLinks').indexOf('diff') !== -1 && mw.config.get('wgDiffOldId') && (mw.config.get('wgDiffOldId') !== mw.config.get('wgDiffNewId') || document.getElementById('differences-prevlink'))) {
// Normally .mw-userlink is a link, but if the
// username is hidden, it will be a span with
// .history-deleted as well. When a sysop views the
// hidden content, the span contains the username in a
// link element, which will *just* have
// .mw-userlink. The below thus finds the first
// instance of the class, which if hidden is the span
// and thus text returns undefined. Technically, this
// is a place where sysops *could* have more
// information available to them (as above, via
// &unhide=1), since the username will be available by
// checking a.mw-userlink instead, but revert() will
// need reworking around userHidden
var vandal = $('#mw-diff-ntitle2').find('.mw-userlink')[0].text;
var ntitle = document.getElementById('mw-diff-ntitle1').parentNode;
 
ntitle.insertBefore(Twinkle.fluff.linkBuilder.rollbackLinks(vandal), ntitle.firstChild);
}
},
 
oldid: function() { // Add a [restore this revision] link on old revisions
var title = document.getElementById('mw-revision-info').parentNode;
title.insertBefore(Twinkle.fluff.linkBuilder.restoreThisRevisionLink('wgRevisionId'), title.firstChild);
}
};
 
Twinkle.fluff.revertdisableLinks = function revertPagedisablelinks( type, vandal, autoRevert, rev, page parentNode) {
// Array.from not available in IE11 :(
$(parentNode).children().each(function(_ix, node) {
node.innerHTML = node.textContent; // Feels like cheating
$(node).css('font-weight', 'normal').css('color', 'darkgray');
});
};
 
 
Twinkle.fluff.revert = function revertPage(type, vandal, rev, page) {
if (mw.util.isIPv6Address(vandal)) {
vandal = Morebits.sanitizeIPv6(vandal);
var revid = rev || mw.config.get('wgCurRevisionId');
 
if (Twinkle.fluff.rollbackInPlace) {
Morebits.status.init( document.getElementById('mw-content-text') );
var notifyStatus = document.createElement('span');
$( '#catlinks' ).remove();
mw.notify(notifyStatus, {
autoHide: false,
title: 'Rollback on ' + page,
tag: 'twinklefluff_' + rev // Shouldn't be necessary given disableLink
});
Morebits.status.init(notifyStatus);
} else {
Morebits.status.init(document.getElementById('mw-content-text'));
$('#catlinks').remove();
}
 
var params = {
type: type,
user: vandal,
userHidden: !vandal, // Keep track of whether the username was hidden
pagename: pagename,
revid: revid,
autoRevert: !!autoRevert
};
 
var query = {
'action': 'query',
'prop': ['info', 'revisions', 'flagged'],
'titles': pagename,
inprop: 'watched',
'rvlimit': 50, // max possible
intestactions: 'edit',
'rvprop': [ 'ids', 'timestamp', 'user', 'comment' ],
rvlimit: Twinkle.getPref('revertMaxRevisions'),
'intoken': 'edit'
rvprop: [ 'ids', 'timestamp', 'user' ],
curtimestamp: '',
meta: 'tokens',
type: 'csrf',
format: 'json'
};
var wikipedia_api = new Morebits.wiki.api( 'முந்தியGrabbing பதிப்புகளிலிருந்துdata தரவுகளைத்of திரட்டுகின்றதுearlier revisions', query, Twinkle.fluff.callbacks.main );
wikipedia_api.params = params;
wikipedia_api.post();
};
 
Twinkle.fluff.revertToRevision = function revertToRevision( oldrev ) {
 
Morebits.status.init( document.getElementById('mw-content-text') );
 
var query = {
'action': 'query',
'prop': ['info', 'revisions'],
'titles': mw.config.get('wgPageName'),
'rvlimit'inprop: 1'watched',
'rvstartid'rvlimit: oldrev1,
rvstartid: oldrev,
'rvprop': [ 'ids', 'timestamp', 'user', 'comment' ],
rvprop: [ 'intokenids':, 'edituser' ],
'format'curtimestamp: 'xml',
meta: 'tokens',
type: 'csrf',
format: 'json'
};
var wikipedia_api = new Morebits.wiki.api( 'முந்தியGrabbing பதிப்பிலிருந்துdata தரவுகளைத்of திரட்டுகின்றதுthe earlier revision', query, Twinkle.fluff.callbacks.toRevision.main );
wikipedia_api.params = { rev: oldrev };
wikipedia_api.post();
};
 
Twinkle.fluff.userIpLink = function( user ) {
return (Morebits.isIPAddress(user) ? "[[Special:Contributions/" : "[[User:" ) + user + "|" + user + "]]";
};
 
Twinkle.fluff.callbacks = {
toRevision: function(apiobj) {
var response = apiobj.getResponse();
main: function( self ) {
var xmlDoc = self.responseXML;
 
var loadtimestamp = response.curtimestamp;
var lastrevid = parseInt( $(xmlDoc).find('page').attr('lastrevid'), 10);
var touchedcsrftoken = $(xmlDoc)response.find('page')query.attr('touched')tokens.csrftoken;
var starttimestamp = $(xmlDoc).find('page').attr('starttimestamp');
var edittoken = $(xmlDoc).find('page').attr('edittoken');
var revertToRevID = $(xmlDoc).find('rev').attr('revid');
var revertToUser = $(xmlDoc).find('rev').attr('user');
 
var page = response.query.pages[0];
if (revertToRevID !== self.params.rev) {
var lastrevid = parseInt(page.lastrevid, 10);
self.statitem.error( 'மீட்டெடுத்த பதிப்பு, கோரிய பதிப்புடன் பொருந்தவில்லை. கைவிடுகின்றது.' );
var touched = page.touched;
return;
}
 
var rev = page.revisions[0];
var optional_summary = prompt( "அருள்கூர்ந்து மீளமைத்தலுக்கு ஒரு காரணத்தைக் குறிப்பிடவும்: ", "" ); // padded out to widen prompt in Firefox
var revertToRevID = parseInt(rev.revid, 10);
if (optional_summary === null)
var revertToUser = rev.user;
{
var revertToUserHidden = !!rev.userhidden;
self.statelem.error( 'Aborted by user.' );
return;
}
var summary = Twinkle.fluff.formatSummary("பின்வரும் பதிப்புக்கு மீளமைக்கப்பட்டது: " + revertToRevID + " $USER உடையது", revertToUser, optional_summary);
 
if (revertToRevID !== apiobj.params.rev) {
var query = {
apiobj.statelem.error('The retrieved revision does not match the requested revision. Stopping revert.');
'action': 'edit',
return;
'title': mw.config.get('wgPageName'),
}
'summary': summary,
'token': edittoken,
'undo': lastrevid,
'undoafter': revertToRevID,
'basetimestamp': touched,
'starttimestamp': starttimestamp,
'watchlist': Twinkle.getPref('watchRevertedPages').indexOf( self.params.type ) !== -1 ? 'watch' : undefined,
'minor': Twinkle.getPref('markRevertedPagesAsMinor').indexOf( self.params.type ) !== -1 ? true : undefined
};
 
var optional_summary = prompt('Please specify a reason for the revert: ', ''); // padded out to widen prompt in Firefox
Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName');
if (optional_summary === null) {
Morebits.wiki.actionCompleted.notice = "மீளமைத்தல் நிறைவு";
apiobj.statelem.error('Aborted by user.');
return;
}
 
var summary = Twinkle.fluff.formatSummary('Restored revision ' + revertToRevID + ' by $USER',
var wikipedia_api = new Morebits.wiki.api( 'மீளமைத்த உள்ளடக்கங்களைச் சேமிக்கின்றது.', query, Twinkle.fluff.callbacks.complete, self.statelem);
revertToUserHidden ? null : revertToUser, optional_summary);
wikipedia_api.params = self.params;
wikipedia_api.post();
 
var query = {
action: 'edit',
title: mw.config.get('wgPageName'),
summary: summary,
tags: Twinkle.changeTags,
token: csrftoken,
undo: lastrevid,
undoafter: revertToRevID,
basetimestamp: touched,
starttimestamp: loadtimestamp,
minor: Twinkle.getPref('markRevertedPagesAsMinor').indexOf('torev') !== -1 ? true : undefined,
format: 'json'
};
// Handle watching, possible expiry
if (Twinkle.getPref('watchRevertedPages').indexOf('torev') !== -1) {
var watchOrExpiry = Twinkle.getPref('watchRevertedExpiry');
 
if (!watchOrExpiry || watchOrExpiry === 'no') {
query.watchlist = 'nochange';
} else if (watchOrExpiry === 'default' || watchOrExpiry === 'preferences') {
query.watchlist = 'preferences';
} else {
query.watchlist = 'watch';
// number allowed but not used in Twinkle.config.watchlistEnums
if ((!page.watched || page.watchlistexpiry) && typeof watchOrExpiry === 'string' && watchOrExpiry !== 'yes') {
query.watchlistexpiry = watchOrExpiry;
}
}
}
 
Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName');
Morebits.wiki.actionCompleted.notice = 'Reversion completed';
 
var wikipedia_api = new Morebits.wiki.api('Saving reverted contents', query, Twinkle.fluff.callbacks.complete, apiobj.statelem);
wikipedia_api.params = apiobj.params;
wikipedia_api.post();
},
main: function( self apiobj) {
var xmlDocresponse = selfapiobj.responseXMLgetResponse();
 
var loadtimestamp = response.curtimestamp;
var lastrevid = parseInt( $(xmlDoc).find('page').attr('lastrevid'), 10);
var touchedcsrftoken = $(xmlDoc)response.find('page')query.attr('touched')tokens.csrftoken;
var starttimestamp = $(xmlDoc).find('page').attr('starttimestamp');
var edittoken = $(xmlDoc).find('page').attr('edittoken');
var lastuser = $(xmlDoc).find('rev').attr('user');
 
var revspage = $(xmlDoc)response.find('rev')query.pages[0];
if (!page.actions.edit) {
apiobj.statelem.error("Unable to edit the page, it's probably protected.");
return;
}
 
var lastrevid = parseInt(page.lastrevid, 10);
var touched = page.touched;
 
var revs = page.revisions;
 
var statelem = apiobj.statelem;
var params = apiobj.params;
 
if ( revs.length < 1 ) {
statelem.error('We have less than one additional revision, thus impossible to revert.');
self.statelem.error( 'ஒரு மேலதிகப் பதிப்பை விடக் குறைவாகவுள்ளது. எனவே, மீளமைக்கமுடியாது.' );
return;
}
var top = revs[0];
var lastuser = top.user;
if( lastrevid < self.params.revid ) {
 
Morebits.status.error( 'Error', [ 'வழங்கியிருந்து பெற்ற அண்மைய பதிப்பு அடையாள இலக்கமானது, ', Morebits.htmlNode( 'strong', lastrevid ), ', காண்பிக்கப்பட்டுள்ள பதிப்பின் அடையாள இலக்கத்திலும் குறைவானது. இது தற்போதைய பதிப்பு அழிக்கப்பட்டிருப்பதையோ வழங்கி சுணங்குவதையோ கெட்ட தரவுகள் பெறப்பட்டதையோ குறிக்கும். இந்நிலையில் நிறுத்துகின்றோம்.' ] );
if (lastrevid < params.revid) {
Morebits.status.error('Error', [ 'The most recent revision ID received from the server, ', Morebits.htmlNode('strong', lastrevid), ', is less than the ID of the displayed revision. This could indicate that the current revision has been deleted, the server is lagging, or that bad data has been received. Stopping revert.' ]);
return;
}
 
// Used for user-facing alerts, messages, etc., not edits or summaries
var userNorm = params.user || Twinkle.fluff.hiddenName;
var index = 1;
if ( self.params.revid !== lastrevid ) {
Morebits.status.warn( 'Warning', [ 'Latest revision ', Morebits.htmlNode( 'strong', lastrevid ), ' doesn\'t equal our revision ', Morebits.htmlNode( 'strong', self.params.revid ) ] );
if ( lastuser === self.params.user ) {
switch ( self.params.type ) {
case 'vand':
Morebits.status.info( 'Info', [ 'Latest revision was made by ', Morebits.htmlNode( 'strong', self.params.user userNorm) , '. As we assume vandalism, we continuewill proceed to revert.' ]);
break;
case 'agf':
Morebits.status.warn( 'Warning', [ 'Latest revision was made by ', Morebits.htmlNode( 'strong', self.params.user userNorm) , '. As we assume good faith, we will stop revertingthe revert, as the problem might have been fixed.' ]);
return;
default:
Morebits.status.warn( 'Notice', [ 'Latest revision was made by ', Morebits.htmlNode( 'strong', self.params.user userNorm) , ', but we will stop revertingthe anywayrevert.' ] );
return;
}
} else if (params.type === 'vand' &&
}
// Okay to test on user since it will either fail or sysop will correctly access it
else if(self.params.type === 'vand' &&
// Besides, none of the trusted bots are going to be revdel'd
Twinkle.fluff.whiteList.indexOf( top.getAttribute( 'user' ) ) !== -1 && revs.length > 1 &&
Twinkle.fluff.trustedBots.indexOf(top.user) !== -1 && revs.length > 1 &&
revs[1].getAttribute( 'pageId' ) === self.params.revid) {
revs[1].revid === params.revid) {
Morebits.status.info( 'Info', [ 'Latest revision was made by ', Morebits.htmlNode( 'strong', lastuser ), ', a trusted bot, and the revision before was made by our vandal, so we proceed with the revert.' ] );
Morebits.status.info('Info', [ 'Latest revision was made by ', Morebits.htmlNode('strong', lastuser), ', a trusted bot, and the revision before was made by our vandal, so we will proceed with the revert.' ]);
index = 2;
} else {
Morebits.status.error( 'Error', [ 'Latest revision was made by ', Morebits.htmlNode( 'strong', lastuser ), ', so it might have already been reverted, stoppingwe will revertingstop the revert.'] );
return;
}
 
} else {
// Expected revision is the same, so the users must match;
// this allows sysops to know whether the users are the same
params.user = lastuser;
userNorm = params.user || Twinkle.fluff.hiddenName;
}
 
if( (Twinkle.fluff.whiteListtrustedBots.indexOf( self.params.user ) !== -1 ) {
switch ( self.params.type ) {
case 'vand':
Morebits.status.info( 'Info', [ 'Vandalism revert was chosen on ', Morebits.htmlNode( 'strong', self.params.user userNorm), '. As this is a whitelistedtrusted bot, we assume you wanted to revert vandalism made by the previous user instead.' ] );
index = 2;
self. params.user = revs[1].getAttribute( 'user' );
params.userHidden = !!revs[1].userhidden;
break;
case 'agf': break;
case 'agf':
Morebits.status.warn( 'Notice', [ 'Good faith revert was chosen on ', Morebits.htmlNode( 'strong', self.params.user ), '. This is a whitelisted bot, and since bots have no faith, AGF rollback will not proceed.' ] );
Morebits.status.warn('Notice', [ 'Good faith revert was chosen on ', Morebits.htmlNode('strong', userNorm), '. This is a trusted bot and thus AGF rollback will not proceed.' ]);
return;
return;
case 'norm':
case 'norm':
/* falls through */
default:
var cont = confirm( 'Normal revert was chosen, but the most recent edit was made by a whitelistedtrusted bot (' + self.params.useruserNorm + '). Do you want to revert the revision before instead?' );
if ( cont ) {
Morebits.status.info( 'Info', [ 'Normal revert was chosen on ', Morebits.htmlNode( 'strong', self.params.user userNorm), '. This is a whitelistedtrusted bot, and per confirmation, we\'ll revert the previous revision instead.' ] );
index = 2;
self. params.user = revs[1].getAttribute( 'user' );
params.userHidden = !!revs[1].userhidden;
} else {
userNorm = params.user || Twinkle.fluff.hiddenName;
Morebits.status.warn( 'Notice', [ 'Normal revert was chosen on ', Morebits.htmlNode( 'strong', self.params.user ), '. This is a whitelisted bot, but per confirmation, revert on top revision will proceed.' ] );
} else {
Morebits.status.warn('Notice', [ 'Normal revert was chosen on ', Morebits.htmlNode('strong', userNorm), '. This is a trusted bot, but per confirmation, revert on selected revision will proceed.' ]);
break;
}
break;
}
}
var count = 0;
 
for( (var i = index; i < revs.length; ++i ) {
++count;
if ( revs[i].getAttribute( 'user' ) !== self.params.user ) {
found = i;
break;
}
 
if ( ! found ) {
self.statelem.error( [ 'No previous revision found. Perhaps ', Morebits.htmlNode( 'strong', self.params.user userNorm), ' is the only contributor, or that the user has made more than ' + mw.language.convertNumber(Twinkle.getPref('revertMaxRevisions')) + ' edits in a row.' ] );
return;
}
 
if ( ! count ) {
Morebits.status.error( 'Error', "We'As wereit is not possible to revert zero revisions. As that makes no sense, we'll will stop reverting this timerevert. It could be that the edit has already been reverted, but the revision ID was still the same." ');
return;
}
 
var good_revision = revs[ found ];
var userHasAlreadyConfirmedAction = false;
if (self.params.type !== 'vand' && count > 1) {
if ( !confirm( self.params.useruserNorm + ' has made ' + mw.language.convertNumber(count) + ' edits in a row. Are you sure you want to revert them all?') ) {
Morebits.status.info( 'Notice', 'Stopping reverting per user inputrevert.' );
return;
}
}
 
self.params.count = count;
 
self.params.goodid = good_revision.getAttribute( 'revid' );
self.params.gooduser = good_revision.getAttribute( 'user' );
params.gooduserHidden = !!good_revision.userhidden;
 
self.statelem.status( [ ' revision ', Morebits.htmlNode( 'strong', self.params.goodid ), ' that was made ', Morebits.htmlNode( 'strong', mw.language.convertNumber(count )), ' revisions ago by ', Morebits.htmlNode( 'strong', selfparams.gooduserHidden ? Twinkle.fluff.hiddenName : params.gooduser ) ] );
 
var summary, extra_summary;
switch ( self.params.type ) {
case 'agf':
extra_summary = prompt( "'An optional comment for the edit summary: "', "" ''); // padded out to widen prompt in Firefox
if (extra_summary === null) {
statelem.error('Aborted by user.');
{
return;
self.statelem.error( 'Aborted by user.' );
return;}
userHasAlreadyConfirmedAction = true;
}
userHasAlreadyConfirmedAction = true;
 
summary = Twinkle.fluff.formatSummary("'Reverted [[WP:AGF|good faith]] edits by $USER"', self.params.user, extra_summary);
params.userHidden ? null : params.user, extra_summary);
break;
break;
 
case 'vand':
summary = Twinkle.fluff.formatSummary('Reverted ' + params.count + (params.count > 1 ? ' edits' : ' edit') + ' by $USER to last revision by ' +
 
(params.gooduserHidden ? Twinkle.fluff.hiddenName : params.gooduser), params.userHidden ? null : params.user);
summary = "Reverted " + self.params.count + (self.params.count > 1 ? ' edits' : ' edit') + " by [[Special:Contributions/" +
break;
self.params.user + "|" + self.params.user + "]] ([[User talk:" + self.params.user + "|talk]]) to last revision by " +
self.params.gooduser + "." + Twinkle.getPref('summaryAd');
break;
 
case 'norm':
/* falls through */
default:
if ( Twinkle.getPref('offerReasonOnNormalRevert') ) {
extra_summary = prompt( "'An optional comment for the edit summary: "', "" ''); // padded out to widen prompt in Firefox
if (extra_summary === null) {
statelem.error('Aborted by user.');
{
return;
self.statelem.error( 'Aborted by user.' );
return;}
userHasAlreadyConfirmedAction = true;
}
userHasAlreadyConfirmedAction = true;
}
 
summary = Twinkle.fluff.formatSummary("'Reverted "' + self.params.count + (self.params.count > 1 ? ' edits' : ' edit') + ' by $USER',
" params.userHidden by? $USER",null : self.params.user, extra_summary);
break;
}
 
if ((Twinkle.getPref('confirmOnFluff') && !userHasAlreadyConfirmedAction && !confirm("Reverting page: are you sure?")) {||
// Mobile user agent taken from [[en:MediaWiki:Gadget-confirmationRollback-mobile.js]]
self.statelem.error( 'Aborted by user.' );
(Twinkle.getPref('confirmOnMobileFluff') && /Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|Opera Mini/i.test(navigator.userAgent))) &&
!userHasAlreadyConfirmedAction && !confirm('Reverting page: are you sure?')) {
statelem.error('Aborted by user.');
return;
}
 
// Decide whether to notify the user on success
var query;
if( (!selfTwinkle.paramsfluff.autoRevertskipTalk ||&& Twinkle.getPref('openTalkPageOnAutoRevertopenTalkPage').indexOf(params.type) !== -1 &&
!params.userHidden && mw.config.get('wgUserName') !== params.user) {
Twinkle.getPref('openTalkPage').indexOf( self.params.type ) !== -1 &&
params.notifyUser = true;
mw.config.get('wgUserName') !== self.params.user ) {
// Pass along to the warn module
Morebits.status.info( 'Info', [ 'Opening user talk page edit form for user ', Morebits.htmlNode( 'strong', self.params.user ) ] );
params.vantimestamp = top.timestamp;
 
query = {
'title': 'User talk:' + self.params.user,
'action': 'edit',
'preview': 'yes',
'vanarticle': self.params.pagename.replace(/_/g, ' '),
'vanarticlerevid': self.params.revid,
'vanarticlegoodrevid': self.params.goodid,
'type': self.params.type,
'count': self.params.count
};
 
switch( Twinkle.getPref('userTalkPageMode') ) {
case 'tab':
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ), '_blank' );
break;
case 'blank':
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ), '_blank',
'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' );
break;
case 'window':
/* falls through */
default:
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ),
( window.name === 'twinklewarnwindow' ? '_blank' : 'twinklewarnwindow' ),
'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' );
break;
}
}
 
// figure out whether we need to/can review the edit
var $flagged = $(xmlDoc)page.find('flagged');
if ((Morebits.userIsInGroup('reviewer') || Morebits.userIsInGroup('sysop')userIsSysop) &&
$!!flagged.length &&
$flagged.attr("stable_revid") >= self.params.goodid &&
$!!flagged.attr("pending_since")) {
self.params.reviewRevert = true;
self.params.edittokencsrftoken = edittokencsrftoken;
}
 
var query = {
'action': 'edit',
'title': self.params.pagename,
'summary': summary,
tags: Twinkle.changeTags,
'token': edittoken,
'undo'token: lastrevidcsrftoken,
undo: lastrevid,
'undoafter': self.params.goodid,
undoafter: params.goodid,
'basetimestamp': touched,
basetimestamp: touched,
'starttimestamp': starttimestamp,
starttimestamp: loadtimestamp,
'watchlist' : Twinkle.getPref('watchRevertedPages').indexOf( self.params.type ) !== -1 ? 'watch' : undefined,
'minor': Twinkle.getPref('markRevertedPagesAsMinor').indexOf( self.params.type ) !== -1 ? true : undefined,
format: 'json'
};
// Handle watching, possible expiry
if (Twinkle.getPref('watchRevertedPages').indexOf(params.type) !== -1) {
var watchOrExpiry = Twinkle.getPref('watchRevertedExpiry');
 
if (!watchOrExpiry || watchOrExpiry === 'no') {
Morebits.wiki.actionCompleted.redirect = self.params.pagename;
query.watchlist = 'nochange';
Morebits.wiki.actionCompleted.notice = "Reversion completed";
} else if (watchOrExpiry === 'default' || watchOrExpiry === 'preferences') {
query.watchlist = 'preferences';
} else {
query.watchlist = 'watch';
// number allowed but not used in Twinkle.config.watchlistEnums
if ((!page.watched || page.watchlistexpiry) && typeof watchOrExpiry === 'string' && watchOrExpiry !== 'yes') {
query.watchlistexpiry = watchOrExpiry;
}
}
}
 
if (!Twinkle.fluff.rollbackInPlace) {
var wikipedia_api = new Morebits.wiki.api( 'Saving reverted contents', query, Twinkle.fluff.callbacks.complete, self.statelem);
Morebits.wiki.actionCompleted.redirect = params.pagename;
wikipedia_api.params = self.params;
}
Morebits.wiki.actionCompleted.notice = 'Reversion completed';
 
var wikipedia_api = new Morebits.wiki.api('Saving reverted contents', query, Twinkle.fluff.callbacks.complete, statelem);
wikipedia_api.params = params;
wikipedia_api.post();
 
},
complete: function (apiobj) {
// TODO Most of this is copy-pasted from Morebits.wiki.page#fnSaveSuccess. Unify it
var $edit = $(apiobj.getXML()).find('edit');
var blacklistresponse = $editapiobj.attrgetResponse('spamblacklist');
var edit = response.edit;
if (blacklist) {
 
var code = document.createElement('code');
if (edit.captcha) {
code.style.fontFamily = "monospace";
apiobj.statelem.error('Could not rollback, because the wiki server wanted you to fill out a CAPTCHA.');
code.appendChild(document.createTextNode(blacklist));
} else if (edit.nochange) {
apiobj.statelem.error(['Could not rollback because the URL ', code, ' is on the spam blacklist.']);
apiobj.statelem.error('Revision we are reverting to is identical to current revision, stopping revert.');
} else if ($edit.attr('nochange') === '') {
apiobj.statelem.warn("Revision we are reverting to is identical to current revision: Nothing to do");
} else {
apiobj.statelem.info("'done"');
var params = apiobj.params;
 
if (params.notifyUser && !params.userHidden) { // notifyUser only from main, not from toRevision
Morebits.status.info('Info', [ 'Opening user talk page edit form for user ', Morebits.htmlNode('strong', params.user) ]);
 
var windowQuery = {
title: 'User talk:' + params.user,
action: 'edit',
preview: 'yes',
vanarticle: params.pagename.replace(/_/g, ' '),
vanarticlerevid: params.revid,
vantimestamp: params.vantimestamp,
vanarticlegoodrevid: params.goodid,
type: params.type,
count: params.count
};
 
switch (Twinkle.getPref('userTalkPageMode')) {
case 'tab':
window.open(mw.util.getUrl('', windowQuery), '_blank');
break;
case 'blank':
window.open(mw.util.getUrl('', windowQuery), '_blank',
'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800');
break;
case 'window':
/* falls through */
default:
window.open(mw.util.getUrl('', windowQuery),
window.name === 'twinklewarnwindow' ? '_blank' : 'twinklewarnwindow',
'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800');
break;
}
}
 
 
// review the revert, if needed
if (apiobj.params.reviewRevert) {
var query = {
'action': 'review',
'revid': $edit.attr('newrevid'),
'token': apiobj.params.edittokencsrftoken,
comment: 'Automatically reviewing reversion' + Twinkle.summaryAd // until the below
'comment': Twinkle.getPref('summaryAd').trim()
// 'tags': Twinkle.changeTags // flaggedrevs tag support: [[phab:T247721]]
};
var wikipedia_api = new Morebits.wiki.api('Automatically accepting your changes', query);
};
 
// builtInStringIf shouldbuiltInString containcontains the string "$USER", whichit will be replaced
// by an appropriate user link if a user name is provided
Twinkle.fluff.formatSummary = function(builtInString, userName, userStringcustomString) {
var result = builtInString;
 
// append user's custom reason with requisite punctuation
if (userStringcustomString) {
result += ': ' + Morebits.string.toUpperCaseFirstChar(userStringcustomString);
if (userString.search(/[.?!;]$/) === -1) {
result += '.';
}
} else {
result += '.';
}
result += Twinkle.getPref('summaryAd');
 
// find number of UTF-8 bytes the resulting string takes up, and possibly add
// a contributions or contributions+talk link if it doesn't push the edit summary
// over the 255499-byte limit
if (/\$USER/.test(builtInString)) {
var resultLen = unescape(encodeURIComponent(result.replace("$USER", ""))).length;
if (userName) {
var contribsLink = "[[Special:Contributions/" + userName + "|" + userName + "]]";
var contribsLenresultLen = unescape(encodeURIComponent(contribsLinkresult.replace('$USER', ''))).length;
var contribsLink = '[[Special:Contributions/' + userName + '|' + userName + ']]';
if (resultLen + contribsLen <= 255) {
var contribsLen = unescape(encodeURIComponent(contribsLink)).length;
var talkLink = " ([[User talk:" + userName + "|talk]])";
if (resultLen + contribsLen + unescape(encodeURIComponent(talkLink)).length <= 255499) {
var talkLink = ' ([[User talk:' + userName + '|talk]])';
result = result.replace("$USER", contribsLink + talkLink);
if (resultLen + contribsLen + unescape(encodeURIComponent(talkLink)).length <= 499) {
result = Morebits.string.safeReplace(result, '$USER', contribsLink + talkLink);
} else {
result = Morebits.string.safeReplace(result, '$USER', contribsLink);
}
} else {
result = Morebits.string.safeReplace(result, '$USER', userName);
}
} else {
result = resultMorebits.replacestring.safeReplace("result, '$USER"', contribsLinkTwinkle.fluff.hiddenName);
}
} else {
result = result.replace("$USER", userName);
}
 
};
 
Twinkle.addInitCallback(Twinkle.fluff.init, = function twinklefluffinit('fluff') {;
if (Twinkle.userAuthorized)
{
// A list of usernames, usually only bots, that vandalism revert is jumped over; that is,
// if vandalism revert was chosen on such username, then its target is on the revision before.
// This is for handling quick bots that makes edits seconds after the original edit is made.
// This only affects vandalism rollback; for good faith rollback, it will stop, indicating a bot
// has no faith, and for normal rollback, it will rollback that edit.
Twinkle.fluff.whiteList = [
'AnomieBOT',
'SineBot'
];
 
if ( Morebits.queryString.exists( 'twinklerevert' ) ) {
Twinkle.fluff.auto();
} else {
Twinkle.fluff.normal();
}
}
};
})(jQuery);
 
 
// </nowiki>
10,498

தொகுப்புகள்

"https://ta.wikipedia.org/wiki/சிறப்பு:MobileDiff/3108309" இருந்து மீள்விக்கப்பட்டது