Added localization strings for the jQueryUI dialog buttons.

This commit is contained in:
ninadsp
2010-06-29 00:17:46 +05:30
parent 25b8d37506
commit 57f2935978

View File

@@ -118,19 +118,8 @@ $(document).ready(function() {
PMA_ajaxShowMessage(); PMA_ajaxShowMessage();
$(this).append('<div id="add_user_dialog"></div>'); var button_options = {};
$.get($(this).attr("href"), {'ajax_request':true}, function(data) { button_options[PMA_messages['strCreateUser']] = function() {
$("#add_user_dialog")
.prepend(data)
.find("#fieldset_add_user_footer").hide() //showing the "Go" and "Create User" buttons together will confuse the user
.end()
.find("#addUsersForm").append('<input type="hidden" name="ajax_request" value="true" />')
.end()
.dialog({
title: PMA_messages['strAddNewUser'],
width: 800,
modal: true,
buttons: {"Create User" : function() {
var the_form = $(this).find("#addUsersForm"); var the_form = $(this).find("#addUsersForm");
@@ -149,9 +138,22 @@ $(document).ready(function() {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : "+data.error, "7000"); PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : "+data.error, "7000");
} }
}) })
}, };
"Cancel" : function() {$(this).dialog("close").remove();} button_options[PMA_messages['strCancel']] = function() { $(this).dialog("close").remove(); }
} //buttons end
$(this).append('<div id="add_user_dialog"></div>');
$.get($(this).attr("href"), {'ajax_request':true}, function(data) {
$("#add_user_dialog")
.prepend(data)
.find("#fieldset_add_user_footer").hide() //showing the "Go" and "Create User" buttons together will confuse the user
.end()
.find("#addUsersForm").append('<input type="hidden" name="ajax_request" value="true" />')
.end()
.dialog({
title: PMA_messages['strAddNewUser'],
width: 800,
modal: true,
buttons: button_options
}); //dialog options end }); //dialog options end
}); });
@@ -200,13 +202,16 @@ $(document).ready(function() {
PMA_ajaxShowMessage(); PMA_ajaxShowMessage();
var button_options = {};
button_options[PMA_messages['strCancel']] = function() { $(this).dialog("close").remove(); }
$(this).append('<div id="edit_user_dialog"></div>'); $(this).append('<div id="edit_user_dialog"></div>');
$.get($(this).attr('href'), {'ajax_request':true}, function(data) { $.get($(this).attr('href'), {'ajax_request':true}, function(data) {
$("#edit_user_dialog") $("#edit_user_dialog")
.append(data) .append(data)
.dialog({ .dialog({
width: 900, width: 900,
buttons: {"Cancel": function() {$(this).dialog("close").remove() ;}} buttons: button_options
}) })
}) })
}) })
@@ -239,14 +244,15 @@ $(document).ready(function() {
PMA_ajaxShowMessage(); PMA_ajaxShowMessage();
var button_options = {};
button_options[PMA_messages['strClose']] = function() { $(this).dialog("close").remove(); }
$.get($(this).attr('href'), {'ajax_request': true}, function(data) { $.get($(this).attr('href'), {'ajax_request': true}, function(data) {
$('<div id="export_dialog"></div>') $('<div id="export_dialog"></div>')
.prepend(data) .prepend(data)
.dialog({ .dialog({
width : 500, width : 500,
buttons: {"Close" : function() { buttons: button_options
$(this).dialog("close").remove();
}}
}); });
}) //end $.get }) //end $.get
}) //end export privileges }) //end export privileges