Sentry fast delete

Add button to quickly delete all found issues

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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);
})();