You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-28 07:41:55 +03:00
Move inline JS to 'binded' JS.
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
This commit is contained in:
16
js/ajax.js
16
js/ajax.js
@@ -397,6 +397,15 @@ var AJAX = {
|
||||
$('<div/>', {id : 'pma_errors'})
|
||||
.insertAfter('#selflink')
|
||||
.append(data._errors);
|
||||
// bind for php error reporting forms (bottom)
|
||||
$("#pma_ignore_errors_bottom").bind("click",
|
||||
function() {
|
||||
PMA_ignorePhpErrors()
|
||||
});
|
||||
$("#pma_ignore_all_errors_bottom").bind("click",
|
||||
function() {
|
||||
PMA_ignorePhpErrors(false)
|
||||
});
|
||||
// In case of 'sendErrorReport'='always'
|
||||
// submit the hidden error reporting form.
|
||||
if (data._sendErrorAlways == '1'
|
||||
@@ -412,6 +421,13 @@ var AJAX = {
|
||||
}
|
||||
}
|
||||
PMA_ajaxShowMessage(msg, false);
|
||||
// bind for php error reporting forms (popup)
|
||||
$("#pma_ignore_errors_popup").bind("click", function() {
|
||||
PMA_ignorePhpErrors()
|
||||
});
|
||||
$("#pma_ignore_all_errors_popup").bind("click", function() {
|
||||
PMA_ignorePhpErrors(false)
|
||||
});
|
||||
|
||||
if (typeof AJAX._callback === 'function') {
|
||||
AJAX._callback.call();
|
||||
|
||||
@@ -430,12 +430,12 @@ $js_messages['phpErrorsFound'] = '<div class="error">'
|
||||
. __('Warning: Some errors have been detected on the server!!')
|
||||
. '<div>'
|
||||
. __('Please look at the bottom of this window.')
|
||||
. '<input type="submit" value="'
|
||||
. '<input id="pma_ignore_errors_popup" type="submit" value="'
|
||||
. __('Ignore')
|
||||
. '" onclick="PMA_ignorePhpErrors()" style="float: right; margin: 20px;">'
|
||||
. '<input type="submit" value="'
|
||||
. '" style="float: right; margin: 20px;">'
|
||||
. '<input id="pma_ignore_all_errors_popup" type="submit" value="'
|
||||
. __('Ignore All')
|
||||
. '" onclick="PMA_ignorePhpErrors(false)" style="float: right; margin: 20px;">'
|
||||
. '" style="float: right; margin: 20px;">'
|
||||
. '</div></div>';
|
||||
|
||||
$js_messages['phpErrorsBeingSubmitted'] = '<div class="error">'
|
||||
|
||||
@@ -338,14 +338,12 @@ class PMA_Error_Handler
|
||||
// add ignore buttons
|
||||
$retval .= '<input type="submit" value="'
|
||||
. __('Ignore')
|
||||
. '" id="pma_ignore_errors"'
|
||||
. ' onclick="PMA_ignorePhpErrors(true)"'
|
||||
. '" id="pma_ignore_errors_bottom"'
|
||||
. ' style="float: right; margin: 20px;">';
|
||||
}
|
||||
$retval .= '<input type="submit" value="'
|
||||
. __('Ignore All')
|
||||
. '" id="pma_ignore_all_errors"'
|
||||
. ' onclick="PMA_ignorePhpErrors(false)"'
|
||||
. '" id="pma_ignore_all_errors_bottom"'
|
||||
. ' style="float: right; margin: 20px;">';
|
||||
}
|
||||
return $retval;
|
||||
@@ -527,9 +525,21 @@ class PMA_Error_Handler
|
||||
} elseif ($GLOBALS['cfg']['SendErrorReports'] == 'ask') {
|
||||
//ask user whether to submit errors or not.
|
||||
if (!$response->isAjax()) {
|
||||
// js code to show appropriate msgs & focusing,
|
||||
// js code to show appropriate msgs, event binding & focusing.
|
||||
$jsCode = 'PMA_ajaxShowMessage(PMA_messages["phpErrorsFound"], '
|
||||
. ' 2000);'
|
||||
. '$("#pma_ignore_errors_popup").bind("click", function() {
|
||||
PMA_ignorePhpErrors()
|
||||
});'
|
||||
. '$("#pma_ignore_all_errors_popup").bind("click", function() {
|
||||
PMA_ignorePhpErrors(false)
|
||||
});'
|
||||
. '$("#pma_ignore_errors_bottom").bind("click", function() {
|
||||
PMA_ignorePhpErrors()
|
||||
});'
|
||||
. '$("#pma_ignore_all_errors_bottom").bind("click", function() {
|
||||
PMA_ignorePhpErrors(false)
|
||||
});'
|
||||
. '$("html, body").animate({
|
||||
scrollTop:$(document).height()
|
||||
}, "slow");';
|
||||
|
||||
Reference in New Issue
Block a user