<commit_before>require(['livedesk-embed/concat.min'], function(){
	require([
		'jquery',
		'livedesk-embed/views/timeline',
        'livedesk-embed/views/user-comments-popup',
		'livedesk-embed/plugins',
		'jquery/cookie',
		'i18n!livedesk_embed'
	], function( $, TimelineView, UserCommentsPopupView ){
		var data = { url: livedesk.blog };
/*		if(livedesk.language) {
			$.cookie('superdesk.langcode',livedesk.language);
		}
*/
		if( livedesk.el !== undefined) {
			if($(livedesk.el).length !== 0)
				data.el = livedesk.el;
			else
				console.log('Element: ',livedesk.el,' not found!');
		}

        var timeline = new TimelineView(data);
        $.dispatcher.on('after-render', function() {
        	var embedConfig = JSON.parse(this.model.get('EmbedConfig'));
            if (embedConfig && embedConfig.UserComments) {
                new UserCommentsPopupView({
                    el: '#liveblog-header', 
                    timeline: timeline,
                    model: timeline.model
                });
            } else {
            	this.el.find('#comment-btn,.comment-box').hide();
            }
        });
	});
});
<commit_msg>LB-743: User Comments - option to disable the user comments per blog<commit_after>require(['livedesk-embed/concat.min'], function(){
	require([
		'jquery',
		'livedesk-embed/views/timeline',
        'livedesk-embed/views/user-comments-popup',
		'livedesk-embed/plugins',
		'jquery/cookie',
		'i18n!livedesk_embed'
	], function( $, TimelineView, UserCommentsPopupView ){
		var data = { url: livedesk.blog };
/*		if(livedesk.language) {
			$.cookie('superdesk.langcode',livedesk.language);
		}
*/
		if( livedesk.el !== undefined) {
			if($(livedesk.el).length !== 0)
				data.el = livedesk.el;
			else
				console.log('Element: ',livedesk.el,' not found!');
		}

        var timeline = new TimelineView(data);
        $.dispatcher.on('after-render', function() {
        	var embedConfig = JSON.parse(this.model.get('EmbedConfig'));
            if (embedConfig && embedConfig.UserComments) {
                new UserCommentsPopupView({
                    el: '#liveblog-header', 
                    timeline: timeline,
                    model: timeline.model
                });
            } else {
            	this.el.find('#comment-btn,.comment-box,.comment-box-message').hide();
            }
        });
	});
});

{'fraction_non_alphanumeric': 0.16187658495350804, 'fraction_numerical': 0.0038038884192730348, 'mean_word_length': 2.3479490806223478, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3628853', 'n_tokens_mistral': 802, 'n_tokens_neox': 711, 'n_words': 114}