<commit_before>/*
 * FlatG
 * https://github.com/goliatone/flatg-website
 *
 * Copyright (c) 2013 goliatone
 * Licensed under the MIT license.
 */
/*global define:true*/
/* jshint strict: false */
define('FlatG', ['jquery'], function($) {

	var Template = function(){};

    Template.compile = function Template(template, otag, ctag) {
            var compiled = function(context){

                function replaceFn() {
                    var prop = arguments[1];
                    return (prop in context) ? context[prop] : '';
                }
                otag = otag || "{{";
                ctag = ctag || "}}";
                
                return template.replace(new RegExp(otag+"(\\w+)"+ctag,"g"), replaceFn);
            };
            return compiled;
    };


	var GithubRelease = function(config){
		$.extend(this, GithubRelease.settings, (config || {}));
	};

	GithubRelease.settings = {
		selector:'.github-release',
		endpoint:'tags',
		url:'https://api.github.com/repos/{{user}}/{{repo}}/{{endpoint}}',
		template:'<a href="{{zipball_url}}" class="button-flat radius download">Download FlatG {{name}}</a>'
	};

	GithubRelease.prototype.init = function(){
		this.urlBuilder = Template.compile(this.url);
		var options = {
			url: this.urlBuilder(this)
		};

		this.$view = $(this.selector);

		$.ajax(options)
		.done(this.onSuccess.bind(this))
		.fail(this.onError.bind(this));
	};

	GithubRelease.prototype.onSuccess = function(result){
		var template = Template.compile(this.template);
		var html = template(result[0]);
		console.log('SUCCESS: ', result, html);
		this.$view.html(html);
	};

	GithubRelease.prototype.onError = function(error){
		console.log('ERROR: ', error);
	};



	var github = new GithubRelease({user:'goliatone', repo:'flatg-core', endpoint:'tags'});
	github.init();



    var FlatG = function(config){
        console.log('FlatG: Constructor!');
    };

    FlatG.prototype.init = function(){
        console.log('FlatG: Init!!!');
        return 'This is just a stub!';
    };

    return FlatG;
});<commit_msg>FlatG: Added method to hide scrollbar on mobile devices.<commit_after>/*
 * FlatG
 * https://github.com/goliatone/flatg-website
 *
 * Copyright (c) 2013 goliatone
 * Licensed under the MIT license.
 */
/*global define:true*/
/* jshint strict: false */
define('FlatG', ['jquery'], function($) {

	var Template = function(){};

    Template.compile = function Template(template, otag, ctag) {
            var compiled = function(context){

                function replaceFn() {
                    var prop = arguments[1];
                    return (prop in context) ? context[prop] : '';
                }
                otag = otag || "{{";
                ctag = ctag || "}}";
                
                return template.replace(new RegExp(otag+"(\\w+)"+ctag,"g"), replaceFn);
            };
            return compiled;
    };


	var GithubRelease = function(config){
		$.extend(this, GithubRelease.settings, (config || {}));
	};

	GithubRelease.settings = {
		selector:'.github-release',
		endpoint:'tags',
		url:'https://api.github.com/repos/{{user}}/{{repo}}/{{endpoint}}',
		template:'<a href="{{zipball_url}}" class="button-flat radius download">Download FlatG {{name}}</a>'
	};

	GithubRelease.prototype.init = function(){
		this.urlBuilder = Template.compile(this.url);
		var options = {
			url: this.urlBuilder(this)
		};

		this.$view = $(this.selector);

		$.ajax(options)
		.done(this.onSuccess.bind(this))
		.fail(this.onError.bind(this));
	};

	GithubRelease.prototype.onSuccess = function(result){
		var template = Template.compile(this.template);
		var html = template(result[0]);
		console.log('SUCCESS: ', result, html);
		this.$view.html(html);
	};

	GithubRelease.prototype.onError = function(error){
		console.log('ERROR: ', error);
	};



	var github = new GithubRelease({user:'goliatone', repo:'flatg-core', endpoint:'tags'});
	github.init();



    var FlatG = function(config){
        console.log('FlatG: Constructor!');
    };

    FlatG.prototype.init = function(){
        console.log('FlatG: Init!!!');
        this.hideScrollbarIPhone();
    };

    FlatG.prototype.hideScrollbarIPhone = function(){
    	/mobi/i.test(navigator.userAgent) && !window.location.hash && setTimeout(function () {
		  window.scrollTo(0, 1);
		}, 500);
    };

    return FlatG;
});
{'fraction_non_alphanumeric': 0.17544663307375172, 'fraction_numerical': 0.0038937242327072834, 'mean_word_length': 2.878330373001776, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4457843', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1327, 'n_words': 253}