Skip to content

Instantly share code, notes, and snippets.

@mainerror
Created September 12, 2012 12:49
Show Gist options
  • Save mainerror/3706379 to your computer and use it in GitHub Desktop.
Save mainerror/3706379 to your computer and use it in GitHub Desktop.
Android Access Request List Clean
$(document).ready(function() {
var idList = [],
ivlID,
fkey;
$('#access-section-request .access-list').children().each(function() {
idList.push(parseInt($(this).attr('id').split('-')[2], 10));
});
fkey = $('#fkey').val();
ivlID = setInterval(function() {
if (idList.length > 0) {
$.ajax({
type: 'POST',
url: '/rooms/setuseraccess/15',
data: {
fkey: fkey,
aclUserId: idList[0],
userAccess: 'remove'
}
});
idList.shift();
} else {
clearInterval(ivlID);
}
}, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment