// 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.ExampleMaskSplitterBlock = (function(superClass) {
  extend(ExampleMaskSplitterBlock, superClass);

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

  ExampleMaskSplitterBlock.prototype.isSimpleSplit = function() {
    return false;
  };

  ExampleMaskSplitterBlock.prototype.getOptions = function() {
    return [
      {
        form: {
          label: "Color"
        },
        type: CUI.Select,
        options: [
          {
            value: "black"
          }, {
            value: "red"
          }, {
            value: "green"
          }, {
            value: "yellow"
          }
        ],
        name: "color"
      }, {
        form: {
          label: "Style"
        },
        type: CUI.Select,
        options: [
          {
            value: "solid"
          }, {
            value: "dotted"
          }, {
            value: "dashed"
          }
        ],
        name: "style"
      }
    ];
  };

  ExampleMaskSplitterBlock.prototype.getDefaultOptions = function() {
    return {
      color: "black",
      style: "solid"
    };
  };

  ExampleMaskSplitterBlock.prototype.renderField = function(opts) {
    var color, div, innerFields, style;
    color = this.getDataOptions().color;
    style = this.getDataOptions().style;
    console.debug(this, "ExampleMaskSplitterBlock.renderField", opts, color, style);
    div = CUI.dom.element("div", {
      "class": "ez5-example-mask-splitter"
    });
    CUI.dom.setStyle(div, {
      border: "4px " + style + " " + color
    });
    innerFields = this.renderInnerFields(opts);
    if ((innerFields != null ? innerFields.length : void 0) > 0 || opts.mode === "editor") {
      return CUI.dom.append(div, this.renderInnerFields(opts));
    }
  };

  ExampleMaskSplitterBlock.prototype.isEnabledForNested = function() {
    return true;
  };

  return ExampleMaskSplitterBlock;

})(CustomMaskSplitter);

MaskSplitter.plugins.registerPlugin(ez5.ExampleMaskSplitterBlock);
