MediaWiki:Gadget-twinklespeedy.js: Perbedaan revisi

Repo at 5c1e7e3: Update from Github
(Repo at a491314: tracking branch 'upstream/master'; tracking branch 'upstream/master'; Use fullurl when linking to file logs on CSD log (#636); Remove Morebits.wikipedia (#600); tweak F5 tooltip to be more in line with use of db-f5 rather than di-orphaned fair use; Tweak db-xfd tooltip to be sysop-agnostic (#620); wikilink additional parameters in the CSD log if possible; Cleanup and simplify code around userList, redirects, and function calls, and add plain G8 to categories (#603); Ignore bl...)
(Repo at 5c1e7e3: Update from Github)
// <nowiki>
 
 
(function($) {
 
 
* Mode of invocation: Tab ("CSD")
* Active on: Non-special, existing pages
* Config directives in: TwinkleConfig
*
* NOTE FOR DEVELOPERS:
}
 
Twinkle.addPortletLink( Twinkle.speedy.callback, "'KPC"', "'tw-csd"', Morebits.userIsInGroup('sysop')userIsSysop ? "'Hapus halaman berdasarkan WP:KPC"' : "'Meminta penghapusan cepat menurut WP:KPC" ');
};
 
// This function is run when the CSD tab/header link is clicked
Twinkle.speedy.callback = function twinklespeedyCallback() {
Twinkle.speedy.initDialog(Morebits.userIsInGroup( 'sysop' )userIsSysop ? Twinkle.speedy.callback.evaluateSysop : Twinkle.speedy.callback.evaluateUser, true);
};
 
// Used by unlink feature
Twinkle.speedy.dialog = null;
// Used throughout
Twinkle.speedy.hasCSD = !!$('#delete-reason').length;
 
// The speedy criteria list can be in one of several modes
mode === Twinkle.speedy.mode.userMultipleRadioClick ||
mode === Twinkle.speedy.mode.sysopMultipleRadioClick;
},
};
 
Twinkle.speedy.initDialog = function twinklespeedyInitDialog(callbackfunc) {
var dialog;
Twinkle.speedy.dialog = new Morebits.simpleWindow(Twinkle.getPref('speedyWindowWidth'), Twinkle.getPref('speedyWindowHeight'));
var isSysop = Morebits.userIsInGroup( 'sysop' );
Twinkle.speedy.dialog = new Morebits.simpleWindow( Twinkle.getPref('speedyWindowWidth'), Twinkle.getPref('speedyWindowHeight') );
dialog = Twinkle.speedy.dialog;
dialog.setTitle( "'Pilih kriteria penghapusan cepat" ');
dialog.setScriptName( "'Twinkle" ');
dialog.addFooterLink( "'Kriteria Penghapusan Cepat"', "'WP:KPC" ');
dialog.addFooterLink( "'Bantuan Twinkle"', "'WP:TW/DOC#speedy" ');
 
var form = new Morebits.quickForm( callbackfunc, (Twinkle.getPref('speedySelectionStyle') === 'radioClick' ? 'change' : null) );
if ( isSysop Morebits.userIsSysop) {
form.append( {
type: 'checkbox',
list: [
{
label: 'Hanya tandai halaman, jangan hapus',
value: 'tag_only',
name: 'tag_only',
tooltip: 'Jika Anda hanya ingin menadai halaman alih-alih menghapusnya sekarang',
checked : !(Twinkle.speedy.hasCSD || Twinkle.getPref('deleteSysopDefaultToTagdeleteSysopDefaultToDelete')),
event: function( event ) {
var cForm = event.target.form;
var cChecked = event.target.checked;
// enable/disable talk page checkbox
if (cForm.talkpage) {
cForm.talkpage.disabledchecked = !cChecked && Twinkle.getPref('deleteTalkPageOnDelete');
}
cForm.talkpage.checked = !cChecked && Twinkle.getPref('deleteTalkPageOnDelete');
// enable redirects checkbox
}
cForm.redirects.checked = !cChecked;
// enable/disable redirects checkbox
// enable delete multiple
cForm.redirects.disabled = cChecked;
cForm.redirectsdelmultiple.checked = !cCheckedfalse;
// enable/disable deletenotify multiplecheckbox
cForm.delmultiplenotify.disabledchecked = cChecked;
// enable deletion notification checkbox
cForm.delmultiple.checked = false;
cForm.warnusertalk.checked = !cChecked && !Twinkle.speedy.hasCSD;
// enable/disable open talk page checkbox
// enable multiple
cForm.openusertalk.disabled = cChecked;
cForm.openusertalkmultiple.checked = false;
// enable requesting creation protection
cForm.salting.checked = false;
 
Twinkle.speedy.callback.modeChanged(cForm);
// enable/disable notify checkbox
cForm.notify.disabled = !cChecked;
cForm.notify.checked = cChecked;
// enable/disable multiple
cForm.multiple.disabled = !cChecked;
cForm.multiple.checked = false;
 
event.stopPropagation();
Twinkle.speedy.callback.modeChanged(cForm);
 
event.stopPropagation();
}
}
]}
} );]
});
 
var deleteOptions = form.append( {
type: 'div',
name: 'delete_options'
} );
deleteOptions.append( {
type: 'header',
label: 'Opsi penghapusan terkait'
} );
if (mw.config.get('wgNamespaceNumber') % 2 === 0 && (mw.config.get('wgNamespaceNumber') !== 2 || (/\//).test(mw.config.get('wgTitle')))) { // hide option for user pages, to avoid accidentally deleting user talk page
deleteOptions.append( {
type: 'checkbox',
list: [
value: 'talkpage',
name: 'talkpage',
tooltip: "'Pilihan ini juga menghapus halaman pembicaraan halaman ini. Jika Anda memilih KPC B8 (telah dipindahkan ke Commons), opsi ini tidak ditindaklanjuti dan halaman pembicaraan *tidak* dihapus."',
checked: Twinkle.getPref('deleteTalkPageOnDelete'),
event: function(event) {
disabled: Twinkle.getPref('deleteSysopDefaultToTag'),
event: function( event ) {
event.stopPropagation();
}
}
]
} );
}
deleteOptions.append( {
type: 'checkbox',
list: [
{
label: 'Hapus juga semua pengalihan',
value: 'redirects',
name: 'redirects',
tooltip: "Opsi ini juga menghapus semua pengalihan yang beralih ke halaman ini. Abaikan jika penghapusan bersifat prosedural (misalnya pindah halaman).",
checked: Twinkle.getPref('deleteRedirectsOnDelete'),
disabled: Twinkle.getPref('deleteSysopDefaultToTag'),
event: function( event ) {
event.stopPropagation();
}
}
]
} );
deleteOptions.append( {
type: 'checkbox',
list: [
{
label: 'Hapus denganjuga alasansemua beberapa kriteriapengalihan',
value: 'delmultipleredirects',
name: 'delmultipleredirects',
tooltip: "Ketika'Opsi terpilih,ini Andajuga dapatmenghapus memilihsemua beberapa kriteriapengalihan yang dapat dipakaiberalih ke halaman ini. Misalnya,Abaikan U11jika danpenghapusan A7bersifat prosedural (misalnya pindah halaman)."',
checked: Twinkle.getPref('deleteRedirectsOnDelete'),
event: function( event ) {
event: function(event) {
Twinkle.speedy.callback.modeChanged( event.target.form );
event.stopPropagation();
}
}
]
} );
deleteOptions.append( {
type: 'checkbox',
list: [
{
label: 'Buka halaman pembicaraan pengguna saat mengirimkan',
value: 'openusertalk',
name: 'openusertalk',
tooltip: 'Secara baku akan membuka preferensi buka-halaman-pembicaraan ketika menghapus halaman dengan alasan ini. Jangan ubah jika Anda memilihnya untuk menghapus dalam beberapa kriteria.',
checked : false
}
]
} );
}
 
var tagOptions = form.append( {
type: 'div',
name: 'tag_options'
} );
 
if( isSysop ) {
tagOptions.append( {
type: 'header',
label: 'Opsi terkait dengan tag'
} );
}
 
tagOptions.append( {
type: 'checkbox',
list: [
{
label: 'HubungiHapus pembuatdengan halamanalasan jikabeberapa memungkinkankriteria',
value: 'notifydelmultiple',
name: 'notifydelmultiple',
tooltip: 'Ketika terpilih, Anda dapat memilih beberapa kriteria yang dapat dipakai ke halaman. Misalnya, U11 dan A7.',
tooltip: "Templat notifikasi akan diberikan pada halaman pembicaraan pembuat halaman, JIKA Anda mengaktifkan notifikasi di preferensi Twinkle " +
event: function(event) {
"untuk kriteria yang Anda pilih DAN kotak ini diberi ceklis. Pembuat halaman akan disambut juga.",
Twinkle.speedy.callback.modeChanged(event.target.form);
checked: !isSysop || Twinkle.getPref('deleteSysopDefaultToTag'),
disabled: isSysop && !Twinkle.getPref('deleteSysopDefaultToTag'),
event: function( event ) {
event.stopPropagation();
}
}
]
} );
tagOptions deleteOptions.append( {
type: 'checkbox',
list: [
{
label: 'TandaiNotify denganpage beberapacreator tagof page deletion',
value: 'multiplewarnusertalk',
name: 'multiplewarnusertalk',
tooltip: 'A notification template will be placed on the talk page of the creator, IF you have a notification enabled in your Twinkle preferences ' +
tooltip: "Ketika dipilih, Anda dapat memilih beberapa kriteria untuk diterapkan. Contohnya, G11 dan A7 adalah gabungan umum pada artikel.",
'for the criterion you choose AND this box is checked. The creator may be welcomed as well.',
disabled: isSysop && !Twinkle.getPref('deleteSysopDefaultToTag'),
checked: !Twinkle.speedy.hasCSD,
event: function( event ) {
event: function(event) {
Twinkle.speedy.callback.modeChanged( event.target.form );
event.stopPropagation();
}
}
]
} );
}
 
var tagOptions = form.append( {
type: 'div',
name: 'work_areatag_options',
});
label: 'Gagal menginisialisasi modul KPC. Ulangi kembali atau beritahukan pengembang Twinkle mengenai masalah ini.'
} );
 
if (Morebits.userIsSysop) {
if( Twinkle.getPref( 'speedySelectionStyle' ) !== 'radioClick' ) {
formtagOptions.append( { type: 'submit' } );
type: 'header',
label: 'Opsi terkait dengan tag'
});
}
 
tagOptions.append({
type: 'checkbox',
list: [
{
label: 'Hubungi pembuat halaman jika memungkinkan',
value: 'notify',
name: 'notify',
tooltip: 'Templat notifikasi akan diberikan pada halaman pembicaraan pembuat halaman, JIKA Anda mengaktifkan notifikasi di preferensi Twinkle ' +
'untuk kriteria yang Anda pilih DAN kotak ini diberi ceklis. Pembuat halaman akan disambut juga.',
checked: !Morebits.userIsSysop || !(Twinkle.speedy.hasCSD || Twinkle.getPref('deleteSysopDefaultToDelete')),
event: function(event) {
event.stopPropagation();
}
}
]
});
tagOptions.append({
type: 'checkbox',
list: [
{
label: 'Tag for creation protection (salting) as well',
value: 'salting',
name: 'salting',
tooltip: 'When selected, the speedy deletion tag will be accompanied by a {{salt}} tag requesting that the deleting administrator apply creation protection. Only select if this page has been repeatedly recreated.',
event: function(event) {
event.stopPropagation();
}
}
]
});
tagOptions.append({
type: 'checkbox',
list: [
{
label: 'Tag with multiple criteria',
value: 'multiple',
name: 'multiple',
tooltip: 'Ketika dipilih, Anda dapat memilih beberapa kriteria untuk diterapkan. Contohnya, G11 dan A7 adalah gabungan umum pada artikel.',
event: function(event) {
Twinkle.speedy.callback.modeChanged(event.target.form);
event.stopPropagation();
}
}
]
});
 
form.append({
type: 'div',
name: 'work_area',
label: 'Gagal menginisialisasi modul KPC. Ulangi kembali atau beritahukan pengembang Twinkle mengenai masalah ini.'
});
 
if (Twinkle.getPref('speedySelectionStyle') !== 'radioClick') {
form.append({ type: 'submit', className: 'tw-speedy-submit' }); // Renamed in modeChanged
}
 
var result = form.render();
dialog.setContent( result );
dialog.display();
 
Twinkle.speedy.callback.modeChanged( result );
};
 
 
if (isSysopMode) {
$("'[name=delete_options]"').show();
$("'[name=tag_options]"').hide();
$('button.tw-speedy-submit').text('Delete page');
} else {
$("'[name=delete_options]"').hide();
$("'[name=tag_options]"').show();
$('button.tw-speedy-submit').text('Tag page');
}
 
var work_area = new Morebits.quickForm.element( {
type: 'div',
name: 'work_area'
} );
 
if (mode === Twinkle.speedy.mode.userMultipleRadioClick || mode === Twinkle.speedy.mode.sysopMultipleRadioClick) {
var evaluateType = isSysopMode ? 'evaluateSysop' : 'evaluateUser';
 
work_area.append( {
type: 'div',
label: 'Setelah selesai, klik:'
} );
work_area.append( {
type: 'button',
name: 'submit-multiple',
label: isSysopMode ? 'Hapus halaman' : 'SubmitTandai Queryhalaman',
event: function( event ) {
Twinkle.speedy.callback[evaluateType]( event );
event.stopPropagation();
}
} );
}
 
var radioOrCheckbox = (Twinkle.speedy.mode.isMultiple(mode) ? 'checkbox' : 'radio');
 
if (isSysopMode && !Twinkle.speedy.mode.isMultiple(mode)) {
work_area.append( { type: 'header', label: 'Alasan lain' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.customRationale, mode) } );
}
 
if (namespace % 2 === 1 && namespace !== 3) {
// show db-talk on talk pages, but not user talk pages
work_area.append( { type: 'header', label: 'Halaman pembicaraan' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.talkList, mode) } );
}
 
case 0: // article
case 1: // talk
work_area.append( { type: 'header', label: 'Artikel' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.articleList, mode) } );
break;
 
case 2: // user
case 3: // user talk
work_area.append( { type: 'header', label: 'Halaman pengguna' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.userList, mode) } );
break;
 
case 6: // file
case 7: // file talk
work_area.append( { type: 'header', label: 'Berkas' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.fileList, mode) } );
if (!isSysopMode) {
work_area.append( { type: 'div', label: 'Menandai untuk KPC B4 (tanpa lisensi), B5 (penggunaan wajar tak terpakai), F6 (tanpa alasan penggunaan untuk penggunaan wajar), dan F11 (tanpa izin) dapat menggunakan tab "DI".' } );
}
break;
case 10: // template
case 11: // template talk
work_area.append( { type: 'header', label: 'Templat' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.templateList, mode) } );
break;
 
