// ==UserScript== // @name WME HN Highlighter // @description A House Number script that highlights the native HN from white in yellow colour. // @namespace https://greasyfork.org/users/1087400-kid4rm90s // @version 2025.01.30.01 // @include /^https:\/\/(www|beta)\.waze\.com\/(?!user\/)(.{2,6}\/)?editor\/?.*$/ // @author kid4rm90s // @license MIT // @grant GM_addStyle // @require https://greasyfork.org/scripts/24851-wazewrap/code/WazeWrap.js // @downloadURL none // ==/UserScript== /* global W */ /* global WazeWrap */ (function main() { "use strict"; const scriptName = GM_info.script.name; const { version } = GM_info.script; console.log(`${scriptName}: Loading `); // Display change log immediately as it has no dependencies on waze itself. const changeLog = [ { version: "1.0", message: "Initial Version" }, { version: "1.1", message: "Removed unneccessary lines" }, { version: "2025.01.29.02", message: "Removed unneccessary lines" }, { version: "2025.01.30.01", message: "Added colour for input-wrapper" }, ]; async function checkVersion() { if (!WazeWrap?.Ready && !WazeWrap?.Interface?.ShowScriptUpdate) { setTimeout(checkVersion, 200); return; } const versionKey = `${scriptName.replace(/\s/g, "")}Version`; const previousVersion = window.localStorage.getItem(versionKey); if (previousVersion === version) { return; } let announcement = ""; let startIndex = 0; // Find the index of the previous version in the change log if (previousVersion) { startIndex = changeLog.findIndex(log => log.version === previousVersion); if (startIndex === -1) { startIndex = 0; // If not found, start from the beginning } } announcement += ""; console.group(`${scriptName} v${version} changelog:`); changeLog.slice(startIndex + 1).forEach(log => console.log(`V${log.version}: ${log.message}`)); console.groupEnd(); const title = startIndex > 0 ? `V${changeLog[startIndex].version} -> V${version}` : `Welcome to HNH V${version}`; console.log("ShwowScriptUpdate", scriptName, title, announcement); WazeWrap.Interface.ShowScriptUpdate( scriptName, title, announcement, "https://greasyfork.org/en/scripts//525203", ); window.localStorage.setItem(versionKey, version); } checkVersion(); // Initialize RHN once Waze has been loaded. function initialize() { console.log(`${scriptName} initializing.`); } function applyStyles() { document.querySelectorAll('.house-number-marker').forEach(marker => { marker.style.backgroundColor = '#FFFF00'; // Yellow }); document.querySelectorAll('.house-numbers-layer .house-number .content .input-wrapper input') .forEach(input => { input.style.backgroundColor = 'rgb(7, 255, 0)'; // Bright Green }); } // Observe DOM changes to apply styles dynamically const observer = new MutationObserver(applyStyles); observer.observe(document.body, { childList: true, subtree: true }); // Initial call to apply styles if elements already exist applyStyles(); // Apply styles using GM_addStyle for better enforcement GM_addStyle(` .house-number-marker { background-color: #FFFF00 !important; /* Change to yellow */ } .house-numbers-layer .house-number .content .input-wrapper input { background-color: rgb(7, 255, 0) !important; /* Bright Green */ } `); console.log(`${scriptName} initialized.`); })();