Created
February 18, 2014 23:39
-
-
Save jhubert/9082925 to your computer and use it in GitHub Desktop.
Delete all the messages from the Hipchat message log that were sent from the expected sender
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('form').each(function(i, el){ | |
| var sender = $(this).parent().siblings('p').text().trim(); | |
| if (sender == 'Errbit') { | |
| var data = 'action=delete'; | |
| data += '&message_id='+$(el).find('input[name="message_id"]').val(); | |
| data += '&xsrf_token='+$(el).find('input[name="xsrf_token"]').val(); | |
| data += '&message_index='+$(el).find('input[name="message_index"]').val(); | |
| $.ajax({ | |
| type: $(el).attr('method'), | |
| url: $(el).attr('action'), | |
| data: data | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment