Commit ab315323 authored by Andreas Fernandez's avatar Andreas Fernandez
Browse files

[TASK] Update jQuery to 3.5.1

jQuery 3.5 has been released a while ago, it's safe to update to the
current version. However, as 3.5.0 introduced some deprecations, it
should be updated in master only.

Executed commands:

  yarn add jquery@^3.5.1
  grunt build

Resolves: #91953
Releases: master
Change-Id: Ife43bc2679549757dede58b0b1fa92df9bce6d7f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65224


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Daniel Haupt's avatarDaniel Haupt <mail@danielhaupt.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Daniel Haupt's avatarDaniel Haupt <mail@danielhaupt.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent 936a6f01
......@@ -183,7 +183,7 @@ class ContextMenu {
const elements = this.drawMenu(items, level);
$obj.html('<div class="list-group">' + elements + '</div>');
$('a.list-group-item', $obj).click((event: JQueryEventObject): void => {
$('a.list-group-item', $obj).on('click', (event: JQueryEventObject): void => {
event.preventDefault();
const $me = $(event.currentTarget);
......
......@@ -107,7 +107,7 @@ class DocumentSaveActions {
if ((e.currentTarget.tagName === 'A' || $me.attr('form')) && !e.isDefaultPrevented()) {
$form.find('[name="doSave"]').val('1');
$form.submit();
$form.trigger('submit');
e.preventDefault();
}
}
......
......@@ -167,10 +167,10 @@ class DragUploaderPlugin {
'</p>' +
'</div>' +
'</div>',
).click(() => {
).on('click', () => {
this.fileInput.click();
});
$('<span />').addClass('dropzone-close').click(this.hideDropzone).appendTo(this.$dropzone);
$('<span />').addClass('dropzone-close').on('click', this.hideDropzone).appendTo(this.$dropzone);
// no filelist then create own progress table
if (this.$fileList.length === 0) {
......@@ -304,7 +304,7 @@ class DragUploaderPlugin {
* @param {Object} button
*/
public bindUploadButton(button: JQuery): void {
button.click((event: Event) => {
button.on('click', (event: Event) => {
event.preventDefault();
this.fileInput.click();
this.showDropzone();
......
......@@ -173,7 +173,7 @@ class ImageManipulation {
constructor() {
// silence is golden
$(window).resize((): void => {
$(window).on('resize', (): void => {
if (this.cropper) {
this.cropper.cropper('destroy');
}
......@@ -197,7 +197,7 @@ class ImageManipulation {
this.trigger = $(e.currentTarget);
this.show();
};
$('.t3js-image-manipulation-trigger').off('click').click(triggerHandler);
$('.t3js-image-manipulation-trigger').off('click').on('click', triggerHandler);
}
/**
......
......@@ -313,7 +313,7 @@ class LoginRefresh {
$('<button />', {type: 'button', class: 'btn btn-primary', 'data-action': 'refreshSession'})
.text(TYPO3.lang['mess.refresh_login_button'])
.on('click', () => {
this.$loginForm.find('form').submit();
this.$loginForm.find('form').trigger('submit');
}),
);
this.registerDefaultModalEvents(this.$loginForm).on('submit', this.submitForm);
......
......@@ -247,7 +247,7 @@ class MultiStepWizard {
*/
public blurCancelStep(): JQuery {
let $button = this.setup.$carousel.closest('.modal').find('button[name="cancel"]');
$button.blur();
$button.trigger('blur');
return $button;
}
......
......@@ -230,7 +230,7 @@ class PageActions {
Array.from(document.querySelectorAll(IdentifierEnum.newButton)).forEach((element: HTMLElement): void => {
element.classList.remove('disabled');
});
$(IdentifierEnum.newButton).click((e: JQueryEventObject): void => {
$(IdentifierEnum.newButton).on('click', (e: JQueryEventObject): void => {
e.preventDefault();
const $me = $(e.currentTarget);
......
......@@ -45,7 +45,7 @@ class ToggleSearchToolbox {
searchField.clearable({
onClear: (input: HTMLInputElement): void => {
if (searchResultShown) {
input.closest('form').submit();
input.closest('form').trigger('submit');
}
},
});
......
......@@ -42,7 +42,7 @@ class DashboardModal {
currentModal.on('button.clicked', (e: JQueryEventObject): void => {
if (e.target.getAttribute('name') === 'save') {
const formElement = currentModal.find('form');
formElement.submit();
formElement.trigger('submit');
} else {
currentModal.trigger('modal-dismiss');
}
......
......@@ -38,7 +38,7 @@ class ExtensionManagerUpdate {
const updateURL = $me.attr('action');
$me.attr('action', '#');
$me.submit((): boolean => {
$me.on('submit', (): boolean => {
// Force update on click.
this.updateFromTer(updateURL, true);
......
......@@ -63,7 +63,7 @@ class Filelist {
private static submitClipboardFormWithCommand(cmd: string): void {
const $form = $('form[name="dblistForm"]');
$form.find('input[name="cmd"]').val(cmd);
$form.submit();
$form.trigger('submit');
}
constructor() {
......@@ -71,7 +71,7 @@ class Filelist {
$((): void => {
Filelist.registerTreeUpdateEvents();
// file index events
$('[data-filelist-show-item-identifier][data-filelist-show-item-type]').click((evt: JQueryEventObject): void => {
$('[data-filelist-show-item-identifier][data-filelist-show-item-type]').on('click', (evt: JQueryEventObject): void => {
const $element = $(evt.currentTarget);
evt.preventDefault();
Filelist.openInfoPopup(
......@@ -80,15 +80,15 @@ class Filelist {
);
});
// file search events
$('a.btn.filelist-file-info').click((event: JQueryEventObject): void => {
$('a.btn.filelist-file-info').on('click', (event: JQueryEventObject): void => {
event.preventDefault();
Filelist.openInfoPopup('_FILE', $(event.currentTarget).attr('data-identifier'));
});
$('a.filelist-file-references').click((event: JQueryEventObject): void => {
$('a.filelist-file-references').on('click', (event: JQueryEventObject): void => {
event.preventDefault();
Filelist.openInfoPopup('_FILE', $(event.currentTarget).attr('data-identifier'));
});
$('a.btn.filelist-file-copy').click((event: JQueryEventObject): void => {
$('a.btn.filelist-file-copy').on('click', (event: JQueryEventObject): void => {
event.preventDefault();
const $element = $(event.currentTarget);
const url = $element.attr('href');
......@@ -104,7 +104,7 @@ class Filelist {
Filelist.submitClipboardFormWithCommand(originalEvent.detail.payload);
}
});
$('[data-filelist-clipboard-cmd]:not([data-filelist-clipboard-cmd=""])').click((evt: JQueryEventObject): void => {
$('[data-filelist-clipboard-cmd]:not([data-filelist-clipboard-cmd=""])').on('click', (evt: JQueryEventObject): void => {
const cmd = $(evt.currentTarget).data('filelistClipboardCmd');
Filelist.submitClipboardFormWithCommand(cmd);
});
......
......@@ -20,7 +20,7 @@ import $ from 'jquery';
class FileListLocalisation {
constructor() {
$((): void => {
$('a.filelist-translationToggler').click((event: JQueryEventObject): void => {
$('a.filelist-translationToggler').on('click', (event: JQueryEventObject): void => {
const id = $(event.currentTarget).attr('data-fileid');
$('div[data-fileid="' + id + '"]').toggle();
});
......
......@@ -79,12 +79,12 @@ class RenameFile {
modal.on('button.clicked', (event: any): void => {
if (event.target.name !== 'cancel') {
conflictModeField.val(event.target.name);
form.submit();
form.trigger('submit');
}
Modal.dismiss();
});
} else {
form.submit();
form.trigger('submit');
}
},
url: ajaxUrl,
......
......@@ -28,7 +28,7 @@ class ImportExport {
.on('confirm.button.ok', (): void => {
$('#t3js-submit-field')
.attr('name', $button.attr('name'))
.closest('form').submit();
.closest('form').trigger('submit');
Modal.currentModal.trigger('modal-dismiss');
})
.on('confirm.button.cancel', (): void => {
......
......@@ -40,12 +40,12 @@ class ExtensionConfiguration extends AbstractInteractableModule {
// Focus search field on ctrl-f
if (String.fromCharCode(e.which).toLowerCase() === 'f') {
e.preventDefault();
$searchInput.focus();
$searchInput.trigger('focus');
}
} else if (e.keyCode === 27) {
// Clear search on ESC key
e.preventDefault();
$searchInput.val('').focus();
$searchInput.val('').trigger('focus');
}
});
......@@ -175,7 +175,7 @@ class ExtensionConfiguration extends AbstractInteractableModule {
const offsetGroup = $('<div>', {'class': 'form-multigroup-wrap'}).append(elementX, elementY);
$parent.append(offsetGroup);
$parent.find('.t3js-emconf-offsetfield').keyup((evt: JQueryEventObject): void => {
$parent.find('.t3js-emconf-offsetfield').on('keyup', (evt: JQueryEventObject): void => {
const $target = $parent.find($(evt.currentTarget).data('target'));
$target.val($parent.find($target.data('offsetfield-x')).val() + ',' + $parent.find($target.data('offsetfield-y')).val());
});
......@@ -211,7 +211,7 @@ class ExtensionConfiguration extends AbstractInteractableModule {
),
);
$parent.append(wrapGroup);
$parent.find('.t3js-emconf-wrapfield').keyup((evt: JQueryEventObject): void => {
$parent.find('.t3js-emconf-wrapfield').on('keyup', (evt: JQueryEventObject): void => {
const $target = $parent.find($(evt.currentTarget).data('target'));
$target.val($parent.find($target.data('wrapfield-start')).val() + '|' + $parent.find($target.data('wrapfield-end')).val());
});
......
......@@ -61,12 +61,12 @@ class LocalConfiguration extends AbstractInteractableModule {
// Focus search field on ctrl-f
if (String.fromCharCode(e.which).toLowerCase() === 'f') {
e.preventDefault();
$searchInput.focus();
$searchInput.trigger('focus');
}
} else if (e.keyCode === 27) {
// Clear search on ESC key
e.preventDefault();
$searchInput.val('').focus();
$searchInput.val('').trigger('focus');
}
});
......
......@@ -41,7 +41,7 @@ class Router {
$(document).on('keydown', '#t3-install-form-password', (e: JQueryEventObject): void => {
if (e.key === 'Enter') {
e.preventDefault();
$('.t3js-login-login').click();
$('.t3js-login-login').trigger('click');
}
});
......
......@@ -72,7 +72,7 @@ class QueryGenerator {
* Submit the form
*/
private doSubmit(): void {
this.form.submit();
this.form.trigger('submit');
}
/**
......
......@@ -21,7 +21,7 @@ import $ from 'jquery';
class FieldSelectBox {
constructor() {
$(() => {
$('.fieldSelectBox .checkAll').change((event: JQueryEventObject): void => {
$('.fieldSelectBox .checkAll').on('change', (event: JQueryEventObject): void => {
const checked = $(event.currentTarget).prop('checked');
const $checkboxes = $('.fieldSelectBox tbody').find(':checkbox');
$checkboxes.each((index: number, elem: Element): void => {
......
......@@ -149,25 +149,25 @@ class Scheduler {
this.checkOrUncheckAllCheckboxes($(evt.currentTarget));
});
$('#task_class').change((evt: JQueryEventObject): void => {
$('#task_class').on('change', (evt: JQueryEventObject): void => {
this.actOnChangedTaskClass($(evt.currentTarget));
});
$('#task_type').change(this.actOnChangedTaskType);
$('#task_type').on('change', this.actOnChangedTaskType);
$('#task_tableGarbageCollection_allTables').change((evt: JQueryEventObject): void => {
$('#task_tableGarbageCollection_allTables').on('change', (evt: JQueryEventObject): void => {
this.actOnChangeSchedulerTableGarbageCollectionAllTables($(evt.currentTarget));
});
$('#task_tableGarbageCollection_table').change((evt: JQueryEventObject): void => {
$('#task_tableGarbageCollection_table').on('change', (evt: JQueryEventObject): void => {
this.actOnChangeSchedulerTableGarbageCollectionTable($(evt.currentTarget));
});
$('[data-update-task-frequency]').change((evt: JQueryEventObject): void => {
$('[data-update-task-frequency]').on('change', (evt: JQueryEventObject): void => {
const $target = $(evt.currentTarget);
const $taskFrequency = $('#task_frequency');
$taskFrequency.val($target.val());
$target.val($target.attr('value')).blur();
$target.val($target.attr('value')).trigger('blur');
});
const taskGroupTable = document.querySelector('table.taskGroup-table');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment