instead of the rails traditional form
 in js mode, there is no prefix before the element name
339395
def define_elements_js(model_class, excluded_props = [])
      attributes = model_class.new.attributes.keys

      attributes.each do |attri|
        unless excluded_props.include? attri
          selector = "#"+attri
          # self.class.send "element", attri.to_sym, selector
          element attri, selector
        end

      end
    end
112995
function() {

      var attrs, x, y, z, key, value, html, inputs, textarea;

      console.log(hashedit.current.node);

      if (hashedit.current.node !== null) {

        // get attributes
        attrs = hashedit.current.node.attributes;

        for (x = 0; x < attrs.length; x += 1) {

          // get key and value
          key = attrs[x].nodeName.replace(/-([a-z])/g, function(g) {
            return g[1].toUpperCase();
          });
          value = attrs[x].nodeValue;

          // if is numeric
          if (!isNaN(parseFloat(value)) && isFinite(value)) {
            value = parseFloat(value);
          }

          // set value
          inputs = document.querySelectorAll('[data-model="node.' + key + '"]');

          for (y = 0; y < inputs.length; y += 1) {
            inputs[y].value = value;
          }

        }

        // get html
        html = hashedit.current.node.innerHTML;

        // remove the element menu
        var i = html.indexOf('<span class="hashedit-element-menu"');
        html = html.substring(0, i);

        inputs = document.querySelectorAll('[data-model="node.html"]');

        for (y = 0; y < inputs.length; y += 1) {
          inputs[y].value = html;
        }


      }


    }
