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;
83 $.get(url, {'ajax_page_request': true, 'ajax_request': true}, AJAX.responseHandler);
88 * Ajax Event handler for 'Delete tracking report entry'
90 $('body').on('click', 'a.delete_entry_anchor.ajax', function (e) {
92 var $anchor = $(this);
93 var question = PMA_messages.strDeletingTrackingEntry;
94 $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
95 PMA_ajaxShowMessage();
96 AJAX.source = $anchor;
97 $.get(url, {'ajax_page_request': true, 'ajax_request': true}, AJAX.responseHandler);