// Generated by CoffeeScript 1.4.0
(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  window.Controls.munin__plot = (function(_super) {

    __extends(munin__plot, _super);

    function munin__plot() {
      return munin__plot.__super__.constructor.apply(this, arguments);
    }

    munin__plot.prototype.createDom = function() {
      var url,
        _this = this;
      url = '/ajenti:munin-proxy/' + encodeURIComponent(this.properties.url);
      if (this.properties.period) {
        url += this.properties.period + '.png';
      }
      this.dom = $("<div class=\"control munin-plot " + (this.properties.widget ? 'widget-mode' : '') + "\">\n    <img src=\"" + url + "\" />\n    <a href=\"#\" class=\"control button style-normal\"><i class=\"icon-plus\"></i> Add widget</a>\n</div>");
      return this.dom.find('a').click(function() {
        return _this.event('widget', {
          url: _this.properties.url,
          period: _this.properties.period
        });
      });
    };

    return munin__plot;

  })(window.Control);

}).call(this);
