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

[!!!][TASK] Remove TBE_EDITOR.typo3form

This patch removes the TBE_EDITOR.typo3form object, which is unused for
a long time now. This "API" was used to either get or set values of
form fields in a very old iteration of the FormEngine.

Resolves: #88411
Releases: master
Change-Id: If7d6e1d13c89944383d06c42d63f2f3a3b40d999
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60791

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Mathias Brodala's avatarMathias Brodala <mbrodala@pagemachine.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Mathias Brodala's avatarMathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent 3c275ff1
......@@ -272,60 +272,3 @@ var TBE_EDITOR_split = TBE_EDITOR.split;
var TBE_EDITOR_curSelected = TBE_EDITOR.curSelected;
var TBE_EDITOR_rawurlencode = TBE_EDITOR.rawurlencode;
var TBE_EDITOR_str_replace = TBE_EDITOR.str_replace;
var typo3form = {
fieldSet: function(theField, evallist, is_in, checkbox, checkboxValue) {
if (document[TBE_EDITOR.formname][theField]) {
var theFObj = new evalFunc_dummy(evallist, is_in, checkbox, checkboxValue);
var theValue = document[TBE_EDITOR.formname][theField].value;
if (checkbox && theValue == checkboxValue) {
document.querySelector('form[name="' + TBE_EDITOR.formname + '"] [data-formengine-input-name="' + theField + '"]').value = "";
if (document[TBE_EDITOR.formname][theField + "_cb"]) document[TBE_EDITOR.formname][theField + "_cb"].checked = "";
} else {
document.querySelector('form[name="' + TBE_EDITOR.formname + '"] [data-formengine-input-name="' + theField + '"]').value = evalFunc.outputObjValue(theFObj, theValue);
if (document[TBE_EDITOR.formname][theField + "_cb"]) document[TBE_EDITOR.formname][theField + "_cb"].checked = "on";
}
}
},
fieldGet: function(theField, evallist, is_in, checkbox, checkboxValue, checkbox_off, checkSetValue) {
if (document[TBE_EDITOR.formname][theField]) {
var theFObj = new evalFunc_dummy(evallist, is_in, checkbox, checkboxValue);
if (checkbox_off) {
if (document[TBE_EDITOR.formname][theField + "_cb"].checked) {
var split = evallist.split(',');
for (var i = 0; split.length > i; i++) {
var el = split[i].replace(/ /g, '');
if (el == 'datetime' || el == 'date') {
var now = new Date();
checkSetValue = Date.parse(now) / 1000 - now.getTimezoneOffset() * 60;
break;
} else if (el == 'time' || el == 'timesec') {
checkSetValue = evalFunc_getTimeSecs(new Date());
break;
}
}
document[TBE_EDITOR.formname][theField].value = checkSetValue;
} else {
document[TBE_EDITOR.formname][theField].value = checkboxValue;
}
} else {
document[TBE_EDITOR.formname][theField].value = evalFunc.evalObjValue(theFObj, document.querySelector('form[name="' + TBE_EDITOR.formname + '"] [data-formengine-input-name="' + theField + '"]').value);
}
typo3form.fieldSet(theField, evallist, is_in, checkbox, checkboxValue);
}
}
};
// @TODO: This function is a copy from jsfunc.evalfield.js
// @TODO: Remove it later, after TBE_EDITOR is not used anymore.
function evalFunc_dummy(evallist, is_in, checkbox, checkboxValue) {
this.evallist = evallist;
this.is_in = is_in;
this.checkboxValue = checkboxValue;
this.checkbox = checkbox;
}
// backwards compatibility for extensions
var typo3FormFieldSet = typo3form.fieldSet;
var typo3FormFieldGet = typo3form.fieldGet;
.. include:: ../../Includes.txt
===============================================
Breaking: #88411 - TBE_EDITOR.typo3form removed
===============================================
See :issue:`88411`
Description
===========
The global object :js:`TBE_EDITOR.typo3form` and its backward layers :js:`typo3FormFieldSet` and :js:`typo3FormFieldGet`
have been removed.
Impact
======
Any extension relying on this code will stop working.
Affected Installations
======================
All installations using the removed code are affected.
Migration
=========
No direct migration possible. Refer to the FormEngine JavaScript API.
.. index:: Backend, JavaScript, NotScanned, ext:backend
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