-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhfr_new_page_number.user.js
More file actions
1572 lines (1509 loc) · 76.5 KB
/
Copy pathhfr_new_page_number.user.js
File metadata and controls
1572 lines (1509 loc) · 76.5 KB
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
// ==UserScript==
// @name [HFR] New Page Number
// @version 2.8.9
// @namespace roger21.free.fr
// @description Affiche le nombre de pages en retard sur la page des drapals et permet l'ouverture en masse des pages en retard avec un clic-milieu sur le drapal (fenêtre de configuration complète avec de nombreuses options).
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAilBMVEX%2F%2F%2F8AAADxjxvylSrzmzf5wYLzmjb%2F9er%2F%2Fv70nj32q1b5woT70qT82rT827b%2F%2B%2FjxkSHykybykyfylCjylCnzmDDzmjX0nTv1o0b1qFH2qVL2qlT3tGn4tmz4uHD4uXL5vHf83Lf83Lj937394MH%2B587%2B69f%2F8%2BX%2F8%2Bf%2F9On%2F9uz%2F%2BPH%2F%2BvT%2F%2FPmRE1AgAAAAwElEQVR42s1SyRbCIAysA7W2tdZ93%2Ff1%2F39PEtqDEt6rXnQOEMhAMkmC4E9QY9j9da1OkP%2BtTiBo1caOjGisDLRDANCk%2FVIHwwkBZGReh9avnGj2%2FWFg%2Feg5hD1bLZTwqdgU%2FlTSdrqZJWN%2FKImPOnGjiBJKhYqMvikxtlhLNTuz%2FgkxjmJRRza5mbcXpbz4zldLJ0lVEBY5nRL4CJx%2FMEfXE4L9j4Qr%2BZakpiandMpX6FO7%2FaPxxUTJI%2FsJ4cd4AoSOBgZnPvgtAAAAAElFTkSuQmCC
// @include https://forum.hardware.fr/forum1.php*
// @include https://forum.hardware.fr/forum1f.php*
// @include https://forum.hardware.fr/*/liste_sujet-*.htm
// @author roger21
// @updateURL https://raw.githubusercontent.com/roger21/hfr/master/hfr_new_page_number.user.js
// @installURL https://raw.githubusercontent.com/roger21/hfr/master/hfr_new_page_number.user.js
// @downloadURL https://raw.githubusercontent.com/roger21/hfr/master/hfr_new_page_number.user.js
// @supportURL https://forum.hardware.fr/hfr/Discussions/Viepratique/sujet_116015_1.htm
// @homepageURL http://roger21.free.fr/hfr/
// @noframes
// @grant GM.getValue
// @grant GM_getValue
// @grant GM.setValue
// @grant GM_setValue
// @grant GM.openInTab
// @grant GM_openInTab
// @grant GM.registerMenuCommand
// @grant GM_registerMenuCommand
// ==/UserScript==
/*
Copyright © 2012, 2014-2022 roger21@free.fr
This program is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <https://www.gnu.org/licenses/agpl.txt>.
*/
// $Rev: 3561 $
// historique :
// 2.8.9 (11/06/2022) :
// - amélioration de la gestion de la taille des champs dans la fenêtre de configuration pour ->
// éviter des débordements de ligne sur certaines configurations
// - redécoupage de certaines lignes longues dans le code
// 2.8.8 (24/01/2022) :
// - coloration en gris du champ "ouvrir les onglets à la fin" pour gm4
// - correction de la gestion du champ "inverser l'ordre des onglets" pour gm4
// 2.8.7 (03/01/2022) :
// - amélioration de l'actualisation du drapal pour l'ouverture en masse avec gm4
// 2.8.6 (02/02/2021) :
// - ajout du support pour GM.registerMenuCommand() (pour gm4)
// 2.8.5 (06/05/2020) :
// - correction d'une fôte
// 2.8.4 (05/05/2020) :
// - ajout de l'option pour ouvrir les onglets à la fin pour Violentmonkey et Tampermonkey
// 2.8.3 (04/05/2020) :
// - nouvelle gestion de l'ouverture des onglets pour Violentmonkey et Tampermonkey ->
// ouverture "à la fin" pour permettre de respecter l'ordre des "séquences" d'ouvertures
// 2.8.2 (11/04/2020) :
// - suppression de la tempo sur l'actualisation du drapal de l'ouverture en masse (marche pas)
// 2.8.1 (17/03/2020) :
// - conversion des click -> select() en focus -> select() sur les champs de saisie
// - reduction de la tempo sur l'actualisation du drapal de l'ouverture en masse
// 2.8.0 (20/02/2020) :
// - ajout d'une double option pour ouvrir les drapals dans un nouvel onglet
// - correction de la gestion des attributs spécifiques du script
// - ajout d'une tempo sur l'actualisation du drapal sur l'ouverture en masse ->
// pour éventuellement permettre une actualisation plus fiable
// - correction d'un bug visuel sur la fenêtre de conf ->
// (suppression de la règle CSS line-height inutile)
// 2.7.0 (18/02/2020) :
// - prise en compte de l'attribut target _blank sur les drapals
// 2.6.9 (13/02/2020) :
// - utilisation d'une url en data pour l'icône du script et changement d'hébergeur ->
// (free.fr -> github.com)
// 2.6.8 (11/01/2020) :
// - mise à jour des images des boutons de la fenêtre de configuration
// 2.6.7 (30/11/2019) :
// - ajout de majuscules sur les titres des sections de la fenêtre de configuration
// 2.6.6 (24/11/2019) :
// - minuscule amélioration du style de certaines images sur la fenêtre de configuration
// 2.6.5 (10/11/2019) :
// - ouverture de la fenêtre de configuration sur tout type de clic sur le bouton
// - réduction des temps des transitions de 0.7s à 0.3s et de 0.5s à 0.3s
// 2.6.4 (12/10/2019) :
// - ajout d'une info "sans rechargement" dans la fenêtre de configuration
// - contrainte de l'icône du bouton à 16px x 16px max
// 2.6.3 (02/10/2019) :
// - suppression de la directive "@inject-into" (mauvaise solution, changer solution)
// - correction de la gestion de la compatibilité gm4 (pour violentmonkey)
// 2.6.2 (18/09/2019) :
// - ajout de la directive "@inject-into content" pour isoler le script sous violentmonkey
// 2.6.1 (12/09/2019) :
// - priorité à la couleur de fin sur la couleur de début pour le dégradé en ->
// limite auto avec amplitude 0
// 2.6.0 (09/09/2019) :
// - nouvelle gestion de l'affichage de la fenêtre de configuration
// - restylage de la fenêtre de configuration (plus compacte)
// - bordure solide pour la fenêtre de configuration
// - petites mises en forme et corrections du code
// 2.5.4 (17/12/2018) :
// - ajout d'une protection contre le réaffichage du nombre de pages en retard ->
// en cas de retour sur la page des drapals, signalé par fugacef :jap:
// 2.5.3 (29/11/2018) :
// - ajout de l'avis de licence AGPL v3+
// 2.5.2 (09/09/2018) :
// - Nouveau format pour la metadata @description (avec majuscule et ponctuation).
// 2.5.1 (05/09/2018) :
// - correction d'une fôte oryble, signalée par demars :jap:
// 2.5.0 (11/08/2018) :
// - ajout de la configuration du délai de rafraîchissement de la page après un click
// - ajout d'un paramètre de rafraîchissement général de la page
// 2.4.0 (06/08/2018) :
// - nouveau nom : [HFR] new page number -> [HFR] New Page Number
// - gestion de la compatibilité gm4
// - check du code dans tm
// - suppression des @grant inutiles
// - maj de la metadata @homepageURL
// - ajout des metadata @author (roger21) et @authororig (Fred82)
// 2.3.6 (28/07/2018) :
// - petites corrections sur les styles css
// - petite maj de style sur l'affichage du nombre total de pages en retard
// 2.3.5 (06/04/2018) :
// - remplacement des window.location par des window.location.href pour fonctionner avec vm
// 2.3.4 (25/12/2017) :
// - désactivation de l'ouverture en masse par défaut
// 2.3.3 (28/11/2017) :
// - passage au https
// 2.3.2 (02/09/2017) :
// - petite correction sans conséquences sur la récupération d'un href
// 2.3.1 (02/09/2017) :
// - homogénéisation de la gestion des clics et des preventDefault avec [HFR] drapal esay click
// 2.3.0 (02/09/2017) :
// - restauration du lien l'orsque l'ouverture en masse est désactivée ->
// (ou limitée à 1 onglet) pour gsi spirit
// - correction de l'affichage du nombre total de pages en retard ->
// mal géré quand on applique la conf plusieurs fois)
// 2.2.3 (29/07/2017) :
// - ajout d'un preventDefault sur le mousedown du clic-milieu sur le drapal pour éviter ->
// l'apparition du défilement automatique
// 2.2.2 (29/07/2017) :
// - correction de la gestion du clic-milieu quand pas d'ouverture en masse ->
// (problème signalé par jakwarrior et gsi spirit)
// 2.2.1 (28/07/2017) :
// - n'affiche pas les totaux si c'est 0 (pasque bon :o )
// 2.2.0 (28/07/2017) :
// - nouvelle gestion du clic-milieu pour une éventuelle compatibilité avec chrome
// - ajout de l'affichage du nombre total de pages en retard et du nombre total de ->
// topics dans la case "Sujet"
// 2.1.3 (20/06/2017) :
// - suppression du text-align-last (maintenant que ça marche, on peut voir que ->
// c'était une connerie :o )
// 2.1.2 (11/02/2017) :
// - correction du style font-fammily à Verdana,Arial,Sans-serif,Helvetica (HFR Style)
// 2.1.1 (22/12/2016) :
// - modification de la gestion du dégradé pour les drapal à 0 en limite auto
// - légère modification de la description
// 2.1.0 (20/12/2016) :
// - ajout d'une option de rechargement de la page des drapals à l'ouverture d'un drapal
// 2.0.2 (15/12/2016) :
// - correction de certains styles css
// 2.0.1 (15/12/2016) :
// - correction d'un bug sur la position des fenêtres d'aide
// 2.0.0 (14/12/2016) :
// - ajout d'une gestion du dégradé
// - ajout d'une fenêtre de configuration complète
// - ajout de la gestion de la page des mps (problème rapporté par StefSamy)
// - suppression des experimentations commentées
// - modification de l'année dans les dates de l'historique : passage de 2 a 4 chiffres
// 1.1.0 (07/08/2016) :
// - reformatage du code (Online JavaScript beautifier : ->
// "2 spaces, unlimited newlines, do not wrap, braces with" et rien coché)
// - expérimentations sur la requete xhr finale (rien de concluant -> commenté)
// 1.0.9 (04/08/2015) :
// - correction d'une bêtise [:roger21:2]
// 1.0.8 (04/08/2015) :
// - amélioration du code sur l'affichage du nombre de pages en retard
// - ajout d'un title explicite comme sur ouverture en masse
// 1.0.7 (03/08/2015) :
// - importante réécriture du code (factorisation, homogénéisation, robustesse, syntaxe)
// -> le nombre d'onglets maximum configuré doit être resaisie
// - contournement du problème d'imposssibilité de réouvrir les onglets fermés
// - ajout d'un "+" devant le nombre de pages "en plus" du drapal
// 1.0.6 (07/03/2015) :
// - ajout de la metadata @noframes (interdit l'execution du script dans une frame pour ->
// plus de sécurité)
// 1.0.5 (07/04/2014) :
// - gestion du annuler sur le menu du script (code de porc is bad)
// 1.0.4 (04/04/2014) :
// - modification de la description
// - ajout d'une icone au script
// - ajout des dates dans l'historique
// 1.0.3 (18/03/2014) :
// - maj des metadata @grant et indentation des metadata
// 1.0.2 (14/09/2012) :
// - ajout des metadata @grant
// 1.0.1 (30/08/2012) :
// - réécriture
/* gestion de la compatibilité gm4 */
if(typeof GM === "undefined") {
this.GM = {};
}
if(typeof GM_getValue !== "undefined" && typeof GM.getValue === "undefined") {
GM.getValue = function(...args) {
return new Promise((resolve, reject) => {
try {
resolve(GM_getValue.apply(null, args));
} catch (e) {
reject(e);
}
});
};
}
if(typeof GM_setValue !== "undefined" && typeof GM.setValue === "undefined") {
GM.setValue = function(...args) {
return new Promise((resolve, reject) => {
try {
resolve(GM_setValue.apply(null, args));
} catch (e) {
reject(e);
}
});
};
}
if(typeof GM_openInTab !== "undefined" && typeof GM.openInTab === "undefined") {
GM.openInTab = function(...args) {
return new Promise((resolve, reject) => {
try {
resolve(GM_openInTab.apply(null, args));
} catch (e) {
reject(e);
}
});
};
}
var gmMenu = GM.registerMenuCommand || GM_registerMenuCommand;
/* nom du script */
var script_name = "[HFR] New Page Number";
/* les images */
var default_icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAACjUlEQVR42mWSXUhTcRjGz3B2E22ii5XgNvbhF%2BlwykzODDRZgh%2FMwDWmNyGpmDGTRGyixOZk7uDeMRtmJBIl3VgXGdJNJzMqvRAqsCLnpXlhXrSoSOfT%2F6SF1Au%2Fu%2F%2FD%2F3mf5%2BW4AwPi5IwMhgmUagapzT8oz%2FSJ%2BIzX1CDn%2Fh32UMY4wrAxfKAUEVF1fJty4htUJr6P1vsWYy22h5FuxU1hUHZQKIkaGSJIlkBIlVzwZGJ12Ip3VJucGXAkQl2N8zdGvM7oWExx0B6%2FJ0rZxpgaLy9noVR7CM%2BH7HgSakJztRWOGjuEcHR%2BMHLX1kmzcm5%2FJ8neF1xXA1OF6Kk6ig67AW9vteLecDtKLQXwXLmKa7H7iXaa87loUcXtBcF2YvbIoUR9wWGUGRQo1qeBP6GBtTAHWq0OGr0JDV2RpCu6LJ6hj9lMKGfpqVZ%2FUg42iMdEawks%2BnRMBzowHuxHZWUVSirqcDHyGM7wK1RRPF5Cn82cFLmU3nr4JFYidXCfMsBRUYRY0At%2FIAi1xoTqCz64aImJVmGhrTUDwcxJPW1GefHOJWtSf0wJjVqJPJMBemMuMo7rkJZpRLqxDJqaXhSNrCd1EYhphGxOKneFan3L4y0JwXMW%2BUYt%2BymE4OQj5PO10PLn0HA7AWvsO3SEhJLg5wgq7g055AuR87YZofNZZWkBiixWeHzjaO6fBMelorBlAsXhTejC2GEikYnKGXtX9IC6FcNeT5PT1bTobOv75h6Y2rX3TMPgDCK3b2k3K7D1VTmKp0zgZCj%2BXs6ov1fmHwoovcJUeZsw628UXoinRz%2BsWcJbazphR1QIzF74908Khuy%2Fm%2B2KzsndrFypJylyKb10KQhppz%2F29ucXz0Rq1fnX2JcAAAAASUVORK5CYII%3D";
var help_img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAACmUlEQVR42q2TX0haYRjGz8XYxW53s6sgbVQUiQ6i2IgxmIxgBDkKpAXRaCPZqFgsFhaFUrEoCIqkRDkjxTA0jEZSoigpiZKxMPzEKDwHQUnxz6Fo8exMhhFEV33wu%2FueHzwv70tR9%2F0s%2B5dCc%2FBCafKfE8Mel%2FvpzeV0nixZdqWVi44z4Z1ho5%2BTrfgKbCh%2BiYNTDsFYtkjopABftIDpDZadXI%2FLbg3TuzmZ1p3JHzLncP5OQr1KIJ%2F1o216D4P0AWw%2BFoHjLL4bSH6QProp0TjTgoWdFHMQ57DuT6CFDw3QIZAEh0iigNmNKKRqN%2FQ7x%2FBG0uhZ2Ge65gKCkmBmkx3ZJTlsh1JonvDi5bAThYsrHvznCi0TLkjHHFjzMjDvMmhVu0dKgtHVYxLguw7Rh2gadqBxaBuELWBxKwqj5wQcLzB6YhD1WdCz6IM7nMSrITspCfp1YS4Yy6BZ5ULDNzvEAzb%2BsxVL9giS2QucJjkoVwKo6TWj4asVvsgZxAorVxJ0zwW4QDSD1%2BMuiPqtqPtiQe1nCzLcHxwxWUgUZlR2G%2FCUR6IwwUtSKO80Xgtkag%2FxHKWg0AQg7rOhVrGG6k%2BrqPpgLFLxnkZFhw6CDi3a1Fuwhxg8btVeV%2BD7jOjsUVh9DBr6baVgIn0O5oxDmXy5SIVcA3onAhVf54F0%2FnqIEsW6oO7jGrPpZ6DfJhD1miDo1KN3zlHkX7i8fR5TpiBMriioplmGej4juLELZfIV2ZN2Om%2FxnsDojuGdahPVXVpUdizhrdIKvT0Mg5OAqv%2BRp55N3r6Nj5o1sodvFthReg%2B%2FgnG4wokiG%2F5TDGo8oMRqlqpTye6%2BphczQqpxWknVTxFKMpGjROocVTtOqJoxJVU1Krz36%2F0Lr2rVjUwVEAIAAAAASUVORK5CYII%3D";
var save_icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAACdklEQVR42q2TX0iTYRTGz1UXCRIMMWOIbKi4pJSU%2FWEbTpnQNowxYyYW1Ihwig4klGijDAtn1IaTqTTRiTbcaAqFCS4skUAkuuvPRxGCIypsoOz26XwftBZkVx544L14f8857znnJTrsqIyTUjFP3tIoCUWPaE82wQqTIAuRtzBAyv%2FC5TFyyKOUNkbluJFyY3jdK2lgtRO14WOgIUrTIDn%2BCXNWR%2FE07V9ZsiG06Uffi6uwLzVKEs%2FBzWF0LDSB%2Bmif9bdJWZQUxRHaEWHxYnOyHqZELfQLp2FkNbDM8TMIvL6LC3MmkJt26BopcgbyCPm0UyVSZhEWQW3sJNTzVVDPVUI3V4XI1iisMQ2CbKIYPAK6TL6cQdEECQOpTnhSLpjiNdA8VjFYAc0sK1qB6TdhZDIZvN3eQs%2BzDvQtdYDaSMgZHA1Q9v7GLbQk9TDEqrmSEax%2BXIZ2pgpTW2MS%2FGP3O3qeXoR1pgbDqQGQjbJ%2FmnCPsv51H2wJLVoSBnz%2B%2BkmCPqTf5WD3Yht04VJYIqfgT%2FWDmvMNBkm4vuxC78olGGdVcMbN2P72RYJ3f%2B7C%2FeQ86kMl0LNBV7IVvTEnqCnvCXSTfKqRAgQ27sA8o4IuokTrfAPW3q%2BgZ7EddaPHoQ6egDFUhsBLHwo9BGrMayJ5eCQ8GmdUjwevbqNxshyG8TJox%2BTQBEWJcCkernlhG6sB6XiMurwxSuHi5WinfXukHkE26U46YZmsxtlxFbr5CQGGLaFqUB0vku6AbWQDB9kpLesn9CacGHruwdCyB%2B6YHQVdXLaaV1l7EPw7zvGHsZKXuyyQgfYY2OOMAsvL2ZWH%2Fnt%2FATnRYAIAzln5AAAAAElFTkSuQmCC";
var close_icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAABzElEQVR42p2Sz0sCURDHH%2BbiU9ToB4LiD8Iu8ihQKBI0WEEUwYMdOkiXLp0i69CpDkERUVBQRBAUHTp0MCEKCipJi37QD%2Bj%2FWZlmXhpKu0UNPHaWt5%2BZ73xnGftjXPn9NsPLh3g8gEcY3V%2F6%2FeLM6y0cu93DuvBTIgGPqgp3g4NCD74OBKASCsGhy3W0390d%2Bga%2FZrPy3A8NQbWv76vIuc8nsADcRiLwkskA5dudnYU1p9PUKMDvo9HaczoN7%2Fk8UDEsANiRJEu4Gg4D3ddhbdXhUFok3g4M8Gp%2Fv%2FYQi8FbLgf0LPf0AHaXxZ6SSZlvtrcTzHVNwvk4QhpJpVGoI4GkCJXABsIrRnCTWfzU6609p1JwgR0xBxwR1p3O2q8wxYnHQ3PLbWAOJTzoD80N81ar%2BBHGjwV1vOntlR4QiCuV7hfdbliy22FaUYQhTB3LwaAEqTOapS3a7TXcOVSEgAOXC2YtFhhnrLUI%2Flmi1ATjO6x8wnzOauUziqJtdXRIZTs4ymRbG4w2F8E%2FSyWI1laswws225dhCPAJk4nWB7tdXTBlNsMIY2qLCjRJ3UOpyygZzfrm9hhjPM%2BYpgs3Ak1S9eBGoGxuCP83PgCikeJyFDsSMAAAAABJRU5ErkJggg%3D%3D";
var reset_icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs%2B9AAABhklEQVQY0wXBT0iTcRjA8e%2Fz%2FN537%2FvamjVa7lSUhUbsEiQRQf%2BoQ3gL6hSskA5Bt%2FQSXTz0%2F2xBl7okZR6EqEgiAvFgCAW1SPLPlGluilubZsv29PmQe37SAUw2u75Swv%2F%2BeXt7R2ve3I27K8GTzoObf8RTF78kU8e4NtTrAGa9qL9GaFVhfrDzdOvibt23rMGrCtiMyABX3g7JARt3b1KZPX%2FAKoLVnI6VHTMVxJZ8ffb4fHYb514Umi58uxMArBOzNYdVBVsiqFd8yY2dOpra%2Fy6nPBg%2F67%2B%2FetkBTGzhUx3sl9Cogk3HwiMA2Q8PHY8u%2FfQApoOwpwYbNaGxBraAtwrQvbwjlh0eUd04cV8Wo3TX1r%2F12%2F8UJyAIjYiwafYmLQPJUYt3jChTiebjZbAavq2KFuckdq%2BM%2FK56NArivmLmBruGPQoufLkuWMkxlffjhwAWktGZkmq96HS072l3lJlfUT6md%2B3Ma9A%2Fp24vQC6f8TFzk4lN6ddtbS2HbUKvF2%2Fpf4cUlw8oMuVkAAAAAElFTkSuQmCC";
var info_img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAABG0lEQVR42mNgoAZwrZy1C4jfAfFrIjFI7SpkAz4D8X907FEzF4yxyQHxC2QDPiBLupTP%2BO9Xv%2BD%2FjN2X%2Fs%2Fae%2Fm%2FX8MCsBiaAc9wGuBYNv1%2F9vQt%2F2Egb8ZWsBjRBoBscyqb8b9j3bH%2F03dd%2BB%2FQtJB4F4AUhrUu%2Bd%2B%2F5dT%2FvTde%2Fd917fn%2FxL41%2F52INQCkMGXiuv%2F3v8B98D99ykbSvOAOxIWztyMMmLQR6KXppAUiyNm%2FyDUApDiuZ9X%2F70DNf4E4qX8d6bEwC5gGYGDW7sukpQMXIC6Ytf3%2FpvOP%2Fm%2B68AjI3orNgKfIBnxxr5r9HxmDkrB37TwwBrHR5YGWvIQbIBJcvkc6ouatdFjVa6JwRM07kcCy1VTJyQAWb%2BM0%2Fl9lTAAAAABJRU5ErkJggg%3D%3D";
/* options par défaut */
var default_max_tab = 9;
var default_color_start_perso = "#ff7f00";
var default_color_end_perso = "#007fff";
var default_fixed_limit = 10;
var default_delay_click = 5; // 5 secondes
var default_delay_page = 10; // 10 minutes
/* options */
var display_button;
var button_icon;
var mass_opener;
var max_tab;
var reverse_order;
var open_at_end;
var color_gradient;
var color_start_type;
var color_end_type;
var color_start_perso;
var color_end_perso;
var limit_type;
var fixed_limit;
var progress_type;
var smaller_text;
var go_top;
var hash_haut;
var refresh_click;
var delay_click;
var display_totals;
var refresh_page;
var delay_page;
var open_new_tab;
var new_tab_foreground;
/* timers des refresh */
var refresh_click_timer = null;
var refresh_page_timer = null;
var scheduled_for_refresh = false;
/* couleurs auto */
var the_style = document.querySelector("head link[href^=\"/include/the_style1.php?color_key=\"]")
.getAttribute("href").split("/");
var color_start_auto = "#" + the_style[13].toLowerCase();
var color_end_auto = "#" + the_style[6].toLowerCase();
var color_text = "#" + the_style[12].toLowerCase();
/* variables globales */
var bigest_page_number = 0;
var actual_bigest_page_number = 0;
var computed_colors = {};
var open_in_background = {
active: false,
insert: !open_at_end,
};
var open_in_foreground = {
active: true,
insert: !open_at_end,
};
var gm4 = false;
if(GM && GM.info && GM.info.scriptHandler === "Greasemonkey") {
gm4 = true;
}
/* fonctions pour les refresh */
function refresh() {
window.location.reload(true);
}
function do_refresh_click(e) {
if(refresh_click && (e === null || e.ctrlKey || e.shiftKey || e.button === 1 || open_new_tab ||
(this.hasAttribute("target") && this.getAttribute("target") === "_blank"))) {
scheduled_for_refresh = true;
window.clearTimeout(refresh_click_timer);
refresh_click_timer = window.setTimeout(refresh, delay_click * 1000);
}
}
function do_refresh_page() {
if(refresh_page) {
window.clearTimeout(refresh_page_timer);
refresh_page_timer = window.setTimeout(refresh, delay_page * 60 * 1000);
}
}
/* fonctions de calcul des couleurs */
function pad(s) {
return s.length === 1 ? "0" + s : s;
}
function mj(r, g, b) {
return (((0.299 * r) + (0.587 * g) + (0.114 * b)) / 255) > 0.5 ? "#000000" : "#ffffff";
}
function white_or_black(bgcolor) {
if(typeof bgcolor === "string") {
// couleur au format hexa #rrggbb
return mj(parseInt(bgcolor.substr(1, 2), 16),
parseInt(bgcolor.substr(3, 2), 16),
parseInt(bgcolor.substr(5, 2), 16));
} else {
if(typeof bgcolor.alpha === "undefined") {
// un objet avec les 3 valeurs r g b en décimal
return mj(bgcolor.r, bgcolor.g, bgcolor.b);
} else {
// un objet avec les 4 valeurs r g b + alpha en décimal
let r = Math.round((parseInt(color_start_auto.substr(1, 2), 16) * (1 - bgcolor.alpha)) +
(bgcolor.r * bgcolor.alpha));
let g = Math.round((parseInt(color_start_auto.substr(3, 2), 16) * (1 - bgcolor.alpha)) +
(bgcolor.g * bgcolor.alpha));
let b = Math.round((parseInt(color_start_auto.substr(5, 2), 16) * (1 - bgcolor.alpha)) +
(bgcolor.b * bgcolor.alpha));
return mj(r, g, b);
}
}
}
function compute_colors(npn) {
let npn_index = "npn" + npn;
if(typeof computed_colors[npn_index] === "undefined") {
let text;
let background;
if(color_start_type !== "trans" && color_end_type !== "trans") { // color_start -> color_end
let color_start = color_start_type === "auto" ? color_start_auto : color_start_perso;
let color_end = color_end_type === "auto" ? color_end_auto : color_end_perso;
if(npn === actual_bigest_page_number) {
text = white_or_black(color_end);
background = color_end;
} else if(npn === 0) {
text = white_or_black(color_start);
background = color_start;
} else {
let start_r = parseInt(color_start.substr(1, 2), 16);
let start_g = parseInt(color_start.substr(3, 2), 16);
let start_b = parseInt(color_start.substr(5, 2), 16);
let end_r = parseInt(color_end.substr(1, 2), 16);
let end_g = parseInt(color_end.substr(3, 2), 16);
let end_b = parseInt(color_end.substr(5, 2), 16);
let color_r;
let color_g;
let color_b;
if(progress_type === "lin") {
color_r = Math.round(start_r + ((end_r - start_r) / actual_bigest_page_number * npn));
color_g = Math.round(start_g + ((end_g - start_g) / actual_bigest_page_number * npn));
color_b = Math.round(start_b + ((end_b - start_b) / actual_bigest_page_number * npn));
} else {
let a_r = (end_r - start_r) / Math.log10(1 + actual_bigest_page_number);
color_r = Math.round(start_r + (a_r * Math.log10(1 + npn)));
let a_g = (end_g - start_g) / Math.log10(1 + actual_bigest_page_number);
color_g = Math.round(start_g + (a_g * Math.log10(1 + npn)));
let a_b = (end_b - start_b) / Math.log10(1 + actual_bigest_page_number);
color_b = Math.round(start_b + (a_b * Math.log10(1 + npn)));
}
text = white_or_black({
r: color_r,
g: color_g,
b: color_b
});
background = "#" + pad(color_r.toString(16)) +
pad(color_g.toString(16)) + pad(color_b.toString(16));
}
} else if(color_start_type === "trans") { // transparent -> color_end
let color_end = color_end_type === "auto" ? color_end_auto : color_end_perso;
if(npn === actual_bigest_page_number) {
text = white_or_black(color_end);
background = color_end;
} else if(npn === 0) {
text = white_or_black(color_start_auto);
background = "transparent";
} else {
let end_r = parseInt(color_end.substr(1, 2), 16);
let end_g = parseInt(color_end.substr(3, 2), 16);
let end_b = parseInt(color_end.substr(5, 2), 16);
let alpha;
if(progress_type === "lin") {
alpha = Math.round(npn * 100 / actual_bigest_page_number) / 100;
} else {
let a = 1 / Math.log10(1 + actual_bigest_page_number);
alpha = Math.round((a * Math.log10(1 + npn)) * 100) / 100;
}
text = white_or_black({
r: end_r,
g: end_g,
b: end_b,
alpha: alpha
});
background = "rgba(" + end_r + ", " + end_g + ", " + end_b + ", " + alpha + ")";
}
} else { // color_start -> transparent
let color_start = color_start_type === "auto" ? color_start_auto : color_start_perso;
if(npn === actual_bigest_page_number) {
text = white_or_black(color_start_auto);
background = "transparent";
} else if(npn === 0) {
text = white_or_black(color_start);
background = color_start;
} else {
let start_r = parseInt(color_start.substr(1, 2), 16);
let start_g = parseInt(color_start.substr(3, 2), 16);
let start_b = parseInt(color_start.substr(5, 2), 16);
let alpha;
if(progress_type === "lin") {
alpha = 1 - (Math.round(npn * 100 / actual_bigest_page_number) / 100);
} else {
let a = 1 / Math.log10(1 + actual_bigest_page_number);
alpha = Math.round((1 - (a * Math.log10(1 + npn))) * 100) / 100;
}
text = white_or_black({
r: start_r,
g: start_g,
b: start_b,
alpha: alpha
});
background = "rgba(" + start_r + ", " + start_g + ", " + start_b + ", " + alpha + ")";
}
}
computed_colors[npn_index] = {
text: text,
background: background
};
}
return computed_colors[npn_index];
}
/* les style css */
var style = document.createElement("style");
style.setAttribute("type", "text/css");
style.textContent =
"#npn_help{position:fixed;width:200px;height:auto;background-color:#e3ebf5;z-index:1003;" +
"visibility:hidden;border:2px solid #6995c3;border-radius:8px;padding:4px 7px 5px;" +
"font-family:Verdana,Arial,Sans-serif,Helvetica;font-size:11px;font-weight:bold;" +
"text-align:justify;}" +
"#npn_background{position:fixed;left:0;top:0;background-color:#242424;z-index:1001;" +
"visibility:hidden;opacity:0;transition:opacity 0.3s ease 0s;}" +
"#npn_config{position:fixed;min-width:465px;height:auto;background:#ffffff;z-index:1002;" +
"visibility:hidden;opacity:0;transition:opacity 0.3s ease 0s;font-size:12px;" +
"border:1px solid black;padding:16px 16px 12px;font-family:Verdana,Arial,Sans-serif,Helvetica;}" +
"#npn_config fieldset{margin:8px 0 0;border:1px solid #888888;padding:4px 10px 10px;" +
"background:linear-gradient(to bottom, #ffffff 20px, transparent);" +
"transition:background-color 0.3s ease 0s;}" +
"#npn_config fieldset.npn_red{background-color:#ffc0b0;}" +
"#npn_config fieldset.npn_green{background-color:#c0ffb0;}" +
"#npn_config legend{font-size:14px;font-weight:normal;}" +
"#npn_config p{font-size:12px;font-weight:normal;font-family:Verdana,Arial,Sans-serif,Helvetica;" +
"margin:4px 0 0;white-space:nowrap;}" +
"#npn_config legend{background-color:#ffffff;}" +
"#npn_config legend.npn_alone{padding:0 3px 2px;}" +
"#npn_config input[type=checkbox]{margin:0 0 1px;vertical-align:text-bottom;}" +
"#npn_config legend input[type=checkbox]{margin-left:2px;}" +
"#npn_config input[type=text]{padding:0 1px;border:1px solid #c0c0c0;height:14px;" +
"font-size:12px;font-family:Verdana,Arial,Sans-serif,Helvetica;font-weight:normal;}" +
"#npn_config input[type=color]{padding:0;width:30px;height:15px;border:1px solid #c0c0c0;}" +
"#npn_config input[type=radio]{margin:0 0 2px;vertical-align:text-bottom;}" +
"#npn_config img{vertical-align:text-bottom;}" +
"#npn_config img.npn_help{margin-right:1px;cursor:help;}" +
"#npn_config img.npn_test{margin:0 3px 1px 0;max-width:16px;max-height:16px;}" +
"#npn_config img.npn_reset{cursor:pointer;margin:0 0 0 3px;vertical-align:baseline;}" +
"#npn_config table{border-collapse:collapse;}" +
"#npn_config div.npn_titre{margin-bottom:16px;text-align:center;font-weight:bold;font-size:16px;}" +
"#npn_config div.npn_di_saveclose{margin-top:16px;text-align:right;}" +
"#npn_config div.npn_di_saveclose div.npn_di_inforeload{float:left;}" +
"#npn_config div.npn_di_saveclose > img{margin-left:8px;cursor:pointer;}" +
"img.npn_button{max-width:16px;max-height:16px;}";
document.getElementsByTagName("head")[0].appendChild(style);
/* popup d'aide */
var npn_help = document.createElement("div");
npn_help.setAttribute("id", "npn_help");
document.body.appendChild(npn_help);
/* bouton d'aide */
function create_help_button(taille, help_text) {
let help_button = document.createElement("img");
help_button.setAttribute("src", help_img);
help_button.setAttribute("class", "npn_help");
help_button.addEventListener("mouseover", function(e) {
npn_help.style.width = taille + "px";
npn_help.textContent = help_text;
npn_help.style.left = (e.clientX + 32) + "px";
npn_help.style.top = (e.clientY - 16) + "px";
npn_help.style.visibility = "visible";
}, false);
help_button.addEventListener("mouseout", function(e) {
npn_help.style.visibility = "hidden";
}, false);
return help_button;
}
/* fonction de désactivation de l'action par défaut */
function prevent_default(e) {
e.preventDefault();
}
/* background pour la fenêtre de configuration */
var npn_background = document.createElement("div");
npn_background.setAttribute("id", "npn_background");
npn_background.addEventListener("click", hideconfig, false);
npn_background.addEventListener("transitionend", backgroundtransitionend, false);
npn_background.addEventListener("contextmenu", prevent_default, false);
document.body.appendChild(npn_background);
/* fenêtre de configuration */
var npn_config = document.createElement("div");
npn_config.setAttribute("id", "npn_config");
npn_config.addEventListener("contextmenu", prevent_default, false);
document.body.appendChild(npn_config);
/* titre de la fenêtre de configuration */
var npn_di_title = document.createElement("div");
npn_di_title.setAttribute("class", "npn_titre");
npn_di_title.appendChild(document.createTextNode("Configuration du script " + script_name));
npn_config.appendChild(npn_di_title);
/* options du bouton */
var npn_fs_button = document.createElement("fieldset");
var npn_lg_button = document.createElement("legend");
var npn_cb_button = document.createElement("input");
npn_cb_button.setAttribute("id", "npn_cb_button");
npn_cb_button.setAttribute("type", "checkbox");
function change_button() {
if(npn_cb_button.checked) {
npn_fs_button.setAttribute("class", "npn_green");
} else {
npn_fs_button.setAttribute("class", "npn_red");
}
}
npn_cb_button.addEventListener("change", change_button, false);
npn_lg_button.appendChild(npn_cb_button);
var npn_lb_button = document.createElement("label");
npn_lb_button
.appendChild(document.createTextNode(" Afficher le bouton du script sur la page des drapals "));
npn_lb_button.setAttribute("for", "npn_cb_button");
npn_lg_button.appendChild(npn_lb_button);
npn_lg_button.appendChild(create_help_button(250,
"Le bouton du script permet d'ouvrir cette fenêtre de " +
"configuration mais cette dernière reste accessible " +
"via le menu de l'extension."));
npn_fs_button.appendChild(npn_lg_button);
npn_config.appendChild(npn_fs_button);
/* icône du bouton */
var npn_p_button = document.createElement("p");
npn_p_button.appendChild(document.createTextNode("icône du bouton : "));
var npn_img_button = document.createElement("img");
npn_img_button.setAttribute("class", "npn_test");
npn_p_button.appendChild(npn_img_button);
var npn_in_button = document.createElement("input");
npn_in_button.setAttribute("type", "text");
npn_in_button.setAttribute("size", "39");
npn_in_button.setAttribute("title", "url de l'icône (http ou data)");
npn_in_button.addEventListener("focus", function() {
npn_in_button.select();
}, false);
function test_icon() {
npn_img_button.setAttribute("src", npn_in_button.value.trim());
npn_in_button.setSelectionRange(0, 0);
npn_in_button.blur();
}
npn_in_button.addEventListener("input", test_icon, false);
npn_p_button.appendChild(npn_in_button);
var npn_img_button_reset = document.createElement("img");
npn_img_button_reset.setAttribute("src", reset_icon);
npn_img_button_reset.setAttribute("class", "npn_reset");
npn_img_button_reset.setAttribute("title", "remettre l'icône par défaut");
function reset_button() {
npn_in_button.value = default_icon;
test_icon();
}
npn_img_button_reset.addEventListener("click", reset_button, false);
npn_p_button.appendChild(npn_img_button_reset);
npn_fs_button.appendChild(npn_p_button);
/* overture en masse */
var npn_fs_mass = document.createElement("fieldset");
var npn_lg_mass = document.createElement("legend");
var npn_cb_mass = document.createElement("input");
npn_cb_mass.setAttribute("id", "npn_cb_mass");
npn_cb_mass.setAttribute("type", "checkbox");
function change_mass() {
if(npn_cb_mass.checked) {
npn_fs_mass.setAttribute("class", "npn_green");
} else {
npn_fs_mass.setAttribute("class", "npn_red");
}
}
npn_cb_mass.addEventListener("change", change_mass, false);
npn_lg_mass.appendChild(npn_cb_mass);
var npn_lb_mass = document.createElement("label");
npn_lb_mass
.appendChild(document.createTextNode(" Activer l'ouverture en masse des pages en retard "));
npn_lb_mass.setAttribute("for", "npn_cb_mass");
npn_lg_mass.appendChild(npn_lb_mass);
npn_lg_mass.appendChild(create_help_button(225,
"Permet d'ouvrir un nombre paramétrable " +
"de pages en retard avec un clic-milieu sur le drapal."));
npn_fs_mass.appendChild(npn_lg_mass);
npn_config.appendChild(npn_fs_mass);
/* max tab, reverse order et open at end */
var npn_p_maxtab = document.createElement("p");
npn_p_maxtab
.appendChild(document.createTextNode("nombre maximum d'onglets à ouvrir simultanément : "));
var npn_in_maxtab = document.createElement("input");
npn_in_maxtab.setAttribute("type", "text");
npn_in_maxtab.setAttribute("size", "2");
npn_in_maxtab.setAttribute("maxlength", "2");
npn_in_maxtab.setAttribute("pattern", "[1-9]([0-9])?");
npn_in_maxtab.setAttribute("title", "de 1 à 99 onglets");
npn_in_maxtab.style.textAlign = "right";
npn_in_maxtab.addEventListener("focus", function() {
npn_in_maxtab.select();
}, false);
npn_p_maxtab.appendChild(npn_in_maxtab);
npn_fs_mass.appendChild(npn_p_maxtab);
var npn_p_reverseandopen = document.createElement("p");
var npn_cb_reverseorder = document.createElement("input");
npn_cb_reverseorder.setAttribute("id", "npn_cb_reverseorder");
npn_cb_reverseorder.setAttribute("type", "checkbox");
var npn_lb_reverseorder = document.createElement("label");
npn_lb_reverseorder.appendChild(document.createTextNode(" inverser l'ordre des onglets "));
npn_lb_reverseorder.setAttribute("for", "npn_cb_reverseorder");
npn_p_reverseandopen.appendChild(npn_cb_reverseorder);
npn_p_reverseandopen.appendChild(npn_lb_reverseorder);
npn_p_reverseandopen.appendChild(create_help_button(250,
"Certaines configurations ont l'ordre des onglets " +
"inversé, cette option permet de les remettre à l'endroit."));
npn_p_reverseandopen
.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0"));
var npn_cb_openatend = document.createElement("input");
npn_cb_openatend.setAttribute("id", "npn_cb_openatend");
npn_cb_openatend.setAttribute("type", "checkbox");
var npn_lb_openatend = document.createElement("label");
npn_lb_openatend.appendChild(document.createTextNode(" ouvrir les onglets à la fin "));
npn_lb_openatend.setAttribute("for", "npn_cb_openatend");
npn_p_reverseandopen.appendChild(npn_cb_openatend);
npn_p_reverseandopen.appendChild(npn_lb_openatend);
npn_p_reverseandopen.appendChild(create_help_button(272,
"Permet d'ouvrir les onglets à la fin de tous les onglets ouverts, cela permet de mieux gérer " +
"l'ordre d'ouverture des onglets en cas d'ouvertures successives. " +
"Non disponible avec Greasemonkey v4."));
npn_fs_mass.appendChild(npn_p_reverseandopen);
/* dégradé */
var npn_fs_gradient = document.createElement("fieldset");
var npn_lg_gradient = document.createElement("legend");
var npn_cb_gradient = document.createElement("input");
npn_cb_gradient.setAttribute("id", "npn_cb_gradient");
npn_cb_gradient.setAttribute("type", "checkbox");
function change_gradient() {
if(npn_cb_gradient.checked) {
npn_fs_gradient.setAttribute("class", "npn_green");
} else {
npn_fs_gradient.setAttribute("class", "npn_red");
}
}
npn_cb_gradient.addEventListener("change", change_gradient, false);
npn_lg_gradient.appendChild(npn_cb_gradient);
var npn_lb_gradient = document.createElement("label");
npn_lb_gradient.appendChild(document.createTextNode(" Activer le dégradé sur la case du drapal "));
npn_lb_gradient.setAttribute("for", "npn_cb_gradient");
npn_lg_gradient.appendChild(npn_lb_gradient);
npn_lg_gradient.appendChild(create_help_button(225,
"Permet de visualiser en couleur les topics les plus en retard."));
npn_fs_gradient.appendChild(npn_lg_gradient);
npn_config.appendChild(npn_fs_gradient);
/* couleurs de début */
var npn_p_color_start = document.createElement("p");
npn_p_color_start.appendChild(document.createTextNode("couleur de début :"));
npn_p_color_start.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0"));
var npn_rd_color_start_auto = document.createElement("input");
npn_rd_color_start_auto.setAttribute("id", "npn_rb_color_start_auto");
npn_rd_color_start_auto.setAttribute("name", "npn_rb_color_start");
npn_rd_color_start_auto.setAttribute("type", "radio");
npn_p_color_start.appendChild(npn_rd_color_start_auto);
var npn_lb_color_start_auto = document.createElement("label");
npn_lb_color_start_auto.appendChild(document.createTextNode(" auto "));
npn_lb_color_start_auto.setAttribute("for", "npn_rb_color_start_auto");
npn_p_color_start.appendChild(npn_lb_color_start_auto);
var npn_co_color_start_auto = document.createElement("input");
npn_co_color_start_auto.setAttribute("id", "npn_co_color_start_auto");
npn_co_color_start_auto.setAttribute("type", "color");
npn_co_color_start_auto.setAttribute("disabled", "true");
npn_p_color_start.appendChild(npn_co_color_start_auto);
npn_p_color_start.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0"));
var npn_rd_color_start_trans = document.createElement("input");
npn_rd_color_start_trans.setAttribute("id", "npn_rb_color_start_trans");
npn_rd_color_start_trans.setAttribute("name", "npn_rb_color_start");
npn_rd_color_start_trans.setAttribute("type", "radio");
npn_p_color_start.appendChild(npn_rd_color_start_trans);
var npn_lb_color_start_trans = document.createElement("label");
npn_lb_color_start_trans.appendChild(document.createTextNode(" transparent"));
npn_lb_color_start_trans.setAttribute("for", "npn_rb_color_start_trans");
npn_p_color_start.appendChild(npn_lb_color_start_trans);
npn_p_color_start.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0"));
var npn_rd_color_start_perso = document.createElement("input");
npn_rd_color_start_perso.setAttribute("id", "npn_rb_color_start_perso");
npn_rd_color_start_perso.setAttribute("name", "npn_rb_color_start");
npn_rd_color_start_perso.setAttribute("type", "radio");
npn_p_color_start.appendChild(npn_rd_color_start_perso);
var npn_lb_color_start_perso = document.createElement("label");
npn_lb_color_start_perso.appendChild(document.createTextNode(" perso "));
npn_lb_color_start_perso.setAttribute("for", "npn_rb_color_start_perso");
npn_p_color_start.appendChild(npn_lb_color_start_perso);
var npn_co_color_start_perso = document.createElement("input");
npn_co_color_start_perso.setAttribute("id", "npn_co_color_start_perso");
npn_co_color_start_perso.setAttribute("type", "color");
function change_color_start_perso() {
npn_co_color_start_perso.setAttribute("title", npn_co_color_start_perso.value.toLowerCase());
}
npn_co_color_start_perso.addEventListener("change", change_color_start_perso, false);
npn_p_color_start.appendChild(npn_co_color_start_perso);
var npn_img_color_start_perso_reset = document.createElement("img");
npn_img_color_start_perso_reset.setAttribute("src", reset_icon);
npn_img_color_start_perso_reset.setAttribute("class", "npn_reset");
npn_img_color_start_perso_reset.setAttribute("title", "remettre la couleur par défaut");
function reset_color_start_perso() {
npn_co_color_start_perso.value = default_color_start_perso;
change_color_start_perso();
}
npn_img_color_start_perso_reset.addEventListener("click", reset_color_start_perso, false);
npn_p_color_start.appendChild(npn_img_color_start_perso_reset);
npn_fs_gradient.appendChild(npn_p_color_start);
/* couleurs de fin */
var npn_p_color_end = document.createElement("p");
npn_p_color_end.appendChild(document.createTextNode("couleur de fin :"));
npn_p_color_end.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0"));
var npn_rd_color_end_auto = document.createElement("input");
npn_rd_color_end_auto.setAttribute("id", "npn_rb_color_end_auto");
npn_rd_color_end_auto.setAttribute("name", "npn_rb_color_end");
npn_rd_color_end_auto.setAttribute("type", "radio");
npn_p_color_end.appendChild(npn_rd_color_end_auto);
var npn_lb_color_end_auto = document.createElement("label");
npn_lb_color_end_auto.appendChild(document.createTextNode(" auto "));
npn_lb_color_end_auto.setAttribute("for", "npn_rb_color_end_auto");
npn_p_color_end.appendChild(npn_lb_color_end_auto);
var npn_co_color_end_auto = document.createElement("input");
npn_co_color_end_auto.setAttribute("id", "npn_co_color_end_auto");
npn_co_color_end_auto.setAttribute("type", "color");
npn_co_color_end_auto.setAttribute("disabled", "true");
npn_p_color_end.appendChild(npn_co_color_end_auto);
npn_p_color_end.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0"));
var npn_rd_color_end_trans = document.createElement("input");
npn_rd_color_end_trans.setAttribute("id", "npn_rb_color_end_trans");
npn_rd_color_end_trans.setAttribute("name", "npn_rb_color_end");
npn_rd_color_end_trans.setAttribute("type", "radio");
npn_p_color_end.appendChild(npn_rd_color_end_trans);
var npn_lb_color_end_trans = document.createElement("label");
npn_lb_color_end_trans.appendChild(document.createTextNode(" transparent"));
npn_lb_color_end_trans.setAttribute("for", "npn_rb_color_end_trans");
npn_p_color_end.appendChild(npn_lb_color_end_trans);
npn_p_color_end.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0"));
var npn_rd_color_end_perso = document.createElement("input");
npn_rd_color_end_perso.setAttribute("id", "npn_rb_color_end_perso");
npn_rd_color_end_perso.setAttribute("name", "npn_rb_color_end");
npn_rd_color_end_perso.setAttribute("type", "radio");
npn_p_color_end.appendChild(npn_rd_color_end_perso);
var npn_lb_color_end_perso = document.createElement("label");
npn_lb_color_end_perso.appendChild(document.createTextNode(" perso "));
npn_lb_color_end_perso.setAttribute("for", "npn_rb_color_end_perso");
npn_p_color_end.appendChild(npn_lb_color_end_perso);
var npn_co_color_end_perso = document.createElement("input");
npn_co_color_end_perso.setAttribute("id", "npn_co_color_end_perso");
npn_co_color_end_perso.setAttribute("type", "color");
function change_color_end_perso() {
npn_co_color_end_perso.setAttribute("title", npn_co_color_end_perso.value.toLowerCase());
}
npn_co_color_end_perso.addEventListener("change", change_color_end_perso, false);
npn_p_color_end.appendChild(npn_co_color_end_perso);
var npn_img_color_end_perso_reset = document.createElement("img");
npn_img_color_end_perso_reset.setAttribute("src", reset_icon);
npn_img_color_end_perso_reset.setAttribute("class", "npn_reset");
npn_img_color_end_perso_reset.setAttribute("title", "remettre la couleur par défaut");
function reset_color_end_perso() {
npn_co_color_end_perso.value = default_color_end_perso;
change_color_end_perso();
}
npn_img_color_end_perso_reset.addEventListener("click", reset_color_end_perso, false);
npn_p_color_end.appendChild(npn_img_color_end_perso_reset);
npn_fs_gradient.appendChild(npn_p_color_end);
/* limite */
var npn_p_limit = document.createElement("p");
npn_p_limit.appendChild(document.createTextNode("limite pour la couleur de fin :"));
npn_p_limit.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0"));
var npn_rd_limit_fixed = document.createElement("input");
npn_rd_limit_fixed.setAttribute("id", "npn_rb_limit_fixed");
npn_rd_limit_fixed.setAttribute("name", "npn_rb_limit");
npn_rd_limit_fixed.setAttribute("type", "radio");
npn_p_limit.appendChild(npn_rd_limit_fixed);
var npn_lb_limit_fixed = document.createElement("label");
npn_lb_limit_fixed.appendChild(document.createTextNode(" fixé "));
npn_lb_limit_fixed.setAttribute("for", "npn_rb_limit_fixed");
npn_p_limit.appendChild(npn_lb_limit_fixed);
var npn_in_limit_fixed = document.createElement("input");
npn_in_limit_fixed.setAttribute("id", "npn_in_limit_fixed");
npn_in_limit_fixed.setAttribute("type", "text");
npn_in_limit_fixed.setAttribute("size", "3");
npn_in_limit_fixed.setAttribute("maxlength", "5");
npn_in_limit_fixed.setAttribute("pattern", "[1-9]([0-9])*");
npn_in_limit_fixed.setAttribute("title",
"nombre de pages nécéssaires pour atteindre la couleur de fin");
npn_in_limit_fixed.style.textAlign = "right";
npn_in_limit_fixed.addEventListener("focus", function() {
npn_in_limit_fixed.select();
}, false);
npn_p_limit.appendChild(npn_in_limit_fixed);
npn_p_limit.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0"));
var npn_rd_limit_auto = document.createElement("input");
npn_rd_limit_auto.setAttribute("id", "npn_rb_limit_auto");
npn_rd_limit_auto.setAttribute("name", "npn_rb_limit");
npn_rd_limit_auto.setAttribute("type", "radio");
npn_p_limit.appendChild(npn_rd_limit_auto);
var npn_lb_limit_auto = document.createElement("label");
npn_lb_limit_auto.appendChild(document.createTextNode(" automatique "));
npn_lb_limit_auto.setAttribute("for", "npn_rb_limit_auto");
npn_p_limit.appendChild(npn_lb_limit_auto);
npn_p_limit.appendChild(create_help_button(225,
"En mode automatique la limite est déterminé en " +
"fonction du topic ayant le plus de pages en retard."));
npn_fs_gradient.appendChild(npn_p_limit);
/* progression */
var npn_p_progress = document.createElement("p");
npn_p_progress.appendChild(document.createTextNode("progression du dégradé :"));
npn_p_progress.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0"));
var npn_rd_progress_lin = document.createElement("input");
npn_rd_progress_lin.setAttribute("id", "npn_rb_progress_lin");
npn_rd_progress_lin.setAttribute("name", "npn_rb_progress");
npn_rd_progress_lin.setAttribute("type", "radio");
npn_p_progress.appendChild(npn_rd_progress_lin);
var npn_lb_progress_lin = document.createElement("label");
npn_lb_progress_lin.appendChild(document.createTextNode(" linéaire"));
npn_lb_progress_lin.setAttribute("for", "npn_rb_progress_lin");
npn_p_progress.appendChild(npn_lb_progress_lin);
npn_p_progress.appendChild(document.createTextNode("\u00A0\u00A0\u00A0\u00A0"));
var npn_rd_progress_log = document.createElement("input");
npn_rd_progress_log.setAttribute("id", "npn_rb_progress_log");
npn_rd_progress_log.setAttribute("name", "npn_rb_progress");
npn_rd_progress_log.setAttribute("type", "radio");
npn_p_progress.appendChild(npn_rd_progress_log);
var npn_lb_progress_log = document.createElement("label");
npn_lb_progress_log.appendChild(document.createTextNode(" logarithmique "));
npn_lb_progress_log.setAttribute("for", "npn_rb_progress_log");
npn_p_progress.appendChild(npn_lb_progress_log);
npn_p_progress.appendChild(create_help_button(200,
"La progression logarithmique est plus adaptée lorsqu'il y a " +
"une forte disparité dans les nombres des pages en retard."));
npn_fs_gradient.appendChild(npn_p_progress);
/* option_diverses : smaller_text, go_top, refresh_click,
display_totals, refresh_page et open_new_tab */
var npn_fs_misc = document.createElement("fieldset");
var npn_lg_misc = document.createElement("legend");
npn_lg_misc.appendChild(document.createTextNode("Options diverses"));
npn_lg_misc.setAttribute("class", "npn_alone");
npn_fs_misc.appendChild(npn_lg_misc);
npn_config.appendChild(npn_fs_misc);
var npn_p_smallertext = document.createElement("p");
var npn_cb_smallertext = document.createElement("input");
npn_cb_smallertext.setAttribute("id", "npn_cb_smallertext");
npn_cb_smallertext.setAttribute("type", "checkbox");
var npn_lb_smallertext = document.createElement("label");
npn_lb_smallertext
.appendChild(document.createTextNode(" réduire la taille du texte des nombres "));
npn_lb_smallertext.setAttribute("for", "npn_cb_smallertext");
npn_p_smallertext.appendChild(npn_cb_smallertext);
npn_p_smallertext.appendChild(npn_lb_smallertext);
npn_p_smallertext.appendChild(create_help_button(225,
"Cette option permet de réduire légèrement la taille de la " +
"police utilisée pour afficher le nombre des pages en retard."));
npn_fs_misc.appendChild(npn_p_smallertext);
var npn_p_gotop = document.createElement("p");
var npn_cb_gotop = document.createElement("input");
npn_cb_gotop.setAttribute("id", "npn_cb_gotop");
npn_cb_gotop.setAttribute("type", "checkbox");
var npn_lb_gotop = document.createElement("label");
npn_lb_gotop
.appendChild(document.createTextNode(" ouvrir les nouvelles pages en haut des messages "));
npn_lb_gotop.setAttribute("for", "npn_cb_gotop");
npn_p_gotop.appendChild(npn_cb_gotop);
npn_p_gotop.appendChild(npn_lb_gotop);
npn_p_gotop.appendChild(create_help_button(250,
"Cette option permet de charger les nouvelles pages directement en " +
"haut du tableau des messages au lieu de les charger en haut de la page."));
npn_fs_misc.appendChild(npn_p_gotop);
var npn_p_refreshclick = document.createElement("p");
var npn_cb_refreshclick = document.createElement("input");
npn_cb_refreshclick.setAttribute("id", "npn_cb_refreshclick");
npn_cb_refreshclick.setAttribute("type", "checkbox");
var npn_lb_refreshclick = document.createElement("label");
npn_lb_refreshclick.appendChild(document.createTextNode(" recharger la page des drapals "));
npn_lb_refreshclick.setAttribute("for", "npn_cb_refreshclick");
var npn_in_refreshclick = document.createElement("input");
npn_in_refreshclick.setAttribute("id", "npn_in_refreshclick");
npn_in_refreshclick.setAttribute("type", "text");
npn_in_refreshclick.setAttribute("size", "2");
npn_in_refreshclick.setAttribute("maxlength", "2");
npn_in_refreshclick.setAttribute("pattern", "[1-9]([0-9])?");
npn_in_refreshclick.setAttribute("title", "de 1 à 99 secondes");
npn_in_refreshclick.style.textAlign = "right";
npn_in_refreshclick.addEventListener("focus", function() {
npn_in_refreshclick.select();
}, false);
var npn_lb_in_refreshclick = document.createElement("label");
npn_lb_in_refreshclick.appendChild(document.createTextNode(" secondes après un clic "));
npn_lb_in_refreshclick.setAttribute("for", "npn_in_refreshclick");
npn_p_refreshclick.appendChild(npn_cb_refreshclick);
npn_p_refreshclick.appendChild(npn_lb_refreshclick);
npn_p_refreshclick.appendChild(npn_in_refreshclick);
npn_p_refreshclick.appendChild(npn_lb_in_refreshclick);
npn_p_refreshclick.appendChild(create_help_button(250,
"Cette option permet de recharger automatiquement la page " +
"des drapals après l'ouverture d'un drapal vers un nouvel onglet."));
npn_fs_misc.appendChild(npn_p_refreshclick);
var npn_p_displaytotals = document.createElement("p");
var npn_cb_displaytotals = document.createElement("input");
npn_cb_displaytotals.setAttribute("id", "npn_cb_displaytotals");
npn_cb_displaytotals.setAttribute("type", "checkbox");
var npn_lb_displaytotals = document.createElement("label");
npn_lb_displaytotals
.appendChild(document.createTextNode(" afficher le nombre total de pages en retard "));
npn_lb_displaytotals.setAttribute("for", "npn_cb_displaytotals");
npn_p_displaytotals.appendChild(npn_cb_displaytotals);
npn_p_displaytotals.appendChild(npn_lb_displaytotals);
npn_p_displaytotals.appendChild(create_help_button(250,
"Cette option permet d'afficher le nombre total de pages en retard " +
"et le nombre total de topics dans la case \"Sujet\" du tableau des topics."));
npn_fs_misc.appendChild(npn_p_displaytotals);
var npn_p_refreshpage = document.createElement("p");
var npn_cb_refreshpage = document.createElement("input");
npn_cb_refreshpage.setAttribute("id", "npn_cb_refreshpage");
npn_cb_refreshpage.setAttribute("type", "checkbox");
var npn_lb_refreshpage = document.createElement("label");
npn_lb_refreshpage
.appendChild(document.createTextNode(" recharger la page des drapals toutes les "));