MediaWiki:Gadget-twinkleconfig.js: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
Repo at a491314: tracking branch 'upstream/master'; Remove G6 disambig (now part of G14) note left behind after #482; Update inline comment |
Repo at 5c1e7e3: Update from Github |
||
Baris 1:
// <nowiki>
(function($) {
Baris 9:
*** twinkleconfig.js: Preferences module
****************************************
* Mode of invocation: Adds configuration form to Wikipedia:Twinkle/Preferences
* Active on: What I just said. Yeah.
I, [[User:This, that and the other]], originally wrote this. If the code is misbehaving, or you have any
Baris 23 ⟶ 22:
Twinkle.config = {};
Twinkle.config.watchlistEnums = { yes: 'Tambahkan ke daftar pantauan', no: 'Jangan tambahkan ke daftar pantauan', 'default': 'Ikuti preferensi baku di situs ini' };
Twinkle.config.commonSets = {
csdCriteria: {
db:
u1:
a1:
h1:
b1:
k1:
t2:
r2:
p1:
},
csdCriteriaDisplayOrder: [
],
csdCriteriaNotification: {
db:
u1: 'U1', u2: 'U2', u3: 'U3', u4: 'U4', u6: 'U6 (hanya untuk "pemindahan salin-tempel")',
u10: 'U10', u11: 'U11', u12: 'U12', u13: 'U13',
a1: 'A1', a2: 'A2', a3: 'A3', a5: 'A5', a7: 'A7', a9: 'A9', a10: 'A10', a11: 'A11',
h3: 'H3', h5: 'H5',
b1: 'B1', b2: 'B2', b3: 'B3', b7: 'B7', b9: 'B9', b10: 'B10',
p1: 'P1', p2: 'P2'
},
csdCriteriaNotificationDisplayOrder: [
],
csdAndDICriteria: {
db:
u1:
a1:
h1:
b1:
k1:
t2:
r2:
p1:
},
csdAndDICriteriaDisplayOrder: [
],
namespacesNoSpecial: {
'0':
'1':
'2':
'3':
'4':
'5':
'6':
'7':
'8':
'9':
'10':
'11':
'12':
'13':
'14':
'15':
'100': 'Portal',
'101': 'Pembicaraan Portal',
'108': 'Buku',
'109': 'Pembicaraan Buku',
'118': 'Draf',
'119': 'Pembicaraan Draf',
'710': 'TimedText',
'711': 'Pembicaraan TimedText',
'828': 'Modul',
'829': 'Pembicaraan Modul'
}
Baris 133 ⟶ 130:
* adminOnly: <true for admin-only sections>,
* hidden: <true for advanced preferences that rarely need to be changed - they can still be modified by manually editing twinkleoptions.js>,
* preferences: [
* {
Baris 155 ⟶ 151:
Twinkle.config.sections = [
{
// TwinkleConfig.summaryAd (string)
// Text to be appended to the edit summary of edits made using Twinkle
{
name:
label:
helptip:
type:
},
// TwinkleConfig.deletionSummaryAd (string)
// Text to be appended to the edit summary of deletions made using Twinkle
{
name:
label:
helptip:
adminOnly: true,
type:
},
// TwinkleConfig.protectionSummaryAd (string)
// Text to be appended to the edit summary of page protections made using Twinkle
{
name:
label:
helptip:
adminOnly: true,
type:
},
// TwinkleConfig.userTalkPageMode may take arguments:
// 'window': open a new window, remember the opened window
// 'tab': opens in a new tab, if possible.
// 'blank': force open in a new window, even if such a window exists
{
name:
label:
type:
enumValues: { window: 'In a window, replacing other user talks', tab: 'In a new tab', blank: 'In a totally new window' }
},
// TwinkleConfig.dialogLargeFont (boolean)
{
name:
label:
type:
},
// Twinkle.config.disabledModules (array)
{
name: 'disabledModules',
label: 'Turn off the selected Twinkle modules',
helptip: 'Anything you select here will NOT be available for use, so act with care. Uncheck to reactivate.',
type: 'set',
setValues: { arv: 'ARV', warn: 'Warn', welcome: 'Welcome', shared: 'Shared IP', talkback: 'Talkback', speedy: 'CSD', prod: 'PROD', xfd: 'XfD', image: 'Image (DI)', protect: 'Protect (RPP)', tag: 'Tag', diff: 'Diff', unlink: 'Unlink', 'fluff': 'Revert and rollback' }
},
// Twinkle.config.disabledSysopModules (array)
{
name: 'disabledSysopModules',
label: 'Turn off the selected admin-only modules',
helptip: 'Anything you select here will NOT be available for use, so act with care. Uncheck to reactivate.',
adminOnly: true,
type: 'set',
setValues: { block: 'Block', deprod: 'DePROD', batchdelete: 'D-batch', batchprotect: 'P-batch', batchundelete: 'Und-batch' }
}
]
},
{
{
name: 'spiWatchReport',
label: 'Menambahkan halaman laporan pengguna siluman ke daftar pantauan',
enumValues: Twinkle.config.watchlistEnums
}
},
{
title: 'Block user',
adminOnly: true,
preferences: [
// TwinkleConfig.defaultToPartialBlocks (boolean)
// Whether to default partial blocks on or off
{
name: 'defaultToPartialBlocks',
label: 'Select partial blocks by default when opening the block menu',
type: 'boolean'
},
// TwinkleConfig.
// if true, blank the talk page when issuing an indef block notice (per [[WP:UWUL#Indefinitely blocked users]])
{
name:
label:
helptip: 'Lihat <a href="' + mw.util.getUrl('WP:UW#Indefinitely blocked users') + '">WP:UW</a> untuk informasi lebih lanjut.',
type: 'boolean'
}
},
{
// TwinkleConfig.
// If the user should be notified after placing a file deletion tag
{
name:
label: 'Pilih "beritahu pengunggah berkas" sebagai pengaturan standar',
type:
},
// TwinkleConfig.
// The watchlist setting of the page tagged for deletion. Either "yes", "no", or "default". Default is "default" (Duh).
{
name:
label: 'Menambahkan halaman berkas ke daftar pantauan setelah ditandai',
type:
enumValues: Twinkle.config.watchlistEnums
},
// TwinkleConfig.deliWatchUser (string)
// The watchlist setting of the user talk page if a notification is placed. Either "yes", "no", or "default". Default is "default" (Duh).
{
name: 'deliWatchUser',
label: 'Menambahkan halaman pembicaraan pengunggah berkas ke daftar pantauan setelah diberitahu',
type: 'enum',
enumValues: Twinkle.config.watchlistEnums
}
]
},
{
title: 'Usulan penghapusan (UP)',
// TwinkleConfig.
// If, when applying prod template to page, to watch the page
{
name:
label: 'Menambahkan artikel ke daftar pantauan setelah ditandai',
type: 'boolean'
},
// TwinkleConfig.
// If, when applying prod template to page, to mark the page as curated/patrolled (if the page was reached from NewPages)
{
name:
label: 'Mark page as patrolled/reviewed when tagging (if possible)',
helptip: 'This should probably not be checked as doing so is against best practice consensus',
type: 'boolean'
},
// TwinkleConfig.
// The prefilled PROD reason.
{
name:
label: 'Isian awal alasan UP',
type: 'string'
},
{
name: 'logProdPages',
label: 'Simpan log di ruang pengguna halaman yang Anda tandai UP',
helptip: 'Karena hanya pengurus yang memiliki akses ke kontribusi mereka yang dihapus, log ruang pengguna menawarkan cara yang baik untuk dapat melacak semua halaman yang Anda tandai UP dengan Twinkle.',
type: 'boolean'
{
name: 'prodLogPageName',
label: 'Simpan log ruang pengguna UP di subhalaman pengguna ini',
helptip: 'Masukkan nama subhalaman dalam kotak ini. Log UP Anda akan tersimpan di Pengguna:<i>nama pengguna</i>/<i>nama subhalaman</i>. Aktifkan log ruang pengguna UP untuk memanfaatkan fungsi ini.',
type: 'string'
}
]
},
{
title: 'Pengembalian dan pembatalan', // twinklefluff module
preferences: [
// TwinkleConfig.autoMenuAfterRollback (bool)
// Option to automatically open the warning menu if the user talk page is opened post-reversion
{
name: 'autoMenuAfterRollback',
label: 'Automatically open the Twinkle warn menu on a user talk page after Twinkle rollback',
helptip: 'Only operates if the relevant box is checked below.',
type: 'boolean'
},
// TwinkleConfig.
// What types of actions that should result in opening of talk page
{
name:
label:
type: 'set',
setValues: { agf: 'Pengembalian ANB', norm: 'Pengembalian normal', vand: 'Pengembalian vandalisme', torev: '"Kembalikan revisi ini"' }
},
// TwinkleConfig.openTalkPageOnAutoRevert (bool)
// Defines if talk page should be opened when calling revert from contribs or recent changes pages. If set to true, openTalkPage defines then if talk page will be opened.
{
name: 'openTalkPageOnAutoRevert',
label: 'Buka halaman pembicaraan pengguna setelah melakukan pembatalan dari kontribusi pengguna',
helptip: 'Mungkin Anda sering membatalkan suntingan pada banyak halaman melalui halaman kontribusi pengguna vandal, sehingga tidaklah nyaman jika harus membuka halaman pembicaraan pengguna. Karenanya opsi ini tidak aktifkan secara bawaan. Jika ini diaktifkan, opsi-opsi yang diinginkan pada pengaturan sebelumnya perlu diaktifkan juga.',
type: 'boolean'
},
// TwinkleConfig.
//
{
name: 'rollbackInPlace',
label: "Don't reload the page when rolling back from contributions or recent changes",
helptip: "When this is on, Twinkle won't reload the contributions or recent changes feed after reverting, allowing you to revert more than one edit at a time.",
type:
},
// TwinkleConfig.markRevertedPagesAsMinor (array)
// What types of actions that should result in marking edit as minor
{
name: 'markRevertedPagesAsMinor',
label: 'Tandai sebagai suntingan kecil pada pengembalian ini',
type: 'set',
setValues: { agf: 'Pengembalian ANB', norm: 'Pengembalian normal', vand: 'Pengembalian vandalisme', torev: '"Kembalikan revisi ini"' }
},
// TwinkleConfig.watchRevertedPages (array)
// What types of actions that should result in forced addition to watchlist
{
name: 'watchRevertedPages',
label: 'Tambahkan halaman ke daftar pantauan pada pengembalian ini',
type: 'set',
setValues: { agf: 'Pengembalian ANB', norm: 'Pengembalian normal', vand: 'Pengembalian vandalisme', torev: '"Kembalikan revisi ini"' }
},
// TwinkleConfig.
// If to offer a prompt for extra summary reason for normal reverts, default to true
{
name:
label: 'Tanyakan alasan untuk pengembalian normal',
helptip: 'Pengembalian "normal" adalah jenis pengembalian yang dilakukan dengan mengeklik [kembalikan] di sisi tengah.',
type: 'boolean'
},
{
name: 'confirmOnFluff',
label: 'Tampilkan pesan konfirmasi sebelum melakukan pengembalian',
helptip: 'Bagi pengguna perangkat sentuh atau pena, dan mereka yang sering mengalami kebimbangan.',
type: 'boolean'
},
// TwinkleConfig.
// Where Twinkle should show rollback links:
// diff, others, mine, contribs, history, recent
// Note from TTO: |contribs| seems to be equal to |others| + |mine|, i.e. redundant, so I left it out heres
{
name: 'showRollbackLinks',
label: 'Tampilkan tautan-tautan pengembalian pada halaman ini',
type: 'set',
setValues: { diff: 'Halaman Diff', others: 'Halaman kontribusi pengguna lain', mine: 'Halaman kontribusi saya', recent: 'Recent changes and related changes special pages', history: 'History pages' }
]
},
{
title: 'Shared IP tagging',
preferences: [
{
name: 'markSharedIPAsMinor',
label: 'Tandai penandaan IP bersama sebagai suntingan kecil',
type: 'boolean'
}
},
{
title: 'Penghapusan cepat (KPC)',
preferences: [
{
name: 'speedySelectionStyle',
label: 'Kapan eksekusi dilakukan dan menandai/menghapus halaman',
type:
enumValues: { 'buttonClick': 'Ketika saya mengeklik "Submit"', 'radioClick': 'Setelah saya memilih sebuah opsi' }
},
// TwinkleConfig.
// Whether to add speedy tagged or deleted pages to watchlist
{
name:
label: 'Tambahkan halaman ke daftar pantauan setelah menandai dengan kriteria ini',
setValues: Twinkle.config.commonSets.csdCriteria,
setDisplayOrder: Twinkle.config.commonSets.csdCriteriaDisplayOrder
},
// TwinkleConfig.markSpeedyPagesAsPatrolled (boolean)
// If, when applying speedy template to page, to mark the page as triaged/patrolled (if the page was reached from NewPages)
{
name: 'markSpeedyPagesAsPatrolled',
label: 'Tandai halaman sebagai sudah dipatroli setelah dilakukan penandaan (jika memungkinkan)',
helptip: 'This should probably not be checked as doing so is against best practice consensus',
type: 'boolean'
},
// TwinkleConfig.
// On what types of speedy deletion notifications shall the user be welcomed
// with a "firstarticle" notice if their talk page has not yet been created.
{
name: 'welcomeUserOnSpeedyDeletionNotification',
label: 'Beritahu pembuat halaman jika menandai dengan kriteria ini',
helptip: 'Meskipun Anda memilih untuk memberitahukan melalui tampilan KPC, pemberitahuan tersebut hanya akan dilakukan sesuai kriteria yang dipilih di sini.',
type: 'set',
setValues: Twinkle.config.commonSets.csdCriteriaNotification,
setDisplayOrder: Twinkle.config.commonSets.csdCriteriaNotificationDisplayOrder
},
// TwinkleConfig.
//
{
name:
label: 'Sapa pembuat halaman bersama dengan pemberitahuan setelah menandai dengan kriteria ini',
helptip: 'Selamat datang hanya akan ditampilkan jika pengguna tersebut diberitahu mengenai penghapusan, dan hanya jika halaman pembicaraannya belum ada. Templat yang digunakan adalah {{Selamat datang 2}}.',
type: 'set',
setValues: Twinkle.config.commonSets.csdCriteriaNotification,
setDisplayOrder: Twinkle.config.commonSets.csdCriteriaNotificationDisplayOrder
},
// TwinkleConfig.
// What types of actions should result in the author of the page being notified of speedy deletion (admin only)
{
name:
label: 'Notify page creator when deleting under these criteria',
helptip: 'Even if you choose to notify from the CSD screen, the notification will only take place for those criteria selected here.',
type: 'set',
setValues: Twinkle.config.commonSets.csdCriteriaNotification,
setDisplayOrder: Twinkle.config.commonSets.csdCriteriaNotificationDisplayOrder
},
// TwinkleConfig.promptForSpeedyDeletionSummary (array of strings)
{
name: 'promptForSpeedyDeletionSummary',
label: 'Izinkan penyuntingan ringkasan penghapusan setelah menghapus dengan kriteria ini',
type: 'set',
setValues: Twinkle.config.commonSets.csdAndDICriteria,
setDisplayOrder: Twinkle.config.commonSets.csdAndDICriteriaDisplayOrder
},
// TwinkleConfig.deleteTalkPageOnDelete (boolean)
// If talk page if exists should also be deleted (CSD G8) when spedying a page (admin only)
{
name: 'deleteTalkPageOnDelete',
label: 'Pilih "juga hapus halaman pembicaraan" secara bawaan',
adminOnly: true,
type: 'boolean'
},
{
name: 'deleteRedirectsOnDelete',
label: 'Pilih "juga hapus pengalihan" secara bawaan',
adminOnly: true,
type: 'boolean'
},
// TwinkleConfig.deleteSysopDefaultToDelete (boolean)
// Make the CSD screen default to "delete" instead of "tag" (admin only)
{
name: 'deleteSysopDefaultToDelete',
label: 'Default to outright deletion instead of speedy tagging',
helptip: 'If there is a CSD tag already present, Twinkle will always default to "delete" mode',
adminOnly: true,
type: 'boolean'
},
// TwinkleConfig.speedyWindowWidth (integer)
// Defines the width of the Twinkle SD window in pixels
{
name: 'speedyWindowWidth',
label: 'Lebar jendela penghapusan cepat (piksel)',
type: 'integer'
},
// TwinkleConfig.speedyWindowWidth (integer)
// Defines the width of the Twinkle SD window in pixels
{
label: 'Tinggi jendela penghapusan cepat (piksel)',
helptip: 'Jika memiliki monitor besar, mungkin Anda ingin memperbesar jendela ini.',
},
{
name: 'logSpeedyNominations',
label: 'Simpan log dalam ruang pengguna nominasi KPC',
helptip: 'Karena selain pengurus tidak memiliki akses ke kontribusi mereka yang dihapus, log ruang pengguna menawarkan cara yang baik untuk melacak semua halaman yang Anda nominasikan KPC menggunakan Twinkle. Berkas yang ditandai menggunakan PB juga ditambahkan ke log ini.',
type: 'boolean'
},
{
name: 'speedyLogPageName',
label: 'Simpan log ruang pengguna KPC di subhalaman pengguna ini',
helptip: 'Masukkan nama subhalaman dalam kotak ini. Log KPC Anda akan tersimpan di Pengguna:<i>nama pengguna</i>/<i>nama subhalaman</i>. Aktifkan log ruang pengguna KPC untuk memanfaatkan fungsi ini.',
type: 'string'
},
{
name: 'noLogOnSpeedyNomination',
label: 'Jangan buat entri log ruang pengguna setelah menandai dengan kriteria ini',
type: 'set',
setValues: Twinkle.config.commonSets.csdAndDICriteria,
setDisplayOrder: Twinkle.config.commonSets.csdAndDICriteriaDisplayOrder
}
},
{
title: 'Tag',
preferences: [
{
name:
label:
type: 'boolean'
},
name: 'watchMergeDiscussions',
label: 'Tambahkan halaman pembicaraan ke daftar pantauan setelah memulai diskusi penggabungan',
type: 'boolean'
},
{
name: 'markTaggedPagesAsMinor',
label: 'Tandai penambahan tag sebagai suntingan kecil',
type: 'boolean'
},
{
name: 'markTaggedPagesAsPatrolled',
label: 'Pilih "tandai halaman sebagai sudah dipatroli" secara bawaan',
type: 'boolean'
},
{
name: 'groupByDefault',
label: 'Pilih "kelompokkan dalam {{artikel bermasalah}}" secara bawaan',
type: 'boolean'
},
{
name: 'tagArticleSortOrder',
label: 'Urutan tampilan bawaan untuk tag artikel',
type: 'enum',
enumValues: { 'cat': 'Berdasarkan kategori', 'alpha': 'Alfabetis' }
},
{
name: 'customTagList',
label: 'Tampilan tag pemeliharaan artikel kustom',
helptip: 'Ini tampil sebagai opsi tambahan di bawah daftar tag. Misalnya, Anda dapat menambahkan tag pemeliharaan baru yang belum pernah ditambahkan ke bawaan Twinkle.',
type: 'customList',
customListValueTitle: 'Nama templat (tanpa tanda kurung kurawal)',
customListLabelTitle: 'Teks yang ditampilkan di dialog Tag '
},
{
name: 'customFileTagList',
label: 'Tampilan tag pemeliharaan berkas kustom',
helptip: 'Tag tambahan untuk berkas.',
type: 'customList',
customListValueTitle: 'Nama templat (tanpa tanda kurung kurawal)',
customListLabelTitle: 'Teks yang ditampilkan di dialog Tag '
},
{
name: 'customRedirectTagList',
label: 'Tampilan tag pemeliharaan halaman pengalihan kustom',
helptip: 'Tag tambahan untuk pengalihan.',
type: 'customList',
customListValueTitle: 'Nama templat (tanpa tanda kurung kurawal)',
customListLabelTitle: 'Teks yang ditampilkan di dialog Tag '
}
]
},
{
title: 'Balasan pembicaraan',
preferences: [
{
name: 'markTalkbackAsMinor',
label: 'Tandai balasan pembicaraan sebagai suntingan kecil',
type: 'boolean'
},
{
name: 'insertTalkbackSignature',
label: 'Tambahkan tanda tangan di dalam balasan pembicaraan',
type: 'boolean'
},
{
name: 'talkbackHeading',
label: 'Judul bagian yang digunakan untuk balasan pembicaraan',
type: 'string'
},
{
name: 'adminNoticeHeading',
label: 'Judul bagian yang digunakan untuk pemberitahuan papan pengumuman pengurus',
helptip: 'Hanya relevan untuk AN dan ANI.',
type: 'string'
},
{
name: 'mailHeading',
label: 'Judul bagian yang digunakan untuk pemberitahuan "Anda mendapatkan pesan"',
type: 'string'
}
]
},
title: 'Hapus tautan',
preferences: [
// TwinkleConfig.unlinkNamespaces (array)
// In what namespaces unlink should happen, default in 0 (article), 10 (template), 100 (portal), and 118 (draft)
{
name: 'unlinkNamespaces',
label: 'Hapus tautan dari halaman dalam ruangnama ini',
helptip: 'Hindari memilih ruangnama pembicaraan apapun, karena Twinkle mungkin akan menghapus tautan dalam arsip pembicaraan.',
type: 'set',
setValues: Twinkle.config.commonSets.namespacesNoSpecial
}
]
},
{
preferences: [
// TwinkleConfig.defaultWarningGroup (int)
// Which level warning should be the default selected group, default is 1
{
name: 'defaultWarningGroup',
label: 'Tingkatan peringatan bawaan',
type: 'enum',
enumValues: {
'2': 'Tingkat 2',
'3': 'Tingkat 3',
'5': 'Tingkat 4im',
'6': 'Pemberitahuan masalah tunggal',
'7': 'Peringatan masalah tunggal',
// 8 was used for block templates before #260
'9': 'Peringatan lainnya',
'10': 'All warning templates',
'11': 'Auto-select level (1-4)'
},
// TwinkleConfig.combinedSingletMenus (boolean)
// if true, show one menu with both single-issue notices and warnings instead of two separately
{
name: 'combinedSingletMenus',
label: 'Replace the two separate single-issue menus into one combined menu',
helptip: 'Selecting either single-issue notices or single-issue warnings as your default will make this your default if enabled.',
type: 'boolean'
},
// TwinkleConfig.
// true: to show shared ip notice if an IP address
//
{
name: 'showSharedIPNotice',
label: 'Tambahkan pemberitahuan tambahan di halaman pembicaraan IP bersama',
helptip: 'Pemberitahuan yang digunakan adalah {{Shared IP advice}}',
type: 'boolean'
// TwinkleConfig.
// if true, watch the page which has been dispatched an warning or notice, if false, default applies
{
name: 'watchWarnings',
label: 'Tambahkan halaman pembicaraan pengguna ke daftar pantauan setelah pemberitahuan',
type: 'boolean'
},
// TwinkleConfig.
// if true, use the native select menu rather the select2-based one
{
name: 'oldSelect',
label: 'Use the non-searchable classic select menu',
type: 'boolean'
{
name: 'customWarningList',
label: 'Tampilan templat peringatan kustom',
helptip: 'Anda dapat menambahkan subhalaman pengguna atau templat pribadi. Peringatan kustom ditampilkan dalam kategori "Peringatan kustom" di dalam kotak dialog peringatan.',
customListValueTitle: 'Nama templat (tanpa tanda kurung kurawal)',
customListLabelTitle: 'Teks yang ditampilkan di daftar peringatan (juga di ringkasan suntingan)'
}
]
title: 'Menyambut pengguna (selamat datang)',
preferences: [
{
name: 'topWelcomes',
label: 'Tempatkan sambutan di atas semua konten yang ada di halaman pembicaraan pengguna',
type: 'boolean'
},
{
name: 'watchWelcomes',
label: 'Tambahkan halaman pembicaraan pengguna ke daftar pantauan setelah menyambutnya',
helptip: 'Melakukan hal ini merupakan penanganan pribadi dalam menyambut pengguna; Anda akan dapat memantau perkembangan mereka sebagai pemula, dan mungkin membantunya.',
type: 'boolean'
},
{
name: 'insertUsername',
label: 'Tambahkan nama pengguna Anda ke templat (bila memungkinkan)',
helptip: 'Beberapa templat selamat datang memiliki kalimat pembuka seperti "Halo, saya <nama pengguna>. Selamat datang" dll. Jika Anda menonaktifkan opsi ini, templat tersebut tidak akan tampil seperti demikian.',
type: 'boolean'
},
{
name: 'quickWelcomeMode',
label: 'Mengeklik tautan "selamat datang" pada halaman perbedaan revisi akan',
helptip: 'Jika Anda memilih penyambutan otomatis, templat yang Anda pilih di bawah akan digunakan.',
type: 'enum',
enumValues: { auto: 'sambut secara otomatis', norm: 'tanya Anda untuk memilih sebuah templat' }
},
{
name: 'quickWelcomeTemplate',
label: 'Templat yang digunakan untuk penyambutan otomatis',
helptip: 'Masukkan nama templat selamat datang, tanpa kurung kurawal. Tautan ke artikel yang disuntingnya itu akan disertakan.',
type: 'string'
},
{
name: 'customWelcomeList',
label: 'Tampilan templat selamat datang kustom',
helptip: 'Anda dapat menambahkan templat selamat datang lainnya, atau subhalaman pengguna yang merupakan templat selamat datang (diawali dengan "User:"). Harap diingat bahwa templat ini disubstitusi ke halaman pembicaraan pengguna.',
type: 'customList',
customListValueTitle: 'Nama templat (tanpa kurung kurawal)',
customListLabelTitle: 'Teks yang ditampilkan di kotak dialog Selamat datang'
},
{
name: 'customWelcomeSignature',
label: 'Tanda tangani templat selamat datang secara otomatis',
helptip: 'Jika templat selamat datang kustom Anda telah memuat tanda tangan di dalam templatnya, nonaktifkan opsi ini.',
type: 'boolean'
}
]
},
{
preferences: [
{
name: 'logXfdNominations',
label: 'Keep a log in userspace of all pages you nominate for a deletion discussion (XfD)',
helptip: 'The userspace log offers a good way to keep track of all pages you nominate for XfD using Twinkle.',
type:
},
{
name:
label: 'Keep the deletion discussion userspace log at this user subpage',
helptip: 'Enter a subpage name in this box. You will find your XfD log at User:<i>username</i>/<i>subpage name</i>. Only works if you turn on the XfD userspace log.',
type: 'string'
},
{
name: 'noLogOnXfdNomination',
label: 'Do not create a userspace log entry when nominating at this venue',
setValues: { afd: 'AfD', tfd: 'TfD', ffd: 'FfD', cfd: 'CfD', cfds: 'CfD/S', mfd: 'MfD', rfd: 'RfD', rm: 'RM' }
},
// TwinkleConfig.xfdWatchPage (string)
// The watchlist setting of the page being nominated for XfD. Either "yes" (add to watchlist), "no" (don't
// add to watchlist), or "default" (use setting from preferences). Default is "default" (duh).
{
name: 'xfdWatchPage',
label: 'Tambahkan halaman nominasi itu ke daftar pantauan',
type:
enumValues: Twinkle.config.watchlistEnums
},
// TwinkleConfig.xfdWatchDiscussion (string)
// The watchlist setting of the newly created XfD page (for those processes that create discussion pages for each nomination),
// or the list page for the other processes.
// Either "yes" (add to watchlist), "no" (don't add to watchlist), or "default" (use setting from preferences). Default is "default" (duh).
{
name:
label: 'Tambahkan halaman diskusi penghapusan ke daftar pantauan',
helptip: 'Ini merujuk ke subhalaman diskusi (untuk AfD dan MfD) atau halaman log harian (untuk TfD, CfD, RfD dan FfD)',
type: 'enum',
enumValues: Twinkle.config.watchlistEnums
},
// TwinkleConfig.xfdWatchList (string)
// The watchlist setting of the XfD list page, *if* the discussion is on a separate page. Either "yes" (add to watchlist), "no" (don't
// add to watchlist), or "default" (use setting from preferences). Default is "no" (Hehe. Seriously though, who wants to watch it?
// Sorry in advance for any false positives.).
{
name: 'xfdWatchList',
label: 'Tambahkan log harian/daftar halaman ke daftar pantauan (jika memungkinkan)',
helptip: 'Ini hanya berlaku untuk AfD dan MfD, di mana diskusinya ditransklusikan ke halaman log harian (untuk AfD) atau halaman utama MfD (untuk MfD).',
type: 'enum',
enumValues: Twinkle.config.watchlistEnums
},
// TwinkleConfig.xfdWatchUser (string)
// The watchlist setting of the user talk page if they receive a notification. Either "yes" (add to watchlist), "no" (don't
// add to watchlist), or "default" (use setting from preferences). Default is "default" (duh).
name: 'xfdWatchUser',
label: 'Tambahkan halaman pembicaraan pengguna ke daftar pantauan (ketika memberitahukan)',
type: 'enum',
enumValues: Twinkle.config.watchlistEnums
},
// TwinkleConfig.xfdWatchRelated (string)
// The watchlist setting of the target of a redirect being nominated for RfD. Either "yes" (add to watchlist), "no" (don't
// add to watchlist), or "default" (use setting from preferences). Default is "default" (duh).
name: 'xfdWatchRelated',
label: 'Tambahkan halaman target pengalihan ke daftar pantauan (ketika memberitahukan)',
helptip: 'Ini hanya berlaku untuk RfD, ketika memberitahukan di halaman pembicaraan target dari halaman pengalihan',
type: 'enum',
enumValues: Twinkle.config.watchlistEnums
},
{
name: 'markXfdPagesAsPatrolled',
label: 'Tandai halaman sebagai sudah dipatroli setelah nominasi AFD (jika mungkin)',
type: 'boolean'
}
]
},
{
title: 'Disembunyikan',
hidden: true,
preferences: [
// twinkle.js: portlet setup
{
name: 'portletArea',
type: 'string'
},
{
name: 'portletId',
type: 'string'
},
{
name: 'portletName',
type: 'string'
},
{
name: 'portletType',
type: 'string'
},
{
name: 'portletNext',
type: 'string'
},
// twinklefluff.js: defines how many revision to query maximum, maximum possible is 50, default is 50
{
name: 'revertMaxRevisions',
type: 'integer'
},
// twinklewarn.js: When using the autolevel select option, how many days makes a prior warning stale
// Huggle is three days ([[Special:Diff/918980316]] and [[Special:Diff/919417999]]) while ClueBotNG is two:
// https://github.com/DamianZaremba/cluebotng/blob/4958e25d6874cba01c75f11debd2e511fd5a2ce5/bot/action_functions.php#L62
{
name: 'autolevelStaleDays',
type: 'integer'
},
// twinklebatchdelete.js: How many pages should be processed maximum
{
name: 'batchMax',
type: 'integer',
adminOnly: true
},
// twinklebatchdelete.js: How many pages should be processed at a time
{
name: 'batchdeleteChunks',
type: 'integer',
adminOnly: true
},
// twinklebatchprotect.js: How many pages should be processed at a time
{
name: 'batchProtectChunks',
type: 'integer',
adminOnly: true
},
// twinklebatchundelete.js: How many pages should be processed at a time
{
name: 'batchundeleteChunks',
type: 'integer',
adminOnly: true
},
// twinkledeprod.js: How many pages should be processed at a time
{
name: 'proddeleteChunks',
type: 'integer',
adminOnly: true
}
]
}
]; // end of Twinkle.config.sections
Twinkle.config.init = function twinkleconfigInit() {
// create the config page at Wikipedia:Twinkle/Preferences
if ((mw.config.get( mw.config.get('wgAction') === 'view') {
if (!document.getElementById(
return; // maybe the page is misconfigured, or something - but any attempt to modify it will be pointless
}
// set style (the url() CSS function doesn't seem to work from wikicode - ?!)
document.getElementById(
var contentdiv = document.getElementById(
contentdiv.textContent =
// let user know about possible conflict with
// (settings in that file will still work, but they will be overwritten by twinkleoptions.js settings)
if (window.TwinkleConfig || window.FriendlyConfig) {
var contentnotice = document.createElement('p');
contentnotice.innerHTML = '<table class="plainlinks ombox ombox-content"><tr><td class="mbox-image">' +
'<img alt="" src="https://upload.wikimedia.org/wikipedia/commons/3/38/Imbox_content.png" /></td>' +
'<td class="mbox-text"><p><big><b>Sebelum mengubah preferensi Anda di sini,</b> pastikan Anda telah menghapus setelan Twinkle dan Friendly lama dari skrip JavaScript kulit Anda.</big></p>' +
'<p>Anda dapat mengunjungi <a href="' + mw.util.getUrl('User:' + mw.config.get('wgUserName') + '/' + mw.config.get('skin') +
'.js', { action: 'edit' }) + '" target="_blank"><b>halaman kulit ini</b></a> atau <a href="' +
mw.util.getUrl('User:' + mw.config.get('wgUserName') + '/common.js', { action: 'edit'}) + '" target="_blank"><b>berkas common.js Anda</b></a>, menghapus semua setelan tentang <code>TwinkleConfig</code> dan <code>FriendlyConfig</code>.</p>' +
'</td></tr></table>';
contentdiv.appendChild(contentnotice);
}
// start a table of contents
var toctable = document.createElement(
toctable.className =
toctable.style.marginLeft =
// create TOC title
var toctitle = document.createElement(
toctitle.id =
var toch2 = document.createElement(
toch2.textContent =
toctitle.appendChild(toch2);
// add TOC show/hide link
var toctoggle = document.createElement(
toctoggle.className =
toctoggle.appendChild(document.createTextNode(
var toctogglelink = document.createElement(
toctogglelink.className =
toctogglelink.setAttribute(
toctogglelink.textContent =
toctoggle.appendChild(toctogglelink);
toctoggle.appendChild(document.createTextNode(
toctitle.appendChild(toctoggle);
toctable.appendChild(toctitle);
// create item container: this is what we add stuff to
var tocul = document.createElement(
toctogglelink.addEventListener(
var $tocul = $(tocul);
$tocul.toggle();
if ($tocul.find(
toctogglelink.textContent =
} else {
toctogglelink.textContent =
}
}, false);
Baris 949 ⟶ 1.022:
var tocnumber = 1;
var contentform = document.createElement(
contentform.setAttribute(
contentform.addEventListener(
contentdiv.appendChild(contentform);
var container = document.createElement(
container.style.width =
contentform.appendChild(container);
$(Twinkle.config.sections).each(function(sectionkey, section) {
if (section.hidden || (section.adminOnly && !Morebits.
return true; // i.e. "continue" in this context
}
// add to TOC
var tocli = document.createElement(
tocli.className =
var toca = document.createElement(
toca.setAttribute(
toca.appendChild(document.createTextNode(section.title));
tocli.appendChild(toca);
tocul.appendChild(tocli);
var row = document.createElement(
var cell = document.createElement(
cell.setAttribute(
var heading = document.createElement(
heading.style.borderBottom =
heading.style.marginTop =
heading.id =
heading.appendChild(document.createTextNode(section.title));
cell.appendChild(heading);
Baris 995 ⟶ 1.061:
// add each of the preferences to the form
$(section.preferences).each(function(prefkey, pref) {
if (pref.adminOnly && !Morebits.
return true; // i.e. "continue" in this context
}
row = document.createElement(
row.style.marginBottom =
// create odd row banding
if (rowcount++ % 2 === 0) {
row.style.backgroundColor =
}
cell = document.createElement(
var label, input;
switch (pref.type) {
case
cell.setAttribute(
label = document.createElement(
input = document.createElement(
input.setAttribute(
input.setAttribute(
input.setAttribute(
if (
input.setAttribute(
}
label.appendChild(input);
label.appendChild(document.createTextNode(
cell.appendChild(label);
break;
case
case
// add label to first column
cell.style.textAlign =
cell.style.paddingRight =
label = document.createElement(
label.setAttribute(
label.appendChild(document.createTextNode(pref.label +
cell.appendChild(label);
row.appendChild(cell);
// add input box to second column
cell = document.createElement(
cell.style.paddingRight =
input = document.createElement(
input.setAttribute(
input.setAttribute(
input.setAttribute(
if (pref.type ===
input.setAttribute(
input.setAttribute(
input.setAttribute(
}
if (
input.setAttribute(
}
cell.appendChild(input);
break;
case
// add label to first column
// note: duplicates the code above, under string/integer
cell.style.textAlign =
cell.style.paddingRight =
label = document.createElement(
label.setAttribute(
label.appendChild(document.createTextNode(pref.label +
cell.appendChild(label);
row.appendChild(cell);
// add input box to second column
cell = document.createElement(
cell.style.paddingRight =
input = document.createElement(
input.setAttribute(
input.setAttribute(
$.each(pref.enumValues, function(enumvalue, enumdisplay) {
var option = document.createElement(
option.setAttribute(
if (
option.setAttribute(
}
option.appendChild(document.createTextNode(enumdisplay));
Baris 1.084 ⟶ 1.150:
break;
case
// add label first of all
cell.setAttribute(
label = document.createElement(
label.appendChild(document.createTextNode(pref.label +
cell.appendChild(label);
var checkdiv = document.createElement(
checkdiv.style.paddingLeft =
var worker = function(itemkey, itemvalue) {
var checklabel = document.createElement(
checklabel.style.marginRight =
checklabel.style.display =
var check = document.createElement(
check.setAttribute(
check.setAttribute(
check.setAttribute(
if (
check.setAttribute(
}
// cater for legacy integer array values for unlinkNamespaces (this can be removed a few years down the track...)
if (pref.name ===
if (
check.setAttribute(
}
}
Baris 1.126 ⟶ 1.192:
break;
case
// add label to first column
cell.style.textAlign =
cell.style.paddingRight =
label = document.createElement(
label.setAttribute(
label.appendChild(document.createTextNode(pref.label +
cell.appendChild(label);
row.appendChild(cell);
// add button to second column
cell = document.createElement(
cell.style.paddingRight =
var button = document.createElement(
button.setAttribute(
button.setAttribute(
button.setAttribute(
button.addEventListener(
// use jQuery data on the button to store the current config value
$(button).data({
value:
pref: pref
});
button.appendChild(document.createTextNode(
cell.appendChild(button);
break;
default:
alert(
break;
}
Baris 1.161 ⟶ 1.226:
// add help tip
cell = document.createElement(
cell.style.fontSize =
cell.style.color =
if (pref.helptip) {
// convert mentions of templates in the helptip to clickable links
cell.innerHTML = pref.helptip.replace(/{{(.+?)}}/g,
'{{<a href="' + mw.util.getUrl(
}
// add reset link (custom lists don't need this, as their config value isn't displayed on the form)
if (pref.type !==
var resetlink = document.createElement(
resetlink.setAttribute(
resetlink.setAttribute(
resetlink.addEventListener(
resetlink.appendChild(document.createTextNode('Atur ulang'));
cell.appendChild(resetlink);
}
Baris 1.193 ⟶ 1.254:
});
var footerbox = document.createElement(
footerbox.setAttribute(
footerbox.style.backgroundColor =
footerbox.style.padding =
var button = document.createElement(
button.setAttribute(
button.setAttribute(
button.appendChild(document.createTextNode(
footerbox.appendChild(button);
var footerspan = document.createElement(
footerspan.className =
footerspan.style.marginLeft =
footerspan.style.fontSize =
var footera = document.createElement(
footera.setAttribute(
footera.setAttribute(
footera.addEventListener(
footera.appendChild(document.createTextNode(
footerspan.appendChild(footera);
footerbox.appendChild(footerspan);
Baris 1.220 ⟶ 1.281:
}
} else if (mw.config.get(
mw.config.get(
mw.config.get(
var box = document.createElement(
// Styled in twinkle.css
box.setAttribute( var link,
scriptPageName = mw.config.get(
mw.config.get(
if (scriptPageName ===
// place "why not try the preference panel" notice
box.setAttribute('class', 'config-twopt-box');
if (mw.config.get(
box.appendChild(document.createTextNode(
} else { // page does not exist
box.appendChild(document.createTextNode(
}
link = document.createElement(
link.setAttribute(
link.appendChild(document.createTextNode(
box.appendChild(link);
box.appendChild(document.createTextNode(
$(box).insertAfter($(
} else if ([
// place "Looking for Twinkle options?" notice
box.setAttribute('class', 'config-userskin-box');
box.appendChild(document.createTextNode(
link = document.createElement(
link.setAttribute(
link.appendChild(document.createTextNode(
box.appendChild(link);
box.appendChild(document.createTextNode(
$(box).insertAfter($(
}
}
};
Baris 1.289 ⟶ 1.329:
Twinkle.config.listDialog.addRow = function twinkleconfigListDialogAddRow(dlgtable, value, label) {
var contenttr = document.createElement(
// "remove" button
var contenttd = document.createElement(
var removeButton = document.createElement(
removeButton.setAttribute(
removeButton.addEventListener(
$(contenttr).remove(); }, false); removeButton.textContent =
contenttd.appendChild(removeButton);
contenttr.appendChild(contenttd);
// value input box
contenttd = document.createElement(
var input = document.createElement(
input.setAttribute(
input.className =
input.style.width =
if (value) {
input.setAttribute(
}
contenttd.appendChild(input);
Baris 1.312 ⟶ 1.354:
// label input box
contenttd = document.createElement(
input = document.createElement(
input.setAttribute(
input.className =
input.style.width =
if (label) {
input.setAttribute(
}
contenttd.appendChild(input);
Baris 1.328 ⟶ 1.370:
Twinkle.config.listDialog.display = function twinkleconfigListDialogDisplay(e) {
var $prefbutton = $(e.target);
var curvalue = $prefbutton.data(
var curpref = $prefbutton.data(
var dialog = new Morebits.simpleWindow(720, 400);
dialog.setTitle(curpref.label);
dialog.setScriptName(
var dialogcontent = document.createElement(
var dlgtable = document.createElement(
dlgtable.className =
dlgtable.style.margin =
dlgtable.style.width =
var dlgtbody = document.createElement(
// header row
var dlgtr = document.createElement(
// top-left cell
var dlgth = document.createElement(
dlgth.style.width =
dlgtr.appendChild(dlgth);
// value column header
dlgth = document.createElement(
dlgth.style.width =
dlgth.textContent =
dlgtr.appendChild(dlgth);
// label column header
dlgth = document.createElement(
dlgth.style.width =
dlgth.textContent =
dlgtr.appendChild(dlgth);
dlgtbody.appendChild(dlgtr);
Baris 1.373 ⟶ 1.415:
// final "add" button
var dlgtfoot = document.createElement(
dlgtr = document.createElement(
var dlgtd = document.createElement(
dlgtd.setAttribute(
var addButton = document.createElement(
addButton.style.minWidth =
addButton.setAttribute(
addButton.addEventListener(
Twinkle.config.listDialog.addRow(dlgtbody);
}, false);
addButton.textContent =
dlgtd.appendChild(addButton);
dlgtr.appendChild(dlgtd);
Baris 1.393 ⟶ 1.435:
// buttonpane buttons: [Save changes] [Reset] [Cancel]
var button = document.createElement(
button.setAttribute(
button.addEventListener(
Twinkle.config.listDialog.save($prefbutton, dlgtbody);
dialog.close();
}, false);
button.textContent =
dialogcontent.appendChild(button);
button = document.createElement(
button.setAttribute(
button.addEventListener(
Twinkle.config.listDialog.reset($prefbutton, dlgtbody);
}, false);
button.textContent =
dialogcontent.appendChild(button);
button = document.createElement(
button.setAttribute(
button.addEventListener(
dialog.close(); // the event parameter on this function seems to be broken
}, false);
button.textContent =
dialogcontent.appendChild(button);
Baris 1.425 ⟶ 1.467:
// reset value on button
var $button = $(button);
var curpref = $button.data(
var oldvalue = $button.data(
Twinkle.config.resetPref(curpref
// reset form
var $tbody = $(tbody);
$tbody.find(
// add the new values
var curvalue = $button.data(
$.each(curvalue, function(k, v) {
Twinkle.config.listDialog.addRow(tbody, v.value, v.label);
Baris 1.439 ⟶ 1.481:
// save the old value
$button.data(
};
Baris 1.446 ⟶ 1.488:
var current = {};
$(tbody).find('input[type="text"]').each(function(inputkey, input) {
if ($(input).hasClass(
current = { value: input.value };
} else {
Baris 1.456 ⟶ 1.498:
}
});
$(button).data(
};
Baris 1.466 ⟶ 1.508:
// search tactics
$(Twinkle.config.sections).each(function(sectionkey, section) {
if (section.hidden || (section.adminOnly && !Morebits.
return true; // continue: skip impossibilities
}
Baris 1.476 ⟶ 1.518:
return true; // continue
}
Twinkle.config.resetPref(pref
foundit = true;
return false; // break
Baris 1.488 ⟶ 1.530:
};
Twinkle.config.resetPref = function twinkleconfigResetPref(pref
switch (pref.type) {
case
document.getElementById(pref.name).checked =
break;
case
case
case
document.getElementById(pref.name).value =
break;
case
$.each(pref.setValues, function(itemkey) {
if (document.getElementById(pref.name +
document.getElementById(pref.name +
}
});
break;
case
$(document.getElementById(pref.name)).data(
break;
default:
alert(
break;
}
Baris 1.526 ⟶ 1.564:
// no confirmation message - the user can just refresh/close the page to abort
$(Twinkle.config.sections).each(function(sectionkey, section) {
if (section.hidden || (section.adminOnly && !Morebits.
return true; // continue: skip impossibilities
}
$(section.preferences).each(function(prefkey, pref) {
if (!pref.adminOnly || Morebits.
Twinkle.config.resetPref(pref
}
});
Baris 1.540 ⟶ 1.578:
Twinkle.config.save = function twinkleconfigSave(e) {
Morebits.status.init(
var userjs = mw.config.get('wgFormattedNamespaces')[mw.config.get('wgNamespaceIds').user] + ':' + mw.config.get('wgUserName') + '/twinkleoptions.js';
var wikipedia_page = new Morebits.wiki.page(userjs, 'Menyimpan preferensi ke ' + userjs);
wikipedia_page.setCallbackParameters(e.target);
wikipedia_page.load(Twinkle.config.writePrefs);
Baris 1.555 ⟶ 1.591:
var form = pageobj.getCallbackParameters();
// this is the object which gets serialized into JSON; only
// preferences that this script knows about are kept
var newConfig = {optionsVersion: 2};
// a comparison function is needed later on
Baris 1.580 ⟶ 1.608:
for (var i = 0; asort[i]; ++i) {
// comparison of the two properties of custom lists
if ((typeof asort[i] ===
asort[i].value !== bsort[i].value)) {
return false;
Baris 1.588 ⟶ 1.616:
}
return true;
}
return a === b;
};
$(Twinkle.config.sections).each(function(sectionkey, section) {
if (section.adminOnly && !Morebits.
return; // i.e. "continue" in this context
}
Baris 1.603 ⟶ 1.631:
// only read form values for those prefs that have them
if
switch (pref.type) {
case 'boolean': // read from the checkbox
userValue = form[pref.name].checked;
break;
case
case 'enum':
userValue = form[pref.name].value;
break;
case
userValue = parseInt(form[pref.name].value, 10);
if (isNaN(userValue)) {
Morebits.status.warn('Menyimpan', 'Nilai yang Anda masukkan untuk ' + pref.name + ' (' + pref.value + ') tidak sah. Proses penyimpanan akan dilanjutkan, namun data yang tidak sah itu akan dilewati.');
userValue = null;
}
break;
case
userValue =
if (
// read only those keys specified in the display order
$.each(pref.setDisplayOrder, function(itemkey, item) {
if (form[pref.name +
userValue.push(item);
}
});
} else {
// read all the keys in the list of values
$.each(pref.setValues, function(itemkey) {
if (form[pref.name +
userValue.push(itemkey);
}
});
}
break;
case
userValue = $(form[pref.name]).data(
break;
default:
alert(
break;
}
} else if (Twinkle.prefs) {
// Retain the hidden preferences that may have customised by the user from twinkleoptions.js
// undefined if not set
userValue = Twinkle.prefs[pref.name];
}
}
// only save those preferences that are *different* from the default
if (userValue !== undefined && !compare(userValue, Twinkle.defaultConfig[pref.name])) {
newConfig[pref.name] = userValue;
}
});
});
var text =
text += JSON.stringify(newConfig, null, 2);
text +=
pageobj.setPageText(text);
pageobj.setEditSummary(
pageobj.setCreateOption(
pageobj.save(Twinkle.config.saveSuccess);
};
Twinkle.config.saveSuccess = function twinkleconfigSaveSuccess(pageobj) {
pageobj.getStatusElement().info(
var noticebox = document.createElement(
noticebox.className =
noticebox.style.fontSize =
noticebox.style.marginTop =
noticebox.innerHTML =
Morebits.status.root.appendChild(noticebox);
var noticeclear = document.createElement(
noticeclear.style.clear =
Morebits.status.root.appendChild(noticeclear);
};
Baris 1.722 ⟶ 1.734:
// </nowiki>
|