<commit_before><?xml version="1.0"?>
<js:Application xmlns="http://www.w3.org/1999/xhtml"
                xmlns:js="js.core" xmlns:ui="js.ui" xmlns:fx="js.fx">

    <js:Imports>
        js.core.Base;
    </js:Imports>

    <js:Script>
        (function () {
            return {
                /**
                 * Initializes the app
                 * this method is called right after the script tag is evaluated
                 */
                initialize:function () {
                    this.set("appName", "AWESOME APP");
                    this.set("hello", "Hello world");
                    this.set("facets", [
                        {
                            label:'Colors',
                            subitems:['red', "green", "gold"]
                        },
                        {
                            label:'Sizes',
                            subitems:['S', "M", "L"]
                        }
                    ]);
                    this.model = new js.core.Bindable({name:'Bob'});

                    this.set("modelBinding", new js.core.Binding({model:this.model, key:'name'}))
                },

                /**
                 * This method should be called from outside to start the application
                 */
                start:function () {
                    this.render(document.body);
                }
            }
        })();
    </js:Script>

    <!-- TODO DO not allow binding for ID -->
    <div id="test" onclick="alert('what')">
        <span>{hello}</span>
        <br/>
        <span>{appName}</span>
    </div>

    <div class="{appName}">
        <!--<js:Template name="ListItem">-->
        <!--</js:Template>-->
    </div>

    <!--<cfg:Modules>-->
    <!--<js:Module src="app.modules.Articles" route="/^articles(.*)$/" />-->
    <!--</cfg:Modules>-->

    <!--<js:ModuleLoader id="">-->
    <!--&lt;!&ndash; optional&ndash;&gt;-->
    <!--<js:ContentPlaceHolder name="main">-->
    <!--</js:ContentPlaceHolder>-->
    <!--</js:ModuleLoader>-->
    <ui:ItemsView tagName="ul" items="{facets}" class="facets">
        <js:Template name="item">
            <li>
                <b>Select:</b>
                <span>{item.label}</span>
                <ui:ItemsView items="{item.subitems}" tagName="ul">
                    <js:Template name="item">
                        <li>{item} for {appName}</li>
                    </js:Template>
                </ui:ItemsView>
            </li>
        </js:Template>
    </ui:ItemsView>


    <!--comes into moduleloader into content place holders-->
    <!--<header class="fixed">--><commit_msg>- added hash var example<commit_after><?xml version="1.0"?>
<js:Application xmlns="http://www.w3.org/1999/xhtml"
                xmlns:js="js.core" xmlns:ui="js.ui" xmlns:fx="js.fx">

    <js:Imports>
        js.core.Base;
    </js:Imports>

    <js:Script>
        (function () {
            return {
                /**
                 * Initializes the app
                 * this method is called right after the script tag is evaluated
                 */
                initialize:function () {
                    this.set("appName", "AWESOME APP");
                    this.set("hello", "Hello");
                    this.set("hash", {a: {b: {c: "Welt"}}});
                    this.set("facets", [
                        {
                            label:'Colors',
                            subitems:['red', "green", "gold"]
                        },
                        {
                            label:'Sizes',
                            subitems:['S', "M", "L"]
                        }
                    ]);
                    this.model = new js.core.Bindable({name:'Bob'});

                    this.set("modelBinding", new js.core.Binding({model:this.model, key:'name'}))
                },

                /**
                 * This method should be called from outside to start the application
                 */
                start:function () {
                    this.render(document.body);
                },
                onItemClick: function(e){
                    e.target.get('item');
                    // e.preventDefault();
                    // this.showItem(e.item);
                },
                foo: function(e){

                },
                showItem: function(item){

                }
            }
        })();
    </js:Script>

    <!-- TODO DO not allow binding for ID -->
    <div id="test" onclick="foo">
        <span>{hello} {hash.a.b.c}</span>
        <br/>
        <span>{appName}</span>
    </div>

    <div class="{appName}">
        <!--<js:Template name="ListItem">-->
        <!--</js:Template>-->
    </div>

    <!--<cfg:Modules>-->
    <!--<js:Module src="app.modules.Articles" route="/^articles(.*)$/" />-->
    <!--</cfg:Modules>-->

    <!--<js:ModuleLoader id="">-->
    <!--&lt;!&ndash; optional&ndash;&gt;-->
    <!--<js:ContentPlaceHolder name="main">-->
    <!--</js:ContentPlaceHolder>-->
    <!--</js:ModuleLoader>-->
    <ui:ItemsView tagName="ul" items="{facets}" class="facets">
        <js:Template name="item">
            <li>
                <b>Select:</b>
                <span>{item.label}</span>
                <ui:ItemsView items="{item.subitems}" tagName="ul">
                    <js:Template name="item">
                        <li onclick="onItemClick">{item} for {appName} on {hash.a.b.c}</li>
                    </js:Template>
                </ui:ItemsView>
            </li>
        </js:Template>
    </ui:ItemsView>


    <!--comes into moduleloader into content place holders-->
    <!--<header class="fixed">-->
{'fraction_non_alphanumeric': 0.1787414066631412, 'fraction_numerical': 0.0024678300722721664, 'mean_word_length': 1.2373817034700316, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 2, '>': 111, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 10}, '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': '6361946', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1511, 'n_words': 276}