MediaWiki:Gadget-Twinkle.js: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
k ~ perbarui kode |
<maintenance> more info TypeError: Twinkle[module] is not a function. (In 'Twinkle[module]()', 'Twinkle[module]' is undefined) |
||
(9 revisi perantara oleh 3 pengguna tidak ditampilkan) | |||
Baris 8:
* Imported from github [https://github.com/azatoth/twinkle].
* All changes should be made in the repository, otherwise they will be lost.
*
* ----------
Baris 17 ⟶ 14:
* every Wikipedian in between. Visit [[WP:TW]] for more information.
*/
// <nowiki>
/* global Morebits */
(
// Check if account is experienced enough to use Twinkle
if (!Morebits.userIsInGroup('autoconfirmed') && !Morebits.userIsInGroup('confirmed')) {
return;
}
var Twinkle = {};
window.Twinkle = Twinkle; // allow global access
// for use by custom modules (normally empty)
Twinkle.initCallbacks = [];
Twinkle.addInitCallback = function twinkleAddInitCallback(
Twinkle.initCallbacks.push(
};
Twinkle.defaultConfig = {};
/**
* This holds the default set of preferences used by Twinkle.
* It is important that all new preferences added here, especially admin-only ones, are also added to
* |Twinkle.config.sections| in twinkleconfig.js, so they are configurable via the Twinkle preferences panel.
* For help on the actual preferences, see the comments in twinkleconfig.js.
*
* Formerly Twinkle.defaultConfig.twinkle and Twinkle.defaultConfig.friendly
*/
Twinkle.defaultConfig
// General
summaryAd:
deletionSummaryAd:
protectionSummaryAd:
userTalkPageMode:
dialogLargeFont: false,
disabledModules: [],
disabledSysopModules: [],
// ARV
spiWatchReport:
// Block
defaultToPartialBlocks: false,
blankTalkpageOnIndefBlock: false,
// Fluff (revert and rollback)
autoMenuAfterRollback: false,
openTalkPage: [ 'agf', 'norm', 'vand' ],
openTalkPageOnAutoRevert: false,
rollbackInPlace: false,
markRevertedPagesAsMinor: [ 'vand' ],
watchRevertedPages: [ 'agf', 'norm', 'vand', 'torev' ],
offerReasonOnNormalRevert: true,
confirmOnFluff: false,
showRollbackLinks: [
// DI (twinkleimage)
notifyUserOnDeli: true,
deliWatchPage:
deliWatchUser:
// PROD
watchProdPages: true,
markProdPagesAsPatrolled: false,
prodReasonDefault: '',
logProdPages: false,
prodLogPageName:
// CSD
speedySelectionStyle:
watchSpeedyPages: [
markSpeedyPagesAsPatrolled:
// these next two should probably be identical by default
promptForSpeedyDeletionSummary: [],
deleteTalkPageOnDelete: true,
deleteRedirectsOnDelete: true,
speedyWindowHeight: 500,
speedyWindowWidth: 800,
logSpeedyNominations: false,
speedyLogPageName:
noLogOnSpeedyNomination: [
// Unlink
unlinkNamespaces: [
// Warn
defaultWarningGroup:
combinedSingletMenus: false,
showSharedIPNotice: true,
watchWarnings: true,
oldSelect: false,
customWarningList: [],
// XfD
logXfdNominations: false,
xfdLogPageName: 'XfD log',
noLogOnXfdNomination: [],
xfdWatchList: 'no',
xfdWatchPage: 'default',
xfdWatchUser: 'default',
xfdWatchRelated: 'default',
markXfdPagesAsPatrolled: true,
// Hidden preferences
revertMaxRevisions: 50,
autolevelStaleDays: 3, // Huggle is 3, CBNG is 2
batchMax: 5000,
batchdeleteChunks: 50,
batchProtectChunks: 50,
batchundeleteChunks: 50,
proddeleteChunks: 50,
// Formerly defaultConfig.friendly:
// Tag
groupByDefault: true,
Baris 146 ⟶ 141:
markTaggedPagesAsMinor: false,
markTaggedPagesAsPatrolled: true,
tagArticleSortOrder:
customTagList: [],
customFileTagList: [],
Baris 154 ⟶ 149:
topWelcomes: false,
watchWelcomes: true,
welcomeHeading:
insertHeadings: true,
insertUsername: true,
insertSignature: true, // sign welcome templates, where appropriate
quickWelcomeMode:
quickWelcomeTemplate:
customWelcomeList: [],
customWelcomeSignature: true,
Baris 166 ⟶ 161:
markTalkbackAsMinor: true,
insertTalkbackSignature: true, // always sign talkback templates
talkbackHeading:
adminNoticeHeading:
mailHeading:
// Shared
Baris 174 ⟶ 169:
};
// now some skin dependent config.
switch (mw.config.get('skin')) {
case 'vector':
Twinkle.defaultConfig.portletArea = 'right-navigation';
Twinkle.defaultConfig.portletName = 'TW';
Twinkle.defaultConfig.portletType = 'menu';
Twinkle.defaultConfig.portletNext = 'p-search';
break;
case 'timeless':
Twinkle.defaultConfig.portletArea = '#page-tools .sidebar-inner';
Twinkle.defaultConfig.portletId = 'p-twinkle';
Twinkle.defaultConfig.portletName = 'Twinkle';
Twinkle.defaultConfig.portletType = null;
Twinkle.defaultConfig.portletNext = 'p-userpagetools';
break;
default:
Twinkle.defaultConfig.portletArea = null;
Twinkle.defaultConfig.portletId = 'p-cactions';
Twinkle.defaultConfig.portletName = null;
Twinkle.defaultConfig.portletType = null;
Twinkle.defaultConfig.portletNext = null;
}
Twinkle.
if (typeof Twinkle.prefs === 'object' && Twinkle.prefs[name] !== undefined) {
return Twinkle.prefs[name];
}
// Old preferences format, used before twinkleoptions.js was a thing
if (typeof window.TwinkleConfig === 'object' && window.TwinkleConfig[name] !== undefined) {
return
}
if (typeof window.FriendlyConfig === 'object' && window.FriendlyConfig[name] !== undefined) {
return window.FriendlyConfig[name];
}
return Twinkle.defaultConfig[name];
};
Baris 427 ⟶ 428:
Twinkle.load = function () {
// Don't activate on special pages other than those
//
var
if (Morebits.userIsSysop) {
}
if (mw.config.get('wgNamespaceNumber') === -1 &&
return;
}
Baris 451 ⟶ 452:
'arv', 'warn', 'block', 'welcome', 'shared', 'talkback',
// Deletion
'speedy', 'prod', /* 'xfd', */ 'image',
// Maintenance
'protect', 'tag',
Baris 462 ⟶ 463:
return disabledModules.indexOf(mod) === -1;
}).forEach(function(module) {
if ( typeof Twinkle[module]
Twinkle[module]();
}
});
Twinkle.config.init(); // Can't turn off
|