{"size": 2108, "ext": "js", "max_stars_repo_path": "src/components/Form/fields.js", "max_stars_repo_name": "SerDIDG/MagpieUI4", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/Form/fields.js", "max_issues_repo_name": "SerDIDG/MagpieUI4", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/Form/fields.js", "max_forks_repo_name": "SerDIDG/MagpieUI4", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.1333333333, "max_line_length": 76, "alphanum_fraction": 0.3861480076}
Com.FormFields.add('empty', {
    'field': false,
    'fieldConstructor': 'Com.AbstractFormField',
});

Com.FormFields.add('buttons', {
    'node': cm.node('div', {'class': 'pt__buttons pull-right'}),
    'field': false,
    'system': true,
    'callbacks': {
        'render': function(that) {
            var nodes = {};
            nodes['container'] = that.params['node'];
            nodes['inner'] = cm.node('div', {'class': 'inner'});
            cm.appendChild(nodes['inner'], nodes['container']);
            return nodes;
        },
        'controller': function(that) {
            var buttons = {},
                node;
            cm.forEach(that.params['options'], function(item) {
                node = cm.node('button', {'class': 'button'}, item['text']);
                switch (item['value']) {
                    case 'submit':
                        node.type = 'submit';
                        cm.addClass(node, 'button-primary');
                        cm.addEvent(node, 'click', function(e) {
                            cm.preventDefault(e);
                            that.form.send();
                        });
                        break;

                    case 'reset':
                        node.type = 'reset';
                        cm.addClass(node, 'button-secondary');
                        cm.addEvent(node, 'click', function(e) {
                            cm.preventDefault(e);
                            that.form.reset();
                        });
                        break;

                    case 'clear':
                        cm.addClass(node, 'button-secondary');
                        cm.addEvent(node, 'click', function(e) {
                            cm.preventDefault(e);
                            that.form.clear();
                        });
                        break;

                    default:
                        break;
                }
                buttons[item['value']] = node;
                that.params['node'].appendChild(node);
            });
            return buttons;
        },
    },
});