case 14: // category
case 15: // category talk
work_area.append( { type: 'header', label: 'Kategori' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.categoryList, mode) } );
break;
 
case 100: // portal
case 101: // portal talk
work_area.append( { type: 'header', label: 'Portal' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.portalList, mode) } );
break;
 
}
} else {
if (namespace === 2 || namespace === 3) {
work_area.append( { type: 'header', label: 'User pages' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.userList, mode) } );
}
work_area.append( { type: 'header', label: 'Redirects' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(Twinkle.speedy.redirectList, mode) } );
}
 
 
// custom rationale lives under general criteria when tagging
if (!isSysopMode) {
generalCriteria = Twinkle.speedy.customRationale.concat(generalCriteria);
}
work_area.append( { type: 'header', label: 'Kriteria umum' } );
work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.generateCsdList(generalCriteria, mode) });
 
var old_area = Morebits.quickForm.getElements(form, "'work_area"')[0];
form.replaceChild(work_area.render(), old_area);
 
// if sysop, check if CSD is already on the page and fill in custom rationale
if (isSysopMode && $("#delete-reason")Twinkle.lengthspeedy.hasCSD) {
var customOption = $("'input[name=csd][value=reason]"')[0];
if (customOption) {
if (Twinkle.getPref('speedySelectionStyle') !== 'radioClick') {
customOption.parentNode.appendChild(customOption.subgroup);
}
customOption.subgroup.querySelector('input').value = decodeURIComponent($("'#delete-reason"').text()).replace(/\+/g, ' ');
}
}
type: 'button',
name: 'submit',
label: isSysopMode ? 'Hapus halaman' : 'KirimTandai permintaanhalaman',
event: submitSubgroupHandler
});
type: 'button',
name: 'submit', // ends up being called "csd.submit" so this is OK
label: isSysopMode ? 'Hapus halaman' : 'KirimTandai permintaanhalaman',
event: submitSubgroupHandler
}
// FIXME: does this do anything?
criterion.event = openSubgroupHandler;
}
 
if ( isSysopMode ) {
var originalEvent = criterion.event;
criterion.event = function(e) {
if (multiple) return originalEvent(e);
 
var normalizedCriterion = Twinkle.speedy.normalizeHash[e.target.value];
$('[name=openusertalk]').prop('checked',
Twinkle.getPref('openUserTalkPageOnSpeedyDelete').indexOf(normalizedCriterion) !== -1
);
if ( originalEvent ) {
return originalEvent(e);
}
};
}
 
