| 6437 | | if ( typeof editor_names[x] != 'object' ) |
| 6438 | | { |
| 6439 | | var textarea = Xinha.getElementById('textarea', editor_names[x] ); |
| 6440 | | if ( !textarea ) |
| 6441 | | { |
| 6442 | | editor_names[x] = null; |
| 6443 | | continue; |
| 6444 | | } |
| | 6438 | if ( typeof editor_names[x] == 'string' ) // the regular case, an id of a textarea |
| | 6439 | { |
| | 6440 | textarea = Xinha.getElementById('textarea', editor_names[x] ); |
| | 6441 | if (!textarea) // the id may be specified for a textarea that is maybe on another page; we simply skip it and go on |
| | 6442 | { |
| | 6443 | editor_names[x] = null; |
| | 6444 | continue; |
| | 6445 | } |
| | 6446 | } |
| | 6447 | // make it possible to pass a reference instead of an id, for example from document.getElementsByTagName('textarea') |
| | 6448 | else if ( typeof editor_names[x] == 'object' && editor_names[x].tagName && editor_names[x].tagName.toLowerCase() == 'textarea' ) |
| | 6449 | { |
| | 6450 | textarea = editor_names[x]; |
| | 6451 | if ( !textarea.id ) // we'd like to have the textarea have an id |
| | 6452 | { |
| | 6453 | textarea.id = 'xinha_id_' + x; |
| | 6454 | } |