vendor/DocumentUp/documentup.js
function insert(target, host, fn) {
      var i = 0, self = host || this, r = []
        // target nodes could be a css selector if it's a string and a selector engine is present
        // otherwise, just use target
        , nodes = query && typeof target == 'string' && target.charAt(0) != '<' ? query(target) : target
      // normalize each node in case it's still a string and we need to create nodes on the fly
      each(normalize(nodes), function (t) {
        each(self, function (el) {
          var n = !el[parentNode] || (el[parentNode] && !el[parentNode][parentNode]) ?
            function () {
              var c = el.cloneNode(true)
              // check for existence of an event cloner
              // preferably https://github.com/fat/bean
              // otherwise Bonzo won't do this for you
              self.$ && self.cloneEvents && self.$(c).cloneEvents(el)
              return c
            }() : el
          fn(t, n)
          r[i] = n
          i++
        })
      }, this)
      each(r, function (e, i) {
        self[i] = e
      })
      self.length = i
      return self
    }
function insert(target, host, fn) {
      var i = 0, self = host || this, r = []
        // target nodes could be a css selector if it's a string and a selector engine is present
        // otherwise, just use target
        , nodes = query && typeof target == 'string' && target.charAt(0) != '<' ? query(target) : target
      // normalize each node in case it's still a string and we need to create nodes on the fly
      each(normalize(nodes), function (t) {
        each(self, function (el) {
          var n = !el[parentNode] || (el[parentNode] && !el[parentNode][parentNode]) ?
            function () {
              var c = el.cloneNode(true)
              // check for existence of an event cloner
              // preferably https://github.com/fat/bean
              // otherwise Bonzo won't do this for you
              self.$ && self.cloneEvents && self.$(c).cloneEvents(el)
              return c
            }() : el
          fn(t, n)
          r[i] = n
          i++
        })
      }, this)
      each(r, function (e, i) {
        self[i] = e
      })
      self.length = i
      return self
    }
function insert ( target , host , fn ) { var i = 0 , self = host || this , r = [ ] // target nodes could be a css selector if it's a string and a selector engine is present // otherwise, just use target , nodes = query && typeof target == 'string' && target . charAt ( 0 ) != '<' ? query ( target ) : target // normalize each node in case it's still a string and we need to create nodes on the fly each ( normalize ( nodes ) , function ( t ) { each ( self , function ( el ) { var n = ! el [ parentNode ] || ( el [ parentNode ] && ! el [ parentNode ] [ parentNode ] ) ? function ( ) { var c = el . cloneNode ( true ) // check for existence of an event cloner // preferably https://github.com/fat/bean // otherwise Bonzo won't do this for you self . $ && self . cloneEvents && self . $ ( c ) . cloneEvents ( el ) return c } ( ) : el fn ( t , n ) r [ i ] = n i ++ } ) } , this ) each ( r , function ( e , i ) { self [ i ] = e } ) self . length = i return self }
this insert method is intense
this insert method is intense