generic-skin 4.0.9 → 4.0.11
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/frameworks/FNRFramework.js +46 -46
- package/package.json +1 -1
|
@@ -38,12 +38,12 @@ const FNR = {
|
|
|
38
38
|
|
|
39
39
|
const getPage = async (url) => {
|
|
40
40
|
$.get(url, (data) => {
|
|
41
|
-
$(data).find('.ipbform').find('tbody').find('tr').each(function() {
|
|
41
|
+
$(data).find('.ipbform').find('tbody').find('tr').each(function () {
|
|
42
42
|
if (finalArray.length < limit && exclusions.indexOf(parseInt($(this).find('.row2 + .row2:not(.centered) a').attr('href').split('/f')[1].split('-')[0])) === -1) {
|
|
43
43
|
addContent(this);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
if (finalArray.length === limit || !$(data).find('.pagination')[0].children.length || $(data).find('.pagination').children().last()[0].localName === 'b') {
|
|
48
48
|
return finalArray;
|
|
49
49
|
} else {
|
|
@@ -74,7 +74,7 @@ const FNR = {
|
|
|
74
74
|
const getUsersPage = (page) => {
|
|
75
75
|
let users = [];
|
|
76
76
|
|
|
77
|
-
$(page).find('.member-list .member').each(function() {
|
|
77
|
+
$(page).find('.member-list .member').each(function () {
|
|
78
78
|
const group = FNR.utility.getGroup($(this).find('.membername span').attr('style').split('color:')[1]);
|
|
79
79
|
|
|
80
80
|
if (option) {
|
|
@@ -116,7 +116,7 @@ const FNR = {
|
|
|
116
116
|
$.get('/groups?change_version=invision', (data) => {
|
|
117
117
|
let groups = [];
|
|
118
118
|
|
|
119
|
-
$(data).find('.group_list > li').each(function() {
|
|
119
|
+
$(data).find('.group_list > li').each(function () {
|
|
120
120
|
groups.push({
|
|
121
121
|
id: parseInt($(this).find('a').attr('href').split('/g')[1].split('-')[0]),
|
|
122
122
|
name: $(this).find('a').text().trim(),
|
|
@@ -236,7 +236,7 @@ const FNR = {
|
|
|
236
236
|
} else {
|
|
237
237
|
classes.push('is-read');
|
|
238
238
|
}
|
|
239
|
-
|
|
239
|
+
|
|
240
240
|
if (src.indexOf('locked') > -1) {
|
|
241
241
|
classes.push('is-closed');
|
|
242
242
|
} else if (src.indexOf('sticky') > 1) {
|
|
@@ -281,12 +281,12 @@ const FNR = {
|
|
|
281
281
|
user: {
|
|
282
282
|
getUrl: (name) => {
|
|
283
283
|
let character =
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
284
|
+
name !== undefined ? encodeURIComponent(name)
|
|
285
|
+
.replace(/[!'()]/g, escape)
|
|
286
|
+
.replace(/\*/g, "%2A") :
|
|
287
|
+
_userdata.user_id;
|
|
288
288
|
|
|
289
|
-
|
|
289
|
+
return "/profile?mode=viewprofile&u=" + character;
|
|
290
290
|
},
|
|
291
291
|
getLevel: async () => {
|
|
292
292
|
switch (_userdata.user_level) {
|
|
@@ -345,7 +345,7 @@ const FNR = {
|
|
|
345
345
|
|
|
346
346
|
user['fields'] = {};
|
|
347
347
|
|
|
348
|
-
$(data).find('dl[id^="field_id"]').each(function() {
|
|
348
|
+
$(data).find('dl[id^="field_id"]').each(function () {
|
|
349
349
|
if ($(this).find('dt span').text() !== '') {
|
|
350
350
|
if ($(this).find('dt span').text() === 'Mensajes') return;
|
|
351
351
|
|
|
@@ -356,7 +356,7 @@ const FNR = {
|
|
|
356
356
|
}
|
|
357
357
|
});
|
|
358
358
|
|
|
359
|
-
$(data).find('.ipbform2 > dl').each(function() {
|
|
359
|
+
$(data).find('.ipbform2 > dl').each(function () {
|
|
360
360
|
if ($(this).find('dt span').length && $(this).find('dt span').text() !== '') {
|
|
361
361
|
if ($(this).find('dt span').text() === 'Mensajes') return;
|
|
362
362
|
|
|
@@ -421,7 +421,7 @@ const FNR = {
|
|
|
421
421
|
const followedPage = await fetch('/search?search_id=watchsearch&change_version=invision');
|
|
422
422
|
const bodyFollowedPage = await followedPage.text();
|
|
423
423
|
const htmlFollowedPage = document.createElement('html');
|
|
424
|
-
|
|
424
|
+
|
|
425
425
|
htmlFollowedPage.innerHTML = bodyFollowedPage;
|
|
426
426
|
|
|
427
427
|
const total = htmlFollowedPage.querySelectorAll('.pagination a');
|
|
@@ -431,7 +431,7 @@ const FNR = {
|
|
|
431
431
|
const finalPage = total[total.length - 2];
|
|
432
432
|
const finalPageUrl = finalPage.href.split(finalPage.origin)[1];
|
|
433
433
|
const finalPageNumberArray = finalPageUrl.match(/[0-9]/g) || [];
|
|
434
|
-
const finalPageNumber = parseInt(finalPageNumberArray.join('')) || 0;
|
|
434
|
+
const finalPageNumber = parseInt(finalPageNumberArray.join('')) || 0;
|
|
435
435
|
|
|
436
436
|
const firstPage = total[1];
|
|
437
437
|
const firstPageUrl = firstPage.href.split(firstPage.origin)[1];
|
|
@@ -453,10 +453,10 @@ const FNR = {
|
|
|
453
453
|
},
|
|
454
454
|
getFollowed: async (page) => {
|
|
455
455
|
try {
|
|
456
|
-
const followedPage = await fetch(page);
|
|
457
|
-
const bodyFollowedPage = await followedPage.text();
|
|
456
|
+
const followedPage = await fetch(page);
|
|
457
|
+
const bodyFollowedPage = await followedPage.text();
|
|
458
458
|
const htmlFollowedPage = document.createElement('html');
|
|
459
|
-
|
|
459
|
+
|
|
460
460
|
htmlFollowedPage.innerHTML = bodyFollowedPage;
|
|
461
461
|
|
|
462
462
|
return Array.from(htmlFollowedPage.querySelectorAll('.ipbtable tbody tr')).map(row => {
|
|
@@ -476,7 +476,7 @@ const FNR = {
|
|
|
476
476
|
return false;
|
|
477
477
|
}
|
|
478
478
|
},
|
|
479
|
-
delFollowed: async (topics) => {
|
|
479
|
+
delFollowed: async (topics) => {
|
|
480
480
|
try {
|
|
481
481
|
await fetch('/search?search_id=watchsearch', {
|
|
482
482
|
method: 'POST',
|
|
@@ -494,7 +494,7 @@ const FNR = {
|
|
|
494
494
|
},
|
|
495
495
|
},
|
|
496
496
|
drafts: {
|
|
497
|
-
delDrafts: async (type, drafts) => {
|
|
497
|
+
delDrafts: async (type, drafts) => {
|
|
498
498
|
try {
|
|
499
499
|
const deleteType = type === 'draft' ? 'draft' : 'topic_draft';
|
|
500
500
|
|
|
@@ -518,27 +518,27 @@ const FNR = {
|
|
|
518
518
|
const draftsPage = await fetch('/search?search_id=draftsearch&change_version=invision');
|
|
519
519
|
const bodyDraftsPage = await draftsPage.text();
|
|
520
520
|
const htmlDraftsPage = document.createElement('html');
|
|
521
|
-
|
|
521
|
+
|
|
522
522
|
htmlDraftsPage.innerHTML = bodyDraftsPage;
|
|
523
|
-
|
|
523
|
+
|
|
524
524
|
const total = htmlDraftsPage.querySelectorAll('.pagination a');
|
|
525
525
|
let arrayItems = [];
|
|
526
|
-
|
|
526
|
+
|
|
527
527
|
if (total.length) {
|
|
528
528
|
const finalPage = total[total.length - 2];
|
|
529
529
|
const finalPageUrl = finalPage.href.split(finalPage.origin)[1];
|
|
530
530
|
const finalPageNumberArray = finalPageUrl.match(/[0-9]/g) || [];
|
|
531
|
-
const finalPageNumber = parseInt(finalPageNumberArray.join('')) || 0;
|
|
532
|
-
|
|
531
|
+
const finalPageNumber = parseInt(finalPageNumberArray.join('')) || 0;
|
|
532
|
+
|
|
533
533
|
const firstPage = total[1];
|
|
534
534
|
const firstPageUrl = firstPage.href.split(firstPage.origin)[1];
|
|
535
535
|
const firstPageNumberArray = firstPageUrl.match(/[0-9]/g) || [];
|
|
536
536
|
const firstPageNumber = parseInt(firstPageNumberArray.join('')) || 0;
|
|
537
|
-
|
|
537
|
+
|
|
538
538
|
const arrayPages = typeof finalPageNumber === 'undefined' ? 0 : finalPageNumber / firstPageNumber;
|
|
539
539
|
arrayItems = Array(arrayPages).fill(null).map((page, index) => `/search?search_id=draftsearch&start=${firstPageNumber * (index + 1)}&change_version=invision`);
|
|
540
540
|
}
|
|
541
|
-
|
|
541
|
+
|
|
542
542
|
return {
|
|
543
543
|
items: htmlDraftsPage.querySelectorAll('.ipbtable tbody tr td').length === 1 ? 0 : htmlDraftsPage.querySelectorAll('.ipbtable tbody tr').length,
|
|
544
544
|
pages: ['/search?search_id=draftsearch&change_version=invision', ...arrayItems],
|
|
@@ -553,12 +553,12 @@ const FNR = {
|
|
|
553
553
|
const draftsPage = await fetch(page);
|
|
554
554
|
const bodyDraftsPage = await draftsPage.text();
|
|
555
555
|
const htmlDraftsPage = document.createElement('html');
|
|
556
|
-
|
|
556
|
+
|
|
557
557
|
htmlDraftsPage.innerHTML = bodyDraftsPage;
|
|
558
|
-
|
|
558
|
+
|
|
559
559
|
return Array.from(htmlDraftsPage.querySelectorAll('.ipbtable tbody tr')).map(row => {
|
|
560
560
|
const cells = row.children;
|
|
561
|
-
|
|
561
|
+
|
|
562
562
|
return {
|
|
563
563
|
topic: {
|
|
564
564
|
name: cells[1].textContent.trim(),
|
|
@@ -583,27 +583,27 @@ const FNR = {
|
|
|
583
583
|
const draftsPage = await fetch('/search?search_id=topicdraftsearch&change_version=invision');
|
|
584
584
|
const bodyDraftsPage = await draftsPage.text();
|
|
585
585
|
const htmlDraftsPage = document.createElement('html');
|
|
586
|
-
|
|
586
|
+
|
|
587
587
|
htmlDraftsPage.innerHTML = bodyDraftsPage;
|
|
588
|
-
|
|
588
|
+
|
|
589
589
|
const total = htmlDraftsPage.querySelectorAll('.pagination a');
|
|
590
590
|
let arrayItems = [];
|
|
591
|
-
|
|
591
|
+
|
|
592
592
|
if (total.length) {
|
|
593
593
|
const finalPage = total[total.length - 2];
|
|
594
594
|
const finalPageUrl = finalPage.href.split(finalPage.origin)[1];
|
|
595
595
|
const finalPageNumberArray = finalPageUrl.match(/[0-9]/g) || [];
|
|
596
|
-
const finalPageNumber = parseInt(finalPageNumberArray.join('')) || 0;
|
|
597
|
-
|
|
596
|
+
const finalPageNumber = parseInt(finalPageNumberArray.join('')) || 0;
|
|
597
|
+
|
|
598
598
|
const firstPage = total[1];
|
|
599
599
|
const firstPageUrl = firstPage.href.split(firstPage.origin)[1];
|
|
600
600
|
const firstPageNumberArray = firstPageUrl.match(/[0-9]/g) || [];
|
|
601
601
|
const firstPageNumber = parseInt(firstPageNumberArray.join('')) || 0;
|
|
602
|
-
|
|
602
|
+
|
|
603
603
|
const arrayPages = typeof finalPageNumber === 'undefined' ? 0 : finalPageNumber / firstPageNumber;
|
|
604
604
|
arrayItems = Array(arrayPages).fill(null).map((page, index) => `/search?search_id=topicdraftsearch&start=${firstPageNumber * (index + 1)}&change_version=invision`);
|
|
605
605
|
}
|
|
606
|
-
|
|
606
|
+
|
|
607
607
|
return {
|
|
608
608
|
items: htmlDraftsPage.querySelectorAll('.ipbtable tbody tr td').length === 1 ? 0 : htmlDraftsPage.querySelectorAll('.ipbtable tbody tr').length,
|
|
609
609
|
pages: ['/search?search_id=topicdraftsearch&change_version=invision', ...arrayItems],
|
|
@@ -618,12 +618,12 @@ const FNR = {
|
|
|
618
618
|
const draftsPage = await fetch(page);
|
|
619
619
|
const bodyDraftsPage = await draftsPage.text();
|
|
620
620
|
const htmlDraftsPage = document.createElement('html');
|
|
621
|
-
|
|
621
|
+
|
|
622
622
|
htmlDraftsPage.innerHTML = bodyDraftsPage;
|
|
623
|
-
|
|
623
|
+
|
|
624
624
|
return Array.from(htmlDraftsPage.querySelectorAll('.ipbtable tbody tr')).map(row => {
|
|
625
625
|
const cells = row.children;
|
|
626
|
-
|
|
626
|
+
|
|
627
627
|
return {
|
|
628
628
|
topic: {
|
|
629
629
|
name: cells[0].textContent.trim(),
|
|
@@ -670,7 +670,7 @@ const FNR = {
|
|
|
670
670
|
case 'select':
|
|
671
671
|
value = $(fields).find('dl:contains("' + item.name + '")').find('dd').find('select option:selected').attr('value');
|
|
672
672
|
|
|
673
|
-
$(fields).find('dl:contains("' + item.name + '")').find('dd').find('select option').each(function() {
|
|
673
|
+
$(fields).find('dl:contains("' + item.name + '")').find('dd').find('select option').each(function () {
|
|
674
674
|
if ($(this).attr('value') === '') return;
|
|
675
675
|
|
|
676
676
|
options.push({
|
|
@@ -928,7 +928,7 @@ const FNR = {
|
|
|
928
928
|
|
|
929
929
|
document.getElementById(`forum-modal`).remove();
|
|
930
930
|
};
|
|
931
|
-
|
|
931
|
+
|
|
932
932
|
document.querySelector('#modal-button-cancel').onclick = () => {
|
|
933
933
|
reject(false);
|
|
934
934
|
document.getElementById(`forum-modal`).remove();
|
|
@@ -938,14 +938,14 @@ const FNR = {
|
|
|
938
938
|
reject(false);
|
|
939
939
|
document.getElementById(`forum-modal`).remove();
|
|
940
940
|
};
|
|
941
|
-
|
|
941
|
+
|
|
942
942
|
document.querySelector('.is-bgmodal.bg-active').onclick = () => {
|
|
943
943
|
reject(false);
|
|
944
944
|
document.getElementById(`forum-modal`).remove();
|
|
945
945
|
};
|
|
946
946
|
});
|
|
947
947
|
},
|
|
948
|
-
genNotification: (title, content, icon, url) => {
|
|
948
|
+
genNotification: (title, content, icon, url) => {
|
|
949
949
|
if (title === '' || title === undefined || title === null) return;
|
|
950
950
|
if (content === '' || content === undefined || content === null) return;
|
|
951
951
|
if (content.length > 50) return;
|
|
@@ -1068,15 +1068,15 @@ const FNR = {
|
|
|
1068
1068
|
if (document.querySelector('.forum-controls')) {
|
|
1069
1069
|
[].forEach.call(document.querySelectorAll('.forum-controls'), (control) => {
|
|
1070
1070
|
let children = 0;
|
|
1071
|
-
|
|
1071
|
+
|
|
1072
1072
|
[].forEach.call(control.children, (item) => {
|
|
1073
1073
|
if (window.getComputedStyle(item, null).display === 'none') {
|
|
1074
1074
|
return;
|
|
1075
1075
|
}
|
|
1076
|
-
|
|
1076
|
+
|
|
1077
1077
|
children += item.children.length;
|
|
1078
1078
|
});
|
|
1079
|
-
|
|
1079
|
+
|
|
1080
1080
|
if (children === 0 && control.classList.contains('not-show') === false) {
|
|
1081
1081
|
control.classList.add('not-show');
|
|
1082
1082
|
}
|