Removed inline coding for Drop Trigger in libraries/tbl_triggers.lib.php

This commit is contained in:
ninadsp
2010-07-11 23:36:24 +05:30
parent dd58a5bc23
commit fe9f539ed2
2 changed files with 34 additions and 2 deletions

View File

@@ -1929,4 +1929,36 @@ $(document).ready(function() {
}) // end $.get }) // end $.get
}) })
}) })
}); //end $(document).ready() for libraries/tbl_links.inc.php }); //end $(document).ready() for libraries/tbl_links.inc.php
/**
* jQuery coding for Drop Trigger. Used on tbl_structure.php
*/
$(document).ready(function() {
$(".drop_trigger_anchor").live('click', function(event) {
event.preventDefault();
var curr_row = $(this).parents('tr');
var question = 'DROP TRIGGER IF EXISTS `' + $(curr_row).children('td:first').text() + '`';
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
$.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function(data) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
$("#topmenucontainer")
.next('div')
.remove()
.end()
.after(data.sql_query);
$(curr_row).hide("medium").remove();
}
else {
PMA_ajaxShowMessage(data.error);
}
}) // end $.get
})
})
}); //end $(document).ready() for Drop Trigger

View File

@@ -42,7 +42,7 @@ if ($triggers) {
($ct%2 == 0) ? 'even' : 'odd', ($ct%2 == 0) ? 'even' : 'odd',
$trigger['name'], $trigger['name'],
PMA_linkOrButton('tbl_sql.php?' . $url_query . '&sql_query=' . urlencode($drop_and_create) . '&show_query=1&delimiter=' . urlencode($delimiter), $titles['Change']), PMA_linkOrButton('tbl_sql.php?' . $url_query . '&sql_query=' . urlencode($drop_and_create) . '&show_query=1&delimiter=' . urlencode($delimiter), $titles['Change']),
'<a href="sql.php?' . $url_query . '&sql_query=' . urlencode($trigger['drop']) . '" onclick="return confirmLink(this, \'' . PMA_jsFormat($trigger['drop'], false) . '\')">' . $titles['Drop'] . '</a>', '<a class="drop_trigger_anchor" href="sql.php?' . $url_query . '&sql_query=' . urlencode($trigger['drop']) . '" >' . $titles['Drop'] . '</a>',
$trigger['action_timing'], $trigger['action_timing'],
$trigger['event_manipulation']); $trigger['event_manipulation']);
$ct++; $ct++;