<commit_before>// Sample view

enyo.kind({
    name: "moon.SearchResultImageItem",
    classes: "moon-search-result-item",
    spotlight: true,
    published: {
        option: {
            src: "",
            caption: ""
        }
    },
    handlers: {
        onSpotlightFocused: "focused",
        onSpotlightBlur: "released"
    },
    components: [
        {name: "caption", classes: "moon-search-result-item-text"}
    ],
    create: function() {
        this.inherited(arguments);
        this.optionChanged();
    },
    getCaption: function() {
        return this.$.caption;
    },
    optionChanged: function(inOld) {
        this.applyStyle("background-image", 'url(' + this.option.src + ')');
        this.$.caption.setContent(this.option.caption);
    },
    focused: function() {
        this.$.caption.addClass("spotlight");
        return true;
    },
    released: function() {
        this.$.caption.removeClass("spotlight");
        return true;
    }
});

enyo.kind({
    name: "moon.sample.search.RecentSearchHalfSample",
    kind: "moon.Panel",
    titleAbove: "02",
    title: "SEARCH",
    titleBelow: "",
    headerComponents: [
        /* Fixme: moon.Panel needs interface to change Header, Body, Tools area size */
        {kind: "moon.InputDecorator", components: [
            {style: "width: 500px", components: [
                {layoutKind: 'FittableColumnsLayout', components: [
                    {kind: "moon.Input", placeholder: "Search term", fit: true, onchange: "inputChanged"},
                    {kind: "Image", src: "../../samples/assets/search-input-search.png", classes: "moon-search-result-image"}
                ]}
            ]}
        ]}
    ],
    components: [
        {
            /* Fixme: enyo.DataList should be changed to moon.DataGrid to support scroll */
            kind: "moon.DataList",
            name: "resultInfo",
            components: [
                {                  
                    bindings: [
                        {from: ".model.option", to: ".$.searchResultImageItem.option"}
                    ], 
                    components: [{                   
                        name: "searchResultImageItem",
                        kind: "moon.SearchResultImageItem", 
                        ontap: "changeName"
                    }]
                }
            ]
        }
    ],
    bindings: [
        {from: ".controller.result", to: ".$.resultInfo.controller"}
    ]
});

// Sample model

enyo.ready(function(){
    var sampleModel = new enyo.Model({
        result: new enyo.Collection([
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}},
            {option: {src: "../assets/default-movie.png", caption: "Person name"}}
        ])
    });

//  Application to render sample

    new enyo.Application({
        view: {
            classes: "enyo-unselectable moon",
            components: [
                {
                    kind: "moon.sample.search.RecentSearchHalfSample",
                    controller: ".app.controllers.searchController",
                    classes: "enyo-fit"
                }
            ]
        },
        controllers: [
            {
                name: "searchController",
                kind: "enyo.ModelController",
                model: sampleModel,
                changeName: function(inSender, inEvent) {
                    inSender.getCaption().setContent("Selected");
                }
            }
        ]
    });
});<commit_msg>GF-53116: Sample fix, use DataGridList instead of DataList, fix up cruft. DCO-1.1-Signed-Off-By: <NAME> <<EMAIL>><commit_after>enyo.kind({
    name: "moon.sample.search.RecentSearchHalfSample",
    kind: "moon.Panel",
    titleAbove: "02",
    title: "SEARCH",
    titleBelow: "",
    events: {
        onChangeName:""
    },
    headerComponents: [
        /* Fixme: moon.Panel needs interface to change Header, Body, Tools area size */
        {kind: "moon.InputDecorator", components: [
            {style: "width: 500px", components: [
                {layoutKind: 'FittableColumnsLayout', components: [
                    {kind: "moon.Input", placeholder: "Search term", fit: true, onchange: "inputChanged"},
                    {kind: "Image", src: "../../samples/assets/search-input-search.png", classes: "moon-search-result-image"}
                ]}
            ]}
        ]}
    ],
    components: [
        {
            /* Fixme: enyo.DataList should be changed to moon.DataGrid to support scroll */
            kind: "moon.DataGridList",
            name: "resultInfo",
            spacing: 20, 
            minWidth: 250, 
            minHeight: 200,
            components: [
                {                  
                    kind: "moon.GridListImageItem", 
                    ontap: "changeName",
                    bindings: [
                        {from: ".model.caption", to: ".caption"},
                        {from: ".model.src", to: ".source"}
                    ]
                }
            ]
        }
    ],
    bindings: [
        {from: ".controller.result", to: ".$.resultInfo.collection"}
    ],
    changeName: function(inSender, inEvent) {
        this.doChangeName({index:inEvent.index});
    }
});

// Sample model

enyo.ready(function(){
    var sampleModel = new enyo.Model({
        result: new enyo.Collection([
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"},
            {src: "../assets/default-movie.png", caption: "Person name"}
        ])
    });

//  Application to render sample

    new enyo.Application({
        view: {
            classes: "enyo-unselectable moon",
            components: [
                {name:"searchView", kind: "moon.sample.search.RecentSearchHalfSample", classes:"enyo-fit"}
            ]
        },
        components: [
            {
                name: "searchController",
                kind: "enyo.ModelController",
                model: sampleModel
            }
        ],
        bindings: [
            {from:".$.searchController", to:".view.$.searchView.controller"}
        ],
        handlers: {
            onChangeName: "changeName"
        },
        changeName: function(inSender, inEvent) {
            this.$.searchController.get("model").get("result").at(inEvent.index).set("caption", "New name set");
        }
    });
});
{'fraction_non_alphanumeric': 0.17121564072783585, 'fraction_numerical': 0.0024196670538133955, 'mean_word_length': 1.810171335327713, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5008832', 'n_tokens_mistral': 3012, 'n_tokens_neox': 2814, 'n_words': 614}