WME Show locked HN + Restriction

Enables View HN and View Restrictions buttons for locked or out of area segments

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         WME Show locked HN + Restriction
// @description  Enables View HN and View Restrictions buttons for locked or out of area segments
// @version      1.1
// @author       whathappened15
// @include      https://www.waze.com/*/editor*
// @include      https://www.waze.com/editor*
// @include      https://beta.waze.com/*
// @exclude      https://www.waze.com/*user/*editor/*
// @namespace    https://greasyfork.org/en/scripts/24955-wme-show-locked-hn-restriction
// @grant        none
// ==/UserScript==

function ShowLockedHM_bootstrap()
{
    Waze.selectionManager.events.register("selectionchanged", null, unlockHNbtn);
    Waze.selectionManager.events.register("selectionchanged", null, unlockResbtn);
}

function unlockHNbtn()
{
    if(Waze.selectionManager.selectedItems.length == 1 && Waze.selectionManager.selectedItems[0].model.type === 'segment' &&
       document.getElementsByClassName('edit-house-numbers')[0] !== undefined)
	{
        document.getElementsByClassName('edit-house-numbers')[0].disabled = false;
    }
}

function unlockResbtn()
{
    if(Waze.selectionManager.selectedItems.length == 1 && Waze.selectionManager.selectedItems[0].model.type === 'segment' &&
       document.getElementsByClassName('edit-restrictions')[0] !== undefined)
	{
        document.getElementsByClassName('edit-restrictions')[0].disabled = false;
    }
}

ShowLockedHM_bootstrap();