{:uriI"file:///Users/eisuke-oishi/work/kuroko2_oss/app/assets/javascripts/kuroko2/job_definitions.js?type=application/javascript&pipeline=self&id=dbcee99cd52d06b1a2fb4e12780933075f341ca46fded3460195ffbb9b3fbca3:ET:load_pathI"@/Users/eisuke-oishi/work/kuroko2_oss/app/assets/javascripts;T:
filenameI"[/Users/eisuke-oishi/work/kuroko2_oss/app/assets/javascripts/kuroko2/job_definitions.js;T: nameI"kuroko2/job_definitions;T:logical_pathI"$kuroko2/job_definitions.self.js;T:content_typeI"application/javascript;T:sourceI" // Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
jQuery(function ($) {
$('.star-holder').delegate('.star', 'ajax:complete', function (xhr, status) {
var currentTarget = xhr.currentTarget;
var definitionsPath = $('.star').data("definitions-path");
switch (status.status) {
case 200: // deleted
var definitionId = status.responseJSON['job_definition_id'];
var elem = $('')
.attr("href", definitionsPath + "/" + definitionId + "/stars")
.attr("data-definition-id", definitionId);
$(currentTarget).replaceWith(elem);
break;
case 201: // created
var starId = status.responseJSON['id'];
var definitionId = status.responseJSON['job_definition_id'];
var elem = $('')
.attr("href", definitionsPath + "/" + definitionId + "/stars/" + starId)
.attr("data-star-id", starId)
.attr("data-definition-id", definitionId);
$(currentTarget).replaceWith(elem);
break;
}
});
$('#instances-holder').delegate('#instances', 'ajax:complete', function (xhr, status) {
switch (status.status) {
case 200: // pagination
$('#instances').replaceWith(status.responseText);
break;
}
});
$('#schedules-holder').delegate('#schedules', 'ajax:complete', function (xhr, status) {
switch (status.status) {
case 200:
case 201:
var schedulesPath = $('#schedules').data("schedules-path");
$.get(schedulesPath, function (data) {
$('#schedules').replaceWith(data);
});
break;
case 400:
$('#cron-field').addClass("has-error");
break;
}
});
$('#suspend-schedules-holder').delegate('#suspend-schedules', 'ajax:complete', function (xhr, status) {
switch (status.status) {
case 200:
case 201:
var schedulesPath = $('#suspend-schedules').data("suspend-schedules-path");
$.get(schedulesPath, function (data) {
$('#suspend-schedules').replaceWith(data);
});
break;
case 400:
$('#suspend-cron-field').addClass("has-error");
break;
}
});
$('#admin_assignments_user_id').select2();
});
;T:
metadata{:dependencieso:Set:
@hash}
I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"ifile-digest:///Users/eisuke-oishi/work/kuroko2_oss/app/assets/javascripts/kuroko2/job_definitions.js;TTF:
requiredo;;} F:stubbedo;;} F:
linkso;;} F:charsetI"
utf-8;F:digest"%$D?Ϸ:6=hɄ:lengthi :dependencies_digest"%ꋔP%ZXk݈5scD[V:idI"Edbcee99cd52d06b1a2fb4e12780933075f341ca46fded3460195ffbb9b3fbca3;F:
mtimel+KX