Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauriciofauth@gmail.com>2018-05-12 08:40:33 +0300
committerMaurício Meneghini Fauth <mauriciofauth@gmail.com>2018-05-12 08:40:33 +0300
commit29364925556d8a7faa0ca94b640d8716b3c68478 (patch)
treebebf8caa3d8d739530df747fd193dd2a0daa290a /js
parentd18076eb96179421081b39e37a1b465e1287753d (diff)
Revert "Replace .focus() with .on()"
This reverts commit d18076eb96179421081b39e37a1b465e1287753d. Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Diffstat (limited to 'js')
-rw-r--r--js/console.js8
-rw-r--r--js/designer/history.js4
-rw-r--r--js/functions.js58
-rw-r--r--js/keyhandler.js2
-rw-r--r--js/makegrid.js10
-rw-r--r--js/navigation.js2
-rw-r--r--js/normalization.js6
-rw-r--r--js/rte.js22
-rw-r--r--js/server_databases.js2
-rw-r--r--js/server_privileges.js6
-rw-r--r--js/server_variables.js2
-rw-r--r--js/sql.js2
-rw-r--r--js/tbl_chart.js2
13 files changed, 63 insertions, 63 deletions
diff --git a/js/console.js b/js/console.js
index 79dcbce208..a0fe38f24b 100644
--- a/js/console.js
+++ b/js/console.js
@@ -135,7 +135,7 @@ var PMA_console = {
PMA_console.$consoleContent.on('click', function (event) {
if (event.target === this) {
- PMA_consoleInput.trigger('focus');
+ PMA_consoleInput.focus();
}
});
@@ -292,7 +292,7 @@ var PMA_console = {
'fast', 'easeOutQuart', function () {
$(window).trigger('resize');
if (inputFocus) {
- PMA_consoleInput.trigger('focus');
+ PMA_consoleInput.focus();
}
});
},
@@ -664,7 +664,7 @@ var PMA_consoleInput = {
* @return void
*/
focus: function () {
- PMA_consoleInput._inputs.console.trigger('focus');
+ PMA_consoleInput._inputs.console.focus();
},
/**
* Used for blur input
@@ -873,7 +873,7 @@ var PMA_consoleMessages = {
});
$targetMessage.find('.action.edit').on('click', function () {
PMA_consoleInput.setText($(this).parent().siblings('.query').text());
- PMA_consoleInput.trigger('focus');
+ PMA_consoleInput.focus();
});
$targetMessage.find('.action.requery').on('click', function () {
var query = $(this).parent().siblings('.query').text();
diff --git a/js/designer/history.js b/js/designer/history.js
index 5d0d965de0..6aaefbe80b 100644
--- a/js/designer/history.js
+++ b/js/designer/history.js
@@ -821,10 +821,10 @@ function build_query (formtitle, fadin) {
}
if (vqb_editor) {
vqb_editor.setValue(q_select);
- vqb_editor.trigger('focus');
+ vqb_editor.focus();
} else {
$elm.val(q_select);
- $elm.trigger('focus');
+ $elm.focus();
}
}
diff --git a/js/functions.js b/js/functions.js
index a42d3add1c..b4351e49b8 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -393,7 +393,7 @@ function PMA_sprintf () {
*/
function PMA_hideShowDefaultValue ($default_type) {
if ($default_type.val() === 'USER_DEFINED') {
- $default_type.siblings('.default_value').show().trigger('focus');
+ $default_type.siblings('.default_value').show().focus();
} else {
$default_type.siblings('.default_value').hide();
if ($default_type.val() === 'NULL') {
@@ -731,7 +731,7 @@ function confirmQuery (theForm1, sqlQuery1) {
return true;
} else {
// statement is rejected -> do not submit the form
- window.trigger('focus');
+ window.focus();
return false;
} // end if (handle confirm box result)
} // end if (display confirm box)
@@ -777,9 +777,9 @@ function checkSqlQuery (theForm) {
}
if (codemirror_editor) {
- codemirror_editor.trigger('focus');
+ codemirror_editor.focus();
} else if (codemirror_inline_editor) {
- codemirror_inline_editor.trigger('focus');
+ codemirror_inline_editor.focus();
}
return result;
} // end of the 'checkSqlQuery()' function
@@ -823,12 +823,12 @@ function checkFormElementInRange (theForm, theFieldName, message, min, max) {
if (isNaN(val)) {
theField.select();
alert(PMA_messages.strEnterValidNumber);
- theField.trigger('focus');
+ theField.focus();
return false;
} else if (val < min || val > max) {
theField.select();
alert(PMA_sprintf(message, val));
- theField.trigger('focus');
+ theField.focus();
return false;
} else {
theField.value = val;
@@ -860,7 +860,7 @@ function checkTableEditForm (theForm, fieldsCnt) {
if (isNaN(val) && elm3.val() !== '') {
elm2.select();
alert(PMA_messages.strEnterValidLength);
- elm2.trigger('focus');
+ elm2.focus();
return false;
}
}
@@ -875,7 +875,7 @@ function checkTableEditForm (theForm, fieldsCnt) {
if (atLeastOneField === 0) {
var theField = theForm.elements.field_0_1;
alert(PMA_messages.strFormEmpty);
- theField.trigger('focus');
+ theField.focus();
return false;
}
@@ -883,7 +883,7 @@ function checkTableEditForm (theForm, fieldsCnt) {
var $input = $('input.textfield[name=\'table\']');
if ($input.val() === '') {
alert(PMA_messages.strFormEmpty);
- $input.trigger('focus');
+ $input.focus();
return false;
}
@@ -1107,10 +1107,10 @@ function setSelectOptions (the_form, the_select, do_check) {
function setQuery (query) {
if (codemirror_editor) {
codemirror_editor.setValue(query);
- codemirror_editor.trigger('focus');
+ codemirror_editor.focus();
} else if (document.sqlform) {
document.sqlform.sql_query.value = query;
- document.sqlform.sql_query.trigger('focus');
+ document.sqlform.sql_query.focus();
}
}
@@ -1251,10 +1251,10 @@ function insertValueQuery () {
/* CodeMirror support */
if (codemirror_editor) {
codemirror_editor.replaceSelection(columnsList);
- codemirror_editor.trigger('focus');
+ codemirror_editor.focus();
// IE support
} else if (document.selection) {
- myQuery.trigger('focus');
+ myQuery.focus();
var sel = document.selection.createRange();
sel.text = columnsList;
// MOZILLA/NETSCAPE support
@@ -1264,7 +1264,7 @@ function insertValueQuery () {
var SqlString = document.sqlform.sql_query.value;
myQuery.value = SqlString.substring(0, startPos) + columnsList + SqlString.substring(endPos, SqlString.length);
- myQuery.trigger('focus');
+ myQuery.focus();
} else {
myQuery.value += columnsList;
}
@@ -2035,12 +2035,12 @@ function bindCodeMirrorToInlineEditor () {
codemirror_inline_editor = PMA_getSQLEditor($inline_editor);
codemirror_inline_editor.getWrapperElement().style.height = height;
codemirror_inline_editor.refresh();
- codemirror_inline_editor.trigger('focus');
+ codemirror_inline_editor.focus();
$(codemirror_inline_editor.getWrapperElement())
.on('keydown', catchKeypressesFromSqlInlineEdit);
} else {
$inline_editor
- .trigger('focus')
+ .focus()
.on('keydown', catchKeypressesFromSqlInlineEdit);
}
}
@@ -3031,7 +3031,7 @@ function PMA_checkPassword ($the_form) {
alert(alert_msg);
$password.val('');
$password_repeat.val('');
- $password.trigger('focus');
+ $password.focus();
return false;
}
return true;
@@ -3053,7 +3053,7 @@ AJAX.registerOnload('functions.js', function () {
} else if (this.value === 'hosttable') {
hostname.val('').prop('required', false);
} else if (this.value === 'userdefined') {
- hostname.trigger('focus').select().prop('required', true);
+ hostname.focus().select().prop('required', true);
}
});
@@ -3069,7 +3069,7 @@ AJAX.registerOnload('functions.js', function () {
$('#pma_username').val('').prop('required', false);
$('#user_exists_warning').css('display', 'none');
} else if (this.value === 'userdefined') {
- $('#pma_username').trigger('focus').select().prop('required', true);
+ $('#pma_username').focus().select().prop('required', true);
}
});
@@ -3086,7 +3086,7 @@ AJAX.registerOnload('functions.js', function () {
$('#text_pma_pw').prop('required', false).val('');
} else if (this.value === 'userdefined') {
$('#text_pma_pw2').prop('required', true);
- $('#text_pma_pw').prop('required', true).trigger('focus').select();
+ $('#text_pma_pw').prop('required', true).focus().select();
} else {
$('#text_pma_pw2').prop('required', false);
$('#text_pma_pw').prop('required', false);
@@ -3183,7 +3183,7 @@ AJAX.registerOnload('functions.js', function () {
$('fieldset#fieldset_change_password')
.find('legend').remove().end()
.find('table.noclick').unwrap().addClass('some-margin')
- .find('input#text_pma_pw').trigger('focus');
+ .find('input#text_pma_pw').focus();
$('#fieldset_change_password_footer').hide();
PMA_ajaxRemoveMessage($msgbox);
$('#change_password_form').on('submit', function (e) {
@@ -3462,7 +3462,7 @@ AJAX.registerOnload('functions.js', function () {
buttons: buttonOptions,
open: function () {
// Focus the "Go" button after opening the dialog
- $(this).closest('.ui-dialog').find('.ui-dialog-buttonpane button:first').trigger('focus');
+ $(this).closest('.ui-dialog').find('.ui-dialog-buttonpane button:first').focus();
},
close: function () {
$(this).remove();
@@ -3608,7 +3608,7 @@ AJAX.registerOnload('functions.js', function () {
}
return false;
});
- $(this).closest('.ui-dialog').find('.ui-dialog-buttonpane button:first').trigger('focus');
+ $(this).closest('.ui-dialog').find('.ui-dialog-buttonpane button:first').focus();
},
close: function () {
$('#col_list').off('click', '.pick');
@@ -3700,7 +3700,7 @@ AJAX.registerOnload('functions.js', function () {
if ($(this).find('option:selected').val() === '') {
return true;
}
- $(this).closest('tr').find('input').trigger('focus');
+ $(this).closest('tr').find('input').focus();
};
while (rows_to_add--) {
@@ -3854,14 +3854,14 @@ function showIndexEditDialog ($outer) {
if ($(this).find('option:selected').val() === '') {
return true;
}
- $(this).closest('tr').find('input').trigger('focus');
+ $(this).closest('tr').find('input').focus();
});
// Focus the slider, otherwise it looks nearly transparent
$('a.ui-slider-handle').addClass('ui-state-focus');
// set focus on index name input, if empty
var input = $outer.find('input#input_index_name');
if (! input.val()) {
- input.trigger('focus');
+ input.focus();
}
}
@@ -4324,11 +4324,11 @@ AJAX.registerOnload('functions.js', function () {
if ($elm.length > 0) {
if (typeof CodeMirror !== 'undefined') {
codemirror_editor = PMA_getSQLEditor($elm);
- codemirror_editor.trigger('focus');
+ codemirror_editor.focus();
codemirror_editor.on('blur', updateQueryParameters);
} else {
// without codemirror
- $elm.trigger('focus').on('blur', updateQueryParameters);
+ $elm.focus().on('blur', updateQueryParameters);
}
}
PMA_highlightSQL($('body'));
@@ -4578,7 +4578,7 @@ function PMA_createViewDialog ($this) {
});
// Attach syntax highlighted editor
codemirror_editor = PMA_getSQLEditor($dialog.find('textarea'));
- $('input:visible[type=text]', $dialog).first().trigger('focus');
+ $('input:visible[type=text]', $dialog).first().focus();
} else {
PMA_ajaxShowMessage(data.error);
}
diff --git a/js/keyhandler.js b/js/keyhandler.js
index b68dadec1a..a5e459fa1a 100644
--- a/js/keyhandler.js
+++ b/js/keyhandler.js
@@ -90,7 +90,7 @@ function onKeyDownArrowsHandler (e) {
var lvalue = o.selectedIndex;
var nOvalue = nO.selectedIndex;
- nO.trigger('focus');
+ nO.focus();
if (is_firefox) {
var ffcheck = 0;
diff --git a/js/makegrid.js b/js/makegrid.js
index ddff82cead..59f0d2041d 100644
--- a/js/makegrid.js
+++ b/js/makegrid.js
@@ -606,7 +606,7 @@ function PMA_makegrid (t, enableResize, enableReorder, enableVisib, enableGridEd
$(g.cEdit).find('.edit_box').val(value);
g.currentEditCell = cell;
- $(g.cEdit).find('.edit_box').trigger('focus');
+ $(g.cEdit).find('.edit_box').focus();
moveCursorToEnd($(g.cEdit).find('.edit_box'));
$(g.cEdit).find('*').prop('disabled', false);
}
@@ -616,7 +616,7 @@ function PMA_makegrid (t, enableResize, enableReorder, enableVisib, enableGridEd
var originalValue = input.val();
var originallength = originalValue.length;
input.val('');
- input.blur().trigger('focus').val(originalValue);
+ input.blur().focus().val(originalValue);
input[0].setSelectionRange(originallength, originallength);
}
},
@@ -1616,7 +1616,7 @@ function PMA_makegrid (t, enableResize, enableReorder, enableVisib, enableGridEd
resizable: false,
modal: true
})
- .find('input').trigger('focus').select();
+ .find('input').focus().select();
});
$(g.t).find('th.draggable a')
.dblclick(function (e) {
@@ -2032,7 +2032,7 @@ function PMA_makegrid (t, enableResize, enableReorder, enableVisib, enableGridEd
$(g.cEditStd).on('keydown', 'input.edit_box, select', handleCtrlNavigation);
- $(g.cEditStd).find('.edit_box').on('focus', function () {
+ $(g.cEditStd).find('.edit_box').focus(function () {
g.showEditArea();
});
$(g.cEditStd).on('keydown', '.edit_box, select', function (e) {
@@ -2051,7 +2051,7 @@ function PMA_makegrid (t, enableResize, enableReorder, enableVisib, enableGridEd
$(g.cEditTextarea).on('keydown', 'textarea.edit_box, select', handleCtrlNavigation);
- $(g.cEditTextarea).find('.edit_box').on('focus', function () {
+ $(g.cEditTextarea).find('.edit_box').focus(function () {
g.showEditArea();
});
$(g.cEditTextarea).on('keydown', '.edit_box, select', function (e) {
diff --git a/js/navigation.js b/js/navigation.js
index 4829645cb5..3168b25041 100644
--- a/js/navigation.js
+++ b/js/navigation.js
@@ -1602,7 +1602,7 @@ PMA_fastFilter.filter.prototype.restore = function (focus) {
this.$this.html(this.$clone.html()).children().show();
this.$this.data('fastFilter', this);
if (focus) {
- this.$this.find('li.fast_filter input.searchClause').trigger('focus');
+ this.$this.find('li.fast_filter input.searchClause').focus();
}
}
this.searchClause = '';
diff --git a/js/normalization.js b/js/normalization.js
index 7558808685..41de567f29 100644
--- a/js/normalization.js
+++ b/js/normalization.js
@@ -424,11 +424,11 @@ function moveRepeatingGroup (repeatingCols) {
var newTable = $('input[name=repeatGroupTable]').val();
var newColumn = $('input[name=repeatGroupColumn]').val();
if (!newTable) {
- $('input[name=repeatGroupTable]').trigger('focus');
+ $('input[name=repeatGroupTable]').focus();
return false;
}
if (!newColumn) {
- $('input[name=repeatGroupColumn]').trigger('focus');
+ $('input[name=repeatGroupColumn]').focus();
return false;
}
datastring = {
@@ -521,7 +521,7 @@ AJAX.registerOnload('normalization.js', function () {
$('.tblFooters').on('click','#saveSplit', function () {
central_column_list = [];
if ($('#newCols #field_0_1').val() === '') {
- $('#newCols #field_0_1').trigger('focus');
+ $('#newCols #field_0_1').focus();
return false;
}
var argsep = PMA_commonParams.get('arg_separator');
diff --git a/js/rte.js b/js/rte.js
index c69acf8dc8..17cfaace74 100644
--- a/js/rte.js
+++ b/js/rte.js
@@ -77,16 +77,16 @@ RTE.COMMON = {
// and the definition must be provided for an item
$elm = $('table.rte_table').last().find('input[name=item_name]');
if ($elm.val() === '') {
- $elm.trigger('focus');
+ $elm.focus();
alert(PMA_messages.strFormEmpty);
return false;
}
$elm = $('table.rte_table').find('textarea[name=item_definition]');
if ($elm.val() === '') {
if (this.syntaxHiglighter !== null) {
- this.syntaxHiglighter.trigger('focus');
+ this.syntaxHiglighter.focus();
} else {
- $('textarea[name=item_definition]').last().trigger('focus');
+ $('textarea[name=item_definition]').last().focus();
}
alert(PMA_messages.strFormEmpty);
return false;
@@ -344,7 +344,7 @@ RTE.COMMON = {
if ($('#rteDialog').parents('.ui-dialog').height() > $(window).height()) {
$('#rteDialog').dialog('option', 'height', $(window).height());
}
- $(this).find('input[name=item_name]').trigger('focus');
+ $(this).find('input[name=item_name]').focus();
$(this).find('input.datefield').each(function () {
PMA_addDatepicker($(this).css('width', '95%'), 'date');
});
@@ -554,7 +554,7 @@ RTE.EVENT = {
// The interval field must not be empty for recurring events
$elm = this.$ajaxDialog.find('input[name=item_interval_value]');
if ($elm.val() === '') {
- $elm.trigger('focus');
+ $elm.focus();
alert(PMA_messages.strFormEmpty);
return false;
}
@@ -562,7 +562,7 @@ RTE.EVENT = {
// The execute_at field must not be empty for "once off" events
$elm = this.$ajaxDialog.find('input[name=item_execute_at]');
if ($elm.val() === '') {
- $elm.trigger('focus');
+ $elm.focus();
alert(PMA_messages.strFormEmpty);
return false;
}
@@ -672,7 +672,7 @@ RTE.ROUTINE = {
inputname.substr(0, 15) === 'item_param_name' ||
inputname.substr(0, 15) === 'item_param_type') {
if ($(this).val() === '') {
- $(this).trigger('focus');
+ $(this).focus();
isSuccess = false;
return false;
}
@@ -694,7 +694,7 @@ RTE.ROUTINE = {
if (($inputtyp.val() === 'ENUM' || $inputtyp.val() === 'SET' || $inputtyp.val().substr(0, 3) === 'VAR') &&
$inputlen.val() === ''
) {
- $inputlen.trigger('focus');
+ $inputlen.focus();
isSuccess = false;
return false;
}
@@ -712,7 +712,7 @@ RTE.ROUTINE = {
if (($returntyp.val() === 'ENUM' || $returntyp.val() === 'SET' || $returntyp.val().substr(0, 3) === 'VAR') &&
$returnlen.val() === ''
) {
- $returnlen.trigger('focus');
+ $returnlen.focus();
alert(PMA_messages.strFormEmpty);
return false;
}
@@ -720,7 +720,7 @@ RTE.ROUTINE = {
if ($('select[name=item_type]').find(':selected').val() === 'FUNCTION') {
// A function must contain a RETURN statement in its definition
if (this.$ajaxDialog.find('table.rte_table').find('textarea[name=item_definition]').val().toUpperCase().indexOf('RETURN') < 0) {
- this.syntaxHiglighter.trigger('focus');
+ this.syntaxHiglighter.focus();
alert(PMA_messages.MissingReturn);
return false;
}
@@ -869,7 +869,7 @@ RTE.ROUTINE = {
$(this).remove();
}
});
- $ajaxDialog.find('input[name^=params]').first().trigger('focus');
+ $ajaxDialog.find('input[name^=params]').first().focus();
/**
* Attach the datepickers to the relevant form fields
*/
diff --git a/js/server_databases.js b/js/server_databases.js
index 79b4431a67..2285619b74 100644
--- a/js/server_databases.js
+++ b/js/server_databases.js
@@ -102,7 +102,7 @@ AJAX.registerOnload('server_databases.js', function () {
// TODO Remove this section when all browsers support HTML5 "required" property
var newDbNameInput = $form.find('input[name=new_db]');
if (newDbNameInput.val() === '') {
- newDbNameInput.trigger('focus');
+ newDbNameInput.focus();
alert(PMA_messages.strFormEmpty);
return;
}
diff --git a/js/server_privileges.js b/js/server_privileges.js
index 123633258c..eef6f26405 100644
--- a/js/server_privileges.js
+++ b/js/server_privileges.js
@@ -17,13 +17,13 @@
function checkAddUser (the_form) {
if (the_form.elements.pred_hostname.value === 'userdefined' && the_form.elements.hostname.value === '') {
alert(PMA_messages.strHostEmpty);
- the_form.elements.hostname.trigger('focus');
+ the_form.elements.hostname.focus();
return false;
}
if (the_form.elements.pred_username.value === 'userdefined' && the_form.elements.username.value === '') {
alert(PMA_messages.strUserEmpty);
- the_form.elements.username.trigger('focus');
+ the_form.elements.username.focus();
return false;
}
@@ -466,7 +466,7 @@ AJAX.registerOnload('server_privileges.js', function () {
$('html, body').animate({ scrollTop: 0 }, 'fast');
};
- $('input.autofocus').trigger('focus');
+ $('input.autofocus').focus();
$(checkboxes_sel).trigger('change');
displayPasswordGenerateButton();
if ($('#edit_user_dialog').length > 0) {
diff --git a/js/server_variables.js b/js/server_variables.js
index a0c2576994..eb82dc0e77 100644
--- a/js/server_variables.js
+++ b/js/server_variables.js
@@ -92,7 +92,7 @@ AJAX.registerOnload('server_variables.js', function () {
.data('content', $valueCell.html())
.html($editor)
.find('input')
- .trigger('focus')
+ .focus()
.on('keydown', function (event) { // Keyboard shortcuts
if (event.keyCode === 13) { // Enter key
$mySaveLink.trigger('click');
diff --git a/js/sql.js b/js/sql.js
index 45f7725ae5..c25124a030 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -743,7 +743,7 @@ AJAX.registerOnload('sql.js', function () {
if (query.length === 0) {
alert(PMA_messages.strFormEmpty);
- $('#sqlquery').trigger('focus');
+ $('#sqlquery').focus();
return false;
}
diff --git a/js/tbl_chart.js b/js/tbl_chart.js
index b3cc1f6cbc..30688716aa 100644
--- a/js/tbl_chart.js
+++ b/js/tbl_chart.js
@@ -309,7 +309,7 @@ AJAX.registerOnload('tbl_chart.js', function () {
// handle changes in chart title
$('input[name="chartTitle"]')
- .on('focus', function () {
+ .focus(function () {
temp_chart_title = $(this).val();
})
.on('keyup', function () {