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

update from enwiki
("//<nowiki> (function($){ /* *********************************..."-இப்பெயரில் புதிய பக்கம் உருவாக்கப்பட்டுள்ளது)
 
(update from enwiki)
 
// <nowiki>
 
 
(function($) {
 
 
* Mode of invocation: Tab on non-diff pages ("Last"); tabs on diff pages ("Since", "Since mine", "Current")
* Active on: Existing non-special pages
* Config directives in: TwinkleConfig
*/
 
Twinkle.diff = function twinklediff() {
if( (mw.config.get('wgNamespaceNumber') < 0 || !mw.config.get('wgArticleId') ) {
return;
}
Twinkle.addPortletLink( mw.util.wikiScriptgetUrl("index"mw.config.get('wgPageName')+, "?"{diff: +'cur', $.param( queryoldid: 'prev'}), 'Last', 'tw-lastdiff', 'Show most recent diff' );
 
var query = {
'title': mw.config.get('wgPageName'),
'diff': 'cur',
'oldid': 'prev'
};
 
Twinkle.addPortletLink( mw.util.wikiScript("index")+ "?" + $.param( query ), 'Last', 'tw-lastdiff', 'Show most recent diff' );
 
// Show additional tabs only on diff pages
if (Morebitsmw.queryStringutil.existsgetParamValue('diff')) {
Twinkle.addPortletLink(function() { Twinkle.diff.evaluate(false); }, 'Since', 'tw-since', 'Show difference between last diff and the revision made by previous user' );
Twinkle.diff.evaluate(false);
Twinkle.addPortletLink( function(){ Twinkle.diff.evaluate(true); }, 'Since mine', 'tw-sincemine', 'Show difference between last diff and my last revision' );
}, 'Since', 'tw-since', 'Show difference between last diff and the revision made by previous user');
Twinkle.addPortletLink(function() {
Twinkle.diff.evaluate(true);
Twinkle.addPortletLink( function(){ Twinkle.diff.evaluate(true); }, 'Since mine', 'tw-sincemine', 'Show difference between last diff and my last revision' );
 
var oldid = /oldid=(.+)/.exec($('#mw-diff-ntitle1').find('strong a').first().attr("'href"'))[1];
Twinkle.addPortletLink( mw.util.wikiScriptgetUrl("index"mw.config.get('wgPageName')+, "?"{diff: +'cur', $.param( queryoldid: oldid}), 'Current', 'tw-curdiff', 'Show difference to current revision' );
query = {
'title': mw.config.get('wgPageName'),
'diff': 'cur',
'oldid' : oldid
};
Twinkle.addPortletLink( mw.util.wikiScript("index")+ "?" + $.param( query ), 'Current', 'tw-curdiff', 'Show difference to current revision' );
}
};
 
var user;
if ( me ) {
user = mw.config.get('wgUserName');
} else {
var node = document.getElementById( 'mw-diff-ntitle2' );
if ( ! node ) {
// nothing to do?
return;
}
var query = {
'prop': 'revisions',
'action': 'query',
'titles': mw.config.get('wgPageName'),
'rvlimit': 1,
'rvprop': [ 'ids', 'user' ],
'rvstartid': mw.config.get('wgCurRevisionId') - 1, // i.e. not the current one
'rvuser': user,
format: 'json'
};
Morebits.status.init( document.getElementById('mw-content-text') );
var wikipedia_api = new Morebits.wiki.api( 'Grabbing data of initial contributor', query, Twinkle.diff.callbacks.main );
wikipedia_api.params = { user: user };
wikipedia_api.post();
 
Twinkle.diff.callbacks = {
main: function( self ) {
var xmlDocrev = self.responseXMLresponse.query.pages[0].revisions;
var revid = $(xmlDoc).find('rev') && rev[0].attr('revid');
 
if ( ! revid ) {
self.statelem.error( 'no suitable earlier revision found, or ' + self.params.user + ' is the only contributor. Aborting.' );
return;
}
'title':window.location = mw.util.getUrl(mw.config.get('wgPageName'), {
var query = {
'title'diff: mw.config.get('wgPageNamewgCurRevisionId'),
'oldid': revid,
});
'diff': mw.config.get('wgCurRevisionId')
};
window.location = mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query );
}
};
 
Twinkle.addInitCallback(Twinkle.diff, 'diff');
})(jQuery);
 
 
// </nowiki>
10,498

தொகுப்புகள்

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