您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Import geojson and manage geojson files
当前为
// ==UserScript== // @name WME Geominator // @author IAmTheKLB // @namespace https://greasyfork.org/en/users/30893-kevin-buley // @description Import geojson and manage geojson files // @include https://www.waze.com/editor/* // @include https://www.waze.com/*/editor/* // @include https://editor-beta.waze.com/* // @version 0.01 // @grant none // @copyright 2016 Kevin Buley // ==/UserScript== function debugLog(message) { window.console.log("WME-Geominator:" + message); return; } // Thanks, Glodenox! function awaitLogin(e) { if (e && e.user === null) { return; } if (typeof Waze === 'undefined' || typeof Waze.loginManager === 'undefined') { setTimeout(awaitLogin, 100); return; } if (!Waze.loginManager.hasUser()) { Waze.loginManager.events.register("login", null, awaitLogin); Waze.loginManager.events.register("loginStatus", null, awaitLogin); return; } // TODO: check whether this is actually useful to do if (typeof document.getElementById('WazeMap') === undefined) { setTimeout(awaitLogin, 100); return; } init(); } function getElementsByClassName(classname, node) { if(!node) node = document.getElementsByTagName("body")[0]; var a = []; var re = new RegExp('\\b' + classname + '\\b'); var els = node.getElementsByTagName("*"); for (var i=0,j=els.length; i<j; i++) if (re.test(els[i].className)) a.push(els[i]); return a; } function getId(node) { return document.getElementById(node); } function initTab() { var addon = document.createElement('section'); addon.id = "sidepanel-geominator"; addon.className = "tab-pane"; var section = document.createElement('p'); section.style.paddingTop = "0px"; section.id = "geominatorOptions"; section.innerHTML = '<b>WME Geominator</b><br>' + '<input type="checkbox" id="_cbGeominator" title="Be Clicked" /> Gotta get clicked! ' + '<br>'; addon.appendChild(section); var userTabs = getId('user-info'); var navTabs = getElementsByClassName('nav-tabs', userTabs)[0]; var tabContent = getElementsByClassName('tab-content', userTabs)[0]; debugLog("newtab"); var newtab = document.createElement('li'); newtab.innerHTML = '<a href="#sidepanel-geominator" data-toggle="tab" title="Geominator">Geominator</a>'; navTabs.appendChild(newtab); tabContent.appendChild(addon); } function init() { debugLog("We made it!"); initTab(); } awaitLogin();