Skip to content

Instantly share code, notes, and snippets.

@bi0xid
Last active May 9, 2018 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bi0xid/af546862d138433def4b1a5bcdbf289b to your computer and use it in GitHub Desktop.
Save bi0xid/af546862d138433def4b1a5bcdbf289b to your computer and use it in GitHub Desktop.
var e = jQuery.Event("keydown");
e.which = 107; // # Some key code value
jQuery('.approve:visible').trigger(e, click);
jQuery('.approve:visible').click().trigger(e);
jQuery(".approve:visible").click(function(){
var e = jQuery.Event("keydown", { keyCode: 107, which: 107});
jQuery(".approve:visible").triggerHandler(e);
});
jQuery("#wordpress-org").keydown(function(e){
console.log(e);
if (e.which == 187) {
jQuery(".approve:visible").click();
}
});
jQuery("#wordpress-org").keydown(function(e){
console.log(e);
if (e.which == 189) {
jQuery(".reject:visible").click();
}
});
var e = jQuery.Event("keydown", { keyCode: 107, which: 107});
jQuery(".approve:visible").triggerHandler(e);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment