The branch, master has been updated
via 9443d6efc2359ba104714fc8d29a4ab2f2ac0447 (commit)
via 8b72097fb0333b61da594fdf38361318c360333d (commit)
via 3be186360686d07efa34c005248097914a8eced1 (commit)
from f328f6d4a933cb4b0d0328687c214f809a919749 (commit)
- Log -----------------------------------------------------------------
commit 9443d6efc2359ba104714fc8d29a4ab2f2ac0447
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sat Feb 5 07:57:30 2011 -0500
Conditional Ajax on display Options
commit 8b72097fb0333b61da594fdf38361318c360333d
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sat Feb 5 07:46:27 2011 -0500
Unneeded wrapping of jQuery object
commit 3be186360686d07efa34c005248097914a8eced1
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sat Feb 5 07:34:56 2011 -0500
Conditional Ajax on sorting results
-----------------------------------------------------------------------
Summary of changes:
js/sql.js | 27 ++++++++++++++++++---------
libraries/display_tbl.lib.php | 12 ++++++++++--
2 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/js/sql.js b/js/sql.js
index f4fe708..593cbe7 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -269,6 +269,7 @@ $(document).ready(function() {
* @memberOf jQuery
* @name paginate_nav_button_click
* @uses PMA_ajaxShowMessage()
+ * @see $cfg['AjaxEnable']
*/
$("input[name=navig].ajax").live('click', function(event) {
/** @lends jQuery */
@@ -293,11 +294,11 @@ $(document).ready(function() {
* Paginate results with Page Selector dropdown
* @memberOf jQuery
* @name paginate_dropdown_change
+ * @see $cfg['AjaxEnable']
*/
$("#pageselector").live('change', function(event) {
var $the_form = $(this).parent("form");
- // see $cfg['AjaxEnable']
if ($(this).hasClass('ajax')) {
event.preventDefault();
@@ -317,15 +318,19 @@ $(document).ready(function() {
* Ajax Event handler for sorting the results table
* @memberOf jQuery
* @name table_results_sort_click
+ * @see $cfg['AjaxEnable']
*/
- $("#table_results").find("a[title=Sort]").live('click',
function(event) {
+
$("#table_results.ajax").find("a[title=Sort]").live('click',
function(event) {
event.preventDefault();
PMA_ajaxShowMessage();
- $.get($(this).attr('href'), $(this).serialize() +
'&ajax_request=true', function(data) {
- $("#sqlqueryresults").html(data);
- $("#sqlqueryresults").trigger('appendAnchor');
+ $anchor = $(this);
+
+ $.get($anchor.attr('href'), $anchor.serialize() +
'&ajax_request=true', function(data) {
+ $("#sqlqueryresults")
+ .html(data)
+ .trigger('appendAnchor');
}) // end $.get()
})//end Sort results table
@@ -333,13 +338,17 @@ $(document).ready(function() {
* Ajax Event handler for the display options
* @memberOf jQuery
* @name displayOptionsForm_submit
+ * @see $cfg['AjaxEnable']
*/
- $("#displayOptionsForm").live('submit', function(event) {
+ $("#displayOptionsForm.ajax").live('submit', function(event) {
event.preventDefault();
- $.post($(this).attr('action'), $(this).serialize() +
'&ajax_request=true' , function(data) {
- $("#sqlqueryresults").html(data);
- $("#sqlqueryresults").trigger('appendAnchor');
+ $form = $(this);
+
+ $.post($form.attr('action'), $form.serialize() +
'&ajax_request=true' , function(data) {
+ $("#sqlqueryresults")
+ .html(data)
+ .trigger('appendAnchor');
}) // end $.post()
})
//end displayOptionsForm handler
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 875cff2..7d0299c 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -540,7 +540,11 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta,
$fields_cnt = 0, $
// Display options (if we are not in print view)
if (! (isset($GLOBALS['printview']) && $GLOBALS['printview']
== '1')) {
- echo '<form method="post" action="sql.php"
name="displayOptionsForm" id="displayOptionsForm">';
+ echo '<form method="post" action="sql.php"
name="displayOptionsForm" id="displayOptionsForm"';
+ if ($GLOBALS['cfg']['AjaxEnable']) {
+ echo ' class="ajax" ';
+ }
+ echo '>';
$url_params = array(
'db' => $db,
'table' => $table,
@@ -623,7 +627,11 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta,
$fields_cnt = 0, $
echo '<input type="hidden" name="goto"
value="sql.php" />' . "\n";
}
- echo '<table id="table_results" class="data">' .
"\n";
+ echo '<table id="table_results" class="data';
+ if ($GLOBALS['cfg']['AjaxEnable']) {
+ echo ' ajax';
+ }
+ echo '">' . "\n";
if ($_SESSION['tmp_user_values']['disp_direction'] ==
'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] ==
'horizontalflipped') {
echo '<thead><tr>' . "\n";
hooks/post-receive
--
phpMyAdmin