Created
November 22, 2009 02:02
-
-
Save t-ashula/240378 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name - Twitter List Delete | |
// @include http://twitter.com/* | |
// @author - t.ashula | |
// ==/UserScript== | |
(function(){ | |
if ( $("#admin_list a.destroy-list") ) { | |
$("#admin_list a.destroy-list").unbind('click'); | |
$.fn.isDestroyListLink=function(){ | |
return this.click(function(D){ | |
var C=$(this); | |
var A=C.next("form"); | |
var B=A.attr("action"); | |
if(confirm(_("Are sure you want to delete this list? There is NO undo!"))){ | |
$.ajax({ | |
url:B, type:"POST", | |
dataType:"json", | |
data:{ | |
_method:'delete', | |
authenticity_token:twttr.form_authenticity_token, | |
twttr:true | |
}, | |
beforeSend:function(){C.disable()}, | |
success:function(){document.location="/"}, | |
error:function(){alert('delete error');C.enable()} | |
}) | |
} | |
return false}) | |
} | |
$("#admin_list a.destroy-list").isDestroyListLink(); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment