Pengguna:Iwan Novirion/twinklediff.js: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
←Membuat halaman berisi 'function twinklediff() { if( wgNamespaceNumber < 0 ) { return; } var query = { 'title': wgPageName, 'diff': 'cur', 'oldid': 'prev' }; addPortletLink( (typ...' |
k Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink) |
||
(2 revisi perantara oleh pengguna yang sama tidak ditampilkan) | |||
Baris 10:
};
mw.util.addPortletLink( (typeof pTwinkle != "undefined") ? pTwinkle : "p-cactions" , mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?' + QueryString.create( query ), 'Last', 'tw-lastdiff', 'Show most recent diff' );
// Show additional tabs only on diff pages
if(!QueryString.exists('diff')) return;
mw.util.addPortletLink( (typeof pTwinkle != "undefined") ? pTwinkle : "p-cactions", "javascript:twinklediff.evaluate(false);", 'Since', 'tw-since', 'Show difference between last diff and the revision made by previous user' );
mw.util.addPortletLink( (typeof pTwinkle != "undefined") ? pTwinkle : "p-cactions", "javascript:twinklediff.evaluate(true);", 'Since mine', 'tw-sincemine', 'Show difference between last diff and my last revision' );
var oldid = document.evaluate( 'substring-after(//div[@id="mw-diff-ntitle1"]/strong/a[1]/@href, "oldid=")', document, null, XPathResult.STRING_TYPE, null).stringValue;
Baris 25:
'oldid' : oldid
};
mw.util.addPortletLink( (typeof pTwinkle != "undefined") ? pTwinkle : "p-cactions", mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?' + QueryString.create( query ), 'Current', 'tw-curdiff', 'Show difference to current revision' );
}
twinklediff.evaluate = function twinklediffEvaluate(me) {
Baris 72:
'diff': wgCurRevisionId
};
window.location = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?' + QueryString.create( query );
}
}
|