MediaWiki:Gadget-Twinkle.js: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
k Perbarui dari GitHub |
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 = {
summaryAd: " ([[WP:TW|TW]])",
deletionSummaryAd: " ([[WP:TW|TW]])",
Baris 50 ⟶ 51:
userTalkPageMode: "tab",
dialogLargeFont: false,
spiWatchReport: "yes",
blankTalkpageOnIndefBlock: false,
openTalkPage: [ "agf", "norm", "vand" ],
openTalkPageOnAutoRevert: false,
Baris 62 ⟶ 66:
confirmOnFluff: false,
showRollbackLinks: [ "diff", "others" ],
notifyUserOnDeli: true,
deliWatchPage: "default",
deliWatchUser: "default",
watchProdPages: true,
prodReasonDefault: "",
logProdPages: false,
prodLogPageName: "Log PROD",
speedySelectionStyle: "buttonClick",
watchSpeedyPages: [ "u3", "u5", "u10", "u11", "u12" ],
markSpeedyPagesAsPatrolled: true,
// these next two should probably be identical by default
notifyUserOnSpeedyDeletionNomination:
welcomeUserOnSpeedyDeletionNotification:
promptForSpeedyDeletionSummary:
openUserTalkPageOnSpeedyDelete:
deleteTalkPageOnDelete:
deleteRedirectsOnDelete: true,
deleteSysopDefaultToTag: false,
Baris 88 ⟶ 96:
speedyLogPageName: "Log KPC",
noLogOnSpeedyNomination: [ "h1" ],
unlinkNamespaces: [ "0", "10", "100", "118" ],
defaultWarningGroup: "1",
showSharedIPNotice: true,
watchWarnings: true,
customWarningList: [],
autoMenuAfterRollback: false,
// XfD▼
xfdWatchDiscussion: "default",
xfdWatchList: "no",
xfdWatchPage: "default",
xfdWatchUser: "default",
xfdWatchRelated: "default",
markXfdPagesAsPatrolled: true,
revertMaxRevisions: 50,
batchdeleteChunks: 50,
Baris 126 ⟶ 140:
Twinkle.defaultConfig.friendly = {
groupByDefault: true,
watchTaggedPages: true,
Baris 134 ⟶ 148:
tagArticleSortOrder: "cat",
customTagList: [],
customFileTagList: [],
// Welcome▼
customRedirectTagList: [],
topWelcomes: false,
watchWelcomes: true,
Baris 145 ⟶ 162:
customWelcomeList: [],
customWelcomeSignature: true,
markTalkbackAsMinor: true,
insertTalkbackSignature: true, // always sign talkback templates
talkbackHeading: "
adminNoticeHeading: "Perhatian",
mailHeading: "Anda memiliki pesan baru!",
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 ( typeof task === "function" ) {
$( link ).click(function ( ev ) {
task();
Baris 349 ⟶ 381:
dataType: "text"
})
.fail(function () { mw.
.done(function ( optionsText ) {
Baris 366 ⟶ 398:
try {
var options =
// Assuming that our options evolve, we will want to transform older versions:
Baris 384 ⟶ 416:
}
catch ( e ) {
mw.
}
})
Baris 395 ⟶ 427:
Twinkle.load = function () {
// Don't activate on special pages other than
// they load faster, especially the watchlist. var specialPageWhitelist = [ 'Contributions', 'DeletedContributions', 'Prefixindex' ];
var isSpecialPage = ( mw.config.get('wgNamespaceNumber') === -1 &&
specialPageWhitelist.indexOf( mw.config.get('wgCanonicalSpecialPageName')
// so don't load there either. $.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
// User/user talk-related
Twinkle.arv();
Baris 441 ⟶ 481:
}
// Run the initialization callbacks for any custom modules
Twinkle.addInitCallback = function ( func ) { func(); };
Baris 453 ⟶ 493:
} ( window, document, jQuery )); // End wrap with anonymous function
//
|