generic-skin 2.5.2 → 2.6.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/vueChrono.js +45 -44
- package/apps/vueChrono.min.js +1 -1
- package/apps/vueDefault.js +354 -100
- package/apps/vueDefault.min.js +2 -4
- package/apps/vueMulti.js +49 -39
- package/apps/vueMulti.min.js +1 -1
- package/apps/vueRela.js +41 -40
- package/apps/vueRela.min.js +1 -1
- package/config/vueComponents.js +78 -114
- package/config/vueComponents.min.js +2 -4
- package/config/vueElements.js +1 -1
- package/config/vueElements.min.js +1 -1
- package/config/vueFilters.js +6 -0
- package/config/vueFilters.min.js +1 -1
- package/extensions/vueRouter.js +0 -0
- package/extensions/vueRouter.min.js +0 -0
- package/frameworks/FNRFramework.js +952 -860
- package/frameworks/FNRFramework.min.js +1 -1
- package/general.js +33 -9
- package/general.min.js +1 -1
- package/options/noManagers.js +3 -3
- package/options/noManagers.min.js +1 -1
- package/package.json +1 -1
- package/pages/ucp.js +37 -1
- package/pages/ucp.min.js +1 -1
- package/plugins/sjcl.min.js +0 -0
- package/readme.md +0 -0
- package/stylesheet.css +57 -26
- package/stylesheet.min.css +1 -1
|
@@ -1,862 +1,954 @@
|
|
|
1
1
|
const FNR = {
|
|
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
|
-
|
|
2
|
+
execFn: (callback) => {
|
|
3
|
+
document.addEventListener('forumReady', callback, false);
|
|
4
|
+
},
|
|
5
|
+
forum: {
|
|
6
|
+
getColors: () => {
|
|
7
|
+
return Object.values(forumColours)
|
|
8
|
+
.map((item) => {
|
|
9
|
+
return {
|
|
10
|
+
name: item.code,
|
|
11
|
+
hex: item.hex
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
getTopics: async (exclusions, limit) => {
|
|
16
|
+
const addContent = (elmt) => {
|
|
17
|
+
const titleElmnt = $(elmt).find('.topictitle');
|
|
18
|
+
const dateElmnt = $(elmt).children().last();
|
|
19
|
+
|
|
20
|
+
finalArray.push({
|
|
21
|
+
name: titleElmnt.text().trim(),
|
|
22
|
+
url: Vue.filter('url-to-normal')(titleElmnt.attr('href')),
|
|
23
|
+
lastpost: {
|
|
24
|
+
url: Vue.filter('url-to-normal')(dateElmnt.children().last().attr('href')),
|
|
25
|
+
date: dateElmnt.text().split('por')[0].trim(),
|
|
26
|
+
who: {
|
|
27
|
+
name: dateElmnt.find('strong a').length ? dateElmnt.find('strong a').text().trim() : 'Invitado',
|
|
28
|
+
url: Vue.filter('url-to-normal')(dateElmnt.find('strong a').length ? dateElmnt.find('strong a').attr('href') : '/'),
|
|
29
|
+
color: dateElmnt.find('strong a').length ? dateElmnt.find('strong a span').attr('style').split('color:')[1] : 'initial',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
forum: {
|
|
33
|
+
name: $(elmt).find('.row2 + .row2:not(.centered) a').text().trim(),
|
|
34
|
+
url: Vue.filter('url-to-normal')($(elmt).find('.row2 + .row2:not(.centered) a').attr('href')),
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getPage = async (url) => {
|
|
40
|
+
$.get(url, (data) => {
|
|
41
|
+
$(data).find('.ipbform').find('tbody').find('tr').each(function() {
|
|
42
|
+
if (finalArray.length < limit && exclusions.indexOf(parseInt($(this).find('.row2 + .row2:not(.centered) a').attr('href').split('/f')[1].split('-')[0])) === -1) {
|
|
43
|
+
addContent(this);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
if (finalArray.length === limit || !$(data).find('.pagination')[0].children.length || $(data).find('.pagination').children().last()[0].localName === 'b') {
|
|
48
|
+
return finalArray;
|
|
49
|
+
} else {
|
|
50
|
+
return getPage($(data).find('.pagination').children().last().attr('href'));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
await getPage('/latest?change_version=invision');
|
|
56
|
+
|
|
57
|
+
let finalArray = [];
|
|
58
|
+
|
|
59
|
+
return finalArray;
|
|
60
|
+
},
|
|
61
|
+
getMembers: (option) => {
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
let members = [];
|
|
64
|
+
|
|
65
|
+
const getUserData = (user, color) => {
|
|
66
|
+
return {
|
|
67
|
+
user: $(user).find('.membername span').text().trim(),
|
|
68
|
+
id: $(user).find('.popupmenu .popupmenu-item a').attr('href').split('?')[0],
|
|
69
|
+
img: $(user).find('.mini-avatar img').attr('src'),
|
|
70
|
+
color: color
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const getUsersPage = (page) => {
|
|
75
|
+
let users = [];
|
|
76
|
+
|
|
77
|
+
$(page).find('.member-list .member').each(function() {
|
|
78
|
+
const group = FNR.utility.getGroup($(this).find('.membername span').attr('style').split('color:')[1]);
|
|
79
|
+
|
|
80
|
+
if (option) {
|
|
81
|
+
users.push(getUserData(this, group));
|
|
82
|
+
} else {
|
|
83
|
+
if (group !== 'unknown' && group !== forumConfig.skinOptions.adminGroup) {
|
|
84
|
+
users.push(getUserData(this, group));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
return users;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const getPage = (url) => {
|
|
93
|
+
$.get(url, (data) => {
|
|
94
|
+
const nextURL = $(data).find('.pagination img[alt="Siguiente"]').parent().attr('href') || false;
|
|
95
|
+
|
|
96
|
+
members = members.concat(getUsersPage(data));
|
|
97
|
+
|
|
98
|
+
if (nextURL) {
|
|
99
|
+
getPage(nextURL);
|
|
100
|
+
} else {
|
|
101
|
+
resolve(members.sort((a, b) => {
|
|
102
|
+
if (a.user < b.user) return -1;
|
|
103
|
+
if (a.user > b.user) return 1;
|
|
104
|
+
return 0;
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
getPage('/memberlist?change_version=invision');
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
getGroups: (cache) => {
|
|
114
|
+
const getData = () => {
|
|
115
|
+
return new Promise((resolve, reject) => {
|
|
116
|
+
$.get('/groups?change_version=invision', (data) => {
|
|
117
|
+
let groups = [];
|
|
118
|
+
|
|
119
|
+
$(data).find('.group_list > li').each(function() {
|
|
120
|
+
groups.push({
|
|
121
|
+
id: parseInt($(this).find('a').attr('href').split('/g')[1].split('-')[0]),
|
|
122
|
+
name: $(this).find('a').text().trim(),
|
|
123
|
+
color: $(this).find('a').css('color'),
|
|
124
|
+
url: Vue.filter('url-to-normal')($(this).find('a').attr('href')),
|
|
125
|
+
count: parseInt($(this).find('div > span').text()) - 1
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
resolve(groups);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const readGroupsCache = () => {
|
|
135
|
+
return new Promise((resolve, reject) => {
|
|
136
|
+
FNR.cache.useData('groups', cache).then(
|
|
137
|
+
(result) => {
|
|
138
|
+
resolve(result);
|
|
139
|
+
},
|
|
140
|
+
(err) => {
|
|
141
|
+
getData().then((data) => {
|
|
142
|
+
FNR.cache.setData('groups', data);
|
|
143
|
+
|
|
144
|
+
resolve(data);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
return readGroupsCache();
|
|
152
|
+
},
|
|
153
|
+
getAffiliates: () => {
|
|
154
|
+
return new Promise((resolve, reject) => {
|
|
155
|
+
const tops = forumConfig.affiliatesMax;
|
|
156
|
+
|
|
157
|
+
const data = Object.entries(forumAffiliates).map((item) => {
|
|
158
|
+
let final = '';
|
|
159
|
+
|
|
160
|
+
item[1].forEach((item) => {
|
|
161
|
+
final += '<li><a href="' + item.url + '" title="' + item.title + '" target="_blank"><img src="' + item.img + '" alt="' + item.title + '"/></a></li>';
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
for (let i = 0; i < (tops[item[0]] - item[1].length); i++) {
|
|
165
|
+
final += '<li><a href="/" title="' + forumData.name + '"><img src="' + forumDefaults.affiliates[item[0]] + '" alt="' + forumData.name + '"/></a></li>';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return final;
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
resolve({
|
|
172
|
+
normal: data[0],
|
|
173
|
+
elite: data[1],
|
|
174
|
+
directory: data[2],
|
|
175
|
+
sister: data[3],
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
content: {
|
|
181
|
+
isAutosave: () => {
|
|
182
|
+
if (document.post === undefined) return false;
|
|
183
|
+
else return _userdata.user_id !== -1 && document.post.mode.value === 'reply' && document.post.t !== undefined
|
|
184
|
+
},
|
|
185
|
+
getPost: (url) => {
|
|
186
|
+
return new Promise((resolve, reject) => {
|
|
187
|
+
$.get(Vue.filter('url-to-invision')(url), (data) => {
|
|
188
|
+
const post = $(data).find("#p" + url.split("#")[1]);
|
|
189
|
+
|
|
190
|
+
resolve({
|
|
191
|
+
author: {
|
|
192
|
+
text: post.find(".author a").text(),
|
|
193
|
+
color: post.find(".author a span").css("color"),
|
|
194
|
+
url: Vue.filter('url-to-normal')(post.find(".author a").attr("href")),
|
|
195
|
+
},
|
|
196
|
+
content: post.find(".post-entry > div").html(),
|
|
197
|
+
date: post.find(".author").html().split("</a>")[1],
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
genPost: (id, content) => {
|
|
203
|
+
return new Promise((resolve, reject) => {
|
|
204
|
+
let save = document.createElement('iframe');
|
|
205
|
+
|
|
206
|
+
save.id = 'forum-save';
|
|
207
|
+
save.src = '/post?t=' + id + '&mode=reply&change_version=invision';
|
|
208
|
+
save.width = 0;
|
|
209
|
+
save.height = 0;
|
|
210
|
+
save.onload = () => {
|
|
211
|
+
saveDOM.onload = () => {
|
|
212
|
+
$('#forum-save').remove();
|
|
213
|
+
|
|
214
|
+
console.clear();
|
|
215
|
+
|
|
216
|
+
resolve(true);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
$('#forum-save').contents().find('.subtitle:contains("Mensaje")').next().find('textarea').val(content);
|
|
220
|
+
$('#forum-save').contents().find('.formbuttonrow.center input[value="Enviar"]').click();
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
document.querySelector('body > header').prepend(save);
|
|
224
|
+
|
|
225
|
+
const saveDOM = document.getElementById('forum-save');
|
|
226
|
+
});
|
|
227
|
+
},
|
|
228
|
+
genTopic: (id, name, content) => {
|
|
229
|
+
return new Promise((resolve, reject) => {
|
|
230
|
+
let save = document.createElement('iframe');
|
|
231
|
+
|
|
232
|
+
save.id = 'forum-save';
|
|
233
|
+
save.src = '/post?f=' + id + '&mode=newtopic&change_version=invision';
|
|
234
|
+
save.width = 0;
|
|
235
|
+
save.height = 0;
|
|
236
|
+
save.onload = () => {
|
|
237
|
+
saveDOM.onload = () => {
|
|
238
|
+
$('#forum-save').remove();
|
|
239
|
+
|
|
240
|
+
console.clear();
|
|
241
|
+
|
|
242
|
+
resolve(true);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
$('#forum-save').contents().find('dl dt:contains("Título del tema")').parent().find('input').val(name);
|
|
246
|
+
$('#forum-save').contents().find('.subtitle:contains("Mensaje")').next().find('textarea').val(content);
|
|
247
|
+
$('#forum-save').contents().find('.formbuttonrow.center input[value="Enviar"]').click();
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
document.querySelector('body > header').prepend(save);
|
|
251
|
+
|
|
252
|
+
const saveDOM = document.getElementById('forum-save');
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
user: {
|
|
257
|
+
getUrl: (name) => {
|
|
258
|
+
let character =
|
|
259
|
+
name !== undefined ? encodeURIComponent(name)
|
|
260
|
+
.replace(/[!'()]/g, escape)
|
|
261
|
+
.replace(/\*/g, "%2A") :
|
|
262
|
+
_userdata.user_id;
|
|
263
|
+
|
|
264
|
+
return "/profile?mode=viewprofile&u=" + character;
|
|
265
|
+
},
|
|
266
|
+
getLevel: async () => {
|
|
267
|
+
switch (_userdata.user_level) {
|
|
268
|
+
case 2:
|
|
269
|
+
return 'mod';
|
|
270
|
+
case 1:
|
|
271
|
+
return 'admin';
|
|
272
|
+
case 0:
|
|
273
|
+
return -1 == _userdata.user_id ? 'guest' : 'user';
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
getGroup: async () => {
|
|
277
|
+
const level = await FNR.user.getLevel();
|
|
278
|
+
|
|
279
|
+
if (level === 'guest') {
|
|
280
|
+
return 'unknown';
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const { colour } = await FNR.user.getProfile(_userdata.user_id, .25);
|
|
284
|
+
|
|
285
|
+
return colour;
|
|
286
|
+
},
|
|
287
|
+
getProfile: (name, time) => {
|
|
288
|
+
const character = name != undefined ? FNR.user.getUrl(name) : FNR.user.getUrl();
|
|
289
|
+
const cache = time || 5;
|
|
290
|
+
|
|
291
|
+
const processData = (content) => {
|
|
292
|
+
if (content.find('a').length) return Vue.filter('url-to-normal')(content.find('a').attr('href'));
|
|
293
|
+
else if (content.find('table').length) return content.find('table').html();
|
|
294
|
+
else if (content.find('img').length) return content.find('img').attr('src');
|
|
295
|
+
else if (content.find('textarea').length) return content.find('textarea').val();
|
|
296
|
+
else if (content.find('span').length) return content.find('span').text().trim();
|
|
297
|
+
else if (content.text().trim() === '-') return '';
|
|
298
|
+
else return content.text();
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
const getData = () => {
|
|
302
|
+
return new Promise((resolve, reject) => {
|
|
303
|
+
$.get(character + '&change_version=invision', (data) => {
|
|
304
|
+
let user = {};
|
|
305
|
+
|
|
306
|
+
user['name'] = $(data).find('.maintitle h1 span').text();
|
|
307
|
+
user['lastvisit'] = $(data).find('dt:contains("Última visita")').parent().find('dd').text();
|
|
308
|
+
user['colour'] = FNR.utility.getGroup($(data).find('.maintitle h1 span').css('color').replace('rgb(', 'rgb_').replace(/, /g, '_').replace(')', ''));
|
|
309
|
+
user['avatar'] = $(data).find('.real_avatar img').attr('src');
|
|
310
|
+
|
|
311
|
+
user['links'] = {
|
|
312
|
+
profile: '/u' + character.split('&u=')[1],
|
|
313
|
+
mp: '/privmsg?mode=post&u=' + character.split('&u=')[1],
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
user['messages'] = {
|
|
317
|
+
public: parseInt($(data).find('span:contains("Mensajes")').parent().parent().find('dd > div').text()) || 0,
|
|
318
|
+
private: parseInt($(data).find('dt:contains("Mensajes privados")').parent().find('dd').text()) || 0
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
user['fields'] = {};
|
|
322
|
+
|
|
323
|
+
$(data).find('dl[id^="field_id"]').each(function() {
|
|
324
|
+
if ($(this).find('dt span').text() !== '') {
|
|
325
|
+
if ($(this).find('dt span').text() === 'Mensajes') return;
|
|
326
|
+
|
|
327
|
+
user.fields[FNR.utility.genSlug($(this).find('dt span').text())] = {
|
|
328
|
+
name: $(this).find('dt span').text(),
|
|
329
|
+
content: processData($(this).find('dd .field_uneditable'))
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
$(data).find('.ipbform2 > dl').each(function() {
|
|
335
|
+
if ($(this).find('dt span').length && $(this).find('dt span').text() !== '') {
|
|
336
|
+
if ($(this).find('dt span').text() === 'Mensajes') return;
|
|
337
|
+
|
|
338
|
+
user.fields[FNR.utility.genSlug($(this).find('dt span').text())] = {
|
|
339
|
+
name: $(this).find('dt span').text(),
|
|
340
|
+
content: processData($(this).find('dd'))
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
user.fields['rango'] = {
|
|
346
|
+
name: 'Rango',
|
|
347
|
+
content: $(data).find('dt:contains("Rango:")').parent().find('dd').text()
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
resolve(user);
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
const readUserCache = (id) => {
|
|
356
|
+
const userId = `userInfo${id}`;
|
|
357
|
+
|
|
358
|
+
return new Promise((resolve, reject) => {
|
|
359
|
+
FNR.cache.useData(userId, cache).then(
|
|
360
|
+
(result) => {
|
|
361
|
+
resolve(result);
|
|
362
|
+
},
|
|
363
|
+
(err) => {
|
|
364
|
+
getData().then((data) => {
|
|
365
|
+
FNR.cache.setData(userId, data);
|
|
366
|
+
|
|
367
|
+
resolve(data);
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
});
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
return readUserCache(name);
|
|
375
|
+
},
|
|
376
|
+
changeAccount: async (out, username, password) => {
|
|
377
|
+
try {
|
|
378
|
+
await fetch(out);
|
|
379
|
+
await fetch('/login', {
|
|
380
|
+
method: 'POST',
|
|
381
|
+
headers: {
|
|
382
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
383
|
+
},
|
|
384
|
+
body: `username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}&autologin=1&login=1`
|
|
385
|
+
})
|
|
386
|
+
|
|
387
|
+
return true;
|
|
388
|
+
} catch (error) {
|
|
389
|
+
console.error('Error inesperado', error);
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
profile: {
|
|
394
|
+
getData: (array) => {
|
|
395
|
+
return new Promise((resolve, reject) => {
|
|
396
|
+
$.get('/profile?change_version=invision&mode=editprofile', (data) => {
|
|
397
|
+
const fields = data;
|
|
398
|
+
|
|
399
|
+
$.get('/profile?change_version=invision&mode=editprofile&page_profil=avatars', (data) => {
|
|
400
|
+
const avatar = data;
|
|
401
|
+
|
|
402
|
+
let result = [];
|
|
403
|
+
|
|
404
|
+
[].forEach.call(array, (item) => {
|
|
405
|
+
let value = '',
|
|
406
|
+
options = [];
|
|
407
|
+
|
|
408
|
+
switch (item.type) {
|
|
409
|
+
case 'input':
|
|
410
|
+
value = $(fields).find('dl:contains("' + item.name + '")').find('dd').find('input').val();
|
|
411
|
+
break;
|
|
412
|
+
|
|
413
|
+
case 'textarea':
|
|
414
|
+
value = $(fields).find('dl:contains("' + item.name + '")').find('dd').find('textarea').val();
|
|
415
|
+
break;
|
|
416
|
+
|
|
417
|
+
case 'select':
|
|
418
|
+
value = $(fields).find('dl:contains("' + item.name + '")').find('dd').find('select option:selected').attr('value');
|
|
419
|
+
|
|
420
|
+
$(fields).find('dl:contains("' + item.name + '")').find('dd').find('select option').each(function() {
|
|
421
|
+
if ($(this).attr('value') === '') return;
|
|
422
|
+
|
|
423
|
+
options.push({
|
|
424
|
+
name: $(this).text(),
|
|
425
|
+
value: $(this).attr('value')
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
break;
|
|
429
|
+
|
|
430
|
+
case 'avatar':
|
|
431
|
+
value = $(avatar).find('.box-content img').attr('src');
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if (item.type === 'select' && value === undefined || item.type === 'select' && value === '') return;
|
|
436
|
+
|
|
437
|
+
let final = {
|
|
438
|
+
type: item.type,
|
|
439
|
+
name: item.name,
|
|
440
|
+
value: value
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
if (item.validation) {
|
|
444
|
+
final.validation = item.validation;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (options.length) {
|
|
448
|
+
final.options = options;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
result.push(final);
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
resolve(result);
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
});
|
|
458
|
+
},
|
|
459
|
+
setData: (array) => {
|
|
460
|
+
return new Promise((resolve, reject) => {
|
|
461
|
+
const resolveSetter = () => {
|
|
462
|
+
$('#forum-save').remove();
|
|
463
|
+
|
|
464
|
+
console.clear();
|
|
465
|
+
|
|
466
|
+
resolve(true);
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
let save = document.createElement('iframe');
|
|
470
|
+
|
|
471
|
+
save.id = 'forum-save';
|
|
472
|
+
save.src = '/profile?change_version=invision&mode=editprofile';
|
|
473
|
+
save.width = 0;
|
|
474
|
+
save.height = 0;
|
|
475
|
+
save.onload = () => {
|
|
476
|
+
let avatar = false;
|
|
477
|
+
|
|
478
|
+
[].forEach.call(array, (item) => {
|
|
479
|
+
switch (item.type) {
|
|
480
|
+
case 'input':
|
|
481
|
+
$('#forum-save').contents().find('dl:contains("' + item.name + '")').find('dd').find('input').first().val(item.value);
|
|
482
|
+
break;
|
|
483
|
+
|
|
484
|
+
case 'textarea':
|
|
485
|
+
$('#forum-save').contents().find('dl:contains("' + item.name + '")').find('dd').find('textarea').val(item.value);
|
|
486
|
+
break;
|
|
487
|
+
|
|
488
|
+
case 'select':
|
|
489
|
+
$('#forum-save').contents().find('dl:contains("' + item.name + '")').find('dd').find('select option[value="' + item.value + '"]').attr('selected', 'selected');
|
|
490
|
+
break;
|
|
491
|
+
|
|
492
|
+
case 'avatar':
|
|
493
|
+
avatar = item.value;
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
saveDOM.onload = () => {
|
|
499
|
+
if (!avatar) {
|
|
500
|
+
resolveSetter();
|
|
501
|
+
} else {
|
|
502
|
+
saveDOM.onload = () => {
|
|
503
|
+
saveDOM.onload = () => {
|
|
504
|
+
resolveSetter();
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
$('#forum-save').contents().find('input[name="avatarremoteurl"]').val(avatar);
|
|
508
|
+
$('#forum-save').contents().find('input[type="submit"][value="Registrar"]').click();
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
saveDOM.src = '/profile?change_version=invision&mode=editprofile&page_profil=avatars';
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
$('#forum-save').contents().find('input[type="submit"][value="Registrar"]').click();
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
document.querySelector('body > header').prepend(save);
|
|
519
|
+
|
|
520
|
+
const saveDOM = document.getElementById('forum-save');
|
|
521
|
+
});
|
|
522
|
+
},
|
|
523
|
+
followed: {
|
|
524
|
+
getPages: async () => {
|
|
525
|
+
try {
|
|
526
|
+
const followedPage = await fetch('/search?search_id=watchsearch&change_version=invision');
|
|
527
|
+
const bodyFollowedPage = await followedPage.text();
|
|
528
|
+
const htmlFollowedPage = document.createElement('html');
|
|
529
|
+
|
|
530
|
+
htmlFollowedPage.innerHTML = bodyFollowedPage;
|
|
531
|
+
|
|
532
|
+
const totalPages = htmlFollowedPage.querySelectorAll('.pagination a');
|
|
533
|
+
const finalPage = totalPages[totalPages.length - 2];
|
|
534
|
+
const finalPageUrl = finalPage.href.split(finalPage.origin)[1];
|
|
535
|
+
const finalPageNumberArray = finalPageUrl.match(/[0-9]/g) || [];
|
|
536
|
+
const finalPageNumber = parseInt(finalPageNumberArray.join('')) || 0;
|
|
537
|
+
|
|
538
|
+
const firstPage = totalPages[1];
|
|
539
|
+
const firstPageUrl = firstPage.href.split(firstPage.origin)[1];
|
|
540
|
+
const firstPageNumberArray = firstPageUrl.match(/[0-9]/g) || [];
|
|
541
|
+
const firstPageNumber = parseInt(firstPageNumberArray.join('')) || 0;
|
|
542
|
+
|
|
543
|
+
const arrayPages = finalPageNumber / firstPageNumber || 0
|
|
544
|
+
const arrayItems = Array(arrayPages).fill(null);
|
|
545
|
+
|
|
546
|
+
return {
|
|
547
|
+
items: htmlFollowedPage.querySelectorAll('.ipbtable tbody tr').length,
|
|
548
|
+
pages: ['/search?search_id=watchsearch&change_version=invision', ...arrayItems.map((page, index) => `/search?search_id=watchsearch&start=${firstPageNumber * (index + 1)}&change_version=invision`)],
|
|
549
|
+
}
|
|
550
|
+
} catch (error) {
|
|
551
|
+
console.error('Error inesperado', error);
|
|
552
|
+
return false;
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
getFollowed: async (page) => {
|
|
556
|
+
try {
|
|
557
|
+
const followedPage = await fetch(page);
|
|
558
|
+
const bodyFollowedPage = await followedPage.text();
|
|
559
|
+
const htmlFollowedPage = document.createElement('html');
|
|
560
|
+
|
|
561
|
+
htmlFollowedPage.innerHTML = bodyFollowedPage;
|
|
562
|
+
|
|
563
|
+
return Array.from(htmlFollowedPage.querySelectorAll('.ipbtable tbody tr')).map(row => {
|
|
564
|
+
const cells = row.children;
|
|
565
|
+
|
|
566
|
+
return {
|
|
567
|
+
id: parseInt(cells[7].children[0].value),
|
|
568
|
+
name: cells[1].querySelector('a').textContent.trim(),
|
|
569
|
+
url: Vue.filter('url-to-normal')(cells[1].querySelector('a').href),
|
|
570
|
+
views: parseInt(cells[5].textContent),
|
|
571
|
+
replies: parseInt(cells[3].textContent),
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
} catch (error) {
|
|
575
|
+
console.error('Error inesperado', error);
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
delFollowed: async (topics) => {
|
|
580
|
+
try {
|
|
581
|
+
await fetch('/search?search_id=watchsearch', {
|
|
582
|
+
method: 'POST',
|
|
583
|
+
headers: {
|
|
584
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
585
|
+
},
|
|
586
|
+
body: `confirm=confirm${topics.map(topic => `&mark${encodeURIComponent(`[]`)}2=${topic}`)}`
|
|
587
|
+
})
|
|
588
|
+
|
|
589
|
+
return true;
|
|
590
|
+
} catch (error) {
|
|
591
|
+
console.error('Error inesperado', error);
|
|
592
|
+
return false;
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
},
|
|
596
|
+
drafts: {
|
|
597
|
+
getDrafts: async () => {
|
|
598
|
+
const getPage = (content, baseIndex) => {
|
|
599
|
+
final = [];
|
|
600
|
+
|
|
601
|
+
if (content.querySelectorAll('.maintitle > h3').length && parseInt(content.querySelectorAll('.maintitle > h3')[0].textContent) !== 0) {
|
|
602
|
+
[].forEach.call(content.querySelectorAll('.ipbform .ipbtable tbody > tr'), (item) => {
|
|
603
|
+
const cells = item.querySelectorAll('td');
|
|
604
|
+
|
|
605
|
+
final.push({
|
|
606
|
+
topic: {
|
|
607
|
+
name: cells[baseIndex + 1].textContent.trim(),
|
|
608
|
+
url: Vue.filter('url-to-normal')(cells[baseIndex + 1].querySelector('a').href)
|
|
609
|
+
},
|
|
610
|
+
info: {
|
|
611
|
+
location: cells[baseIndex + 2].textContent.trim(),
|
|
612
|
+
date: cells[baseIndex + 3].textContent.trim()
|
|
613
|
+
},
|
|
614
|
+
modify: Vue.filter('url-to-normal')(cells[baseIndex + 4].querySelector('a').href)
|
|
615
|
+
});
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
return final;
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
try {
|
|
623
|
+
const msgDraft = await fetch('/search?search_id=draftsearch&change_version=invision');
|
|
624
|
+
const topicDraft = await fetch('/search?search_id=topicdraftsearch&change_version=invision');
|
|
625
|
+
|
|
626
|
+
const bodyMsgDraft = await msgDraft.text();
|
|
627
|
+
const bodyTopicDraft = await topicDraft.text();
|
|
628
|
+
|
|
629
|
+
const htmlMsgDraft = document.createElement('html');
|
|
630
|
+
const htmlTopicDraft = document.createElement('html');
|
|
631
|
+
|
|
632
|
+
htmlMsgDraft.innerHTML = bodyMsgDraft;
|
|
633
|
+
htmlTopicDraft.innerHTML = bodyTopicDraft;
|
|
634
|
+
|
|
635
|
+
return {
|
|
636
|
+
msgDrafts: getPage(htmlMsgDraft, 0),
|
|
637
|
+
topicDrafts: getPage(htmlTopicDraft, -1)
|
|
638
|
+
};
|
|
639
|
+
} catch (error) {
|
|
640
|
+
return false;
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
delDrafts: async (type, drafts) => {
|
|
644
|
+
try {
|
|
645
|
+
const deleteType = type === 'draft' ? 'draft' : 'topic_draft';
|
|
646
|
+
|
|
647
|
+
await fetch(`/search?search_id=${type}search`, {
|
|
648
|
+
method: 'POST',
|
|
649
|
+
headers: {
|
|
650
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
651
|
+
},
|
|
652
|
+
body: `confirm=confirm${drafts.map(draft => `&delete_${deleteType}${encodeURIComponent(`[${draft}]`)}=on`)}`
|
|
653
|
+
})
|
|
654
|
+
|
|
655
|
+
return true;
|
|
656
|
+
} catch (error) {
|
|
657
|
+
console.error('Error inesperado', error);
|
|
658
|
+
return false;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
cache: {
|
|
665
|
+
getData: (id) => {
|
|
666
|
+
if (localStorage.getItem(forumData.prefix + '_' + id) === null) return false;
|
|
667
|
+
else return JSON.parse(localStorage.getItem(forumData.prefix + '_' + id)).content;
|
|
668
|
+
},
|
|
669
|
+
setData: (id, data, time) => {
|
|
670
|
+
let cur_date = time === -1 ? 'undefined' : new Date().getTime();
|
|
671
|
+
|
|
672
|
+
localStorage.setItem(
|
|
673
|
+
forumData.prefix + '_' + id,
|
|
674
|
+
JSON.stringify({
|
|
675
|
+
cached_at: cur_date,
|
|
676
|
+
content: data,
|
|
677
|
+
})
|
|
678
|
+
);
|
|
679
|
+
},
|
|
680
|
+
delData: (id) => {
|
|
681
|
+
if (localStorage.getItem(forumData.prefix + '_' + id) === null) return false;
|
|
682
|
+
else return localStorage.removeItem(forumData.prefix + '_' + id);
|
|
683
|
+
},
|
|
684
|
+
useData: async (id, time) => {
|
|
685
|
+
const item = localStorage.getItem(forumData.prefix + '_' + id);
|
|
686
|
+
const cur_date = new Date();
|
|
687
|
+
const timeMil = time == -1 ? 'undefined' : time * 86400000;
|
|
688
|
+
|
|
689
|
+
if ((item != null && time == -1) || (item != null && parseInt(JSON.parse(item).cached_at) + timeMil > cur_date.getTime())) {
|
|
690
|
+
return JSON.parse(item).content;
|
|
691
|
+
} else {
|
|
692
|
+
return Promise.reject(false);
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
utility: {
|
|
697
|
+
genSlug: (text, alt) => {
|
|
698
|
+
const slug = (Q) => {
|
|
699
|
+
const R = '\xE0\xE1\xE4\xE2\xE8\xE9\xEB\xEA\xEC\xED\xEF\xEE\xF2\xF3\xF6\xF4\xF9\xFA\xFC\xFB\xF1\xE7\xB7/_,:;';
|
|
700
|
+
Q = Q.trim().toLowerCase();
|
|
701
|
+
for (var T = 0, U = R.length; T < U; T++) Q = Q.replace(new RegExp(R.charAt(T), 'g'), 'aaaaeeeeiiiioooouuuunc------'.charAt(T));
|
|
702
|
+
return Q.replace(/[^a-z0-9 -]/g, '').replace(/\s+/g, '-').replace(/-+/g, '-');
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
const replace = alt || '_';
|
|
706
|
+
|
|
707
|
+
return slug(text).replace(/-/g, replace);
|
|
708
|
+
},
|
|
709
|
+
genArray: (string) => {
|
|
710
|
+
return JSON.parse(string.replace(/`/g, '"'));
|
|
711
|
+
},
|
|
712
|
+
genValidation: (array) => {
|
|
713
|
+
let final = '';
|
|
714
|
+
|
|
715
|
+
[].forEach.call(array, (item) => {
|
|
716
|
+
switch (item.validation) {
|
|
717
|
+
case 'hex':
|
|
718
|
+
if (!item.value.match(/^#[a-f0-9]{6}$/i)) {
|
|
719
|
+
final += '<li>El campo de ' + item.name.toLowerCase() + ' debe incluir un código de color hexadecimal.</li>';
|
|
720
|
+
}
|
|
721
|
+
break;
|
|
722
|
+
|
|
723
|
+
case 'img':
|
|
724
|
+
if (!item.value.match(/(jpg|jpeg|png)$/i)) {
|
|
725
|
+
final += '<li>El campo de ' + item.name.toLowerCase() + ' debe ser el enlace a una imagen (formato png, jpg o jpeg).</li>';
|
|
726
|
+
}
|
|
727
|
+
break;
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
return final;
|
|
732
|
+
},
|
|
733
|
+
getGroup: (color) => {
|
|
734
|
+
const returnHexVer = (code) => {
|
|
735
|
+
let status = 'unknown';
|
|
736
|
+
|
|
737
|
+
Object.values(forumColours).map((item) => {
|
|
738
|
+
if (item.hex === code.toLowerCase()) status = FNR.utility.genSlug(item.code);
|
|
739
|
+
});
|
|
740
|
+
|
|
741
|
+
return status;
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
const returnIdVer = (code) => {
|
|
745
|
+
let status = 'unknown';
|
|
746
|
+
|
|
747
|
+
Object.values(forumColours).map((item) => {
|
|
748
|
+
if (item.id === code) status = FNR.utility.genSlug(item.code);
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
return status;
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
if (color === undefined) return 'unknown';
|
|
755
|
+
else if (color.indexOf('#') > -1) return returnHexVer(color);
|
|
756
|
+
else if (color.indexOf('id_') > -1) return returnIdVer(parseFloat(color.split('_')[1]));
|
|
757
|
+
else if (forumColours[color] === undefined) return 'unknown';
|
|
758
|
+
else return FNR.utility.genSlug(forumColours[color].code);
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
html: {
|
|
762
|
+
genModal: (title, content, buttons) => {
|
|
763
|
+
if (title === '' || title === undefined || title === null) return;
|
|
764
|
+
if (content === '' || content === undefined || content === null) return;
|
|
765
|
+
|
|
766
|
+
let modal = document.createElement('div');
|
|
767
|
+
|
|
768
|
+
modal.id = 'forum-modal';
|
|
769
|
+
|
|
770
|
+
document.body.appendChild(modal);
|
|
771
|
+
|
|
772
|
+
let final = '';
|
|
773
|
+
|
|
774
|
+
final += '<div id="' + FNR.utility.genSlug(title, '-') + '" class="modal-element">';
|
|
775
|
+
final += '<div class="modal-title">';
|
|
776
|
+
final += '<h3>' + title + '</h3>';
|
|
777
|
+
final += '<a onclick="document.getElementById(`forum-modal`).remove()">';
|
|
778
|
+
final += '<i class="fas fa-times"></i>';
|
|
779
|
+
final += '</a>';
|
|
780
|
+
final += '</div>';
|
|
781
|
+
final += '<div class="modal-content">';
|
|
782
|
+
final += '<div class="is-content">';
|
|
783
|
+
final += content.replace(/\n/g, '<br>');
|
|
784
|
+
final += '</div>';
|
|
785
|
+
|
|
786
|
+
if (buttons !== '' && buttons !== undefined && buttons !== null) {
|
|
787
|
+
final += '<div class="modal-buttons">';
|
|
788
|
+
final += buttons;
|
|
789
|
+
final += '</div>';
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
final += '</div>';
|
|
793
|
+
final += '</div>';
|
|
794
|
+
|
|
795
|
+
final += '<div class="is-bgmodal bg-active" onclick="document.getElementById(`forum-modal`).remove()"></div>';
|
|
796
|
+
|
|
797
|
+
document.getElementById('forum-modal').innerHTML = final;
|
|
798
|
+
},
|
|
799
|
+
genPrompt: (title, content, placeholder, text) => {
|
|
800
|
+
if (title === '' || title === undefined || title === null) return;
|
|
801
|
+
if (content === '' || content === undefined || content === null) return;
|
|
802
|
+
|
|
803
|
+
return new Promise((resolve, reject) => {
|
|
804
|
+
FNR.html.genModal(title, '<p>' + content + '</p><p><input id="modal-prompt" type="text" placeholder="' + placeholder + '" value="' + text + '"></p>', '<button id="modal-button-enter" class="button1 btn-main">Confirmar</button><button id="modal-button-cancel" class="button1">Cancelar</button>');
|
|
805
|
+
|
|
806
|
+
document.querySelector('#modal-button-enter').onclick = () => {
|
|
807
|
+
const result = document.querySelector('#modal-prompt').value;
|
|
808
|
+
|
|
809
|
+
if (result === '') {
|
|
810
|
+
resolve(false);
|
|
811
|
+
} else {
|
|
812
|
+
resolve(result);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
document.getElementById(`forum-modal`).remove();
|
|
816
|
+
};
|
|
817
|
+
|
|
818
|
+
document.querySelector('#modal-button-cancel').onclick = () => {
|
|
819
|
+
reject(false);
|
|
820
|
+
document.getElementById(`forum-modal`).remove();
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
document.querySelector('.modal-title a').onclick = () => {
|
|
824
|
+
reject(false);
|
|
825
|
+
document.getElementById(`forum-modal`).remove();
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
document.querySelector('.is-bgmodal.bg-active').onclick = () => {
|
|
829
|
+
reject(false);
|
|
830
|
+
document.getElementById(`forum-modal`).remove();
|
|
831
|
+
};
|
|
832
|
+
});
|
|
833
|
+
},
|
|
834
|
+
genNotification: (title, content, icon, url) => {
|
|
835
|
+
if (title === '' || title === undefined || title === null) return;
|
|
836
|
+
if (content === '' || content === undefined || content === null) return;
|
|
837
|
+
if (content.length > 50) return;
|
|
838
|
+
if (icon === '' || icon === undefined || icon === null) return;
|
|
839
|
+
|
|
840
|
+
if (document.querySelectorAll('forum-notification').length) {
|
|
841
|
+
document.getElementById('forum-notification').remove();
|
|
842
|
+
clearTimeout();
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
let notification = document.createElement('div');
|
|
846
|
+
|
|
847
|
+
notification.id = 'forum-notification';
|
|
848
|
+
|
|
849
|
+
document.body.appendChild(notification);
|
|
850
|
+
|
|
851
|
+
let final = '';
|
|
852
|
+
|
|
853
|
+
if (url === '' || url === undefined || url === null) {
|
|
854
|
+
final += '<div id="' + FNR.utility.genSlug(title, '-') + '" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >';
|
|
855
|
+
} else {
|
|
856
|
+
final += '<a href="' + url + '" target="_blank" id="' + FNR.utility.genSlug(title, '-') + '" class="notification-element" onclick="document.querySelector(`#forum-notification`).classList.remove(`notification-show`)" >';
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
final += '<div class="notification-icon">';
|
|
860
|
+
final += '<i class="' + icon + '"></i>';
|
|
861
|
+
final += '</div>';
|
|
862
|
+
final += '<div class="notification-content">';
|
|
863
|
+
final += '<h3>' + title + '</h3>';
|
|
864
|
+
final += '<p>' + content + '</p>';
|
|
865
|
+
final += '</div>';
|
|
866
|
+
final += '<div class="notification-controls">';
|
|
867
|
+
final += '<i class="fas fa-times"></i>';
|
|
868
|
+
final += '</div>';
|
|
869
|
+
|
|
870
|
+
if (url === '' || url === undefined || url === null) {
|
|
871
|
+
final += '</div>';
|
|
872
|
+
} else {
|
|
873
|
+
final += '</a>';
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
document.getElementById('forum-notification').innerHTML = final;
|
|
877
|
+
|
|
878
|
+
setTimeout(() => {
|
|
879
|
+
document.getElementById(`forum-notification`).classList.add('notification-show');
|
|
880
|
+
}, 250);
|
|
881
|
+
|
|
882
|
+
setTimeout(() => {
|
|
883
|
+
document.getElementById(`forum-notification`).classList.remove('notification-show');
|
|
884
|
+
}, 8000);
|
|
885
|
+
|
|
886
|
+
setTimeout(() => {
|
|
887
|
+
document.getElementById(`forum-notification`).remove();
|
|
888
|
+
}, 10000);
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
behaviour: {
|
|
892
|
+
genWiki: () => {
|
|
893
|
+
if (document.querySelector('.wiki-cascade')) {
|
|
894
|
+
[].forEach.call(document.getElementsByClassName('wiki-cascade'), (item) => {
|
|
895
|
+
item.onclick = () => {
|
|
896
|
+
const element = item.parentElement.parentElement;
|
|
897
|
+
|
|
898
|
+
if (element.classList.contains('is-active')) {
|
|
899
|
+
element.classList.remove('is-active');
|
|
900
|
+
} else {
|
|
901
|
+
element.classList.add('is-active');
|
|
902
|
+
}
|
|
903
|
+
};
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
if (document.querySelector('.wiki-controls .router-link-active')) {
|
|
908
|
+
[].forEach.call(document.querySelectorAll('.wiki-controls .router-link-active'), (item) => {
|
|
909
|
+
if (!item.parentElement.parentElement.parentElement.parentElement.parentElement.classList.contains('wiki-index')) {
|
|
910
|
+
const setActive = (element, isFirst) => {
|
|
911
|
+
let parentElement = element.parentElement.parentElement;
|
|
912
|
+
|
|
913
|
+
if (isFirst) {
|
|
914
|
+
parentElement = parentElement.parentElement.parentElement;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
parentElement.classList.add('is-active');
|
|
918
|
+
parentElement.classList.add('is-selected');
|
|
919
|
+
|
|
920
|
+
if (!parentElement.parentElement.parentElement.parentElement.classList.contains('wiki-index')) {
|
|
921
|
+
setActive(parentElement, false);
|
|
922
|
+
}
|
|
923
|
+
};
|
|
924
|
+
|
|
925
|
+
setActive(item, true);
|
|
926
|
+
}
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
if (document.querySelector('aside.wiki-index > .select-container > select')) {
|
|
931
|
+
document.querySelector('aside.wiki-index > .select-container > select').onchange = () => {
|
|
932
|
+
router.push(document.querySelector('aside.wiki-index > .select-container > select').value);
|
|
933
|
+
};
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
genDropeable: () => {
|
|
937
|
+
if (document.querySelector('.is-dropeable')) {
|
|
938
|
+
[].forEach.call(document.getElementsByClassName('is-dropeable'), (item) => {
|
|
939
|
+
item.onclick = () => {
|
|
940
|
+
if (!item.classList.contains('is-active')) {
|
|
941
|
+
[].forEach.call(document.getElementsByClassName('is-dropeable'), (drops) => {
|
|
942
|
+
drops.classList.remove('is-active');
|
|
943
|
+
});
|
|
944
|
+
|
|
945
|
+
item.classList.add('is-active');
|
|
946
|
+
} else {
|
|
947
|
+
item.classList.remove('is-active');
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
862
954
|
};
|