Sentry fast delete

Add button to quickly delete all found issues

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Sentry fast delete
// @namespace    http://tampermonkey.net/
// @version      1.1.6
// @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 delAllSafe = function() {
        document.querySelector('.chk-select-all').click();
        document.querySelector('.action-delete').click();
    };

    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('.action-delete').click();
        //document.querySelector('.modal-footer .btn-primary').click();
    };

    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-trash" 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-safe"><span class="icon icon-trash" style="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-safe').onclick = delAllSafe;

            var div = document.createElement('div');
            var html = `
<div class="btn-group">
<a class="btn btn-default btn-sm delete-all"><span class="icon icon-trash" style="color: red; margin-right: 1px"></span></a>
</div>
`;
            div.innerHTML = html.trim();
            div = div.firstChild;

            document.querySelector('.stream-actions-left').appendChild(div);
            document.querySelector('.delete-all').onclick = delAll;
        }
    },1000);
})();