 
 jQuery.fn.view = -> @data('view')
 jQuery.fn.views = -> @toArray().map (elt) -> $(elt).view()
-docEl = document.documentElement
-matches = docEl.matchesSelector || docEl.mozMatchesSelector || docEl.webkitMatchesSelector || docEl.oMatchesSelector || docEl.msMatchesSelector
-jQuery.fn.matching = if matches then ((selector) -> matches.call(@[0], selector)) else jQuery.fn.is
 
 # Trigger attach event when views are added to the DOM
 callAttachHook = (element) ->

  'blur change click dblclick error focus input keydown
   keypress keyup load mousedown mousemove mouseout mouseover
   mouseup resize scroll select submit unload'.split /\s+/

idCounter = 0


          element = $(element)
          element.on eventName, (event) -> view[methodName](event, element)

      if matchesSelector(view, selector)
        methodName = view[0].getAttribute(eventName)
        do (methodName) ->
          view.on eventName, (event) -> view[methodName](event, view)