Twinkle.speedy.customRationale = [
{
label: 'Alasan lain' + (Morebits.userIsInGroup('sysop')userIsSysop ? ' (alasan penghapusan lainnya)' : ' menggunakan kriteria templat {{db}}'),
value: 'reason',
tooltip: '{{db}} kependekan dari "dihapus karena". Sekurang-kurangnya satu kriteria harus diberikan, dan sebutkan alasannya.',
label: 'B1: Redundan atau duplikat',
value: 'redundantimage',
tooltip: 'Berkas atau media tak terpakai yang merupakan sebuah salinan, dengan format yang sama dan resolusi/kualitas yang sama/lebih rendah, dari sebuah berkas atau media lain di Wikipedia. Yang tidak termasuk di dalamnya adalah duplikat berkas atau media di Wikimedia Commons, karena alasan-alasan lisensi;',
},
{
}
},
/* {
label: 'F7: Fair-use media from a commercial image agency which is not the subject of sourced commentary',
value: 'badfairuse', // same as above
},
hideWhenMultiple: true
}, */
{
label: 'B8: Berkas yang sama persis tersedia di Wikimedia Commons',
label: 'A7: Tidak mengindikasikan kepentingan (tokoh, organisasi, isi situs)',
value: 'a7',
tooltip: 'Artikel tentang tokoh, organisasi (termasuk di dalamnya band, klub, perusahaan, dll., kecuali sekolah), atau isi situs yang tidak menunjukkan alasan mengapa subyek itu dianggap penting. Jika yang kontroversial, maka Anda dapat mengusulkan penghapusan dengan templat {{hapus}} atau membawanya ke halaman Wikipedia:Usulan penghapusan',
// hideWhenSingle: true
},
/* {
label: 'A7: UnremarkableNo indication of importance (person)',
value: 'person',
tooltip: 'An article about a real person that does not assert the importance or significance of its subject. If controversial, or if there has been a previous AfD that resulted in the article being kept, the article should be nominated for AfD instead',
},
{
label: 'A7: UnremarkableNo indication of importance (musician(s) or band)',
value: 'band',
tooltip: 'Article about a band, singer, musician, or musical ensemble that does not assert the importance or significance of the subject',
},
{
label: 'A7: UnremarkableNo indication of importance (club, society or group)',
value: 'club',
tooltip: 'Article about a club, society or group that does not assert the importance or significance of the subject',
hideWhenMultiple: true
},
{
label: 'A7: UnremarkableNo indication of importance (company or organization)',
value: 'corp',
tooltip: 'Article about a company or organization that does not assert the importance or significance of the subject',
},
{
label: 'A7: UnremarkableNo indication of importance (website or web content)',
value: 'web',
tooltip: 'Article about a web site, blog, online forum, webcomic, podcast, or similar web content that does not assert the importance or significance of its subject',
},
{
label: 'A7: UnremarkableNo indication of importance (individual animal)',
value: 'animal',
tooltip: 'Article about an individual animal (e.g. pet) that does not assert the importance or significance of its subject',
},
{
label: 'A7: UnremarkableNo indication of importance (organized event)',
value: 'event',
tooltip: 'Article about an organized event (tour, function, meeting, party, etc.) that does not assert the importance or significance of its subject',
hideWhenMultiple: true
}, */
{
label: 'A9: Artikel yang tidak mengindikasikan kepentingan (rekaman musik)',
label: 'Artikel serupa: '
}
},
/* {
label: 'A11: Obviously made up by creator, and no claim of significance',
value: 'madeup',
tooltip: 'An article which plainly indicates that the subject was invented/coined/discovered by the article\'s creator or someone they know personally, and does not credibly indicate why its subject is important or significant'
} */
];
 
value: 'userreq',
tooltip: 'Yang termasuk di dalamnya: halaman dan subhalaman pengguna (tetapi tidak halaman pembicaraan pengguna) yang diminta untuk dihapus oleh penggunanya. Dalam kasus-kasus yang langka ada kemungkinan halaman tersebut perlu dipertahankan untuk kepentingan administratif.',
subgroup: ((mw.config.get('wgNamespaceNumber') === 3 && mw.config.get('wgTitle').indexOf('/') === -1) ? {
name: 'userreq_rationale',
type: 'input',
tooltip: 'Halaman pembicaraan pengguna dihapus hanya dalam keadaan langka tertentu.',
size: 60
} : null),
hideSubgroupWhenMultiple: true
},
hideWhenMultiple: true,
hideWhenRedirect: true
},
// {*
{
// label: 'G13: AfC draft submission or a blank draft, stale by over 6 months',
label: 'G13: AfC draft submission or a blank draft, stale by over 6 months',
// value: 'afc',
value: 'afc',
// tooltip: 'Any rejected or unsubmitted AfC draft submission or a blank draft, that has not been edited in over 6 months (excluding bot edits).',
tooltip: 'Any rejected or unsubmitted AfC draft submission or a blank draft, that has not been edited in over 6 months (excluding bot edits).',
// hideWhenMultiple: true,
// hideWhenRedirect hideWhenMultiple: true,
hideWhenRedirect: true
// }
}
*/
];
 
label: 'Penjelasan lanjut: ',
size: 60
},
hideSubgroupWhenSysop: true
},
{
type: 'input',
label: 'Pilih kriteria yang berlaku: '
},
hideWhenMultiple: true
},
{
value: 'nonsense',
tooltip: 'Yang tidak termasuk di dalamnya: penulisan yang buruk, terjemahan buruk, vandalisme, materi fiktif, materi berbahasa selain bahasa Indonesia, pemberitaan palsu; namun demikian, beberapa di antara yang disebutkan dapat dihapus dengan dasar vandalisme.',
hideInNamespaces: [ 2 ] // Not applicable in userspace
},
{
value: 'test',
tooltip: 'Halaman yang dibuat untuk mencoba kode-kode wiki. Yang tidak termasuk di dalamnya: penyuntingan di halaman-halaman bernama "bak pasir" dan ruangnama pengguna.',
hideInNamespaces: [ 2 ] // Not applicable in userspace
},
{
tooltip: 'Harus dimulai dengan awalan "Wikipedia:"',
size: 60
},
hideSubgroupWhenMultiple: true
},
{
label: 'Nama pengguna (jika ada): ',
tooltip: 'Jangan dimulai dengan "Pengguna:"'
},
hideSubgroupWhenMultiple: true
},
{
hideWhenRedirect: true
},
// {*
{
// label: 'G6: XfD',
// value label: 'xfdG6: XfD',
value: 'xfd',
// tooltip: 'A deletion discussion (at AfD, FfD, RfD, TfD, CfD, or MfD) was closed as "delete", but the page wasn\'t actually deleted.',
tooltip: 'A deletion discussion (at AfD, FfD, RfD, TfD, CfD, or MfD) was closed as "delete", but the page wasn\'t actually deleted.',
// subgroup: {
subgroup: {
// name: 'xfd_fullvotepage',
// type name: 'inputxfd_fullvotepage',
type: 'input',
// label: 'Page where the deletion discussion was held: ',
label: 'Page where the deletion discussion was held: ',
// tooltip: 'Must start with "Wikipedia:"',
tooltip: 'Must start with "Wikipedia:"',
// size: 40
size: 40
// },
},
// hideWhenMultiple: true
hideWhenMultiple: true
// },
},
*/
{
label: 'U6: Pemindahan salin-tempel',
label: 'Penjelasan opsional: ',
size: 60
},
hideSubgroupWhenSysop: true
},
{
]
},
// {
// label: 'G13: Page in draft namespace or userspace AfC submission, stale by over 6 months',
// value: 'afc',
// tooltip: 'Any rejected or unsubmitted AfC submission in userspace or any non-redirect page in draft namespace, that has not been edited for more than 6 months. Blank drafts in either namespace are also included.',
// hideWhenRedirect: true,
// showInNamespaces: [2, 118] // user, draft namespaces only
// },
// {
// label: 'G14: Unnecessary disambiguation page',
// value: 'disambig',
// tooltip: 'This only applies for orphaned disambiguation pages which either: (1) disambiguate only one existing Wikipedia page and whose title ends in "(disambiguation)" (i.e., there is a primary topic); or (2) disambiguate no (zero) existing Wikipedia pages, regardless of its title. It also applies to orphan "Foo (disambiguation)" redirects that target pages that are not disambiguation or similar disambiguation-like pages (such as set index articles or lists)',
}
// hideWhenRedirect: true
// }
];
 
},
{
label: 'R4R3: Pengalihan yang baru dibuat karena kesalahan ketik atau kesalahan penamaan yang tidak disengaja',
value: 'redirtypo',
tooltip: 'Meskipun demikian, pengalihan dari kesalahan umum pengejaan atau penamaan biasanya berguna, seperti halnya pengalihan dari istilah dalam bahasa lain.'
},
// {
// label: 'R4: File namespace redirect with a name that matches a Commons page',
// value: 'redircom',
// tooltip: 'The redirect should have no incoming links (unless the links are cleary intended for the file or redirect at Commons).',
// showInNamespaces: [ 6 ]
// },
{
label: 'U6: Pengalihan ke halaman disambiguasi yang salah',
},
{
label: 'U8: Pengalihan ke target tidak sah, seperti target yang tidak ada, pengalihan ganda, dan judul yang buruk',
value: 'redirnone',
tooltip: 'Ini tidak berlaku untuk halaman berguna ke sebuah proyek, dan khususnya: diskusi penghapusan yang tidak dicatat di tempat lain, halaman pengguna dan pembicaraannya, arsip halaman pembicaraan, pengalihan yang dapat diperbaiki, dan halaman berkas dan pembicaraannya yang ada di Commons.',
hideWhenMultiple: true
},
];
 
