| 523 | | }; |
| 524 | | |
| 525 | | // ******* TEMPORARY FIX! This does not belong here and should probably be in Xinha core |
| 526 | | // This is only here so that I can do other testing in the mean time. |
| 527 | | InsertNote.prototype.getElementsByClassName = function(searchClass, node, tag) |
| 528 | | { |
| 529 | | if (node == null) |
| 530 | | node = this.editor._doc; |
| 531 | | if (tag == null) |
| 532 | | tag = "*"; |
| 533 | | var els = node.getElementsByTagName(tag); |
| 534 | | var regex = new RegExp("(^|\\\\s)" + searchClass + "(\\\\s|$)"); |
| 535 | | var classEls = new Array(); |
| 536 | | for (var i=0; i<els.length; i++) |
| 537 | | { |
| 538 | | if (regex.test(els[i].className)) |
| 539 | | classEls.push(els[i]); |
| 540 | | } |
| 541 | | return classEls; |