diff --git a/Build/Sources/TypeScript/recordlist/Resources/Public/TypeScript/ElementBrowser.ts b/Build/Sources/TypeScript/recordlist/Resources/Public/TypeScript/ElementBrowser.ts index 992b0e650188d6afa8006241750af558d1a4a529..6ed67eb5fffe4acd4b5bc4540d2454ad28caead3 100644 --- a/Build/Sources/TypeScript/recordlist/Resources/Public/TypeScript/ElementBrowser.ts +++ b/Build/Sources/TypeScript/recordlist/Resources/Public/TypeScript/ElementBrowser.ts @@ -167,11 +167,6 @@ class ElementBrowser { public addElement(elName: string, elValue: string, altElValue: string, close: boolean): void { if (this.getParent()) { - if (this.getParent().setFormValueFromBrowseWin) { - console.warn('setFormValueFromBrowseWin has been marked as deprecated. Listen to message events instead.'); - this.getParent().setFormValueFromBrowseWin(this.fieldReference, altElValue ? altElValue : elValue, elName); - } - const message = { actionName: 'typo3:elementBrowser:elementAdded', fieldName: this.fieldReference, diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js index 591510480e97645b27762160475a554eb1b010a1..5aaaa1276bce0a65baf1b8d10585ef25daaa2c8d 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js @@ -20,13 +20,6 @@ * - select fields: move selected items up and down via buttons, remove items etc */ -// add legacy functions to be accessible in the global scope -var setFormValueOpenBrowser, // @deprecated - setFormValueFromBrowseWin, // @deprecated - setHiddenFromList, // @deprecated - setFormValueManipulate, // @deprecated - setFormValue_getFObj; // @deprecated - /** * Module: TYPO3/CMS/Backend/FormEngine */ @@ -68,18 +61,6 @@ define(['jquery', browserUrl: '' }; - /** - * Opens a popup window with the element browser (browser.php) - * - * @param {string} mode can be "db" or "file" - * @param {string} params additional params for the browser window - * @deprecated since TYPO3 v10.2, will be removed in TYPO3 v11.0. Use FormEngine.openPopupWindow() instead. - */ - setFormValueOpenBrowser = function(mode, params) { - console.warn('setFormValueOpenBrowser() has been marked as deprecated and will be removed in TYPO3 v11. Use FormEngine.openPopupWindow instead.'); - return FormEngine.openPopupWindow(mode, params); - }; - /** * Opens a popup window with the element browser (browser.php) * @@ -94,27 +75,6 @@ define(['jquery', }); }; - /** - * properly fills the select field from the popup window (element browser, link browser) - * or from a multi-select (two selects side-by-side) - * previously known as "setFormValueFromBrowseWin" - * - * @param {string} fieldName Formerly known as "fsetFormValueFromBrowseWinName" name of the field, like [tt_content][2387][header] - * @param {string|number} value The value to fill in (could be an integer) - * @param {string} label The visible name in the selector - * @param {string} title The title when hovering over it - * @param {string} exclusiveValues If the select field has exclusive options that are not combine-able - * @param {$} $optionEl The jQuery object of the selected <option> tag - * @deprecated since TYPO3 v10.2, will be removed in TYPO3 v11.0. Use FormEngine.setSelectOptionFromExternalSource() instead. - */ - setFormValueFromBrowseWin = function(fieldName, value, label, title, exclusiveValues, $optionEl) { - console.warn( - 'setFormValueFromBrowseWin() has been marked as deprecated and will be removed in TYPO3 v11. ' - + 'Use FormEngine.setSelectOptionFromExternalSource() or send a message instead.' - ); - FormEngine.setSelectOptionFromExternalSource(fieldName, value, label, title, exclusiveValues, $optionEl); - }; - /** * properly fills the select field from the popup window (element browser, link browser) * or from a multi-select (two selects side-by-side) @@ -253,19 +213,6 @@ define(['jquery', } }; - /** - * sets the value of the hidden field, from the select list, always executed after the select field was updated - * previously known as global function setHiddenFromList() - * - * @param {HTMLElement} selectFieldEl the select field - * @param {HTMLElement} originalFieldEl the hidden form field - * @deprecated since TYPO3 v10.2, will be removed in TYPO3 v11.0. Use FormEngine.updateHiddenFieldValueFromSelect() instead. - */ - setHiddenFromList = function(selectFieldEl, originalFieldEl) { - console.warn('setHiddenFromList() has been marked as deprecated and will be removed in TYPO3 v11. Use FormEngine.updateHiddenFieldValueFromSelect() instead.'); - FormEngine.updateHiddenFieldValueFromSelect(selectFieldEl, originalFieldEl); - }; - /** * sets the value of the hidden field, from the select list, always executed after the select field was updated * previously known as global function setHiddenFromList() @@ -284,201 +231,6 @@ define(['jquery', $(originalFieldEl).val(selectedValues.join(',')); }; - /** - * legacy function, can be removed once this function is not in use anymore - * - * @param {String} fName - * @param {String} type - * @param {Number} maxLength - * @deprecated since TYPO3 v10.2, will be removed in TYPO3 v11.0. - */ - setFormValueManipulate = function(fName, type, maxLength) { - console.warn('setFormValueManipulate() has been marked as deprecated and will be removed in TYPO3 v11.'); - var $formEl = FormEngine.getFormElement(fName); - if ($formEl.length > 0) { - var formObj = $formEl.get(0); - var localArray_V = []; - var localArray_L = []; - var localArray_S = []; - var localArray_T = []; - var fObjSel = formObj[fName + '_list']; - var l = fObjSel.length; - var c = 0; - var a; - - if (type === 'RemoveFirstIfFull') { - if (maxLength == 1) { - for (a = 1; a < l; a++) { - if (fObjSel.options[a].selected != 1) { - localArray_V[c] = fObjSel.options[a].value; - localArray_L[c] = fObjSel.options[a].text; - localArray_S[c] = 0; - localArray_T[c] = fObjSel.options[a].title; - c++; - } - } - } else { - return; - } - } - - if ((type === "Remove" && fObjSel.size > 1) || type === "Top" || type === "Bottom") { - if (type === "Top") { - for (a = 0; a < l; a++) { - if (fObjSel.options[a].selected == 1) { - localArray_V[c] = fObjSel.options[a].value; - localArray_L[c] = fObjSel.options[a].text; - localArray_S[c] = 1; - localArray_T[c] = fObjSel.options[a].title; - c++; - } - } - } - for (a = 0; a < l; a++) { - if (fObjSel.options[a].selected != 1) { - localArray_V[c] = fObjSel.options[a].value; - localArray_L[c] = fObjSel.options[a].text; - localArray_S[c] = 0; - localArray_T[c] = fObjSel.options[a].title; - c++; - } - } - if (type === "Bottom") { - for (a = 0; a < l; a++) { - if (fObjSel.options[a].selected == 1) { - localArray_V[c] = fObjSel.options[a].value; - localArray_L[c] = fObjSel.options[a].text; - localArray_S[c] = 1; - localArray_T[c] = fObjSel.options[a].title; - c++; - } - } - } - } - if (type === "Down") { - var tC = 0; - var tA = []; - var aa = 0; - - for (a = 0; a < l; a++) { - if (fObjSel.options[a].selected != 1) { - // Add non-selected element: - localArray_V[c] = fObjSel.options[a].value; - localArray_L[c] = fObjSel.options[a].text; - localArray_S[c] = 0; - localArray_T[c] = fObjSel.options[a].title; - c++; - - // Transfer any accumulated and reset: - if (tA.length > 0) { - for (aa = 0; aa < tA.length; aa++) { - localArray_V[c] = fObjSel.options[tA[aa]].value; - localArray_L[c] = fObjSel.options[tA[aa]].text; - localArray_S[c] = 1; - localArray_T[c] = fObjSel.options[tA[aa]].title; - c++; - } - - tC = 0; - tA = []; - } - } else { - tA[tC] = a; - tC++; - } - } - // Transfer any remaining: - if (tA.length > 0) { - for (aa = 0; aa < tA.length; aa++) { - localArray_V[c] = fObjSel.options[tA[aa]].value; - localArray_L[c] = fObjSel.options[tA[aa]].text; - localArray_S[c] = 1; - localArray_T[c] = fObjSel.options[tA[aa]].title; - c++; - } - } - } - if (type === "Up") { - var tC = 0; - var tA = []; - var aa = 0; - c = l - 1; - - for (a = l - 1; a >= 0; a--) { - if (fObjSel.options[a].selected != 1) { - - // Add non-selected element: - localArray_V[c] = fObjSel.options[a].value; - localArray_L[c] = fObjSel.options[a].text; - localArray_S[c] = 0; - localArray_T[c] = fObjSel.options[a].title; - c--; - - // Transfer any accumulated and reset: - if (tA.length > 0) { - for (aa = 0; aa < tA.length; aa++) { - localArray_V[c] = fObjSel.options[tA[aa]].value; - localArray_L[c] = fObjSel.options[tA[aa]].text; - localArray_S[c] = 1; - localArray_T[c] = fObjSel.options[tA[aa]].title; - c--; - } - - tC = 0; - tA = []; - } - } else { - tA[tC] = a; - tC++; - } - } - // Transfer any remaining: - if (tA.length > 0) { - for (aa = 0; aa < tA.length; aa++) { - localArray_V[c] = fObjSel.options[tA[aa]].value; - localArray_L[c] = fObjSel.options[tA[aa]].text; - localArray_S[c] = 1; - localArray_T[c] = fObjSel.options[tA[aa]].title; - c--; - } - } - c = l; // Restore length value in "c" - } - - // Transfer items in temporary storage to list object: - fObjSel.length = c; - for (a = 0; a < c; a++) { - fObjSel.options[a].value = localArray_V[a]; - fObjSel.options[a].text = localArray_L[a]; - fObjSel.options[a].selected = localArray_S[a]; - fObjSel.options[a].title = localArray_T[a]; - } - FormEngine.updateHiddenFieldValueFromSelect(fObjSel, formObj[fName]); - - FormEngine.legacyFieldChangedCb(); - } - }; - - - /** - * Legacy function - * returns the DOM object for the given form name of the current form, - * but only if the given field name is valid, legacy function, use "getFormElement" instead - * - * @param {String} fieldName the name of the field name - * @returns {*|HTMLElement} - * @deprecated since TYPO3 v10.2, will be removed in TYPO3 v11.0. Use FormEngine.getFormElement() instead. - */ - setFormValue_getFObj = function(fieldName) { - console.warn('setFormValue_getFObj() has been marked as deprecated and will be removed in TYPO3 v11. Use FormEngine.getFormElement() instead.'); - var $formEl = FormEngine.getFormElement(fieldName); - if ($formEl.length > 0) { - // return the DOM element of the form object - return $formEl.get(0); - } - return null; - }; - /** * returns a jQuery object for the given form name of the current form, * if the parameter "fieldName" is given, then the form element is only returned if the field name is available diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-91473-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-91473-DeprecatedFunctionalityRemoved.rst index d8005b4031d2bb057df505808d28fb10b25cff96..85ada851bb81473ad66909b062905f14aa36df29 100644 --- a/typo3/sysext/core/Documentation/Changelog/master/Breaking-91473-DeprecatedFunctionalityRemoved.rst +++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-91473-DeprecatedFunctionalityRemoved.rst @@ -252,6 +252,11 @@ The following global JavaScript functions have been removed: - :js:`rawurlencode` - :js:`str_replace` - :js:`openUrlInWindow` +- :js:`setFormValueOpenBrowser` +- :js:`setFormValueFromBrowseWin` +- :js:`setHiddenFromList` +- :js:`setFormValueManipulate` +- :js:`setFormValue_getFObj` The following JavaScript modules have been removed: diff --git a/typo3/sysext/recordlist/Resources/Public/JavaScript/ElementBrowser.js b/typo3/sysext/recordlist/Resources/Public/JavaScript/ElementBrowser.js index 6bc5e8ae39dc2fda21e3385db6f17948574c408a..a8f696ac0d40a7609953cfeb69384431331244a6 100644 --- a/typo3/sysext/recordlist/Resources/Public/JavaScript/ElementBrowser.js +++ b/typo3/sysext/recordlist/Resources/Public/JavaScript/ElementBrowser.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","TYPO3/CMS/Backend/Utility/MessageUtility","jquery","TYPO3/CMS/Backend/Modal"],(function(e,t,r,i,n){"use strict";return new class{constructor(){this.opener=null,this.thisScriptUrl="",this.mode="",this.formFieldName="",this.fieldReference="",this.fieldReferenceSlashed="",this.rte={parameters:"",configuration:""},this.irre={objectId:0},this.focusOpenerAndClose=()=>{this.getParent()&&this.getParent().focus(),n.dismiss(),close()},i(()=>{const e=i("body").data();this.thisScriptUrl=e.thisScriptUrl,this.mode=e.mode,this.formFieldName=e.formFieldName,this.fieldReference=e.fieldReference,this.fieldReferenceSlashed=e.fieldReferenceSlashed,this.rte.parameters=e.rteParameters,this.rte.configuration=e.rteConfiguration,this.irre.objectId=e.irreObjectId})}setReferences(){return!!(this.getParent()&&this.getParent().content&&this.getParent().content.document.editform&&this.getParent().content.document.editform[this.formFieldName])&&(this.targetDoc=this.getParent().content.document,this.elRef=this.targetDoc.editform[this.formFieldName],!0)}executeFunctionByName(e,t,...r){const i=e.split("."),n=i.pop();for(let e of i)t=t[e];return t[n].apply(t,r)}getParent(){return null===this.opener&&(void 0!==window.parent&&void 0!==window.parent.document.list_frame&&null!==window.parent.document.list_frame.parent.document.querySelector(".t3js-modal-iframe")?this.opener=window.parent.document.list_frame:void 0!==window.parent&&void 0!==window.parent.frames.list_frame&&null!==window.parent.frames.list_frame.parent.document.querySelector(".t3js-modal-iframe")?this.opener=window.parent.frames.list_frame:void 0!==window.frames&&void 0!==window.frames.frameElement&&null!==window.frames.frameElement&&window.frames.frameElement.classList.contains("t3js-modal-iframe")?this.opener=window.frames.frameElement.contentWindow.parent:window.opener&&(this.opener=window.opener)),this.opener}insertElement(e,t,i,n,s,o,a,d,l){if(this.irre.objectId){if(this.getParent()){const i={actionName:"typo3:foreignRelation:insert",objectGroup:this.irre.objectId,table:e,uid:t};r.MessageUtility.send(i,this.getParent())}else alert("Error - reference to main window is not set properly!"),this.focusOpenerAndClose();return l&&this.focusOpenerAndClose(),!0}return!this.fieldReference||this.rte.parameters||this.rte.configuration||this.addElement(n,e+"_"+t,s,l),!1}addElement(e,t,i,n){if(this.getParent()){this.getParent().setFormValueFromBrowseWin&&(console.warn("setFormValueFromBrowseWin has been marked as deprecated. Listen to message events instead."),this.getParent().setFormValueFromBrowseWin(this.fieldReference,i||t,e));const s={actionName:"typo3:elementBrowser:elementAdded",fieldName:this.fieldReference,value:i||t,label:e};r.MessageUtility.send(s,this.getParent()),n&&this.focusOpenerAndClose()}else alert("Error - reference to main window is not set properly!"),this.focusOpenerAndClose()}}})); \ No newline at end of file +define(["require","exports","TYPO3/CMS/Backend/Utility/MessageUtility","jquery","TYPO3/CMS/Backend/Modal"],(function(e,t,r,i,n){"use strict";return new class{constructor(){this.opener=null,this.thisScriptUrl="",this.mode="",this.formFieldName="",this.fieldReference="",this.fieldReferenceSlashed="",this.rte={parameters:"",configuration:""},this.irre={objectId:0},this.focusOpenerAndClose=()=>{this.getParent()&&this.getParent().focus(),n.dismiss(),close()},i(()=>{const e=i("body").data();this.thisScriptUrl=e.thisScriptUrl,this.mode=e.mode,this.formFieldName=e.formFieldName,this.fieldReference=e.fieldReference,this.fieldReferenceSlashed=e.fieldReferenceSlashed,this.rte.parameters=e.rteParameters,this.rte.configuration=e.rteConfiguration,this.irre.objectId=e.irreObjectId})}setReferences(){return!!(this.getParent()&&this.getParent().content&&this.getParent().content.document.editform&&this.getParent().content.document.editform[this.formFieldName])&&(this.targetDoc=this.getParent().content.document,this.elRef=this.targetDoc.editform[this.formFieldName],!0)}executeFunctionByName(e,t,...r){const i=e.split("."),n=i.pop();for(let e of i)t=t[e];return t[n].apply(t,r)}getParent(){return null===this.opener&&(void 0!==window.parent&&void 0!==window.parent.document.list_frame&&null!==window.parent.document.list_frame.parent.document.querySelector(".t3js-modal-iframe")?this.opener=window.parent.document.list_frame:void 0!==window.parent&&void 0!==window.parent.frames.list_frame&&null!==window.parent.frames.list_frame.parent.document.querySelector(".t3js-modal-iframe")?this.opener=window.parent.frames.list_frame:void 0!==window.frames&&void 0!==window.frames.frameElement&&null!==window.frames.frameElement&&window.frames.frameElement.classList.contains("t3js-modal-iframe")?this.opener=window.frames.frameElement.contentWindow.parent:window.opener&&(this.opener=window.opener)),this.opener}insertElement(e,t,i,n,s,o,a,d,l){if(this.irre.objectId){if(this.getParent()){const i={actionName:"typo3:foreignRelation:insert",objectGroup:this.irre.objectId,table:e,uid:t};r.MessageUtility.send(i,this.getParent())}else alert("Error - reference to main window is not set properly!"),this.focusOpenerAndClose();return l&&this.focusOpenerAndClose(),!0}return!this.fieldReference||this.rte.parameters||this.rte.configuration||this.addElement(n,e+"_"+t,s,l),!1}addElement(e,t,i,n){if(this.getParent()){const s={actionName:"typo3:elementBrowser:elementAdded",fieldName:this.fieldReference,value:i||t,label:e};r.MessageUtility.send(s,this.getParent()),n&&this.focusOpenerAndClose()}else alert("Error - reference to main window is not set properly!"),this.focusOpenerAndClose()}}})); \ No newline at end of file