Changeset 14200
- Timestamp:
- 06/28/08 08:10:00 (5 months ago)
- Files:
-
- 1 modified
-
dojox/trunk/string/BidiComplex.js (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dojox/trunk/string/BidiComplex.js
r14184 r14200 20 20 } 21 21 22 //FIXME: use dojo.connect 22 23 if(dojo.isIE){ 23 24 field.onkeydown = new Function("dojox.string.BidiComplex._ceKeyDown(event);"); … … 28 29 } 29 30 31 //FIXME: use dojo.connect 30 32 field.oncut = dojox.string.BidiComplex._fOnCut; 31 33 field.oncopy = dojox.string.BidiComplex._fOnCopy; … … 35 37 36 38 dojox.string.BidiComplex.createDisplayString = function(/*String*/str, /*String*/pattern){ 37 // summary:38 // Create the Display string by adding the Unicode direction Markers39 // Example :40 // var displayString = dojox.string.BidiComplex.createDisplayString(originalString,"FILE_PATH"); 41 // 39 // summary: 40 // Create the display string by adding the Unicode direction Markers 41 // pattern: Complex Expression Pattern type. One of "FILE_PATH", "URL", "EMAIL", "XPATH" 42 43 //FIXME: inline _insertMarkers 42 44 return dojox.string.BidiComplex._insertMarkers(str, pattern); 43 45 }; … … 168 170 } 169 171 170 textToClipboard = dojox.string.BidiComplex.stripSpecialCharacters(text);172 var textToClipboard = dojox.string.BidiComplex.stripSpecialCharacters(text); 171 173 172 174 if(dojo.isIE){ … … 195 197 196 198 if(dojo.isIE){ 197 curPos = obj.selectionStart;199 // curPos = obj.selectionStart; 198 200 range = document.selection.clear(); 199 201 }else{ 200 curPos = obj.selectionStart;202 var curPos = obj.selectionStart; 201 203 obj.value = obj.value.substring(0, curPos) + obj.value.substring(obj.selectionEnd); 202 204 obj.setSelectionRange(curPos, curPos); … … 206 208 }; 207 209 208 dojox.string.BidiComplex._getCaretPos = function(event,obj){ 209 if(!dojo.isIE){ 210 return [event.target.selectionStart, event.target.selectionEnd]; 211 }else{ 210 // is there dijit code to do this? 211 dojox.string.BidiComplex._getCaretPos = function(event, obj){ 212 if(dojo.isIE){ 212 213 var position = 0, 213 214 range = document.selection.createRange().duplicate(), … … 225 226 ++position; 226 227 } 227 } 228 229 return [position, position + rangeLength]; 230 }; 231 228 229 return [position, position + rangeLength]; 230 } 231 232 return [event.target.selectionStart, event.target.selectionEnd]; 233 }; 234 235 // is there dijit code to do this? 232 236 dojox.string.BidiComplex._setSelectedRange = function(obj,selectionStart,selectionEnd){ 233 237 if(dojo.isIE){ … … 295 299 296 300 if(pattern == "FILE_PATH"){ 297 delimiters = "/\\:."; 301 delimiters = "/\\:."; // FIXME: use split? 298 302 for(i = 0; i < str.length; i++){ //FIXME: dojo.forEach 299 303 if((delimiters.indexOf(str.charAt(i)) >= 0) && 300 304 dojox.string.BidiComplex._isCharBeforeBiDiChar(str, i, previous)){ 301 305 previous = i; 302 dojox.string.BidiComplex._segmentsPointers[sp_len] = i; 303 sp_len++; 306 dojox.string.BidiComplex._segmentsPointers[sp_len++] = i; 304 307 } 305 308 } … … 308 311 309 312 // parse protocol, host, path 310 delimiters = "/:.?=&#"; 313 delimiters = "/:.?=&#"; // FIXME: use split? 311 314 for(i = 0; i < buffer_length; i++){ //FIXME: dojo.forEach 312 315 if((delimiters.indexOf(str.charAt(i)) >= 0) && … … 318 321 } 319 322 }else if(pattern == "EMAIL"){ 320 delimiters = "<>@.,;"; 323 delimiters = "<>@.,;"; // FIXME: use split? 321 324 var inQuotes = false; 322 325