MediaWiki:Gadget-Twinkle.js: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Kenrick95 (bicara | kontrib)
k Perbarui dari GitHub
Kenrick95 (bicara | kontrib)
Repo at d9666d4: Update Twinkle from upstream
Baris 17:
* every Wikipedian in between. Visit [[WP:TW]] for more information.
*/
 
//<nowiki>
 
/* global Morebits */
 
( function ( window, document, $, undefined ) { // Wrap with anonymous function
Baris 44 ⟶ 45:
*/
Twinkle.defaultConfig.twinkle = {
// General
summaryAd: " ([[WP:TW|TW]])",
deletionSummaryAd: " ([[WP:TW|TW]])",
Baris 50 ⟶ 51:
userTalkPageMode: "tab",
dialogLargeFont: false,
 
// ARV
spiWatchReport: "yes",
 
// Block
blankTalkpageOnIndefBlock: false,
 
// Fluff (revert and rollback)
openTalkPage: [ "agf", "norm", "vand" ],
openTalkPageOnAutoRevert: false,
Baris 62 ⟶ 66:
confirmOnFluff: false,
showRollbackLinks: [ "diff", "others" ],
 
// DI (twinkleimage)
notifyUserOnDeli: true,
deliWatchPage: "default",
deliWatchUser: "default",
 
// PROD
watchProdPages: true,
prodReasonDefault: "",
logProdPages: false,
prodLogPageName: "Log PROD",
 
// CSD
speedySelectionStyle: "buttonClick",
watchSpeedyPages: [ "u3", "u5", "u10", "u11", "u12" ],
markSpeedyPagesAsPatrolled: true,
 
// these next two should probably be identical by default
notifyUserOnSpeedyDeletionNomination: [ "db", "u1", "u2", "u3", "u4", "u6", "u10", "u11", "u12", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "b1", "b2", "b3", "b7", "b9", "b10", "h3", "t2", "t3", "p1", "p2" ],
welcomeUserOnSpeedyDeletionNotification: [ "db", "u1", "u2", "u3", "u4", "u6", "u10", "u11", "u12", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "b1", "b2", "b3", "b7", "b9", "b10", "h3", "t2", "t3", "p1", "p2" ],
promptForSpeedyDeletionSummary: [ "db", "u1", "u2", "u3", "u4", "u6", "u7", "u8", "u10", "u11", "u12", "a1", "a2", "a3", "a5", "a7", "a9", "a10", "b2", "b4", "b7", "b8", "b10", "t2", "t3", "p1", "p2" ],
openUserTalkPageOnSpeedyDelete: [ "db", "u1", "u2", "u3", "u4", "u5", "u10", "u11", "u12", "a1", "a3", "a7", "a9", "a10", "b3", "b7", "b9", "h3", "t2", "p1" ],
deleteTalkPageOnDelete: falsetrue,
deleteRedirectsOnDelete: true,
deleteSysopDefaultToTag: false,
Baris 88 ⟶ 96:
speedyLogPageName: "Log KPC",
noLogOnSpeedyNomination: [ "h1" ],
 
// Unlink
unlinkNamespaces: [ "0", "10", "100", "118" ],
 
// Warn
defaultWarningGroup: "1",
showSharedIPNotice: true,
watchWarnings: true,
customWarningList: [],
autoMenuAfterRollback: false,
// XfD
 
// XfD
xfdWatchDiscussion: "default",
xfdWatchList: "no",
xfdWatchPage: "default",
xfdWatchUser: "default",
xfdWatchRelated: "default",
markXfdPagesAsPatrolled: true,
 
// Hidden preferences
revertMaxRevisions: 50,
batchdeleteChunks: 50,
Baris 126 ⟶ 140:
 
Twinkle.defaultConfig.friendly = {
// Tag
groupByDefault: true,
watchTaggedPages: true,
Baris 134 ⟶ 148:
tagArticleSortOrder: "cat",
customTagList: [],
customFileTagList: [],
// Welcome
customRedirectTagList: [],
 
// Welcome
topWelcomes: false,
watchWelcomes: true,
Baris 145 ⟶ 162:
customWelcomeList: [],
customWelcomeSignature: true,
 
// Talkback
markTalkbackAsMinor: true,
insertTalkbackSignature: true, // always sign talkback templates
talkbackHeading: "TalkbackPesan baru dari " + mw.config.get("wgUserName"),
adminNoticeHeading: "Perhatian",
mailHeading: "Anda memiliki pesan baru!",
 
// Shared
markSharedIPAsMinor: true
};
Baris 276 ⟶ 295:
}
 
if( outerDivClass === "vectorMenu" ) {
// add invisible checkbox to make menu keyboard accessible
// similar to the p-cactions ("More") menu
var chkbox = document.createElement( "input" );
chkbox.className = "vectorMenuCheckbox";
chkbox.setAttribute( "type","checkbox" );
chkbox.setAttribute( "aria-labelledby", "p-twinkle-label" );
outerDiv.appendChild( chkbox );
}
var h5 = document.createElement( "h3" );
if(outerDivClass === "vectorMenu") {
h5.id = "p-twinkle-label";
}
if ( type === "menu" ) {
var span = document.createElement( "span" );
Baris 324 ⟶ 355:
}
var link = mw.util.addPortletLink( Twinkle.getPref( "portletId" ), typeof task === "string" ? task : "#", text, id, tooltip );
$('.client-js .skin-vector #p-cactions').css('margin-right', 'initial');
if ( $.isFunction( task ) ) {
if ( typeof task === "function" ) {
$( link ).click(function ( ev ) {
task();
Baris 349 ⟶ 381:
dataType: "text"
})
.fail(function () { mw.util.jsMessagenotify( "Could not load twinkleoptions.js" ); })
.done(function ( optionsText ) {
 
Baris 366 ⟶ 398:
 
try {
var options = $JSON.parseJSONparse( optionsText );
 
// Assuming that our options evolve, we will want to transform older versions:
Baris 384 ⟶ 416:
}
catch ( e ) {
mw.util.jsMessagenotify("Could not parse twinkleoptions.js");
}
})
Baris 395 ⟶ 427:
 
Twinkle.load = function () {
// Don't activate on special pages other than "Contributions"those on the whitelist so that
// they load faster, especially the watchlist.
var specialPageWhitelist = [ 'Contributions', 'DeletedContributions', 'Prefixindex' ];
var isSpecialPage = ( mw.config.get('wgNamespaceNumber') === -1 &&
specialPageWhitelist.indexOf( mw.config.get('wgCanonicalSpecialPageName') !) === "Contributions"-1 &&);
mw.config.get('wgCanonicalSpecialPageName') !== "Prefixindex" ),
 
// Also, Twinkle is incompatible with Internet Explorer versions 8 or lower,
// so don't load there either.
var 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 ) {
return;
}
 
// Prevent clickjacking
if ( window.top !== window.self ) {
return;
}
Baris 411 ⟶ 451:
Morebits.wiki.api.setApiUserAgent( 'Twinkle/2.0 (' + mw.config.get( 'wgDBname' ) + ')' );
 
// Load the modules in the order that the tabs should appearsappear
// User/user talk-related
Twinkle.arv();
Baris 441 ⟶ 481:
}
// Run the initialization callbacks for any custom modules
$( Twinkle.initCallbacks ).eachforEach(function ( k, vfunc ) { vfunc(); });
Twinkle.addInitCallback = function ( func ) { func(); };
 
Baris 453 ⟶ 493:
} ( window, document, jQuery )); // End wrap with anonymous function
 
// </nowiki>