'a10': 'a10',
'madeup': 'a11',
'rediruser': 'r3r2',
'redirtypo': 'r4r3',
// 'redircom' : 'r4',
'redundantimage': 'b1',
'noimage': 'b2',
'unksource': 'b4',
'unfree': 'b5',
'b5f5': 'b5',
'norat': 'b6',
'badfairuse': 'b7',
'nowcommons': 'b8',
'commons': 'b8',
'imgcopyvio': 'b9',
'nopermission': 'b11',
'catempty': 'k1',
'k1': 'k1',
'k2': 'k2',
'userreq': 'h1',
'nouser': 'h2',
'gallery': 'h3',
'notwebhost': 'h5',
'policy': 't3t2',
'duplicatetemplate': 't4t3',
'p1': 'p1',
'emptyportal': 'p2',
var code, parameters, i;
if (params.normalizeds.length > 1) {
code = "'{{db-multiple"';
params.utparams = {};
$.each(params.normalizeds, function(index, norm) {
code += "'|"' + norm.toUpperCase();
parameters = params.templateParams[index] || [];
for (var i in parameters) {
if (typeof parameters[i] === 'string' && !parseInt(i, 10)) { // skip numeric parameters - {{db-multiple}} doesn't understand them
code += "'|"' + i + "'="' + parameters[i];
}
}
$.extend(params.utparams, Twinkle.speedy.getUserTalkParameters(norm, parameters));
});
code += "'}}"';
} else {
parameters = params.templateParams[0] || [];
code = "'{{hapus|"' + params.values[0];
for (i in parameters) {
if (typeof parameters[i] === 'string') {
code += "'|"' + i + "'="' + parameters[i];
}
}
if (params.usertalk) {
code += "}}";
code += '|help=off';
}
code += '}}';
params.utparams = Twinkle.speedy.getUserTalkParameters(params.normalizeds[0], parameters);
}
parseWikitext: function(wikitext, callback) {
var query = {
action: "'parse"',
prop: "'text"',
pst: "'true"',
text: wikitext,
contentmodel: "'wikitext"',
title: mw.config.get("'wgPageName"')
};
 
var statusIndicator = new Morebits.status( 'Membuat ringkasan penghapusan' );
var api = new Morebits.wiki.api( 'Memilah-milah templat hapus', query, function(apiObj) {
var reason = decodeURIComponent($(apiObj.getXML().querySelector('text').childNodes[0].nodeValue).find('#delete-reason').text()).replace(/\+/g, ' ');
if (!reason) {
statusIndicator.warn( 'Tidak dapat membuat ringkasan dari templat penghapusan' );
} else {
statusIndicator.info('selesai');
}
callback(reason);
}, statusIndicator);
api.post();
},
 
noteToCreator: function(pageobj) {
var params = pageobj.getCallbackParameters();
var initialContrib = pageobj.getCreator();
 
// disallow notifying yourself
if (initialContrib === mw.config.get('wgUserName')) {
Morebits.status.warn('Anda (' + initialContrib + ') membuat halaman ini; lewati pemberitahuan');
initialContrib = null;
 
// don't notify users when their user talk page is nominated/deleted
} else if (initialContrib === mw.config.get('wgTitle') && mw.config.get('wgNamespaceNumber') === 3) {
Morebits.status.warn('Memberitahu penyunting awal: pengguna ini membuat halaman pembicaraannya sendiri; lewati pemberitahuan');
initialContrib = null;
 
// quick hack to prevent excessive unwanted notifications, per request. Should actually be configurable on recipient page...
} else if ((initialContrib === 'Cyberbot I' || initialContrib === 'SoxBot' || initialContrib === 'Kenrick95Bot') && params.normalizeds[0] === 'f2') {
Morebits.status.warn('Memberitahu kontributor awal: halaman dibuat oleh bot; lewati pemberitahuan');
initialContrib = null;
 
// Check for already existing tags
} else if (Twinkle.speedy.hasCSD && params.warnUser && !confirm('The page is has a deletion-related tag, and thus the creator has likely been notified. Do you want to notify them for this deletion as well?')) {
Morebits.status.info('Notifying initial contributor', 'canceled by user; skipping notification.');
initialContrib = null;
}
 
if (initialContrib) {
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, 'Memberitahu penyunting awal (' + initialContrib + ')'),
notifytext, i, editsummary;
 
// special cases: "db" and "db-multiple"
if (params.normalizeds.length > 1) {
notifytext = '\n{{subst:db-' + (params.warnUser ? 'deleted' : 'notice') + '-multiple|1=' + Morebits.pageNameNorm;
var count = 2;
$.each(params.normalizeds, function(index, norm) {
notifytext += '|' + count++ + '=' + norm.toUpperCase();
});
} else if (params.normalizeds[0] === 'db') {
notifytext = '\n{{subst:db-reason-' + (params.warnUser ? 'deleted' : 'notice') + '|1=' + Morebits.pageNameNorm;
} else {
notifytext = '\n{{subst:db-csd-' + (params.warnUser ? 'deleted' : 'notice') + '-custom|1=';
if (params.values[0] === 'copypaste') {
notifytext += params.templateParams[0].sourcepage;
} else {
notifytext += Morebits.pageNameNorm;
statusIndicator.info( 'selesai' );
}
notifytext += '|2=' + params.values[0];
callback(reason);
}
}, statusIndicator);
 
api.post();
for (i in params.utparams) {
if (typeof params.utparams[i] === 'string') {
notifytext += '|' + i + '=' + params.utparams[i];
}
}
notifytext += (params.welcomeuser ? '' : '|nowelcome=yes') + '}} ~~~~';
 
editsummary = 'Pemberitahuan: ' + (params.warnUser ? '' : ' nominasi ') + 'penghapusan cepat';
if (params.normalizeds.indexOf('g10') === -1) { // no article name in summary for G10 taggings
editsummary += ' untuk [[:' + Morebits.pageNameNorm + ']].';
} else {
editsummary += ' dari halaman serangan.';
}
 
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
usertalkpage.setCreateOption('recreate');
usertalkpage.setFollowRedirect(true);
usertalkpage.append(function onNotifySuccess() {
// add this nomination to the user's userspace log, if the user has enabled it
if (params.lognomination) {
Twinkle.speedy.callbacks.user.addToLog(params, initialContrib);
}
}, function onNotifyError() {
// if user could not be notified, log nomination without mentioning that notification was sent
if (params.lognomination) {
Twinkle.speedy.callbacks.user.addToLog(params, null);
}
});
} else if (params.lognomination) {
// log nomination even if the user notification wasn't sent
Twinkle.speedy.callbacks.user.addToLog(params, null);
}
},
 
sysop: {
main: function( params ) {
var reason;
 
if (!params.normalizeds.length && params.normalizeds[0] === 'db') {
reason = prompt('"Masukkan alasan penghapusan yang akan digunakan untuk catatan penghapusan:"', ""'');
Twinkle.speedy.callbacks.sysop.deletePage( reason, params );
} else {
var code = Twinkle.speedy.callbacks.getTemplateCodeAndParams(params)[0];
Twinkle.speedy.callbacks.parseWikitext(code, function(reason) {
if (params.promptForSummary) {
reason = prompt("'Masukkan alasan penghapusan yang digunakan, atau klik OK untuk menerima yang dibuat secara otomatis."', reason);
}
Twinkle.speedy.callbacks.sysop.deletePage( reason, params );
});
}
},
deletePage: function( reason, params ) {
var thispage = new Morebits.wiki.page( mw.config.get('wgPageName'), "'Menghapus halaman" ');
 
if (reason === null) {
return Morebits.status.error("'Meminta alasan"', "'Dibatalkan"');
} else if (!reason || !reason.replace(/^\s*/, ""'').replace(/\s*$/, ""'')) {
return Morebits.status.error("'Meminta alasan"', "'Anda tidak memberikan apa pun. Saya tidak tahu... apa yang terjadi dengan pengurus dan antek apatisnya... Saya menyerah..."');
}
 
thispage.setEditSummary( reason + Twinkle.getPref('deletionSummaryAd') );
thispage.deletePage(var deleteMain = function(callback) {
thispage.getStatusElementsetEditSummary()reason + Twinkle.infogetPref("selesai"'deletionSummaryAd'));
thispage.deletePage(function() {
Twinkle.speedy.callbacks.sysop.deleteTalk( params );
thispage.getStatusElement().info('done');
});
typeof callback === 'function' && callback();
Twinkle.speedy.callbacks.sysop.deleteTalk(params);
});
};
 
// look up initial contributor. If prompting user for deletion reason, just display a link.
// Otherwise open the talk page directly
if ( params.openUserTalk warnUser) {
thispage.setCallbackParameters( params );
thispage.lookupCreation(function(pageobj) {
thispage.lookupCreator( Twinkle.speedy.callbacks.sysop.openUserTalkPage );
deleteMain(function() {
Twinkle.speedy.callbacks.noteToCreator(pageobj);
});
});
} else {
deleteMain();
}
},
deleteTalk: function( params ) {
// delete talk page
if (params.deleteTalkPage &&
params.normalized !== 'f8' &&
document.getElementById( 'ca-talk' ).className !== 'new') {
var talkpage = new Morebits.wiki.page( mw.config.get('wgFormattedNamespaces')[ mw.config.get('wgNamespaceNumber') + 1 ] + ':' + mw.config.get('wgTitle'), "'Menghapus halaman pembicaraan" ');
talkpage.setEditSummary('[[WP:KPC#U8|U8]]: Halaman pembicaraan dari halaman yang telah dihapus: "' + Morebits.pageNameNorm + '"' + Twinkle.getPref('deletionSummaryAd'));
talkpage.deletePage();
// this is ugly, but because of the architecture of wiki.api, it is needed
// (otherwise success/failure messages for the previous action would be suppressed)
window.setTimeout(function() { Twinkle.speedy.callbacks.sysop.deleteRedirects( params ); }, 1800);
Twinkle.speedy.callbacks.sysop.deleteRedirects(params);
}, 1800);
} else {
Twinkle.speedy.callbacks.sysop.deleteRedirects( params );
}
},
deleteRedirects: function( params ) {
// delete redirects
if (params.deleteRedirects) {
'titles': mw.config.get('wgPageName'),
'prop': 'redirects',
'rdlimit': 5000 'max' // 500 is max for normal users, 5000 for bots and sysops
};
var wikipedia_api = new Morebits.wiki.api( 'mencari daftar pengalihan...', query, Twinkle.speedy.callbacks.sysop.deleteRedirectsMain,
new Morebits.status( 'Menghapus halaman pengalihan' ) );
wikipedia_api.params = params;
wikipedia_api.post();
// promote Unlink tool
var $link, $bigtext;
if( (mw.config.get('wgNamespaceNumber') === 6 && params.normalized !== 'f8' ) {
$link = $('<a/>', {
'href': '#',
'text': 'Klik di sini untuk mengakses alat Unlink',
'css': { 'fontSize': '100130%', 'fontWeight': 'bold' },
'click': function() {
Morebits.wiki.actionCompleted.redirect = null;
Twinkle.speedy.dialog.close();
Twinkle.unlink.callback("'Menghapus pranala balik ke halaman yang dihapus "' + Morebits.pageNameNorm);
}
});
'href': '#',
'text': 'Klik di sini untuk mengakses alat Unlink',
'css': { 'fontSize': '100130%', 'fontWeight': 'bold' },
'click': function() {
Morebits.wiki.actionCompleted.redirect = null;
Twinkle.speedy.dialog.close();
Twinkle.unlink.callback("'Menghapus pranala balik ke halaman yang dihapus "' + Morebits.pageNameNorm);
}
});
}
},
openUserTalkPagedeleteRedirectsMain: function( pageobj apiobj) {
pageobj.getStatusElement().unlink(); // don't need it anymore
var user = pageobj.getCreator();
var params = pageobj.getCallbackParameters();
 
var query = {
'title': 'User talk:' + user,
'action': 'edit',
'preview': 'yes',
'vanarticle': Morebits.pageNameNorm
};
 
if (params.normalized === 'db' || Twinkle.getPref("promptForSpeedyDeletionSummary").indexOf(params.normalized) !== -1) {
// provide a link to the user talk page
var $link, $bigtext;
$link = $('<a/>', {
'href': mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ),
'text': 'Klik di sini untuk membuka Pembicaraan Pengguna: ' + user,
'target': '_blank',
'css': { 'fontSize': '100%', 'fontWeight': 'bold' }
});
$bigtext = $('<span/>', {
'text': 'Beritahu pembuat halaman',
'css': { 'fontSize': '100%', 'fontWeight': 'bold' }
});
Morebits.status.info($bigtext[0], $link[0]);
} else {
// open the initial contributor's talk page
var statusIndicator = new Morebits.status('Membuka kotak penyuntingan halaman pembicaraan pengguna untuk ' + user, 'sedang membuka...');
 
switch( Twinkle.getPref('userTalkPageMode') ) {
case 'tab':
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ), '_blank' );
break;
case 'blank':
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ), '_blank', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' );
break;
case 'window':
/* falls through */
default:
window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ),
( window.name === 'twinklewarnwindow' ? '_blank' : 'twinklewarnwindow' ),
'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' );
break;
}
 
statusIndicator.info( 'selesai' );
}
},
deleteRedirectsMain: function( apiobj ) {
var xmlDoc = apiobj.getXML();
var $snapshot = $(xmlDoc).find('redirects rd');
var statusIndicator = apiobj.statelem;
 
if ( !total ) {
statusIndicator.status("'tidak ada pengalihan yang ditemukan"');
return;
}
 
statusIndicator.status("'0%"');
 
var current = 0;
var onsuccess = function( apiobjInner ) {
var now = parseInt( 100 * (++current) / total, 10 ) + '%';
statusIndicator.update( now );
apiobjInner.statelem.unlink();
if ( current >= total ) {
statusIndicator.info( now + ' (selesai)' );
Morebits.wiki.removeCheckpoint();
}
// defaults to /doc for lua modules, which may not exist
if (!pageobj.exists() && mw.config.get('wgPageContentModel') !== 'Scribunto') {
statelem.error( "'Sepertinya halaman ini tidak ada; mungkin telah dihapus" ');
return;
}
var params = pageobj.getCallbackParameters();
 
statelem.status( 'Memeriksa tag di halaman...' );
 
// check for existing deletion tags
var tag = /(?:\{\{\s*(db|delete|hapus|hapus:|penghapusan|db-.*?|speedy deletion-.*?)(?:\s*\||\s*\}\}))/.exec( text );
// This won't make use of the db-multiple template but it probably should
if( (tag && !confirm( "'Templat yang berhubungan dengan penghapusan {{"' + tag[1] + "'}} ditemukan di halaman. Apakah Anda masih ingin menambahkan templat KPC?" ') ) {
return;
}
 
var xfd = /\{\{((?:article for deletion|proposed deletion|prod blp|template for discussion)\/dated|[cfm]fd\b)/i.exec( text ) || /#invoke:(RfD)/.exec(text);
if( (xfd && !confirm( "'Templat yang berhubungan dengan penghapusan {{"' + xfd[1] + "'}} telah ada di halaman ini. Apakah Anda masih ingin menambahkan templat KPC?" ') ) {
return;
}
params.utparams = buildData[1];
 
// curate/patrol the page
var thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
if (Twinkle.getPref('markSpeedyPagesAsPatrolled')) {
// patrol the page, if reached from Special:NewPages
pageobj.triage();
if( Twinkle.getPref('markSpeedyPagesAsPatrolled') ) {
thispage.patrol();
}
 
// Won't work with userboxes in userspace, or any other transcluded page outside template space
if (mw.config.get('wgNamespaceNumber') === 10) { // Template:
code = "'<noinclude>"' + code + "'</noinclude>"';
}
 
// Remove tags that become superfluous with this action
text = text.replace(/\{\{\s*([Uu]serspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/g, ""'');
if (mw.config.get('wgNamespaceNumber') === 6) {
// remove "move to Commons" tag - deletion-tagged files cannot be moved to Commons
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi, ""'');
}
 
if (params.requestsalt) {
if (params.normalizeds.indexOf('g10') === -1) {
code = code + '\n{{salt}}';
} else {
code = '{{salt}}\n' + code;
}
}
 
editsummary = editsummary.substr(0, editsummary.length - 2); // remove trailing comma
editsummary += ').';
} else if (params.normalizeds[0] === "'db"') {
editsummary = 'Meminta [[WP:KPC|penghapusan cepat]] dengan alasan "' + params.templateParams[0]["'1"'] + '".';
} else {
editsummary = "'Meminta penghapusan cepat ([[WP:KPC#"' + params.normalizeds[0].toUpperCase() + "'|KPC "' + params.normalizeds[0].toUpperCase() + "']])."';
}
 
// Set the correct value for |ts= parameter in {{db-g13}}
pageobj.setPageText(code + ((params.normalizeds.indexOf('g10') !== -1) ? '' : ("\n" + text) )); // cause attack pages to be blanked
if (params.normalizeds.indexOf('u13') !== -1) {
code = code.replace('$TIMESTAMP', pageobj.getLastEditTime());
}
 
pageobj.setPageText(code + (params.normalizeds.indexOf('g10') !== -1 ? '' : '\n' + text)); // cause attack pages to be blanked
pageobj.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
pageobj.setWatchlist(params.watch);
if (params.scribunto) {
pageobj.setCreateOption('recreate'); // Module /doc might not exist
pageobj.setCreateOption('recreate'); // Module /doc might not exist
if (params.watch) {
// Watch module in addition to /doc subpage
var watch_query = {
action: 'watch',
titles: mw.config.get('wgPageName'),
token: mw.user.tokens.get('watchToken')
};
new Morebits.wiki.api('Adding Module to watchlist', watch_query).post();
}
}
pageobj.save(Twinkle.speedy.callbacks.user.tagComplete);
},
var params = pageobj.getCallbackParameters();
 
// Notification to first contributor, will also log nomination to the user's userspace log
if (params.usertalk) {
var callback = function(pageobj) {
var initialContrib = pageobj.getCreator();
 
// disallow warning yourself
if (initialContrib === mw.config.get('wgUserName')) {
Morebits.status.warn("Anda (" + initialContrib + ") membuat halaman ini; lewati pemberitahuan");
initialContrib = null;
 
// don't notify users when their user talk page is nominated
} else if (initialContrib === mw.config.get('wgTitle') && mw.config.get('wgNamespaceNumber') === 3) {
Morebits.status.warn("Memberitahu penyunting awal: pengguna ini membuat halaman pembicaraannya sendiri; lewati pemberitahuan");
initialContrib = null;
 
// quick hack to prevent excessive unwanted notifications, per request. Should actually be configurable on recipient page...
} else if ((initialContrib === "Cyberbot I" || initialContrib === "SoxBot" || initialContrib === "Kenrick95Bot") && params.normalizeds[0] === "f2") {
Morebits.status.warn("Memberitahu kontributor awal: halaman dibuat oleh bot; lewati pemberitahuan");
initialContrib = null;
 
} else {
var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Memberitahu penyunting awal (" + initialContrib + ")"),
notifytext, i;
 
// specialcase "db" and "db-multiple"
if (params.normalizeds.length > 1) {
notifytext = "\n{{subst:db-notice-multiple|1=" + Morebits.pageNameNorm;
var count = 2;
$.each(params.normalizeds, function(index, norm) {
notifytext += "|" + (count++) + "=" + norm.toUpperCase();
});
} else if (params.normalizeds[0] === "db") {
notifytext = "\n{{subst:db-reason-notice|1=" + Morebits.pageNameNorm;
} else {
notifytext = "\n{{subst:db-csd-notice-custom|1=" + Morebits.pageNameNorm + "|2=" + params.values[0];
}
 
for (i in params.utparams) {
if (typeof params.utparams[i] === 'string') {
notifytext += "|" + i + "=" + params.utparams[i];
}
}
notifytext += (params.welcomeuser ? "" : "|nowelcome=yes") + "}} ~~~~";
 
var editsummary = "Pemberitahuan: nominasi penghapusan cepat";
if (params.normalizeds.indexOf("g10") === -1) { // no article name in summary for G10 taggings
editsummary += " untuk [[:" + Morebits.pageNameNorm + "]].";
} else {
editsummary += " dari halaman serangan.";
}
 
usertalkpage.setAppendText(notifytext);
usertalkpage.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
usertalkpage.setCreateOption('recreate');
usertalkpage.setFollowRedirect(true);
usertalkpage.append(function onNotifySuccess() {
// add this nomination to the user's userspace log, if the user has enabled it
if (params.lognomination) {
Twinkle.speedy.callbacks.user.addToLog(params, initialContrib);
}
}, function onNotifyError() {
// if user could not be notified, log nomination without mentioning that notification was sent
if (params.lognomination) {
Twinkle.speedy.callbacks.user.addToLog(params, null);
}
});
}
 
 
};
var thispage = new Morebits.wiki.page(Morebits.pageNameNorm);
thispage.lookupCreatorsetCallbackParameters(callbackparams);
thispage.lookupCreation(Twinkle.speedy.callbacks.noteToCreator);
}
// or, if not notifying, add this nomination to the user's userspace log without the initial contributor's name
} else if (params.lognomination) {
Twinkle.speedy.callbacks.user.addToLog(params, null);
}
// for DI: params.fromDI = true, params.templatename, params.normalized (note: normalized is a string)
addToLog: function(params, initialContrib) {
var wikipedia_pageusl = new Morebits.wiki.pageuserspaceLogger("User:" + mw.config.get('wgUserName') + "/" + Twinkle.getPref('speedyLogPageName'), "Menambahkan entri ke log ruangnama pengguna");
usl.initialText =
params.logInitialContrib = initialContrib;
'Ini adalah log semua nominasi [[WP:KPC|penghapusan cepat]] yang dibuat oleh pengguna ini dengan menggunakan modul KPC [[WP:TW|Twinkle]].\n\n' +
wikipedia_page.setCallbackParameters(params);
'Jika Anda tidak ingin menyimpan log ini, Anda dapat mematikannya di [[Wikipedia:Twinkle/Preferences|panel preferensi]], dan ' +
wikipedia_page.load(Twinkle.speedy.callbacks.user.saveLog);
'menominasikan halaman ini untuk dihapus di bawah [[WP:KPC#H1|KPC U1]].' +
},
(Morebits.userIsSysop ? '\n\nLog ini tidak mencatat penghapusan cepat yang dibuat menggunakan Twinkle.' : '');
 
saveLog: function(pageobj) {
var text = pageobj.getPageText();
var params = pageobj.getCallbackParameters();
 
var appendText = "";
 
// add blurb if log page doesn't exist
if (!pageobj.exists()) {
appendText +=
"Ini adalah log semua nominasi [[WP:KPC|penghapusan cepat]] yang dibuat oleh pengguna ini dengan menggunakan modul KPC [[WP:TW|Twinkle]].\n\n" +
"Jika Anda tidak ingin menyimpan log ini, Anda dapat mematikannya di [[Wikipedia:Twinkle/Preferences|panel preferensi]], dan " +
"menominasikan halaman ini untuk dihapus di bawah [[WP:KPC#H1|KPC U1]].\n";
if (Morebits.userIsInGroup("sysop")) {
appendText += "\n\nLog ini tidak mencatat penghapusan cepat yang dibuat menggunakan Twinkle.";
}
}
 
// create monthly header
var date = new Date();
var headerRe = new RegExp("^==+\\s*" + date.getUTCMonthName() + "\\s+" + date.getUTCFullYear() + "\\s*==+", "m");
if (!headerRe.exec(text)) {
appendText += "\n\n=== " + date.getUTCMonthName() + " " + date.getUTCFullYear() + " ===";
}
 
var formatParamLog = function(normalize, csdparam, input) {
if ((normalize === 'G4' && csdparam === 'xfd') || (normalize === 'G6' && csdparam === 'page') || (normalize === 'G6' && csdparam === 'fullvotepage') || (normalize === 'G6' && csdparam === 'sourcepage')
|| (normalize === 'A2G6' && csdparam === 'sourcepage') || (normalize === 'A10' && csdparam === 'article') || (normalize === 'F5' && csdparam === 'replacement')) {
(normalize === 'G6' && csdparam === 'fullvotepage') ||
(normalize === 'G6' && csdparam === 'sourcepage') ||
(normalize === 'A2' && csdparam === 'source') ||
(normalize === 'A10' && csdparam === 'article') ||
(normalize === 'F1' && csdparam === 'filename') ||
(normalize === 'F5' && csdparam === 'replacement')) {
input = '[[:' + input + ']]';
} else if (normalize === 'G5' && csdparam === 'user') {
} else if (normalize === 'G12' && csdparam.lastIndexOf('url', 0) === 0 && input.lastIndexOf('http', 0) === 0) {
input = '[' + input + ' ' + input + ']';
} else if (normalize === 'F1' && csdparam === 'filename') {
input = '[[:File:' + input + ']]';
} else if (normalize === 'T3' && csdparam === 'template') {
input = '[[:Template:' + input + ']]';
 
// If a logged file is deleted but exists on commons, the wikilink will be blue, so provide a link to the log
var fileLogLink = mw.config.get('wgNamespaceNumber') === 6 ? ' ([{{fullurl:Special:Log|page=' + mw.util.wikiUrlencode (mw.config.get('wgPageName')) + '}} log])' : '';
 
var editsummary = "'Mencatat pengusulan penghapusan cepat"';
var appendText += "\n'# [[:"' + Morebits.pageNameNorm;
 
if (params.fromDI) {
appendText += "']]"' + fileLogLink + "': DI [[WP:KPC#"' + params.normalized.toUpperCase() + "'|KPC "' + params.normalized.toUpperCase() + "']]"';// ({{tl|di-"' + params.templatename + "'}})"';
// The params data structure when coming from DI is quite different,
// so this hardcodes the only interesting items worth logging
}
});
editsummary += "' of [[:"' + Morebits.pageNameNorm + "']]."';
} else {
if (params.normalizeds.indexOf("'g10"') === -1) { // no article name in log for G10 taggings
appendText += "']]"' + fileLogLink + "': "';
editsummary += "' of [[:"' + Morebits.pageNameNorm + "']]."';
} else {
appendText += "'|This]] attack page"' + fileLogLink + "': "';
editsummary += "' of an attack page."';
}
if (params.normalizeds.length > 1) {
appendText += "'berbagai kriteria ("';
$.each(params.normalizeds, function(index, norm) {
appendText += "'[[WP:KPC#"' + norm.toUpperCase() + "'|"' + norm.toUpperCase() + ']], ';
});
appendText = appendText.substr(0, appendText.length - 2); // remove trailing comma
appendText += ')';
} else if (params.normalizeds[0] === "'db"') {
appendText += "'{{tl|db-reason}}"';
} else {
appendText += "'[[WP:KPC#"' + params.normalizeds[0].toUpperCase() + "'|KPC "' + params.normalizeds[0].toUpperCase() + "']] ({{tl|db-"' + params.values[0] + "'}})"';
}
 
// Treat custom rationale individually
if (params.normalizeds[0] && params.normalizeds[0] === 'db') {
extraInfo += formatParamLog('Custom', 'rationale', params.templateParams[0]["'1"']);
} else {
params.templateParams.forEach(function(item, index) {
var keys = Object.keys(item);
if (keys[0] !== undefined && keys[0].length > 0) {
// Second loop required since some items (G12, F9) may have multiple keys
keys.forEach(function(key, keyIndex) {
if (keys[keyIndex] === 'blanked' || keys[keyIndex] === 'ts') {
return true; // Not worth logging
} else {
extraInfo += formatParamLog(params.normalizeds[index].toUpperCase(), keys[keyIndex], item[key]);
}
extraInfo += formatParamLog(params.normalizeds[index].toUpperCase(), keys[keyIndex], item[key]);
});
}
}
 
if (params.requestsalt) {
appendText += '; requested creation protection ([[WP:SALT|salting]])';
}
if (extraInfo) {
appendText += '; informasi tambahan:' + extraInfo;
}
if (params.logInitialContribinitialContrib) {
appendText += "'; memberitahukan {{user|1="' + params.logInitialContribinitialContrib + "'}}"';
}
appendText += "' ~~~~~\n"';
 
usl.log(appendText, editsummary + Twinkle.getPref('summaryAd'));
 
pageobj.setAppendText(appendText);
pageobj.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
pageobj.setCreateOption("recreate");
pageobj.append();
}
}
switch (value) {
case 'reason':
if (form["'csd.reason_1"']) {
var dbrationale = form["'csd.reason_1"'].value;
if (!dbrationale || !dbrationale.trim()) {
alert( 'Alasan lainnya: Mohon tulis alasan!' );
parameters = null;
return false;
}
currentParams["'1"'] = dbrationale;
}
break;
 
case 'userreq': // U1
if (form["'csd.userreq_rationale"']) {
var u1rationale = form["'csd.userreq_rationale"'].value;
if (mw.config.get('wgNamespaceNumber') === 3 && !((/\//).test(mw.config.get('wgTitle'))) &&
(!u1rationale || !u1rationale.trim())) {
alert( 'KPC H1: Mohon tuliskan alasan ketika mengusulkan penghapusan halaman pembiaraan pengguna.' );
parameters = null;
return false;
 
case 'repost': // G4
if (form["'csd.repost_xfd"']) {
var deldisc = form["'csd.repost_xfd"'].value;
if (deldisc) {
if (!/^(?:wp|wikipedia):/i.test(deldisc)) {
if (deldisc.substring(0, 9) !== "Wikipedia" && deldisc.substring(0, 3) !== "WP:") {
alert( 'KPC U4: Penghapusan halaman diskusi, jika ada, harus dimulai dengan "Wikipedia:".' );
parameters = null;
return false;
 
case 'banned': // G5
if (form["'csd.banned_user"'] && form["'csd.banned_user"'].value) {
currentParams.user = form["'csd.banned_user"'].value.replace(/^\s*User:/i, ""'');
}
break;
 
case 'move': // G6
if (form["'csd.move_page"'] && form["'csd.move_reason"']) {
var movepage = form["'csd.move_page"'].value,
movereason = form["'csd.move_reason"'].value;
if (!movepage || !movepage.trim()) {
alert( 'KPC U6 (move): Mohon tuliskan nama halaman yang akan dipindahkan ke sini.' );
parameters = null;
return false;
}
if (!movereason || !movereason.trim()) {
alert( 'KPC U6 (move): Mohon tuliskan alasan pemindahan.' );
parameters = null;
return false;
break;
 
// case 'xfd': // G6
// if (form["'csd.xfd_fullvotepage"']) {
// var xfd = form["'csd.xfd_fullvotepage"'].value;
// if (xfd) {
if (!/^(?:wp|wikipedia):/i.test(xfd)) {
// if (xfd.substring(0, 9) !== "Wikipedia" && xfd.substring(0, 3) !== "WP:") {
// alert( 'CSD G6 (XFD): The deletion discussion page name, if provided, must start with "Wikipedia:".' );
// parameters = null;
// return false;
// }
// currentParams.fullvotepage = xfd;
// }
// }
// break;
 
case 'copypaste': // G6
if (form["'csd.copypaste_sourcepage"']) {
var copypaste = form["'csd.copypaste_sourcepage"'].value;
if (!copypaste || !copypaste.trim()) {
alert( 'KPC U6 (salin-tempel): Mohon tuliskan halaman sumber.' );
parameters = null;
return false;
 
case 'g6': // G6
if (form["'csd.g6_rationale"'] && form["'csd.g6_rationale"'].value) {
currentParams.rationale = form["'csd.g6_rationale"'].value;
}
break;
 
case 'author': // G7
if (form["'csd.author_rationale"'] && form["'csd.author_rationale"'].value) {
currentParams.rationale = form["'csd.author_rationale"'].value;
}
break;
 
case 'g8': // G8
if (form["'csd.g8_rationale"'] && form["'csd.g8_rationale"'].value) {
currentParams.rationale = form["'csd.g8_rationale"'].value;
}
break;
 
case 'copyvio': // G12
if (form["'csd.copyvio_url"'] && form["'csd.copyvio_url"'].value) {
currentParams.url = form["'csd.copyvio_url"'].value;
}
if (form["'csd.copyvio_url2"'] && form["'csd.copyvio_url2"'].value) {
currentParams.url2 = form["'csd.copyvio_url2"'].value;
}
if (form["'csd.copyvio_url3"'] && form["'csd.copyvio_url3"'].value) {
currentParams.url3 = form["'csd.copyvio_url3"'].value;
}
break;
 
case 'afc': // G13
currentParams.ts = '$TIMESTAMP'; // to be replaced by the last revision timestamp when page is saved
var query = {
action: "query",
titles: mw.config.get("wgPageName"),
prop: "revisions",
rvprop: "timestamp"
},
api = new Morebits.wiki.api( 'Mengambil waktu revisi terakhir', query, function( apiobj ) {
var xmlDoc = apiobj.getXML(),
isoDateString = $(xmlDoc).find("rev").attr("timestamp");
 
currentParams.ts = isoDateString;
});
 
// Wait for API call to finish
api.post({
async: false
});
 
break;
 
case 'redundantimage': // F1
if (form["'csd.redundantimage_filename"']) {
var redimage = form["'csd.redundantimage_filename"'].value;
if (!redimage || !redimage.trim()) {
alert( 'KPC B1: Mohon tuliskan nama berkas yang lain.' );
parameters = null;
return false;
}
currentParams.filename = redimage.replace(/^\s*(Image|File):/i, "".test(redimage) ? redimage : 'File:' + redimage;
}
break;
 
case 'badfairuse': // F7
if (form["'csd.badfairuse_rationale"'] && form["'csd.badfairuse_rationale"'].value) {
currentParams.rationale = form["'csd.badfairuse_rationale"'].value;
}
break;
 
case 'commons': // F8
if (form["'csd.commons_filename"']) {
var filename = form["'csd.commons_filename"'].value;
if (filename && filename.trim() && filename !== Morebits.pageNameNorm) {
currentParams.filename = /^\s*(filename.indexOf("Image|File):") === 0 || filename/i.indexOftest("File:") === 0filename) ? filename : "'File:"' + filename;
}
}
 
case 'imgcopyvio': // F9
if (form["'csd.imgcopyvio_url"'] && form["'csd.imgcopyvio_rationale"']) {
var f9url = form["'csd.imgcopyvio_url"'].value;
var f9rationale = form["'csd.imgcopyvio_rationale"'].value;
if ((!f9url || !f9url.trim()) && (!f9rationale || !f9rationale.trim())) {
alert( 'CSD F9: You must enter a url or reason (or both) when nominating a file under F9.' );
parameters = null;
return false;
}
if (form["'csd.imgcopyvio_url"'].value) {
currentParams.url = f9url;
}
if (form["'csd.imgcopyvio_rationale"'].value) {
currentParams.rationale = f9rationale;
}
 
case 'foreign': // A2
if (form["'csd.foreign_source"']) {
var foreignlink = form["'csd.foreign_source"'].value;
if (!foreignlink || !foreignlink.trim()) {
alert( 'KPC A2: Mohon tuliskan pranala antarwiki ke artikel yang memuat artikel ini sebagai salinan.' );
parameters = null;
return false;
 
case 'transwiki': // A5
if (form["'csd.transwiki_location"'] && form["'csd.transwiki_location"'].value) {
currentParams.location = form["'csd.transwiki_location"'].value;
}
break;
 
case 'a10': // A10
if (form["'csd.a10_article"']) {
var duptitle = form["'csd.a10_article"'].value;
if (!duptitle || !duptitle.trim()) {
alert( 'KPC A10: Mohon tuliskan nama artikel duplikat.' );
parameters = null;
return false;
 
case 'policy': // T2
if (form["'csd.policy_rationale"'] && form["'csd.policy_rationale"'].value) {
currentParams.rationale = form["'csd.policy_rationale"'].value;
}
break;
 
case 'duplicatetemplate': // T3
if (form["'csd.duplicatetemplate_2"']) {
var t3template = form["'csd.duplicatetemplate_2"'].value;
if (!t3template || !t3template.trim()) {
alert( 'KPC T3: Mohon tuliskan nama templat duplikat.' );
parameters = null;
return false;
}
currentParams.ts = "'~~~~~"';
currentParams.template = t3template.replace(/^\s*Template:/i, ""'');
}
break;
 
case 'p1': // P1
if (form["'csd.p1_criterion"']) {
var criterion = form["'csd.p1_criterion"'].value;
if (!criterion || !criterion.trim()) {
alert( 'KPC P1: Mohon tuliskan kriteria KPC yang sesuai.' );
parameters = null;
return false;
};
 
// functionFunction for processing talk page notification template parameters
// key1/value1: for {{db-criterion-[notice|deleted]}} (via {{db-csd-[notice|deleted]-custom}})
// utparams.param: for {{db-[notice|deleted]-multiple}}
Twinkle.speedy.getUserTalkParameters = function twinklespeedyGetUserTalkParameters(normalized, parameters) {
var utparams = [];
 
switch (normalized) {
// Special cases
case 'db':
if (normalized === 'db') {
utparams["2"] = parameters["1"];
utparams['2'] = parameters['1'];
break;
} else if (normalized === 'g6') {
case 'g12':
utparams.key1 = "url"'to';
utparams.value1 = utparams.url = parametersMorebits.urlpageNameNorm;
} else if (normalized === 'g12') {
break;
['url', 'url2', 'url3'].forEach(function(item, idx) {
case 'a10':
if (parameters[item]) {
utparams.key1 = "article";
idx++;
utparams.value1 = utparams.article = parameters.article;
utparams['key' + idx] = item;
break;
utparams['value' + idx] = utparams[item] = parameters[item];
default:
break;}
});
} else {
// Handle the rest
var param;
switch (normalized) {
case 'g4':
param = 'xfd';
break;
case 'a2':
param = 'source';
break;
case 'a5':
param = 'location';
break;
case 'a10':
param = 'article';
break;
case 'f9':
param = 'url';
break;
case 'p1':
param = 'criterion';
break;
default:
break;
}
// No harm in providing a usertalk template with the others' parameters
if (param && parameters[param]) {
utparams.key1 = param;
utparams.value1 = utparams[param] = parameters[param];
}
}
return utparams;
var values = (e.target.form ? e.target.form : e.target).getChecked('csd');
if (values.length === 0) {
alert( "'Mohon tuliskan kriteria yang sesuai!" ');
return null;
}
 
Twinkle.speedy.callback.evaluateSysop = function twinklespeedyCallbackEvaluateSysop(e) {
var form = (e.target.form ? e.target.form : e.target);
 
if (e.target.type === "'checkbox"' || e.target.type === "'text"' ||
e.target.type === "'select"') {
return;
}
 
var tag_only = form.tag_only;
if ( tag_only && tag_only.checked ) {
Twinkle.speedy.callback.evaluateUser(e);
return;
var values = Twinkle.speedy.resolveCsdValues(e);
if (!values) {
return;
}
var templateParams = Twinkle.speedy.getParameters(form, values);
if (!templateParams) {
return;
}
 
var normalizeds = values.map(function(value) {
return Twinkle.speedy.normalizeHash[ value ];
});
 
// analyse each criterion to determine whether to watch the page, prompt for summary, or opennotify userthe talk pagecreator
var watchPage, promptForSummary;
normalizeds.forEach(function(norm) {
if (Twinkle.getPref("'watchSpeedyPages"').indexOf(norm) !== -1) {
watchPage = true;
}
if (Twinkle.getPref("'promptForSpeedyDeletionSummary"').indexOf(norm) !== -1) {
promptForSummary = true;
}
});
 
var warnusertalk = false;
if (form.warnusertalk.checked) {
$.each(normalizeds, function(index, norm) {
if (Twinkle.getPref('warnUserOnSpeedyDelete').indexOf(norm) !== -1) {
if (norm === 'g6' && values[index] !== 'copypaste') {
return true;
}
warnusertalk = true;
return false; // break
}
});
}
 
var welcomeuser = false;
if (warnusertalk) {
$.each(normalizeds, function(index, norm) {
if (Twinkle.getPref('welcomeUserOnSpeedyDeletionNotification').indexOf(norm) !== -1) {
welcomeuser = true;
return false; // break
}
});
}
 
var params = {
deleteTalkPage: form.talkpage && form.talkpage.checked,
deleteRedirects: form.redirects.checked,
warnUser: warnusertalk,
openUserTalk: form.openusertalk.checked,
welcomeuser: welcomeuser,
promptForSummary: promptForSummary,
templateParams: Twinkle.speedy.getParameters( form, values )templateParams
};
if(!params.templateParams) {
return;
}
 
Morebits.simpleWindow.setButtonsEnabled( false );
Morebits.status.init( form );
 
Twinkle.speedy.callbacks.sysop.main( params );
};
 
Twinkle.speedy.callback.evaluateUser = function twinklespeedyCallbackEvaluateUser(e) {
var form = (e.target.form ? e.target.form : e.target);
 
if (e.target.type === "'checkbox"' || e.target.type === "'text"' ||
e.target.type === "'select"') {
return;
}
return;
}
var templateParams = Twinkle.speedy.getParameters(form, values);
//var multiple = form.multiple.checked;
if (!templateParams) {
return;
}
 
// var multiple = form.multiple.checked;
var normalizeds = [];
$.each(values, function(index, value) {
var norm = Twinkle.speedy.normalizeHash[ value ];
 
normalizeds.push(norm);
welcomeuser: welcomeuser,
lognomination: csdlog,
requestsalt: form.salting.checked,
templateParams: Twinkle.speedy.getParameters( form, values )
templateParams: templateParams
};
if (!params.templateParams) {
return;
}
 
Morebits.simpleWindow.setButtonsEnabled( false );
Morebits.status.init( form );
 
Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName');
Morebits.wiki.actionCompleted.notice = "'Penandaan selesai"';
 
// Modules can't be tagged, follow standard at TfD and place on /doc subpage
var isScribuntoparams.scribunto = mw.config.get('wgPageContentModel') === 'Scribunto';
var wikipedia_page = isScribuntoparams.scribunto ? new Morebits.wiki.page(mw.config.get('wgPageName') + '/doc', "'Menandai halaman dokumentasi modul"') : new Morebits.wiki.page(mw.config.get('wgPageName'), "'Menandai halaman"');
wikipedia_page.setCallbackParameters(params);
wikipedia_page.load(Twinkle.speedy.callbacks.user.main);
 
 
// </nowiki>