Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Error message with no response from server in AJAX

  • Loading branch information...
commit ed25431f3cdd73fddff8048214507997f60f271c 1 parent 6b3e3c2
@vrana authored
View
1  adminer/include/design.inc.php
@@ -28,6 +28,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css">
<script type="text/javascript">
var areYouSure = '<?php echo lang('Resend POST data?'); ?>';
+var noResponse = '<?php echo lang('No response from server.'); ?>';
</script>
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>
View
1  adminer/lang/cs.inc.php
@@ -279,6 +279,7 @@
// reload confirmation in AJAX
'Resend POST data?' => 'Znovu odeslat POST data?',
+ 'No response from server.' => 'Server neodpověděl.',
'Editor' => 'Editor',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
View
66 adminer/static/functions.js
@@ -335,43 +335,39 @@ function ajaxSend(url, data, popState, noscroll) {
if (originalFavicon) {
replaceFavicon(originalFavicon);
}
- if (!xmlhttp.status) {
- setHtml('loader', '');
- } else {
- if (!popState) {
- if (data || url != location.href) {
- history.pushState(data, '', url); //! remember window position
- }
- }
- if (!noscroll && !/&order/.test(url)) {
- scrollTo(0, 0);
- }
- setHtml('content', xmlhttp.responseText);
- var content = document.getElementById('content');
- var scripts = content.getElementsByTagName('script');
- var length = scripts.length; // required to avoid infinite loop
- for (var i=0; i < length; i++) {
- var script = document.createElement('script');
- script.text = scripts[i].text;
- content.appendChild(script);
- }
-
- var as = document.getElementById('menu').getElementsByTagName('a');
- var href = location.href.replace(/(&(sql=|dump=|(select|table)=[^&]*)).*/, '$1');
- for (var i=0; i < as.length; i++) {
- as[i].className = (href == as[i].href ? 'active' : '');
- }
- var dump = document.getElementById('dump');
- if (dump) {
- var match = /&(select|table)=([^&]+)/.exec(href);
- dump.href = dump.href.replace(/[^=]+$/, '') + (match ? match[2] : '');
- }
- //! modify Change database hidden fields
-
- if (window.jush) {
- jush.highlight_tag('code', 0);
+ if (!popState) {
+ if (data || url != location.href) {
+ history.pushState(data, '', url); //! remember window position
}
}
+ if (!noscroll && !/&order/.test(url)) {
+ scrollTo(0, 0);
+ }
+ setHtml('content', (xmlhttp.status ? xmlhttp.responseText : '<p class="error">' + noResponse));
+ var content = document.getElementById('content');
+ var scripts = content.getElementsByTagName('script');
+ var length = scripts.length; // required to avoid infinite loop
+ for (var i=0; i < length; i++) {
+ var script = document.createElement('script');
+ script.text = scripts[i].text;
+ content.appendChild(script);
+ }
+
+ var as = document.getElementById('menu').getElementsByTagName('a');
+ var href = location.href.replace(/(&(sql=|dump=|(select|table)=[^&]*)).*/, '$1');
+ for (var i=0; i < as.length; i++) {
+ as[i].className = (href == as[i].href ? 'active' : '');
+ }
+ var dump = document.getElementById('dump');
+ if (dump) {
+ var match = /&(select|table)=([^&]+)/.exec(href);
+ dump.href = dump.href.replace(/[^=]+$/, '') + (match ? match[2] : '');
+ }
+ //! modify Change database hidden fields
+
+ if (window.jush) {
+ jush.highlight_tag('code', 0);
+ }
}
}, data);
}
View
1  changes.txt
@@ -4,6 +4,7 @@ Fix minor parser bug in SQL command with webserver file
Ctrl+click on button opens form to blank window
SET DEFAULT foreign key action
Trim table and column names (bug #3405309)
+Error message with no response from server in AJAX
PostgreSQL: fix alter foreign key
PostgreSQL over PDO: connect if the eponymous database does not exist (bug #3391619)
Boolean search (Editor)
Please sign in to comment.
Something went wrong with that request. Please try again.