-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhfr_recherche_google.user.js
1626 lines (1566 loc) · 54.4 KB
/
hfr_recherche_google.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ==UserScript==
// @name [HFR] Recherche Google et DuckDuckGo
// @version 2.1.1
// @namespace roger21.free.fr
// @description Remplace le bouton de recherche du forum (en haut à droite) par un champ de recherche par Google, DuckDuckGo ou les deux.
// @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/*
// @author roger21
// @updateURL https://raw.githubusercontent.com/roger21/hfr/master/hfr_recherche_google.user.js
// @installURL https://raw.githubusercontent.com/roger21/hfr/master/hfr_recherche_google.user.js
// @downloadURL https://raw.githubusercontent.com/roger21/hfr/master/hfr_recherche_google.user.js
// @supportURL https://forum.hardware.fr/hfr/Discussions/Viepratique/sujet_116015_1.htm
// @homepageURL http://roger21.free.fr/hfr/
// @noframes
// @grant GM.openInTab
// @grant GM_openInTab
// @grant GM.getValue
// @grant GM_getValue
// @grant GM.setValue
// @grant GM_setValue
// @grant GM.registerMenuCommand
// @grant GM_registerMenuCommand
// ==/UserScript==
/*
Copyright © 2012-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: 3673 $
// historique :
// 2.1.1 (04/12/2022) :
// - détection du topic sur la page de réponse / édition normale
// 2.1.0 (01/09/2022) :
// - Why Not Both?
// 2.0.0 (20/08/2022) :
// - nouveau nom : [HFR] Recherche Google -> [HFR] Recherche Google et DuckDuckGo
// - possibilité de choisir entre Google et DuckDuckGo
// - possibilité de contextualiser la recherhce jusqu'au topic
// - ajout d'une fenêtre de configuration
// - refonte de l'interface
// 1.5.6 (03/01/2022) :
// - mise à jour des cats / sous-cats (ajout de la sous-cat windows 11)
// 1.5.5 (13/02/2020) :
// - utilisation d'une url en data pour l'icône du script et changement d'hébergeur ->
// (free.fr -> github.com)
// 1.5.4 (01/01/2020) :
// - mise à jour des cats / sous-cats
// 1.5.3 (02/10/2019) :
// - suppression de la directive "@inject-into" (mauvaise solution, changer solution)
// - correction de la gestion de la compatibilité gm4 (pour violentmonkey)
// 1.5.2 (18/09/2019) :
// - ajout de la directive "@inject-into content" pour isoler le script sous violentmonkey
// 1.5.1 (29/11/2018) :
// - ajout de l'avis de licence AGPL v3+
// 1.5.0 (12/08/2018) :
// - nouveau nom : [HFR] recherche google -> [HFR] Recherche Google
// - ajout de la metadata @author (roger21)
// 1.4.0 (26/05/2018) :
// - ajout du support pour la cat shop
// - gestion de la compatibilité gm4
// - utilisation de keydown au lieu de keypress
// - recodage en event.key au lieu de event.keyCode deprecated
// - check du code dans tm et restylage du code (moins barbare)
// - maj de la metadata @homepageURL
// - suppression des @grant inutiles
// - reformatage du code (Online JavaScript beautifier : ->
// "2 spaces, unlimited newlines, do not wrap, braces with" et rien coché)
// 1.3.1 (28/11/2017) :
// - passage au https
// 1.3.0 (30/10/2016) :
// - force l'ouverture de la recherche google au premier plan (ajout d'un paramètre ->
// modifiable dans le code)
// 1.2.8 (06/08/2016) :
// - compression de l'image du bouton (pngoptimizer)
// - correction des styles css du bouton et du champ de recherche
// - mise à jour des cats / sous-cats mais y'avait rien de nouveau :o
// - modification de l'année dans les dates de l'historique : passage de 2 a 4 chiffres
// 1.2.7 (20/01/2016) :
// - correction d'un deprecated dans string.replace()
// - ajout d'un padding left dans l'input de recherche pour voir ce con de curseur :o
// 1.2.6 (29/11/2015) :
// - nouvelle mise à jour des cats / sous-cats (nouvelle cat diy)
// 1.2.5 (11/11/2015) :
// - mise à jour des cats / sous-cats
// 1.2.4 (05/09/2015) :
// - nouveau logo google
// 1.2.3 (07/03/2015) :
// - ajout de la metadata @noframes (interdit l'execution du script dans une frame ->
// pour plus de sécurité)
// 1.2.2 (04/04/2014) :
// - modification de la description
// - ajout d'une icone au script
// - ajout des dates dans l'historique
// 1.2.1 (18/03/2014) :
// - modification de la description
// - maj des metadata @grant et indentation des metadata
// - correction d'une typo dans l'historique
// 1.2.0 (14/09/2013) :
// - nodeValue -> textContent pour gérer les nodes element des pages > 1
// 1.1.1 (14/09/2012) :
// - ajout des metadata @grant
// 1.1.0 (02/09/2012):
// - gestion des NO_BREAK_SPACE qui apparaissent comme ça par magie, merci md de merde
/* ---------------------------- */
/* gestion de compatibilité gm4 */
/* ---------------------------- */
if(typeof GM === "undefined") {
this.GM = {};
}
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);
}
});
};
}
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);
}
});
};
}
let gmMenu = GM.registerMenuCommand || GM_registerMenuCommand;
/* ---------- */
/* les images */
/* ---------- */
const img_google = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm%2B48GgAAAgNJREFUOI2lkjto02EUxX%2Ff90%2BszaPB0iaVLkaCQiIIidJKl1gf6FCXVuiondwEJw0SpWhRxKEiLdJB3Yov8AHSksRQxKFJXBRxEotV0epi0zzJ%2FzqYpDESEL3T5Xyc851z74X%2FLNUMfD%2Fc12EWK2OCGkHhA1wotSxCXAzzes98%2BnVLgZX9u8Ii6i7Q1eJDE1FRd2LxYg2w1Jqv%2B3YfEuERYK1CAiyB5EH5qnhRNOlGRQ2QjXg9KG6vk%2BWZVkbAHU953fG039igu4BJUzPkiS3O%2FRGhHLOcKWa6J%2FLxXtDyMltwDniTyUKLGL9VNYIabgt9w9Kbo%2FRi8%2FnuqUydvHd8NYBVb2wmGmUpxaKOV7UZ%2BACMnlzZGX47x1SDRUPdx5TtzQKmwQ%2FApf%2FGZouy1iMUTWO5TVdcHyr27FkJ9kNiYd2CuopIJ4CIdCilItWHT3WBdxXH8%2FclZ%2BDy2s5NRVNfCt88Npg8fqsAkIjYZ2pagxPZ08ivXkSSUF3jlXwwOr4W%2FFwUA5Tak21ffdp356i%2FRgw9HrL1z0yeQ8wLVUi0oW5AwyWGZkcOKuQJDYcksKQgC2wFbEbej%2B3LCbTpuhaPOE7WHQBkRu%2FNK60PACv19LAF2AHYACrtb8h5pmc7ffZT9RE1j3bg4RFnK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mcnCOUzMDBx8EpLcrOD1WMAAG67I%2F%2Bh5MSaAAAAAElFTkSuQmCC";
const img_gooduck = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhklEQVQ4y63Tv2tTURjG8c/NzaVSapFY6mBdK4oOqbq4dOgiLiJk6Ryc/QMC1aWruAkK/kQIuHQTpBkyOAhCxUmEDG5qurRNk+aHNw65SW8Nhg4903sO7/t9n/c553DSa2ft4vt2Radd8XGpXLifLxeCSfmZ9GZ7OX8lrmdvIcLNfKb3GM+ODUAxrmdHm4VMF4r5cmH5f4Bs0rmCWVzu1w+Z58IePXAX1UkKXuE6pqHfngZnM51h3sFxRniOnxC3ToHTQQ9aeDMRMFfdej1X3SqiCDoDH3LhAWxgO120st5YXFlvXBt5kPhwFU8g3psSzjM1ULCK1Xy58B3vcrWXOdxL1F4YmriATcxDvxMOPAj30o0XUYqjXZnuLJxPe/BgWAzxTgSioDs2cz9sD8NaGrB0JKsbJB78GAPE2f1h+CENOGJS/CsaxdGYggY08SgNWEsOE8Lh87+dbf2jYHcfdyqlmVr6Gj/hBl7g659vURNd/A4CX/AZbwkeNs88vVQpzWye2O/9C4nYcy1K62IBAAAAAElFTkSuQmCC";
let img_help = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAACmUlEQVR42q2TX0haYRjGz8XYxW53s6sgbVQUiQ6i2IgxmIxgBDkKpAXRaCPZqFgsFhaFUrEoCIqkRDkjxTA0jEZSoigpiZKxMPzEKDwHQUnxz6Fo8exMhhFEV33wu%2FueHzwv70tR9%2F0s%2B5dCc%2FBCafKfE8Mel%2FvpzeV0nixZdqWVi44z4Z1ho5%2BTrfgKbCh%2BiYNTDsFYtkjopABftIDpDZadXI%2FLbg3TuzmZ1p3JHzLncP5OQr1KIJ%2F1o216D4P0AWw%2BFoHjLL4bSH6QProp0TjTgoWdFHMQ57DuT6CFDw3QIZAEh0iigNmNKKRqN%2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:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAABzElEQVR42p2Sz0sCURDHH%2BbiU9ToB4LiD8Iu8ihQKBI0WEEUwYMdOkiXLp0i69CpDkERUVBQRBAUHTp0MCEKCipJi37QD%2Bj%2FWZlmXhpKu0UNPHaWt5%2BZ73xnGftjXPn9NsPLh3g8gEcY3V%2F6%2FeLM6y0cu93DuvBTIgGPqgp3g4NCD74OBKASCsGhy3W0390d%2Bga%2FZrPy3A8NQbWv76vIuc8nsADcRiLwkskA5dudnYU1p9PUKMDvo9HaczoN7%2Fk8UDEsANiRJEu4Gg4D3ddhbdXhUFok3g4M8Gp%2Fv%2FYQi8FbLgf0LPf0AHaXxZ6SSZlvtrcTzHVNwvk4QhpJpVGoI4GkCJXABsIrRnCTWfzU6609p1JwgR0xBxwR1p3O2q8wxYnHQ3PLbWAOJTzoD80N81ar%2BBHGjwV1vOntlR4QiCuV7hfdbliy22FaUYQhTB3LwaAEqTOapS3a7TXcOVSEgAOXC2YtFhhnrLUI%2Flmi1ATjO6x8wnzOauUziqJtdXRIZTs4ymRbG4w2F8E%2FSyWI1laswws225dhCPAJk4nWB7tdXTBlNsMIY2qLCjRJ3UOpyygZzfrm9hhjPM%2BYpgs3Ak1S9eBGoGxuCP83PgCikeJyFDsSMAAAAABJRU5ErkJggg==";
/* -------------- */
/* les constantes */
/* -------------- */
const script_name = "[HFR] Recherche Google et DuckDuckGo";
const google_url = "https://www.google.com/search?q=";
const duckduckgo_url = "https://duckduckgo.com/?q=";
const insite = " site:forum.hardware.fr";
/* ------------------------- */
/* les paramètres par défaut */
/* ------------------------- */
// "google", "duckduckgo" ou "both"
const gmhfrrgedr21_search_engine_default = "duckduckgo";
// 0, 1, 2 ou 3 (forum, cat, sous-cat ou topic)
const gmhfrrgedr21_max_context_level_default = 2;
// true ou false
const gmhfrrgedr21_open_in_foreground_default = true;
/* ---------------------- */
/* les variables globales */
/* ---------------------- */
let gmhfrrgedr21_search_engine;
let gmhfrrgedr21_max_context_level;
let gmhfrrgedr21_open_in_foreground;
let cat, subcat, topic, search_input, search_img;
let do_debug = false;
/* -------------------------------------------- */
/* les correspondances cats / sous-cats <=> url */
/* -------------------------------------------- */
let cats = {
cat0: {
key: "service-client-shophfr",
name: "Service client shop.hardware.fr"
},
cat1: {
key: "Hardware",
name: "Hardware",
subcats: {
subcat0: {
key: "carte-mere",
name: "Carte mère"
},
subcat1: {
key: "Memoire",
name: "Mémoire"
},
subcat2: {
key: "Processeur",
name: "Processeur"
},
subcat3: {
key: "2D-3D",
name: "Carte graphique"
},
subcat4: {
key: "Boitier",
name: "Boitier"
},
subcat5: {
key: "Alimentation",
name: "Alimentation"
},
subcat6: {
key: "HDD",
name: "Disque dur"
},
subcat7: {
key: "SSD",
name: "Disque SSD"
},
subcat8: {
key: "lecteur-graveur",
name: "CD/DVD/BD"
},
subcat9: {
key: "minipc",
name: "Mini PC"
},
subcat10: {
key: "Benchs",
name: "Bench"
},
subcat11: {
key: "Materiels-problemes-divers",
name: "Matériels & problèmes divers"
},
subcat12: {
key: "conseilsachats",
name: "Conseil d'achat"
},
subcat13: {
key: "hfr",
name: "HFR"
},
subcat14: {
key: "actualites",
name: "Actus"
}
}
},
cat2: {
key: "HardwarePeripheriques",
name: "Hardware - Périphériques",
subcats: {
subcat0: {
key: "Ecran",
name: "Ecran"
},
subcat1: {
key: "Imprimante",
name: "Imprimante"
},
subcat2: {
key: "Scanner",
name: "Scanner"
},
subcat3: {
key: "webcam-camera-ip",
name: "Webcam / Caméra IP"
},
subcat4: {
key: "Clavier-Souris",
name: "Clavier / Souris"
},
subcat5: {
key: "Joys",
name: "Joys"
},
subcat6: {
key: "Onduleur",
name: "Onduleur"
},
subcat7: {
key: "Divers",
name: "Divers"
}
}
},
cat3: {
key: "OrdinateursPortables",
name: "Ordinateurs portables",
subcats: {
subcat0: {
key: "portable",
name: "Portable"
},
subcat1: {
key: "Ultraportable",
name: "Ultraportable"
},
subcat2: {
key: "Transportable",
name: "Transportable"
},
subcat3: {
key: "Netbook",
name: "Netbook"
},
subcat4: {
key: "Composant",
name: "Composant"
},
subcat5: {
key: "Accessoire",
name: "Accessoire"
},
subcat6: {
key: "Conseils-d-achat",
name: "Conseils d'achat"
},
subcat7: {
key: "SAV",
name: "SAV"
}
}
},
cat4: {
key: "OverclockingCoolingModding",
name: "Overclocking, Cooling & Modding",
subcats: {
subcat0: {
key: "CPU",
name: "CPU"
},
subcat1: {
key: "GPU",
name: "GPU"
},
subcat2: {
key: "Air-Cooling",
name: "Air Cooling"
},
subcat3: {
key: "Water-Xtreme-Cooling",
name: "Water & Xtreme Cooling"
},
subcat4: {
key: "Silence",
name: "Silence"
},
subcat5: {
key: "Modding",
name: "Modding"
},
subcat6: {
key: "Divers-8",
name: "Divers"
}
}
},
cat5: {
key: "electroniquedomotiquediy",
name: "Electronique, domotique, DIY",
subcats: {
subcat0: {
key: "conception_depannage_mods",
name: "Conception, dépannage, mods"
},
subcat1: {
key: "nano-ordinateur_microcontroleurs_fpga",
name: "Nano-ordinateur, microcontrôleurs, FPGA"
},
subcat2: {
key: "domotique_maisonconnectee",
name: "Domotique et maison connectée"
},
subcat3: {
key: "mecanique_prototypage",
name: "Mécanique, prototypage"
},
subcat4: {
key: "imprimantes3D",
name: "Imprimantes 3D"
},
subcat5: {
key: "robotique_modelisme",
name: "Robotique et modélisme"
},
subcat6: {
key: "divers",
name: "Divers"
}
}
},
cat6: {
key: "gsmgpspda",
name: "Technologies Mobiles",
subcats: {
subcat0: {
key: "autres-os-mobiles",
name: "Autres OS Mobiles"
},
subcat1: {
key: "operateur",
name: "Opérateur"
},
subcat2: {
key: "telephone-android",
name: "Téléphone Android"
},
subcat3: {
key: "telephone-windows-phone",
name: "Téléphone Windows Phone"
},
subcat4: {
key: "telephone",
name: "Téléphone"
},
subcat5: {
key: "tablette",
name: "Tablette"
},
subcat6: {
key: "android",
name: "Android"
},
subcat7: {
key: "windows-phone",
name: "Windows Phone"
},
subcat8: {
key: "GPS-PDA",
name: "GPS / PDA"
},
subcat9: {
key: "accessoires",
name: "Accessoires"
}
}
},
cat7: {
key: "apple",
name: "Apple",
subcats: {
subcat0: {
key: "Mac-OS-X",
name: "Mac OS X"
},
subcat1: {
key: "Applications",
name: "Applications"
},
subcat2: {
key: "Mac",
name: "Mac"
},
subcat3: {
key: "Macbook",
name: "Macbook"
},
subcat4: {
key: "Iphone-amp-Ipod",
name: "Iphone & Ipod"
},
subcat5: {
key: "Ipad",
name: "Ipad"
},
subcat6: {
key: "Peripheriques",
name: "Périphériques"
}
}
},
cat8: {
key: "VideoSon",
name: "Video & Son",
subcats: {
subcat0: {
key: "HiFi-HomeCinema",
name: "HiFi & Home Cinema"
},
subcat1: {
key: "Materiel",
name: "Matériel"
},
subcat2: {
key: "Traitement-Audio",
name: "Traitement Audio"
},
subcat3: {
key: "Traitement-Video",
name: "Traitement Vidéo"
}
}
},
cat9: {
key: "Photonumerique",
name: "Photo numérique",
subcats: {
subcat0: {
key: "Appareil",
name: "Appareil"
},
subcat1: {
key: "Objectif",
name: "Objectif"
},
subcat2: {
key: "Accessoire",
name: "Accessoire"
},
subcat3: {
key: "Photos",
name: "Photos"
},
subcat4: {
key: "Technique",
name: "Technique"
},
subcat5: {
key: "Logiciels-Retouche",
name: "Logiciels & Retouche"
},
subcat6: {
key: "Argentique",
name: "Argentique"
},
subcat7: {
key: "Concours",
name: "Concours"
},
subcat8: {
key: "Galerie-Perso",
name: "Galerie Perso"
},
subcat9: {
key: "Divers-7",
name: "Divers"
}
}
},
cat10: {
key: "JeuxVideo",
name: "Jeux Video",
subcats: {
subcat0: {
key: "PC",
name: "PC"
},
subcat1: {
key: "Consoles",
name: "Consoles"
},
subcat2: {
key: "Achat-Ventes",
name: "Achat & Ventes"
},
subcat3: {
key: "Teams-LAN",
name: "Teams & LAN"
},
subcat4: {
key: "Tips-Depannage",
name: "Tips & Dépannage"
},
subcat5: {
key: "VR-Realite-Virtuelle",
name: "Réalité virtuelle"
},
subcat6: {
key: "mobiles",
name: "Mobiles"
}
}
},
cat11: {
key: "WindowsSoftware",
name: "Windows & Software",
subcats: {
subcat0: {
key: "windows-11",
name: "Win 11"
},
subcat1: {
key: "windows-10",
name: "Win 10"
},
subcat2: {
key: "windows-8",
name: "Win 8"
},
subcat3: {
key: "Windows-7-seven",
name: "Win 7"
},
subcat4: {
key: "Windows-vista",
name: "Win Vista"
},
subcat5: {
key: "Windows-nt-2k-xp",
name: "Win NT/2K/XP"
},
subcat6: {
key: "Win-9x-me",
name: "Win 9x/Me"
},
subcat7: {
key: "Securite",
name: "Sécurité"
},
subcat8: {
key: "Virus-Spywares",
name: "Virus/Spywares"
},
subcat9: {
key: "Stockage-Sauvegarde",
name: "Stockage/Sauvegarde"
},
subcat10: {
key: "Logiciels",
name: "Logiciels"
},
subcat11: {
key: "Tutoriels",
name: "Tutoriels"
}
}
},
cat12: {
key: "reseauxpersosoho",
name: "Réseaux grand public / SoHo",
subcats: {
subcat0: {
key: "FAI",
name: "FAI"
},
subcat1: {
key: "Reseaux",
name: "Réseaux"
},
subcat2: {
key: "Routage-et-securite",
name: "Sécurité"
},
subcat3: {
key: "WiFi-et-CPL",
name: "WiFi et CPL"
},
subcat4: {
key: "Hebergement",
name: "Hébergement"
},
subcat5: {
key: "Tel-TV-sur-IP",
name: "Tel / TV sur IP"
},
subcat6: {
key: "Chat-visio-et-voix",
name: "Chat, visio et voix"
},
subcat7: {
key: "Tutoriels",
name: "Tutoriels"
}
}
},
cat13: {
key: "systemereseauxpro",
name: "Systèmes & Réseaux Pro",
subcats: {
subcat0: {
key: "Reseaux",
name: "Réseaux"
},
subcat1: {
key: "Securite",
name: "Sécurité"
},
subcat2: {
key: "Telecom",
name: "Télécom"
},
subcat3: {
key: "Infrastructures-serveurs",
name: "Infrastructures serveurs"
},
subcat4: {
key: "Stockage",
name: "Stockage"
},
subcat5: {
key: "Logiciels-entreprise",
name: "Logiciels d'entreprise"
},
subcat6: {
key: "Management-SI",
name: "Management du SI"
},
subcat7: {
key: "poste-de-travail",
name: "Poste de travail"
}
}
},
cat14: {
key: "OSAlternatifs",
name: "Linux et OS Alternatifs",
subcats: {
subcat0: {
key: "Codes-scripts",
name: "Codes et scripts"
},
subcat1: {
key: "Debats",
name: "Débats"
},
subcat2: {
key: "Divers-2",
name: "Divers"
},
subcat3: {
key: "Hardware-2",
name: "Hardware"
},
subcat4: {
key: "Installation",
name: "Installation"
},
subcat5: {
key: "Logiciels-2",
name: "Logiciels"
},
subcat6: {
key: "Multimedia",
name: "Multimédia"
},
subcat7: {
key: "reseaux-securite",
name: "réseaux et sécurité"
}
}
},
cat15: {
key: "Programmation",
name: "Programmation",
subcats: {
subcat0: {
key: "ADA",
name: "Ada"
},
subcat1: {
key: "Algo",
name: "Algo"
},
subcat2: {
key: "Android",
name: "Android"
},
subcat3: {
key: "API-Win32",
name: "API Win32"
},
subcat4: {
key: "ASM",
name: "ASM"
},
subcat5: {
key: "ASP",
name: "ASP"
},
subcat6: {
key: "Big-Data",
name: "BI/Big Data"
},
subcat7: {
key: "C",
name: "C"
},
subcat8: {
key: "CNET-managed",
name: "C#/.NET managed"
},
subcat9: {
key: "C-2",
name: "C++"
},
subcat10: {
key: "Delphi-Pascal",
name: "Delphi/Pascal"
},
subcat11: {
key: "Flash-ActionScript",
name: "Flash/ActionScript"
},
subcat12: {
key: "HTML-CSS-Javascript",
name: "HTML/CSS"
},
subcat13: {
key: "iOS",
name: "iOS"
},
subcat14: {
key: "Java",
name: "Java"
},
subcat15: {
key: "Javascript-Node-js",
name: "Javascript/Node.js"
},
subcat16: {
key: "Langages-fonctionnels",
name: "Langages fonctionnels"
},
subcat17: {
key: "Perl",
name: "Perl"
},
subcat18: {
key: "PHP",
name: "PHP"
},
subcat19: {
key: "Python",
name: "Python"
},
subcat20: {
key: "Ruby",
name: "Ruby/Rails"
},
subcat21: {
key: "Shell-Batch",
name: "Shell/Batch"
},
subcat22: {
key: "SGBD-SQL",
name: "SQL/NoSQL"
},
subcat23: {
key: "VB-VBA-VBS",
name: "VB/VBA/VBS"
},
subcat24: {
key: "Windows-Phone",
name: "Windows Phone"
},
subcat25: {
key: "XML-XSL",
name: "XML/XSL"
},
subcat26: {
key: "Divers-6",
name: "Divers"
}
}
},
cat16: {
key: "Graphisme",
name: "Graphisme",
subcats: {
subcat0: {
key: "Cours",
name: "Cours"
},
subcat1: {
key: "Galerie",
name: "Galerie"
},
subcat2: {
key: "Infographie-2D",
name: "Infographie 2D"
},
subcat3: {
key: "PAO-Desktop-Publishing",
name: "PAO / Desktop Publishing"
},
subcat4: {
key: "Infographie-3D",
name: "Infographie 3D"
},
subcat5: {
key: "Webdesign",
name: "Web design"
},
subcat6: {
key: "Arts-traditionnels",
name: "Arts traditionnels"
},
subcat7: {
key: "Concours-2",
name: "Concours"
},
subcat8: {
key: "Ressources",
name: "Ressources"
},
subcat9: {
key: "Divers-5",
name: "Divers"
}
}
},
cat17: {
key: "AchatsVentes",
name: "Achats & Ventes",
subcats: {
subcat0: {
key: "Hardware",
name: "Hardware"
},
subcat1: {
key: "pc-portables",
name: "PC Portables"
},
subcat2: {
key: "tablettes",
name: "Tablettes"
},
subcat3: {
key: "Photo-Audio-Video",
name: "Photo"
},
subcat4: {
key: "audio-video",
name: "Audio, Vidéo"
},
subcat5: {
key: "Telephonie",
name: "Téléphonie"
},
subcat6: {
key: "Softs-livres",
name: "Softs, livres"
},
subcat7: {
key: "Divers-4",
name: "Divers"
},
subcat8: {
key: "Avis-estimations",
name: "Avis, estimations"
},
subcat9: {
key: "Feedback",
name: "Feed-back"
},
subcat10: {
key: "Regles-coutumes",
name: "Règles et coutumes"
}
}
},
cat18: {
key: "EmploiEtudes",
name: "Emploi & Etudes",
subcats: {
subcat0: {
key: "Marche-emploi",
name: "Marché de l'emploi"
},
subcat1: {
key: "Etudes-Orientation",
name: "Etudes / Orientation"
},
subcat2: {
key: "Annonces-emplois",
name: "Annonces d'emplois"
},
subcat3: {
key: "Feedback-entreprises",
name: "Feedback sur les entreprises"