<commit_before>/*
 * DiscoJuice
 * Author: <NAME>, UNINETT, <EMAIL>
 * Licence undecided.
 */
if (typeof DiscoJuice == "undefined") var DiscoJuice = {};

DiscoJuice.Hosted = {
	
	"setup": function (target, title, spentityid, responseurl, feeds, redirectURL) {
		var options, i;
		
		options = {
			"title": "Sign in to <strong>" + title + "</strong>",
			"subtitle": "Select your Provider",
			"disco": {
				"spentityid": spentityid,
				"url": responseurl,
				"stores": ["https://store.discojuice.org/"],
				"writableStore": "https://store.discojuice.org/"
			},
			"cookie": true,
			"country": true,
			"location": true,
			"countryAPI": "https://store.discojuice.org/country",
			"discoPath": "https://static.discojuice.org/",
			"callback": function (e, djc) {
                var returnto = window.location.href;
				window.location = redirectURL + escape(e.entityID);
			},
			"metadata": []
		};
		
		for(i = 0; i < feeds.length; i++) {
			options.metadata.push("https://static.discojuice.org/feeds/" + feeds[i]);
		}
		
		$(document).ready(function() {
			$(target).DiscoJuice(options);
			console.log("SETUP completed");
			console.log(options);
		});
		
	}
	
};<commit_msg>Adding helped function to load hosted configuration<commit_after>/*
 * DiscoJuice
 * Author: <NAME>, UNINETT, <EMAIL>
 * Licence undecided.
 */
if (typeof DiscoJuice == "undefined") var DiscoJuice = {};

function getConfig (target, title, spentityid, responseurl, feeds, redirectURL) {
	var options, i;
	
	options = {
		"title": "Sign in to <strong>" + title + "</strong>",
		"subtitle": "Select your Provider",
		"disco": {
			"spentityid": spentityid,
			"url": responseurl,
			"stores": ["https://store.discojuice.org/"],
			"writableStore": "https://store.discojuice.org/"
		},
		"cookie": true,
		"country": true,
		"location": true,
		"countryAPI": "https://store.discojuice.org/country",
		"discoPath": "https://static.discojuice.org/",
		"callback": function (e, djc) {
            var returnto = window.location.href;
			window.location = redirectURL + escape(e.entityID);
		},
		"metadata": []
	};
	
	for(i = 0; i < feeds.length; i++) {
		options.metadata.push("https://static.discojuice.org/feeds/" + feeds[i]);
	}
	return options;
}


DiscoJuice.Hosted = {
	
	"getConfig": getConfig,
		
	"setup": function (target, title, spentityid, responseurl, feeds, redirectURL) {
		var options;

		options = getConfig(target, title, spentityid, responseurl, feeds, redirectURL);
		
		$(document).ready(function() {
			$(target).DiscoJuice(options);
			console.log("SETUP completed");
			console.log(options);
		});
		
	}
	
};
{'fraction_non_alphanumeric': 0.18369690011481057, 'fraction_numerical': 0.0007654037504783774, 'mean_word_length': 3.6512455516014235, 'pattern_counts': {'":': 31, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 10, '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': '3397626', 'n_tokens_mistral': 1050, 'n_tokens_neox': 900, 'n_words': 187}