Fixed bug #6696: Parts of the TYPO3 back-end do not work correctly with prototype...
authorOliver Hader <oliver.hader@typo3.org>
Mon, 12 Nov 2007 13:47:33 +0000 (13:47 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 12 Nov 2007 13:47:33 +0000 (13:47 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2689 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/jsfunc.inline.js
typo3/js/browse_links.js
typo3/jsfunc.tbe_editor.js

index c74b142..91136a9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-12  Oliver Hader  <oh@inpublica.de>
+
+       * (minor) Fixed bug #6696: Parts of the TYPO3 back-end do not work correctly with prototype.js 1.6.0
+
 2007-11-11  Ingmar Schlecht  <ingmar@typo3.org>
 
        * Minor code-cleanup to recent Workspace related changes
index ada489a..cf4f97c 100755 (executable)
@@ -35,7 +35,11 @@ var inline = {
        lockedAjaxMethod: {},
        data: {},
 
-       addToDataArray: function(object) { for (var i in object) { this.data[i] = $H(this.data[i]).merge(object[i]); } },
+       addToDataArray: function(object) {
+               $H(object).each(function(pair) {
+                       inline.data[pair.key] = $H(inline.data[pair.key]).merge(pair.value).toObject();
+               });
+       },
        setPrependFormFieldNames: function(value) {     this.prependFormFieldNames = value; },
        setNoTitleString: function(value) { this.noTitleString = value; },
 
@@ -463,37 +467,39 @@ var inline = {
        },
 
        revertUnique: function(objectPrefix, elName, recordUid) {
-               var unique = this.data.unique[objectPrefix];
-               var fieldObj = elName ? document.getElementsByName(elName+'['+unique.field+']') : null;
-
-               if (unique.type == 'select') {
-                       if (fieldObj && fieldObj.length) {
-                               delete(this.data.unique[objectPrefix].used[recordUid])
-
-                               if (unique.selector == 'select') {
-                                       if (!isNaN(fieldObj[0].value)) {
-                                               var selector = $(objectPrefix+'_selector');
-                                               this.readdSelectOption(selector, fieldObj[0].value, unique);
+               if (this.data.unique && this.data.unique[objectPrefix]) {
+                       var unique = this.data.unique[objectPrefix];
+                       var fieldObj = elName ? document.getElementsByName(elName+'['+unique.field+']') : null;
+       
+                       if (unique.type == 'select') {
+                               if (fieldObj && fieldObj.length) {
+                                       delete(this.data.unique[objectPrefix].used[recordUid])
+       
+                                       if (unique.selector == 'select') {
+                                               if (!isNaN(fieldObj[0].value)) {
+                                                       var selector = $(objectPrefix+'_selector');
+                                                       this.readdSelectOption(selector, fieldObj[0].value, unique);
+                                               }
                                        }
-                               }
-
-                               if (!(unique.selector && unique.max == -1)) {
-                                       var formName = this.prependFormFieldNames+this.parseFormElementName('parts', objectPrefix, 3, 1);
-                                       var formObj = document.getElementsByName(formName);
-                                       if (formObj.length) {
-                                               var records = formObj[0].value.split(',');
-                                               var recordObj;
-                                                       // walk through all inline records on that level and get the select field
-                                               for (var i=0; i<records.length; i++) {
-                                                       recordObj = document.getElementsByName(this.prependFormFieldNames+'['+unique.table+']['+records[i]+']['+unique.field+']');
-                                                       if (recordObj.length) this.readdSelectOption(recordObj[0], fieldObj[0].value, unique);
+       
+                                       if (!(unique.selector && unique.max == -1)) {
+                                               var formName = this.prependFormFieldNames+this.parseFormElementName('parts', objectPrefix, 3, 1);
+                                               var formObj = document.getElementsByName(formName);
+                                               if (formObj.length) {
+                                                       var records = formObj[0].value.split(',');
+                                                       var recordObj;
+                                                               // walk through all inline records on that level and get the select field
+                                                       for (var i=0; i<records.length; i++) {
+                                                               recordObj = document.getElementsByName(this.prependFormFieldNames+'['+unique.table+']['+records[i]+']['+unique.field+']');
+                                                               if (recordObj.length) this.readdSelectOption(recordObj[0], fieldObj[0].value, unique);
+                                                       }
                                                }
                                        }
                                }
+                       } else if (unique.type == 'groupdb') {
+                               // alert(objectPrefix+'/'+recordUid);
+                               delete(this.data.unique[objectPrefix].used[recordUid])
                        }
-               } else if (unique.type == 'groupdb') {
-                       // alert(objectPrefix+'/'+recordUid);
-                       delete(this.data.unique[objectPrefix].used[recordUid])
                }
        },
 
@@ -522,7 +528,7 @@ var inline = {
                var beforeDeleteIsBelowMax = this.isBelowMax(objectPrefix);
 
                        // revert the unique settings if available
-               if (this.data.unique && this.data.unique[objectPrefix]) this.revertUnique(objectPrefix, elName, recordUid);
+               this.revertUnique(objectPrefix, elName, recordUid);
 
                        // if the record is new and was never saved before, just remove it from DOM
                if (this.isNewRecord(objectId)) {
index a405052..7592f19 100755 (executable)
@@ -32,7 +32,7 @@
 var BrowseLinks = {
        elements: {},
        addElements: function(elements) {
-               BrowseLinks.elements = $H(BrowseLinks.elements).merge(elements);
+               BrowseLinks.elements = $H(BrowseLinks.elements).merge(elements).toObject();
        },
        focusOpenerAndClose: function(close) {
                if (close) {
index 5480154..67f78f3 100755 (executable)
@@ -77,7 +77,7 @@ var TBE_EDITOR = {
        // Handling of data structures:
        addElements: function(elements) {
                TBE_EDITOR.recentUpdatedElements = elements;
-               TBE_EDITOR.elements = $H(TBE_EDITOR.elements).merge(elements);
+               TBE_EDITOR.elements = $H(TBE_EDITOR.elements).merge(elements).toObject();
        },
        removeElement: function(record) {
                if (TBE_EDITOR.elements && TBE_EDITOR.elements[record]) {