Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1408 from madhuracj/tracking
Tracking improvements. Implements rfe #1562
- Loading branch information
Showing
8 changed files
with
210 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/** | ||
* Unbind all event handlers before tearing down the page | ||
*/ | ||
AJAX.registerTeardown('db_tracking.js', function () { | ||
$('body').off('click', '#trackedForm.ajax button[name="submit_mult"], #trackedForm.ajax input[name="submit_mult"]'); | ||
$('body').off('click', '#untrackedForm.ajax button[name="submit_mult"], #untrackedForm.ajax input[name="submit_mult"]'); | ||
$('body').off('click', 'a.drop_tracking_anchor.ajax'); | ||
}); | ||
|
||
/** | ||
* Bind event handlers | ||
*/ | ||
AJAX.registerOnload('db_tracking.js', function () { | ||
|
||
/** | ||
* Handles multi submit for tracked tables | ||
*/ | ||
$('body').on('click', '#trackedForm.ajax button[name="submit_mult"], #trackedForm.ajax input[name="submit_mult"]', function (e) { | ||
e.preventDefault(); | ||
var $button = $(this); | ||
var $form = $button.parent('form'); | ||
var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true&submit_mult=' + $button.val(); | ||
|
||
if ($button.val() == 'drop_tracking') { | ||
var question = PMA_messages.strDeleteTrackingDataMultiple; | ||
$button.PMA_confirm(question, $form.attr('action'), function (url) { | ||
PMA_ajaxShowMessage(PMA_messages.strDeletingTrackingData); | ||
$.get(url, submitData, AJAX.responseHandler); | ||
}); | ||
} else { | ||
PMA_ajaxShowMessage(); | ||
$.get($form.attr('action'), submitData, AJAX.responseHandler); | ||
} | ||
}); | ||
|
||
/** | ||
* Handles multi submit for untracked tables | ||
*/ | ||
$('body').on('click', '#untrackedForm.ajax button[name="submit_mult"], #untrackedForm.ajax input[name="submit_mult"]', function (e) { | ||
e.preventDefault(); | ||
var $button = $(this); | ||
var $form = $button.parent('form'); | ||
var submitData = $form.serialize() + '&ajax_request=true&ajax_page_request=true&submit_mult=' + $button.val(); | ||
PMA_ajaxShowMessage(); | ||
$.get($form.attr('action'), submitData, AJAX.responseHandler); | ||
}); | ||
|
||
/** | ||
* Ajax Event handler for 'Drop tracking' | ||
*/ | ||
$('body').on('click', 'a.drop_tracking_anchor.ajax', function (e) { | ||
e.preventDefault(); | ||
var $anchor = $(this); | ||
var question = PMA_messages.strDeleteTrackingData; | ||
$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) { | ||
PMA_ajaxShowMessage(PMA_messages.strDeletingTrackingData); | ||
$.get(url, {'ajax_page_request': true, 'ajax_request': true}, AJAX.responseHandler); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.