Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0583eb2

Browse filesBrowse files
committed
[1.7] Adjusted profile page script to the website layout
1 parent 73fb3d2 commit 0583eb2
Copy full SHA for 0583eb2

3 files changed

+29-20Lines changed: 29 additions & 20 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎dist/NuoFlix/EnhancedNuoFlix.user.js‎

Copy file name to clipboardExpand all lines: dist/NuoFlix/EnhancedNuoFlix.user.js
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name Enhanced NuoFlix
33
// @name:de NuoFlix 2.0
44
// @namespace http://tampermonkey.net/
5-
// @version 1.6
5+
// @version 1.1
66
// @description Adds a lot of improvements and new features to NuoFlix. See preview video for more details: https://www.youtube.com/watch?v=kxp2j46IWZA
77
// @description:de Fügt zahlreiche Verbesserungen und neue Funktionen zu NuoFlix hinzu. Weitere Details finden Sie im Vorschauvideo: https://www.youtube.com/watch?v=kxp2j46IWZA
88
// @icon https://nuoflix.de/favicon-16x16.png
@@ -1928,7 +1928,7 @@ div:not(:last-child) > .playlistButton {
19281928
ignoreFilter.value.push(user);
19291929
ignoreFilter.active = true;
19301930
}
1931-
originalCommentContainer = document.getElementsByClassName('profilContentInner')[0];
1931+
originalCommentContainer = document.getElementsByClassName('profilContentInner')[1];
19321932
if (!originalCommentContainer) {
19331933
const msg = t('DOM-Element nicht gefunden. Nicht eingeloggt? Falls doch, hat sich der DOM verändert.');
19341934
messagebox('error', msg);
@@ -2113,9 +2113,9 @@ function doUpdateDateFilter(fromInput, toInput) {
21132113
updatePage();
21142114
}
21152115
function generateCommentObject() {
2116-
let RawData = document.getElementsByClassName('profilContentInner')[0];
2117-
if (!RawData) return [];
2118-
let commentBlocksRaw = RawData.getElementsByClassName('commentItem');
2116+
let rawData = document.getElementsByClassName('profilContentInner')[1];
2117+
if (!rawData) return [];
2118+
let commentBlocksRaw = rawData.getElementsByClassName('commentItem');
21192119
let commentDataCollection = [];
21202120
let counter = 0;
21212121
let tmp;
@@ -2974,7 +2974,7 @@ function updatePaginationUI() {
29742974
if (typeof paginationControlContainerBottom !== typeof undefined && paginationControlContainerBottom instanceof HTMLElement) paginationControlContainerBottom.remove();
29752975
paginationContainer = addToDOM(
29762976
buildPaginationUi().parseHTML(),
2977-
document.getElementsByClassName('rowHeadlineHolder')[1],
2977+
document.getElementsByClassName('rowHeadlineHolder')[3],
29782978
InsertionService.After,
29792979
true,
29802980
'paginationContainer'
@@ -3027,12 +3027,12 @@ function updateComments() {
30273027
} else {
30283028
customCommentContainer = document.getElementById('customCommentContainer');
30293029
if (!customCommentContainer) {
3030-
customCommentContainer = document.getElementsByClassName('profilContentInner')[0];
3030+
customCommentContainer = document.getElementsByClassName('profilContentInner')[1];
30313031
customCommentContainer.id = 'customCommentContainer';
30323032
}
30333033
}
30343034
insertPaginatedComments();
3035-
customCommentContainer = document.getElementsByClassName('profilContentInner')[0];
3035+
customCommentContainer = document.getElementsByClassName('profilContentInner')[1];
30363036
if (totalComments === 0) {
30373037
const msg = `<div class="msgNoResults">${t('Noch keine Kommentare...')}</div>`.parseHTML();
30383038
addToDOM(msg, customCommentContainer, InsertionService.AsLastChild, false);
Collapse file

‎src/NuoFlix/EnhancedNuoFlix/Global/userscript_definition.js‎

Copy file name to clipboardExpand all lines: src/NuoFlix/EnhancedNuoFlix/Global/userscript_definition.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name Enhanced NuoFlix
33
// @name:de NuoFlix 2.0
44
// @namespace http://tampermonkey.net/
5-
// @version 1.6
5+
// @version 1.1
66
// @description Adds a lot of improvements and new features to NuoFlix. See preview video for more details: https://www.youtube.com/watch?v=kxp2j46IWZA
77
// @description:de Fügt zahlreiche Verbesserungen und neue Funktionen zu NuoFlix hinzu. Weitere Details finden Sie im Vorschauvideo: https://www.youtube.com/watch?v=kxp2j46IWZA
88
// @icon https://nuoflix.de/favicon-16x16.png
Collapse file

‎src/NuoFlix/EnhancedNuoFlix/ProfilePage/functions_profilePage.js‎

Copy file name to clipboardExpand all lines: src/NuoFlix/EnhancedNuoFlix/ProfilePage/functions_profilePage.js
+20-11Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function execute_profilePage() {
6262
}
6363

6464
// disable the original comment container
65-
originalCommentContainer = document.getElementsByClassName('profilContentInner')[0];
65+
originalCommentContainer = document.getElementsByClassName('profilContentInner')[1];
6666
if (!originalCommentContainer) {
6767
const msg = t('DOM-Element nicht gefunden. Nicht eingeloggt? Falls doch, hat sich der DOM verändert.');
6868
messagebox('error', msg);
@@ -256,7 +256,7 @@ function execute_profilePage() {
256256
}
257257
});
258258

259-
// only enable the button for deleting users from block list if an entry is selected
259+
// mount handler which only enables the "delete user from block list" button while an user is selected in the list
260260
document.getElementById('ignoredUsers').addEventListener('change', function() {
261261
const deleteButton = document.getElementById('deleteIgnoreUser');
262262
this.selectedIndex === -1 && deleteButton
@@ -334,17 +334,16 @@ function doUpdateDateFilter(fromInput, toInput) {
334334

335335

336336
/**
337-
* Generates the data object for storing existing comments
338-
* by parsing the container holding which contains all the
339-
* comments.
337+
* This will search and parse all comments and generate a data
338+
* object from it.
340339
*
341340
* @return {Object[]} - Comment data collection
342341
*/
343342
function generateCommentObject() {
344343
// get raw data
345-
let RawData = document.getElementsByClassName('profilContentInner')[0];
346-
if (!RawData) return [];
347-
let commentBlocksRaw = RawData.getElementsByClassName('commentItem');
344+
let rawData = document.getElementsByClassName('profilContentInner')[1];
345+
if (!rawData) return [];
346+
let commentBlocksRaw = rawData.getElementsByClassName('commentItem');
348347

349348
// generate data array for each raw comment
350349
let commentDataCollection = [];
@@ -782,6 +781,12 @@ function convertGermanDate(string) {
782781

783782

784783

784+
/**
785+
* Creates the HTML structure of the pagination container for the
786+
* current state of the page.
787+
*
788+
* @return {string}
789+
*/
785790
function buildPaginationUi() {
786791
// use local copy to adjust the value after filter were applied
787792
let _totalComments = totalComments - filteredCommentsCount;
@@ -1486,9 +1491,13 @@ function updatePaginationUI() {
14861491
if (typeof paginationControlContainer !== typeof undefined && paginationControlContainer instanceof HTMLElement) paginationControlContainer.remove();
14871492
if (typeof paginationControlContainerBottom !== typeof undefined && paginationControlContainerBottom instanceof HTMLElement) paginationControlContainerBottom.remove();
14881493

1494+
// TODO: Aktuell wird mit ...[3] die Überschrift "---- Deine Kommentare ----" als Ref zum einfügen genutzt.
1495+
// mal testen, ob man nicht einfach direkt den customCommentContainer nutzen kann. Eig sollte der hier
1496+
// schon in jeder Situation verfügbar sein, aber lieber mal durchtesten...
1497+
14891498
paginationContainer = addToDOM(
14901499
buildPaginationUi().parseHTML(),
1491-
document.getElementsByClassName('rowHeadlineHolder')[1],
1500+
document.getElementsByClassName('rowHeadlineHolder')[3],
14921501
InsertionService.After,
14931502
true,
14941503
'paginationContainer'
@@ -1559,12 +1568,12 @@ function updateComments() {
15591568
// on very first build
15601569
customCommentContainer = document.getElementById('customCommentContainer');
15611570
if (!customCommentContainer) {
1562-
customCommentContainer = document.getElementsByClassName('profilContentInner')[0];
1571+
customCommentContainer = document.getElementsByClassName('profilContentInner')[1];
15631572
customCommentContainer.id = 'customCommentContainer';
15641573
}
15651574
}
15661575
insertPaginatedComments();
1567-
customCommentContainer = document.getElementsByClassName('profilContentInner')[0];
1576+
customCommentContainer = document.getElementsByClassName('profilContentInner')[1];
15681577
// if no comments to display, display message instead
15691578
if (totalComments === 0) {
15701579
const msg = `<div class="msgNoResults">${t('Noch keine Kommentare...')}</div>`.parseHTML();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.