您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Highlights un-nudged house numbers
当前为
/* global W */ // ==UserScript== // @name WME HN Tool // @description Highlights un-nudged house numbers // @version 1.00 // @author SAR85 // @copyright SAR85 // @license CC BY-NC-ND // @grant none // @include https://www.waze.com/editor/* // @include https://www.waze.com/*/editor/* // @include https://editor-beta.waze.com/* // @namespace https://greasyfork.org/users/9321 // ==/UserScript== function highlightUntouched(hnMarkers) { 'use strict'; var i, n, marker; for (i = 0, n = hnMarkers.length; i < n; i++) { marker = hnMarkers[i]; //marker.model is undefined for a selected HN marker if ('undefined' !== typeof marker.model && null === marker.model.updatedBy) { //marker.icon.$div.find('.drag-handle').css('background-color', "#3399FF"); //marker.input.css('color', '#3399FF'); marker.inputWrapper.css('background-color', '#FF9966'); } } } function checkHNs() { 'use strict'; var count = 0, check = function () { console.debug('Checking for HN'); var hnMarkers = W.appPresenter.sidebar.editPanel.typeToEditorClass .segment.houseNumbersControl.markerLayer.markers; if (hnMarkers.length > 0) { return highlightUntouched(hnMarkers); } else if (++count < 50) { window.setTimeout(check, 100); } else { console.debug('Error reading HNs'); } }; return check(); } function updateAlert() { 'use strict'; var hnVersion = '1.00', alertOnUpdate = true, versionChanges = 'WME Highlight HNs has been updated to ' + hnVersion + '.\n'; versionChanges += 'Changes:\n'; versionChanges += '[*]First public release.\n'; if (alertOnUpdate && window.localStorage && window.localStorage.hnVersion !== hnVersion) { window.localStorage.hnVersion = hnVersion; alert(versionChanges); } } function hnInit() { 'use strict'; var houseNumberControl = W.appPresenter.sidebar.editPanel.typeToEditorClass.segment.houseNumbersControl, wRender = houseNumberControl.render; houseNumberControl.render = function () { wRender.call(houseNumberControl); checkHNs(); }; console.debug('HN Tool: Initialized.'); updateAlert(); } function hnBootstrap(count) { 'use strict'; count = count || 0; if (undefined !== typeof W && undefined !== typeof W.accelerators && W.appPresenter && W.appPresenter.sidebar && W.appPresenter.sidebar.editPanel && W.appPresenter.sidebar && W.appPresenter.sidebar.editPanel && W.appPresenter.sidebar.editPanel.typeToEditorClass && W.appPresenter.sidebar.editPanel.typeToEditorClass.segment && undefined !== typeof W.appPresenter.sidebar.editPanel.typeToEditorClass.segment.houseNumbersControl) { console.debug('HN Tool: Initializing...'); window.setTimeout(hnInit, 100); } else if (count < 10) { console.debug('HN Tool: Bootstrap failed. Trying again...'); window.setTimeout(function () { hnBootstrap(++count); }, 1000); } else { console.debug('HN Tool: Bootstrap error.'); } } console.debug('HN Tool: Bootstrap...'); window.setTimeout(hnBootstrap, 100);