1 // NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE:
3 // This file is generated automatically by the script
4 // "scripts/generate_client_js_actions.pl". See the documentation for
5 // SL/ClientJS.pm for instructions.
7 function display_flash(type, message) {
8 $('#flash_' + type + '_content').text(message);
9 $('#flash_' + type).show();
12 function eval_json_result(data) {
17 return display_flash('error', data.error);
19 $(['info', 'warning', 'error']).each(function(idx, category) {
20 $('#flash_' + category).hide();
21 $('#flash_' + category + '_content').empty();
24 if ((data.js || '') != '')
27 if (data.eval_actions)
28 $(data.eval_actions).each(function(idx, action) {
29 // console.log("ACTION " + action[0] + " ON " + action[1]);
34 // console.log("current_content_type " + $('#current_content_type').val() + ' ID ' + $('#current_content_id').val());
37 function submit_ajax_form(url, form_selector, additional_data) {
38 var separator = /\?/.test(url) ? '&' : '?';
39 $.post(url + separator + $(form_selector).serialize(), additional_data, eval_json_result);