Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).bind('keydown', 'ctrl+alt+d', function(e) {
- //Ctrl+Alt+D
- if(e.ctrlKey && e.altKey && e.key == "d") {
- let suggestions = $("#suggestions");
- let approved = suggestions.find(".approve-action.active").closest(".suggestion");
- if(approved.length) {
- let text = approved.find(".suggestion-text").text();
- console.log("Deleting "+text);
- suggestions.find(".suggestion").each(function() {
- let elem = $(this);
- if(!elem.find(".approve-action").hasClass("active")
- && elem.find(".suggestion-text").text()==text) {
- let deleteButton = elem.find(".active_suggestion_delete_button");
- deleteButton.click();
- };
- });
- } else {
- console.log("No approved suggestions on this phrase.");
- };
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement