Advertisement
Cool_boy21

Crowdin approved duplicates removal

Jul 5th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).bind('keydown', 'ctrl+alt+d', function(e) {
  2.     //Ctrl+Alt+D
  3.     if(e.ctrlKey && e.altKey && e.key == "d") {
  4.         let suggestions = $("#suggestions");
  5.         let approved = suggestions.find(".approve-action.active").closest(".suggestion");
  6.         if(approved.length) {
  7.             let text = approved.find(".suggestion-text").text();
  8.             console.log("Deleting "+text);
  9.             suggestions.find(".suggestion").each(function() {
  10.                 let elem = $(this);
  11.                 if(!elem.find(".approve-action").hasClass("active")
  12.                     && elem.find(".suggestion-text").text()==text) {
  13.                     let deleteButton = elem.find(".active_suggestion_delete_button");
  14.                     deleteButton.click();
  15.                 };
  16.             });
  17.         } else {
  18.             console.log("No approved suggestions on this phrase.");
  19.         };
  20.     };
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement