Created
April 11, 2014 00:56
-
-
Save pdclark/10435098 to your computer and use it in GitHub Desktop.
Delete all deals in Highrise by 37Signals (basecamp.com)
This file contains 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
/** | |
* This script should be pasted into a Browser debug console | |
* after clicking the Highrise links to show all deals. | |
* | |
* It may need to be run several times to deal with the massive amount | |
* of AJAX queries. | |
*/ | |
// Inject jQuery | |
var s=document.createElement('script'); | |
s.setAttribute('src','//code.jquery.com/jquery.js'); | |
document.getElementsByTagName('body')[0].appendChild(s); | |
// Give jQuery time to load | |
setTimeout( function(){ | |
var $ = jQuery; | |
// Select all deal links | |
$('tr.deal h3 a').each(function(){ | |
var baseUrl = $(this).prop('href'); | |
// Load the confimation page | |
$.get( baseUrl + '/confirm_destroy', function( data ) { | |
var $html = $(data); | |
// Submit the confirmation form | |
var $form = $html.find('div.submit form'); | |
$.post( baseUrl, $form.serialize() ); | |
} ); | |
}); | |
}, 3000 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Many thanks for sharing this gist! It's absurd that highrise doesn't provide a bulk delete :/