<commit_before>require(window.APT_OPTIONS.configObject,
	['underscore', 'js/quickvm_sup', 'moment', 'js/ppstart',
	 'js/lib/text!template/show-profile.html',
	 'js/lib/text!template/waitwait-modal.html',
	 'js/lib/text!template/renderer-modal.html',
	 'js/lib/text!template/showtopo-modal.html',
	 'js/lib/text!template/rspectextview-modal.html',
	 'js/lib/text!template/guest-instantiate.html',
	 'js/lib/text!template/instantiate-modal.html',
	 'js/lib/text!template/oops-modal.html',
	 'js/lib/text!template/share-modal.html',
	 // jQuery modules
	 'marked','jquery-ui','jquery-grid'],
function (_, sup, moment, ppstart,
	  showString, waitwaitString, 
	  rendererString, showtopoString, rspectextviewString,
	  guestInstantiateString, instantiateString, oopsString, shareString)
{
    'use strict';
    var profile_uuid = null;
    var version_uuid = null;
    var gotscript    = 0;
    var ajaxurl      = "";
    var amlist       = null;
    var isppprofile  = false;
    var myCodeMirror = null;
    var showTemplate      = _.template(showString);
    var InstTemplate      = _.template(instantiateString);
    var shareTemplate     = _.template(shareString);

    function initialize()
    {
	window.APT_OPTIONS.initialize(sup);
	version_uuid  = window.VERSION_UUID;
	profile_uuid  = window.PROFILE_UUID;
	ajaxurl       = window.AJAXURL;
	isppprofile   = window.ISPPPROFILE;

	var fields = JSON.parse(_.unescape($('#form-json')[0].textContent));
	amlist     = JSON.parse(_.unescape($('#amlist-json')[0].textContent));

	if (_.has(fields, "profile_script") && fields["profile_script"] != "") {
	    gotscript = 1;
	}
	
	// Generate the templates.
	var show_html   = showTemplate({
	    fields:		fields,
	    version_uuid:	version_uuid,
	    profile_uuid:	profile_uuid,
	    history:		window.HISTORY,
	    isadmin:		window.ISADMIN,
	    withpublishing:     window.WITHPUBLISHING,
	});
	$('#page-body').html(show_html);

	$('#waitwait_div').html(waitwaitString);
	$('#showtopomodal_div').html(showtopoString);
	$('#guest_div').html(guestInstantiateString);
    	var instantiate_html = InstTemplate({ amlist: amlist,
					      amdefault: window.AMDEFAULT});
	$('#instantiate_div').html(instantiate_html);
	$('#rspectext_div').html(rspectextviewString);
	$('#oops_div').html(oopsString);
	$('#share_div').html(shareTemplate({formfields: fields}))

	// This activates the popover subsystem.
	$('[data-toggle="popover"]').popover({
	    trigger: 'hover',
	    container: 'body'
	});
	// Format dates with moment before display.
	$('.format-date').each(function() {
	    var date = $.trim($(this).html());
	    if (date != "") {
		$(this).html(moment($(this).html()).format("lll"));
	    }
	});<commit_msg>Minor fix to popover placement.<commit_after>require(window.APT_OPTIONS.configObject,
	['underscore', 'js/quickvm_sup', 'moment', 'js/ppstart',
	 'js/lib/text!template/show-profile.html',
	 'js/lib/text!template/waitwait-modal.html',
	 'js/lib/text!template/renderer-modal.html',
	 'js/lib/text!template/showtopo-modal.html',
	 'js/lib/text!template/rspectextview-modal.html',
	 'js/lib/text!template/guest-instantiate.html',
	 'js/lib/text!template/instantiate-modal.html',
	 'js/lib/text!template/oops-modal.html',
	 'js/lib/text!template/share-modal.html',
	 // jQuery modules
	 'marked','jquery-ui','jquery-grid'],
function (_, sup, moment, ppstart,
	  showString, waitwaitString, 
	  rendererString, showtopoString, rspectextviewString,
	  guestInstantiateString, instantiateString, oopsString, shareString)
{
    'use strict';
    var profile_uuid = null;
    var version_uuid = null;
    var gotscript    = 0;
    var ajaxurl      = "";
    var amlist       = null;
    var isppprofile  = false;
    var myCodeMirror = null;
    var showTemplate      = _.template(showString);
    var InstTemplate      = _.template(instantiateString);
    var shareTemplate     = _.template(shareString);

    function initialize()
    {
	window.APT_OPTIONS.initialize(sup);
	version_uuid  = window.VERSION_UUID;
	profile_uuid  = window.PROFILE_UUID;
	ajaxurl       = window.AJAXURL;
	isppprofile   = window.ISPPPROFILE;

	var fields = JSON.parse(_.unescape($('#form-json')[0].textContent));
	amlist     = JSON.parse(_.unescape($('#amlist-json')[0].textContent));

	if (_.has(fields, "profile_script") && fields["profile_script"] != "") {
	    gotscript = 1;
	}
	
	// Generate the templates.
	var show_html   = showTemplate({
	    fields:		fields,
	    version_uuid:	version_uuid,
	    profile_uuid:	profile_uuid,
	    history:		window.HISTORY,
	    isadmin:		window.ISADMIN,
	    withpublishing:     window.WITHPUBLISHING,
	});
	$('#page-body').html(show_html);

	$('#waitwait_div').html(waitwaitString);
	$('#showtopomodal_div').html(showtopoString);
	$('#guest_div').html(guestInstantiateString);
    	var instantiate_html = InstTemplate({ amlist: amlist,
					      amdefault: window.AMDEFAULT});
	$('#instantiate_div').html(instantiate_html);
	$('#rspectext_div').html(rspectextviewString);
	$('#oops_div').html(oopsString);
	$('#share_div').html(shareTemplate({formfields: fields}))

	// This activates the popover subsystem.
	$('[data-toggle="popover"]').popover({
	    trigger: 'hover',
	    placement: 'auto',
	    container: 'body'
	});
	
	// Format dates with moment before display.
	$('.format-date').each(function() {
	    var date = $.trim($(this).html());
	    if (date != "") {
		$(this).html(moment($(this).html()).format("lll"));
	    }
	});
{'fraction_non_alphanumeric': 0.16513929618768328, 'fraction_numerical': 0.001466275659824047, 'mean_word_length': 4.066852367688022, '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': '1335556', 'n_tokens_mistral': 1923, 'n_tokens_neox': 1829, 'n_words': 286}