<commit_before>/*
 * Wegas
 * http://www.albasim.ch/wegas/
 *
 * Copyright (c) 2013 School of Business and Engineering Vaud, Comem
 * Licensed under the MIT License
 */
/**
 * @fileoverview
 * @author <NAME> <EMAIL> at <EMAIL>
 */
YUI.add('wegas-choicelist', function(Y) {
    "use strict";

    var BOUNDINGBOX = 'boundingBox',
            CONTENTBOX = 'contentBox',
            List;

    /**
     * @name Y.Wegas.ChoiceList
     * @extends Y.Wegas.List
     * @class class to serialize widgets
     * @constructor
     * @description class to serialize widgets
     */
    List = Y.Base.create("wegas-choicelist", Y.Wegas.List, [], {
        /** @lends Y.Wegas.ChoiceList# */
        bindUI: function() {
            this.after("addChild", function() {
                this.set("element", this.get("element"));
            });
        },
        syncUI: function() {
            this.constructor.superclass.syncUI.apply(this);
            this.set("element", this.get("element"));
        },
        getActiveElement: function() {
            return this.item(this.get("element"));
        }

    }, {
        EDITORNAME: "Choice List",
        /**
         * @lends Y.Wegas.ChoiceList
         */
        /**
         * @field
         * @static
         * @description
         * <p><strong>Attributes</strong></p>
         * <ul>
         *    <li>defaultChildType: default value for children. Transient.</li>
         *    <li>children: list of widget. Transient.</li>
         *    <li>direction: string-helper to add class and set style of the
         *     list (vertical or horizontal). Vertical by default</li>
         * </ul>
         */
        ATTRS: {
            defaultChildType: {
                value: "Text",
                "transient": true
            },
            children: {
                "transient": true
            },
            direction: {
                value: 'vertical',
                readOnly: true,
                "transient": true
            },
            element: {
                value: 0,
                "transient": true,
                type:"number",
                setter: function(val) {
                    if (this.size() > 0) {
                        val = val % this.size();
                        this.each(function(item) {
                            item.get("boundingBox").addClass("hiddenChild");
                        });
                        this.item(val).get("boundingBox").removeClass("hiddenChild");
                    }
                    return val;
                }
            }
        }
    });
    Y.namespace('Wegas').ChoiceList = List;

});<commit_msg>ChoiceList<commit_after>/*
 * Wegas
 * http://www.albasim.ch/wegas/
 *
 * Copyright (c) 2013 School of Business and Engineering Vaud, Comem
 * Licensed under the MIT License
 */
/**
 * @fileoverview
 * @author <NAME> <EMAIL>
 */
YUI.add('wegas-choicelist', function(Y) {
    "use strict";

    var BOUNDINGBOX = 'boundingBox',
            CONTENTBOX = 'contentBox',
            List;

    /**
     * @name Y.Wegas.ChoiceList
     * @extends Y.Wegas.List
     * @class class to serialize widgets
     * @constructor
     * @description class to serialize widgets
     */
    List = Y.Base.create("wegas-choicelist", Y.Wegas.List, [], {
        /** @lends Y.Wegas.ChoiceList# */
        bindUI: function() {
            this.after("addChild", function() {
                this.set("element", this.get("element"));
            });
        },
        syncUI: function() {
            this.constructor.superclass.syncUI.apply(this);
            this.set("element", this.get("element"));
        },
        getActiveElement: function() {
            return this.item(this.get("element"));
        }

    }, {
        EDITORNAME: "Choice List",
        /**
         * @lends Y.Wegas.ChoiceList
         */
        /**
         * @field
         * @static
         * @description
         * <p><strong>Attributes</strong></p>
         * <ul>
         *    <li>defaultChildType: default value for children. Transient.</li>
         *    <li>children: list of widget. Transient.</li>
         *    <li>direction: string-helper to add class and set style of the
         *     list (vertical or horizontal). Vertical by default</li>
         * </ul>
         */
        ATTRS: {
            defaultChildType: {
                value: "Text",
                "transient": true
            },
            children: {
                "transient": true
            },
            direction: {
                value: 'vertical',
                readOnly: true,
                "transient": true
            },
            element: {
                value: 0,
                "transient": true,
                type: "number",
                validator: Y.Lang.isNumber,
                setter: function(val) {
                    if (this.size() > 0) {
                        val = val % this.size();
                        this.each(function(item) {
                            item.get("boundingBox").addClass("hiddenChild");
                        });
                        this.item(val).get("boundingBox").removeClass("hiddenChild");
                    }
                    return val;
                }
            }
        }
    });
    Y.namespace('Wegas').ChoiceList = List;

});
{'fraction_non_alphanumeric': 0.1347344717583036, 'fraction_numerical': 0.002251829611559392, 'mean_word_length': 1.3275109170305677, 'pattern_counts': {'":': 8, '<': 32, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3750569', 'n_tokens_mistral': 1509, 'n_tokens_neox': 1439, 'n_words': 291}