<commit_before>// Copyright (c) 2013 M-Way Solutions GmbH
// http://github.com/mwaylabs/The-M-Project/blob/absinthe/MIT-LICENSE.txt

(function( scope ) {

    /**
     * the switchlayout template
     * @type {string}
     */
    var switchTemplate = M.SwitchLayout.prototype.template;
    /**
     * the header template
     * @type {string}
     */

    var headerTemplate = M.HeaderLayout.prototype.template;
    /**
     * add a header to the both content container
     * @type {string}
     */
    var myTemplate = switchTemplate.replace(/m-page-1">/gi, 'm-page-1">' + headerTemplate.replace(/data-childviews="header"/gi, 'data-childviews="content_page1_header"'));
    myTemplate = myTemplate.replace(/m-page-2">/gi, 'm-page-2">' + headerTemplate.replace(/data-childviews="header"/gi, 'data-childviews="content_page2_header"'));

    /**
     * A Switchlayout with a header and content
     * @type {*|Object|void}
     */
    M.SwitchMenuHeaderContentLayout = M.SwitchHeaderContentLayout.extend({

        _type: 'M.SwitchHeaderContentLayout',

        /**
         * the template - a combination of the header and switch template
         * @type {string}
         */
        template: myTemplate,

        cssClass:'switch-menu-header-content-layout',

        menu: null,

        /**
         * The content gets mapped to the DOM via the Switchlayout. Then map the header to the Layout.
         * @param {Object} the views to display
         * @returns {SwitchHeaderContentLayout}
         */
        applyViews: function( settings ) {

            if( !this.menu ) {
                this.menu = M.MenuView.extend().create().render();
                this.$el.append(this.menu.$el);
            }
            var menuButton = M.ButtonView.extend();
            settings.header.addChildView('first', menuButton.create());

            M.SwitchHeaderContentLayout.prototype.applyViews.apply(this, [settings]);

            if(!this._firstRender){
                //insert the view
                this.$el.find('[data-childviews="menu-content"]').html(settings.menuContent.render().$el);
            }
            return this;
        }
    });

})(this);<commit_msg>add menu to header - waiting on bugfix<commit_after>// Copyright (c) 2013 M-Way Solutions GmbH
// http://github.com/mwaylabs/The-M-Project/blob/absinthe/MIT-LICENSE.txt

(function( scope ) {

    /**
     * the switchlayout template
     * @type {string}
     */
    var switchTemplate = M.SwitchLayout.prototype.template;
    /**
     * the header template
     * @type {string}
     */

    var headerTemplate = M.HeaderLayout.prototype.template;
    /**
     * add a header to the both content container
     * @type {string}
     */
    var myTemplate = switchTemplate.replace(/m-page-1">/gi, 'm-page-1">' + headerTemplate.replace(/data-childviews="header"/gi, 'data-childviews="content_page1_header"'));
    myTemplate = myTemplate.replace(/m-page-2">/gi, 'm-page-2">' + headerTemplate.replace(/data-childviews="header"/gi, 'data-childviews="content_page2_header"'));

    /**
     * A Switchlayout with a header and content
     * @type {*|Object|void}
     */
    M.SwitchMenuHeaderContentLayout = M.SwitchHeaderContentLayout.extend({

        _type: 'M.SwitchHeaderContentLayout',

        /**
         * the template - a combination of the header and switch template
         * @type {string}
         */
        template: myTemplate,

        cssClass:'switch-menu-header-content-layout',

        menu: null,

        /**
         * The content gets mapped to the DOM via the Switchlayout. Then map the header to the Layout.
         * @param {Object} the views to display
         * @returns {SwitchHeaderContentLayout}
         */
        applyViews: function( settings ) {

            if( !this.menu ) {
                this.menu = M.MenuView.extend().create().render();
                this.$el.append(this.menu.$el);
            }
            var that = this;
            var menuButton = M.ButtonView.extend({
                value: '',
                icon: 'fa-align-justify',
                events: {
                    tap: function() {
                        that.menu.toggle();
                    }
                }
            }).create();
            settings.header.addChildView('first', menuButton);
            M.SwitchHeaderContentLayout.prototype.applyViews.apply(this, [settings]);


            if(!this._firstRender){
                //insert the view
                this.$el.find('[data-childviews="menu-content"]').html(settings.menuContent.render().$el);
            }
            return this;
        }
    });

})(this);
{'fraction_non_alphanumeric': 0.13565891472868216, 'fraction_numerical': 0.004306632213608958, 'mean_word_length': 2.0519053876478317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4895212', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1271, 'n_words': 266}