<commit_before>define([
    "../events/events",
    "../utils/logger",
    "./gplayer_view",
    "./player/player",
    "nativesortable",
    "mCustomScrollbar"
], function(Events, Logger, gPlayerView, Player, NativeSortable, mCustomScrollbar) {
    /**
     * View
     */
    var View = function(controller, notifications) {
        this._controller = controller;
        this._notifications = notifications;
        
        this.init(); // init constructor
    };
    
    View.prototype = {
        _model: null,
        _controller: null,
        _notifications: null,
        
        
        /**
         * Constructor for the view.
         *
         * @return this for chaining
         */
        init: function() {
            Logger.debug('VIEW::INIT FIRED');
            
            return this;
        },
        
        
        /**
         * Sets the view up :)
         *              
         * @return this for chaining
         */
        setup: function() {
            Logger.debug('VIEW::SETUP FIRED');
            
            this.layout();
            
            return this;
        },
        
        
        /**
         * 
         *
         */
        layout: function() {
            Logger.debug('VIEW::LAYOUT FIRED');
            
            var gPlayerViewLayout = new gPlayerView(this).append(this.getModel().getContainer());
            
            $(this.getModel().getContainer())
                .addClass('orange')
                .addClass(this.getModel().classes.gPlayer)
                .addClass(this.getModel().classes.draggable_queue)
                .addClass(this.getModel().classes.size)
                .addClass(this.getModel().classes.empty);
            
            var PlayerView = new Player(this).append('.'+this.getModel().classes.player_wrapper);
            
            // @todo move this out.. to queue as it should append itself
            NativeSortable(document.querySelector('.queue'), {
                change: onchange,
                childClass: 'sortable-child',
                draggingClass: 'sortable-dragging',
                overClass: 'sortable-over'
            });
            
            this.horizontalScrollInit();
            
            return this;
        },
        
        // @todo move this out.. to queue as it should append itself
        horizontalScrollInit: function() {
            mCustomScrollbar($); // @todo Figure what's the deal with the mouseheel plugin.. 
            
            $('.queue-container').mCustomScrollbar({
                    scrollInertia: 150,
                    
                    onTotalScrollOffset: 40,
                    onTotalScrollBackOffset: 20,
                    
                    mouseWheel: true,
                    horizontalScroll: true,
                    
                    advanced:{
                        autoExpandHorizontalScroll: true
                    }
            });
            
            this.horizontalScrollUpdate();
        },
        
        // @todo move this out.. to queue as it should append itself
        horizontalScrollUpdate: function() {
            $('.queue-container').mCustomScrollbar('update');
            
            if ($('.mCustomScrollBox .mCSB_container')) {
                var width = $('.mCustomScrollBox .mCSB_container').css('width') || '0px';
                var widthPX = Number(width.replace('px', ''));
                
                if (widthPX <= window.innerWidth) {
                    $('.mCustomScrollBox .mCSB_container').css('width', '100%');
                }
            }<commit_msg>removed hard coded container path to read the model<commit_after>define([
    "../events/events",
    "../utils/logger",
    "./gplayer_view",
    "./player/player",
    "nativesortable",
    "mCustomScrollbar"
], function(Events, Logger, gPlayerView, Player, NativeSortable, mCustomScrollbar) {
    /**
     * View
     */
    var View = function(controller, notifications) {
        this._controller = controller;
        this._notifications = notifications;
        
        this.init(); // init constructor
    };
    
    View.prototype = {
        _model: null,
        _controller: null,
        _notifications: null,
        
        
        /**
         * Constructor for the view.
         *
         * @return this for chaining
         */
        init: function() {
            Logger.debug('VIEW::INIT FIRED');
            
            return this;
        },
        
        
        /**
         * Sets the view up :)
         *              
         * @return this for chaining
         */
        setup: function() {
            Logger.debug('VIEW::SETUP FIRED');
            
            this.layout();
            
            return this;
        },
        
        
        /**
         * 
         *
         */
        layout: function() {
            Logger.debug('VIEW::LAYOUT FIRED');
            
            var gPlayerViewLayout = new gPlayerView(this).append(this.getModel().getContainer());
            
            $(this.getModel().getContainer())
                .addClass('orange')
                .addClass(this.getModel().classes.gPlayer)
                .addClass(this.getModel().classes.draggable_queue)
                .addClass(this.getModel().classes.size)
                .addClass(this.getModel().classes.empty);
            
            var PlayerView = new Player(this).append('.'+this.getModel().classes.player_wrapper);
            
            // @todo move this out.. to queue as it should append itself
            NativeSortable(document.querySelector('.queue'), {
                change: onchange,
                childClass: 'sortable-child',
                draggingClass: 'sortable-dragging',
                overClass: 'sortable-over'
            });
            
            this.horizontalScrollInit();
            
            return this;
        },
        
        // @todo move this out.. to queue as it should append itself
        horizontalScrollInit: function() {
            mCustomScrollbar($); // @todo Figure what's the deal with the mouseheel plugin.. 
            
            $('.'+this.getModel().classes.queue_container).mCustomScrollbar({
                    scrollInertia: 150,
                    
                    onTotalScrollOffset: 40,
                    onTotalScrollBackOffset: 20,
                    
                    mouseWheel: true,
                    horizontalScroll: true,
                    
                    advanced:{
                        autoExpandHorizontalScroll: true
                    }
            });
            
            this.horizontalScrollUpdate();
        },
        
        // @todo move this out.. to queue as it should append itself
        horizontalScrollUpdate: function() {
            $('.'+this.getModel().classes.queue_container).mCustomScrollbar('update');
            
            if ($('.mCustomScrollBox .mCSB_container')) {
                var width = $('.mCustomScrollBox .mCSB_container').css('width') || '0px';
                var widthPX = Number(width.replace('px', ''));
                
                if (widthPX <= window.innerWidth) {
                    $('.mCustomScrollBox .mCSB_container').css('width', '100%');
                }
            }
{'fraction_non_alphanumeric': 0.11271834061135372, 'fraction_numerical': 0.003002183406113537, 'mean_word_length': 1.2599444958371877, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '331481', 'n_tokens_mistral': 1828, 'n_tokens_neox': 1752, 'n_words': 350}