forked from wikimedia-gadgets/twinkle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtwinklespeedy.js
1989 lines (1823 loc) · 74.9 KB
/
twinklespeedy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// <nowiki>
(function() {
/*
****************************************
*** twinklespeedy.js: CSD module
****************************************
* Mode of invocation: Tab ("CSD")
* Active on: Non-special, existing pages
*
* NOTE FOR DEVELOPERS:
* If adding a new criterion, add it to the appropriate places at the top of
* twinkleconfig.js. Also check out the default values of the CSD preferences
* in twinkle.js, and add your new criterion to those if you think it would be
* good.
*/
Twinkle.speedy = function twinklespeedy() {
// Disable on:
// * special pages
// * non-existent pages
if (mw.config.get('wgNamespaceNumber') < 0 || !mw.config.get('wgArticleId')) {
return;
}
Twinkle.addPortletLink(Twinkle.speedy.callback, 'CSD', 'tw-csd', Morebits.userIsSysop ? 'Delete page according to WP:CSD' : 'Request speedy deletion according to WP:CSD');
};
// This function is run when the CSD tab/header link is clicked
Twinkle.speedy.callback = function twinklespeedyCallback() {
Twinkle.speedy.initDialog(Morebits.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;
// Prepares the speedy deletion dialog and displays it
Twinkle.speedy.initDialog = function twinklespeedyInitDialog(callbackfunc) {
Twinkle.speedy.dialog = new Morebits.SimpleWindow(Twinkle.getPref('speedyWindowWidth'), Twinkle.getPref('speedyWindowHeight'));
const dialog = Twinkle.speedy.dialog;
dialog.setTitle('Choose criteria for speedy deletion');
dialog.setScriptName('Twinkle');
dialog.addFooterLink('Speedy deletion policy', 'WP:CSD');
dialog.addFooterLink('CSD prefs', 'WP:TW/PREF#speedy');
dialog.addFooterLink('Twinkle help', 'WP:TW/DOC#speedy');
dialog.addFooterLink('Give feedback', 'WT:TW');
const form = new Morebits.QuickForm(callbackfunc, Twinkle.getPref('speedySelectionStyle') === 'radioClick' ? 'change' : null);
if (Morebits.userIsSysop) {
form.append({
type: 'checkbox',
list: [
{
label: 'Tag page only, don\'t delete',
value: 'tag_only',
name: 'tag_only',
tooltip: 'If you just want to tag the page, instead of deleting it now',
checked: !(Twinkle.speedy.hasCSD || Twinkle.getPref('deleteSysopDefaultToDelete')),
event: function(event) {
const cForm = event.target.form;
const cChecked = event.target.checked;
// enable talk page checkbox
if (cForm.talkpage) {
cForm.talkpage.checked = !cChecked && Twinkle.getPref('deleteTalkPageOnDelete');
}
// enable redirects checkbox
cForm.redirects.checked = !cChecked;
// enable delete multiple
cForm.delmultiple.checked = false;
// enable notify checkbox
cForm.notify.checked = cChecked;
// enable deletion notification checkbox
cForm.warnusertalk.checked = !cChecked && !Twinkle.speedy.hasCSD;
// enable multiple
cForm.multiple.checked = false;
// enable requesting creation protection
cForm.salting.checked = false;
Twinkle.speedy.callback.modeChanged(cForm);
event.stopPropagation();
}
}
]
});
const deleteOptions = form.append({
type: 'div',
name: 'delete_options'
});
deleteOptions.append({
type: 'header',
label: 'Delete-related options'
});
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: [
{
label: 'Also delete talk page',
value: 'talkpage',
name: 'talkpage',
tooltip: "This option deletes the page's talk page in addition. If you choose the F8 (moved to Commons) criterion, this option is ignored and the talk page is *not* deleted.",
checked: Twinkle.getPref('deleteTalkPageOnDelete'),
event: function(event) {
event.stopPropagation();
}
}
]
});
}
deleteOptions.append({
type: 'checkbox',
list: [
{
label: 'Also delete all redirects',
value: 'redirects',
name: 'redirects',
tooltip: 'This option deletes all incoming redirects in addition. Avoid this option for procedural (e.g. move/merge) deletions.',
checked: Twinkle.getPref('deleteRedirectsOnDelete'),
event: function (event) {
event.stopPropagation();
}
},
{
label: 'Delete under multiple criteria',
value: 'delmultiple',
name: 'delmultiple',
tooltip: 'When selected, you can select several criteria that apply to the page. For example, G11 and A7 are a common combination for articles.',
event: function(event) {
Twinkle.speedy.callback.modeChanged(event.target.form);
event.stopPropagation();
}
},
{
label: 'Notify page creator of page deletion',
value: 'warnusertalk',
name: 'warnusertalk',
tooltip: 'A notification template will be placed on the talk page of the creator, IF you have a notification enabled in your Twinkle preferences ' +
'for the criterion you choose AND this box is checked. The creator may be welcomed as well.',
checked: !Twinkle.speedy.hasCSD,
event: function(event) {
event.stopPropagation();
}
}
]
});
}
const tagOptions = form.append({
type: 'div',
name: 'tag_options'
});
if (Morebits.userIsSysop) {
tagOptions.append({
type: 'header',
label: 'Tag-related options'
});
}
tagOptions.append({
type: 'checkbox',
list: [
{
label: 'Notify page creator if possible',
value: 'notify',
name: 'notify',
tooltip: 'A notification template will be placed on the talk page of the creator, IF you have a notification enabled in your Twinkle preferences ' +
'for the criterion you choose AND this box is checked. The creator may be welcomed as well.',
checked: !Morebits.userIsSysop || !(Twinkle.speedy.hasCSD || Twinkle.getPref('deleteSysopDefaultToDelete')),
event: function(event) {
event.stopPropagation();
}
},
{
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();
}
},
{
label: 'Tag with multiple criteria',
value: 'multiple',
name: 'multiple',
tooltip: 'When selected, you can select several criteria that apply to the page. For example, G11 and A7 are a common combination for articles.',
event: function(event) {
Twinkle.speedy.callback.modeChanged(event.target.form);
event.stopPropagation();
}
}
]
});
form.append({
type: 'div',
id: 'prior-deletion-count',
style: 'font-style: italic'
});
form.append({
type: 'div',
name: 'work_area',
label: 'Failed to initialize the CSD module. Please try again, or tell the Twinkle developers about the issue.'
});
if (Twinkle.getPref('speedySelectionStyle') !== 'radioClick') {
form.append({ type: 'submit', className: 'tw-speedy-submit' }); // Renamed in modeChanged
}
const result = form.render();
dialog.setContent(result);
dialog.display();
Twinkle.speedy.callback.modeChanged(result);
// Check for prior deletions. Just once, upon init
Twinkle.speedy.callback.priorDeletionCount();
};
Twinkle.speedy.callback.modeChanged = function twinklespeedyCallbackModeChanged(form) {
const namespace = mw.config.get('wgNamespaceNumber');
// first figure out what mode we're in
const mode = {
isSysop: !!form.tag_only && !form.tag_only.checked,
isMultiple: form.tag_only && !form.tag_only.checked ? form.delmultiple.checked : form.multiple.checked,
isRadioClick: Twinkle.getPref('speedySelectionStyle') === 'radioClick'
};
if (mode.isSysop) {
$('[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');
}
const work_area = new Morebits.QuickForm.Element({
type: 'div',
name: 'work_area'
});
if (mode.isMultiple && mode.isRadioClick) {
const evaluateType = mode.isSysop ? 'evaluateSysop' : 'evaluateUser';
work_area.append({
type: 'div',
label: 'When finished choosing criteria, click:'
});
work_area.append({
type: 'button',
name: 'submit-multiple',
label: mode.isSysop ? 'Delete page' : 'Tag page',
event: function(event) {
Twinkle.speedy.callback[evaluateType](event);
event.stopPropagation();
}
});
}
const appendList = function(headerLabel, csdList) {
work_area.append({ type: 'header', label: headerLabel });
work_area.append({ type: mode.isMultiple ? 'checkbox' : 'radio', name: 'csd', list: Twinkle.speedy.generateCsdList(csdList, mode) });
};
if (mode.isSysop && !mode.isMultiple) {
appendList('Custom rationale', Twinkle.speedy.customRationale);
}
if (namespace % 2 === 1 && namespace !== 3) {
// show db-talk on talk pages, but not user talk pages
appendList('Talk pages', Twinkle.speedy.talkList);
}
if (!Morebits.isPageRedirect()) {
switch (namespace) {
case 0: // article
case 1: // talk
appendList('Articles', Twinkle.speedy.articleList);
break;
case 2: // user
case 3: // user talk
appendList('User pages', Twinkle.speedy.userList);
break;
case 6: // file
case 7: // file talk
appendList('Files', Twinkle.speedy.fileList);
if (!mode.isSysop) {
work_area.append({ type: 'div', label: 'Tagging for CSD F4 (no license), F5 (orphaned non-free use), F6 (no non-free use rationale), and F11 (no permission) can be done using Twinkle\'s "DI" tab.' });
}
break;
case 14: // category
case 15: // category talk
appendList('Categories', Twinkle.speedy.categoryList);
break;
default:
break;
}
} else {
if (namespace === 2 || namespace === 3) {
appendList('User pages', Twinkle.speedy.userList);
}
appendList('Redirects', Twinkle.speedy.redirectList);
}
let generalCriteria = Twinkle.speedy.generalList;
// custom rationale lives under general criteria when tagging
if (!mode.isSysop) {
generalCriteria = Twinkle.speedy.customRationale.concat(generalCriteria);
}
appendList('General criteria', generalCriteria);
const 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 (mode.isSysop && Twinkle.speedy.hasCSD) {
const customOption = $('input[name=csd][value=reason]')[0];
if (customOption) {
if (Twinkle.getPref('speedySelectionStyle') !== 'radioClick') {
// force listeners to re-init
customOption.click();
customOption.parentNode.appendChild(customOption.subgroup);
}
customOption.subgroup.querySelector('input').value = decodeURIComponent($('#delete-reason').text()).replace(/\+/g, ' ');
}
}
};
Twinkle.speedy.callback.priorDeletionCount = function () {
const query = {
action: 'query',
format: 'json',
list: 'logevents',
letype: 'delete',
leaction: 'delete/delete', // Just pure page deletion, no redirect overwrites or revdel
letitle: mw.config.get('wgPageName'),
leprop: '', // We're just counting we don't actually care about the entries
lelimit: 5 // A little bit goes a long way
};
new Morebits.wiki.Api('Checking for past deletions', query, ((apiobj) => {
const response = apiobj.getResponse();
const delCount = response.query.logevents.length;
if (delCount) {
let message = delCount + ' previous deletion';
if (delCount > 1) {
message += 's';
if (response.continue) {
message = 'More than ' + message;
}
// 3+ seems problematic
if (delCount >= 3) {
$('#prior-deletion-count').css('color', 'red');
}
}
// Provide a link to page logs (CSD templates have one for sysops)
const link = Morebits.htmlNode('a', '(logs)');
link.setAttribute('href', mw.util.getUrl('Special:Log', {page: mw.config.get('wgPageName')}));
link.setAttribute('target', '_blank');
$('#prior-deletion-count').text(message + ' '); // Space before log link
$('#prior-deletion-count').append(link);
}
})).post();
};
Twinkle.speedy.generateCsdList = function twinklespeedyGenerateCsdList(list, mode) {
const pageNamespace = mw.config.get('wgNamespaceNumber');
const openSubgroupHandler = function(e) {
$(e.target.form).find('input').prop('disabled', true);
$(e.target.form).children().css('color', 'gray');
$(e.target).parent().css('color', 'black').find('input').prop('disabled', false);
$(e.target).parent().find('input:text')[0].focus();
e.stopPropagation();
};
const submitSubgroupHandler = function(e) {
const evaluateType = mode.isSysop ? 'evaluateSysop' : 'evaluateUser';
Twinkle.speedy.callback[evaluateType](e);
e.stopPropagation();
};
return $.map(list, (critElement) => {
const criterion = $.extend({}, critElement);
if (mode.isMultiple) {
if (criterion.hideWhenMultiple) {
return null;
}
if (criterion.hideSubgroupWhenMultiple) {
criterion.subgroup = null;
}
} else {
if (criterion.hideWhenSingle) {
return null;
}
if (criterion.hideSubgroupWhenSingle) {
criterion.subgroup = null;
}
}
if (mode.isSysop) {
if (criterion.hideWhenSysop) {
return null;
}
if (criterion.hideSubgroupWhenSysop) {
criterion.subgroup = null;
}
} else {
if (criterion.hideWhenUser) {
return null;
}
if (criterion.hideSubgroupWhenUser) {
criterion.subgroup = null;
}
}
if (Morebits.isPageRedirect() && criterion.hideWhenRedirect) {
return null;
}
if (criterion.showInNamespaces && criterion.showInNamespaces.indexOf(pageNamespace) < 0) {
return null;
}
if (criterion.hideInNamespaces && criterion.hideInNamespaces.indexOf(pageNamespace) > -1) {
return null;
}
if (criterion.subgroup && !mode.isMultiple && mode.isRadioClick) {
if (Array.isArray(criterion.subgroup)) {
criterion.subgroup = criterion.subgroup.concat({
type: 'button',
name: 'submit',
label: mode.isSysop ? 'Delete page' : 'Tag page',
event: submitSubgroupHandler
});
} else {
criterion.subgroup = [
criterion.subgroup,
{
type: 'button',
name: 'submit', // ends up being called "csd.submit" so this is OK
label: mode.isSysop ? 'Delete page' : 'Tag page',
event: submitSubgroupHandler
}
];
}
// FIXME: does this do anything?
criterion.event = openSubgroupHandler;
}
return criterion;
});
};
Twinkle.speedy.customRationale = [
{
label: 'Custom rationale' + (Morebits.userIsSysop ? ' (custom deletion reason)' : ' using {{db}} template'),
value: 'reason',
tooltip: '{{db}} is short for "delete because". At least one of the other deletion criteria must still apply to the page, and you must make mention of this in your rationale. This is not a "catch-all" for when you can\'t find any criteria that fit.',
subgroup: {
name: 'reason_1',
type: 'input',
label: 'Rationale:',
size: 60
},
hideWhenMultiple: true
}
];
Twinkle.speedy.talkList = [
{
label: 'G8: Talk pages with no corresponding subject page',
value: 'talk',
tooltip: 'This excludes any page that is useful to the project - in particular, user talk pages, talk page archives, and talk pages for files that exist on Wikimedia Commons.'
}
];
Twinkle.speedy.fileList = [
{
label: 'F1: Redundant file',
value: 'redundantimage',
tooltip: 'Any file that is a redundant copy, in the same file format and same or lower resolution, of something else on Wikipedia. Likewise, other media that is a redundant copy, in the same format and of the same or lower quality. This does not apply to files duplicated on Wikimedia Commons, because of licence issues; these should be tagged with {{subst:ncd|Image:newname.ext}} or {{subst:ncd}} instead',
subgroup: {
name: 'redundantimage_filename',
type: 'input',
label: 'File this is redundant to:',
tooltip: 'The "File:" prefix can be left off.'
}
},
{
label: 'F2: Corrupt, missing, or empty file',
value: 'noimage',
tooltip: 'Before deleting this type of file, verify that the MediaWiki engine cannot read it by previewing a resized thumbnail of it. This also includes empty (i.e., no content) file description pages for Commons files'
},
{
label: 'F2: Unneeded file description page for a file on Commons',
value: 'fpcfail',
tooltip: 'An image, hosted on Commons, but with tags or information on its English Wikipedia description page that are no longer needed. (For example, a failed featured picture candidate.)',
hideWhenMultiple: true
},
{
label: 'F3: Improper license',
value: 'noncom',
tooltip: 'Files licensed as "for non-commercial use only", "non-derivative use" or "used with permission" that were uploaded on or after 2005-05-19, except where they have been shown to comply with the limited standards for the use of non-free content. This includes files licensed under a "Non-commercial Creative Commons License". Such files uploaded before 2005-05-19 may also be speedily deleted if they are not used in any articles'
},
{
label: 'F4: Lack of licensing information',
value: 'unksource',
tooltip: 'Files in category "Files with unknown source", "Files with unknown copyright status", or "Files with no copyright tag" that have been tagged with a template that places them in the category for more than seven days, regardless of when uploaded. Note, users sometimes specify their source in the upload summary, so be sure to check the circumstances of the file.',
hideWhenUser: true
},
{
label: 'F5: Unused non-free copyrighted file',
value: 'f5',
tooltip: 'Files that are not under a free license or in the public domain that are not used in any article, whose only use is in a deleted article, and that are very unlikely to be used on any other article. Reasonable exceptions may be made for files uploaded for an upcoming article. For other unused non-free files, use the "Orphaned non-free use" option in Twinkle\'s DI tab.',
hideWhenUser: true
},
{
label: 'F6: Missing fair-use rationale',
value: 'norat',
tooltip: 'Any file without a fair use rationale may be deleted seven days after it is uploaded. Boilerplate fair use templates do not constitute a fair use rationale. Files uploaded before 2006-05-04 should not be deleted immediately; instead, the uploader should be notified that a fair-use rationale is needed. Files uploaded after 2006-05-04 can be tagged using the "No non-free use rationale" option in Twinkle\'s DI module. Such files can be found in the dated subcategories of Category:Files with no non-free use rationale.',
hideWhenUser: true
},
{
label: 'F7: Fair-use media from a commercial image agency which is not the subject of sourced commentary',
value: 'badfairuse',
tooltip: 'Non-free images or media from a commercial source (e.g., Associated Press, Getty), where the file itself is not the subject of sourced commentary, are considered an invalid claim of fair use and fail the strict requirements of WP:NFCC. For cases that require a waiting period (invalid or otherwise disputed rationales or replaceable images), use the options on Twinkle\'s DI tab.',
subgroup: {
name: 'badfairuse_rationale',
type: 'input',
label: 'Optional explanation:',
size: 60
},
hideWhenMultiple: true
},
{
label: 'F8: File available as an identical or higher-resolution copy on Wikimedia Commons',
value: 'commons',
tooltip: 'Provided the following conditions are met: 1: The file format of both images is the same. 2: The file\'s license and source status is beyond reasonable doubt, and the license is undoubtedly accepted at Commons. 3: All information on the file description page is present on the Commons file description page. That includes the complete upload history with links to the uploader\'s local user pages. 4: The file is not protected, and the file description page does not contain a request not to move it to Commons. 5: If the file is available on Commons under a different name than locally, all local references to the file must be updated to point to the title used at Commons. 6: For {{c-uploaded}} files: They may be speedily deleted as soon as they are off the Main Page',
subgroup: {
name: 'commons_filename',
type: 'input',
label: 'Filename on Commons:',
value: Morebits.pageNameNorm,
tooltip: 'This can be left blank if the file has the same name on Commons as here. The "File:" prefix is optional.'
},
hideWhenMultiple: true
},
{
label: 'F9: Unambiguous copyright infringement',
value: 'imgcopyvio',
tooltip: 'The file was copied from a website or other source that does not have a license compatible with Wikipedia, and the uploader neither claims fair use nor makes a credible assertion of permission of free use. Sources that do not have a license compatible with Wikipedia include stock photo libraries such as Getty Images or Corbis. Non-blatant copyright infringements should be discussed at Wikipedia:Files for deletion',
subgroup: [
{
name: 'imgcopyvio_url',
type: 'input',
label: 'URL of the copyvio, including the "http://". If the copyvio is of a non-internet source and you cannot provide a URL, you must use the deletion rationale box.',
size: 60
},
{
name: 'imgcopyvio_rationale',
type: 'input',
label: 'Deletion rationale for non-internet copyvios:',
size: 60
}
]
},
{
label: 'F11: No evidence of permission',
value: 'nopermission',
tooltip: 'If an uploader has specified a license and has named a third party as the source/copyright holder without providing evidence that this third party has in fact agreed, the item may be deleted seven days after notification of the uploader',
hideWhenUser: true
},
{
label: 'G8: File description page with no corresponding file',
value: 'imagepage',
tooltip: 'This is only for use when the file doesn\'t exist at all. Corrupt files, and local description pages for files on Commons, should use F2; implausible redirects should use R3; and broken Commons redirects should use R4.'
}
];
Twinkle.speedy.articleList = [
{
label: 'A1: No context. Articles lacking sufficient context to identify the subject of the article.',
value: 'nocontext',
tooltip: 'Example: "He is a funny man with a red car. He makes people laugh." This applies only to very short articles. Context is different from content, treated in A3, below.'
},
{
label: 'A2: Foreign language articles that exist on another Wikimedia project',
value: 'foreign',
tooltip: 'If the article in question does not exist on another project, the template {{notenglish}} should be used instead. All articles in a non-English language that do not meet this criteria (and do not meet any other criteria for speedy deletion) should be listed at Pages Needing Translation (PNT) for review and possible translation',
subgroup: {
name: 'foreign_source',
type: 'input',
label: 'Interwiki link to the article on the foreign-language wiki:',
tooltip: 'For example, fr:Bonjour'
}
},
{
label: 'A3: No content whatsoever',
value: 'nocontent',
tooltip: 'Any article consisting only of links elsewhere (including hyperlinks, category tags and "see also" sections), a rephrasing of the title, and/or attempts to correspond with the person or group named by its title. This does not include disambiguation pages'
},
{
label: 'A7: No indication of importance (people, groups, companies, web content, individual animals, or organized events)',
value: 'a7',
tooltip: 'An article about a real person, group of people, band, club, company, web content, individual animal, tour, or party that does not assert the importance or significance of its subject. If controversial, or if a previous AfD has resulted in the article being kept, the article should be nominated for AfD instead',
hideWhenSingle: true
},
{
label: 'A7: No 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',
hideWhenMultiple: true
},
{
label: 'A7: No 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',
hideWhenMultiple: true
},
{
label: 'A7: No 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: No 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',
hideWhenMultiple: true
},
{
label: 'A7: No 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',
hideWhenMultiple: true
},
{
label: 'A7: No 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',
hideWhenMultiple: true
},
{
label: 'A7: No 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: Unremarkable musical recording where artist\'s article doesn\'t exist',
value: 'a9',
tooltip: 'An article about a musical recording which does not indicate why its subject is important or significant, and where the artist\'s article has never existed or has been deleted'
},
{
label: 'A10: Recently created article that duplicates an existing topic',
value: 'a10',
tooltip: 'A recently created article with no relevant page history that does not aim to expand upon, detail or improve information within any existing article(s) on the subject, and where the title is not a plausible redirect. This does not include content forks, split pages or any article that aims at expanding or detailing an existing one.',
subgroup: {
name: 'a10_article',
type: 'input',
label: 'Article that is duplicated:'
}
},
{
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'
}
];
Twinkle.speedy.categoryList = [
{
label: 'C1: Empty categories',
value: 'catempty',
tooltip: 'Categories that have been unpopulated for at least seven days. This does not apply to categories being discussed at WP:CFD, disambiguation categories, and certain other exceptions. If the category isn\'t relatively new, it possibly contained articles earlier, and deeper investigation is needed'
},
{
label: 'C4: Permanently unused maintenance categories',
value: 'c4',
tooltip: 'Unused maintenance categories, such as empty dated maintenance categories for dates in the past, tracking categories no longer used by a template after a rewrite, or empty subcategories of Category:Wikipedia sockpuppets or Category:Suspected Wikipedia sockpuppets. Empty maintenance categories are not necessarily unused—this criterion is for categories which will always be empty, not just currently empty.',
subgroup: {
name: 'c4_rationale',
type: 'input',
label: 'Optional explanation:',
size: 60
}
}
];
Twinkle.speedy.userList = [
{
label: 'U1: User request',
value: 'userreq',
tooltip: 'Personal subpages, upon request by their user. In some rare cases there may be administrative need to retain the page. Also, sometimes, main user pages may be deleted as well. See Wikipedia:User page for full instructions and guidelines',
subgroup: mw.config.get('wgNamespaceNumber') === 3 && mw.config.get('wgTitle').indexOf('/') === -1 ? {
name: 'userreq_rationale',
type: 'input',
label: 'A mandatory rationale to explain why this user talk page should be deleted:',
tooltip: 'User talk pages are deleted only in highly exceptional circumstances. See WP:DELTALK.',
size: 60
} : null,
hideSubgroupWhenMultiple: true
},
{
label: 'U2: Nonexistent user',
value: 'nouser',
tooltip: 'User pages of users that do not exist (Check Special:Listusers)'
},
{
label: 'U5: A non-contributor misusing Wikipedia as a web host',
value: 'notwebhost',
tooltip: 'Pages in userspace consisting of writings, information, discussions, or activities not closely related to Wikipedia\'s goals, where the owner has made few or no edits outside of user pages, except for plausible drafts and pages adhering to WP:UPYES. It applies regardless of the age of the page in question.',
hideWhenRedirect: true
},
{
label: 'G11: Promotional user page under a promotional user name',
value: 'spamuser',
tooltip: 'A promotional user page, with a username that promotes or implies affiliation with the thing being promoted. Note that simply having a page on a company or product in one\'s userspace does not qualify it for deletion. If a user page is spammy but the username is not, then consider tagging with regular G11 instead.',
hideWhenMultiple: true,
hideWhenRedirect: true
},
{
label: 'G13: AfC draft submission or a blank draft, stale by over 6 months',
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).',
hideWhenMultiple: true,
hideWhenRedirect: true
}
];
Twinkle.speedy.generalList = [
{
label: 'G1: Patent nonsense. Pages consisting purely of incoherent text or gibberish with no meaningful content or history.',
value: 'nonsense',
tooltip: 'This does not include poor writing, partisan screeds, obscene remarks, vandalism, fictional material, material not in English, poorly translated material, implausible theories, or hoaxes. In short, if you can understand it, G1 does not apply.',
hideInNamespaces: [ 2 ] // Not applicable in userspace
},
{
label: 'G2: Test page',
value: 'test',
tooltip: 'A page created to test editing or other Wikipedia functions. Pages in the User namespace are not included, nor are valid but unused or duplicate templates.',
hideInNamespaces: [ 2 ] // Not applicable in userspace
},
{
label: 'G3: Pure vandalism',
value: 'vandalism',
tooltip: 'Plain pure vandalism (including redirects left behind from pagemove vandalism)'
},
{
label: 'G3: Blatant hoax',
value: 'hoax',
tooltip: 'Blatant and obvious hoax, to the point of vandalism',
hideWhenMultiple: true
},
{
label: 'G4: Recreation of material deleted via a deletion discussion',
value: 'repost',
tooltip: 'A copy, by any title, of a page that was deleted via an XfD process or Deletion review, provided that the copy is substantially identical to the deleted version. This clause does not apply to content that has been "userfied", to content undeleted as a result of Deletion review, or if the prior deletions were proposed or speedy deletions, although in this last case, other speedy deletion criteria may still apply',
subgroup: {
name: 'repost_xfd',
type: 'input',
label: 'Page where the deletion discussion took place:',
tooltip: 'Must start with "Wikipedia:"',
size: 60
}
},
{
label: 'G5: Created by a banned or blocked user',
value: 'banned',
tooltip: 'Pages created by banned or blocked users in violation of their ban or block, and which have no substantial edits by others',
subgroup: {
name: 'banned_user',
type: 'input',
label: 'Username of banned user (if available):',
tooltip: 'Should not start with "User:"'
}
},
{
label: 'G6: Error',
value: 'error',
tooltip: 'A page that was obviously created in error, or a redirect left over from moving a page that was obviously created at the wrong title.',
hideWhenMultiple: true
},
{
label: 'G6: Move',
value: 'move',
tooltip: 'Making way for an uncontroversial move like reversing a redirect',
subgroup: [
{
name: 'move_page',
type: 'input',
label: 'Page to be moved here:'
},
{
name: 'move_reason',
type: 'input',
label: 'Reason:',
size: 60
}
],
hideWhenMultiple: true
},
{
label: 'G6: 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.',
subgroup: {
name: 'xfd_fullvotepage',
type: 'input',
label: 'Page where the deletion discussion was held:',
tooltip: 'Must start with "Wikipedia:"',
size: 40
},
hideWhenMultiple: true
},
{
label: 'G6: AfC move',
value: 'afc-move',
tooltip: 'Making way for acceptance of a draft submitted to AfC',
subgroup: {
name: 'draft_page',
type: 'input',
label: 'Draft to be moved here:'
},
hideWhenMultiple: true
},
{
label: 'G6: Copy-and-paste page move',
value: 'copypaste',
tooltip: 'This only applies for a copy-and-paste page move of another page that needs to be temporarily deleted to make room for a clean page move.',
subgroup: {
name: 'copypaste_sourcepage',
type: 'input',
label: 'Original page that was copy-pasted here:'
},
hideWhenMultiple: true
},
{
label: 'G6: Housekeeping and non-controversial cleanup',
value: 'g6',
tooltip: 'Other routine maintenance tasks',
subgroup: {
name: 'g6_rationale',
type: 'input',
label: 'Rationale:',
size: 60
}
},
{
label: 'G7: Author requests deletion, or author blanked',
value: 'author',
tooltip: 'Any page for which deletion is requested by the original author in good faith, provided the page\'s only substantial content was added by its author. If the author blanks the page, this can also be taken as a deletion request.',
subgroup: {
name: 'author_rationale',
type: 'input',
label: 'Optional explanation:',
tooltip: 'Perhaps linking to where the author requested this deletion.',
size: 60
},
hideSubgroupWhenSysop: true
},
{
label: 'G8: Pages dependent on a non-existent or deleted page',
value: 'g8',
tooltip: 'such as talk pages with no corresponding subject page; subpages with no parent page; file pages without a corresponding file; redirects to non-existent targets; or categories populated by deleted or retargeted templates. This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.',
subgroup: {
name: 'g8_rationale',
type: 'input',
label: 'Optional explanation:',
size: 60
},
hideSubgroupWhenSysop: true
},
{
label: 'G8: Subpages with no parent page',
value: 'subpage',
tooltip: 'This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.',
hideWhenMultiple: true,
hideInNamespaces: [ 0, 6, 8 ] // hide in main, file, and mediawiki-spaces
},
{
label: 'G10: Attack page',
value: 'attack',
tooltip: 'Pages that serve no purpose but to disparage or threaten their subject or some other entity (e.g., "John Q. Doe is an imbecile"). This includes a biography of a living person that is negative in tone and unsourced, where there is no NPOV version in the history to revert to. Administrators deleting such pages should not quote the content of the page in the deletion summary!'
},
{
label: 'G10: Wholly negative, unsourced BLP',
value: 'negublp',
tooltip: 'A biography of a living person that is entirely negative in tone and unsourced, where there is no neutral version in the history to revert to.',
hideWhenMultiple: true
},
{
label: 'G11: Unambiguous advertising or promotion',
value: 'spam',
tooltip: 'Pages which exclusively promote a company, product, group, service, or person and which would need to be fundamentally rewritten in order to become encyclopedic. Note that an article about a company or a product which describes its subject from a neutral point of view does not qualify for this criterion; an article that is blatant advertising should have inappropriate content as well'
},
{
label: 'G12: Unambiguous copyright infringement',
value: 'copyvio',
tooltip: 'Either: (1) Material was copied from another website that does not have a license compatible with Wikipedia, or is photography from a stock photo seller (such as Getty Images or Corbis) or other commercial content provider; (2) There is no non-infringing content in the page history worth saving; or (3) The infringement was introduced at once by a single person rather than created organically on wiki and then copied by another website such as one of the many Wikipedia mirrors',
subgroup: [
{
name: 'copyvio_url',
type: 'input',
label: 'URL (if available):',
tooltip: 'If the material was copied from an online source, put the URL here, including the "http://" or "https://" protocol.',
size: 60
},
{
name: 'copyvio_url2',
type: 'input',
label: 'Additional URL:',
tooltip: 'Optional. Should begin with "http://" or "https://"',
size: 60
},
{
name: 'copyvio_url3',
type: 'input',
label: 'Additional URL:',
tooltip: 'Optional. Should begin with "http://" or "https://"',
size: 60
}
]
},
{
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)'
}
];
Twinkle.speedy.redirectList = [
{
label: 'R2: Redirect from mainspace to any other namespace except the Category:, Template:, Wikipedia:, Help: and Portal: namespaces',
value: 'rediruser',
tooltip: 'This does not include the pseudo-namespace shortcuts. If this was the result of a page move, consider waiting a day or two before deleting the redirect',
showInNamespaces: [ 0 ]
},
{
label: 'R3: Recently created redirect from an implausible typo or misnomer',
value: 'redirtypo',
tooltip: 'However, redirects from common misspellings or misnomers are generally useful, as are redirects in other languages'
},
{
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: 'G6: Redirect to malplaced disambiguation page',
value: 'movedab',
tooltip: 'This only applies for redirects to disambiguation pages ending in (disambiguation) where a primary topic does not exist.',
hideWhenMultiple: true
},
{
label: 'G8: Redirects to non-existent targets',
value: 'redirnone',
tooltip: 'This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.',
hideWhenMultiple: true
}
];
Twinkle.speedy.normalizeHash = {
reason: 'db',
nonsense: 'g1',
test: 'g2',
vandalism: 'g3',
hoax: 'g3',
repost: 'g4',
banned: 'g5',
error: 'g6',