您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hides the selection panel
当前为
// ==UserScript== // @name WME Selection Panel Hider // @version 0.1.1 // @description Hides the selection panel // @match https://editor-beta.waze.com/*editor/* // @match https://www.waze.com/*editor/* // @grant none // @author JJohnston84 // @namespace https://greasyfork.org/users/10332 // ==/UserScript== (function() { // Delay Init setTimeout(init, 654); Waze.loginManager.events.register("login", null, init); var hideButtonArea; var showButtonArea; var hasSelection; var suppressSelectionPanel; function init() { // Tab creation var editPanel = document.getElementById('edit-panel'); var userPanel = document.getElementById('user-info'); hideButtonArea = document.createElement("div"); var hidePanelButton = document.createElement('input'); hidePanelButton.type = 'button'; hidePanelButton.value = 'Hide Selection Panel'; hidePanelButton.onclick = sphHideSelectionPanel; hideButtonArea.appendChild(hidePanelButton); showButtonArea = document.createElement("div"); var showPanelButton = document.createElement('input'); showPanelButton.type = 'button'; showPanelButton.value = 'Show Selection Panel'; showPanelButton.onclick = sphShowSelectionPanel; showButtonArea.appendChild(showPanelButton); editPanel.appendChild(hideButtonArea); userPanel.appendChild(showButtonArea); Waze.selectionManager.events.register("selectionchanged", null, sphSelectionChanged); sphUpdateVisibility(); } function sphHideSelectionPanel() { suppressSelectionPanel = true; Waze.appPresenter.sidebar.editPanel.hide(); Waze.appPresenter.sidebar.userTabs.show(); sphUpdateVisibility(); } function sphShowSelectionPanel() { suppressSelectionPanel = false; Waze.appPresenter.sidebar.editPanel.show(); Waze.appPresenter.sidebar.userTabs.hide(); sphUpdateVisibility(); } function sphSelectionChanged() { hasSelection = Waze.selectionManager.hasSelectedItems(); suppressSelectionPanel = suppressSelectionPanel && hasSelection; sphUpdateVisibility(); } function sphUpdateVisibility() { var canSeeShowButton = hasSelection && suppressSelectionPanel; var canSeeHideButton = hasSelection && !suppressSelectionPanel; hideButtonArea.style.display = canSeeHideButton ? 'block' : 'none'; showButtonArea.style.display = canSeeShowButton ? 'block' : 'none'; } })();