mirror of
https://github.com/kennethreitz-archive/www.gittip.com.git
synced 2026-06-21 15:50:59 +00:00
28cb48c72a
I sort of did this one with the blast shield down. I haven't even run
the tests yet. The sorts of things I changed:
- SQL {elsewhere,exchanges}.participant_id => .participant
- SQL participants.id => .username
- ORM {user,participant,self}.id => .username
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
$(document).ready(function()
|
|
{
|
|
// Wire up is_suspicious toggle.
|
|
// =============================
|
|
|
|
$('label.is-suspicious-knob').click(function()
|
|
{
|
|
var username = $(this).attr('data-username');
|
|
jQuery.ajax(
|
|
{ url: '/' + username + '/toggle-is-suspicious.json'
|
|
, type: 'POST'
|
|
, dataType: 'json'
|
|
, success: function(data)
|
|
{
|
|
if (data.is_suspicious)
|
|
$(".on-profile").addClass('is-suspicious');
|
|
else
|
|
$(".on-profile").removeClass('is-suspicious');
|
|
$('INPUT.is-suspicious-knob').attr( 'checked'
|
|
, data.is_suspicious
|
|
);
|
|
}
|
|
, error: function() {
|
|
alert( "Failed to change is_suspicious. Please "
|
|
+ "try again."
|
|
);
|
|
}
|
|
}
|
|
);
|
|
});
|
|
});
|