The branch, master has been updated
via a00fc340f9aad0a03cb73960b0e0f609ab09f1ce (commit)
via 26b869a2548a781b54af65b96d557e6dfdf162fa (commit)
via 5a5fc6097eeb3d7a6b27318d95684ac641576dcb (commit)
via 75a7e6f50bf297366c66c26dc82d9e5c75fd4dde (commit)
via 6d85a894b3079b258929931a1c99a7f69bb474a9 (commit)
via 9d9e22e6d1d0c53a2edef6b1754c9505c98b0af7 (commit)
via eedf03282c9c8f572586c1a1b2e5786ef83c8d79 (commit)
via 7011f7e925d729dab4400340346de72d8df976e1 (commit)
via 860586e3b2178080c26c92dacc046ad63ea616d5 (commit)
from a7ea657625a7c4ddb1389d9cd9b1f82bf00bc80c (commit)
- Log -----------------------------------------------------------------
commit a00fc340f9aad0a03cb73960b0e0f609ab09f1ce
Merge: a7ea657 26b869a
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Sat Nov 5 14:36:08 2011 +0000
Merge branch 'menubar'
commit 26b869a2548a781b54af65b96d557e6dfdf162fa
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Sat Nov 5 14:15:46 2011 +0000
Updated changelog
commit 5a5fc6097eeb3d7a6b27318d95684ac641576dcb
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Sat Nov 5 14:11:20 2011 +0000
PMA_convertFootnotesToTooltips was using the wrong element since the top menu was stickied
commit 75a7e6f50bf297366c66c26dc82d9e5c75fd4dde
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Sat Nov 5 14:05:13 2011 +0000
Generate the "floating_menubar" element in PHP to avoid firing it's JS handler in the navi frame
commit 6d85a894b3079b258929931a1c99a7f69bb474a9
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Sat Nov 5 13:47:24 2011 +0000
Fixed bug #3302419 - Tabs break when squeezing page
commit 9d9e22e6d1d0c53a2edef6b1754c9505c98b0af7
Merge: eedf032 e27befb
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Sat Nov 5 13:46:21 2011 +0000
Merge branch 'master' into menubar
commit eedf03282c9c8f572586c1a1b2e5786ef83c8d79
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Fri Nov 4 16:13:08 2011 +0000
Prevent the breadcrumbs from wrapping
commit 7011f7e925d729dab4400340346de72d8df976e1
Merge: 860586e 15b25f9
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Fri Nov 4 15:09:48 2011 +0000
Merge branch 'master' into menubar
commit 860586e3b2178080c26c92dacc046ad63ea616d5
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Mon Oct 31 21:12:58 2011 +0000
Stick table tools to top of page on scroll
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 2 +
js/db_operations.js | 8 +-
js/db_structure.js | 2 +-
js/functions.js | 123 +++++++++++++++++++++----------
js/server_privileges.js | 8 +-
js/tbl_change.js | 6 +-
js/tbl_structure.js | 2 +-
libraries/header.inc.php | 4 +-
themes/original/css/theme_right.css.php | 22 +++++-
themes/pmahomme/css/theme_right.css.php | 27 +++++--
10 files changed, 139 insertions(+), 65 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d63bd32..dbe226a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -55,6 +55,8 @@ phpMyAdmin - ChangeLog
+ patch #3428376 [pmadb] pmadb on a different MySQL server
+ patch #3410688 [interface] Improving field size for character columns
- [usability] Removed an unnecessary AJAX request from database search
+- bug #3302419 [navi] Tabs break when squeezing page
++ rfe #3406797 [navi] Stick table tools to top of page on scroll
3.4.8.0 (not yet released)
- bug #3425230 [interface] enum data split at space char (more space to edit)
diff --git a/js/db_operations.js b/js/db_operations.js
index b053694..9776cef 100644
--- a/js/db_operations.js
+++ b/js/db_operations.js
@@ -56,14 +56,14 @@ $(document).ready(function() {
window.parent.db = data.newname;
- $("#topmenucontainer")
+ $("#floating_menubar")
.next('div')
.remove()
.end()
.after(data.sql_query);
//Remove the empty notice div generated due to a NULL query passed to PMA_showMessage()
- var $notice_class = $("#topmenucontainer").next("div").find('.notice');
+ var $notice_class = $("#floating_menubar").next("div").find('.notice');
if ($notice_class.text() == '') {
$notice_class.remove();
}
@@ -99,7 +99,7 @@ $(document).ready(function() {
$('.success').fadeOut();
$('.error').fadeOut();
if(data.success == true) {
- $('#topmenucontainer').after(data.message);
+ $('#floating_menubar').after(data.message);
if( $("#checkbox_switch").is(":checked")) {
window.parent.db = data.newname;
window.parent.refreshMain();
@@ -112,7 +112,7 @@ $(document).ready(function() {
}
}
else {
- $('#topmenucontainer').after(data.error);
+ $('#floating_menubar').after(data.error);
}
PMA_ajaxRemoveMessage($msgbox);
diff --git a/js/db_structure.js b/js/db_structure.js
index 162a6c7..42bdb5f 100644
--- a/js/db_structure.js
+++ b/js/db_structure.js
@@ -165,7 +165,7 @@ $(document).ready(function() {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
if (selected_submit_type == "showinsert") {
- $(data.sql_query).insertAfter("#topmenucontainer");
+ $(data.sql_query).insertAfter("#floating_menubar");
$("#result_query .notice").remove();
$("#result_query").prepend((data.message));
}
diff --git a/js/functions.js b/js/functions.js
index 0bdfb5a..4029020 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -2222,7 +2222,7 @@ $(document).ready(function() {
}
if (data.success == true) {
PMA_ajaxShowMessage(data.message);
- $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
+ $("<div id='sqlqueryresults'></div>").insertAfter("#floating_menubar");
$("#sqlqueryresults").html(data.sql_query);
$("#result_query .notice").remove();
$("#result_query").prepend((data.message));
@@ -2284,7 +2284,7 @@ $(document).ready(function() {
}
if (data.success == true) {
PMA_ajaxShowMessage(data.message);
- $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
+ $("<div id='sqlqueryresults'></div>").insertAfter("#floating_menubar");
$("#sqlqueryresults").html(data.sql_query);
$("#result_query .notice").remove();
$("#result_query").prepend((data.message));
@@ -2320,7 +2320,7 @@ $(document).ready(function() {
}
if (data.success == true) {
PMA_ajaxShowMessage(data.message);
- $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
+ $("<div id='sqlqueryresults'></div>").insertAfter("#floating_menubar");
$("#sqlqueryresults").html(data.sql_query);
$("#result_query .notice").remove();
$("#result_query").prepend((data.message));
@@ -2361,13 +2361,13 @@ $(document).ready(function() {
$temp_div.html(data);
var $success = $temp_div.find("#result_query .success");
PMA_ajaxShowMessage($success);
- $("<div id='sqlqueryresults' class='ajax'></div>").insertAfter("#topmenucontainer");
+ $("<div id='sqlqueryresults' class='ajax'></div>").insertAfter("#floating_menubar");
$("#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");
+ $("<div id='sqlqueryresults' class='ajax'></div>").insertAfter("#floating_menubar");
$("#sqlqueryresults").html(data.sql_query);
} else {
var $temp_div = $("<div id='temp_div'></div>");
@@ -2519,7 +2519,7 @@ $(document).ready(function() {
$.post($(the_form).attr('action'), $(the_form).serialize() + '&change_pw='+ this_value, function(data) {
if(data.success == true) {
- $("#topmenucontainer").after(data.sql_query);
+ $("#floating_menubar").after(data.sql_query);
$("#change_password_dialog").hide().remove();
$("#edit_user_dialog").dialog("close").remove();
$('#change_password_anchor.dialog_active').removeClass('dialog_active').addClass('ajax');
@@ -2889,7 +2889,7 @@ function PMA_convertFootnotesToTooltips($div)
// JavaScript-disabled browsers) since the tooltip is sufficient
if ($div == undefined || ! $div instanceof jQuery || $div.length == 0) {
- $div = $("#serverinfo").parent();
+ $div = $("body");
}
$footnotes = $div.find(".footnotes");
@@ -2932,6 +2932,10 @@ function PMA_convertFootnotesToTooltips($div)
});
}
+/**
+ * This function handles the resizing of the content frame
+ * and adjusts the top menu according to the new size of the frame
+ */
function menuResize()
{
var cnt = $('#topmenu');
@@ -2944,47 +2948,64 @@ function menuResize()
var more_shown = li2.length > 0;
var w = more_shown ? submenu_w : 0;
- // hide menu items
- var hide_start = 0;
- for (var i = 0; i < li.length-1; i++) { // li.length-1: skip .submenu element
+ // Calculate the total width used by all the shown tabs
+ var total_len = w;
+ for (var i = 0; i < li.length-1; i++) {
+ total_len += $(li[i]).outerWidth(true);
+ }
+
+ // Now hide menu elements that don't fit into the menubar
+ var i = li.length-1;
+ var hidden = false; // Whether we have hidden any tabs
+ while (total_len >= wmax && --i >= 0) { // Process the tabs backwards
+ hidden = true;
var el = $(li[i]);
var el_width = el.outerWidth(true);
el.data('width', el_width);
- w += el_width;
- if (w > wmax) {
- w -= el_width;
- if (w + submenu_w < wmax) {
- hide_start = i;
- } else {
- hide_start = i-1;
- w -= $(li[i-1]).data('width');
- }
- break;
+ if (! more_shown) {
+ total_len -= el_width;
+ el.prependTo(submenu_ul);
+ total_len += submenu_w;
+ more_shown = true;
+ } else {
+ total_len -= el_width;
+ el.prependTo(submenu_ul);
}
}
- if (hide_start > 0) {
- for (var i = hide_start; i < li.length-1; i++) {
- $(li[i])[more_shown ? 'prependTo' : 'appendTo'](submenu_ul);
- }
- submenu.addClass('shown');
- } else if (more_shown) {
- w -= submenu_w;
- // nothing hidden, maybe something can be restored
+ // If we didn't hide any tabs, then there might be some space to show some
+ if (! hidden) {
+ // Show menu elements that do fit into the menubar
for (var i = 0; i < li2.length; i++) {
- //console.log(li2[i], submenu_w);
- w += $(li2[i]).data('width');
- // item fits or (it is the last item and it would fit if More got removed)
- if (w+submenu_w < wmax || (i == li2.length-1 && w < wmax)) {
+ total_len += $(li2[i]).data('width');
+ // item fits or (it is the last item
+ // and it would fit if More got removed)
+ if (total_len < wmax
+ || (i == li2.length - 1 && total_len - submenu_w < wmax)
+ ) {
$(li2[i]).insertBefore(submenu);
- if (i == li2.length-1) {
- submenu.removeClass('shown');
- }
- continue;
+ } else {
+ break;
}
- break;
}
}
+
+ // Show/hide the "More" tab as needed
+ if (submenu_ul.find('li').length > 0) {
+ submenu.addClass('shown');
+ } else {
+ submenu.removeClass('shown');
+ }
+
+ if (li.length == 1) {
+ // If there is only the "More" tab left, then we need
+ // to align the submenu to the left edge of the tab
+ submenu_ul.removeClass().addClass('only');
+ } else {
+ // Otherwise we align the submenu to the right edge of the tab
+ submenu_ul.removeClass().addClass('notonly');
+ }
+
if (submenu.find('.tabactive').length) {
submenu.addClass('active').find('> a').removeClass('tab').addClass('tabactive');
} else {
@@ -3023,8 +3044,8 @@ $(function() {
topmenu.append(submenu);
// populate submenu and register resize event
- $(window).resize(menuResize);
menuResize();
+ $(window).resize(menuResize);
});
/**
@@ -3354,7 +3375,7 @@ function PMA_slidingMessage(msg, $obj)
// If the second argument was not supplied,
// we might have to create a new DOM node.
if ($('#PMA_slidingMessage').length == 0) {
- $('#topmenucontainer')
+ $('#floating_menubar')
.after('<span id="PMA_slidingMessage" '
+ 'style="display: inline-block;"></span>');
}
@@ -3472,7 +3493,7 @@ $(document).ready(function() {
}
if (data.success == true) {
PMA_ajaxShowMessage(data.message);
- $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
+ $("<div id='sqlqueryresults'></div>").insertAfter("#floating_menubar");
$("#sqlqueryresults").html(data.sql_query);
} else {
var $temp_div = $("<div id='temp_div'></div>")
@@ -3665,3 +3686,25 @@ function printPage()
$(document).ready(function() {
$('input#print').click(printPage);
});
+
+/**
+ * Makes the breadcrumbs and the menu bar float at the top of the viewport
+ */
+$(document).ready(function () {
+ if ($("#floating_menubar").length) {
+ $("#floating_menubar")
+ .css({
+ 'position': 'fixed',
+ 'top': 0,
+ 'left': 0,
+ 'width': '100%',
+ 'z-index': 500
+ })
+ .append($('#serverinfo'))
+ .append($('#topmenucontainer'));
+ $('body').css(
+ 'padding-top',
+ $('#floating_menubar').outerHeight(true)
+ );
+ }
+});
diff --git a/js/server_privileges.js b/js/server_privileges.js
index d1d051d..6a7e289 100644
--- a/js/server_privileges.js
+++ b/js/server_privileges.js
@@ -187,14 +187,14 @@ $(document).ready(function() {
if (data.success == true) {
$("#add_user_dialog").dialog("close").remove();
PMA_ajaxShowMessage(data.message);
- $("#topmenucontainer")
+ $("#floating_menubar")
.next('div')
.remove()
.end()
.after(data.sql_query);
//Remove the empty notice div generated due to a NULL query passed to PMA_showMessage()
- var $notice_class = $("#topmenucontainer").next("div").find('.notice');
+ var $notice_class = $("#floating_menubar").next("div").find('.notice');
if ($notice_class.text() == '') {
$notice_class.remove();
}
@@ -413,12 +413,12 @@ $(document).ready(function() {
$("#edit_user_dialog").dialog("close").remove();
if(data.sql_query) {
- $("#topmenucontainer")
+ $("#floating_menubar")
.next('div')
.remove()
.end()
.after(data.sql_query);
- var notice_class = $("#topmenucontainer").next("div").find('.notice');
+ var notice_class = $("#floating_menubar").next("div").find('.notice');
if($(notice_class).text() == '') {
$(notice_class).remove();
}
diff --git a/js/tbl_change.js b/js/tbl_change.js
index 099dab9..ddf40aa 100644
--- a/js/tbl_change.js
+++ b/js/tbl_change.js
@@ -311,14 +311,14 @@ $(document).ready(function() {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
- $("#topmenucontainer")
+ $("#floating_menubar")
.next('div')
.remove()
.end()
.after(data.sql_query);
//Remove the empty notice div generated due to a NULL query passed to PMA_showMessage()
- var $notice_class = $("#topmenucontainer").next("div").find('.notice');
+ var $notice_class = $("#floating_menubar").next("div").find('.notice');
if ($notice_class.text() == '') {
$notice_class.remove();
}
@@ -334,7 +334,7 @@ $(document).ready(function() {
} else {
//happens for example when no change was done while editing
$('#insertForm').remove();
- $('#topmenucontainer').after('<div id="sqlqueryresults"></div>');
+ $('#floating_menubar').after('<div id="sqlqueryresults"></div>');
$('#sqlqueryresults').html(data);
}
})
diff --git a/js/tbl_structure.js b/js/tbl_structure.js
index 226d1c4..f278807 100644
--- a/js/tbl_structure.js
+++ b/js/tbl_structure.js
@@ -262,7 +262,7 @@ $(document).ready(function() {
}
if (data.success == true) {
PMA_ajaxShowMessage(data.message);
- $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
+ $("<div id='sqlqueryresults'></div>").insertAfter("#floating_menubar");
$("#sqlqueryresults").html(data.sql_query);
$("#result_query .notice").remove();
$("#result_query").prepend((data.message));
diff --git a/libraries/header.inc.php b/libraries/header.inc.php
index b57b276..538d3e5 100644
--- a/libraries/header.inc.php
+++ b/libraries/header.inc.php
@@ -122,8 +122,8 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) {
$item .= '%4$s: ';
}
$item .= '%3$s</a>' . "\n";
-
- echo '<div id="serverinfo">' . "\n";
+ echo "<div id='floating_menubar'></div>\n";
+ echo "<div id='serverinfo'>\n";
if ($GLOBALS['cfg']['NavigationBarIconic']) {
echo PMA_getImage('s_host.png', '', array('class' => 'item')) . "\n";
}
diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php
index 42806e6..aaacd44 100644
--- a/themes/original/css/theme_right.css.php
+++ b/themes/original/css/theme_right.css.php
@@ -28,7 +28,7 @@ body {
font-family: <?php echo $GLOBALS['cfg']['FontFamily']; ?>;
<?php } ?>
padding: 0;
- margin: 0.5em;
+ margin: 0 0.5em 0 0;
color: <?php echo $GLOBALS['cfg']['MainColor']; ?>;
background: <?php echo $GLOBALS['cfg']['MainBackground']; ?>;
}
@@ -685,13 +685,20 @@ ul#topmenu ul {
margin: 0;
padding: 0;
position: absolute;
- right: 0;
list-style-type: none;
display: none;
border: 1px #666 solid;
z-index: 2;
}
+ul#topmenu ul.only {
+ left: 0;
+}
+
+ul#topmenu ul.notonly {
+ right: 0;
+}
+
ul#topmenu li:hover ul, ul#topmenu .submenuhover ul {
display: block;
}
@@ -857,9 +864,18 @@ div#tablestatistics table {
/* Heading */
+#topmenucontainer {
+ background: white;
+ padding-right: 1em;
+ width: 100%;
+}
+
#serverinfo {
+ background: white;
font-weight: bold;
- margin-bottom: 0.5em;
+ padding-bottom: 0.5em;
+ width: 10000px;
+ overflow: hidden;
}
#serverinfo .item {
diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php
index 5aadf21..0737a37 100644
--- a/themes/pmahomme/css/theme_right.css.php
+++ b/themes/pmahomme/css/theme_right.css.php
@@ -30,7 +30,7 @@ body {
font-family: <?php echo $GLOBALS['cfg']['FontFamily']; ?>;
<?php } ?>
padding: 0;
- margin: 0.5em;
+ margin: 0 0.5em 0 0;
color: #444;
background: #fff;
}
@@ -884,13 +884,20 @@ ul#topmenu ul {
margin: 0;
padding: 0;
position: absolute;
- right: 0;
list-style-type: none;
display: none;
border: 1px #ddd solid;
z-index: 2;
}
+ul#topmenu ul.only {
+ left: 0;
+}
+
+ul#topmenu ul.notonly {
+ right: 0;
+}
+
ul#topmenu li:hover {
background:url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>tab_hover_bg.png) repeat-x 50% 0%!important;
}
@@ -959,7 +966,7 @@ ul#topmenu > li {
/* default tab styles */
ul#topmenu a, ul#topmenu span {
- padding:10px;
+ padding: 0.6em;
}
ul#topmenu ul a {
@@ -1067,14 +1074,20 @@ div#tablestatistics table {
/* Heading */
+#topmenucontainer {
+ padding-right: 1em;
+ width: 100%;
+ border-bottom:1px solid #ccc;
+ background-color: #dcdcdc;
+}
+
#serverinfo {
border-bottom:1px solid #fff;
- -moz-border-radius: 4px 4px 0 0;
- -webkit-border-radius: 4px 4px 0 0;
- border-radius:4px 4px 0 0;
background:#888;
- padding:10px;
+ padding: 0.3em 0.9em;
text-shadow:0 1px 0 #000000;
+ width: 10000px;
+ overflow: hidden;
}
#serverinfo .item {
hooks/post-receive
--
phpMyAdmin