WME Show locked HN + Restriction

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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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();