Git
Threads by month
- ----- 2025 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
August 2011
- 8 participants
- 476 discussions

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15022-g75eed8e
by Michal Čihař 15 Aug '11
by Michal Čihař 15 Aug '11
15 Aug '11
The branch, master has been updated
via 75eed8e9aa2d2dfc80c0d23997a908e3eba4f3ea (commit)
from d4049610ee2bfe1909705b9983df3b9e290ff4dc (commit)
- Log -----------------------------------------------------------------
commit 75eed8e9aa2d2dfc80c0d23997a908e3eba4f3ea
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:47:46 2011 +0200
Escape html tags
-----------------------------------------------------------------------
Summary of changes:
server_status.php | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/server_status.php b/server_status.php
index fdc2abd..51d08e0 100644
--- a/server_status.php
+++ b/server_status.php
@@ -1383,15 +1383,15 @@ function printVariablesTable()
}
}
if ('%' === substr($name, -1, 1)) {
- echo PMA_formatNumber($value, 0, 2) . ' %';
+ echo htmlspecialchars(PMA_formatNumber($value, 0, 2)) . ' %';
} elseif (strpos($name, 'Uptime')!==FALSE) {
- echo PMA_timespanFormat($value);
+ echo htmlspecialchars(PMA_timespanFormat($value));
} elseif (is_numeric($value) && $value == (int) $value && $value > 1000) {
- echo PMA_formatNumber($value, 3, 1);
+ echo htmlspecialchars(PMA_formatNumber($value, 3, 1));
} elseif (is_numeric($value) && $value == (int) $value) {
- echo PMA_formatNumber($value, 3, 0);
+ echo htmlspecialchars(PMA_formatNumber($value, 3, 0));
} elseif (is_numeric($value)) {
- echo PMA_formatNumber($value, 3, 1);
+ echo htmlspecialchars(PMA_formatNumber($value, 3, 1));
} else {
echo htmlspecialchars($value);
}
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15021-gd404961
by Michal Čihař 15 Aug '11
by Michal Čihař 15 Aug '11
15 Aug '11
The branch, master has been updated
via d4049610ee2bfe1909705b9983df3b9e290ff4dc (commit)
from 3d57df57bd21bf9baa75aaa8e8c7b50145a4777b (commit)
- Log -----------------------------------------------------------------
commit d4049610ee2bfe1909705b9983df3b9e290ff4dc
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:46:58 2011 +0200
Fix trailing tags
-----------------------------------------------------------------------
Summary of changes:
server_status.php | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/server_status.php b/server_status.php
index f52f3a6..fdc2abd 100644
--- a/server_status.php
+++ b/server_status.php
@@ -744,7 +744,7 @@ echo __('Runtime Information');
<input name="filterText" type="text" id="filterText" style="vertical-align: baseline;" />
</div>
<div class="formelement">
- <input type="checkbox" name="filterAlert" id="filterAlert">
+ <input type="checkbox" name="filterAlert" id="filterAlert" />
<label for="filterAlert"><?php echo __('Show only alert values'); ?></label>
</div>
<div class="formelement">
@@ -761,7 +761,7 @@ echo __('Runtime Information');
</select>
</div>
<div class="formelement">
- <input type="checkbox" name="dontFormat" id="dontFormat">
+ <input type="checkbox" name="dontFormat" id="dontFormat" />
<label for="dontFormat"><?php echo __('Show unformatted values'); ?></label>
</div>
</fieldset>
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15020-g3d57df5
by Michal Čihař 15 Aug '11
by Michal Čihař 15 Aug '11
15 Aug '11
The branch, master has been updated
via 3d57df57bd21bf9baa75aaa8e8c7b50145a4777b (commit)
from 36775d227737e71f48d4b91433229fa91f1ba6d8 (commit)
- Log -----------------------------------------------------------------
commit 3d57df57bd21bf9baa75aaa8e8c7b50145a4777b
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:44:39 2011 +0200
More fixups
-----------------------------------------------------------------------
Summary of changes:
server_status.php | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/server_status.php b/server_status.php
index 24a0846..f52f3a6 100644
--- a/server_status.php
+++ b/server_status.php
@@ -1490,7 +1490,7 @@ function printMonitor()
<?php echo __('The phpMyAdmin Monitor can assist you in optimizing the server configuration and track down time intensive queries. For the latter you will need to set log_output to \'TABLE\' and have either the slow_query_log or general_log enabled. Note however, that the general_log produces a lot of data and increases server load by up to 15%'); ?>
<?php if(PMA_MYSQL_INT_VERSION < 50106) { ?>
<p>
- <img class="icon ic_s_attention" src="themes/dot.gif" alt="">
+ <img class="icon ic_s_attention" src="themes/dot.gif" alt="" />
<?php
echo __('Unfortunately your Database server does not support logging to table, which is a requirement for analyzing the database logs with phpMyAdmin. Logging to table is supported by MySQL 5.1.6 and onwards. You may still use the server charting features however.');
?>
@@ -1513,7 +1513,7 @@ function printMonitor()
echo '</p>';
?>
<p>
- <img class="icon ic_s_attention" src="themes/dot.gif" alt="">
+ <img class="icon ic_s_attention" src="themes/dot.gif" alt="" />
<?php
echo '<strong>';
echo __('Please note:');
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15019-g36775d2
by Michal Čihař 15 Aug '11
by Michal Čihař 15 Aug '11
15 Aug '11
The branch, master has been updated
via 36775d227737e71f48d4b91433229fa91f1ba6d8 (commit)
from e195d7cb41c2a02c9affcd008cb50efdd167a78e (commit)
- Log -----------------------------------------------------------------
commit 36775d227737e71f48d4b91433229fa91f1ba6d8
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:37:34 2011 +0200
Fixup <img> tags
-----------------------------------------------------------------------
Summary of changes:
server_status.php | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/server_status.php b/server_status.php
index 4590812..24a0846 100644
--- a/server_status.php
+++ b/server_status.php
@@ -1456,7 +1456,7 @@ function printMonitor()
<img src="themes/dot.gif" class="icon ic_b_chart" alt="" />
<?php echo __('Add chart'); ?>
</a>
- <a href="#rearrangeCharts"><img class="icon ic_b_tblops" src="themes/dot.gif" width="16" height="16" alt=""> <?php echo __('Rearrange/edit charts'); ?></a>
+ <a href="#rearrangeCharts"><img class="icon ic_b_tblops" src="themes/dot.gif" width="16" height="16" alt="" /><?php echo __('Rearrange/edit charts'); ?></a>
<div class="clearfloat paddingtop"></div>
<div class="floatleft">
<?php
@@ -1499,7 +1499,7 @@ function printMonitor()
} else {
?>
<p></p>
- <img class="ajaxIcon" src="<?php echo $GLOBALS['pmaThemeImage']; ?>ajax_clock_small.gif" alt="Loading">
+ <img class="ajaxIcon" src="<?php echo $GLOBALS['pmaThemeImage']; ?>ajax_clock_small.gif" alt="Loading" />
<div class="ajaxContent"></div>
<div class="monitorUse" style="display:none;">
<p></p>
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15018-ge195d7c
by Michal Čihař 15 Aug '11
by Michal Čihař 15 Aug '11
15 Aug '11
The branch, master has been updated
via e195d7cb41c2a02c9affcd008cb50efdd167a78e (commit)
via 0c16e0fcb5f264da8db3f76e468dbd04543fc9f1 (commit)
from ee69f251fdead1f8cbe85bb47eeab7abe77848e0 (commit)
- Log -----------------------------------------------------------------
commit e195d7cb41c2a02c9affcd008cb50efdd167a78e
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:35:37 2011 +0200
Escape possible < coming from PMA_formatNumber
commit 0c16e0fcb5f264da8db3f76e468dbd04543fc9f1
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:34:50 2011 +0200
Missing tag
-----------------------------------------------------------------------
Summary of changes:
server_status.php | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/server_status.php b/server_status.php
index 1695e99..4590812 100644
--- a/server_status.php
+++ b/server_status.php
@@ -874,6 +874,7 @@ function printQueryStatistics()
/* l10n: # = Amount of queries */
echo __('#');
?>
+ </th>
<th>ø <?php echo __('per hour'); ?></th>
<th>%</th>
</tr>
@@ -899,11 +900,11 @@ function printQueryStatistics()
?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
<th class="name"><?php echo htmlspecialchars($name); ?></th>
- <td class="value"><?php echo PMA_formatNumber($value, 5, 0, true); ?></td>
+ <td class="value"><?php echo htmlspecialchars(PMA_formatNumber($value, 5, 0, true)); ?></td>
<td class="value"><?php echo
- PMA_formatNumber($value * $hour_factor, 4, 1, true); ?></td>
+ htmlspecialchars(PMA_formatNumber($value * $hour_factor, 4, 1, true)); ?></td>
<td class="value"><?php echo
- PMA_formatNumber($value * $perc_factor, 0, 2); ?>%</td>
+ htmlspecialchars(PMA_formatNumber($value * $perc_factor, 0, 2)); ?>%</td>
</tr>
<?php
}
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15016-gee69f25
by Michal Čihař 15 Aug '11
by Michal Čihař 15 Aug '11
15 Aug '11
The branch, master has been updated
via ee69f251fdead1f8cbe85bb47eeab7abe77848e0 (commit)
from 3538fd83c27930d20e42e9d70664aab478c828aa (commit)
- Log -----------------------------------------------------------------
commit ee69f251fdead1f8cbe85bb47eeab7abe77848e0
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:33:57 2011 +0200
Fix HTML tags
-----------------------------------------------------------------------
Summary of changes:
server_status.php | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/server_status.php b/server_status.php
index 1add0b6..1695e99 100644
--- a/server_status.php
+++ b/server_status.php
@@ -836,16 +836,16 @@ function printQueryStatistics()
echo sprintf(__('Questions since startup: %s'), PMA_formatNumber($total_queries, 0)) . ' ';
echo PMA_showMySQLDocu('server-status-variables', 'server-status-variables', false, 'statvar_Questions');
?>
- <br>
+ <br />
<span>
<?php
echo 'ø ' . __('per hour') . ': ';
echo PMA_formatNumber($total_queries * $hour_factor, 0);
- echo '<br>';
+ echo '<br />';
echo 'ø ' . __('per minute') . ': ';
echo PMA_formatNumber( $total_queries * 60 / $server_status['Uptime'], 0);
- echo '<br>';
+ echo '<br />';
if ($total_queries / $server_status['Uptime'] >= 1) {
echo 'ø ' . __('per second') . ': ';
@@ -1461,7 +1461,7 @@ function printMonitor()
<?php
echo __('Refresh rate') . '<br />';
refreshList('gridChartRefresh', 5, Array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200));
- ?><br>
+ ?><br />
</div>
<div class="floatleft">
<?php echo __('Chart columns'); ?> <br />
@@ -1536,7 +1536,7 @@ function printMonitor()
<input type="radio" name="chartType" value="variable" id="chartStatusVar" checked="checked">
<label for="chartStatusVar"><?php echo __('Status variable(s)'); ?></label><br/>
<div id="chartVariableSettings">
- <label for="chartSeries"><?php echo __('Select series:'); ?></label><br>
+ <label for="chartSeries"><?php echo __('Select series:'); ?></label><br />
<select id="chartSeries" name="varChartList" size="1">
<option><?php echo __('Commonly monitored'); ?></option>
<option>Processes</option>
@@ -1552,18 +1552,18 @@ function printMonitor()
<option>Open_tables</option>
<option>Select_full_join</option>
<option>Slow_queries</option>
- </select><br>
+ </select><br />
<label for="variableInput"><?php echo __('or type variable name:'); ?> </label>
<input type="text" name="variableInput" id="variableInput" />
<p></p>
<input type="checkbox" name="differentialValue" id="differentialValue" value="differential" checked="checked" />
- <label for="differentialValue"><?php echo __('Display as differential value'); ?></label><br>
+ <label for="differentialValue"><?php echo __('Display as differential value'); ?></label><br />
<input type="checkbox" id="useDivisor" name="useDivisor" value="1" />
<label for="useDivisor"><?php echo __('Apply a divisor'); ?></label>
<span class="divisorInput" style="display:none;">
<input type="text" name="valueDivisor" size="4" value="1">
(<a href="#kibDivisor"><?php echo __('KiB'); ?></a>, <a href="#mibDivisor"><?php echo __('MiB'); ?></a>)
- </span><br>
+ </span><br />
<input type="checkbox" id="useUnit" name="useUnit" value="1" />
<label for="useUnit"><?php echo __('Append unit to data values'); ?></label>
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15015-g3538fd8
by Michal Čihař 15 Aug '11
by Michal Čihař 15 Aug '11
15 Aug '11
The branch, master has been updated
via 3538fd83c27930d20e42e9d70664aab478c828aa (commit)
from f552d312b3d08606f292abdc23932bc7a708b43a (commit)
- Log -----------------------------------------------------------------
commit 3538fd83c27930d20e42e9d70664aab478c828aa
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:17:32 2011 +0200
Safer compression
Always have working file in js/
-----------------------------------------------------------------------
Summary of changes:
scripts/compress-js | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/scripts/compress-js b/scripts/compress-js
index ea43782..445cae4 100755
--- a/scripts/compress-js
+++ b/scripts/compress-js
@@ -4,6 +4,7 @@ set -e
for file in `find js -name '*.js' -not -name '*min.js'` ; do
mkdir -p sources/`dirname $file`
- mv $file sources/$file
- java -jar ./scripts/google-javascript-compiler/compiler.jar --js sources/$file --js_output_file $file
+ java -jar ./scripts/google-javascript-compiler/compiler.jar --js $file --js_output_file $file.tmp
+ cp -a $file sources/$file
+ mv $file.tmp $file
done
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15014-gf552d31
by Michal Čihař 15 Aug '11
by Michal Čihař 15 Aug '11
15 Aug '11
The branch, master has been updated
via f552d312b3d08606f292abdc23932bc7a708b43a (commit)
via a9b718d2e07ac28324ddf203c27a9b8abc16fb7d (commit)
via bdc3d232929210f0ec6d09ab6a36639c1b5d1011 (commit)
from ba5b79d98b9eab438583d3bd9d1e25911c7fcbce (commit)
- Log -----------------------------------------------------------------
commit f552d312b3d08606f292abdc23932bc7a708b43a
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:12:27 2011 +0200
Various JS fixes
commit a9b718d2e07ac28324ddf203c27a9b8abc16fb7d
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:09:44 2011 +0200
A little bit of coding style
commit bdc3d232929210f0ec6d09ab6a36639c1b5d1011
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:08:51 2011 +0200
Expand tabs
-----------------------------------------------------------------------
Summary of changes:
js/tbl_zoom_plot.js | 658 +++++++++++++++++++++++++-------------------------
1 files changed, 329 insertions(+), 329 deletions(-)
diff --git a/js/tbl_zoom_plot.js b/js/tbl_zoom_plot.js
index b9c0d75..796b543 100644
--- a/js/tbl_zoom_plot.js
+++ b/js/tbl_zoom_plot.js
@@ -35,7 +35,7 @@ Array.min = function (array) {
/**
** Checks if a string contains only numeric value
- ** @param n: String (to be checked)
+ ** @param n: String (to be checked)
**/
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
@@ -43,7 +43,7 @@ function isNumeric(n) {
/**
** Checks if an object is empty
- ** @param n: Object (to be checked)
+ ** @param n: Object (to be checked)
**/
function isEmpty(obj) {
var name;
@@ -59,15 +59,15 @@ function isEmpty(obj) {
** @param type String Field type(datetime/timestamp/time/date)
**/
function getDate(val,type) {
- if(type.toString().search(/datetime/i) != -1 || type.toString().search(/timestamp/i) != -1) {
- return Highcharts.dateFormat('%Y-%m-%e %H:%M:%S', val)
- }
- else if(type.toString().search(/time/i) != -1) {
+ if (type.toString().search(/datetime/i) != -1 || type.toString().search(/timestamp/i) != -1) {
+ return Highcharts.dateFormat('%Y-%m-%e %H:%M:%S', val)
+ }
+ else if (type.toString().search(/time/i) != -1) {
return Highcharts.dateFormat('%H:%M:%S', val + 19800000)
- }
+ }
else if (type.toString().search(/date/i) != -1) {
return Highcharts.dateFormat('%Y-%m-%e', val)
- }
+ }
}
/**
@@ -76,30 +76,30 @@ function getDate(val,type) {
** @param type Sring Field type(datetime/timestamp/time/date)
**/
function getTimeStamp(val,type) {
- if(type.toString().search(/datetime/i) != -1 || type.toString().search(/timestamp/i) != -1) {
- return getDateFromFormat(val,'yyyy-MM-dd HH:mm:ss', val)
- }
- else if(type.toString().search(/time/i) != -1) {
- return getDateFromFormat('1970-01-01 ' + val,'yyyy-MM-dd HH:mm:ss')
- }
+ if (type.toString().search(/datetime/i) != -1 || type.toString().search(/timestamp/i) != -1) {
+ return getDateFromFormat(val,'yyyy-MM-dd HH:mm:ss', val)
+ }
+ else if (type.toString().search(/time/i) != -1) {
+ return getDateFromFormat('1970-01-01 ' + val,'yyyy-MM-dd HH:mm:ss')
+ }
else if (type.toString().search(/date/i) != -1) {
- return getDateFromFormat(val,'yyyy-MM-dd')
- }
+ return getDateFromFormat(val,'yyyy-MM-dd')
+ }
}
/**
** Classifies the field type into numeric,timeseries or text
** @param field: field type (as in database structure)
- **/
+ **/
function getType(field) {
- if(field.toString().search(/int/i) != -1 || field.toString().search(/decimal/i) != -1 || field.toString().search(/year/i) != -1)
- return 'numeric';
- else if(field.toString().search(/time/i) != -1 || field.toString().search(/date/i) != -1)
- return 'time';
- else
- return 'text';
+ if (field.toString().search(/int/i) != -1 || field.toString().search(/decimal/i) != -1 || field.toString().search(/year/i) != -1)
+ return 'numeric';
+ else if (field.toString().search(/time/i) != -1 || field.toString().search(/date/i) != -1)
+ return 'time';
+ else
+ return 'text';
}
-/**
+/**
** Converts a categorical array into numeric array
** @param array categorical values array
**/
@@ -131,7 +131,7 @@ $(document).ready(function() {
cache: 'false'
});
- var cursorMode = ($("input[name='mode']:checked").val() == 'edit') ? 'crosshair' : 'pointer';
+ var cursorMode = ($("input[name='mode']:checked").val() == 'edit') ? 'crosshair' : 'pointer';
var currentChart = null;
var currentData = null;
var xLabel = $('#tableid_0').val();
@@ -140,7 +140,7 @@ $(document).ready(function() {
var yType = $('#types_1').val();
var dataLabel = $('#dataLabel').val();
- // Get query result
+ // Get query result
var data = jQuery.parseJSON($('#querydata').html());
/**
@@ -164,16 +164,16 @@ $(document).ready(function() {
/**
* Input form validation
- **/
+ **/
$('#inputFormSubmitId').click(function() {
- if ($('#tableid_0').get(0).selectedIndex == 0 || $('#tableid_1').get(0).selectedIndex == 0)
- PMA_ajaxShowMessage(PMA_messages['strInputNull']);
- else if (xLabel == yLabel)
+ if ($('#tableid_0').get(0).selectedIndex == 0 || $('#tableid_1').get(0).selectedIndex == 0)
+ PMA_ajaxShowMessage(PMA_messages['strInputNull']);
+ else if (xLabel == yLabel)
PMA_ajaxShowMessage(PMA_messages['strSameInputs']);
});
/**
- ** Prepare a div containing a link, otherwise it's incorrectly displayed
+ ** Prepare a div containing a link, otherwise it's incorrectly displayed
** after a couple of clicks
**/
$('<div id="togglesearchformdiv"><a id="togglesearchformlink"></a></div>')
@@ -191,177 +191,177 @@ $(document).ready(function() {
} else {
$link.text(PMA_messages['strHideSearchCriteria']);
}
- // avoid default click action
- return false;
- });
-
- /**
+ // avoid default click action
+ return false;
+ });
+
+ /**
** Set dialog properties for the data display form
**/
$("#dataDisplay").dialog({
autoOpen: false,
- title: 'Data point content',
+ title: 'Data point content',
modal: false, //false otherwise other dialogues like timepicker may not function properly
height: $('#dataDisplay').height() + 80,
width: $('#dataDisplay').width() + 80
});
/*
- * Handle submit of zoom_display_form
+ * Handle submit of zoom_display_form
*/
-
+
$("#submitForm").click(function(event) {
-
+
//Prevent default submission of form
event.preventDefault();
-
- //Find changed values by comparing form values with selectedRow Object
- var newValues = new Array();//Stores the values changed from original
+
+ //Find changed values by comparing form values with selectedRow Object
+ var newValues = new Array();//Stores the values changed from original
var it = 4;
var xChange = false;
var yChange = false;
- for (key in selectedRow) {
- if (key != 'where_clause'){
- var oldVal = selectedRow[key];
- var newVal = ($('#fields_null_id_' + it).attr('checked')) ? null : $('#fieldID_' + it).val();
- if (oldVal != newVal){
- selectedRow[key] = newVal;
- newValues[key] = newVal;
- if(key == xLabel) {
- xChange = true;
- data[currentData][xLabel] = newVal;
- }
- else if(key == yLabel) {
- yChange = true;
- data[currentData][yLabel] = newVal;
- }
- }
- }
- it++
- }//End data update
-
- //Update the chart series and replot
+ for (key in selectedRow) {
+ if (key != 'where_clause'){
+ var oldVal = selectedRow[key];
+ var newVal = ($('#fields_null_id_' + it).attr('checked')) ? null : $('#fieldID_' + it).val();
+ if (oldVal != newVal){
+ selectedRow[key] = newVal;
+ newValues[key] = newVal;
+ if (key == xLabel) {
+ xChange = true;
+ data[currentData][xLabel] = newVal;
+ }
+ else if (key == yLabel) {
+ yChange = true;
+ data[currentData][yLabel] = newVal;
+ }
+ }
+ }
+ it++
+ }//End data update
+
+ //Update the chart series and replot
if (xChange || yChange) {
- var newSeries = new Array();
- newSeries[0] = new Object();
+ var newSeries = new Array();
+ newSeries[0] = new Object();
newSeries[0].marker = {
symbol: 'circle'
};
- //Logic similar to plot generation, replot only if xAxis changes or yAxis changes. Code includes a lot of checks so as to replot only when necessary
- if(xChange) {
- xCord[currentData] = selectedRow[xLabel];
- if(xType == 'numeric') {
- currentChart.series[0].data[currentData].update({ x : selectedRow[xLabel] });
- currentChart.xAxis[0].setExtremes(Array.min(xCord) - 6,Array.max(xCord) + 6);
+ //Logic similar to plot generation, replot only if xAxis changes or yAxis changes. Code includes a lot of checks so as to replot only when necessary
+ if (xChange) {
+ xCord[currentData] = selectedRow[xLabel];
+ if (xType == 'numeric') {
+ currentChart.series[0].data[currentData].update({ x : selectedRow[xLabel] });
+ currentChart.xAxis[0].setExtremes(Array.min(xCord) - 6,Array.max(xCord) + 6);
+ }
+ else if (xType == 'time') {
+ currentChart.series[0].data[currentData].update({ x : getTimeStamp(selectedRow[xLabel],$('#types_0').val())});
}
- else if(xType == 'time') {
- currentChart.series[0].data[currentData].update({ x : getTimeStamp(selectedRow[xLabel],$('#types_0').val())});
- }
- else {
- var tempX = getCord(xCord);
- var tempY = getCord(yCord);
- var i = 0;
- newSeries[0].data = new Array();
- xCord = tempX[2];
- yCord = tempY[2];
-
- $.each(data,function(key,value) {
- if(yType != 'text')
- newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: value[yLabel], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- else
+ else {
+ var tempX = getCord(xCord);
+ var tempY = getCord(yCord);
+ var i = 0;
+ newSeries[0].data = new Array();
+ xCord = tempX[2];
+ yCord = tempY[2];
+
+ $.each(data,function(key,value) {
+ if (yType != 'text')
+ newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: value[yLabel], marker: {fillColor: colorCodes[i % 8]} , id: i } );
+ else
newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: tempY[0][i], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- i++;
+ i++;
});
- currentSettings.xAxis.labels = { formatter : function() {
- if(tempX[1][this.value] && tempX[1][this.value].length > 10)
- return tempX[1][this.value].substring(0,10)
- else
- return tempX[1][this.value];
+ currentSettings.xAxis.labels = { formatter : function() {
+ if (tempX[1][this.value] && tempX[1][this.value].length > 10)
+ return tempX[1][this.value].substring(0,10)
+ else
+ return tempX[1][this.value];
}
}
- currentSettings.series = newSeries;
+ currentSettings.series = newSeries;
currentChart = PMA_createChart(currentSettings);
- }
+ }
- }
- if(yChange) {
+ }
+ if (yChange) {
- yCord[currentData] = selectedRow[yLabel];
- if(yType == 'numeric') {
- currentChart.series[0].data[currentData].update({ y : selectedRow[yLabel] });
- currentChart.yAxis[0].setExtremes(Array.min(yCord) - 6,Array.max(yCord) + 6);
+ yCord[currentData] = selectedRow[yLabel];
+ if (yType == 'numeric') {
+ currentChart.series[0].data[currentData].update({ y : selectedRow[yLabel] });
+ currentChart.yAxis[0].setExtremes(Array.min(yCord) - 6,Array.max(yCord) + 6);
}
- else if(yType =='time') {
- currentChart.series[0].data[currentData].update({ y : getTimeStamp(selectedRow[yLabel],$('#types_1').val())});
- }
- else {
- var tempX = getCord(xCord);
- var tempY = getCord(yCord);
- var i = 0;
- newSeries[0].data = new Array();
- xCord = tempX[2];
- yCord = tempY[2];
-
- $.each(data,function(key,value) {
- if(xType != 'text' )
+ else if (yType =='time') {
+ currentChart.series[0].data[currentData].update({ y : getTimeStamp(selectedRow[yLabel],$('#types_1').val())});
+ }
+ else {
+ var tempX = getCord(xCord);
+ var tempY = getCord(yCord);
+ var i = 0;
+ newSeries[0].data = new Array();
+ xCord = tempX[2];
+ yCord = tempY[2];
+
+ $.each(data,function(key,value) {
+ if (xType != 'text' )
newSeries[0].data.push({ name: value[dataLabel], x: value[xLabel], y: tempY[0][i], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- else
+ else
newSeries[0].data.push({ name: value[dataLabel], x: tempX[0][i], y: tempY[0][i], marker: {fillColor: colorCodes[i % 8]} , id: i } );
- i++;
+ i++;
});
- currentSettings.yAxis.labels = { formatter : function() {
- if(tempY[1][this.value] && tempY[1][this.value].length > 10)
- return tempY[1][this.value].substring(0,10)
- else
- return tempY[1][this.value];
+ currentSettings.yAxis.labels = { formatter : function() {
+ if (tempY[1][this.value] && tempY[1][this.value].length > 10)
+ return tempY[1][this.value].substring(0,10)
+ else
+ return tempY[1][this.value];
}
}
- currentSettings.series = newSeries;
- currentChart = PMA_createChart(currentSettings);
- }
- }
- currentChart.series[0].data[currentData].select();
+ currentSettings.series = newSeries;
+ currentChart = PMA_createChart(currentSettings);
+ }
+ }
+ currentChart.series[0].data[currentData].select();
}
- //End plot update
+ //End plot update
- //Generate SQL query for update
- if (!isEmpty(newValues)) {
+ //Generate SQL query for update
+ if (!isEmpty(newValues)) {
var sql_query = 'UPDATE `' + window.parent.table + '` SET ';
- for (key in newValues) {
- if(key != 'where_clause') {
- sql_query += '`' + key + '`=' ;
- var value = newValues[key];
- if(!isNumeric(value) && value != null)
- sql_query += '\'' + value + '\' ,';
- else
- sql_query += value + ' ,';
- }
- }
- sql_query = sql_query.substring(0, sql_query.length - 1);
- sql_query += ' WHERE ' + PMA_urldecode(data[currentData]['where_clause']);
-
- //Post SQL query to sql.php
- $.post('sql.php', {
+ for (key in newValues) {
+ if (key != 'where_clause') {
+ sql_query += '`' + key + '`=' ;
+ var value = newValues[key];
+ if (!isNumeric(value) && value != null)
+ sql_query += '\'' + value + '\' ,';
+ else
+ sql_query += value + ' ,';
+ }
+ }
+ sql_query = sql_query.substring(0, sql_query.length - 1);
+ sql_query += ' WHERE ' + PMA_urldecode(data[currentData]['where_clause']);
+
+ //Post SQL query to sql.php
+ $.post('sql.php', {
'token' : window.parent.token,
'db' : window.parent.db,
'ajax_request' : true,
'sql_query' : sql_query,
- 'inline_edit' : false
- }, function(data) {
- if(data.success == true) {
- $('#sqlqueryresults').html(data.sql_query);
- $("#sqlqueryresults").trigger('appendAnchor');
- }
- else
- PMA_ajaxShowMessage(data.error);
- })//End $.post
- }//End database update
- $("#dataDisplay").dialog("close");
- });//End submit handler
+ 'inline_edit' : false
+ }, function(data) {
+ if (data.success == true) {
+ $('#sqlqueryresults').html(data.sql_query);
+ $("#sqlqueryresults").trigger('appendAnchor');
+ }
+ else
+ PMA_ajaxShowMessage(data.error);
+ })//End $.post
+ }//End database update
+ $("#dataDisplay").dialog("close");
+ });//End submit handler
/*
* Generate plot using Highcharts
- */
+ */
if (data != null) {
$('#zoom_search_form')
@@ -369,87 +369,87 @@ $(document).ready(function() {
.hide();
$('#togglesearchformlink')
.text(PMA_messages['strShowSearchCriteria'])
- $('#togglesearchformdiv').show();
+ $('#togglesearchformdiv').show();
var selectedRow;
- var columnNames = new Array();
- var colorCodes = ['#FF0000','#00FFFF','#0000FF','#0000A0','#FF0080','#800080','#FFFF00','#00FF00','#FF00FF'];
- var series = new Array();
- var xCord = new Array();
- var yCord = new Array();
- var xCat = new Array();
- var yCat = new Array();
- var tempX, tempY;
- var it = 0;
+ var columnNames = new Array();
+ var colorCodes = ['#FF0000','#00FFFF','#0000FF','#0000A0','#FF0080','#800080','#FFFF00','#00FF00','#FF00FF'];
+ var series = new Array();
+ var xCord = new Array();
+ var yCord = new Array();
+ var xCat = new Array();
+ var yCat = new Array();
+ var tempX, tempY;
+ var it = 0;
// Set the basic plot settings
var currentSettings = {
chart: {
- renderTo: 'querychart',
- type: 'scatter',
- zoomType: 'xy',
- width:$('#resizer').width() -3,
- height:$('#resizer').height()-20
- },
- credits: {
- enabled: false
+ renderTo: 'querychart',
+ type: 'scatter',
+ zoomType: 'xy',
+ width:$('#resizer').width() -3,
+ height:$('#resizer').height()-20
},
- exporting: { enabled: false },
+ credits: {
+ enabled: false
+ },
+ exporting: { enabled: false },
label: { text: $('#dataLabel').val() },
- plotOptions: {
- series: {
- allowPointSelect: true,
+ plotOptions: {
+ series: {
+ allowPointSelect: true,
cursor: 'pointer',
- showInLegend: false,
+ showInLegend: false,
dataLabels: {
- enabled: false,
+ enabled: false
},
- point: {
+ point: {
events: {
click: function() {
- var id = this.id;
- var fid = 4;
- currentData = id;
- // Make AJAX request to tbl_zoom_select.php for getting the complete row info
- var post_params = {
+ var id = this.id;
+ var fid = 4;
+ currentData = id;
+ // Make AJAX request to tbl_zoom_select.php for getting the complete row info
+ var post_params = {
'ajax_request' : true,
'get_data_row' : true,
'db' : window.parent.db,
'table' : window.parent.table,
'where_clause' : data[id]['where_clause'],
- 'token' : window.parent.token,
+ 'token' : window.parent.token
}
$.post('tbl_zoom_select.php', post_params, function(data) {
- // Row is contained in data.row_info, now fill the displayResultForm with row values
- for ( key in data.row_info) {
- if (data.row_info[key] == null)
- $('#fields_null_id_' + fid).attr('checked', true);
- else
- $('#fieldID_' + fid).val(data.row_info[key]);
- fid++;
- }
- selectedRow = new Object();
- selectedRow = data.row_info;
+ // Row is contained in data.row_info, now fill the displayResultForm with row values
+ for ( key in data.row_info) {
+ if (data.row_info[key] == null)
+ $('#fields_null_id_' + fid).attr('checked', true);
+ else
+ $('#fieldID_' + fid).val(data.row_info[key]);
+ fid++;
+ }
+ selectedRow = new Object();
+ selectedRow = data.row_info;
});
- $("#dataDisplay").dialog("open");
- },
+ $("#dataDisplay").dialog("open");
+ }
}
- }
- }
- },
- tooltip: {
- formatter: function() {
- return this.point.name;
- }
- },
+ }
+ }
+ },
+ tooltip: {
+ formatter: function() {
+ return this.point.name;
+ }
+ },
title: { text: 'Query Results' },
- xAxis: {
- title: { text: $('#tableid_0').val() },
+ xAxis: {
+ title: { text: $('#tableid_0').val() }
},
yAxis: {
- min: null,
- title: { text: $('#tableid_1').val() },
- },
+ min: null,
+ title: { text: $('#tableid_1').val() }
+ }
}
$('#resizer').resizable({
@@ -461,145 +461,145 @@ $(document).ready(function() {
);
}
});
-
- // Classify types as either numeric,time,text
- xType = getType(xType);
- yType = getType(yType);
- //Set the axis type based on the field
- currentSettings.xAxis.type = (xType == 'time') ? 'datetime' : 'linear';
- currentSettings.yAxis.type = (yType == 'time') ? 'datetime' : 'linear';
+ // Classify types as either numeric,time,text
+ xType = getType(xType);
+ yType = getType(yType);
+
+ //Set the axis type based on the field
+ currentSettings.xAxis.type = (xType == 'time') ? 'datetime' : 'linear';
+ currentSettings.yAxis.type = (yType == 'time') ? 'datetime' : 'linear';
// Formulate series data for plot
series[0] = new Object();
series[0].data = new Array();
- series[0].marker = {
+ series[0].marker = {
symbol: 'circle'
};
- if (xType != 'text' && yType != 'text') {
- $.each(data,function(key,value) {
- var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
- var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
+ if (xType != 'text' && yType != 'text') {
+ $.each(data,function(key,value) {
+ var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
+ var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
series[0].data.push({ name: value[dataLabel], x: xVal, y: yVal, marker: {fillColor: colorCodes[it % 8]} , id: it } );
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- it++;
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ it++;
});
- if(xType == 'numeric') {
- currentSettings.xAxis.max = Array.max(xCord) + 6
- currentSettings.xAxis.min = Array.min(xCord) - 6
- }
- else {
- currentSettings.xAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_0').val());
- }}
+ if (xType == 'numeric') {
+ currentSettings.xAxis.max = Array.max(xCord) + 6
+ currentSettings.xAxis.min = Array.min(xCord) - 6
}
- if(yType == 'numeric') {
- currentSettings.yAxis.max = Array.max(yCord) + 6
- currentSettings.yAxis.min = Array.min(yCord) - 6
- }
- else {
- currentSettings.yAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_1').val());
- }}
+ else {
+ currentSettings.xAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_0').val());
+ }}
+ }
+ if (yType == 'numeric') {
+ currentSettings.yAxis.max = Array.max(yCord) + 6
+ currentSettings.yAxis.min = Array.min(yCord) - 6
+ }
+ else {
+ currentSettings.yAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_1').val());
+ }}
}
}
-
- else if (xType =='text' && yType !='text') {
- $.each(data,function(key,value) {
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- });
-
- tempX = getCord(xCord);
- $.each(data,function(key,value) {
- var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
+
+ else if (xType =='text' && yType !='text') {
+ $.each(data,function(key,value) {
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ });
+
+ tempX = getCord(xCord);
+ $.each(data,function(key,value) {
+ var yVal = (yType == 'numeric') ? value[yLabel] : getTimeStamp(value[yLabel],$('#types_1').val());
series[0].data.push({ name: value[dataLabel], x: tempX[0][it], y: yVal, marker: {fillColor: colorCodes[it % 8]} , id: it } );
- it++;
+ it++;
});
-
- currentSettings.xAxis.labels = { formatter : function() {
- if(tempX[1][this.value] && tempX[1][this.value].length > 10)
- return tempX[1][this.value].substring(0,10)
- else
- return tempX[1][this.value];
- }
+
+ currentSettings.xAxis.labels = { formatter : function() {
+ if (tempX[1][this.value] && tempX[1][this.value].length > 10)
+ return tempX[1][this.value].substring(0,10)
+ else
+ return tempX[1][this.value];
+ }
}
- if(yType == 'numeric') {
- currentSettings.yAxis.max = Array.max(yCord) + 6
- currentSettings.yAxis.min = Array.min(yCord) - 6
- }
- else {
- currentSettings.yAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_1').val());
- }}
+ if (yType == 'numeric') {
+ currentSettings.yAxis.max = Array.max(yCord) + 6
+ currentSettings.yAxis.min = Array.min(yCord) - 6
}
- xCord = tempX[2];
- }
-
- else if (xType !='text' && yType =='text') {
- $.each(data,function(key,value) {
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- });
- tempY = getCord(yCord);
- $.each(data,function(key,value) {
- var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
+ else {
+ currentSettings.yAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_1').val());
+ }}
+ }
+ xCord = tempX[2];
+ }
+
+ else if (xType !='text' && yType =='text') {
+ $.each(data,function(key,value) {
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ });
+ tempY = getCord(yCord);
+ $.each(data,function(key,value) {
+ var xVal = (xType == 'numeric') ? value[xLabel] : getTimeStamp(value[xLabel],$('#types_0').val());
series[0].data.push({ name: value[dataLabel], y: tempY[0][it], x: xVal, marker: {fillColor: colorCodes[it % 8]} , id: it } );
- it++;
+ it++;
});
- if(xType == 'numeric') {
- currentSettings.xAxis.max = Array.max(xCord) + 6
- currentSettings.xAxis.min = Array.min(xCord) - 6
- }
- else {
- currentSettings.xAxis.labels = { formatter : function() {
- return getDate(this.value, $('#types_0').val());
- }}
+ if (xType == 'numeric') {
+ currentSettings.xAxis.max = Array.max(xCord) + 6
+ currentSettings.xAxis.min = Array.min(xCord) - 6
}
- currentSettings.yAxis.labels = { formatter : function() {
- if(tempY[1][this.value] && tempY[1][this.value].length > 10)
- return tempY[1][this.value].substring(0,10)
- else
- return tempY[1][this.value];
- }
+ else {
+ currentSettings.xAxis.labels = { formatter : function() {
+ return getDate(this.value, $('#types_0').val());
+ }}
}
- yCord = tempY[2];
- }
-
- else if (xType =='text' && yType =='text') {
- $.each(data,function(key,value) {
- xCord.push(value[xLabel]);
- yCord.push(value[yLabel]);
- });
- tempX = getCord(xCord);
- tempY = getCord(yCord);
- $.each(data,function(key,value) {
+ currentSettings.yAxis.labels = { formatter : function() {
+ if (tempY[1][this.value] && tempY[1][this.value].length > 10)
+ return tempY[1][this.value].substring(0,10)
+ else
+ return tempY[1][this.value];
+ }
+ }
+ yCord = tempY[2];
+ }
+
+ else if (xType =='text' && yType =='text') {
+ $.each(data,function(key,value) {
+ xCord.push(value[xLabel]);
+ yCord.push(value[yLabel]);
+ });
+ tempX = getCord(xCord);
+ tempY = getCord(yCord);
+ $.each(data,function(key,value) {
series[0].data.push({ name: value[dataLabel], x: tempX[0][it], y: tempY[0][it], marker: {fillColor: colorCodes[it % 8]} , id: it } );
- it++;
+ it++;
});
- currentSettings.xAxis.labels = { formatter : function() {
- if(tempX[1][this.value] && tempX[1][this.value].length > 10)
- return tempX[1][this.value].substring(0,10)
- else
- return tempX[1][this.value];
- }
- }
- currentSettings.yAxis.labels = { formatter : function() {
- if(tempY[1][this.value] && tempY[1][this.value].length > 10)
- return tempY[1][this.value].substring(0,10)
- else
- return tempY[1][this.value];
- }
- }
- xCord = tempX[2];
- yCord = tempY[2];
-
- }
-
- currentSettings.series = series;
+ currentSettings.xAxis.labels = { formatter : function() {
+ if (tempX[1][this.value] && tempX[1][this.value].length > 10) {
+ return tempX[1][this.value].substring(0,10)
+ } else {
+ return tempX[1][this.value];
+ }
+ }};
+ currentSettings.yAxis.labels = { formatter : function() {
+ if (tempY[1][this.value] && tempY[1][this.value].length > 10) {
+ return tempY[1][this.value].substring(0,10);
+ } else {
+ return tempY[1][this.value];
+ }
+ }};
+ xCord = tempX[2];
+ yCord = tempY[2];
+
+ }
+
+ currentSettings.series = series;
currentChart = PMA_createChart(currentSettings);
- scrollToChart();
+ scrollToChart();
}
});
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15011-gba5b79d
by Michal Čihař 15 Aug '11
by Michal Čihař 15 Aug '11
15 Aug '11
The branch, master has been updated
via ba5b79d98b9eab438583d3bd9d1e25911c7fcbce (commit)
from 7546350978c3a4af1ed944cc92532706be71a794 (commit)
- Log -----------------------------------------------------------------
commit ba5b79d98b9eab438583d3bd9d1e25911c7fcbce
Author: Michal Čihař <michal(a)cihar.com>
Date: Mon Aug 15 17:05:16 2011 +0200
Remove trailing comma to avoid problems with MSIE
-----------------------------------------------------------------------
Summary of changes:
js/makegrid.js | 272 ++++++++++++++++++++++++++++----------------------------
1 files changed, 136 insertions(+), 136 deletions(-)
diff --git a/js/makegrid.js b/js/makegrid.js
index 91fa8a5..1fd07c1 100644
--- a/js/makegrid.js
+++ b/js/makegrid.js
@@ -19,22 +19,22 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
* Constant
***********/
minColWidth: 15,
-
-
+
+
/***********
* Variables, assigned with default value, changed later
***********/
actionSpan: 5, // number of colspan in Actions header in a table
tableCreateTime: null, // table creation time, used for saving column order and visibility to server, only available in "Browse tab"
-
+
// Column reordering variables
colOrder: new Array(), // array of column order
-
+
// Column visibility variables
colVisib: new Array(), // array of column visibility
showAllColText: '', // string, text for "show all" button under column visibility list
visibleHeadersCount: 0, // number of visible data headers
-
+
// Table hint variables
qtip: null, // qtip API
reorderHint: '', // string, hint for column reordering
@@ -45,7 +45,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
showSortHint: false,
showMarkHint: false,
showColVisibHint: false,
-
+
// Grid editing
isCellEditActive: false, // true if current focus is in edit cell
isEditCellTextEditable: false, // true if current edit cell is editable in the text input box (not textarea)
@@ -60,14 +60,14 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
lastXHR : null, // last XHR object used in AJAX request
isSaving: false, // true when currently saving edited data, used to handle double posting caused by pressing ENTER in grid edit text box in Chrome browser
alertNonUnique: '', // string, alert shown when saving edited nonunique table
-
+
// Common hidden inputs
token: null,
server: null,
db: null,
table: null,
-
-
+
+
/************
* Functions
************/
@@ -93,7 +93,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
g.hideEditCell();
}
},
-
+
/**
* Start to reorder column. Called when clicking on table header.
*
@@ -113,10 +113,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$(g.cPointer).css({
top: objPos.top
});
-
+
// get the column index, zero-based
var n = g.getHeaderIdx(obj);
-
+
g.colReorder = {
x0: e.pageX,
y0: e.pageY,
@@ -133,7 +133,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
g.hideEditCell();
}
},
-
+
/**
* Handle mousemove event when dragging.
*
@@ -151,7 +151,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$(g.cCpy)
.css('left', g.colReorder.objLeft + dx)
.show();
-
+
// pointer animation
var hoveredCol = g.getHoveredCol(e);
if (hoveredCol) {
@@ -175,7 +175,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
}
},
-
+
/**
* Stop the dragging action.
*
@@ -191,7 +191,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
var n = g.colRsz.n;
// do the resizing
g.resize(n, nw);
-
+
g.reposRsz();
g.reposDrop();
g.colRsz = false;
@@ -210,7 +210,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
g.refreshRestoreButton();
}
-
+
// animate new column position
$(g.cCpy).stop(true, true)
.animate({
@@ -225,7 +225,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$('body').css('cursor', 'inherit');
$('body').noSelect(false);
},
-
+
/**
* Resize column n to new width "nw"
*
@@ -239,7 +239,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
.css('width', nw);
});
},
-
+
/**
* Reposition column resize bars.
*/
@@ -254,7 +254,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
$(g.cRsz).css('height', $(g.t).height());
},
-
+
/**
* Shift column from index oldn to newn.
*
@@ -277,7 +277,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
});
// reposition the column resize bars
g.reposRsz();
-
+
// adjust the column visibility list
if (newn < oldn) {
$(g.cList).find('.lDiv div:eq(' + newn + ')')
@@ -297,7 +297,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
g.colVisib.splice(newn, 0, tmp);
}
},
-
+
/**
* Find currently hovered table column's header (excluding actions column).
*
@@ -316,7 +316,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
});
return hoveredCol;
},
-
+
/**
* Get a zero-based index from a <th class="draggable"> tag in a table.
*
@@ -326,7 +326,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
getHeaderIdx: function(obj) {
return $(obj).parents('tr').find('th.draggable').index(obj);
},
-
+
/**
* Reposition the columns back to normal order.
*/
@@ -348,7 +348,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
g.refreshRestoreButton();
},
-
+
/**
* Send column preferences (column order and visibility) to the server.
*/
@@ -379,7 +379,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
});
}
},
-
+
/**
* Refresh restore button state.
* Make restore button disabled if the table is similar with initial state.
@@ -402,7 +402,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$('.restore_column').show();
}
},
-
+
/**
* Update current hint using the boolean values (showReorderHint, showSortHint, etc.).
* It will hide the hint if all the boolean values is false.
@@ -429,23 +429,23 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
text += text.length > 0 ? '<br />' : '';
text += g.colVisibHint;
}
-
+
// hide the hint if no text and the event is mouseenter
g.qtip.disable(!text && e.type == 'mouseenter');
-
+
g.qtip.updateContent(text, false);
} else {
g.hideHint();
}
},
-
+
hideHint: function() {
if (g.qtip) {
g.qtip.hide();
g.qtip.disable(true);
}
},
-
+
/**
* Toggle column's visibility.
* After calling this function and it returns true, afterToggleCol() must be called.
@@ -479,7 +479,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
return true;
},
-
+
/**
* This must be called if toggleCol() returns is true.
*
@@ -491,12 +491,12 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
g.reposRsz();
g.reposDrop();
g.sendColPrefs();
-
+
// check visible first row headers count
g.visibleHeadersCount = $(g.t).find('tr:first th.draggable:visible').length;
g.refreshRestoreButton();
},
-
+
/**
* Show columns' visibility list.
*
@@ -518,7 +518,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$(obj).addClass('coldrop-hover');
}
},
-
+
/**
* Hide columns' visibility list.
*/
@@ -526,7 +526,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$(g.cList).hide();
$(g.cDrop).find('.coldrop-hover').removeClass('coldrop-hover');
},
-
+
/**
* Reposition the column visibility drop-down arrow.
*/
@@ -541,7 +541,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
});
}
},
-
+
/**
* Show all hidden columns.
*/
@@ -553,7 +553,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
g.afterToggleCol();
},
-
+
/**
* Show edit cell, if it can be shown
*
@@ -570,7 +570,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
// reposition the cEdit element
$(g.cEdit).css({
top: $cell.position().top,
- left: $cell.position().left,
+ left: $cell.position().left
})
.show()
.find('input')
@@ -582,7 +582,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
var value = $cell.is(':not(.null)') ? PMA_getCellValue(cell) : '';
$(g.cEdit).find('input')
.val(value);
-
+
g.currentEditCell = cell;
$(g.cEdit).find('input[type=text]').focus();
$(g.cEdit).find('*').removeAttr('disabled');
@@ -593,7 +593,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
}
},
-
+
/**
* Remove edit cell and the edit area, if it is shown.
*
@@ -609,13 +609,13 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
g.saveOrPostEditedCell();
return;
}
-
+
// cancel any previous request
if (g.lastXHR != null) {
g.lastXHR.abort();
g.lastXHR = null;
}
-
+
if (data) {
if (g.currentEditCell) { // save value of currently edited cell
// replace current edited field with the new value
@@ -649,19 +649,19 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$this_field.find('span').html(value);
});
}
-
+
// refresh the grid
g.reposRsz();
g.reposDrop();
}
-
+
// hide the cell editing area
$(g.cEdit).hide();
$(g.cEdit).find('input[type=text]').blur();
g.isCellEditActive = false;
g.currentEditCell = null;
},
-
+
/**
* Show drop-down edit area when edit cell is focused.
*/
@@ -690,10 +690,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
* @var curr_value String current value of the field (for fields that are of type enum or set).
*/
var curr_value = $td.find('span').text();
-
+
// empty all edit area, then rebuild it based on $td classes
$editArea.empty();
-
+
// add goto link, if this cell contains a link
if ($td.find('a').length > 0) {
var gotoLink = document.createElement('div');
@@ -702,7 +702,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
.append($td.find('a').clone());
$editArea.append(gotoLink);
}
-
+
g.wasEditedCellNull = false;
if ($td.is(':not(.not_null)')) {
// append a null checkbox
@@ -713,7 +713,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$checkbox.attr('checked', true);
g.wasEditedCellNull = true;
}
-
+
// if the select/editor is changed un-check the 'checkbox_null_<field_name>_<row_index>'.
if ($td.is('.enum, .set')) {
$editArea.find('select').live('change', function(e) {
@@ -734,7 +734,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$checkbox.attr('checked', false);
})
}
-
+
// if 'checkbox_null_<field_name>_<row_index>' is clicked empty the corresponding select/editor.
$checkbox.click(function(e) {
if ($td.is('.enum')) {
@@ -755,7 +755,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$(g.cEdit).find('input[type=text]').val('');
})
}
-
+
if($td.is('.relation')) {
/** @lends jQuery */
//handle relations
@@ -763,7 +763,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
// initialize the original data
$td.data('original_data', null);
-
+
/**
* @var post_params Object containing parameters for the POST request
*/
@@ -787,11 +787,11 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$td.data('original_data', value);
// update the text input field, in case where the "Relational display column" is checked
$(g.cEdit).find('input[type=text]').val(value);
-
+
$editArea.append(data.dropdown);
$editArea.append('<div class="cell_edit_hint">' + g.cellEditHint + '</div>');
}) // end $.post()
-
+
$editArea.find('select').live('change', function(e) {
$(g.cEdit).find('input[type=text]').val($(this).val());
})
@@ -820,7 +820,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$editArea.append(data.dropdown);
$editArea.append('<div class="cell_edit_hint">' + g.cellEditHint + '</div>');
}) // end $.post()
-
+
$editArea.find('select').live('change', function(e) {
$(g.cEdit).find('input[type=text]').val($(this).val());
})
@@ -850,7 +850,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$editArea.append(data.select);
$editArea.append('<div class="cell_edit_hint">' + g.cellEditHint + '</div>');
}) // end $.post()
-
+
$editArea.find('select').live('change', function(e) {
$(g.cEdit).find('input[type=text]').val($(this).val());
})
@@ -879,7 +879,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
* @var sql_query String containing the SQL query used to retrieve value of truncated/transformed data
*/
var sql_query = 'SELECT `' + field_name + '` FROM `' + g.table + '` WHERE ' + PMA_urldecode(where_clause);
-
+
// Make the Ajax call and get the data, wrap it and insert it
g.lastXHR = $.post('sql.php', {
'token' : g.token,
@@ -896,7 +896,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
// get the truncated data length
g.maxTruncatedLen = $(g.currentEditCell).text().length - 3;
}
-
+
$td.data('original_data', data.value);
$(g.cEdit).find('input[type=text]').val(data.value);
$editArea.append('<textarea>'+data.value+'</textarea>');
@@ -925,11 +925,11 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$editArea.append('<div class="cell_edit_hint">' + g.cellEditHint + '</div>');
g.isEditCellTextEditable = true;
}
-
+
$editArea.show();
}
},
-
+
/**
* Post the content of edited cell.
*/
@@ -938,7 +938,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
return;
}
g.isSaving = true;
-
+
/**
* @var relation_fields Array containing the name/value pairs of relational fields
*/
@@ -981,19 +981,19 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
var me_fields_name = Array();
var me_fields = Array();
var me_fields_null = Array();
-
+
// alert user if edited table is not unique
if (!is_unique) {
alert(g.alertNonUnique);
}
-
+
// loop each edited row
$('.to_be_saved').parents('tr').each(function() {
var $tr = $(this);
var where_clause = $tr.find('.where_clause').val();
full_where_clause.push(PMA_urldecode(where_clause));
var condition_array = jQuery.parseJSON($tr.find('.condition_array').val());
-
+
/**
* multi edit variables, for current row
* @TODO array indices are still not correct, they should be md5 of field's name
@@ -1008,7 +1008,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
* @var $this_field Object referring to the td that is being edited
*/
var $this_field = $(this);
-
+
/**
* @var field_name String containing the name of this field.
* @see getFieldName()
@@ -1024,21 +1024,21 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
transformation_fields = true;
}
this_field_params[field_name] = $this_field.data('value');
-
+
/**
* @var is_null String capturing whether 'checkbox_null_<field_name>_<row_index>' is checked.
*/
var is_null = this_field_params[field_name] === null;
-
+
fields_name.push(field_name);
-
+
if (is_null) {
fields_null.push('on');
fields.push('');
} else {
fields_null.push('');
fields.push($this_field.data('value'));
-
+
var cell_index = $this_field.index('.to_be_saved');
if($this_field.is(":not(.relation, .enum, .set, .bit)")) {
if($this_field.is('.transformed')) {
@@ -1060,9 +1060,9 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
}
}
-
+
}); // end of loop for every edited cells in a row
-
+
// save new_clause
var new_clause = '';
for (var field in condition_array) {
@@ -1073,16 +1073,16 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$tr.data('new_clause', new_clause);
// save condition_array
$tr.find('.condition_array').val(JSON.stringify(condition_array));
-
+
me_fields_name.push(fields_name);
me_fields.push(fields);
me_fields_null.push(fields_null);
-
+
}); // end of loop for every edited rows
-
+
rel_fields_list = $.param(relation_fields);
transform_fields_list = $.param(transform_fields);
-
+
// Make the Ajax post after setting all parameters
/**
* @var post_params Object containing parameters for the POST request
@@ -1105,7 +1105,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
'goto' : 'sql.php',
'submit_type' : 'save'
};
-
+
if (!g.saveCellsAtOnce) {
$(g.cEdit).find('*').attr('disabled', 'disabled');
var $editArea = $(g.cEdit).find('.edit_area');
@@ -1114,7 +1114,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$('.save_edited').addClass('saving_edited_data')
.find('input').attr('disabled', 'disabled'); // disable the save button
}
-
+
$.ajax({
type: 'POST',
url: 'tbl_replace.php',
@@ -1138,7 +1138,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
var old_clause = $where_clause.attr('value');
var decoded_old_clause = PMA_urldecode(old_clause);
var decoded_new_clause = PMA_urldecode(new_clause);
-
+
$where_clause.attr('value', new_clause);
// update Edit, Copy, and Delete links also
$(this).parent('tr').find('a').each(function() {
@@ -1158,7 +1158,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
var $checkbox = $(this);
var checkbox_name = $checkbox.attr('name');
var checkbox_value = $checkbox.attr('value');
-
+
$checkbox.attr('name', checkbox_name.replace(old_clause, new_clause));
$checkbox.attr('value', checkbox_value.replace(decoded_old_clause, decoded_new_clause));
});
@@ -1171,7 +1171,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$('#sqlqueryresults').prepend(data.sql_query);
}
g.hideEditCell(true, data);
-
+
// remove the "Save edited cells" button
$('.save_edited').hide();
// update saved fields
@@ -1179,7 +1179,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
.removeClass('to_be_saved')
.data('value', null)
.data('original_data', null);
-
+
g.isCellEdited = false;
} else {
PMA_ajaxShowMessage(data.error);
@@ -1187,7 +1187,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
}) // end $.ajax()
},
-
+
/**
* Save edited cell, so it can be posted later.
*/
@@ -1251,7 +1251,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
need_to_post = true;
}
}
-
+
if (need_to_post) {
$(g.currentEditCell).addClass('to_be_saved')
.data('value', this_field_params[field_name]);
@@ -1260,10 +1260,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
g.isCellEdited = true;
}
-
+
return need_to_post;
},
-
+
/**
* Save or post currently edited cell, depending on the "saveCellsAtOnce" configuration.
*/
@@ -1283,7 +1283,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
}
}
},
-
+
/**
* Initialize column resize feature.
*/
@@ -1291,10 +1291,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
// create column resizer div
g.cRsz = document.createElement('div');
g.cRsz.className = 'cRsz';
-
+
// get data columns in the first row of the table
var $firstRowCols = $(g.t).find('tr:first th.draggable');
-
+
// create column borders
$firstRowCols.each(function() {
var cb = document.createElement('div'); // column border
@@ -1305,32 +1305,32 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$(g.cRsz).append(cb);
});
g.reposRsz();
-
+
// attach to global div
$(g.gDiv).prepend(g.cRsz);
},
-
+
/**
* Initialize column reordering feature.
*/
initColReorder: function() {
g.cCpy = document.createElement('div'); // column copy, to store copy of dragged column header
g.cPointer = document.createElement('div'); // column pointer, used when reordering column
-
+
// adjust g.cCpy
g.cCpy.className = 'cCpy';
$(g.cCpy).hide();
-
+
// adjust g.cPointer
g.cPointer.className = 'cPointer';
$(g.cPointer).css('visibility', 'hidden'); // set visibility to hidden instead of calling hide() to force browsers to cache the image in cPointer class
-
+
// assign column reordering hint
g.reorderHint = PMA_messages['strColOrderHint'];
-
+
// get data columns in the first row of the table
var $firstRowCols = $(g.t).find('tr:first th.draggable');
-
+
// initialize column order
$col_order = $('#col_order'); // check if column order is passed from PHP
if ($col_order.length > 0) {
@@ -1344,7 +1344,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
g.colOrder.push(i);
}
}
-
+
// register events
$(t).find('th.draggable')
.mousedown(function(e) {
@@ -1367,41 +1367,41 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$('.restore_column').click(function() {
g.restoreColOrder();
});
-
+
// attach to global div
$(g.gDiv).append(g.cPointer);
$(g.gDiv).append(g.cCpy);
-
+
// prevent default "dragstart" event when dragging a link
$(t).find('th a').bind('dragstart', function() {
return false;
});
-
+
// refresh the restore column button state
g.refreshRestoreButton();
},
-
+
/**
* Initialize column visibility feature.
*/
initColVisib: function() {
g.cDrop = document.createElement('div'); // column drop-down arrows
g.cList = document.createElement('div'); // column visibility list
-
+
// adjust g.cDrop
g.cDrop.className = 'cDrop';
-
+
// adjust g.cList
g.cList.className = 'cList';
$(g.cList).hide();
-
+
// assign column visibility related hints
g.colVisibHint = PMA_messages['strColVisibHint'];
g.showAllColText = PMA_messages['strShowAllCol'];
-
+
// get data columns in the first row of the table
var $firstRowCols = $(g.t).find('tr:first th.draggable');
-
+
// initialize column visibility
$col_visib = $('#col_visib'); // check if column visibility is passed from PHP
if ($col_visib.length > 0) {
@@ -1415,15 +1415,15 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
g.colVisib.push(1);
}
}
-
+
// get data columns in the first row of the table
var $firstRowCols = $(t).find('tr:first th.draggable');
-
+
// make sure we have more than one column
if ($firstRowCols.length > 1) {
var $colVisibTh = $(g.t).find('th:not(.draggable)');
PMA_createqTip($colVisibTh);
-
+
// create column visibility drop-down arrow(s)
$colVisibTh.each(function() {
var $th = $(this);
@@ -1445,7 +1445,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
.mouseleave(function(e) {
g.showColVisibHint = false;
});
-
+
// add column visibility control
g.cList.innerHTML = '<div class="lDiv"></div>';
var $listDiv = $(g.cList).find('div');
@@ -1479,41 +1479,41 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
});
}
}
-
+
// hide column visibility list if we move outside the list
$(t).find('td, th.draggable').mouseenter(function() {
g.hideColList();
});
-
+
// attach to global div
$(g.gDiv).append(g.cDrop);
$(g.gDiv).append(g.cList);
-
+
// some adjustment
g.reposDrop();
},
-
+
/**
* Initialize grid editing feature.
*/
initGridEdit: function() {
// create cell edit wrapper element
g.cEdit = document.createElement('div');
-
+
// adjust g.cEdit
g.cEdit.className = 'cEdit';
$(g.cEdit).html('<input type="text" /><div class="edit_area" />');
$(g.cEdit).hide();
-
+
// assign cell editing hint
g.cellEditHint = PMA_messages['strCellEditHint'];
g.saveCellWarning = PMA_messages['strSaveCellWarning'];
g.alertNonUnique = PMA_messages['strAlertNonUnique'];
g.gotoLinkText = PMA_messages['strGoToLink'];
-
+
// initialize cell editing configuration
g.saveCellsAtOnce = $('#save_cells_at_once').val();
-
+
// register events
$(t).find('td.data')
.click(function(e) {
@@ -1567,60 +1567,60 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
return g.saveCellWarning;
}
});
-
+
// attach to global div
$(g.gDiv).append(g.cEdit);
-
+
// add hint for grid editing feature when hovering "Edit" link in each table row
PMA_createqTip($(g.t).find('.edit_row_anchor a'), PMA_messages['strGridEditFeatureHint']);
}
}
-
+
/******************
* Initialize grid
******************/
-
+
// wrap all data cells, except actions cell, with span
$(t).find('th, td:not(:has(span))')
.wrapInner('<span />');
-
+
// create grid elements
g.gDiv = document.createElement('div'); // create global div
-
+
// initialize the table variable
g.t = t;
-
+
// get data columns in the first row of the table
var $firstRowCols = $(t).find('tr:first th.draggable');
-
+
// initialize visible headers count
g.visibleHeadersCount = $firstRowCols.filter(':visible').length;
-
+
// assign first column (actions) span
if (! $(t).find('tr:first th:first').hasClass('draggable')) { // action header exist
g.actionSpan = $(t).find('tr:first th:first').prop('colspan');
} else {
g.actionSpan = 0;
}
-
+
// assign table create time
// #table_create_time will only available if we are in "Browse" tab
g.tableCreateTime = $('#table_create_time').val();
-
+
// assign the hints
g.sortHint = PMA_messages['strSortHint'];
g.markHint = PMA_messages['strColMarkHint'];
-
+
// assign common hidden inputs
var $common_hidden_inputs = $('.common_hidden_inputs');
g.token = $common_hidden_inputs.find('input[name=token]').val();
g.server = $common_hidden_inputs.find('input[name=server]').val();
g.db = $common_hidden_inputs.find('input[name=db]').val();
g.table = $common_hidden_inputs.find('input[name=table]').val();
-
+
// add table class
$(t).addClass('pma_table');
-
+
// link the global div
$(t).before(g.gDiv);
$(g.gDiv).append(t);
@@ -1646,10 +1646,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
{
g.initGridEdit();
}
-
+
// create qtip for each <th> with draggable class
PMA_createqTip($(t).find('th.draggable'));
-
+
// register events for hint tooltip
$(t).find('th.draggable a')
.attr('title', '') // hide default tooltip for sorting
@@ -1677,7 +1677,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
g.dragEnd(e);
});
}
-
+
// bind event to update currently hovered qtip API
$(t).find('th')
.mouseenter(function(e) {
@@ -1687,7 +1687,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
.mouseleave(function(e) {
g.updateHint(e);
});
-
+
// some adjustment
$(t).removeClass('data');
$(g.gDiv).addClass('data');
hooks/post-receive
--
phpMyAdmin
1
0

[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_2-15010-g7546350
by Marc Delisle 15 Aug '11
by Marc Delisle 15 Aug '11
15 Aug '11
The branch, master has been updated
via 7546350978c3a4af1ed944cc92532706be71a794 (commit)
via 90c010f9ca0dd52ce322c133f84b5321c2f40264 (commit)
via a3343a7736e97ad32711793ec94b104a488c4c90 (commit)
via 6b3f10523e1b00a072fd2a6ad24aeb86dc534bca (commit)
via b761f400fbb86c12d96dbbd9beeb8fda74de8e68 (commit)
via 3fdf5dd2ea03fafcf37308e85a72b6427a043924 (commit)
via e0d4dd51e69065d2c4b6fb08bc51ef43f828120c (commit)
via 48a95cb47936f0bb06b9b7d1728045889af19889 (commit)
from e19d93a70c52fd490f0d10da6ac9adc20fbfbc65 (commit)
- Log -----------------------------------------------------------------
commit 7546350978c3a4af1ed944cc92532706be71a794
Merge: e19d93a 90c010f
Author: Marc Delisle <marc(a)infomarc.info>
Date: Mon Aug 15 07:46:17 2011 -0400
Merge commit '90c010f9ca0dd52ce322c133f84b5321c2f40264'
commit 90c010f9ca0dd52ce322c133f84b5321c2f40264
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sat Aug 13 07:00:50 2011 +0530
Fixed the issue of not showing the Docuemnts
commit a3343a7736e97ad32711793ec94b104a488c4c90
Merge: 6b3f105 b319651
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Fri Aug 12 22:52:02 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 6b3f10523e1b00a072fd2a6ad24aeb86dc534bca
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Fri Aug 12 22:47:23 2011 +0530
Added table results for actions in Table maintenance in Table options
commit b761f400fbb86c12d96dbbd9beeb8fda74de8e68
Merge: 3fdf5dd c00b1e5
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Mon Aug 8 09:25:10 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 3fdf5dd2ea03fafcf37308e85a72b6427a043924
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Mon Aug 8 09:24:38 2011 +0530
Changed the logic of truncate table in table operations
commit e0d4dd51e69065d2c4b6fb08bc51ef43f828120c
Merge: 48a95cb a5394bd
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sun Aug 7 16:22:03 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 48a95cb47936f0bb06b9b7d1728045889af19889
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sun Aug 7 16:19:14 2011 +0530
Ajaxify table maintenance in table operations
-----------------------------------------------------------------------
Summary of changes:
js/functions.js | 79 ++++++++++++++++++++++++++++++++++++++++++---------
sql.php | 28 ++++++++++++++++++
tbl_operations.php | 16 +++++-----
3 files changed, 101 insertions(+), 22 deletions(-)
diff --git a/js/functions.js b/js/functions.js
index 58ad805..ee83b8a 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -1992,7 +1992,7 @@ $(document).ready(function() {
**/
$("#alterTableOrderby.ajax").live('submit', function(event) {
event.preventDefault();
- $form = $(this);
+ var $form = $(this);
PMA_prepareForAjaxRequest($form);
/*variables which stores the common attributes*/
@@ -2010,9 +2010,9 @@ $(document).ready(function() {
$("#result_query .notice").remove();
$("#result_query").prepend((data.message));
} else {
- $temp_div = $("<div id='temp_div'></div>")
+ var $temp_div = $("<div id='temp_div'></div>")
$temp_div.html(data.error);
- $error = $temp_div.find("code").addClass("error");
+ var $error = $temp_div.find("code").addClass("error");
PMA_ajaxShowMessage($error);
}
}) // end $.post()
@@ -2023,7 +2023,7 @@ $(document).ready(function() {
**/
$("#copyTable.ajax input[name='submit_copy']").live('click', function(event) {
event.preventDefault();
- $form = $("#copyTable");
+ var $form = $("#copyTable");
if($form.find("input[name='switch_to_new']").attr('checked')) {
$form.append('<input type="hidden" name="submit_copy" value="Go" />');
$form.removeClass('ajax');
@@ -2052,15 +2052,53 @@ $(document).ready(function() {
window.parent.frame_navigation.location.reload();
}
} else {
- $temp_div = $("<div id='temp_div'></div>")
+ var $temp_div = $("<div id='temp_div'></div>");
$temp_div.html(data.error);
- $error = $temp_div.find("code").addClass("error");
+ var $error = $temp_div.find("code").addClass("error");
PMA_ajaxShowMessage($error);
}
}) // end $.post()
}
});//end of copyTable ajax submit
+ /**
+ *Ajax events for actions in the "Table maintenance"
+ **/
+ $("#tbl_maintenance.ajax li a.maintain_action").live('click', function(event) {
+ event.preventDefault();
+ var $link = $(this);
+ var href = $link.attr("href");
+ href = href.split('?');
+ if ($("#sqlqueryresults").length != 0) {
+ $("#sqlqueryresults").remove();
+ }
+ if ($("#result_query").length != 0) {
+ $("#result_query").remove();
+ }
+ //variables which stores the common attributes
+ $.post(href[0], href[1]+"&ajax_request=true", function(data) {
+ if (data.success == undefined) {
+ var $temp_div = $("<div id='temp_div'></div>");
+ $temp_div.html(data);
+ var $success = $temp_div.find("#result_query .success");
+ PMA_ajaxShowMessage($success);
+ $("<div id='sqlqueryresults' class='ajax'></div>").insertAfter("#topmenucontainer");
+ $("#sqlqueryresults").html(data);
+ PMA_init_slider();
+ $("#sqlqueryresults").children("fieldset").remove();
+ } else if (data.success == true ) {
+ PMA_ajaxShowMessage(data.message);
+ $("<div id='sqlqueryresults' class='ajax'></div>").insertAfter("#topmenucontainer");
+ $("#sqlqueryresults").html(data.sql_query);
+ } else {
+ var $temp_div = $("<div id='temp_div'></div>");
+ $temp_div.html(data.error);
+ var $error = $temp_div.find("code").addClass("error");
+ PMA_ajaxShowMessage($error);
+ }
+ }) // end $.post()
+ });//end of table maintanance ajax click
+
}, 'top.frame_content'); //end $(document).ready for 'Table operations'
@@ -2983,7 +3021,7 @@ $(document).ready(function() {
$("#drop_tbl_anchor").live('click', function(event) {
event.preventDefault();
- //context is top.frame_content, so we need to use window.parent.db to access the db var
+ //context is top.frame_content, so we need to use window.parent.table to access the table var
/**
* @var question String containing the question to be asked for confirmation
*/
@@ -3011,10 +3049,10 @@ $(document).ready(function() {
* @see $cfg['AjaxEnable']
*/
$(document).ready(function() {
- $("#truncate_tbl_anchor").live('click', function(event) {
+ $("#truncate_tbl_anchor.ajax").live('click', function(event) {
event.preventDefault();
- //context is top.frame_content, so we need to use window.parent.db to access the db var
+ //context is top.frame_content, so we need to use window.parent.table to access the table var
/**
* @var question String containing the question to be asked for confirmation
*/
@@ -3024,13 +3062,26 @@ $(document).ready(function() {
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function(data) {
- //Database deleted successfully, refresh both the frames
- window.parent.refreshNavigation();
- window.parent.refreshMain();
+ if ($("#sqlqueryresults").length != 0) {
+ $("#sqlqueryresults").remove();
+ }
+ if ($("#result_query").length != 0) {
+ $("#result_query").remove();
+ }
+ if (data.success == true) {
+ PMA_ajaxShowMessage(data.message);
+ $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
+ $("#sqlqueryresults").html(data.sql_query);
+ } else {
+ var $temp_div = $("<div id='temp_div'></div>")
+ $temp_div.html(data.error);
+ var $error = $temp_div.find("code").addClass("error");
+ PMA_ajaxShowMessage($error);
+ }
}) // end $.get()
}); // end $.PMA_confirm()
- }); //end of Drop Table Ajax action
-}) // end of $(document).ready() for Drop Table
+ }); //end of Truncate Table Ajax action
+}) // end of $(document).ready() for Truncate Table
/**
* Attach CodeMirror2 editor to SQL edit area.
diff --git a/sql.php b/sql.php
index 7e9c0f6..60740f6 100644
--- a/sql.php
+++ b/sql.php
@@ -767,6 +767,34 @@ else {
PMA_ajaxResponse(NULL, true, $extra_data);
}
+ if (isset($_REQUEST['ajax_request']) && isset($_REQUEST['table_maintenance'])) {
+ $GLOBALS['js_include'][] = 'functions.js';
+ $GLOBALS['js_include'][] = 'makegrid.js';
+ $GLOBALS['js_include'][] = 'sql.js';
+
+ // Gets the list of fields properties
+ if (isset($result) && $result) {
+ $fields_meta = PMA_DBI_get_fields_meta($result);
+ $fields_cnt = count($fields_meta);
+ }
+
+ if (empty($disp_mode)) {
+ // see the "PMA_setDisplayMode()" function in
+ // libraries/display_tbl.lib.php
+ $disp_mode = 'urdr111101';
+ }
+
+ // hide edit and delete links for information_schema
+ if ($db == 'information_schema') {
+ $disp_mode = 'nnnn110111';
+ }
+
+ $message = PMA_Message::success($message);
+ echo PMA_showMessage($message, $GLOBALS['sql_query'], 'success');
+ PMA_displayTable($result, $disp_mode, $analyzed_sql);
+ exit();
+ }
+
// Displays the headers
if (isset($show_query)) {
unset($show_query);
diff --git a/tbl_operations.php b/tbl_operations.php
index a5a9eef..3e536c2 100644
--- a/tbl_operations.php
+++ b/tbl_operations.php
@@ -593,7 +593,7 @@ if (isset($possible_row_formats[$tbl_type])) {
<fieldset>
<legend><?php echo __('Table maintenance'); ?></legend>
-<ul>
+<ul id="tbl_maintenance" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>>
<?php
// Note: BERKELEY (BDB) is no longer supported, starting with MySQL 5.1
if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
@@ -604,7 +604,7 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
'table_maintenance' => 'Go',
));
?>
- <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
+ <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Check table'); ?></a>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'CHECK_TABLE'); ?>
</li>
@@ -614,7 +614,7 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
$this_url_params = array_merge($url_params,
array('sql_query' => 'ALTER TABLE ' . PMA_backquote($GLOBALS['table']) . ' ENGINE = InnoDB'));
?>
- <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
+ <li><a class='maintain_action' href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Defragment table'); ?></a>
<?php echo PMA_showMySQLDocu('Table_types', 'InnoDB_File_Defragmenting'); ?>
</li>
@@ -627,7 +627,7 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
'table_maintenance' => 'Go',
));
?>
- <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
+ <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Analyze table'); ?></a>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'ANALYZE_TABLE');?>
</li>
@@ -640,7 +640,7 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
'table_maintenance' => 'Go',
));
?>
- <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
+ <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Repair table'); ?></a>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'REPAIR_TABLE'); ?>
</li>
@@ -653,7 +653,7 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) {
'table_maintenance' => 'Go',
));
?>
- <li><a href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
+ <li><a class='maintain_action' href="tbl_operations.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Optimize table'); ?></a>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'OPTIMIZE_TABLE'); ?>
</li>
@@ -668,7 +668,7 @@ $this_url_params = array_merge($url_params,
'reload' => 1,
));
?>
- <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
+ <li><a class='maintain_action' href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>">
<?php echo __('Flush the table (FLUSH)'); ?></a>
<?php echo PMA_showMySQLDocu('MySQL_Database_Administration', 'FLUSH'); ?>
</li>
@@ -692,7 +692,7 @@ if (! $tbl_is_view && ! (isset($db_is_information_schema) && $db_is_information_
'message_to_show' => sprintf(__('Table %s has been emptied'), htmlspecialchars($table)),
));
?>
- <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="truncate_tbl_anchor"' : ''); ?>>
+ <li><a href="sql.php<?php echo PMA_generate_common_url($this_url_params); ?>" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'id="truncate_tbl_anchor" class="ajax"' : ''); ?>>
<?php echo __('Empty the table (TRUNCATE)'); ?></a>
<?php echo PMA_showMySQLDocu('SQL-Syntax', 'TRUNCATE_TABLE'); ?>
</li>
hooks/post-receive
--
phpMyAdmin
1
0