Sha256: e88106c728b0a4794281f898162d2dff6277c721fa447cf8423c06126265a52b

Contents?: true

Size: 749 Bytes

Versions: 1

Compression:

Stored size: 749 Bytes

Contents

var Pixelator = function(data, partner) {
  this.data = data;
  this.partner = partner;
};

Pixelator.prototype = {
  defaults: function() {
    var default_context = this.data.context || {};
    default_context.timestamp = new Date().getTime();
    return default_context;
  },
  picker: function(key, options) {
    var self = this;
    var keys = self.data.pixels[key];

    if (!keys) { return; }

    _.each(keys, function(pixel) {
      if (pixel.partner && self.partner !== pixel.partner) {
        return;
      }

      var gp = new GenericPixel({ context: options, pixel: pixel });
      gp.insert();
    });
  },
  run: function(key, options) {
    options = _(options || {}).extend(this.defaults());
    this.picker(key, options);
  }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pixelator-0.0.1 app/assets/javascripts/core/pixelator.js