2 * Unbind all event handlers before tearing down the page
4 AJAX.registerTeardown('db_tracking.js', function () {
5 $('body').off('click', '#trackedForm.ajax button[name="submit_mult"], #trackedForm.ajax input[name="submit_mult"]');
6 $('body').off('click', '#untrackedForm.ajax button[name="submit_mult"], #untrackedForm.ajax input[name="submit_mult"]');
7 $('body').off('click', 'a.delete_tracking_anchor.ajax');
13 AJAX.registerOnload('db_tracking.js', function () {
15 $('#versions tr:first th').append($('<div class="sorticon"></div>'));
16 $('#versions').tablesorter({
20 2: {sorter: "integer"},
27 $('#noversions tr:first th').append($('<div class="sorticon"></div>'));
28 $('#noversions').tablesorter({
37 * Handles multi submit for tracked tables
39 $('body').on('click', '#trackedForm.ajax button[name="submit_mult"], #trackedForm.ajax input[name="submit_mult"]', function (e) {
41 var $button = $(this);
42 var $form = $button.parent('form');
43 var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true&submit_mult=' + $button.val();
45 if ($button.val() == 'delete_tracking') {
46 var question = PMA_messages.strDeleteTrackingDataMultiple;
47 $button.PMA_confirm(question, $form.attr('action'), function (url) {
48 PMA_ajaxShowMessage(PMA_messages.strDeletingTrackingData);
50 $.post(url, submitData, AJAX.responseHandler);
53 PMA_ajaxShowMessage();
55 $.post($form.attr('action'), submitData, AJAX.responseHandler);
60 * Handles multi submit for untracked tables
62 $('body').on('click', '#untrackedForm.ajax button[name="submit_mult"], #untrackedForm.ajax input[name="submit_mult"]', function (e) {
64 var $button = $(this);
65 var $form = $button.parent('form');
66 var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true&submit_mult=' + $button.val();
67 PMA_ajaxShowMessage();
69 $.post($form.attr('action'), submitData, AJAX.responseHandler);
73 * Ajax Event handler for 'Delete tracking'
75 $('body').on('click', 'a.delete_tracking_anchor.ajax', function (e) {
77 var $anchor = $(this);
78 var question = PMA_messages.strDeleteTrackingData;
79 $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
80 PMA_ajaxShowMessage(PMA_messages.strDeletingTrackingData);
81 AJAX.source = $anchor;
82 $.get(url, {'ajax_page_request': true, 'ajax_request': true}, AJAX.responseHandler);