2 * Unbind all event handlers before tearing down a page
4 AJAX.registerTeardown('tbl_find_replace.js', function () {
5 $('#find_replace_form').off('submit');
6 $('#toggle_find').off('click');
12 AJAX.registerOnload('tbl_find_replace.js', function () {
13 $('<div id="toggle_find_div"><a id="toggle_find"></a></div>')
14 .insertAfter('#find_replace_form')
18 .html(PMA_messages.strHideFindNReplaceCriteria)
21 $('#find_replace_form').slideToggle();
22 if ($link.text() === PMA_messages.strHideFindNReplaceCriteria) {
23 $link.text(PMA_messages.strShowFindNReplaceCriteria);
25 $link.text(PMA_messages.strHideFindNReplaceCriteria);
30 $('#find_replace_form').submit(function (e) {
32 var findReplaceForm = $('#find_replace_form');
33 PMA_prepareForAjaxRequest(findReplaceForm);
34 var $msgbox = PMA_ajaxShowMessage();
35 $.post(findReplaceForm.attr('action'), findReplaceForm.serialize(), function (data) {
36 PMA_ajaxRemoveMessage($msgbox);
37 if (data.success === true) {
38 $('#toggle_find_div').show();
39 $('#toggle_find').click();
40 $('#sqlqueryresultsouter').html(data.preview);
42 $('#sqlqueryresultsouter').html(data.error);