class SelectOrCreate(Select): """ Base class for all

example.js // Generated by CoffeeScript 1.7.1 $(function() { $('a[name=add_dialog]').click(function() { var dialog, id; id = $(this).data('id'); dialog = $('#' + id + '-dialog').dialog(); return false; }); return $('input[name=add_another_id_series]').click(function() { var data, form; form = $(this).parent().parent().find('#form-dialog'); data = { param1: $('#param1').val(), param2: $('#param2').val(), param3: $('#param3').val(), param4: $('#param4').val(), param5: $('#param5').val() }; return $.ajax($(this).data('url'), { type: 'POST', beforeSend: function(request) { request.setRequestHeader('Cache-Control', 'no-cache'); request.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); return request.setRequestHeader('X-CSRFToken', getCookie('csrftoken')); }, data: data, success: function(data) { if (data.status === 'Wrong') { $(form).html(data.form); } if (data.status === 'Ok') { $('#id_series').append(''); $('#id_series').val(data.id); $('#id_series-dialog').dialog('close'); } } }); }); });