<commit_before><link rel="import" href="../../bower_components/polymer/polymer.html">

<link rel="import" href="../dtile-shell/dtile-shell.html">

<dom-module id="dtile-app">
    <template>
        <dtile-shell>

        </dtile-shell>
    </template>
</dom-module>

<script>
    class DTileApp extends Polymer.Element {
        static get is() { return "dtile-app"; }
    }

    customElements.define(DTileApp.is, DTileApp);
</script><commit_msg>Add basic routing<commit_after><link rel="import" href="../../bower_components/polymer/polymer.html">

<link rel="import" href="../../bower_components/app-route/app-location.html">
<link rel="import" href="../../bower_components/app-route/app-route.html">

<link rel="import" href="../../bower_components/iron-pages/iron-pages.html">

<link rel="import" href="../dtile-shell/dtile-shell.html">

<dom-module id="dtile-app">
    <template>
        <app-location id="location" route="{{route}}"></app-location>
        <app-route
            route="{{route}}"
            pattern="/:pageName"
            data="{{pageData}}"
            tail="{{subroute}}">
        </app-route>
        <app-route
            route="{{subroute}}"
            pattern="/:content"
            data="{{pageContentData}}">
        </app-route>

        <dtile-shell>
            <iron-pages selected="[[page]]" attr-for-selected="page">
                <span page="projects">Projects</span>
                <span page="maps">Maps</span>
                <span page="tilesets">Maps</span>
                <span page="editor">Editor</span>
            </iron-pages>
        </dtile-shell>
    </template>
</dom-module>

<script>
    class DTileApp extends Polymer.Element {
        static get is() { return "dtile-app"; }

        static get properties() {
            return {
                page: {
                    type: String,
                    value: "projects"
                },

                pageData: Object,
                pageContentData: Object
            };
        }

        static get observers() {
            return [
                "_updatePage(pageData, pageContentData)"
            ];
        }

        _updatePage(pageData, pageContentData) {
            if (pageData.pageName === "") {
                this.$.location.path = "projects";
            } else {
                this.page = pageData.pageName;
            }
        }
    }

    customElements.define(DTileApp.is, DTileApp);
</script>
{'fraction_non_alphanumeric': 0.16462917685411574, 'fraction_numerical': 0.0, 'mean_word_length': 1.8513356562137049, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 42, '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': '898533', 'n_tokens_mistral': 724, 'n_tokens_neox': 694, 'n_words': 116}