<commit_before>define(['logger', 'tracker', 'underscore', 'jquery', 'backbone', 'voc',
        'spin',
        'data/episode/EpisodeData',
        'utils/SystemMessages', 'utils/EntityHelpers'],
    function(Logger, tracker, _, $, Backbone, Voc, Spinner, EpisodeData, SystemMessages, EntityHelpers){
    return Backbone.View.extend({
        LOG: Logger.get('OrganizeOverlayView'),
        tagName: 'div',
        className: 'organizeOverlay',
        events:{
            'click button' : 'disableOverlay'
        },
        initialize: function() {
            this.organizeView = this.options.organizeView;
            this.isOverlayEnabled = false;
            // Organize Model is provided
            var that = this,
                episode = this.getEpisode();

            if ( _.isEmpty(episode) ) {
                var version = this.getVersion();

                version.once('change:'+this.model.vie.namespaces.uri(Voc.belongsToEpisode), this.setEpisodeModelAndListeners, this);
            } else {
                this.setEpisodeModelAndListeners();
            }
        },
        render: function() {
            this.LOG.debug('Rendering OrganizeOverlayView', this.el, this.$el);

            this.$el.append('<button type="button" class="btn btn-info">Request Editing Lock</button>');
            if ( !this.episodeModel ) {
                this.$el.find('button').hide();
                this.$el.append('<span class="episodeLoading">Loading ...</span>');
            }

            return this;
        },
        setEpisodeModelAndListeners: function() {
            this.episodeModel = this.getEpisode();

            this.$el.find('span.episodeLoading').remove();
            this.$el.find('button').show();

            if ( this.isOverlayNeeded() ) {
                this.enableOverlayVisuals();
            } else if ( this.isLockedByCurrentUser() ) {
                this.enableReleaseLockButton();
            } else {
                this.$el.hide();
            }<commit_msg>LL-907 A small big fix.<commit_after>define(['logger', 'tracker', 'underscore', 'jquery', 'backbone', 'voc',
        'spin',
        'data/episode/EpisodeData',
        'utils/SystemMessages', 'utils/EntityHelpers'],
    function(Logger, tracker, _, $, Backbone, Voc, Spinner, EpisodeData, SystemMessages, EntityHelpers){
    return Backbone.View.extend({
        LOG: Logger.get('OrganizeOverlayView'),
        tagName: 'div',
        className: 'organizeOverlay',
        events:{
            'click button' : 'disableOverlay'
        },
        initialize: function() {
            this.organizeView = this.options.organizeView;
            this.isOverlayEnabled = false;
            // Organize Model is provided
            var that = this,
                episode = this.getEpisode();

            if ( _.isEmpty(episode) ) {
                var version = this.getVersion();

                version.once('change:'+this.model.vie.namespaces.uri(Voc.belongsToEpisode), this.setEpisodeModelAndListeners, this);
            } else {
                this.setEpisodeModelAndListeners();
            }
        },
        render: function() {
            this.LOG.debug('Rendering OrganizeOverlayView', this.el, this.$el);

            this.$el.append('<button type="button" class="btn btn-info">Request Editing Lock</button>');
            if ( !this.episodeModel ) {
                this.$el.find('button').hide();
                this.$el.append('<span class="episodeLoading">Loading ...</span>');
            }

            return this;
        },
        setEpisodeModelAndListeners: function() {
            this.episodeModel = this.getEpisode();

            this.$el.find('span.episodeLoading').remove();
            this.$el.find('button').show();
            this.$el.hide();

            if ( this.isOverlayNeeded() ) {
                this.enableOverlayVisuals();
            } else if ( this.isLockedByCurrentUser() ) {
                this.enableReleaseLockButton();
            }
{'fraction_non_alphanumeric': 0.13896525868532866, 'fraction_numerical': 0.0007498125468632841, 'mean_word_length': 1.9513274336283186, 'pattern_counts': {'":': 0, '<': 11, '<?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': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3418766', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1070, 'n_words': 183}