14,091
edits
(Trying a new version (from En Wikipedia)) |
|||
Line 15: | Line 15: | ||
* | * | ||
* This is AzaToth's Twinkle, the popular script sidekick for newbies, admins, and | * This is AzaToth's Twinkle, the popular script sidekick for newbies, admins, and | ||
* every Wikipedian in between. Visit [[ | * every Wikipedian in between. Visit [[SV:TW]] for more information. | ||
*/ | */ | ||
Line 45: | Line 45: | ||
Twinkle.defaultConfig.twinkle = { | Twinkle.defaultConfig.twinkle = { | ||
// General | // General | ||
summaryAd: " ([[ | summaryAd: " ([[SV:TW|TW]])", | ||
deletionSummaryAd: " ([[ | deletionSummaryAd: " ([[SV:TW|TW]])", | ||
protectionSummaryAd: " ([[ | protectionSummaryAd: " ([[SV:TW|TW]])", | ||
userTalkPageMode: " | userTalkPageMode: "window", | ||
dialogLargeFont: false, | dialogLargeFont: false, | ||
// Fluff (revert and rollback) | // Fluff (revert and rollback) | ||
openTalkPage: [ "agf", "norm", "vand" ], | openTalkPage: [ "agf", "norm", "vand" ], | ||
Line 73: | Line 69: | ||
// CSD | // CSD | ||
speedySelectionStyle: "buttonClick", | speedySelectionStyle: "buttonClick", | ||
speedyPromptOnG7: false, | |||
watchSpeedyPages: [ "g3", "g5", "g10", "g11", "g12" ], | watchSpeedyPages: [ "g3", "g5", "g10", "g11", "g12" ], | ||
markSpeedyPagesAsPatrolled: true, | markSpeedyPagesAsPatrolled: true, | ||
// these next two should probably be identical by default | // these next two should probably be identical by default | ||
notifyUserOnSpeedyDeletionNomination: [ "db", "g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11", "f1", "f2", "f3", "f7", "f9", "f10", "u3 | notifyUserOnSpeedyDeletionNomination: [ "db", "g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11", "f1", "f2", "f3", "f7", "f9", "f10", "u3", "t2", "t3", "p1", "p2" ], | ||
welcomeUserOnSpeedyDeletionNotification: [ "db", "g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11", "f1", "f2", "f3", "f7", "f9", "f10", "u3 | welcomeUserOnSpeedyDeletionNotification: [ "db", "g1", "g2", "g3", "g4", "g6", "g10", "g11", "g12", "g13", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11", "f1", "f2", "f3", "f7", "f9", "f10", "u3", "t2", "t3", "p1", "p2" ], | ||
promptForSpeedyDeletionSummary: [], | promptForSpeedyDeletionSummary: [ "db", "g1", "g2", "g3", "g4", "g6", "g7", "g8", "g10", "g11", "g12", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11", "f2", "f4", "f7", "f8", "f10", "t2", "t3", "p1", "p2" ], | ||
openUserTalkPageOnSpeedyDelete: [ "db", "g1", "g2", "g3", "g4", "g5", "g10", "g11", "g12", "a1", "a3", "a7", "a9", "a10", "a11", "f3", "f7", "f9", "u3 | openUserTalkPageOnSpeedyDelete: [ "db", "g1", "g2", "g3", "g4", "g5", "g10", "g11", "g12", "a1", "a3", "a7", "a9", "a10", "a11", "f3", "f7", "f9", "u3", "t2", "p1" ], | ||
deleteTalkPageOnDelete: | deleteTalkPageOnDelete: false, | ||
deleteRedirectsOnDelete: true, | deleteRedirectsOnDelete: true, | ||
deleteSysopDefaultToTag: false, | deleteSysopDefaultToTag: false, | ||
Line 89: | Line 86: | ||
noLogOnSpeedyNomination: [ "u1" ], | noLogOnSpeedyNomination: [ "u1" ], | ||
// Unlink | // Unlink | ||
unlinkNamespaces: [ "0 | unlinkNamespaces: [ "0", "100" ], | ||
// Warn | // Warn | ||
defaultWarningGroup: "1", | defaultWarningGroup: "1", | ||
showSharedIPNotice: true, | showSharedIPNotice: true, | ||
watchWarnings: true, | watchWarnings: true, | ||
blankTalkpageOnIndefBlock: false, | |||
customWarningList: [], | customWarningList: [], | ||
// XfD | // XfD | ||
Line 100: | Line 98: | ||
xfdWatchPage: "default", | xfdWatchPage: "default", | ||
xfdWatchUser: "default", | xfdWatchUser: "default", | ||
// Hidden preferences | // Hidden preferences | ||
revertMaxRevisions: 50, | revertMaxRevisions: 50, | ||
batchdeleteChunks: 50, | batchdeleteChunks: 50, | ||
batchDeleteMinCutOff: 5, | |||
batchMax: 5000, | batchMax: 5000, | ||
batchProtectChunks: 50, | batchProtectChunks: 50, | ||
batchProtectMinCutOff: 5, | |||
batchundeleteChunks: 50, | batchundeleteChunks: 50, | ||
batchUndeleteMinCutOff: 5, | |||
deliChunks: 500, | |||
deliMax: 5000, | |||
proddeleteChunks: 50 | proddeleteChunks: 50 | ||
}; | }; | ||
Line 186: | Line 188: | ||
return result; | return result; | ||
}; | }; | ||
/** | /** | ||
Line 299: | Line 299: | ||
outerDiv.appendChild( h5 ); | outerDiv.appendChild( h5 ); | ||
if ( type === "menu" ) { | if ( type === "menu" ) { | ||
innerDiv = document.createElement( "div" ); | var innerDiv = document.createElement( "div" ); | ||
innerDiv.className = innerDivClass; | innerDiv.className = innerDivClass; | ||
outerDiv.appendChild(innerDiv); | outerDiv.appendChild(innerDiv); | ||
Line 324: | Line 323: | ||
} | } | ||
var link = mw.util.addPortletLink( Twinkle.getPref( "portletId" ), typeof task === "string" ? task : "#", text, id, tooltip ); | var link = mw.util.addPortletLink( Twinkle.getPref( "portletId" ), typeof task === "string" ? task : "#", text, id, tooltip ); | ||
if ( $.isFunction( task ) ) { | if ( $.isFunction( task ) ) { | ||
$( link ).click(function ( ev ) { | $( link ).click(function ( ev ) { | ||
Line 367: | Line 365: | ||
try { | try { | ||
var options = | var options = $.parseJSON( optionsText ); | ||
// Assuming that our options evolve, we will want to transform older versions: | // Assuming that our options evolve, we will want to transform older versions: | ||
Line 396: | Line 394: | ||
Twinkle.load = function () { | Twinkle.load = function () { | ||
// Don't activate on special pages other than "Contributions" so that they load faster, especially the watchlist. | |||
var isSpecialPage = ( mw.config.get('wgNamespaceNumber') === -1 | |||
&& mw.config.get('wgCanonicalSpecialPageName') !== "Contributions" | |||
var isSpecialPage = ( mw.config.get('wgNamespaceNumber') === -1 && | && mw.config.get('wgCanonicalSpecialPageName') !== "Prefixindex" ), | ||
// Also, Twinkle is incompatible with Internet Explorer versions 8 or lower, so don't load there either. | |||
isOldIE = ( $.client.profile().name === 'msie' && $.client.profile().versionNumber < 9 ); | |||
// Prevent users that are not autoconfirmed from loading Twinkle as well. | |||
if ( isSpecialPage || isOldIE || !Twinkle.userAuthorized ) { | if ( isSpecialPage || isOldIE || !Twinkle.userAuthorized ) { | ||
return; | return; | ||
} | } | ||
// Load the modules in the order that the tabs should appears | |||
// Load the modules in the order that the tabs should | |||
// User/user talk-related | // User/user talk-related | ||
Twinkle.arv(); | Twinkle.arv(); | ||
Twinkle.warn(); | Twinkle.warn(); | ||
Twinkle.welcome(); | Twinkle.welcome(); | ||
Twinkle.shared(); | Twinkle.shared(); | ||
Line 444: | Line 428: | ||
Twinkle.fluff.init(); | Twinkle.fluff.init(); | ||
if ( Morebits.userIsInGroup('sysop') ) { | if ( Morebits.userIsInGroup('sysop') ) { | ||
Twinkle.delimages(); | |||
Twinkle.deprod(); | Twinkle.deprod(); | ||
Twinkle.batchdelete(); | Twinkle.batchdelete(); | ||
Line 450: | Line 435: | ||
} | } | ||
// Run the initialization callbacks for any custom modules | // Run the initialization callbacks for any custom modules | ||
Twinkle.initCallbacks. | $( Twinkle.initCallbacks ).each(function ( k, v ) { v(); }); | ||
Twinkle.addInitCallback = function ( func ) { func(); }; | Twinkle.addInitCallback = function ( func ) { func(); }; | ||