1jQuery(function () {
2    $div = jQuery('.plugin_booking');
3    if (!$div.length) return;
4
5    $div.load(
6        DOKU_BASE + 'lib/exe/ajax.php',
7        {
8            call: 'plugin_booking',
9            id: JSINFO['id'],
10        }
11    ).on('submit', function (e) {
12        e.preventDefault();
13
14        param = jQuery(e.target).serializeArray();
15        param.push({name: 'call', value: 'plugin_booking'});
16        param.push({name: 'id', value: JSINFO['id']});
17        param.push({name: 'do', value: 'book'});
18
19        $div.load(
20            DOKU_BASE + 'lib/exe/ajax.php',
21            param
22        );
23    }).on('click', '.cancel', function (e) {
24        e.preventDefault();
25        $div.load(
26            DOKU_BASE + 'lib/exe/ajax.php',
27            {
28                call: 'plugin_booking',
29                do: 'cancel',
30                id: JSINFO['id'],
31                at: e.target.href.split('#')[1],
32            }
33        );
34    });
35});
36
37