I just wrote some code that won't quite work the same, but it was fun to experiment with:
Code
$$('dd.ce')
// Get all elements except the first because we don't want that
.slice(1)
// Convert nodeList to native arrays and remove the text elements
.map(a => Array.apply(null, a.childNodes).filter(b => b.nodeType !== 3))
.reduce( (prev, curr) => prev.concat(curr), [])
// Filter empty elements that are at the end
.filter(a => a.className !== 'c')
.reduce( (prev, curr) => {
// Previous node was a comment and current node is an item
if (prev.nodeType === 8 && curr.nodeType === 1) {
const id = prev.data.match(/\d{1,99}/)[0];
const url = `http://ladderslasher.d2jsp.org/itemHistory.php?i=${id}&c=1`
curr.innerHTML += `<br/><a href=${url}>ID: ${id}</a>`;
curr.style.height = 'auto'
}
// Always return the node for the next iteration
return curr;
}, {nodeType: null})
just paste it into your console while having a profile page with items open and it could work
if this is not legit to post, please let me know or block my post
edit: the one below will also adjust the height of each item box to match across all items, but will have a worse runtime (probably not noticable to anyone)
Code
var elements = $$('dd.ce')
// Get all elements except the first because we don't want that
.slice(1)
// Convert nodeList to native arrays and remove the text elements
.map(a => Array.apply(null, a.childNodes).filter(b => b.nodeType !== 3))
.reduce( (prev, curr) => prev.concat(curr), [])
// Filter empty elements that are at the end
.filter(a => a.className !== 'c');
elements
.reduce( (prev, curr) => {
// Previous node was a comment and current node is an item
if (prev.nodeType === 8 && curr.nodeType === 1) {
const id = prev.data.match(/\d{1,99}/)[0];
const url = `http://ladderslasher.d2jsp.org/itemHistory.php?i=${id}&c=1`
curr.innerHTML += `<br/><a href=${url}>ID: ${id}</a>`;
curr.style.height = '100%'
}
// Always return the node for the next iteration
return curr;
}, {nodeType: null})
var maxHeight = elements
.reduce( (prev, curr) => prev > curr.offsetHeight || !curr.offsetHeight ? prev : curr.offsetHeight, 0);
elements
.forEach(ell => {ell.nodeType === 1 && (ell.style.height = `${maxHeight}px`)});
what a fun thing to do before going to bed
This post was edited by Dante on Apr 18 2018 05:23pm