Bug #20422 » 11087_v2.diff
typo3/jsfunc.tbe_editor.js (working copy) | ||
---|---|---|
document[TBE_EDITOR.formname][theField].value = RTEcontent;
|
||
alert(document[TBE_EDITOR.formname][theField].value);
|
||
},
|
||
// strips the "table", the "field" and the "uid" from the fName
|
||
extractDataFromFieldName: function(fName) {
|
||
var idx = 2 + TBE_EDITOR.prependFormFieldNamesCnt;
|
||
var table = TBE_EDITOR.split(fName, '[', idx);
|
||
var uid = TBE_EDITOR.split(fName, '[', idx + 1);
|
||
var field = TBE_EDITOR.split(fName, '[', idx + 2);
|
||
return { table: table.substr(0, table.length-1), uid: uid.substr(0, uid.length-1), field: field.substr(0,field.length-1) };
|
||
},
|
||
getElementFromFieldName: function(fName) {
|
||
var data = TBE_EDITOR.extractDataFromFieldName(fName);
|
||
return TBE_EDITOR.getElement('data[' + data.table + '][' + data.uid + ']', data.field);
|
||
},
|
||
fieldChanged_fName: function(fName,el) {
|
||
var idx=2+TBE_EDITOR.prependFormFieldNamesCnt;
|
||
var table = TBE_EDITOR.split(fName, "[", idx);
|
||
var uid = TBE_EDITOR.split(fName, "[", idx+1);
|
||
var field = TBE_EDITOR.split(fName, "[", idx+2);
|
||
table = table.substr(0,table.length-1);
|
||
uid = uid.substr(0,uid.length-1);
|
||
field = field.substr(0,field.length-1);
|
||
TBE_EDITOR.fieldChanged(table,uid,field,el);
|
||
var data = TBE_EDITOR.extractDataFromFieldName(fName);
|
||
TBE_EDITOR.fieldChanged(data.table, data.uid, data.field, el);
|
||
},
|
||
fieldChanged: function(table,uid,field,el) {
|
||
var theField = TBE_EDITOR.prependFormFieldNames+'['+table+']['+uid+']['+field+']';
|
t3lib/class.t3lib_tceforms.php (working copy) | ||
---|---|---|
browserWin.focus();
|
||
}
|
||
function setFormValueFromBrowseWin(fName,value,label,exclusiveValues) { //
|
||
var formObj = setFormValue_getFObj(fName)
|
||
var formObj = setFormValue_getFObj(fName);
|
||
if (formObj && value!="--div--") {
|
||
fObj = formObj[fName+"_list"];
|
||
var len = fObj.length;
|
||
... | ... | |
var m = new RegExp("(^|,)"+value+"($|,)");
|
||
if (exclusiveValues.match(m)) {
|
||
// the new value is exclusive
|
||
for (a=len-1;a>=0;a--) fObj[a] = null;
|
||
for (a=len-1;a>=0;a--) {
|
||
fObj[a] = null;
|
||
}
|
||
len = 0;
|
||
} else if (len == 1) {
|
||
m = new RegExp("(^|,)"+fObj.options[0].value+"($|,)");
|
||
... | ... | |
}
|
||
// Inserting element
|
||
var setOK = 1;
|
||
if (!formObj[fName+"_mul"] || formObj[fName+"_mul"].value==0) {
|
||
if (!formObj[fName+"_mul"] || formObj[fName+"_mul"].value === 0) {
|
||
for (a=0;a<len;a++) {
|
||
if (fObj.options[a].value==value) {
|
||
setOK = 0;
|
||
}
|
||
}
|
||
}
|
||
if (setOK) {
|
||
// remove the existing option element if there is only one element allowed
|
||
var el = TBE_EDITOR.getElementFromFieldName(fName);
|
||
var range = String(el.range);
|
||
range = range.split(",");
|
||
if (range[1] == "1") {
|
||
setFormValueManipulate(fName, "Remove");
|
||
len = 0;
|
||
}
|
||
|
||
fObj.length++;
|
||
fObj.options[len].value = value;
|
||
fObj.options[len].text = unescape(label);
|