(function() {

  this.def_tag('FORMFIELD_TAG',"NODE_TAG",function(__scope,__class){

    if(!this.__ctor__){this.__ctor__= function FORMFIELD_TAG(){__class.__super__.__ctor__.apply(this, arguments)}; this.__ctor__.prototype = this.prototype; }

    this.prototype["label="] = function(label) {
      return this["@label"]["text="](label);
    }; __method_added(this,"label=");

    this.prototype.value = function() {
      return this["@field"].value();
    }; __method_added(this,"value");

    this.prototype["value="] = function(val) {
      return this["@field"]["value="](val);
    }; __method_added(this,"value=");

    this.prototype.onformchange = function(event) {
      return false;
    }; __method_added(this,"onformchange");

    this.prototype.name = function() {
      return this['[]']('name');
    }; __method_added(this,"name");

    this.prototype["editing?"] = function() {
      return this["flagged?"]('active');
    }; __method_added(this,"editing?");

  });

  this.def_tag('TEXTFIELD_TAG',"FORMFIELD_TAG",function(__scope,__class){

    this.__ctor__ = function TEXTFIELD_TAG(node, attributes) {
      this["@label"] = __tag('label',null,null,{});
      this["@field"] = __tag('input',null,null,{
        'type': 'text'
      });
      return __class.__super__.__ctor__.call(this, node, attributes, [this["@label"], this["@field"]]);
    }; this.__ctor__.prototype = this.prototype;;

  });

  this.def_tag('SLIDER_TAG',"FORMFIELD_TAG",function(__scope,__class){

    this.__ctor__ = function SLIDER_TAG(node, attributes) {
      this["@label"] = __tag('label',null,null,{});
      this["@field"] = __tag('input',null,null,{
        'type': 'range'
      });
      this["@hint"] = __tag('div',null,[ "formfield-value"],{});
      return __class.__super__.__ctor__.call(this, node, attributes, [this["@hint"], this["@label"], this["@field"]]);
    }; this.__ctor__.prototype = this.prototype;;

    this.prototype.value = function() {
      return $to_f(this["@field"].value());
    }; __method_added(this,"value");

    this.prototype.hint = function() {
      return this.value();
    }; __method_added(this,"hint");

    this.prototype["min="] = function(min) {
      return this["@field"]['[]=']('min',min);
    }; __method_added(this,"min=");

    this.prototype["max="] = function(max) {
      return this["@field"]['[]=']('max',max);
    }; __method_added(this,"max=");

    this.prototype["step="] = function(step) {
      return this["@field"]['[]=']('step',step);
    }; __method_added(this,"step=");

    this.prototype["label="] = function(label) {
      return this["@label"]["text="](label);
    }; __method_added(this,"label=");

    this.prototype["value="] = function(val) {
      this["@field"]["value="]($to_f(val));
      return this["@hint"]["text="](this.hint());
    }; __method_added(this,"value=");

    this.prototype.ontouchstart = function() {
      return true;
    }; __method_added(this,"ontouchstart");

    this.prototype.onformchange = function(event) {
      this["@hint"]["text="](this.hint());
      return false;
    }; __method_added(this,"onformchange");

  });

  this.def_tag('SWITCHER_TAG',"SLIDER_TAG",function(__scope,__class){

    if(!this.__ctor__){this.__ctor__= function SWITCHER_TAG(){__class.__super__.__ctor__.apply(this, arguments)}; this.__ctor__.prototype = this.prototype; }

    this.prototype.hint = function() {
      if (this.value()) {
        return 'on';
      } else {
        return 'off';
      }
    }; __method_added(this,"hint");

  });

}).call($$base);