123325
def method_missing(name, *args, &blk)
      if name.to_s =~ /^default_(.*)=$/
        @default_options[$1.to_sym] = args.first
      elsif name.to_s =~ /=$/
        @dirty_options[$`.to_sym] = args.first
      elsif @default_options.key?(name)
        dirty_or_db_setting_or_default(name)
      else
        super
      end
    end
1141566
def form_for(*args, &block)
      if search_obj = args.find { |arg| arg.is_a?(Searchlogic::Search) }
        options = args.extract_options!
        options[:html] ||= {}
        options[:html][:method] ||= :get
        options[:url] ||= url_for
        args.unshift(:search) if args.first == search_obj
        args << options
      end
      super
    end
421438
function () {
        var prefix = '%(',
            suffix = ')',
            data = this.data,
            output = '',
            dataKey;

        output = this.__message__;
        for (dataKey in data) {

            if (data.hasOwnProperty(dataKey)) {
                output = output.replace(prefix + dataKey + suffix, '' + data[dataKey]);
            }
        }
        output = output.replace(prefix + 'code' + suffix, '' + this.code);
        output = output.replace(prefix + 'name' + suffix, '' + this.name);

        return output;
    }
1127464
function selectorForm(selector) {
    var str;
    if (selector.indexOf('[') !== -1) {
        var newSelector = attributeEquals(selector);
        newSelector = newSelector.replace('sel=', ''); // valid sass syntax
        var firstSelector = firstPart(selector);
        if (firstSelector in jquerySelectors) {
            str = jquerySelectors[firstSelector]
                  .replace('%', '"' + newSelector + '"');
        }
    } else
    if (selector in jquerySelectors) {
        str = jquerySelectors[selector].replace('%', '');
    } else {
        str = '$("' + selector + '")';
    }
    return str;
}
814246
function fixChromeAutocomplete() {
      const global = formlyConfig.extras.removeChromeAutoComplete === true
      const offInstance = scope.options && scope.options.removeChromeAutoComplete === false
      const onInstance = scope.options && scope.options.removeChromeAutoComplete === true
      if ((global && !offInstance) || onInstance) {
        const input = document.createElement('input')
        input.setAttribute('autocomplete', 'address-level4')
        input.setAttribute('hidden', 'true')
        el[0].appendChild(input)
      }

    }
230869
protected function initForm()
    {
        (isset($this->options['name'])) ? $name = $this->options['name'] : $name = '';
        if (empty($name)) {
            $name = 'form_' . (count(self::$forms) + 1);
        }
        unset($this->options['name']);

        $this->form = tao_helpers_form_FormFactory::getForm($name, $this->options);

        //add property action in toolbar
        $actions     = tao_helpers_form_FormFactory::getCommonActions();
        $propertyElt = tao_helpers_form_FormFactory::getElement('property', 'Free');
        $propertyElt->setValue(
            "<a href='#' class='btn-info property-adder small'><span class='icon-property-add'></span> " . __('Add property') . "</a>"
        );
        $actions[] = $propertyElt;

        //property mode
        $propModeELt = tao_helpers_form_FormFactory::getElement('propMode', 'Free');
        if($this->propertyMode == 'advanced'){
            $propModeELt->setValue("<a href='#' class='btn-info property-mode small property-mode-simple'><span class='icon-property-advanced'></span> ".__('Simple Mode')."</a>");
        }
        else{
            $propModeELt->setValue("<a href='#' class='btn-info property-mode small property-mode-advanced'><span class='icon-property-advanced'></span> ".__('Advanced Mode')."</a>");
        }

        $actions[] = $propModeELt;

        //add a hidden field that states it is a class edition form.
        $classElt = tao_helpers_form_FormFactory::getElement('tao.forms.class', 'Hidden');
        $classElt->setValue('1');
        $classElt->addClass('global');
        $this->form->addElement($classElt);

        $this->form->setActions($actions, 'top');
        $this->form->setActions($actions, 'bottom');


    }
426676
def _normalize_options(options)
        _normalize_text(options)

        if options[:html]
          options[:html] = ERB::Util.html_escape(options[:html])
        end

        if options[:status]
          options[:status] = Rack::Utils.status_code(options[:status])
        end

        super
      end
506492
protected function initForm()
    {
    	(isset($this->options['name'])) ? $name = $this->options['name'] : $name = ''; 
    	if(empty($name)){
			$name = 'form_'.(count(self::$forms)+1);
		}
		unset($this->options['name']);
			
		$this->form = \tao_helpers_form_FormFactory::getForm($name, $this->options);
		
		//create action in toolbar
		$createElt = \tao_helpers_form_FormFactory::getElement('create', 'Free');
		$createElt->setValue('<button class="btn-info" type="submit" id="addButton">'.\tao_helpers_Icon::iconAdd().__('Create').'</button>');
		$this->form->setActions(array(), 'top');
		$this->form->setActions(array($createElt), 'bottom');
    }
102983
def input_html_options
      super.merge(
        data: {
          attachments_path: options.fetch(:route, route_from_configuration),
          max_number_of_files: options.fetch(:max_number_of_files, nil),
          disabled_submit_text: I18n.t(:disabled, scope: 'simple_form_attachments.buttons'),
          sortable: sortable?
        }.reject{ |k, v| v.nil? }
      )
    end
340684
def standard
      form = self.mailbox
      form += @config[:tag_separator] + self.tag if self.tag
      form += "(" + self.comment + ")" if self.comment
      form.gsub!(/([\\\"])/, '\\\1') # Escape \ and "
      if form =~ /[ \"\(\),:<>@\[\\\]]/ # Space and "(),:;<>@[\]
        form = %Q("#{form}")
      end
      form
    end
556029
function() {
    let names = jst._flatten.apply(this, arguments);

    for (let name of names) {
      let fullName = jst.tagPrefix + name;
      jst[fullName] = function() {
        let args = jst._flatten.apply(this, arguments);
        return (new JstElement(name, args));
      };
    }
  }
916760
function () {
/*Line 30 - 'AtomFormGrid.js' */                var element = this._element;
/*Line 31 - 'AtomFormGrid.js' */                $(element).addClass("atom-form-grid");

/*Line 33 - 'AtomFormGrid.js' */                var children = $(element).children();

/*Line 35 - 'AtomFormGrid.js' */                var ae = new AtomEnumerator(children);

/*Line 37 - 'AtomFormGrid.js' */                AtomUI.removeAllChildren(element);

/*Line 39 - 'AtomFormGrid.js' */                var container = document.createElement("DIV");
/*Line 40 - 'AtomFormGrid.js' */                //container.setAttribute("style-width", "[$owner.controlWidth]");
/*Line 41 - 'AtomFormGrid.js' */                $(container).addClass("atom-form-grid-container");

/*Line 43 - 'AtomFormGrid.js' */                element.appendChild(container);

/*Line 45 - 'AtomFormGrid.js' */                var minLabelWidth = AtomUI.attr(this._element, "atom-min-label-width");

/*Line 47 - 'AtomFormGrid.js' */                this.getTemplate("fieldTemplate");

/*Line 49 - 'AtomFormGrid.js' */                while (ae.next()) {
/*Line 50 - 'AtomFormGrid.js' */                    var item = ae.current();

/*Line 52 - 'AtomFormGrid.js' */                    var at = AtomUI.attr(item,"atom-type");
/*Line 53 - 'AtomFormGrid.js' */                    if (at == "AtomFormRow") {
/*Line 54 - 'AtomFormGrid.js' */                        var table = document.createElement("TABLE");
/*Line 55 - 'AtomFormGrid.js' */                        container.appendChild(table);
/*Line 56 - 'AtomFormGrid.js' */                        $(table).addClass("atom-form-grid-row");
/*Line 57 - 'AtomFormGrid.js' */                        var tbody = document.createElement("TBODY");
/*Line 58 - 'AtomFormGrid.js' */                        table.appendChild(tbody);

/*Line 60 - 'AtomFormGrid.js' */                        var tr = document.createElement("TR");
/*Line 61 - 'AtomFormGrid.js' */                        tbody.appendChild(tr);

/*Line 63 - 'AtomFormGrid.js' */                        var children = $(item).children();
/*Line 64 - 'AtomFormGrid.js' */                        var ce = new AtomEnumerator(children);
/*Line 65 - 'AtomFormGrid.js' */                        while (ce.next()) {
/*Line 66 - 'AtomFormGrid.js' */                            var td = document.createElement("TD");
/*Line 67 - 'AtomFormGrid.js' */                            tr.appendChild(td);
/*Line 68 - 'AtomFormGrid.js' */                            this.createField(td, ce.current());
/*Line 69 - 'AtomFormGrid.js' */                        }

/*Line 71 - 'AtomFormGrid.js' */                        continue;
/*Line 72 - 'AtomFormGrid.js' */                    }
/*Line 73 - 'AtomFormGrid.js' */                    if (at == "AtomFormTabControl" || at == "AtomTabControl") {


/*Line 76 - 'AtomFormGrid.js' */                        var tabBar = document.createElement("ul");
/*Line 77 - 'AtomFormGrid.js' */                        tabBar.setAttribute("atom-type", "AtomToggleButtonBar");
/*Line 78 - 'AtomFormGrid.js' */                        var tabBarID = AtomUI.assignID(tabBar);
/*Line 79 - 'AtomFormGrid.js' */                        tabBar.setAttribute("atom-name", tabBarID);
/*Line 80 - 'AtomFormGrid.js' */                        tabBar.setAttribute("atom-show-tabs", "true");
/*Line 81 - 'AtomFormGrid.js' */                        var te = document.createElement("li");
/*Line 82 - 'AtomFormGrid.js' */                        tabBar.appendChild(te);
/*Line 83 - 'AtomFormGrid.js' */                        te.setAttribute("atom-text", "{$data.label}");
/*Line 84 - 'AtomFormGrid.js' */                        te.setAttribute("atom-template", "itemTemplate");
/*Line 85 - 'AtomFormGrid.js' */                        //td.appendChild(tabBar);
/*Line 86 - 'AtomFormGrid.js' */                        this.createField(container, tabBar);

/*Line 88 - 'AtomFormGrid.js' */                        var tbc = allControls[tabBarID];

/*Line 90 - 'AtomFormGrid.js' */                        var ce = new ChildEnumerator(item);
/*Line 91 - 'AtomFormGrid.js' */                        var list = [];
/*Line 92 - 'AtomFormGrid.js' */                        var index = 0;
/*Line 93 - 'AtomFormGrid.js' */                        while (ce.next()) {
/*Line 94 - 'AtomFormGrid.js' */                            var child = ce.current();
/*Line 95 - 'AtomFormGrid.js' */                            $(child).remove();
/*Line 96 - 'AtomFormGrid.js' */                            child.setAttribute("style-display", "[$scope." + tabBarID + ".selectedIndex == " + index + " ? '' : 'none']");
/*Line 97 - 'AtomFormGrid.js' */                            var cf = this.createField(container, child);
/*Line 98 - 'AtomFormGrid.js' */                            list.push(cf);
/*Line 99 - 'AtomFormGrid.js' */                            //if (cf.constructor == WebAtoms.AtomFormGridLayout) {

/*Line 101 - 'AtomFormGrid.js' */                            //}
/*Line 102 - 'AtomFormGrid.js' */                            index++;
/*Line 103 - 'AtomFormGrid.js' */                        }

/*Line 105 - 'AtomFormGrid.js' */                        tbc.set_items(list);
/*Line 106 - 'AtomFormGrid.js' */                        continue;
/*Line 107 - 'AtomFormGrid.js' */                    }
/*Line 108 - 'AtomFormGrid.js' */                    this.createField(container, item);

/*Line 110 - 'AtomFormGrid.js' */                }

/*Line 112 - 'AtomFormGrid.js' */            }
754263
def create_rails_view
      name = @view.underscore
      Rails.application.eager_load! if ApplicationController.descendants.length == 0
      controllers = ApplicationController.descendants.map { |cont| cont.name.gsub('Controller', '').underscore }
      dirname = controllers.include?(name) ? name : name.pluralize
      empty_directory "app/views/#{dirname}"
      if Gem.loaded_specs.has_key? 'haml-rails'
        file = "app/views/#{dirname}/index.html.haml"
        copy_file "boilerplate/views/rails_view.html.haml", file
        gsub_file file, /placeholder/, name
      else
        file = "app/views/#{dirname}/index.html.erb"
        copy_file "boilerplate/views/rails_view.html.erb", file
        gsub_file file, /placeholder/, name
      end
    end
696483
def bootstrap_form_with(**options, &block)
      bootstrap_options = options[:bootstrap] || {}

      css_classes = options.delete(:class)

      if bootstrap_options[:layout].to_s == "inline"
        css_classes = [css_classes, "form-inline"].compact.join(" ")
      end

      form_options = options.reverse_merge(builder: ComfyBootstrapForm::FormBuilder)
      form_options.merge!(class: css_classes) unless css_classes.blank?

      supress_form_field_errors do
        form_with(**form_options, &block)
      end
    end
491507
function Avowal(options) {
    var opts = options || {};
    opts.templates = opts.templates || {};

    if (!opts.name) {
      fail('form name attribute needed.');
    }

    this.form = document.querySelector('form[name=' + opts.name + ']');
    if (!this.form) {
      fail('form "' + opts.name + '" not found.');
    }

    this._state = {};
    this._cache = {};
    this._lifecycle = {};
    this._statusMessages = {};
    this._templates = {
      success: opts.templates.success || '<span>{{message}}</span>',
      error: opts.templates.error || '<span>{{message}}</span>'
    };

    this._initEventDelegation(opts.on || 'input');
  }