Fixed issue #10899: bugfixes for t3editor codecompletion (credits to Stephan Petzl...
authorTobias Liebig <mail@etobi.de>
Wed, 15 Apr 2009 19:58:12 +0000 (19:58 +0000)
committerTobias Liebig <mail@etobi.de>
Wed, 15 Apr 2009 19:58:12 +0000 (19:58 +0000)
* resolve relative paths in curly brackets on the right side of reference and copy operators

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5316 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/t3editor/jslib/ts_codecompletion/tsparser.js

index 2948709..e0ecf9d 100644 (file)
@@ -272,9 +272,18 @@ var TsParser = function(tsRef,extTsObjTree){
                                                                setTreeNodeValue(path, str);\r
                                                                break;\r
                                                        case '=<': // reference to another object in the tree\r
+                                                                // resolve relative path               \r
+                                                               if ( prefixes.length > 0 \r
+                                                                               && str.substr(0, 1) == '.' ) {\r
+                                                                       str = prefixes.join('.') + str;\r
+                                                               }\r
                                                                setReference(path, str);\r
                                                                break;\r
                                                        case '<': // copy from another object in the tree\r
+                                                               if ( prefixes.length > 0 \r
+                                                                               && str.substr(0, 1) == '.' ) {\r
+                                                                       str = prefixes.join('.') + str;\r
+                                                               }\r
                                                                setCopy(path, str);\r
                                                                break;\r
                                                        case '>': // delete object value and properties\r
@@ -311,14 +320,18 @@ var TsParser = function(tsRef,extTsObjTree){
                        currentLine = line;\r
                        var i = line.indexOf('<');\r
                        if (i != -1) {\r
-                               var path = line.substring(i+1, line.length)\r
+                               var path = line.substring(i+1, line.length);\r
+                               path = path.replace(/\s/g,"");\r
+                               if ( prefixes.length > 0 && path.substr(0,1) == '.') {\r
+                                       path = prefixes.join('.') + path;\r
+                               }\r
                        } else {\r
                                var path = line;\r
                                if (prefixes.length>0) {\r
                                        path = prefixes.join('.') + '.' + path;\r
+                                       path = path.replace(/\s/g,"");\r
                                }\r
                        }\r
-                       path = path.replace(/\s/g,"");\r
                        var lastDot = path.lastIndexOf(".");\r
                        path = path.substring(0, lastDot);\r
                }\r