// Generated by CoffeeScript 1.12.7
var extend = 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; },
  hasProp = {}.hasOwnProperty;

ez5.ExamplePoolPlugin = (function(superClass) {
  extend(ExamplePoolPlugin, superClass);

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

  ExamplePoolPlugin.prototype.getTabs = function(tabs) {
    tabs.push({
      name: "example-pool",
      text: "Example Add-On",
      content: (function(_this) {
        return function() {
          var form;
          form = new CUI.Form({
            data: _this._pool.data.pool,
            name: "custom_data",
            fields: [
              {
                type: CUI.Input,
                textarea: true,
                name: "example_add_on",
                form: {
                  label: "Add-On Info",
                  hint: "Add some info here."
                }
              }
            ]
          });
          return form.start();
        };
      })(this)
    });
    return tabs;
  };

  ExamplePoolPlugin.prototype.getInfoDivRows = function(rows) {
    var add_on_info;
    add_on_info = this._pool.data.pool.custom_data.example_add_on;
    if (add_on_info) {
      rows.push({
        key: "Add-On Info",
        value: add_on_info
      });
    }
  };

  ExamplePoolPlugin.prototype.getInfoDiv = function(nodes) {
    nodes.push(new CUI.Label({
      padded: true,
      text: "The ExamplePoolPlugin is **active**.",
      markdown: true,
      multiline: true
    }));
  };

  ExamplePoolPlugin.prototype.getSaveData = function(save_data) {
    save_data.pool.custom_data.example_add_on = this._pool.data.pool.custom_data.example_add_on;
  };

  return ExamplePoolPlugin;

})(ez5.PoolPlugin);

Pool.plugins.registerPlugin(ez5.ExamplePoolPlugin);
