<commit_before>// ### Part of the [Rosy Framework](http://github.com/ff0000/rosy)
/* site.js */

// ## The RED Namespace
var RED = RED || {};

// ## Local Namespace
// Example Site object, controls global functionality and instantiates the Example Default Page.
// You should replace the namespace "Example" with your own Site namespace, this is only an example.
var Example = Example || {};

// Site shell object

// Model manager and shell manager
RED.SITE = $.extend(true, Example, RED, (function () {
	
	return {
		
		models : {},
		
		init : function () {
			// Create the site shell
			this.models.Shell = new Example.Shell();
			
			// Wait for DOMContentLoaded
			$(document).ready(this.onReady.call(this));
		},
		
		onReady : function () {
			var body = $("body"),
			    // Use `attr("data-page-class")` if < jQuery 1.6
				pageClass = body.data("pageClass");
			
			// creates `Page()` based on `<div data-page-class="Home">`
			if (pageClass && typeof Example.Page[pageClass] === "function") {
				this.models[pageClass] = new Example.Page[pageClass]();
			// defaults to `Example.Page();`
			} else {
				this.models.page = new Example.Page();
			}
		}
	};
}()));<commit_msg>Move functionality into a createModel method. Allows for model instantiation outside of this static class. Creating getters for model retrieval.<commit_after>// ### Part of the [Rosy Framework](http://github.com/ff0000/rosy)
/* site.js */

// ## The RED Namespace
var RED = RED || {};

// ## Local Namespace
// Example Site object, controls global functionality and instantiates the Example Default Page.
// You should replace the namespace "Example" with your own Site namespace, this is only an example.
var Example = Example || {};

// Site shell object

// Model manager and shell manager
RED.SITE = $.extend(true, Example, RED, (function () {
	
	return {
		
		models : {},
		
		init : function () {
			// Create the site shell
			this.models.Shell = new Example.Shell();
			
			// Wait for DOMContentLoaded
			$(document).ready(this.onReady.call(this));
		},
		
		createModel : function (page, vars) {
			var master = Example.Page,
			    model = (page && typeof master[page] === "function" ? master[page] : master);
			
			return this.models[page || "page"] = new model(vars);
		},
		
		getModel : function (page) {
			return this.models[page];
		},
		
		getModels : function () {
			return this.models;
		},
		
		onReady : function () {
			var body = $("body"),
			    // Use `attr("data-page-class")` if < jQuery 1.6
				pageClass = body.data("pageClass");
			
			// creates `Page()` based on `<div data-page-class="Home">`
			this.createModel(pageClass);
		}
	};
}()));
{'fraction_non_alphanumeric': 0.15598050243719536, 'fraction_numerical': 0.0044994375703037125, 'mean_word_length': 3.04855842185129, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '603840', 'n_tokens_mistral': 927, 'n_tokens_neox': 777, 'n_words': 247}