d2jsp
Log InRegister
d2jsp Forums > d2jsp > Ladder Slasher > Iso Ls Plug In
Add Reply New Topic New Poll
Member
Posts: 103,403
Joined: Jun 22 2007
Gold: 6,660.65
Oct 11 2019 12:42pm
The one where you can click ID from profile without going to source etc

Can’t find :(
Member
Posts: 23,728
Joined: Aug 21 2007
Gold: 433.48
Trader: Trusted
Oct 11 2019 12:47pm
Code
// ==UserScript==
// @name Show Item IDs
// @namespace http://tampermonkey.net/
// @version 0.1
// @author Dante@JSP
// @match http*://forums.d2jsp.org/user.php?c=*&i=*&p=*
// ==/UserScript==

/* jshint ignore:start */
(function() {
var elements = Array.apply(null, document.querySelectorAll('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 core = document.querySelectorAll('.ftbt')[0].childNodes[1].childNodes[2].childNodes[1].innerHTML === 'Original' ? 0 : 1;
const url = `http://ladderslasher.d2jsp.org/itemHistory.php?i=${id}&c=${core}`

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`)});

})()


for chrome and tampermonkey
Member
Posts: 103,403
Joined: Jun 22 2007
Gold: 6,660.65
Oct 11 2019 12:49pm
Ty love
Go Back To Ladder Slasher Topic List
Add Reply New Topic New Poll