Greasy Fork is available in English.
Gaia ToolBox for Waze Editors. Some funcionalities to make waze map editing a little bit easier.
当前为
// ==UserScript==
// @name GTB4WE
// @name:es Herramientas pa Gaia
// @version 0.1
// @description Gaia ToolBox for Waze Editors. Some funcionalities to make waze map editing a little bit easier.
// @description:es Algunas funcionalidades pa hacer la edición del mapa mas sencilla.
// @author abdielisai
// @include http://gaia.inegi.org.mx/mdm6/*
// @grant none
// @license GPLv3
// @namespace http://greasyfork.icu/users/118132
// ==/UserScript==
(function() {
function bootstrap(tries) {
tries = tries || 1;
if ($) {
init();
} else if (tries < 1000) {
setTimeout(function () {bootstrap(tries++);}, 200);
}
}
bootstrap();
function init(){
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
selectStreetName();
});
});
observer.observe($("#mdm6DinamicPanel_detail")[0],{ childList: true});
console.log("Gaia ToolBox for Waze Editors (GTB4WE) " + GM_info.script.version+" is running.");
}
function selectStreetName(){
var elements = $(".dinamicPanel-detailMainLabel");
if(elements.length == 0 || elements[0].childNodes.length == 0) return;
var sel = window.getSelection();
if(!sel.isCollapsed) return;
var range = document.createRange();
elements[0].childNodes.forEach(function(child){
if(child.nodeName == "#text" && child.nodeValue.indexOf("Calles")>=0){
range.setStart(child, 7);
range.setEndAfter(child);
return;
}else if(child.nodeName == "TABLE"){
range.selectNodeContents(child.childNodes[0].childNodes[0].childNodes[1]);
return;
}
});
sel.removeAllRanges();
sel.addRange(range);
}
})();