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 namespace("kivi", function(ns) {
8 ns.display_flash = function(type, message) {
9 $('#flash_' + type + '_content').text(message);
10 $('#flash_' + type).show();
13 ns.eval_json_result = function(data) {
18 return ns.display_flash('error', data.error);
20 $(['info', 'warning', 'error']).each(function(idx, category) {
21 $('#flash_' + category).hide();
22 $('#flash_' + category + '_content').empty();
25 if ((data.js || '') != '')
28 if (data.eval_actions)
29 $(data.eval_actions).each(function(idx, action) {
30 // console.log("ACTION " + action[0] + " ON " + action[1]);
35 // console.log("current_content_type " + $('#current_content_type').val() + ' ID ' + $('#current_content_id').val());
38 ns.submit_ajax_form = function(url, form_selector, additional_data) {
39 var separator = /\?/.test(url) ? '&' : '?';
40 $.post(url + separator + $(form_selector).serialize(), additional_data, ns.eval_json_result);