Changeset 1086 for trunk/plugins


Ignore:
Timestamp:
10/13/08 15:41:52 (11 years ago)
Author:
nicholasbs
Message:

Remove getElementsByClassName function now that Xinha's got it built in (thanks to #1303)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/InsertNote/InsertNote.js

    r1067 r1086  
    506506{ 
    507507  var doc = this.editor._doc; 
    508   // XXX TODO getElementByClassName shoud be implemented outside of InsertNote 
    509   var markers = this.getElementsByClassName(this.MARKER_CLASS); 
     508  var markers = Xinha.getElementsByClassName(doc, this.MARKER_CLASS); 
    510509   
    511510  if (!noteId) 
     
    521520  } 
    522521  return els; 
    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; 
    542522}; 
    543523 
Note: See TracChangeset for help on using the changeset viewer.