The branch, master has been updated
via a0d08a33214dd14e407a4eefe587f3b618bc17c7 (commit)
from 3cb9916d8bdf46b6b016f0ae483b261565abe424 (commit)
- Log -----------------------------------------------------------------
commit a0d08a33214dd14e407a4eefe587f3b618bc17c7
Author: Michal Čihař <mcihar(a)novell.com>
Date: Wed Feb 2 16:04:22 2011 +0100
Move javascript for sliders to functions.js.
-----------------------------------------------------------------------
Summary of changes:
js/functions.js | 28 ++++++++++++++++++++++++++++
libraries/common.lib.php | 37 +------------------------------------
2 files changed, 29 insertions(+), 36 deletions(-)
diff --git a/js/functions.js b/js/functions.js
index d8f75cf..24dc0a3 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -2411,6 +2411,17 @@ function PMA_getRowNumber(classlist) {
}
/**
+ * Changes status of slider
+ */
+function PMA_set_status_label(id) {
+ if ($('#' + id).css('display') == 'none') {
+ $('#anchor_status_' + id).text('+ ');
+ } else {
+ $('#anchor_status_' + id).text('- ');
+ }
+}
+
+/**
* Vertical pointer
*/
$(document).ready(function() {
@@ -2478,5 +2489,22 @@ $(document).ready(function() {
})();
}
+ /**
+ * Slider effect.
+ */
+ $('.pma_auto_slider').each(function(idx, e) {
+ $('<span id="anchor_status_' + e.id +
'"><span>')
+ .insertBefore(e);
+ PMA_set_status_label(e.id);
+
+ $('<a href="#' + e.id + '" id="anchor_' + e.id
+ '">' + e.title + '</a>')
+ .insertBefore(e)
+ .click(function() {
+ $('#' + e.id).toggle('clip');
+ PMA_set_status_label(e.id);
+ return false;
+ });
+ });
+
}) // end of $(document).ready()
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 6b47060..ac79a12 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -2524,42 +2524,7 @@ function PMA_generate_slider_effect($id, $message)
* maybe by using an additional param, the id of the div to append to
*/
?>
-<div id="<?php echo $id; ?>" <?php echo
$GLOBALS['cfg']['InitialSlidersState'] == 'closed' ? '
style="display: none; overflow:auto;"' : ''; ?>>
- <script type="text/javascript">
-// <![CDATA[
-
- function PMA_set_status_label_<?php echo $id; ?>() {
- if ($('#<?php echo $id; ?>').css('display') ==
'none') {
- $('#anchor_status_<?php echo $id; ?>').text('+ ');
- } else {
- $('#anchor_status_<?php echo $id; ?>').text('- ');
- }
- }
-
- $(document).ready(function() {
-
- $('<span id="anchor_status_<?php echo $id;
?>"><span>')
- .insertBefore('#<?php echo $id; ?>')
-
- PMA_set_status_label_<?php echo $id; ?>();
-
- $('<a href="#<?php echo $id; ?>" id="anchor_<?php
echo $id; ?>"><?php echo htmlspecialchars($message); ?></a>')
- .insertBefore('#<?php echo $id; ?>')
- .click(function() {
- // The callback should be the 4th parameter but
- // it only works as the second parameter;
- // For the possible effects see
http://jqueryui.com/demos/show
- $('#<?php echo $id; ?>').toggle('clip', function()
{
- PMA_set_status_label_<?php echo $id; ?>();
- });
- return false;
- });
- });
- //]]>
- </script>
- <noscript>
- <div id="<?php echo $id; ?>"></div>
- </noscript>
+<div id="<?php echo $id; ?>" <?php echo
$GLOBALS['cfg']['InitialSlidersState'] == 'closed' ? '
style="display: none; overflow:auto;"' : ''; ?>
class="pma_auto_slider" title="<?php echo htmlspecialchars($message);
?>">
<?php
}
hooks/post-receive
--
phpMyAdmin