(function ($) {
    $.field_views = function (element, options) {
        var defaults = {
        }
        var plugin = this;
        plugin.settings = {}
        var $element = $(element), 
            element = element;    
        
        plugin.init = function () {
            plugin.settings = $.extend({}, defaults, options);
            let field_name = plugin.settings.field_name;
            $element.find(`input[name="${field_name}"]`).iCheck({
                checkboxClass: 'icheckbox_square-red',
                radioClass: 'iradio_square-red',
                increaseArea: '20%' 
            });
            ;
        };
        plugin.example_function = function () {
        };
        plugin.init();
    }
    
    $.fn.field_views = function (options) {
        
        return this.each(function () {
            
            if (undefined == $(this).data('field_views')) {
                var plugin = new $.field_views(this, options);
                $(this).data('field_views', plugin);
            }
        });
    }
})(jQuery);