-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.php
1684 lines (1564 loc) · 109 KB
/
index.php
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
<!DOCTYPE html>
<?php
header('Content-Type: text/html; charset=utf-8');
session_name( 'SWViewer' );
session_start();
# Redirect to https
if (!(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' ||
$_SERVER['HTTPS'] == 1) ||
isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) {
$redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
session_write_close();
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $redirect);
exit();
}
?>
<html id="parentHTML" class="notranslate" lang="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Permissions-Policy" content="interest-cohort=()"/>
<title>SWViewer</title>
<meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>
<meta name="application-name" content="SWViewer">
<meta name="author" content="Iluvatar, Ajbura, 1997kB">
<meta name="description" content="App for monitoring recent changes of Wikipedia in real-time.">
<meta name="keywords" content="swmt, patrolling wikipedia, recent changes, ">
<meta name="msapplication-TileColor" content="#808d9f">
<!-- icons -->
<link rel="icon" type="image/png" sizes="32x32" href="img/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicons/favicon-16x16.png">
<link rel="mask-icon" href="img/favicons/safari-pinned-tab.svg" color="#5bbad5">
<!-- Add iOS meta tags and icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#191919">
<meta name="apple-mobile-web-app-title" content="SWViewer">
<link rel="apple-touch-icon" sizes="180x180" href="img/favicons/apple-touch-icon.png">
<!-- PWA -->
<meta name="theme-color" content="#191919">
<link rel='manifest' href='manifest.webmanifest'>
<script>
if (window.navigator.userAgent.indexOf('MSIE ') > 0 || window.navigator.userAgent.indexOf('Trident/') > 0 || window.navigator.userAgent.indexOf('Edge/') > 0) {
alert("Sorry, but Internet Explorer and Microsoft Edge browsers is not supported.");
if (window.stop !== undefined) {
window.stop();
} else if (document.execCommand !== undefined) {
document.execCommand("Stop", false);
}
}
</script>
<script async src="js/pwacompat.js"></script>
<script>
if ("serviceWorker" in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('./service-worker.js', {
scope: './'
})
.then((reg) => {
console.log('Service worker registered.', reg);
});
});
}
</script>
<!-- AngularJS, jQuery, Moment -->
<script type="text/javascript" src="//tools-static.wmflabs.org/cdnjs/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript" src="//tools-static.wmflabs.org/cdnjs/ajax/libs/moment.js/2.24.0/moment-with-locales.min.js"></script>
<script type="text/javascript" src="//tools-static.wmflabs.org/cdnjs/ajax/libs/angular.js/1.8.2/angular.min.js"></script>
<script type="text/javascript" src="//tools-static.wmflabs.org/cdnjs/ajax/libs/angular-ui/0.4.0/angular-ui.min.js"></script>
<script type="text/javascript" src="//tools-static.wmflabs.org/cdnjs/ajax/libs/angular-ui-bootstrap/2.5.6/ui-bootstrap-tpls.min.js"></script>
<script type="text/javascript" src="./js/modules/bakeEl.min.js" defer></script>
<script type="text/javascript" src="./js/modules/pw.js" defer></script>
<script type="text/javascript" src="./js/modules/po.js" defer></script>
<!-- Fonts, stylesheet-->
<link rel="stylesheet" href="css/base/fonts.css">
<link rel="stylesheet" href="css/base/variables.css">
<link rel="stylesheet" href="css/base/base.css">
<link rel="stylesheet" href="css/components/comp.css">
<link rel="stylesheet" href="css/components/header.css">
<link rel="stylesheet" href="css/components/dialog.css">
<link rel="stylesheet" href="css/components/notification.css">
<link rel="stylesheet" href="css/index.css?v=1.4">
<link rel="stylesheet" href="css/components/pw-po.css">
<link rel="stylesheet" href="css/layouts/logs.css">
<link rel="stylesheet" href="css/layouts/talk.css">
<style>
* {
outline: none;
box-sizing: border-box;
}
ul.dropdown-menu {
padding: 0;
margin: 10px 0;
list-style: none;
background-color: #fff;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
ul.dropdown-menu > li {
padding: 3px;
margin: 0;
cursor: pointer;
}
ul.dropdown-menu > li:hover, ul.dropdown-menu > li.active {
color: #f3f3f3;
background-color: #66666621;
}
ul.dropdown-menu > li > a {
color: #000000bf;
}
.ltr-mark:after { content: "\200E"; }
.rtl-mark:after { content: "\200F"; }
</style>
<script>
function sandwichLocalisation(baseContent, dirLocal, localMessage, targetEl, patternType, parsedLen, styleEl, uniqId, linkLocalisation, baseAdd = false) {
var parsedMessage; var baseContent = baseContent;
if (patternType === 'link')
parsedMessage = (dirLocal === 'ltr') ? localMessage.match(/^(.*?)\[\$link\|(.*?)\](.*)$/) : localMessage.match(/^(.*?)\[\$\s?link\s?\|\s?(.*?)\](.*)$/);
else {
if (patternType === 'name')
parsedMessage = (dirLocal === 'ltr') ? localMessage.match(/^(.*?)\$1(.*)/) : localMessage.match(/^(.*?)\$\s?1(.*)/);
else
parsedMessage = (dirLocal === 'ltr') ? localMessage.match(/^(.*?)\[\$1\|(.*?)\](.*)$/) : localMessage.match(/^(.*?)\[\$\s?1\s?\|\s?(.*?)\](.*)$/);
}
if (parsedMessage !== null && parsedMessage.length === parsedLen) {
targetEl.textContent = '';
var preLocalisedEl1 = baseContent.createElement('div');
var preLocalisedEl2 = (linkLocalisation === false) ? baseContent.createElement('div') : baseContent.createElement('a');
var preLocalisedEl3 = baseContent.createElement('div');
preLocalisedEl1.id = 'localisedEl' + uniqId + '1';
preLocalisedEl2.id = 'localisedEl' + uniqId + '2';
preLocalisedEl3.id = 'localisedEl' + uniqId + '3';
preLocalisedEl1.style.display = preLocalisedEl2.style.display = preLocalisedEl3.style.display = styleEl;
if (linkLocalisation !== false) {
preLocalisedEl2.href = linkLocalisation;
preLocalisedEl2.rel = 'noopener noreferrer';
preLocalisedEl2.target = '_blank';
}
targetEl.appendChild(preLocalisedEl1); targetEl.appendChild(preLocalisedEl2); targetEl.appendChild(preLocalisedEl3);
if (baseAdd !== false)
baseContent = baseAdd;
baseContent.getElementById('localisedEl' + uniqId + '1').textContent = parsedMessage[1];
if (parsedLen === 3) {
baseContent.getElementById('localisedEl' + uniqId + '2').textContent = 'SWViewer';
baseContent.getElementById('localisedEl' + uniqId + '3').textContent = parsedMessage[2];
} else {
baseContent.getElementById('localisedEl' + uniqId + '2').textContent = parsedMessage[2];
baseContent.getElementById('localisedEl' + uniqId + '3').textContent = parsedMessage[3];
}
}
}
</script>
</head>
<?php
# Callback errors
if (isset($_GET["error"])) {
if ($_GET["error"] == "rights") echo "<div style='background-color: red;' align=center>Sorry, to use this application <a rel='noopener noreferrer' target='_blank' href='https://meta.wikimedia.org/wiki/Special:MyLanguage/Rollback'>local</a> or <a rel='noopener noreferrer' target='_blank' href='https://meta.wikimedia.org/wiki/Special:MyLanguage/Global_rollback'>global</a> rollback is required.<br>If you have rollback right and see that error, then report about it on <a rel='noopener noreferrer' target='_blank' href='https://meta.wikimedia.org/wiki/Special:MyLanguage/SWViewer'>talk page</a>. Thanks!</div>";
if ($_GET["error"] == "internal") echo "<div style='background-color: red;' align=center>Internal server error</div>";
session_write_close();
exit();
}
# If user is not logged in, then show login layer
$checkLoginSWV = true;
if (!isset($_SESSION['tokenKey']) || !isset($_SESSION['tokenSecret']) || !isset($_SESSION['userName']) || !isset($_SESSION['userRole']) || !isset($_SESSION['mode']) || $_SESSION['mode'] == "" || !isset($_SESSION['talkToken']) || $_SESSION['talkToken'] == "") {
$checkLoginSWV = false;
if (isset($_COOKIE["SWViewer-auth"])) {
$cookies = $_COOKIE["SWViewer-auth"];
$obj = json_decode($cookies);
if (!isset($obj->cookies)) {
$_SESSION['userName'] = $obj->userName;
$_SESSION['tokenKey'] = $obj->tokenKey;
$_SESSION['tokenSecret'] = $obj->tokenSecret;
$_SESSION['talkToken'] = $obj->talkToken;
$_SESSION['userRole'] = $obj->userRole;
$_SESSION['notGR'] = (isset($obj->notGR)) ? $obj->notGR : "";
$_SESSION['mode'] = $obj->mode;
$_SESSION['accessGlobal'] = $obj->accessGlobal;
$_SESSION['projects'] = $obj->projects;
}
}
}
if (isset($_SESSION['userName']) && !empty($_SESSION['userName']) && isset($_SESSION['tokenKey']) && !empty($_SESSION['tokenKey']) && isset($_SESSION['tokenSecret']) && !empty($_SESSION['tokenSecret']) && isset($_SESSION['talkToken']) && !empty($_SESSION['talkToken']) && $_SESSION['talkToken'] !== "" && isset($_SESSION['mode']) && !empty($_SESSION['mode']) && $_SESSION['mode'] !== null && $_SESSION['talkToken'] !== null && $_SESSION['mode'] !== "")
$checkLoginSWV = true;
if ($checkLoginSWV == false) {
echo "
<noscript>
<span style='color: red;'>JavaScript is not enabled!</span>
</noscript>
<div id='login-page-base' class='login-base secondary-cont' style='display: none'>
<div class='login-card'>
<div style='text-align: center;'>
<span class='fs-xl custom-lang' style='font-weight: bold;'>[login-welcome]</span>
<a id='abtn' class='i-btn__accent accent-hover custom-lang' style='margin: 16px 0; color: var(--tc-accent) !important; padding: 0 24px; text-decoration: none !important;' href='https://swviewer.toolforge.org/php/oauth.php?action=auth'>[login-oauth]</a>
<span id='login-r' class='fs-xs custom-lang' style='width: 80%'>[login-rights]</span>
<span id='login-d' class='fs-xs' style='margin-top: 3px; width: 80%'><div id='ld1' style='display: inline'></div><div id='ld2' style='display: inline' onclick='openPO()'></div><div id='ld3' style='display: inline'></div></span>
</div>
<div>
<span class='i-btn__secondary-outlined secondary-hover fs-md custom-lang' style='height: 35px; margin-bottom: 8px;' onclick='openPO();'>[about]</span>
<span class='fs-xs'>Brought to you by <a rel='noopener noreferrer' target='_blank' href='https://meta.wikimedia.org/wiki/User:Iluvatar'>Iluvatar</a>, <a rel='noopener noreferrer' target='_blank' href='https://ajbura.github.io'>ajbura</a>, <a rel='noopener noreferrer' target='_blank' href='https://en.wikipedia.org/wiki/User:1997kB'>1997kB</a></span>
</div>
</div>
</div>
<!-- po Overlay-->
<div id='POOverlay' class='po__overlay' onclick='closePO()'></div>
<script>
(async function() {
var code = 'en';
code = window.navigator.language || navigator.userLanguage;
let responseLang = await fetch('i18n/en.json');
const baseLang = await responseLang.json();
let responseLangInfo = await fetch('php/localisation.php?mycode=' + code);
language = await responseLangInfo.json();
var useLang = []; useLang['@metadata'] = []; var dirLang = language['dir']; var languageIndex = language['code'];
document.getElementById('parentHTML').setAttribute('dir', language['dir']);
document.getElementById('parentHTML').setAttribute('lang', languageIndex);
if (language['code'] === 'en') {
for (m in baseLang) {
useLang[m] = baseLang[m];
}
useLang['@metadata']['authors'] = baseLang['@metadata']['authors'];
useLang['@metadata']['langName'] = 'English';
} else {
let responseLang2 = await fetch('i18n/' + language['code'] + '.json');
const selectLang = await responseLang2.json();
for (m in baseLang) {
if (baseLang.hasOwnProperty(m)) {
if (m !== '@metadata') {
if (selectLang.hasOwnProperty(m)) {
if (selectLang[m] !== '' && selectLang[m] !== null) useLang[m] = selectLang[m];
else useLang[m] = baseLang[m]
} else
useLang[m] = baseLang[m];
}
}
}
useLang['@metadata']['authors'] = selectLang['@metadata']['authors'];
useLang['@metadata']['langName'] = language['name'];
}
var elementsLang = document.getElementsByClassName('custom-lang');
for (el in elementsLang) {
if (elementsLang.hasOwnProperty(el)) {
var attrs = elementsLang[el].attributes;
for (l in attrs) {
if (attrs.hasOwnProperty(l))
if (typeof attrs[l].value !== 'undefined')
if (useLang.hasOwnProperty(attrs[l].value.replace('[', '').replace(']', '')))
elementsLang[el].setAttribute(attrs[l].name, useLang[attrs[l].value.replace('[', '').replace(']', '')]);
}
if (typeof elementsLang[el].value !== 'undefined')
if (useLang.hasOwnProperty(elementsLang[el].value.replace('[', '').replace(']', '')))
elementsLang[el].value = useLang[elementsLang[el].value.replace('[', '').replace(']', '')];
if (typeof elementsLang[el].textContent !== 'undefined')
if (useLang.hasOwnProperty(elementsLang[el].textContent.replace('[', '').replace(']', '')))
elementsLang[el].textContent = useLang[elementsLang[el].textContent.replace('[', '').replace(']', '')];
}
}
const lr = useLang['login-rights']; var loginR = document.getElementById('login-r');
const parserLr = (dirLang === 'ltr') ? lr.match(/^(.*?)\[\\$1\|(.*?)\](.*?)\[\\$2\|(.*?)\](.*)$/) : lr.match(/^(.*?)\[\\$\s?1\s?\|\s?(.*?)\](.*?)\[\\$\s?2\s?\|\s?(.*?)\](.*)$/);
if (parserLr !== null && parserLr.length === 6) {
loginR.textContent = '';
var lrdiv1 = document.createElement('div'); var lrdiv2 = document.createElement('div'); var lrdiv3 = document.createElement('div');
lrdiv1.id = 'lr1'; lrdiv2.id = 'lr2'; lrdiv3.id = 'lr3'; lrdiv1.style.display = lrdiv2.style.display = lrdiv3.style.display = 'inline';
if (dirLang !== 'rtl') lrdiv1.style.marginRight = '1px'; else lrdiv3.style.marginRight = '1px';
lrdiv2.style.marginRight = '1px';
var lra1 = document.createElement('a'); var lra2 = document.createElement('a');
lra1.id = 'lra1'; lra2.id = 'lra2'; lra1.style.display = lra2.style.display = 'inline'; lra1.style.marginRight = lra2.style.marginRight = '1px';
lra1.href = 'https://meta.wikipedia.org/wiki/Special:MyLanguage/Rollback'; lra1.rel = 'noopener noreferrer'; lra1.target = '_blank';
lra2.href = 'https://meta.wikimedia.org/wiki/Special:MyLanguage/Global_rollback'; lra2.rel = 'noopener noreferrer'; lra2.target = '_blank';
loginR.appendChild(lrdiv1); loginR.appendChild(lra1); loginR.appendChild(lrdiv2); loginR.appendChild(lra2); loginR.appendChild(lrdiv3);
document.getElementById('lr1').textContent = parserLr[1];
document.getElementById('lra1').textContent = parserLr[2];
document.getElementById('lr2').textContent = parserLr[3];
document.getElementById('lra2').textContent = parserLr[4];
document.getElementById('lr3').textContent = parserLr[5];
}
const ld = useLang['login-disclaimer']; var loginD = document.getElementById('login-d');
const parserLd = (dirLang === 'ltr') ? ld.match(/^(.*?)\[\\$1\|(.*?)\](.*)$/) : ld.match(/^(.*?)\[\\$\s?1\s?\|\s?(.*?)\](.*)$/);
if (parserLd === null || parserLd.length !== 4)
loginD.innerHtml = '[login-disclaimer]';
else {
var ld1 = document.getElementById('ld1'); var ld2 = document.getElementById('ld2'); var ld3 = document.getElementById('ld3');
if (dirLang !== 'rtl') ld1.style.marginRight = '3px'; ld2.style.marginRight = '3px';
ld2.style.color = 'var(--link-color)'; ld2.style.textDecoration = 'none'; ld2.style.cursor = 'pointer';
ld1.textContent = parserLd[1];
ld2.textContent = parserLd[2];
ld3.textContent = parserLd[3];
}
window.useLang = useLang; window.dirLang = dirLang; window.languageIndex = languageIndex;
var lastOpenedPO = undefined;
$.getScript('https://swviewer.toolforge.org/js/modules/about.js');
document.getElementById('login-page-base').style.display = 'block';
})();
document.onkeydown = function (e) {
if (!e) e = window.event;
var keyCode = e.which || e.keyCode || e.key;
if (keyCode === 27)
if (document.getElementById('POOverlay').classList.contains('po__overlay__active'))
closePO();
};
function openPO (po = 'about') {
function openPOLocal () {
document.getElementById(po).style.display = 'grid';
setTimeout(() => {
document.getElementById(po).classList.add('po__active');
document.getElementById('POOverlay').classList.add('po__overlay__active');
}, 0);
lastOpenedPO = po;
}
if (document.getElementById(po) === null) {
if (po === 'about') $.getScript('https://swviewer.toolforge.org/js/modules/about.js');
if (document.getElementById(po) !== null) openPOLocal();
} else openPOLocal();
}
function closePO () {
if (lastOpenedPO !== undefined) {
document.getElementById(lastOpenedPO).classList.remove('po__active');
document.getElementById('POOverlay').classList.remove('po__overlay__active');
setTimeout(() => {
document.getElementById(lastOpenedPO).style.display = 'none';
}, 200);
}
}
</script>";
exit(0);
}
# Check user is banned in SWV
$ts_pw = posix_getpwuid(posix_getuid());
$ts_mycnf = parse_ini_file("/data/project/swviewer/security/replica.my.cnf");
$db = new PDO("mysql:host=tools.labsdb;dbname=s53950__SWViewer;charset=utf8", $ts_mycnf['user'], $ts_mycnf['password']);
unset($ts_mycnf, $ts_pw);
$q = $db->prepare('SELECT name, lang, locked, rebind, betaTester FROM user WHERE name=:name');
$q->execute(array(':name' => $_SESSION["userName"]));
$result = $q->fetchAll();
$isLocked = intval($result[0]["locked"]);
$isBetaTester = intval($result[0]["betaTester"]);
$isRebind = intval($result[0]["rebind"]);
# User is banned or need refesh parameters
if ($isLocked !== 0 || $isRebind == 1) {
$_SESSION = array();
session_write_close();
if (isset($_COOKIE['SWViewer-auth'])) {
unset($_COOKIE['SWViewer-auth']);
setcookie('SWViewer-auth', '', time() - 3600, '/');
}
if ($isLocked !== 0)
echo "Access denied. You have been blocked.";
else
echo "<script>window.location.href = 'https://swviewer.toolforge.org/php/oauth.php?action=unlogin&kik=1';</script>";
exit();
}
$isBetaTest = false;
# User is not beta tester
if ($isBetaTest === true && $isBetaTester === 0) {
echo "Access denied. Please add yourself at <a href='https://meta.wikimedia.org/wiki/SWViewer/members' rel='noopener noreferrer' target='_blank'>beta tester list</a>, and let us know in <a href='http://ircredirect.toolforge.org/?server=irc.libera.chat&channel=swviewer&consent=yes' rel='noopener noreferrer' target='_blank'>IRC channel</a> or <a href='https://discord.gg/UTScYTR' rel='noopener noreferrer' target='_blank'>Discord server</a>.";
$_SESSION = array();
session_write_close();
exit();
}
# Get dir writing to php var
$rtl = Array ("dv", "nqo", "syc", "arc", "yi", "ydd", "tmr", "lad-hebr", "he", "ur", "ug-arab", "skr-arab", "sdh", "sd", "ps", "prs", "pnb", "ota", "mzn", "ms-arab", "lrc", "luz", "lki", "ku-arab", "ks-arab", "kk-arab", "khw", "ha-arab", "glk", "fa", "ckb", "bqi", "bgn", "bft", "bcc", "azb", "az-arab", "arz", "ary", "arq", "ar", "aeb-arab");
$langDir = (in_array($result[0]["lang"], $rtl)) ? "rtl" : "ltr";
# User is not banned. Update date of last open (offline users in The Talk)
$q = $db->prepare('UPDATE user SET lastopen=CURRENT_TIMESTAMP WHERE name=:name');
$q->execute(array(':name' => $_SESSION["userName"]));
$userSelf = $_SESSION["userName"];
$isGlobalModeAccess = false;
$isGlobal = false;
if ($_SESSION['mode'] == "global")
$isGlobal = true;
else
if (isset($_SESSION['accessGlobal']))
if ($_SESSION['accessGlobal'] == "true")
$isGlobalModeAccess = true;
$userRole = $_SESSION['userRole'];
session_write_close();
?>
<body class="full-screen" id="mainapp-body">
<!-- Loading UI -->
<div id="loading" class="secodnary-cont" style="padding: 16px; background: #ffffff; display: flex; align-items: center; justify-content: center; align-content: center; flex-wrap: wrap; position: fixed; z-index: 999;">
<div style="width: 75px; height: 75px;">
<svg version=1.1 id=Layer_1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink x=0px y=0px viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space=preserve> <g id=sw-logo> <path id=base d="M255.9,503L255.9,503C119.3,503,8.5,392.3,8.5,255.6v0C8.5,119,119.3,8.2,255.9,8.2h0 c136.6,0,247.4,110.8,247.4,247.4v0C503.3,392.3,392.6,503,255.9,503z"/> <g id=diff> <path fill=#FFE49C d="M226.3,358.7l-69.2,18.6c-12,3.2-23.8-5.8-23.8-18.2v-207c0-12.4,11.8-21.5,23.8-18.2l69.2,18.6 c8.2,2.2,14,9.7,14,18.2v169.8C240.3,349,234.6,356.5,226.3,358.7z"/> <path fill=#D8ECFF d="M364.5,358.7l-69.2,18.6c-12,3.2-23.8-5.8-23.8-18.2v-207c0-12.4,11.8-21.5,23.8-18.2l69.2,18.6 c8.2,2.2,14,9.7,14,18.2v169.8C378.5,349,372.8,356.5,364.5,358.7z"/> </g> </g> </svg>
</div>
<h1 style="padding: 4px 16px 0">SWViewer
<div id="loadingBar" style="height: 4px; width: 10%; background-color: #efefef; border-radius: 4px; transition: width 200ms ease-in;"></div>
</h1>
</div>
<!-- Application UI -->
<div id="angularapp" ng-app="swv" ng-controller="Queue">
<div class="base-container" id="app">
<div id="baseGrid" class="base-grid">
<!-- sidebar -->
<div id="sidebar" class="sidebar-base primary-cont">
<div class="sidebar__options">
<div id="btn-home" class="tab__active primary-hover custom-lang" onclick="clickHome(); closePW();" aria-label="[tooltip-home]" i-tooltip="right">
<div class="tab-indicator"></div>
<img class="touch-ic primary-icon custom-lang" src="./img/swviewer-filled.svg" alt="[talk-img-app]">
</div>
<div id="btn-talk" class="primary-hover disabled custom-lang" onclick="openPW('talkForm')" aria-label="[tooltip-talk]" i-tooltip="right">
<div class="tab-indicator"></div>
<span id="badge-talk" class="tab-notice-indicator" style="display: none; background-color: var(--bc-positive);">{{numberLocale(users.length)}}</span>
<span class="loading-tab tab-notice-indicator">!</span>
<img class="touch-ic primary-icon custom-lang" src="./img/message-filled.svg" alt="[img-message]">
</div>
<div id="btn-logs" class="primary-hover custom-lang" onclick="openPW('logs')" aria-label="[tooltip-logs]" i-tooltip="right">
<div class="tab-indicator"></div>
<span class="loading-tab tab-notice-indicator">!</span>
<img class="touch-ic primary-icon custom-lang" src="./img/doc-filled.svg" alt="[img-logos]">
</div>
<div id="btn-unlogin" class="primary-hover custom-lang" onclick="logout(); closeSidebar();" aria-label="[tooltip-logout]" i-tooltip="right">
<img class="touch-ic primary-icon custom-lang" src="./img/power-filled.svg" alt="[img-logout]">
</div>
<div id="btn-about" class="primary-hover custom-lang" style="margin-top: auto;" onclick="openPO('about'); closeSidebar();" aria-label="[about]" i-tooltip="right">
<span class="loading-tab tab-notice-indicator">!</span>
<img class="touch-ic primary-icon custom-lang" src="./img/about-filled.svg" alt="[img-about]">
</div>
<div id="btn-notification" class="primary-hover custom-lang" onclick="openPO('notificationPanel'); closeSidebar(); notifyOpen();" aria-label="[tooltip-notification]" i-tooltip="right">
<span id="notify-indicator" class="tab-notice-indicator tab-notice-indicator__inactive" style="background-color: var(--bc-negative);">0</span>
<span class="loading-tab tab-notice-indicator">!</span>
<img class="touch-ic primary-icon custom-lang" src="./img/bell-filled.svg" alt="[img-notification]">
</div>
<div id="btn-settings" class="primary-hover custom-lang" onclick="openPO('settingsOverlay'); closeSidebar();" aria-label="[tooltip-settings]" i-tooltip="right">
<img class="touch-ic primary-icon custom-lang" src="./img/settings-filled.svg" alt="[img-settings]">
</div>
</div>
</div>
<!-- Drawer -->
<div id="queueDrawer" class="drawer-base primary-cont">
<div class="edit-queue-base">
<div class="action-header eq__header">
<div class="mobile-only primary-hover custom-lang" onclick="openSidebar();" aria-label="[tooltip-m-sidebar]" i-tooltip="bottom-left">
<img class="touch-ic primary-icon custom-lang" src="./img/drawer-filled.svg" alt="[img-navigation]">
</div>
<span id="presetsArrow" class="presets-arrow action-header__title fs-lg disabled" onClick="togglePresets()">
<span id="drawerPresetTitle" class="drawer-preset-title custom-lang">[presets-default-title]</span>
</span>
<div id="editCurrentPreset" class="primary-hover disabled custom-lang" aria-label="[tooltip-edit-preset]" i-tooltip="bottom-right">
<img class="touch-ic primary-icon custom-lang" src="./img/filter-bar-filled.svg" alt="[img-edit]">
</div>
<div id="moreOptionBtnMobile" class="mobile-only primary-hover disabled custom-lang" onclick="toggleMoreControl();" aria-label="[tooltip-more-options]" i-tooltip="bottom-right" ng-click="moreOptionsClick()">
<img class="touch-ic primary-icon custom-lang" src="./img/v-dots-filled.svg" alt="[img-options]">
</div>
</div>
<div id="presetBody" class="preset__body" style="height: 0;">
<div class="primary-scroll">
<div id="presetsBase" class="fs-md">
<button class="i-btn__primary primary-hover fs-sm" style="background-color: var(--bc-primary-hover);" onclick="editPreset();">
<img class="touch-ic primary-icon custom-lang" src="./img/plus-filled.svg" alt="[img-plus]"><span class="custom-lang">[presets-button-create]</span>
</button>
</div>
</div>
</div>
<div id="eqBody" class="eq__body">
<div class="queue-base primary-scroll">
<div class="queue" id="queue">
<div class="talk-svg" style="display: none; cursor: default;">
<span class="fs-md custom-lang">[queue-empty-msg]</span>
</div>
<div class="primary-hover" ng-click="select(edit)" ng-repeat="edit in edits track by $index">
<div class="queue-col">
<div class="queue-ores" style="background-color: {{edit.ores.color}}">{{edit.ores.score}}</div>
<div class="queue-new">{{edit.isNew}}</div>
</div>
<div class="queue-row">
<div class="queue-wikiname fs-sm" ng-style="editColor(edit)">
{{edit.wiki}}‎
<span class="fs-xs" ng-style="byteCountColor(edit.byteCount)">({{edit.byteCount}}‎)</span>
</div>
<div class="queue-title fs-xs">{{edit.title}}</div>
<div class="queue-username fs-xs">{{edit.user}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Status Bar -->
<div id="statusbar" class="statusbar-base primary-cont">
<div class="statusbar-left-cont">
<div ng-click="pause()" class="status__notify primary-hover">
<div id="recentStreamIndicator" class="recentStream__indicator"></div>
<span>{{recentChangeStatus.status}}</span>
</div>
<div class="status__notify primary-hover">
<img class="touch-ic primary-icon" src="./img/eye-filled.svg">
<span>{{numberLocale(sessionActions.diffViewed)}}</span>
</div>
<div class="status__notify primary-hover" style="padding-right: 4px;" onclick="searchMyLogs(1);">
<img class="touch-ic primary-icon" src="./img/rollback-filled.svg">
<span>{{numberLocale(sessionActions.rollback)}}</span>
</div>
<div class="status__notify" style="padding: 0;">
<span style="font-weight: bold;">·</span>
</div>
<div class="status__notify primary-hover" style="padding-left: 4px;" onclick="searchMyLogs(2);">
<span>{{numberLocale(sessionActions.undo)}}</span>
</div>
<div class="status__notify primary-hover" onclick="searchMyLogs(3);">
<img class="touch-ic primary-icon" src="./img/tag-filled.svg">
<span>{{numberLocale(sessionActions.delete)}}</span>
</div>
<div class="status__notify primary-hover" onclick="searchMyLogs(4);">
<img class="touch-ic primary-icon" src="./img/pencil-filled.svg">
<span>{{numberLocale(sessionActions.edit)}}</span>
</div>
<div class="status__notify primary-hover" onclick="searchMyLogs(5);">
<img class="touch-ic primary-icon" src="./img/warning-filled.svg">
<span>{{numberLocale(sessionActions.warn)}}</span>
</div>
<div class="status__notify primary-hover" onclick="searchMyLogs(6);">
<img class="touch-ic primary-icon" src="./img/report-filled.svg">
<span>{{numberLocale(sessionActions.report)}}</span>
</div>
</div>
<div class="statusbar-right-cont">
<div class='status__notify primary-hover'>
<span id="statusbarTime" onclick="changeTimeFormat(false);">Time</span>
</div>
</div>
</div>
<!-- Main Window -->
<div class="window-base secondary-cont">
<div id="windowContent" class="window-content">
<!-- description container -->
<div id="description-container" class="description-container fs-md" style="display: none; margin-top: 0;">
<div class="desc-un">
<div id="us" class="fs-sm custom-lang"><span class="custom-lang">[diff-info-user]</span> <div id="userLinkSpec" ng-click="openLink('diff');"></div></div>
<div class="fs-sm"><span class="custom-lang">[diff-info-namespace]</span> <div id="ns" style="display: inline-block" class="fs-sm"></div></div>
</div>
<div class="desc-wt">
<div class="fs-sm"><span class="custom-lang">[diff-info-wiki]</span> <div id="wiki" style="display: inline-block" class="fs-sm"></div></div>
<div id="tit" class="fs-sm" style="overflow: unset;"><span class="custom-lang">[diff-info-title]</span> <div id="pageLinkSpec" style="cursor: pointer; display: inline-block; color: var(--link-color);" ng-click="openLink('page');"></div></div>
</div>
<div class="desc-c">
<div class="fs-sm"><span class="custom-lang">[diff-info-comment]</span> <div id="com" style="display: inline-block" class="fs-sm"></div></div>
</div>
</div>
<!-- Mobile next diff button -->
<div id="patrol-container">
<div id="drawerFabPatrol" class="drawer-fab-patrol mobile-only" style="transform: scale(0); border: solid gold;">
<div id="drawer-patrol" class="accent-hover custom-lang" ng-click='patrol()' aria-label="[tooltip-patrol]" i-tooltip="top-right">
<img class="touch-ic accent-icon custom-lang" src="./img/check-mark.svg" alt="[img-patrol]">
</div>
</div>
</div>
<div id="drawerFab" class="drawer-fab mobile-only">
<div id="next-diff" class="accent-hover custom-lang" ng-click='nextDiff()' aria-label="[tooltip-m-next-difference]" i-tooltip="top-right">
<img class="touch-ic accent-icon custom-lang" src="./img/swviewer-filled.svg" alt="[img-next]">
</div>
<span id="next-diff-title" class="fs-md custom-lang">[diff-mo-fetching]</span>
<div class="accent-hover custom-lang" style="position: relative;" onclick="toggleMDrawer();" aria-label="[tooltip-m-queue]" i-tooltip="top-right">
<span class="drawer-btn__edits-count">{{edits.length}}</span>
<img class="touch-ic accent-icon custom-lang" src="./img/drawer-filled.svg" alt="[img-drawer]">
</div>
</div>
<div id="notificationFabBase" class="notification-fab-base notification-fab-base__inactive drawer-fab mobile-only">
<div id="notificationFab" class="secondary-hover custom-lang" onclick="openPO('notificationPanel'); notifyOpen();" aria-label="[tooltip-m-notification]" i-tooltip="top-left">
<span id="notify-fab-indicator" class="tab-notice-indicator" style="background-color: var(--bc-negative);">0</span>
<img class="secondary-icon touch-ic custom-lang" src="/img/bell-filled.svg" alt="[img-bell]">
</div>
</div>
<!-- Controls -->
<div id="moreControlOverlay" class="more-control__overlay" onclick="closeMoreControl();"></div>
<div id="controlsBase" class="controls-base floatbar" style="display: none;">
<!-- More control -->
<div id="moreControl" class="more-control more-control__hidden secondary-scroll">
<div>
<a class="secondary-hover fs-sm custom-lang" href='https://meta.wikimedia.org/wiki/Special:MyLanguage/Meta:Requests_for_help_from_a_sysop_or_bureaucrat' rel='noopener noreferrer' target='_blank'>[diff-mo-rfh]</a>
<span vr-line="secondary"></span>
<a class="secondary-hover fs-sm custom-lang" href='https://meta.wikimedia.org/wiki/Special:MyLanguage/Steward_requests/Miscellaneous' rel='noopener noreferrer' target='_blank'>[diff-mo-srm]</a>
<span vr-line="secondary"></span>
<a class="secondary-hover fs-sm custom-lang" href='https://meta.wikimedia.org/wiki/Special:MyLanguage/Steward_requests/Global' rel='noopener noreferrer' target='_blank'>[diff-mo-srg]</a>
<span vr-line="secondary"></span>
<a class="secondary-hover fs-sm custom-lang" href='https://meta.wikimedia.org/wiki/Special:MyLanguage/Global_sysops/Requests' rel='noopener noreferrer' target='_blank'>[diff-mo-gsr]</a>
</div>
<div id="CAUTH">
<div class="secondary-hover custom-lang" ng-click="copyCentralAuth()" aria-label="[tooltip-copy-link]" i-tooltip="top-left"><img class="touch-ic secondary-icon custom-lang" src="./img/copy-filled.svg" alt="[img-copy]"></div>
<a class="secondary-hover fs-md custom-lang" href='https://meta.wikimedia.org/wiki/Special:CentralAuth?target={{selectedEdit.user}}' onclick="closeMoreControl();" rel='noopener noreferrer' target='_blank'>[diff-mo-ca]</a>
</div>
<div>
<div class="secondary-hover custom-lang" ng-click="copyGlobalContribs()" aria-label="[tooltip-copy-link]" i-tooltip="top-left"><img class="touch-ic secondary-icon custom-lang" src="./img/copy-filled.svg" alt="[img-copy]"></div>
<a id="luxo" class="secondary-hover fs-md custom-lang" href='https://guc.toolforge.org/?src=hr&by=date&user={{selectedEdit.user}}' onclick="closeMoreControl();" rel='noopener noreferrer' target='_blank'>[diff-mo-guc]</a>
</div>
<div>
<div class="secondary-hover custom-lang" ng-click="copyViewHistory()" aria-label="[tooltip-copy-link]" i-tooltip="top-left"><img class="touch-ic secondary-icon custom-lang" src="./img/copy-filled.svg" alt="[img-copy]"></div>
<a class="secondary-hover fs-md custom-lang" href='{{selectedEdit.server_url + "" + selectedEdit.script_path}}/index.php?title={{selectedEdit.title | encodeURIComponent}}&action=history' onclick="toggleMoreControl();" rel='noopener noreferrer' target='_blank'>[diff-mo-vh]</a>
</div>
<div ng-click="doThank();">
<div class="secondary-hover custom-lang" aria-label="[tooltip-thank]" i-tooltip="top-left">
<img class="touch-ic secondary-icon custom-lang" src="./img/thumbs-up-filled.svg" alt="[img-thank]">
</div>
<a class="secondary-hover fs-md custom-lang"><span style="color: var(--tc-secondary);">[diff-mo-thank]</span></a>
</div>
<div ng-click="openEditSource();" onclick="openPW('editForm'); closeMoreControl();">
<div id="editBtn" class="secondary-hover custom-lang" aria-label="[tooltip-edit-source]" i-tooltip="top-left">
<img class="touch-ic secondary-icon custom-lang" src="./img/pencil-filled.svg" alt="[img-edit]">
</div>
<a class="secondary-hover fs-md custom-lang"><span style="color: var(--tc-secondary);">[diff-mo-es]</span></a>
</div>
</div>
<!-- Control buttons -->
<div id="control" class="toolbar">
<div class="desktop-only secondary-hover custom-lang" onclick="toggleMoreControl();" aria-label="[tooltip-more-options]" i-tooltip="top-right">
<img class="touch-ic secondary-icon custom-lang" src="./img/v-dots-filled.svg" alt="[more-options]">
</div>
<div id="browser" class="secondary-hover custom-lang" ng-click="browser();" aria-label="[tooltip-open-browser]" i-tooltip="top-right">
<img class="touch-ic secondary-icon custom-lang" src="./img/open-newtab-filled.svg" alt="[img-browser]">
</div>
<div id="patrol" class="secondary-hover custom-lang" ng-click="patrol();" aria-label="[tooltip-patrol]" i-tooltip="top-right" style="display: none">
<img class="touch-ic secondary-icon custom-lang" src="./img/check-mark.svg" alt="[img-patrol]">
</div>
<div id="tagBtn" class="secondary-hover custom-lang" ng-click="openTagPanel();" onclick="openPW('tagPanel')" aria-label="[tooltip-speedy-del]" i-tooltip="top">
<img class="touch-ic secondary-icon custom-lang" src="./img/tag-filled.svg" alt="[img-edit]">
</div>
<div id="customRevertBtn" class="secondary-hover custom-lang" ng-click="openCustomRevertPanel();" aria-label="[tooltip-custom-rollback]" i-tooltip="top">
<img class="touch-ic secondary-icon custom-lang" src="./img/custom-rollback-filled.svg" alt="[img-custom-rb]">
</div>
<div id="revert" class="secondary-hover custom-lang" ng-click="doRevert({}, true, true);" aria-label="[tooltip-rollback]" i-tooltip="top">
<img class="touch-ic secondary-icon custom-lang" src="./img/rollback-filled.svg" alt="[img-rollback]">
</div>
<div id="back" class="secondary-hover custom-lang" ng-click="Back();" aria-label="[tooltip-last-diff]" i-tooltip="top-left">
<img class="touch-ic secondary-icon custom-lang" src="./img/arrow-left-filled.svg" alt="[img-back]">
</div>
</div>
</div>
<!-- Welcome page and Difference viewer -->
<div class="diff-container frame-diff">
<iframe id='page-welcome' class='full-screen custom-lang' style='display: block;' title='[welcome-page-title]' src='templates/welcome.html'></iframe>
<iframe id='page' class='full-screen custom-lang' style='display: none;' title='[page-title]' sandbox='allow-same-origin allow-scripts'></iframe>
</div>
<!-- Edit Source | popup-window -->
<div id="editForm" class="pw__base" style='display: none; grid-template-areas: "pw__header pw__header" "pw__content pw__content";'>
<!--pw Header-->
<div class="pw__header action-header">
<div class="mobile-only secondary-hover custom-lang" onclick="openSidebar();" aria-label="[tooltip-m-sidebar]" i-tooltip="bottom-left">
<img class="touch-ic secondary-icon custom-lang" src="./img/drawer-filled.svg" alt="[img-box]">
</div>
<span class="action-header__title fs-xl custom-lang">[edit-source-title]</span>
<div class="mobile-only secondary-hover custom-lang" onclick="closePW()" aria-label="[tooltip-po-close]" i-tooltip="bottom-right">
<img class="touch-ic secondary-icon custom-lang" src="./img/cross-filled.svg" alt="[talk-img-cross]">
</div>
<span class="desktop-only pw__esc secondary-hover fs-md" onclick="closePW()">esc</span>
</div>
<!--pw Content-->
<div id="editFormBody" class="pw__content">
<img id="editSourceLoadingAnim" class="secondary-icon touch-ic" src="/img/swviewer-droping-anim.svg" style="opacity: .4; width: 100px; height: 100px; margin: auto;">
<textarea id="textpage" class="pw__content-body secondary-scroll editForm__textarea fs-md custom-lang" style="padding-bottom: 40px; color: var(--tc-secondary-low);" title="[tooltip-edit-form]"></textarea>
<div class="pw__floatbar">
<form ng-submit="saveEdit()"><input id="summaryedit" class="secondary-placeholder fs-md custom-lang" title="[summary-title]" placeholder="[summary-placeholder]"></form>
<span vr-line></span>
<div id="editForm-save" class="secondary-hover custom-lang" ng-click="saveEdit()" aria-label="[tooltip-publish-changes]" i-tooltip="top-right">
<img class="touch-ic secondary-icon custom-lang" src="./img/save-filled.svg" alt="[img-save]">
</div>
</div>
</div>
</div>
<!-- floating overlay -->
<div id="floatingOverlay" class="floating-overlay" onclick="closeSidebar();"></div>
</div>
</div>
</div>
</div>
<script>document.getElementById('loadingBar').style.width = "30%";</script>
<!-- customRevert | Popup-overlay -->
<div id="customRevert" class="po__base">
<div class="po__header action-header">
<span class="action-header__title fs-lg custom-lang">[custom-revert-title]</span>
<div class="mobile-only secondary-hover custom-lang" onclick="closePO()" aria-label="[tooltip-po-close]" i-tooltip="bottom-right">
<img class="touch-ic secondary-icon custom-lang" src="./img/cross-filled.svg" alt="[talk-img-cross]">
</div>
<span class="desktop-only po__esc secondary-hover fs-md" onclick="closePO()">esc</span>
</div>
<div class="po__content">
<div class="po__content-body secondary-scroll">
<form id="summariesContainer" style="display: flex" ng-submit="doRevert();">
<input class="i-input__secondary secondary-placeholder fs-md custom-lang" style="margin-right: 8px; flex: 1;" title="[tooltip-reason]" name="credit" id="credit" placeholder="[custom-revert-placeholder]"/>
<button type="button" class="i-btn__accent accent-hover fs-md custom-lang" id="btn-cr-u-apply" ng-click="doRevert();">[custom-revert-button]</button>
</form>
<br>
<div class="i__base">
<div class="i__title fs-md custom-lang">[warn-user-title]</div>
<div class="i__description fs-xs custom-lang">[warn-user-desc]</div>
<div class="i__content fs-sm">
<div id="warn-box" class="t-btn__secondary"></div>
</div>
</div>
<div class="i__base" id="last-warn-box">
<div class="i__title fs-md custom-lang">[max-warn-title]</div>
<div class="i__description fs-xs custom-lang">[max-warn-desc]</div>
<div class="i__content fs-sm">
<span id="max" class="i-checkbox" onclick="toggleICheckBox(this);"></span>
</div>
</div>
<div class="i__base" id="treat-undo-box">
<div class="i__title fs-md custom-lang">[treat-undo-title]</div>
<div class="i__description fs-xs custom-lang">[treat-undo-desc]</div>
<div class="i__content fs-sm">
<span id="treatUndo" class="i-checkbox" onclick="toggleICheckBox(this);"></span>
</div>
</div>
<label class="fs-md custom-lang">[common-summaries]</label>
<div class="panel-cr-reasons" ng-repeat="description in selectedEdit.config.rollback track by $index">
<div class="fs-sm" ng-style="descriptionColor(description)" ng-click="selectRollbackDescription(description)">{{description.name}}</div>
</div>
</div>
</div>
</div>
<!-- tagPanel | Popup-overlay -->
<div id="tagPanel" class="po__base">
<div class="po__header action-header">
<span class="action-header__title fs-lg custom-lang">[tag-deletion-title]</span>
<div class="mobile-only secondary-hover custom-lang" onclick="closePO()" aria-label="[tooltip-po-close]" i-tooltip="bottom-right">
<img class="touch-ic secondary-icon custom-lang" src="./img/cross-filled.svg" alt="[talk-img-cross]">
</div>
<span class="desktop-only po__esc secondary-hover fs-md" onclick="closePO()">esc</span>
</div>
<div class="po__content">
<div class="po__content-body secondary-scroll">
<div class="i__base">
<div class="i__title fs-md custom-lang">[warn-user-title]</div>
<div class="i__description fs-xs custom-lang">[warn-user-desc]</div>
<div class="i__content fs-sm">
<div id="warn-box-delete" class="t-btn__secondary"></div>
</div>
</div>
<div id="speedyReasonsBox">
<div class="panel-cr-reasons" ng-repeat="speedy in selectedEdit.config.speedy track by $index" onclick="closePO();">
<div class="fs-sm" ng-style="speedyColor(speedy)" ng-click="selectSpeedy(speedy)">{{speedy.name}}</div>
</div>
</div>
<br/>
<div id="btn-group-addToGSR" class="i__base">
<div id="GSRRole" class="i__title fs-md custom-lang" style="display: none">[gsr-add]</div>
<div id="addToGSR-description" class="i__description fs-xs"></div>
<div id="GSRRole2" class="i__content fs-sm" style="display: none">
<span id="addToGSR" class="i-checkbox" onclick="toggleICheckBox (this);"></span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Settings | Popup-overlay -->
<div id="settingsOverlay" class="po__base">
<div class="po__header action-header">
<span class="action-header__title fs-lg custom-lang">[settings-title]</span>
<div class="mobile-only secondary-hover custom-lang" onclick="closePO()" aria-label="[tooltip-po-close]" i-tooltip="bottom-right">
<img class="touch-ic secondary-icon custom-lang" src="./img/cross-filled.svg" alt="[talk-img-cross]">
</div>
<span class="desktop-only po__esc secondary-hover fs-md" onclick="closePO()">esc</span>
</div>
<div class="po__content">
<div class="po__content-body secondary-scroll">
<div id="settingsBase">
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-theme]</div>
<div class="i__description fs-xs custom-lang">[settings-theme-descr]</div>
<div class="i__content fs-sm">
<select id="themeSelector" class="i-select__secondary fs-md"></select>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-language]</div>
<div class="i__description fs-xs custom-lang">[settings-language-descr]</div>
<div class="i__content fs-sm">
<select id="languageSelector" class="i-select__secondary fs-md" onchange="changeLanguageSelector()"></select>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-language-region]</div>
<div class="i__description fs-xs custom-lang">[settings-language-region-descr]</div>
<div class="i__content fs-sm">
<select id="localeSelector" class="i-select__secondary fs-md" onchange="changeLocaleSelector()"></select>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-sound]</div>
<div class="i__description fs-xs custom-lang">[settings-sound-descr]</div>
<div class="i__content fs-sm">
<select id="soundSelector" class="i-select__secondary fs-md">
<option class="custom-lang" value="0">[settings-sound-none]</option>
<option class="custom-lang" value="1">[settings-sound-all]</option>
<option class="custom-lang" value="2">[settings-sound-msg-a-mentions]</option>
<option class="custom-lang" value="3">[settings-sound-only-mentions]</option>
<option class="custom-lang" value="4">[settings-sound-edits]</option>
<option class="custom-lang" value="5">[settings-sound-only-edits]</option>
</select>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-revisions]</div>
<div class="i__description fs-xs custom-lang">[settings-revisions-descr]</div>
<div class="i__content fs-sm">
<select id="checkSelector" class="i-select__secondary fs-md">
<option class="custom-lang" value="0">[settings-revisions-onlylast]</option>
<option class="custom-lang" value="1">[settings-revisions-alert]</option>
<option class="custom-lang" value="2">[settings-revisions-all]</option>
</select>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-direction]</div>
<div class="i__description fs-xs custom-lang">[settings-direction-descr]</div>
<div class="i__content fs-sm">
<div id="bottom-up-btn" class="t-btn__secondary" onclick="toggleTButton(this); bottomUp(this);"></div>
</div>
</div>
<div class="desktop-only i__base">
<div class="i__title fs-md custom-lang">[settings-rh-mode]</div>
<div class="i__description fs-xs custom-lang">[settings-rh-mode-descr]</div>
<div class="i__content fs-sm">
<div id="RH-mode-btn" class="t-btn__secondary" onclick="toggleTButton(this); RHModeBtn(this, false);"></div>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-terminate-stream]</div>
<div class="i__description fs-xs custom-lang">[settings-terminate-stream-descr]</div>
<div class="i__content fs-sm">
<div id="terminate-stream-btn" class="t-btn__secondary" onclick="toggleTButton(this); terminateStreamBtn(this, false);"></div>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-jumps]</div>
<div class="i__description fs-xs custom-lang" id="jumps-descr">[settings-jumps-descr]</div>
<div class="i__content fs-sm">
<div id="jumps-btn" class="t-btn__secondary" onclick="toggleTButton(this); jumpsState(this, false);"></div>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-hotkeys]</div>
<div class="i__description fs-xs custom-lang" id="hotkeys-descr">[settings-hotkeys-descr]</div>
<div class="i__content fs-sm">
<div id="hotkeys-btn" class="t-btn__secondary" onclick="toggleTButton(this); hotkeysState(this, false);"></div>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-limit]</div>
<div class="i__description fs-xs custom-lang">[settings-limit-descr]</div>
<div class="i__content fs-sm">
<input id="max-queue" class="i-input__secondary secondary-placeholder fs-sm custom-lang" name="max-queue" placeholder="[settings-limit-placeholder]">
</div>
</div>
<div id="control-panel" class="i__base" style="display: none">
<div class="i__title fs-md custom-lang">[settings-control]</div>
<div class="i__extra">
<ul class="i-chip-list fs-sm">
<li><a id="cpLink" class="fs-sm custom-lang" href="https://swviewer.toolforge.org/php/control.php" rel="noopener noreferrer" target="_blank">[settings-control-panel]</a></li>
<li><a id="saLink" class="fs-sm custom-lang" href="https://swviewer-service.toolforge.org" rel="noopener noreferrer" target="_blank">[settings-service]</a></li>
</ul>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[settings-beta]</div>
<div class="i__extra">
<ul class="i-chip-list fs-sm">
<li><a class="fs-sm custom-lang" href="https://swviewer.toolforge.org/beta.php" rel="noopener noreferrer" target="_blank">[settings-beta-tester]</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- po Overlay-->
<div id="POOverlay" class="po__overlay" onclick="closePO()"></div>
<!-- Edit preset | Template -->
<template id="editPTitleTemplate">
<div>
<span class="fs-sm custom-lang">[presets-title]</span>
<input id="presetTitleInput" class="i-input__secondary secondary-placeholder fs-md" type="text" autocomplete="off" placeholder="">
</div><br/>
</template>
<template id="editPresetTemplate">
<div class="i__base">
<div class="i__title fs-md custom-lang">[presets-registered]</div>
<div class="i__description fs-xs custom-lang">[presets-registered-desc]</div>
<div class="i__content fs-sm">
<div id="registered-btn" class="t-btn__secondary" onclick="toggleTButton(this); registeredBtn(this);"></div>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[presets-anons]</div>
<div class="i__description fs-xs custom-lang">[presets-anons-desc]</div>
<div class="i__content fs-sm">
<div id="onlyanons-btn" class="t-btn__secondary" onclick="toggleTButton(this); onlyAnonsBtn(this);"></div>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[presets-new]</div>
<div class="i__description fs-xs custom-lang">[presets-new-desc]</div>
<div class="i__content fs-sm">
<div id="new-pages-btn" class="t-btn__secondary" onclick="toggleTButton(this); newPagesBtn(this);"></div>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[presets-only-new]</div>
<div class="i__description fs-xs custom-lang">[presets-only-new-desc]</div>
<div class="i__content fs-sm">
<div id="onlynew-pages-btn" class="t-btn__secondary" onclick="toggleTButton(this); onlyNewPagesBtn(this);"></div>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[presets-edits-limit]</div>
<div class="i__description fs-xs custom-lang">[presets-edits-limit-desc]</div>
<div class="i__content fs-sm">
<input id="max-edits" class="i-input__secondary secondary-placeholder fs-sm custom-lang" name="max-edits" placeholder="[presets-edits-limit-placeholder]">
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[presets-days-limit]</div>
<div class="i__description fs-xs custom-lang">[presets-days-limit-desc]</div>
<div class="i__content fs-sm">
<input id="max-days" class="i-input__secondary secondary-placeholder fs-sm custom-lang" name="max-days" placeholder="[presets-days-limit-placeholder]">
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[presets-ns]</div>
<div class="i__description fs-xs" style="display:flex"><span id="ns-desc" class="custom-lang">[presets-ns-desc]</span></div>
<div class="i__content fs-sm">
<div id="btn-delete-ns" class="i-minus fs-sm" onclick="nsDeleteFunct()">-</div>
<input id="ns-input" class="i-input__secondary secondary-placeholder fs-sm custom-lang" name="" placeholder="[presets-enter-placeholder]">
<div id="btn-add-ns" class="i-plus fs-sm" onclick="nsAddFunct()">+</div>
</div>
<div class="i__extra">
<ul id="nsList" class="i-chip-list fs-sm"></ul>
</div>
</div>
<div class="i__base">
<div class="i__title fs-md custom-lang">[presets-ores-filter]</div>
<div class="i__description fs-xs custom-lang">[presets-ores-filter-desc]</div>
<div class="i__content fs-sm">
<input id="ores-filter" class="i-input__secondary secondary-placeholder fs-sm custom-lang" name="ores-filter" placeholder="0-100">
</div>
</div>
<div id="sw-set" class="i__base" style="display:none;">
<div class="i__title fs-md custom-lang">[presets-sw]</div>
<div class="i__description fs-xs custom-lang">[presets-sw-desc]</div>
<div class="i__content fs-sm">
<div id="small-wikis-btn" class="t-btn__secondary" onclick="toggleTButton(this); smallWikisBtn(this);"></div>
</div>
</div>
<div id="ad-set" class="i__base" style="display:none;">
<div class="i__title fs-md custom-lang">[presets-additional]</div>
<div class="i__description fs-xs" style="display:flex"><span id="adw" class="custom-lang">[presets-additional-desc]</span></div>
<div class="i__content fs-sm">
<div id="lt-300-btn" class="t-btn__secondary" onclick="toggleTButton(this); lt300Btn(this);"></div>
</div>
</div>
<div id="custom-set" class="i__base" style="display:none; position:relative;">
<div class="i__title fs-md custom-lang">[presets-custom]</div>
<div class="i__description fs-xs custom-lang">[presets-custom-desc]</div>
<div class="i__content fs-sm" style="position:absolute; right:0px; width: 200px;">
<input id="bl-p" name="bl-p" class="i-input__secondary secondary-placeholder fs-sm custom-lang" ngtype="text" ng-model="selected" uib-typeahead="WikiForSelect.name as WikiForSelect.domain for WikiForSelect in WikisListForSelect | filter:$viewValue:startsWith | limitTo:8" class="form-control" typeahead-editable="false" typeahead-on-select="selectList('bl', selected); selected = '';" placeholder="[presets-enter-placeholder]">
</div>
<div class="i__extra">