2 * Unbind all event handlers before tearing down the page
4 AJAX.registerTeardown('tbl_tracking.js', function () {
5 $('body').off('click', '#versionsForm.ajax button[name="submit_mult"], #versionsForm.ajax input[name="submit_mult"]');
6 $('body').off('click', 'a.delete_version_anchor.ajax');
7 $('body').off('click', 'a.delete_entry_anchor.ajax');
13 AJAX.registerOnload('tbl_tracking.js', function () {
15 $('#versions tr:first th').append($('<div class="sorticon"></div>'));
16 $('#versions').tablesorter({
20 1: {sorter: "integer"},
26 if ($('#ddl_versions tbody tr').length > 0) {
27 $('#ddl_versions tr:first th').append($('<div class="sorticon"></div>'));
28 $('#ddl_versions').tablesorter({
31 0: {sorter: "integer"},
38 if ($('#dml_versions tbody tr').length > 0) {
39 $('#dml_versions tr:first th').append($('<div class="sorticon"></div>'));
40 $('#dml_versions').tablesorter({
43 0: {sorter: "integer"},
51 * Handles multi submit for tracking versions
53 $('body').on('click', '#versionsForm.ajax button[name="submit_mult"], #versionsForm.ajax input[name="submit_mult"]', function (e) {
55 var $button = $(this);
56 var $form = $button.parent('form');
57 var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true&submit_mult=' + $button.val();
59 if ($button.val() == 'delete_version') {
60 var question = PMA_messages.strDeleteTrackingVersionMultiple;
61 $button.PMA_confirm(question, $form.attr('action'), function (url) {
62 PMA_ajaxShowMessage();
64 $.post(url, submitData, AJAX.responseHandler);
67 PMA_ajaxShowMessage();
69 $.post($form.attr('action'), submitData, AJAX.responseHandler);
74 * Ajax Event handler for 'Delete version'
76 $('body').on('click', 'a.delete_version_anchor.ajax', function (e) {
78 var $anchor = $(this);
79 var question = PMA_messages.strDeleteTrackingVersion;
80 $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
81 PMA_ajaxShowMessage();
82 AJAX.source = $anchor;
84 'ajax_page_request': true,
86 'token': PMA_commonParams.get('token')
88 $.post(url, params, AJAX.responseHandler);
93 * Ajax Event handler for 'Delete tracking report entry'
95 $('body').on('click', 'a.delete_entry_anchor.ajax', function (e) {
97 var $anchor = $(this);
98 var question = PMA_messages.strDeletingTrackingEntry;
99 $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
100 PMA_ajaxShowMessage();
101 AJAX.source = $anchor;
103 'ajax_page_request': true,
104 'ajax_request': true,
105 'token': PMA_commonParams.get('token')
107 $.post(url, params, AJAX.responseHandler);