Untitled

mail@pastecode.io avatar
unknown
javascript
7 months ago
862 B
5
Indexable
Never
if (window.location.pathname.match("\/logs\/veh\/[0-9]+")) {
    var tr = document.getElementsByTagName("tr");
    for (var i = 0; i < tr.length; i++) {
        var cur = tr[i];
        if (cur.childNodes.length == 0) continue;
        var car_id;
        if (window.location.pathname.match("\/logs\/veh\/2001")) {
            car_id = cur.children[0].innerText.match(/\((\d+)\)/);
        } else if (window.location.pathname.match("\/logs\/veh\/2000")) {
            car_id = cur.children[0].innerText.match(/([0-9]+)/);
        }
        if (car_id == null) continue;
        car_id = parseInt(car_id[1]);
        var index_car_id = car_id - 400;
        if (index_car_id >= 0 && index_car_id < car_names.length) {
            var car_name = car_names[index_car_id];
            cur.children[0].innerText += " " + car_name;
        }
    }
}
Leave a Comment