// ==UserScript== // @name Dreams // @description Sets new TDZK accessKeys // @include * // ==UserScript== (function() { function $(id) { return document.getElementById(id) } function $$(parent, childs) { return parent.getElementsByTagName(childs) } window.addEventListener("load", function() { // Dock as = $$(document, 'a'); for (i=0; i<as.length; i++) { temp = as[i].href.split("?") if (temp[0] == 'http://nomad.tdzk.com/station/reqDock') { as[i].accessKey = "x" } } // Trade goods if ($('tradeform')) { rows = $$($$($('tradeform'), 'tbody')[0], 'tr'); for (i=0; i<rows.length; i++) { row = rows[i] accessKeyToAdd = ((i+1) == 10) ? '/' : ((i+1) == 11) ? '*' : ((i+1) == 12) ? '-' : (i+1); rowa = $$(row, 'a') if (rowa[0]) { rowa[0].accessKey = accessKeyToAdd } } } }, false); })();