| @@ -0,0 +1,30 @@ | |||||
| // ==UserScript== | |||||
| // @name Garland location fixer | |||||
| // @version 1 | |||||
| // @include http://www.garlandtools.org/db/* | |||||
| // @run-at document-end | |||||
| // @grant none | |||||
| // ==/UserScript== | |||||
| /* Patch gathering material resolver */ | |||||
| function garlandLocationFixer() { | |||||
| 'use strict'; | |||||
| console.log('fixer: garlandLocationFixer, v1.0'); | |||||
| console.log('fixer: installing monkey patch'); | |||||
| let actual_resolve = gt.node.resolveCraftSource; | |||||
| gt.node.resolveCraftSource = function(step, id) { | |||||
| actual_resolve(step, id); | |||||
| let view = step.sourceView; | |||||
| console.log('fixer: Adding ' + view.name + ' to ' + view.longSourceName); | |||||
| view.longSourceName = view.name + ', ' + view.longSourceName; | |||||
| console.log('fixer: done.'); | |||||
| } | |||||
| console.log('fixer: done.'); | |||||
| } | |||||
| /* Add script to execute in page scope */ | |||||
| var script = document.createElement("script"); | |||||
| script.type = "application/javascript"; | |||||
| script.textContent = "(" + garlandLocationFixer + ")();"; | |||||
| document.body.appendChild(script); | |||||