Skip to content

Commit

Permalink
Merge branch 'master' into drizzle
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrp committed May 16, 2011
2 parents 3ff9e70 + c74fad4 commit abd6b3b
Show file tree
Hide file tree
Showing 101 changed files with 41,120 additions and 31,767 deletions.
13 changes: 12 additions & 1 deletion ChangeLog
Expand Up @@ -2,10 +2,21 @@
======================

3.5.0.0 (not yet released)
+ rfe #2021981 [interface] Add support for mass prefix change.
+ "up to date" message on main page when current version is up to date
+ Update to jQuery 1.6.1
+ Patch #3256122 [search] Show/hide db search results
+ Patch #3302354 Add gettext wrappers around a message

3.4.1.0 (not yet released)
- bug #3301108 [interface] Synchronize and already configured host
- bug #3302457 Inline edit and $cfg['PropertiesIconic']
- Patch #3302313 Show a translated label
- bug #3300981 [navi] Table filter is case sensitive
- bug #3285929 [privileges] Revert temporary fix
- bug #3302872 [synchronize] Synchronize and user name

3.4.0.0 (not yet released)
3.4.0.0 (2011-05-11)
+ rfe #2890226 [view] Enable VIEW rename
+ rfe #838637 [privileges] Export a user's privileges
- [core] Updated mootools to fix some glitches with Safari.
Expand Down
6 changes: 6 additions & 0 deletions db_structure.php
Expand Up @@ -519,6 +519,12 @@
. __('Repair table') . '</option>' . "\n";
echo ' <option value="analyze_tbl" >'
. __('Analyze table') . '</option>' . "\n";
echo ' <option value="add_prefix_tbl" >'
. __('Add prefix to table') . '</option>' . "\n";
echo ' <option value="replace_prefix_tbl" >'
. __('Replace table prefix') . '</option>' . "\n";
echo ' <option value="copy_tbl_change_prefix" >'
. __('Copy table with prefix') . '</option>' . "\n";
}
?>
</select>
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -153,7 +153,7 @@ function getFrames() {
// ]]>
</script>
<?php
echo PMA_includeJS('jquery/jquery-1.4.4.js');
echo PMA_includeJS('jquery/jquery-1.6.1.js');
echo PMA_includeJS('update-location.js');
echo PMA_includeJS('common.js');
?>
Expand Down
43 changes: 39 additions & 4 deletions js/db_search.js
Expand Up @@ -51,14 +51,14 @@ function deleteResult(result_path , msg , ajaxEnable){
/** Load the deleted option to the page*/
$('#browse-results').load(result_path + " '"+'#result_query' + "'");
$('#sqlqueryform').load(result_path + " '"+'#sqlqueryform' + "'");
$('#togglequerybox').html(PMA_messages['strHideQueryBox']);
$('#togglequerybox').html(PMA_messages['strShowQueryBox']);

/** Refresh the search results after the deletion */
document.getElementById('buttonGo'). click();
//PMA_ajaxShowMessage(PMA_messages['strDeleting']);
/** Show the results of the deletion option */
$('#browse-results').show();
$('#sqlqueryform').show();
$('#sqlqueryform').hide();
$('#togglequerybox').show();
}
else
Expand Down Expand Up @@ -89,6 +89,31 @@ $(document).ready(function() {
$('#sqlqueryform').hide();
$('#togglequerybox').hide();
});
/**
*Prepare a div containing a link for toggle the search results
*/
$('<div id="togglesearchresultsdiv"><a id="togglesearchresultlink"></a></div>')
.insertAfter('#searchresults')
/** don't show it until we have results on-screen */
.hide();

$('<br class="clearfloat" />').insertAfter("#togglesearchresultsdiv").show();
/** Changing the displayed text according to the hide/show criteria in search result forms*/

$('#togglesearchresultlink')
.html(PMA_messages['strHideSearchResults'])
.bind('click', function() {
var $link = $(this);
$('#searchresults').slideToggle();
if ($link.text() == PMA_messages['strHideSearchResults']) {
$link.text(PMA_messages['strShowSearchResults']);
} else {
$link.text(PMA_messages['strHideSearchResults']);
}
/** avoid default click action */
return false;
});

/**
* Prepare a div containing a link for toggle the search form, otherwise it's incorrectly displayed
* after a couple of clicks
Expand All @@ -101,7 +126,7 @@ $(document).ready(function() {
/** Changing the displayed text according to the hide/show criteria in search form*/
$("#togglequerybox").hide();
$("#togglequerybox").bind('click', function() {
var $link = $(this)
var $link = $(this);
$('#sqlqueryform').slideToggle("medium");
if ($link.text() == PMA_messages['strHideQueryBox']) {
$link.text(PMA_messages['strShowQueryBox']);
Expand All @@ -110,7 +135,7 @@ $(document).ready(function() {
}
/** avoid default click action */
return false;
})
});

/** don't show it until we have results on-screen */

Expand Down Expand Up @@ -149,6 +174,16 @@ $(document).ready(function() {
// found results
$("#searchresults").html(response);
$("#sqlqueryresults").trigger('appendAnchor');

$('#togglesearchresultlink')
// always start with the Show message
.text(PMA_messages['strHideSearchResults'])
$('#togglesearchresultsdiv')
// now it's time to show the div containing the link
.show();
$('#searchresults').show();


$('#db_search_form')
// workaround for Chrome problem (bug #3168569)
.slideToggle()
Expand Down
115 changes: 91 additions & 24 deletions js/functions.js
Expand Up @@ -90,19 +90,23 @@ function parseVersionString (str) {
* Indicates current available version on main page.
*/
function PMA_current_version() {
var current = parseVersionString('3.4.0'/*pmaversion*/);
var current = parseVersionString(pmaversion);
var latest = parseVersionString(PMA_latest_version);
$('#li_pma_version').append(PMA_messages['strLatestAvailable'] + ' ' + PMA_latest_version);
var version_information_message = PMA_messages['strLatestAvailable'] + ' ' + PMA_latest_version;
if (latest > current) {
var message = $.sprintf(PMA_messages['strNewerVersion'], PMA_latest_version, PMA_latest_date);
if (Math.floor(latest / 10000) == Math.floor(current / 10000)) {
/* Security update */
klass = 'warning';
klass = 'error';
} else {
klass = 'notice';
}
$('#maincontainer').after('<div class="' + klass + '">' + message + '</div>');
}
if (latest == current) {
version_information_message = ' (' + PMA_messages['strUpToDate'] + ')';
}
$('#li_pma_version').append(version_information_message);
}

/**
Expand Down Expand Up @@ -743,21 +747,19 @@ function insertQuery(queryType) {
valDis += "[value-" + NbSelect + "]";
editDis += myListBox.options[i].value + "=[value-" + NbSelect + "]";
}
if (queryType == "selectall") {
query = "SELECT * FROM `" + table + "` WHERE 1";
} else if (queryType == "select") {
query = "SELECT " + chaineAj + " FROM `" + table + "` WHERE 1";
} else if (queryType == "insert") {
query = "INSERT INTO `" + table + "`(" + chaineAj + ") VALUES (" + valDis + ")";
} else if (queryType == "update") {
query = "UPDATE `" + table + "` SET " + editDis + " WHERE 1";
} else if(queryType == "delete") {
query = "DELETE FROM `" + table + "` WHERE 1";
} else if(queryType == "clear") {
query = '';
}
document.sqlform.sql_query.value = query;
sql_box_locked = false;
if (queryType == "selectall") {
query = "SELECT * FROM `" + table + "` WHERE 1";
} else if (queryType == "select") {
query = "SELECT " + chaineAj + " FROM `" + table + "` WHERE 1";
} else if (queryType == "insert") {
query = "INSERT INTO `" + table + "`(" + chaineAj + ") VALUES (" + valDis + ")";
} else if (queryType == "update") {
query = "UPDATE `" + table + "` SET " + editDis + " WHERE 1";
} else if(queryType == "delete") {
query = "DELETE FROM `" + table + "` WHERE 1";
}
document.sqlform.sql_query.value = query;
sql_box_locked = false;
}
}

Expand Down Expand Up @@ -1145,7 +1147,11 @@ $(document).ready(function(){
});

$('.sqlbutton').click(function(evt){
insertQuery(evt.target.id);
if (evt.target.id == 'clear') {
$('#sqlquery').val('');
} else {
insertQuery(evt.target.id);
}
return false;
});

Expand Down Expand Up @@ -1269,7 +1275,7 @@ function PMA_ajaxShowMessage(message, timeout) {
.hide();
})
}

return $("#loading");
}

Expand Down Expand Up @@ -1442,7 +1448,7 @@ $(document).ready(function() {
open: PMA_verifyTypeOfAllColumns,
buttons : button_options
}); // end dialog options
}
}
PMA_ajaxRemoveMessage($msgbox);
}) // end $.get()

Expand Down Expand Up @@ -1583,7 +1589,7 @@ $(document).ready(function() {
$("#create_table_div").html(data);
}
PMA_verifyTypeOfAllColumns();
PMA_ajaxRemoveMessage($msgbox);
PMA_ajaxRemoveMessage($msgbox);
}) //end $.post()

}) // end create table form (add fields)
Expand Down Expand Up @@ -1733,7 +1739,7 @@ $(document).ready(function() {
.dialog({
title: PMA_messages['strChangePassword'],
width: 600,
close: function(ev,ui) {$(this).remove();},
close: function(ev,ui) {$(this).remove();},
buttons : button_options,
beforeClose: function(ev,ui){ $('#change_password_anchor.dialog_active').removeClass('dialog_active').addClass('ajax')}
})
Expand Down Expand Up @@ -1772,7 +1778,7 @@ $(document).ready(function() {
$("#change_password_dialog").hide().remove();
$("#edit_user_dialog").dialog("close").remove();
$('#change_password_anchor.dialog_active').removeClass('dialog_active').addClass('ajax');
PMA_ajaxRemoveMessage($msgbox);
PMA_ajaxRemoveMessage($msgbox);
}
else {
PMA_ajaxShowMessage(data.error);
Expand Down Expand Up @@ -2278,3 +2284,64 @@ $(document).ready(function() {

}) // end of $(document).ready()

/**
* Attach Ajax event handlers for Drop Table.
*
* @uses $.PMA_confirm()
* @uses PMA_ajaxShowMessage()
* @uses window.parent.refreshNavigation()
* @uses window.parent.refreshMain()
* @see $cfg['AjaxEnable']
*/
$(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
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDropTableStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'DROP TABLE ' + window.parent.table;

$(this).PMA_confirm(question, $(this).attr('href') ,function(url) {

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();
}) // end $.get()
}); // end $.PMA_confirm()
}); //end of Drop Table Ajax action
}) // end of $(document).ready() for Drop Table

/**
* Attach Ajax event handlers for Truncate Table.
*
* @uses $.PMA_confirm()
* @uses PMA_ajaxShowMessage()
* @uses window.parent.refreshNavigation()
* @uses window.parent.refreshMain()
* @see $cfg['AjaxEnable']
*/
$(document).ready(function() {
$("#truncate_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
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strTruncateTableStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + ' :\n' + 'TRUNCATE TABLE ' + window.parent.table;

$(this).PMA_confirm(question, $(this).attr('href') ,function(url) {

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();
}) // end $.get()
}); // end $.PMA_confirm()
}); //end of Drop Table Ajax action
}) // end of $(document).ready() for Drop Table
2 changes: 1 addition & 1 deletion js/import.js
Expand Up @@ -16,7 +16,7 @@ function changePluginOpts() {
var selected_plugin_name = $("#plugins option:selected").attr("value");
$("#" + selected_plugin_name + "_options").fadeIn('slow');
if(selected_plugin_name == "csv") {
$("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one");
$("#import_notification").text(PMA_messages['strImportCSV']);
} else {
$("#import_notification").text("");
}
Expand Down

0 comments on commit abd6b3b

Please sign in to comment.