o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1360491345.674269:@value"{I"
class:EFI"BundledAsset; FI"logical_path; FI"rollout_admin/admin.js; FI"
pathname; FI"f/Users/abalsam/Documents/projects/rollout_admin/app/assets/javascripts/rollout_admin/admin.js.erb; FI"content_type; FI"application/javascript; FI"
mtime; FI"2013-02-10T11:15:34+01:00; FI"length; FiI"digest; F"%69a3023bda44134fd91ad3d0e0b82fc9I"source; FI"
$(function(){
$('a.icon-chevron-down').click(
function(){
$(this).parent().find('div.details').fadeIn(1000);
$(this).hide();
$(this).parent().find('a.icon-chevron-up').show();
}
);
$('a.icon-chevron-up').click(
function(){
$(this).parent().find('div.details').fadeOut(500);
$(this).hide();
$(this).parent().find('a.icon-chevron-down').show();
}
);
$(document).delegate('i.delete_user', 'click',
function(){
var context=$(this).closest("div").parent().find("h4#feature_name").html(),
that=$(this).closest("li"),
ulist=$(this).closest("ul");
$.post('/testing/remove.json', {object_type:"user", user: $(this).closest("li").text(), feature: context}, function(data) {
that.remove();
if ($("li",ulist).length == 1) {
ulist.children(':last').before('
No members');
}
});
});
$(document).delegate('i.delete_group','click',
function(){
var context=$(this).closest("div").parent().find("h4#feature_name").html(),
that=$(this).closest("li"),
ulist=$(this).closest("ul");
$.post('/testing/remove.json', {object_type:"group", group: $(this).closest("li").text(), feature: context}, function(data) {
that.remove();
if ($("li",ulist).length == 1) {
ulist.children(':last').before('No members');
}
});
});
$(document).delegate('i.delete_ip','click',
function(){
var context=$(this).closest("div").parent().find("h4#feature_name").html(),
that=$(this).closest("li"),
ulist=$(this).closest("ul");
$.post('/testing/remove.json', {object_type:"ip", ip: $(this).closest("li").text(), feature: context}, function(data) {
that.remove();
if ($("li",ulist).length == 1) {
ulist.children(':last').before('No members');
}
});
});
$('i.add_users').click(
function(){
context=$(this).closest("div").parent().find("h4#feature_name").html();
$('.feature_name').html(context);
$that = $(this);
$.getJSON('/testing/get_users.json', function(json) {
userlist='Select users to add
';
$('#addUserModal').find("div.modal-body").html(userlist);
// clear former event handlers
$('#addUserModal').find("div.modal-footer").find("button.btn-primary").unbind();
$('#addUserModal').find("div.modal-footer").find("button.btn-primary").click(function() {
var allUsers = [];
var allUserNames = [];
$('#userlist :checked').each(function() {
allUsers.push($(this).val());
allUserNames.push($(this).data("username"));
});
$.post('/testing/add.json', {object_type:"user", user: allUsers.join(), feature: context}, function(data) {
list = $that.closest('ul');
if (list.children(':first').text() == "No members") {
list.children(':first').remove();
}
allUserNames.forEach(function(entry) {
list.children(':last').before(''+entry+'');
});
});
$('#addUserModal').modal('hide');
});
$('#addUserModal').modal();
});
}
);
$('i.add_groups').click(
function(){
context=$(this).closest("div").parent().find("h4#feature_name").html();
$('.feature_name').html(context);
$that = $(this);
// clear former event handlers
$('#addGroupModal').find("div.modal-footer").find("button.btn-primary").unbind();
$('#addGroupModal').find("div.modal-footer").find("button.btn-primary").click(function() {
$.post('/testing/add.json', {object_type:"group", group: $('#addGroupModal').find("div.modal-body").find("input#group_name").val(), feature: context}, function(data) {
list = $that.closest('ul');
if (list.children(':first').text() == "No members") {
list.children(':first').remove();
}
list.children(':last').before(''+$('#addGroupModal').find("div.modal-body").find("input#group_name").val()+'');
$('#addGroupModal').find("div.modal-body").find("input#group_name").val('');
});
$('#addGroupModal').modal('hide');
});
$('#addGroupModal').modal();
}
);
$('i.add_ips').click(
function(){
context=$(this).closest("div").parent().find("h4#feature_name").html();
$('.feature_name').html(context);
$that = $(this);
// clear former event handlers
$('#addIPModal').find("div.modal-footer").find("button.btn-primary").unbind();
$('#addIPModal').find("div.modal-footer").find("button.btn-primary").click(function() {
$.post('/testing/add.json', {object_type:"ip", ip: $('#addIPModal').find("div.modal-body").find("input#ipaddr").val(), feature: context}, function(data) {
list = $that.closest('ul');
if (list.children(':first').text() == "No members") {
list.children(':first').remove();
}
list.children(':last').before(''+$('#addIPModal').find("div.modal-body").find("input#ipaddr").val()+'');
$('#addIPModal').find("div.modal-body").find("input#ipaddr").val('');
});
$('#addIPModal').modal('hide');
});
$('#addIPModal').modal();
}
);
});
; FI"required_assets_digest; F"%ff80bdef3790a6daa8da03e3cd8608f6I"
_version; F"%6776f581a4329e299531e1d52aa59832