Permalink
Browse files

Don't use AJAX links and forms

  • Loading branch information...
1 parent bf54c13 commit 4815c7d02008c5ed63b8dd86bed3d79267f72212 @vrana vrana committed Apr 16, 2012
@@ -18,7 +18,6 @@
case "up.gif": echo base64_decode("compile_file('../adminer/static/up.gif', 'base64_encode');"); break;
case "down.gif": echo base64_decode("compile_file('../adminer/static/down.gif', 'base64_encode');"); break;
case "arrow.gif": echo base64_decode("compile_file('../adminer/static/arrow.gif', 'base64_encode');"); break;
- case "loader.gif": echo base64_decode("compile_file('../adminer/static/loader.gif', 'base64_encode');"); break;
}
}
exit;
@@ -51,7 +51,7 @@
<p>
<?php if ($row["db"] == "" && $row["ns"] == "") { ?>
<?php echo lang('Target table'); ?>:
-<?php echo html_select("table", $referencable, $row["table"], "this.form['change-js'].value = '1'; if (!ajaxForm(this.form)) this.form.submit();"); ?>
+<?php echo html_select("table", $referencable, $row["table"], "this.form['change-js'].value = '1'; this.form.submit();"); ?>
<input type="hidden" name="change-js" value="">
<noscript><p><input type="submit" name="change" value="<?php echo lang('Change'); ?>"></noscript>
<table cellspacing="0">
@@ -16,21 +16,14 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "", $
}
$title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
$title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
- if (is_ajax()) {
- header("X-AJAX-Title: " . rawurlencode($title_page));
- } else {
- ?>
+ ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="robots" content="noindex">
<title><?php echo $title_page; ?></title>
<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>
<?php if ($adminer->head()) { ?>
@@ -41,15 +34,13 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "", $
<?php } ?>
<?php echo $head; ?>
-<body class="<?php echo lang('ltr'); ?> nojs"<?php echo ($_POST ? "" : " onclick=\"return bodyClick(event, '" . h(js_escape(DB) . "', '" . js_escape($_GET["ns"])) . "');\""); // avoid re-post confirmation after refreshing the next page in Google Chrome ?> onkeydown="bodyKeydown(event);" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion();"); ?>">
+<body class="<?php echo lang('ltr'); ?> nojs" onkeydown="bodyKeydown(event);" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion();"); ?>">
<script type="text/javascript">
document.body.className = document.body.className.replace(/ nojs/, ' js');
</script>
-<div id="loader"><img src="../adminer/static/loader.gif" alt=""></div>
<div id="content">
<?php
- }
if (isset($breadcrumb)) {
$link = substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1);
echo '<p id="breadcrumb"><a href="' . h($link ? $link : ".") . '">' . $drivers[DRIVER] . '</a> &raquo; ';
@@ -100,14 +91,12 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "", $
*/
function page_footer($missing = "") {
global $adminer;
- if (!is_ajax()) {
- ?>
+ ?>
</div>
<?php switch_lang(); ?>
<div id="menu">
<?php $adminer->navigation($missing); ?>
</div>
<?php
- }
}
@@ -452,7 +452,7 @@ function redirect($location, $message = null) {
if ($location == "") {
$location = ".";
}
- header((is_ajax() ? "X-AJAX-Redirect" : "Location") . ": $location");
+ header("Location: $location");
exit;
}
}
@@ -268,6 +268,5 @@
'Copy' => 'نسخ',
'Permanent link' => 'وصلة دائمة',
'Edit all' => 'تعديل الكل',
- 'Resend POST data?' => 'هل تود إعادة إرسال بيانات POST ؟',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -268,6 +268,5 @@
'Copy' => 'Còpia',
'Permanent link' => 'Enllaç permanent',
'Edit all' => 'Edita-ho tot',
- 'Resend POST data?' => 'Torna a enviar les dades POST?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -278,10 +278,6 @@
'Geometry' => 'Geometrie',
'Relations' => 'Vztahy',
- // 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
'$1-$3-$5' => '$6.$4.$1',
@@ -268,6 +268,5 @@
'Copy' => 'Kopieren',
'Permanent link' => 'Dauerhafter Link',
'Edit all' => 'Alle ändern',
- 'Resend POST data?' => 'POST data noch einmal senden ?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -268,6 +268,5 @@
'Copy' => 'Copiar',
'Permanent link' => 'Enlace permanente',
'Edit all' => 'Editar todos',
- 'Resend POST data?' => 'Volver a enviar POST data?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -268,6 +268,5 @@
'Copy' => 'Kopeeri',
'Permanent link' => 'Püsilink',
'Edit all' => 'Muuda kõiki',
- 'Resend POST data?' => 'Saada POST andmed uuesti?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -277,9 +277,6 @@
'Geometry' => 'هندسه',
'Relations' => 'رابطه ها',
- // reload confirmation in AJAX
- 'Resend POST data?' => 'ارسال مجدد داده ها؟',
-
'Editor' => 'ویرایشگر',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$1-$3-$5',
@@ -268,6 +268,5 @@
'Copy' => 'Copier',
'Permanent link' => 'Lien permanent',
'Edit all' => 'Tout modifier',
- 'Resend POST data?' => 'Renvoyer les données POST ?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -268,6 +268,5 @@
'Copy' => 'Másolás',
'Permanent link' => 'Hivatkozás',
'Edit all' => 'Összes szerkesztése',
- 'Resend POST data?' => 'Újraküldi a POST adatokat?',
'HH:MM:SS' => 'óó:pp:mm',
);
@@ -268,6 +268,5 @@
'Copy' => 'Copia',
'Permanent link' => 'Link permanente',
'Edit all' => 'Modifica tutto',
- 'Resend POST data?' => 'Reinvio i dati POST?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -268,6 +268,5 @@
'Copy' => 'コピー',
'Permanent link' => 'パーマネントリンク',
'Edit all' => 'すべて編集',
- 'Resend POST data?' => '再送信しますか?',
'HH:MM:SS' => '時:分:秒',
);
@@ -277,9 +277,6 @@
'Geometry' => 'Geometrija',
'Relations' => 'Ryšiai',
- // reload confirmation in AJAX
- 'Resend POST data?' => 'Persiųsti POST duomenis?',
-
'Editor' => 'Redaktorius',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$1-$3-$5',
@@ -268,6 +268,5 @@
'Copy' => 'Kopieren',
'Permanent link' => 'Permanente link',
'Edit all' => 'Alles bewerken',
- 'Resend POST data?' => 'POST data opnieuw verzenden',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -278,10 +278,6 @@
'Geometry' => 'Geometria',
'Relations' => 'Relacje',
- // reload confirmation in AJAX
- 'Resend POST data?' => 'Wysłać dane ponownie?',
- 'No response from server.' => 'Brak odpowiedzi od serwera.',
-
'Editor' => 'Edytor',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$6.$4.$1',
@@ -268,6 +268,5 @@
'Copy' => 'Copiază',
'Permanent link' => 'Adresă permanentă',
'Edit all' => 'Editează tot',
- 'Resend POST data?' => 'Retrimite datele POST?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -268,6 +268,5 @@
'Copy' => 'Копировать',
'Permanent link' => 'Постоянная ссылка',
'Edit all' => 'Редактировать всё',
- 'Resend POST data?' => 'Еще раз послать данные POST запроса?',
'HH:MM:SS' => 'ЧЧ:ММ:СС',
);
@@ -268,6 +268,5 @@
'Copy' => 'Kopírovať',
'Permanent link' => 'Permanentný odkaz',
'Edit all' => 'Upraviť všetko',
- 'Resend POST data?' => 'Znovu poslať POST data?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -268,6 +268,5 @@
'Copy' => 'நகல்',
'Permanent link' => 'நிரந்தர இணைப்பு',
'Edit all' => 'அனைத்தையும் தொகு',
- 'Resend POST data?' => 'POST data வை மீண்டும் அனுப்பவா?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -278,10 +278,6 @@
'Geometry' => 'Геометрія',
'Relations' => 'Зв\'язки',
- // reload confirmation in AJAX
- 'Resend POST data?' => 'Ще раз надіслати POST-запит?',
- 'No response from server.' => 'Нема відповіді від сервера.',
-
'Editor' => 'Редактор',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$5.$3.$1',
@@ -278,10 +278,6 @@
'Geometry' => 'xx',
'Relations' => 'xx',
- // reload confirmation in AJAX
- 'Resend POST data?' => 'xx',
- 'No response from server.' => 'xx',
-
'Editor' => 'xx',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => 'xx',
@@ -268,6 +268,5 @@
'Copy' => '複製',
'Permanent link' => '永久鏈接',
'Edit all' => '編輯全部',
- 'Resend POST data?' => '重新發送表單資料?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -268,6 +268,5 @@
'Copy' => '复制',
'Permanent link' => '固定链接',
'Edit all' => '编辑全部',
- 'Resend POST data?' => '重新发送 POST 数据?',
'HH:MM:SS' => 'HH:MM:SS',
);
@@ -377,7 +377,7 @@
$found_rows = found_rows($table_status, $where);
if ($found_rows < max(1e4, 2 * ($page + 1) * $limit)) {
// slow with big tables
- ob_flush(); //! doesn't work with AJAX
+ ob_flush();
flush();
$found_rows = $connection->result("SELECT COUNT(*) FROM " . table($TABLE) . ($where ? " WHERE " . implode(" AND ", $where) : ""));
} else {
@@ -20,8 +20,6 @@ code { background: #eee; }
tbody tr:hover td, tbody tr:hover th { background: #eee; }
pre { margin: 1em 0 0; }
input[type=image] { vertical-align: middle; }
-.loading, .loading input { cursor: progress; }
-.loading #loader { display: inline; }
.version { color: #777; font-size: 67%; }
.js .hidden, .nojs .jsonly { display: none; }
.nowrap td, .nowrap th, td.nowrap { white-space: pre; }
@@ -49,7 +47,6 @@ input[type=image] { vertical-align: middle; }
#content { margin: 2em 0 0 21em; padding: 10px 20px 20px 0; }
#lang { position: absolute; top: 0; left: 0; line-height: 1.8em; padding: .3em 1em; }
#breadcrumb { white-space: nowrap; position: absolute; top: 0; left: 21em; background: #eee; height: 2em; line-height: 1.8em; padding: 0 1em; margin: 0 0 0 -18px; }
-#loader { display: none; position: fixed; top: 2px; right: 2px; z-index: 1; }
#h1 { color: #777; text-decoration: none; font-style: italic; }
#version { font-size: 67%; color: red; }
#schema { margin-left: 60px; position: relative; -moz-user-select: none; -webkit-user-select: none; }
@@ -6,9 +6,6 @@ var jushRoot = '../externals/jush/'; // global variable to allow simple customiz
* @param string first three characters of database system version
*/
function bodyLoad(version) {
- if (history.state !== undefined) { // copied from editor/static/editing.js
- onpopstate(history);
- }
if (jushRoot) {
var script = document.createElement('script');
script.src = jushRoot + 'jush.js';
Oops, something went wrong. Retry.

0 comments on commit 4815c7d

Please sign in to comment.