Sentry fast delete

Add button to quickly delete all found issues

当前为 2018-04-22 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Sentry fast delete
// @namespace    http://tampermonkey.net/
// @version      1.1.1
// @description  Add button to quickly delete all found issues
// @author       Cáno
// @match        https://sentry.getprintbox.com/hiddendata/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var delAll = function() {
        document.querySelector('.chk-select-all').click();
        document.querySelector('.action-delete').click();
        document.querySelector('.modal-footer .btn-primary').click();
        location.reload();
    };

    var delSelected = function() {
        //document.querySelector('.chk-select-all').click();
        document.querySelector('.action-delete').click();
        document.querySelector('.modal-footer .btn-primary').click();
        location.reload();
    };

    window.onload = function(event) {
        setInterval(function(){
            if (document.querySelector('.delete-all')) {
            } else if (document.querySelector('.stream-actions-left')) {
                var div = document.createElement('div');
                var html = `
<div class="btn-group">
<a class="btn btn-default btn-sm delete-selected"><span class="icon icon-ban" style="margin-right: 5px"></span>Delete selected
</a>
</div>
`;
                div.innerHTML = html.trim();
                div = div.firstChild;
                document.querySelector('.stream-actions-left').appendChild(div);
                document.querySelector('.delete-selected').onclick = delSelected;

                var div = document.createElement('div');
                var html = `
<div class="btn-group">
<a class="btn btn-default btn-sm delete-all"><span class="icon icon-ban" style="color: red; margin-right: 5px"></span>Delete all
</a>
</div>
`;
                div.innerHTML = html.trim();
                div = div.firstChild;
                document.querySelector('.stream-actions-left').appendChild(div);
                document.querySelector('.delete-all').onclick = delAll;
            }
        },1000);
    };
})();