generic-skin 2.6.41 → 2.9.56
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 +26 -26
- package/apps/vueChrono.min.js +1 -1
- package/apps/vueDefault.js +198 -107
- package/apps/vueDefault.min.js +2 -2
- package/apps/vueMulti.js +24 -24
- package/apps/vueMulti.min.js +1 -1
- package/apps/vueRela.js +28 -28
- package/apps/vueRela.min.js +1 -1
- package/config/vueComponents.js +89 -86
- package/config/vueComponents.min.js +2 -2
- package/extensions/vueRouter.js +1 -1
- package/frameworks/FNRFramework.js +391 -198
- package/frameworks/FNRFramework.min.js +1 -1
- package/general.js +79 -49
- package/general.min.js +1 -1
- package/options/noManagers.js +15 -15
- package/options/noManagers.min.js +1 -1
- package/package.json +1 -1
- package/pages/ucp.js +14 -14
- package/pages/ucp.min.js +1 -1
- package/stylesheet.css +1 -1
- package/stylesheet.min.css +1 -1
|
@@ -177,80 +177,105 @@ const FNR = {
|
|
|
177
177
|
});
|
|
178
178
|
},
|
|
179
179
|
},
|
|
180
|
-
content: {
|
|
180
|
+
content: {
|
|
181
181
|
isAutosave: () => {
|
|
182
182
|
if (document.post === undefined) return false;
|
|
183
183
|
else return _userdata.user_id !== -1 && document.post.mode.value === 'reply' && document.post.t !== undefined
|
|
184
184
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
185
|
+
post: {
|
|
186
|
+
getPost: (url) => {
|
|
187
|
+
return new Promise((resolve, reject) => {
|
|
188
|
+
$.get(Vue.filter('url-to-invision')(url), (data) => {
|
|
189
|
+
const post = $(data).find("#p" + url.split("#")[1]);
|
|
190
|
+
|
|
191
|
+
resolve({
|
|
192
|
+
author: {
|
|
193
|
+
text: post.find(".author a").text(),
|
|
194
|
+
color: post.find(".author a span").css("color"),
|
|
195
|
+
url: Vue.filter('url-to-normal')(post.find(".author a").attr("href")),
|
|
196
|
+
},
|
|
197
|
+
content: post.find(".post-entry > div").html(),
|
|
198
|
+
date: post.find(".author").html().split("</a>")[1],
|
|
199
|
+
});
|
|
198
200
|
});
|
|
199
201
|
});
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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();
|
|
202
|
+
},
|
|
203
|
+
genPost: (id, content) => {
|
|
204
|
+
return new Promise((resolve, reject) => {
|
|
205
|
+
let save = document.createElement('iframe');
|
|
213
206
|
|
|
214
|
-
|
|
207
|
+
save.id = 'forum-save';
|
|
208
|
+
save.src = '/post?t=' + id + '&mode=reply&change_version=invision';
|
|
209
|
+
save.width = 0;
|
|
210
|
+
save.height = 0;
|
|
211
|
+
save.onload = () => {
|
|
212
|
+
saveDOM.onload = () => {
|
|
213
|
+
$('#forum-save').remove();
|
|
215
214
|
|
|
216
|
-
|
|
215
|
+
console.clear();
|
|
216
|
+
|
|
217
|
+
resolve(true);
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
$('#forum-save').contents().find('.subtitle:contains("Mensaje")').next().find('textarea').val(content);
|
|
221
|
+
$('#forum-save').contents().find('.formbuttonrow.center input[value="Enviar"]').click();
|
|
217
222
|
};
|
|
218
223
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
224
|
+
document.querySelector('body > header').prepend(save);
|
|
225
|
+
|
|
226
|
+
const saveDOM = document.getElementById('forum-save');
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
topic: {
|
|
231
|
+
getType: (src) => {
|
|
232
|
+
const classes = [];
|
|
233
|
+
|
|
234
|
+
if (src.indexOf('unread') > -1) {
|
|
235
|
+
classes.push('is-unread');
|
|
236
|
+
} else {
|
|
237
|
+
classes.push('is-read');
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (src.indexOf('locked') > -1) {
|
|
241
|
+
classes.push('is-closed');
|
|
242
|
+
} else if (src.indexOf('sticky') > 1) {
|
|
243
|
+
classes.push('is-sticky');
|
|
244
|
+
} else if (src.indexOf('global_announce') > 1) {
|
|
245
|
+
classes.push('is-global-announcement');
|
|
246
|
+
} else if (src.indexOf('announce') > 1) {
|
|
247
|
+
classes.push('is-announcement');
|
|
248
|
+
}
|
|
222
249
|
|
|
223
|
-
|
|
250
|
+
return classes;
|
|
251
|
+
},
|
|
252
|
+
genTopic: (id, name, content) => {
|
|
253
|
+
return new Promise((resolve, reject) => {
|
|
254
|
+
let save = document.createElement('iframe');
|
|
224
255
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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();
|
|
256
|
+
save.id = 'forum-save';
|
|
257
|
+
save.src = '/post?f=' + id + '&mode=newtopic&change_version=invision';
|
|
258
|
+
save.width = 0;
|
|
259
|
+
save.height = 0;
|
|
260
|
+
save.onload = () => {
|
|
261
|
+
saveDOM.onload = () => {
|
|
262
|
+
$('#forum-save').remove();
|
|
239
263
|
|
|
240
|
-
|
|
264
|
+
console.clear();
|
|
241
265
|
|
|
242
|
-
|
|
243
|
-
|
|
266
|
+
resolve(true);
|
|
267
|
+
};
|
|
244
268
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
269
|
+
$('#forum-save').contents().find('dl dt:contains("Título del tema")').parent().find('input').val(name);
|
|
270
|
+
$('#forum-save').contents().find('.subtitle:contains("Mensaje")').next().find('textarea').val(content);
|
|
271
|
+
$('#forum-save').contents().find('.formbuttonrow.center input[value="Enviar"]').click();
|
|
272
|
+
};
|
|
249
273
|
|
|
250
|
-
|
|
274
|
+
document.querySelector('body > header').prepend(save);
|
|
251
275
|
|
|
252
|
-
|
|
253
|
-
|
|
276
|
+
const saveDOM = document.getElementById('forum-save');
|
|
277
|
+
});
|
|
278
|
+
},
|
|
254
279
|
}
|
|
255
280
|
},
|
|
256
281
|
user: {
|
|
@@ -390,6 +415,234 @@ const FNR = {
|
|
|
390
415
|
return false;
|
|
391
416
|
}
|
|
392
417
|
},
|
|
418
|
+
followed: {
|
|
419
|
+
getPages: async () => {
|
|
420
|
+
try {
|
|
421
|
+
const followedPage = await fetch('/search?search_id=watchsearch&change_version=invision');
|
|
422
|
+
const bodyFollowedPage = await followedPage.text();
|
|
423
|
+
const htmlFollowedPage = document.createElement('html');
|
|
424
|
+
|
|
425
|
+
htmlFollowedPage.innerHTML = bodyFollowedPage;
|
|
426
|
+
|
|
427
|
+
const total = htmlFollowedPage.querySelectorAll('.pagination a');
|
|
428
|
+
let arrayItems = [];
|
|
429
|
+
|
|
430
|
+
if (total.length) {
|
|
431
|
+
const finalPage = total[total.length - 2];
|
|
432
|
+
const finalPageUrl = finalPage.href.split(finalPage.origin)[1];
|
|
433
|
+
const finalPageNumberArray = finalPageUrl.match(/[0-9]/g) || [];
|
|
434
|
+
const finalPageNumber = parseInt(finalPageNumberArray.join('')) || 0;
|
|
435
|
+
|
|
436
|
+
const firstPage = total[1];
|
|
437
|
+
const firstPageUrl = firstPage.href.split(firstPage.origin)[1];
|
|
438
|
+
const firstPageNumberArray = firstPageUrl.match(/[0-9]/g) || [];
|
|
439
|
+
const firstPageNumber = parseInt(firstPageNumberArray.join('')) || 0;
|
|
440
|
+
|
|
441
|
+
const arrayPages = typeof finalPageNumber === 'undefined' ? 0 : finalPageNumber / firstPageNumber;
|
|
442
|
+
arrayItems = Array(arrayPages).fill(null).map((page, index) => `/search?search_id=watchsearch&start=${firstPageNumber * (index + 1)}&change_version=invision`);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
return {
|
|
446
|
+
items: htmlFollowedPage.querySelectorAll('.ipbtable tbody tr td').length === 1 ? 0 : htmlFollowedPage.querySelectorAll('.ipbtable tbody tr').length,
|
|
447
|
+
pages: ['/search?search_id=watchsearch&change_version=invision', ...arrayItems],
|
|
448
|
+
}
|
|
449
|
+
} catch (error) {
|
|
450
|
+
console.error('Error inesperado', error);
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
getFollowed: async (page) => {
|
|
455
|
+
try {
|
|
456
|
+
const followedPage = await fetch(page);
|
|
457
|
+
const bodyFollowedPage = await followedPage.text();
|
|
458
|
+
const htmlFollowedPage = document.createElement('html');
|
|
459
|
+
|
|
460
|
+
htmlFollowedPage.innerHTML = bodyFollowedPage;
|
|
461
|
+
|
|
462
|
+
return Array.from(htmlFollowedPage.querySelectorAll('.ipbtable tbody tr')).map(row => {
|
|
463
|
+
const cells = row.children;
|
|
464
|
+
|
|
465
|
+
return {
|
|
466
|
+
id: parseInt(cells[7].children[0].value),
|
|
467
|
+
name: cells[1].querySelector('.topictitle').textContent.trim(),
|
|
468
|
+
url: Vue.filter('url-to-normal')(cells[1].querySelector('.topictitle').href),
|
|
469
|
+
views: parseInt(cells[5].textContent),
|
|
470
|
+
replies: parseInt(cells[3].textContent),
|
|
471
|
+
type: FNR.content.topic.getType(cells[0].querySelector('img').src).join(' '),
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
} catch (error) {
|
|
475
|
+
console.error('Error inesperado', error);
|
|
476
|
+
return false;
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
delFollowed: async (topics) => {
|
|
480
|
+
try {
|
|
481
|
+
await fetch('/search?search_id=watchsearch', {
|
|
482
|
+
method: 'POST',
|
|
483
|
+
headers: {
|
|
484
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
485
|
+
},
|
|
486
|
+
body: `confirm=confirm${topics.map(topic => `&mark${encodeURIComponent(`[]`)}2=${topic}`)}`
|
|
487
|
+
})
|
|
488
|
+
|
|
489
|
+
return true;
|
|
490
|
+
} catch (error) {
|
|
491
|
+
console.error('Error inesperado', error);
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
},
|
|
496
|
+
drafts: {
|
|
497
|
+
delDrafts: async (type, drafts) => {
|
|
498
|
+
try {
|
|
499
|
+
const deleteType = type === 'draft' ? 'draft' : 'topic_draft';
|
|
500
|
+
|
|
501
|
+
await fetch(`/search?search_id=${type}search`, {
|
|
502
|
+
method: 'POST',
|
|
503
|
+
headers: {
|
|
504
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
505
|
+
},
|
|
506
|
+
body: `confirm=confirm${drafts.map(draft => `&delete_${deleteType}${encodeURIComponent(`[${draft}]`)}=on`)}`
|
|
507
|
+
})
|
|
508
|
+
|
|
509
|
+
return true;
|
|
510
|
+
} catch (error) {
|
|
511
|
+
console.error('Error inesperado', error);
|
|
512
|
+
return false;
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
messages: {
|
|
516
|
+
getPages: async () => {
|
|
517
|
+
try {
|
|
518
|
+
const draftsPage = await fetch('/search?search_id=draftsearch&change_version=invision');
|
|
519
|
+
const bodyDraftsPage = await draftsPage.text();
|
|
520
|
+
const htmlDraftsPage = document.createElement('html');
|
|
521
|
+
|
|
522
|
+
htmlDraftsPage.innerHTML = bodyDraftsPage;
|
|
523
|
+
|
|
524
|
+
const total = htmlDraftsPage.querySelectorAll('.pagination a');
|
|
525
|
+
let arrayItems = [];
|
|
526
|
+
|
|
527
|
+
if (total.length) {
|
|
528
|
+
const finalPage = total[total.length - 2];
|
|
529
|
+
const finalPageUrl = finalPage.href.split(finalPage.origin)[1];
|
|
530
|
+
const finalPageNumberArray = finalPageUrl.match(/[0-9]/g) || [];
|
|
531
|
+
const finalPageNumber = parseInt(finalPageNumberArray.join('')) || 0;
|
|
532
|
+
|
|
533
|
+
const firstPage = total[1];
|
|
534
|
+
const firstPageUrl = firstPage.href.split(firstPage.origin)[1];
|
|
535
|
+
const firstPageNumberArray = firstPageUrl.match(/[0-9]/g) || [];
|
|
536
|
+
const firstPageNumber = parseInt(firstPageNumberArray.join('')) || 0;
|
|
537
|
+
|
|
538
|
+
const arrayPages = typeof finalPageNumber === 'undefined' ? 0 : finalPageNumber / firstPageNumber;
|
|
539
|
+
arrayItems = Array(arrayPages).fill(null).map((page, index) => `/search?search_id=draftsearch&start=${firstPageNumber * (index + 1)}&change_version=invision`);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
return {
|
|
543
|
+
items: htmlDraftsPage.querySelectorAll('.ipbtable tbody tr td').length === 1 ? 0 : htmlDraftsPage.querySelectorAll('.ipbtable tbody tr').length,
|
|
544
|
+
pages: ['/search?search_id=draftsearch&change_version=invision', ...arrayItems],
|
|
545
|
+
}
|
|
546
|
+
} catch (error) {
|
|
547
|
+
console.error('Error inesperado', error);
|
|
548
|
+
return false;
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
getDrafts: async (page) => {
|
|
552
|
+
try {
|
|
553
|
+
const draftsPage = await fetch(page);
|
|
554
|
+
const bodyDraftsPage = await draftsPage.text();
|
|
555
|
+
const htmlDraftsPage = document.createElement('html');
|
|
556
|
+
|
|
557
|
+
htmlDraftsPage.innerHTML = bodyDraftsPage;
|
|
558
|
+
|
|
559
|
+
return Array.from(htmlDraftsPage.querySelectorAll('.ipbtable tbody tr')).map(row => {
|
|
560
|
+
const cells = row.children;
|
|
561
|
+
|
|
562
|
+
return {
|
|
563
|
+
topic: {
|
|
564
|
+
name: cells[1].textContent.trim(),
|
|
565
|
+
url: Vue.filter('url-to-normal')(cells[1].querySelector('a').href)
|
|
566
|
+
},
|
|
567
|
+
info: {
|
|
568
|
+
location: cells[2].textContent.trim(),
|
|
569
|
+
date: cells[3].textContent.trim()
|
|
570
|
+
},
|
|
571
|
+
modify: Vue.filter('url-to-normal')(cells[4].querySelector('a').href)
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
} catch (error) {
|
|
575
|
+
console.error('Error inesperado', error);
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
topics: {
|
|
581
|
+
getPages: async () => {
|
|
582
|
+
try {
|
|
583
|
+
const draftsPage = await fetch('/search?search_id=topicdraftsearch&change_version=invision');
|
|
584
|
+
const bodyDraftsPage = await draftsPage.text();
|
|
585
|
+
const htmlDraftsPage = document.createElement('html');
|
|
586
|
+
|
|
587
|
+
htmlDraftsPage.innerHTML = bodyDraftsPage;
|
|
588
|
+
|
|
589
|
+
const total = htmlDraftsPage.querySelectorAll('.pagination a');
|
|
590
|
+
let arrayItems = [];
|
|
591
|
+
|
|
592
|
+
if (total.length) {
|
|
593
|
+
const finalPage = total[total.length - 2];
|
|
594
|
+
const finalPageUrl = finalPage.href.split(finalPage.origin)[1];
|
|
595
|
+
const finalPageNumberArray = finalPageUrl.match(/[0-9]/g) || [];
|
|
596
|
+
const finalPageNumber = parseInt(finalPageNumberArray.join('')) || 0;
|
|
597
|
+
|
|
598
|
+
const firstPage = total[1];
|
|
599
|
+
const firstPageUrl = firstPage.href.split(firstPage.origin)[1];
|
|
600
|
+
const firstPageNumberArray = firstPageUrl.match(/[0-9]/g) || [];
|
|
601
|
+
const firstPageNumber = parseInt(firstPageNumberArray.join('')) || 0;
|
|
602
|
+
|
|
603
|
+
const arrayPages = typeof finalPageNumber === 'undefined' ? 0 : finalPageNumber / firstPageNumber;
|
|
604
|
+
arrayItems = Array(arrayPages).fill(null).map((page, index) => `/search?search_id=topicdraftsearch&start=${firstPageNumber * (index + 1)}&change_version=invision`);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
return {
|
|
608
|
+
items: htmlDraftsPage.querySelectorAll('.ipbtable tbody tr td').length === 1 ? 0 : htmlDraftsPage.querySelectorAll('.ipbtable tbody tr').length,
|
|
609
|
+
pages: ['/search?search_id=topicdraftsearch&change_version=invision', ...arrayItems],
|
|
610
|
+
}
|
|
611
|
+
} catch (error) {
|
|
612
|
+
console.error('Error inesperado', error);
|
|
613
|
+
return false;
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
getDrafts: async (page) => {
|
|
617
|
+
try {
|
|
618
|
+
const draftsPage = await fetch(page);
|
|
619
|
+
const bodyDraftsPage = await draftsPage.text();
|
|
620
|
+
const htmlDraftsPage = document.createElement('html');
|
|
621
|
+
|
|
622
|
+
htmlDraftsPage.innerHTML = bodyDraftsPage;
|
|
623
|
+
|
|
624
|
+
return Array.from(htmlDraftsPage.querySelectorAll('.ipbtable tbody tr')).map(row => {
|
|
625
|
+
const cells = row.children;
|
|
626
|
+
|
|
627
|
+
return {
|
|
628
|
+
topic: {
|
|
629
|
+
name: cells[0].textContent.trim(),
|
|
630
|
+
url: Vue.filter('url-to-normal')(cells[0].querySelector('a').href)
|
|
631
|
+
},
|
|
632
|
+
info: {
|
|
633
|
+
location: cells[1].textContent.trim(),
|
|
634
|
+
date: cells[2].textContent.trim()
|
|
635
|
+
},
|
|
636
|
+
modify: Vue.filter('url-to-normal')(cells[3].querySelector('a').href)
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
} catch (error) {
|
|
640
|
+
console.error('Error inesperado', error);
|
|
641
|
+
return false;
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
}
|
|
645
|
+
},
|
|
393
646
|
profile: {
|
|
394
647
|
getData: (array) => {
|
|
395
648
|
return new Promise((resolve, reject) => {
|
|
@@ -519,145 +772,6 @@ const FNR = {
|
|
|
519
772
|
|
|
520
773
|
const saveDOM = document.getElementById('forum-save');
|
|
521
774
|
});
|
|
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
775
|
}
|
|
662
776
|
}
|
|
663
777
|
},
|
|
@@ -888,7 +1002,7 @@ const FNR = {
|
|
|
888
1002
|
}, 10000);
|
|
889
1003
|
}
|
|
890
1004
|
},
|
|
891
|
-
behaviour: {
|
|
1005
|
+
behaviour: {
|
|
892
1006
|
genWiki: () => {
|
|
893
1007
|
if (document.querySelector('.wiki-cascade')) {
|
|
894
1008
|
[].forEach.call(document.getElementsByClassName('wiki-cascade'), (item) => {
|
|
@@ -949,6 +1063,85 @@ const FNR = {
|
|
|
949
1063
|
};
|
|
950
1064
|
});
|
|
951
1065
|
}
|
|
952
|
-
}
|
|
1066
|
+
},
|
|
1067
|
+
genControls: () => {
|
|
1068
|
+
if (document.querySelector('.forum-controls')) {
|
|
1069
|
+
[].forEach.call(document.querySelectorAll('.forum-controls'), (control) => {
|
|
1070
|
+
let children = 0;
|
|
1071
|
+
|
|
1072
|
+
[].forEach.call(control.children, (item) => {
|
|
1073
|
+
if (window.getComputedStyle(item, null).display === 'none') {
|
|
1074
|
+
return;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
children += item.children.length;
|
|
1078
|
+
});
|
|
1079
|
+
|
|
1080
|
+
if (children === 0 && control.classList.contains('not-show') === false) {
|
|
1081
|
+
control.classList.add('not-show');
|
|
1082
|
+
}
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
},
|
|
1086
|
+
genPagelist: (total, current) => {
|
|
1087
|
+
if (total.length < 5) {
|
|
1088
|
+
return total;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
switch (current) {
|
|
1092
|
+
case 0:
|
|
1093
|
+
return [
|
|
1094
|
+
total[current],
|
|
1095
|
+
total[current + 1],
|
|
1096
|
+
total[current + 2],
|
|
1097
|
+
total[current + 3],
|
|
1098
|
+
total[current + 4]
|
|
1099
|
+
];
|
|
1100
|
+
|
|
1101
|
+
case 1:
|
|
1102
|
+
return [
|
|
1103
|
+
total[current - 1],
|
|
1104
|
+
total[current],
|
|
1105
|
+
total[current + 1],
|
|
1106
|
+
total[current + 2],
|
|
1107
|
+
total[current + 3]
|
|
1108
|
+
];
|
|
1109
|
+
|
|
1110
|
+
case current.length - 1:
|
|
1111
|
+
return [
|
|
1112
|
+
total[current - 4],
|
|
1113
|
+
total[current - 3],
|
|
1114
|
+
total[current - 2],
|
|
1115
|
+
total[current - 1],
|
|
1116
|
+
total[current]
|
|
1117
|
+
];
|
|
1118
|
+
|
|
1119
|
+
case current.length - 2:
|
|
1120
|
+
return [
|
|
1121
|
+
total[current - 3],
|
|
1122
|
+
total[current - 2],
|
|
1123
|
+
total[current - 1],
|
|
1124
|
+
total[current],
|
|
1125
|
+
total[current + 1]
|
|
1126
|
+
];
|
|
1127
|
+
|
|
1128
|
+
default:
|
|
1129
|
+
return [
|
|
1130
|
+
total[current - 2],
|
|
1131
|
+
total[current - 1],
|
|
1132
|
+
total[current],
|
|
1133
|
+
total[current + 1],
|
|
1134
|
+
total[current + 2]
|
|
1135
|
+
];
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
genDebounce: (func, timeout = 300) => {
|
|
1139
|
+
let timer;
|
|
1140
|
+
|
|
1141
|
+
return (...args) => {
|
|
1142
|
+
clearTimeout(timer);
|
|
1143
|
+
timer = setTimeout(() => { func.apply(this, args); }, timeout);
|
|
1144
|
+
};
|
|
1145
|
+
},
|
|
953
1146
|
}
|
|
954
1147
|
};
|