The branch, master has been updated via 180f0882df651c6cf338f93081d141ca84b8fde3 (commit) via 1e61f723b8380e108febf01b6696f6fab434618b (commit) via 70656e2b6a6661e381ef1d5dcdc43fcd14b1086d (commit) via 84d62e1fd8c2ad4e5aa78a7a94091342e843ea02 (commit) from 0add8b61f8d41100d98436bf180d9ca7bece082f (commit)
- Log ----------------------------------------------------------------- commit 180f0882df651c6cf338f93081d141ca84b8fde3 Author: Rouslan Placella rouslan@placella.com Date: Tue Jun 21 19:43:45 2011 +0100
undefined is a keyword, not a string
commit 1e61f723b8380e108febf01b6696f6fab434618b Merge: 0add8b61f8d41100d98436bf180d9ca7bece082f 70656e2b6a6661e381ef1d5dcdc43fcd14b1086d Author: Rouslan Placella rouslan@placella.com Date: Tue Jun 21 19:42:17 2011 +0100
Merge branch 'rte_bugfix'
commit 70656e2b6a6661e381ef1d5dcdc43fcd14b1086d Author: Rouslan Placella rouslan@placella.com Date: Tue Jun 21 19:29:48 2011 +0100
Made the 'object' parameter for PMA_slidingMessage() optional
commit 84d62e1fd8c2ad4e5aa78a7a94091342e843ea02 Author: Rouslan Placella rouslan@placella.com Date: Tue Jun 21 18:46:41 2011 +0100
Fixed incorrect queuing of objects in PMA_slidingMessage()
-----------------------------------------------------------------------
Summary of changes: js/db_routines.js | 6 ++-- js/functions.js | 90 ++++++++++++++++++++++++++++++---------------------- 2 files changed, 55 insertions(+), 41 deletions(-)
diff --git a/js/db_routines.js b/js/db_routines.js index 1c03b6b..95254ca 100644 --- a/js/db_routines.js +++ b/js/db_routines.js @@ -246,7 +246,7 @@ $(document).ready(function() { if(data.success == true) { // Routine created successfully PMA_ajaxRemoveMessage($msg); - PMA_slidingMessage($('#js_query_display'), data.message); + PMA_slidingMessage(data.message); $ajaxDialog.dialog('close'); // If we are in 'edit' mode, we must remove the reference to the old row. if (mode == 'edit') { @@ -516,7 +516,7 @@ $(document).ready(function() { if(data.success == true) { // Routine executed successfully PMA_ajaxRemoveMessage($msg); - PMA_slidingMessage($('#js_query_display'), data.message); + PMA_slidingMessage(data.message); $ajaxDialog.dialog('close'); } else { PMA_ajaxShowMessage(data.error); @@ -542,7 +542,7 @@ $(document).ready(function() { $ajaxDialog.find('input[name^=params]').first().focus(); } else { // Routine executed successfully - PMA_slidingMessage($('#js_query_display'), data.message); + PMA_slidingMessage(data.message); } } else { PMA_ajaxShowMessage(data.error); diff --git a/js/functions.js b/js/functions.js index 3b4d9b4..c3900f3 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1300,7 +1300,7 @@ function PMA_ajaxShowMessage(message, timeout) { * Removes the message shown for an Ajax operation when it's completed */ function PMA_ajaxRemoveMessage($this_msgbox) { - if ($this_msgbox != 'undefined' && $this_msgbox instanceof jQuery) { + if ($this_msgbox != undefined && $this_msgbox instanceof jQuery) { $this_msgbox .stop(true, true) .fadeOut('medium'); @@ -2449,55 +2449,69 @@ $(document).ready(function() { /** * Creates a message inside an object with a sliding effect * + * @param msg A string containing the text to display * @param $obj a jQuery object containing the reference * to the element where to put the message - * @param msg A string containing the text to display + * This is optional, if no element is + * provided, one will be created below the + * navigation links at the top of the page * * @return bool True on success, false on failure */ -function PMA_slidingMessage($obj, msg) { - if ($obj != 'undefined' && $obj instanceof jQuery) { - if ($obj.has('div').length > 0) { - // If there already is a message inside the - // target object, we must get rid of it +function PMA_slidingMessage(msg, $obj) { + if (msg == undefined || msg.length == 0) { + // Don't show an empty message + return false; + } + if ($obj == undefined || ! $obj instanceof jQuery) { + // If the second argument was not supplied, + // we might have to create a new DOM node. + if ($('#PMA_slidingMessage').length == 0) { + $('#topmenucontainer') + .after('<span id="PMA_slidingMessage"></span>'); + } + $obj = $('#PMA_slidingMessage'); + } + if ($obj.has('div').length > 0) { + // If there already is a message inside the + // target object, we must get rid of it + $obj + .find('div') + .first() + .fadeOut(function () { + $obj + .children() + .remove(); $obj .append('<div style="display: none;">' + msg + '</div>') + .animate({ + height: $obj.find('div').first().height() + }) .find('div') .first() - .fadeOut(function () { - $(this).remove(); - $obj.animate({ - height: $obj.find('div').first().height() - }); + .fadeIn(); + }); + } else { + // Object does not already have a message + // inside it, so we simply slide it down + $obj + .width('100%') + .html('<div style="display: none;">' + msg + '</div>') + .find('div') + .first() + .slideDown(function() { + // Set the height of the parent + // to the height of the child + $obj + .height( $obj .find('div') .first() - .fadeIn(); - }); - } else { - // Object does not already have a message - // inside it, so we simply slide it down - $obj - .width('100%') - .html('<div style="display: none;">' + msg + '</div>') - .find('div') - .first() - .slideDown(function() { - // Set the height of the parent - // to the height of the child - $obj - .height( - $obj - .find('div') - .first() - .height() - ); - }); - } - return true; - } else { - return false; + .height() + ); + }); } + return true; } // end PMA_slidingMessage()
/** @@ -2554,7 +2568,7 @@ $(document).ready(function() { } // Show the query that we just executed PMA_ajaxRemoveMessage($msg); - PMA_slidingMessage($('#js_query_display'), data.sql_query); + PMA_slidingMessage(data.sql_query); } else { PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error); }
hooks/post-receive