diff --git a/.doc/phpdoc-templates/combodo-wiki/graphs/class.html.twig b/.doc/phpdoc-templates/combodo-wiki/graphs/class.html.twig index 69b92fdca..c0c48af53 100644 --- a/.doc/phpdoc-templates/combodo-wiki/graphs/class.html.twig +++ b/.doc/phpdoc-templates/combodo-wiki/graphs/class.html.twig @@ -23,7 +23,7 @@ $(document).ready(function() { $("#viewer").iviewer({src: '{{ path('graphs/classes.svg') }}', zoom_animation: false}); - $('#viewer img').bind('dragstart', function(event){ + $('#viewer img').on('dragstart', function(event){ event.preventDefault(); }); $(window).resize(); diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index ebdad6b02..4d3b4e7ba 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -2931,11 +2931,11 @@ JS $sStatesSelection .= ''; $sStatesSelection .= ''; $oPage->add_ready_script(<<m_iFormId}').change( function() { +$('.state_select_{$this->m_iFormId}').on('change', function() { if ($('#obj_state_orig').val() != $(this).val()) { $('.state_select_{$this->m_iFormId}').val($(this).val()); $('#form_{$this->m_iFormId}').data('force_submit', true); - $('#form_{$this->m_iFormId}').submit(); + $('#form_{$this->m_iFormId}').trigger('submit'); } }); JS diff --git a/application/forms.class.inc.php b/application/forms.class.inc.php index 890475e4f..9877d9d84 100644 --- a/application/forms.class.inc.php +++ b/application/forms.class.inc.php @@ -363,7 +363,7 @@ $('#$sDialogId').dialog({ buttons: [ { text: "$sOkButtonLabel", click: function() { var oForm = $(this).closest('.ui-dialog').find('form'); - oForm.submit(); + oForm.trigger('submit'); if (AnimateDlgButtons) { sFormId = oForm.attr('id'); diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 1ca330f8f..b24073617 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -13037,7 +13037,7 @@ class AttributeRedundancySettings extends AttributeDBField $sEditValue = $bSelected ? $iCurrentValue : ''; $sValue = ''; // To fix an issue on Firefox: focus set to the option (because the input is within the label for the option) - $oPage->add_ready_script("\$('[name=\"$sName\"]').on('click', function(){var me=this; setTimeout(function(){\$(me).focus();}, 100);});"); + $oPage->add_ready_script("\$('[name=\"$sName\"]').on('click', function(){var me=this; setTimeout(function(){\$(me).trigger('focus');}, 100);});"); } else { @@ -13052,7 +13052,7 @@ class AttributeRedundancySettings extends AttributeDBField $sEditValue = $bSelected ? $iCurrentValue : ''; $sValue = ''; // To fix an issue on Firefox: focus set to the option (because the input is within the label for the option) - $oPage->add_ready_script("\$('[name=\"$sName\"]').on('click', function(){var me=this; setTimeout(function(){\$(me).focus();}, 100);});"); + $oPage->add_ready_script("\$('[name=\"$sName\"]').on('click', function(){var me=this; setTimeout(function(){\$(me).trigger('focus');}, 100);});"); } else { diff --git a/datamodels/2.x/authent-cas/view/cas_sso_button.html.twig b/datamodels/2.x/authent-cas/view/cas_sso_button.html.twig index a839b135e..c2f044510 100644 --- a/datamodels/2.x/authent-cas/view/cas_sso_button.html.twig +++ b/datamodels/2.x/authent-cas/view/cas_sso_button.html.twig @@ -1,7 +1,7 @@ {# @copyright Copyright (C) 2010-2024 Combodo SAS #} {# @license http://opensource.org/licenses/AGPL-3.0 #} -
+
' + tab.text() + '
'); let oTempDiv = $('
').addClass('ibo-tab--temporary-remote-content') let oPlaceholder = $('
').addClass('ibo-tab--temporary-remote-content--placeholder').load(tab.attr('data-placeholder')); - let oLoadButton = $('
').addClass('ibo-tab--temporary-remote-content--button').text(placeholder).on('click', function(){tab.find('a').click()}) + let oLoadButton = $('
').addClass('ibo-tab--temporary-remote-content--button').text(placeholder).on('click', function(){tab.find('a').trigger('click')}) oTempDiv.append(oPlaceholder) oTempDiv.append(oLoadButton) panel.append(oTempDiv); diff --git a/js/links/links_direct_widget.js b/js/links/links_direct_widget.js index 94e42fd3a..272063b74 100644 --- a/js/links/links_direct_widget.js +++ b/js/links/links_direct_widget.js @@ -121,7 +121,7 @@ $(function() /* this.datatable.trigger("update").trigger("applyWidgets"); this.datatable.tableHover();*/ - this.datatable.find('.selectList'+this.id).bind('change', function () { + this.datatable.find('.selectList'+this.id).on('change', function () { me._updateButtons(); }); @@ -202,7 +202,7 @@ $(function() me.oDlg = $('
'); $('body').append(me.oDlg); me.oDlg.html(data); - me.oDlg.find('form').removeAttr('onsubmit').bind('submit', function () { + me.oDlg.find('form').removeAttr('onsubmit').on('submit', function () { me._onSearchToAdd(); return false; }); @@ -429,7 +429,7 @@ $(function() me.oDlg.find('span.indicator').html(''); $.post(this.options.submit_to, oParams, function (data) { me.oDlg.html(data); - me.oDlg.find('form').removeAttr('onsubmit').bind('submit', function () { + me.oDlg.find('form').removeAttr('onsubmit').on('submit', function () { me._onCreateRow(); return false; }); diff --git a/js/links/links_widget.js b/js/links/links_widget.js index eaffcae21..8c35cbb04 100644 --- a/js/links/links_widget.js +++ b/js/links/links_widget.js @@ -260,7 +260,7 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH theMap[this.name] = this.value; } } - $(this).parents('tr:first').remove(); // Remove the whole line, so that, next time the dialog gets displayed it's no longer there + $(this).parents('tr').first().remove(); // Remove the whole line, so that, next time the dialog gets displayed it's no longer there } ); @@ -342,7 +342,7 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH } width = dlg.innerWidth()-padding_right-padding_left-22; // 5 (margin-left) + 5 (padding-left) + 5 (padding-right) + 5 (margin-right) + 2 for rounding ! height = dlg.innerHeight()-padding_top-padding_bottom-22; - wizard = dlg.find('.wizContainer:first'); + wizard = dlg.find('.wizContainer').first(); wizard.width(width); wizard.height(height); form_height = searchForm.outerHeight(); diff --git a/js/search/search_form_criteria.js b/js/search/search_form_criteria.js index 415c5649a..172b9059e 100644 --- a/js/search/search_form_criteria.js +++ b/js/search/search_form_criteria.js @@ -226,7 +226,7 @@ $(function() // Focus on right input var oOpElemRadioChecked = this.element.find('.sfc_fg_operator .sfc_op_radio:checked'); - var oOpElemInputFirst = oOpElemRadioChecked.closest('.sfc_fg_operator').find('.sfc_op_content input[type="text"]:first'); + var oOpElemInputFirst = oOpElemRadioChecked.closest('.sfc_fg_operator').find('.sfc_op_content input[type="text"]').first(); oOpElemInputFirst.filter(':not([data-no-auto-focus])').trigger('click').trigger('focus'); @@ -656,7 +656,7 @@ $(function() if ($(oEvent.target).is('input[type="text"], select')) { return; } - oOpContentElem.focus(); + oOpContentElem.trigger('focus'); }); // - Mark as draft on key typing oOpContentElem.on('keydown', function(oEvent){ diff --git a/js/search/search_form_criteria_date_abstract.js b/js/search/search_form_criteria_date_abstract.js index 86c07ec52..9910dde97 100644 --- a/js/search/search_form_criteria_date_abstract.js +++ b/js/search/search_form_criteria_date_abstract.js @@ -230,7 +230,7 @@ $(function() var odatetimepickerOptions = $.extend({}, oInputParam.picker_extra_params, odatetimepickerOptionsDefault, me.options.datepicker, { onSelect: function() { fHandleSynchCallback(this, false); - $(this).focus(); + $(this).trigger('focus'); } }); @@ -581,7 +581,7 @@ $(function() oOpElemDropdown.find('.sfc_op_radio').prop('checked', true); me._markAsDraft(); } - oOpElemDropdown.find('input[type="text"]:first').focus(); + oOpElemDropdown.find('input[type="text"]').first().trigger('focus'); }) .appendTo(this.element.find('.sfc_fg_operators')) ; diff --git a/js/search/search_form_criteria_numeric.js b/js/search/search_form_criteria_numeric.js index e23a70c93..e3f2bf2bd 100644 --- a/js/search/search_form_criteria_numeric.js +++ b/js/search/search_form_criteria_numeric.js @@ -129,7 +129,7 @@ $(function() if ($(oEvent.target).is('input[type="text"], select')) { return; } - oOpContentElemFrom.focus(); + oOpContentElemFrom.trigger('focus'); }); // - Apply on "enter" key hit // TODO: this could be refactored diff --git a/js/search/search_form_handler.js b/js/search/search_form_handler.js index 21165c1cf..742fe3537 100644 --- a/js/search/search_form_handler.js +++ b/js/search/search_form_handler.js @@ -319,9 +319,9 @@ $(function() // - Open it first this.elements.more_criterion.addClass('opened'); // - Focus filter - this.elements.more_criterion.find('.sf_filter:first input[type="text"]') + this.elements.more_criterion.find('.sf_filter').first().find('input[type="text"]') .val('') - .focus(); + .trigger('focus'); // - Then only check if more menu is to close to the right side (otherwise we might not have the right element's position) var iFormWidth = this.element.outerWidth(); var iFormLeftPos = this.element.offset().left; @@ -436,7 +436,7 @@ $(function() // DOM this.elements.more_criterion = $('
') .addClass('sf_more_criterion') - .appendTo(this.elements.criterion_area.find('.sf_criterion_row:first')); + .appendTo(this.elements.criterion_area.find('.sf_criterion_row').first()); // Header part var oHeaderElem = $('
') @@ -705,7 +705,7 @@ $(function() this.elements.submit_button = $('
') .addClass('sf_button') .addClass('sf_submit') - .appendTo(this.elements.criterion_area.find('.sf_criterion_row:first')); + .appendTo(this.elements.criterion_area.find('.sf_criterion_row').first()); var sButtonText = (this.options.auto_submit === true) ? Dict.S('UI:Button:Refresh') : Dict.S('UI:Button:Search'); var sButtonIcon = (this.options.auto_submit === true) ? 'fas fa-sync-alt' : 'fas fa-search'; @@ -871,7 +871,7 @@ $(function() // Add to first OR condition if not specified if(oCriterionGroupElem === undefined) { - oCriterionGroupElem = this.elements.criterion_area.find('.sf_criterion_row:first .sf_criterion_group'); + oCriterionGroupElem = this.elements.criterion_area.find('.sf_criterion_row').first().find('.sf_criterion_group'); } // Protection against bad initialization data @@ -1209,7 +1209,7 @@ $(function() { const me = this; const oFormPanelHeaderElem = this._getFormPanelHeaderElem(); - const oResultsPanelBodyElem = this._getResultsPanelElem().find('.ibo-panel--body:first'); + const oResultsPanelBodyElem = this._getResultsPanelElem().find('.ibo-panel--body').first(); // Ensure result body panel has been created if (oResultsPanelBodyElem.length === 0) { @@ -1418,7 +1418,7 @@ $(function() return null; } - return oFormPanelElem.find('[data-role="ibo-panel--header"]:first'); + return oFormPanelElem.find('[data-role="ibo-panel--header"]').first(); }, /** * @return {null|Object} The jQuery object representing the body of the search form panel; or null if none found @@ -1431,7 +1431,7 @@ $(function() return null; } - return oFormPanelElem.find('[data-role="ibo-panel--body"]:first'); + return oFormPanelElem.find('[data-role="ibo-panel--body"]').first(); }, /** * @return {Object} The jQuery object representing the complete results panel @@ -1439,7 +1439,7 @@ $(function() */ _getResultsPanelElem: function() { - return this.elements.results_area === null ? null : this.elements.results_area.find('[data-role="ibo-panel"]:first') + return this.elements.results_area === null ? null : this.elements.results_area.find('[data-role="ibo-panel"]').first(); }, /** * @return {Object} The jQuery object representing the top toolbar of the results (pagination, ...) @@ -1447,7 +1447,7 @@ $(function() */ _getResultsToolbarTopElem: function() { - return this.elements.results_area === null ? null : this.elements.results_area.find('.ibo-datatable--toolbar:first'); + return this.elements.results_area === null ? null : this.elements.results_area.find('.ibo-datatable--toolbar').first(); }, /** * @return {Object} The jQuery object representing the columns headers of the results @@ -1455,7 +1455,7 @@ $(function() */ _getResultsTableHeaders: function() { - return this.elements.results_area === null ? null : this.elements.results_area.find('.dataTables_scrollHead:first'); + return this.elements.results_area === null ? null : this.elements.results_area.find('.dataTables_scrollHead').first(); }, diff --git a/js/searchformforeignkeys.js b/js/searchformforeignkeys.js index dc702b93c..253d5cab8 100644 --- a/js/searchformforeignkeys.js +++ b/js/searchformforeignkeys.js @@ -129,7 +129,7 @@ function SearchFormForeignKeys(id, sTargetClass, sAttCode, oSearchWidgetElmt, sF { dlg.height($(window).height()-70); } - var searchForm = dlg.find('div.display_block:first'); // Top search form, enclosing display_block + var searchForm = dlg.find('div.display_block').first(); // Top search form, enclosing display_block var results = $('#SearchResultsToAdd_'+me.id); var oPadding = {}; var aKeys = ['top', 'right', 'bottom', 'left']; @@ -257,7 +257,7 @@ function SearchFormForeignKeys(id, sTargetClass, sAttCode, oSearchWidgetElmt, sF theMap[this.name] = this.value; } } - $(this).parents('tr:first').remove(); // Remove the whole line, so that, next time the dialog gets displayed it's no longer there + $(this).parents('tr').first().remove(); // Remove the whole line, so that, next time the dialog gets displayed it's no longer there } ); theMap["sFilter"] = $('#datatable_ResultsToAdd_'+me.id+' [name="filter"]').val(); @@ -300,7 +300,7 @@ function SearchFormForeignKeys(id, sTargetClass, sAttCode, oSearchWidgetElmt, sF $('#SearchResultsToAdd_'+me.id).html(me.emptyHtml); } $('#label_'+me.id).removeClass('dlg_loading'); - $('#label_'+me.id).focus(); + $('#label_'+me.id).trigger('focus'); me.ajax_request = null; }; diff --git a/js/selectize.js b/js/selectize.js index 976abbf73..fc8e0473f 100644 --- a/js/selectize.js +++ b/js/selectize.js @@ -118,7 +118,7 @@ MicroPlugin.mixin = function (Interface) { loaded: {} }; - if (isArray(plugins)) { + if (Array.isArray(plugins)) { for (i = 0, n = plugins.length; i < n; i++) { if (typeof plugins[i] === 'string') { queue.push(plugins[i]); @@ -665,7 +665,7 @@ var getInputSelection = function (input) { result.start = input.selectionStart; result.length = input.selectionEnd - result.start; } else if (document.selection) { - input.focus(); + input.trigger('focus'); var sel = document.selection.createRange(); var selLen = document.selection.createRange().text.length; sel.moveStart('character', -input.value.length); @@ -830,7 +830,7 @@ var Selectize = function($input, settings) { var computedStyle = window.getComputedStyle && window.getComputedStyle(input, null); dir = computedStyle ? computedStyle.getPropertyValue('direction') : input.currentStyle && input.currentStyle.direction; - dir = dir || $input.parents('[dir]:first').attr('dir') || ''; + dir = dir || $input.parents('[dir]').first().attr('dir') || ''; self.settings = {}; @@ -1180,7 +1180,7 @@ $.extend(Selectize.prototype, { } if (!self.isFocused || !self.isOpen) { - self.focus(); + self.trigger('focus'); e.preventDefault(); } }, @@ -1194,7 +1194,7 @@ $.extend(Selectize.prototype, { if (!defaultPrevented) { window.setTimeout(function () { if (!self.isOpen) { - self.focus(); + self.trigger('focus'); } }, 0); } @@ -1377,7 +1377,7 @@ $.extend(Selectize.prototype, { var wasFocused = self.isFocused; if (self.isDisabled) { - self.blur(); + self.trigger('blur'); e && e.preventDefault(); return false; } @@ -1415,7 +1415,7 @@ $.extend(Selectize.prototype, { self.setCaret(self.items.length); self.refreshState(); - dest && dest.focus && dest.focus(); + dest && dest.focus && dest.trigger('focus'); self.isBlurring = false; self.ignoreFocus = false; @@ -1589,7 +1589,7 @@ $.extend(Selectize.prototype, { self.hideInput(); if (!this.isFocused) { - self.focus(); + self.trigger('focus'); } }, @@ -1637,7 +1637,7 @@ $.extend(Selectize.prototype, { self.hideInput(); self.close(); } - self.focus(); + self.trigger('focus'); }, hideInput: function() { @@ -1658,7 +1658,7 @@ $.extend(Selectize.prototype, { if (self.isDisabled) return self; self.ignoreFocus = true; - self.$control_input[0].focus(); + self.$control_input[0].trigger('focus'); window.setTimeout(function() { self.ignoreFocus = false; self.onFocus(); @@ -1667,7 +1667,7 @@ $.extend(Selectize.prototype, { }, blur: function(dest) { - this.$control_input[0].blur(); + this.$control_input[0].trigger('blur'); this.onBlur(null, dest); return this; }, @@ -1837,17 +1837,17 @@ $.extend(Selectize.prototype, { if (results.items.length > 0) { $active_before = active_before && self.getOption(active_before); if (results.query !== "" && self.settings.setFirstOptionActive) { - $active = $dropdown_content.find('[data-selectable]:first') + $active = $dropdown_content.find('[data-selectable]').first(); } else if (results.query !== "" && $active_before && $active_before.length) { - $active = $active_before; + $active = $active_before; } else if (self.settings.mode === 'single' && self.items.length) { - $active = self.getOption(self.items[0]); + $active = self.getOption(self.items[0]); } if (!$active || !$active.length) { if ($create && !self.settings.addPrecedence) { $active = self.getAdjacentOption($create, 1); } else { - $active = $dropdown_content.find('[data-selectable]:first'); + $active = $dropdown_content.find('[data-selectable]').first(); } } } else { @@ -2350,7 +2350,7 @@ $.extend(Selectize.prototype, { (self.settings.mode === "multi" && self.isFull()) ) return; - self.focus(); + self.trigger('focus'); self.isOpen = true; self.refreshState(); self.$dropdown.css({ visibility: 'hidden', display: 'block' }); @@ -2368,7 +2368,7 @@ $.extend(Selectize.prototype, { self.hideInput(); if (self.isBlurring) { - self.$control_input[0].blur(); + self.$control_input[0].trigger('blur'); } } diff --git a/js/simple_graph.js b/js/simple_graph.js index 65ecedfe9..7f577fa7e 100644 --- a/js/simple_graph.js +++ b/js/simple_graph.js @@ -86,13 +86,13 @@ $(function() me._on_tabs_activate(ui); }); } - $(window).bind('resized', function () { + $(window).on('resized', function () { var that = me; window.setTimeout(function () { that._on_resize(); }, 50); }); - $('#dh_flash').bind('toggle_complete', function () { + $('#dh_flash').on('toggle_complete', function () { var that = me; window.setTimeout(function () { that._on_resize(); @@ -655,7 +655,7 @@ $(function() close: function() { $(this).remove(); }, buttons: [ {text: this.options.labels['cancel'], click: function() { $(this).dialog('close');} }, - {text: this.options.labels['export'], click: function() { $('#graph_'+me.element.attr('id')+'_export_dlg').submit(); $(this).dialog('close');} }, + {text: this.options.labels['export'], click: function() { $('#graph_'+me.element.attr('id')+'_export_dlg').trigger('submit'); $(this).dialog('close');} }, ] }); }, diff --git a/js/table-selectable-lines.js b/js/table-selectable-lines.js index 66b1e7535..523e3e39e 100644 --- a/js/table-selectable-lines.js +++ b/js/table-selectable-lines.js @@ -47,7 +47,7 @@ $(document).ready(function () { if (($cellClickedInput.length === 1) && ($cellClickedInput.is("input:radio") || $cellClickedInput.is("input:checkbox")) ) { - $cellClickedInput.click(); + $cellClickedInput.trigger('click'); if ($cellClicked.not(":first-child")) { return; @@ -56,7 +56,7 @@ $(document).ready(function () { var $lineClicked = $eventTarget.closest("tr"); var $lineClickedInput = $lineClicked.find(FIRST_CELL_WITH_INPUT_SELECTOR); - $lineClickedInput.click(); + $lineClickedInput.trigger('click'); }); $(document).on('change', TABLE_SELECTOR, function (event) { diff --git a/js/utils.js b/js/utils.js index fb681bfe5..dc4c4b655 100644 --- a/js/utils.js +++ b/js/utils.js @@ -33,7 +33,7 @@ function ReloadTruncatedList(divId, sSerializedFilter, sExtraParams) { var table = $(this); var id = $(this).parent(); aTruncatedLists[divId] = undefined; - var checkbox = (table.find('th:first :checkbox').length > 0); + var checkbox = (table.find('th').first().find(':checkbox').length > 0); if (checkbox) { // There is a checkbox in the first column, don't make it sortable table.tablesorter({headers: {0: {sorter: false}}, widgets: ['myZebra', 'truncatedList']}).tablesorterPager({container: $("#pager")}); // sortable and zebra tables @@ -387,7 +387,7 @@ function OpenOql(sOQL) { form.appendChild(input); document.body.appendChild(form); // form.submit() is blocked by the browser - $('#run_query_form').submit(); + $('#run_query_form').trigger('submit'); document.body.removeChild(form); } @@ -1397,7 +1397,7 @@ let CombodoModal = { let oSelectorElem = null; switch(typeof oOptions.base_modal.selector) { case 'string': - oSelectorElem = $(oOptions.base_modal.selector); + oSelectorElem = $(oOptions.base_modal.selector).first(); if (oSelectorElem.length === 0) { CombodoJSConsole.Error('Could not open modal dialog as the selector option did not return any element: ' + oOptions.base_modal.selector); return null; diff --git a/pages/UniversalSearch.php b/pages/UniversalSearch.php index 5c63b785a..55759374f 100644 --- a/pages/UniversalSearch.php +++ b/pages/UniversalSearch.php @@ -53,7 +53,7 @@ $oP->SetBreadCrumbEntry('ui-tool-universalsearch', Dict::S('Menu:UniversalSearch //$sSearchHeaderForceDropdown -$sSearchHeaderForceDropdown = ''; $aClassLabels = array(); foreach (MetaModel::GetClasses('bizmodel, grant_by_profile') as $sCurrentClass) { if ((MetaModel::HasCategory($sCurrentClass, 'grant_by_profile') && UserRights::IsActionAllowed($sCurrentClass, UR_ACTION_BULK_MODIFY)) diff --git a/pages/ajax.csvimport.php b/pages/ajax.csvimport.php index adb0d449e..cb010793e 100644 --- a/pages/ajax.csvimport.php +++ b/pages/ajax.csvimport.php @@ -390,7 +390,7 @@ try $oPage->add_ready_script( <<sJSURLs); $aResult['js'] = 'charts['.$iRefresh.'].load({json: '.str_replace('"', '\'', $oBlock->sJson). ',keys: { x: \'label\', value: [\'value\']'. - '},onclick: function (d) { var aURLs = $.parseJSON('.str_replace('"', '\'', $oBlock->sJSURLs).'); window.location.href= aURLs[d.index]; }})'; + '},onclick: function (d) { var aURLs = JSON.parse('.str_replace('"', '\'', $oBlock->sJSURLs).'); window.location.href= aURLs[d.index]; }})'; break; case 'pie': @@ -692,7 +692,7 @@ try $aResult['JSURLs'] = str_replace('"', '\'', $oBlock->sJSURLs); $aResult['js'] = 'charts['.$iRefresh.'].load({columns: '.str_replace('"', '\'', $oBlock->sJSColumns). ',names: '.str_replace('"', '\'', $oBlock->sJSNames). - ',onclick: function (d) { var aURLs = $.parseJSON('.str_replace('"', '\'', $oBlock->sJSURLs).'); window.location.href= aURLs[d.index]; }})'; + ',onclick: function (d) { var aURLs = JSON.parse('.str_replace('"', '\'', $oBlock->sJSURLs).'); window.location.href= aURLs[d.index]; }})'; break; } } else { @@ -2194,7 +2194,7 @@ EOF <<'); - $('#upload_form').submit(); + $('#upload_form').trigger('submit'); $(this).prop('disabled', true); }); $('.img-picker').magnificPopup({type: 'image', closeOnContentClick: true }); diff --git a/pages/csvimport.php b/pages/csvimport.php index 8c1181733..e39e841c8 100644 --- a/pages/csvimport.php +++ b/pages/csvimport.php @@ -422,14 +422,14 @@ EOF { $('input[name=step]').val(3); $('#wizForm').removeAttr('onsubmit'); // No need to perform validation checks when going back - $('#wizForm').submit(); + $('#wizForm').trigger('submit'); } function CSVGoBack() { $('input[name=step]').val(2); $('#wizForm').removeAttr('onsubmit'); // No need to perform validation checks when going back - $('#wizForm').submit(); + $('#wizForm').trigger('submit'); } @@ -437,7 +437,7 @@ EOF { $('input[name=step]').val(1); $('#wizForm').removeAttr('onsubmit'); // No need to perform validation checks when going back - $('#wizForm').submit(); + $('#wizForm').trigger('submit'); } @@ -873,7 +873,7 @@ EOF function GoBack() { $('input[name=step]').val(1); - $('#wizForm').submit(); + $('#wizForm').trigger('submit'); } var ajax_request = null; @@ -1089,7 +1089,7 @@ EOF ); $oPage->add_ready_script( <<AddSubBlock($oQueryTextArea); $oP->add_ready_script(<<SetOnClickJsCode( <<AddSubBlock($oUseSuggestedQueryButton); diff --git a/pages/schema.php b/pages/schema.php index 343c7bcb5..046b07f6f 100644 --- a/pages/schema.php +++ b/pages/schema.php @@ -135,16 +135,16 @@ EOF $oOpenAllButton = ButtonUIBlockFactory::MakeForAlternativePrimaryAction('Open All', '', '', false, 'lifecycleOpenAll'); $oOpenAllButton->SetOnClickJsCode( <<SetOnClickJsCode( <<SetBreadCrumbEntry('ui-tool-tag-admin', Dict::S('Menu:TagAdminMenu'), Dict::S('Menu:TagAdminMenu+'), '', 'fas fa-tags', iTopWebPage::ENUM_BREADCRUMB_ENTRY_ICON_TYPE_CSS_CLASSES); - $sSearchHeaderForceDropdown = ''; $aClassLabels = array(); foreach(MetaModel::EnumChildClasses($sBaseClass, ENUM_CHILD_CLASSES_EXCLUDETOP) as $sCurrentClass) { diff --git a/setup/setup.js b/setup/setup.js index f512bc259..a7d740260 100644 --- a/setup/setup.js +++ b/setup/setup.js @@ -60,7 +60,7 @@ function CheckDirectoryConfFilesPermissions(sWikiVersion){ 200: function() { $('#details').prepend('
Security issue: iTop is bundled with directory-level configuration files. You must check that those files will be read by your web server (eg. ' + 'AllowOverride directive should be set to All for Apache HTTP Server) see documentation.
'); - $(' and 1 Security issue').insertBefore('h2.message button:first'); + $(' and 1 Security issue').insertBefore($('h2.message button').first()); } } }); diff --git a/setup/setuputils.class.inc.php b/setup/setuputils.class.inc.php index f179d1e75..5fe6c345d 100644 --- a/setup/setuputils.class.inc.php +++ b/setup/setuputils.class.inc.php @@ -1517,7 +1517,7 @@ JS $sDBNameInput .= ''; } $oPage->add_ready_script('$("#db_name_container").html("'.addslashes($sDBNameInput).'");'); - $oPage->add_ready_script('$("#db_name").bind("click keyup change", function() { $("#existing_db").prop("checked", true); WizardUpdateButtons(); });'); + $oPage->add_ready_script('$("#db_name").on("click keyup change", function() { $("#existing_db").prop("checked", true); WizardUpdateButtons(); });'); } } diff --git a/setup/wizardsteps.class.inc.php b/setup/wizardsteps.class.inc.php index 6e537882e..a6bbd1012 100644 --- a/setup/wizardsteps.class.inc.php +++ b/setup/wizardsteps.class.inc.php @@ -320,9 +320,9 @@ HTML //$oPage->add(''); $oPage->add_ready_script( <<add_ready_script( <<add(''); $oPage->add(''); } - $oPage->add_ready_script('$(".check_select").bind("click change", function() { WizardUpdateButtons(); });'); + $oPage->add_ready_script('$(".check_select").on("click change", function() { WizardUpdateButtons(); });'); $oPage->add_script( <<add(''); $oPage->add_ready_script( <<add(''); $oPage->add_ready_script( <<add(''); $oPage->add_ready_script( <<add_ready_script( << 0) { oNextStackItemElem.trigger('click'); // Count non acknowledged stack items and change button label to close if there is only one if (oWelcomePopupDialogElem.find('[data-role="ibo-welcome-popup--stack-item"]:not(.ibo-is-acknowledged)').length === 1) { - const oAckButton = oWelcomePopupDialogElem.closest('[role="dialog"]').find('.ui-dialog-buttonset .ibo-is-primary:first'); + const oAckButton = oWelcomePopupDialogElem.closest('[role="dialog"]').find('.ui-dialog-buttonset .ibo-is-primary').first(); oAckButton.text({{ 'UI:WelcomePopup:Button:AcknowledgeAndClose'|dict_s|json_encode|raw }}); } } else { diff --git a/templates/base/components/input/file-select/layout.js.twig b/templates/base/components/input/file-select/layout.js.twig index 8cd8b1fc8..d8c9d5865 100644 --- a/templates/base/components/input/file-select/layout.js.twig +++ b/templates/base/components/input/file-select/layout.js.twig @@ -1,7 +1,7 @@ {# @copyright Copyright (C) 2010-2024 Combodo SAS #} {# @license http://opensource.org/licenses/AGPL-3.0 #} {% if oUIBlock.GetShowFilename() %} - $('#{{ oUIBlock.GetId() }}').bind('change', function() { + $('#{{ oUIBlock.GetId() }}').on('change', function() { var fileName = $(this).val().replace(/^.*[\\\/]/, ''); fileName = $('
').text(fileName).html(); $('#{{ oUIBlock.GetId() }}-file-name').html(fileName); diff --git a/templates/base/components/input/select/select.html.twig b/templates/base/components/input/select/select.html.twig index eee09e48b..5fd21518c 100644 --- a/templates/base/components/input/select/select.html.twig +++ b/templates/base/components/input/select/select.html.twig @@ -5,7 +5,7 @@ {% include "base/components/input/inputlabel.html.twig" %} {% endif %} \n"); $oP->add_ready_script(<<