<commit_before>/*!
 * Chiaki JavaScript Library
 * Copyright (c) 2016 <NAME>(i#wind.moe)
 * MIT Licensed
 * @Version Alpha 0.1
 * @Date 09/18/2016 14:49:39 UTC+8
 */

~ function (window, docunment, debug, i) {

    var _exist = function (value, _default) {
		return value ? value : _default ? _default : false;
	};

    /* Selector */

    i = function (ele) {
        return docunment.querySelector(ele);
    }

    i.getJSON = function (obj) {

        if (window.fetch) {
            tmp = '?';
            for (i in obj.data) {
                tmp += i.toString() + '=' + obj.data[i].toString() + '&';
            }
            if (tmp.charAt(tmp.length - 1) == '&' || tmp.charAt(tmp.length - 1) == '?')
                tmp = tmp.substring(0, tmp.length - 1);
            var url = obj.url + tmp;

            var getData = {
                method: 'GET',
                mode: 'cors',
                headers: {
                    "Content-Type": "application/x-www-form-urlencoded"
                }
            }

            fetch(url, getData).then(function (res) {

                if (res.ok) {
                    return res.json().then(function (json) {
                        obj.success(json);
                    });
                } else {
                    console.log("Looks like the response wasn't perfect, got status", res.status);
                }
            }).catch(function (e) {
                console.log("Fetch failed!", e);
            });
        } else {
            
            //传统xhr
        }

    }

    i.img = {
        lazyload: function (high) {

			function getTop(ele) {
				var top = ele.offsetTop;
				while (ele = ele.offsetParent) {
					top += ele.offsetTop;
				}
				return top;
			}

			var imgs = document.body.querySelectorAll('.lazyload'),
				H = window.innerHeight,
				high = _exist(high, 500);

			function lazyload() {
				var S = i('.container').scrollTop;
						[].forEach.call(imgs, function (img) {
					if (!img.getAttribute('data-src')) {
						return;
					}
					if (H + S + high > getTop(img)) {
						img.src = img.getAttribute("data-src");
						img.removeAttribute("data-src");
					}
				});
			}
			i('.container').addEventListener("scroll", lazyload);
		}
    }
    if(window.location.href.indexOf('manage') >= 0) {
        i.img.lazyload();
    }
    window.Chiaki = i;
    typeof ($) === "undefined" ? $ = i: NaN;
    return i;
}(window, document, true);

Title=document.title,
document.addEventListener(
    "visibilitychange",
    function(){
        var e=[
            "╭(′▽`)╯","( ͡° ͜ʖ ͡°)", "(ÒܫÓױ)", "ヽ( ^∀^)ﾉ",
            "(╯°□°)╯︵","(´・ω・`)","(`皿´)",
            "(¬_¬)","(￣▽￣)\"","(〒︿〒)"];
        document.hidden?
            (document.title=e[parseInt(10*Math.random(),10)]+" "+document.title,clearTimeout(2e3)):
            document.title=Title;<commit_msg>Add picture lazyload and add Music module<commit_after>/*!
 * Chiaki JavaScript Library
 * Copyright (c) 2016 <NAME>(i#wind.moe)
 * MIT Licensed
 * @Version Alpha 0.1
 * @Date 09/18/2016 14:49:39 UTC+8
 */

~ function (window, docunment, debug, i) {

    var _exist = function (value, _default) {
		return value ? value : _default ? _default : false;
	};

    /* Selector */

    i = function (ele) {
        return docunment.querySelector(ele);
    }

    i.getJSON = function (obj) {

        if (window.fetch) {
            tmp = '?';
            for (i in obj.data) {
                tmp += i.toString() + '=' + obj.data[i].toString() + '&';
            }
            if (tmp.charAt(tmp.length - 1) == '&' || tmp.charAt(tmp.length - 1) == '?')
                tmp = tmp.substring(0, tmp.length - 1);
            var url = obj.url + tmp;

            var getData = {
                method: 'GET',
                mode: 'cors',
                headers: {
                    "Content-Type": "application/x-www-form-urlencoded"
                }
            }

            fetch(url, getData).then(function (res) {

                if (res.ok) {
                    return res.json().then(function (json) {
                        obj.success(json);
                    });
                } else {
                    console.log("Looks like the response wasn't perfect, got status", res.status);
                }
            }).catch(function (e) {
                console.log("Fetch failed!", e);
            });
        } else {
            
            //传统xhr
        }

    }

    i.img = {
        lazyload: function (high) {

			function getTop(ele) {
				var top = ele.offsetTop;
				while (ele = ele.offsetParent) {
					top += ele.offsetTop;
				}
				return top;
			}

			var imgs = document.body.querySelectorAll('.lazyload'),
				H = window.innerHeight,
				high = _exist(high, 500);

			function lazyload() {
				var S = i('.container').scrollTop;
						[].forEach.call(imgs, function (img) {
					if (!img.getAttribute('data-src')) {
						return;
					}
					if (H + S + high > getTop(img)) {
						img.src = img.getAttribute("data-src");
						img.removeAttribute("data-src");
					}
				});
			}
			i('.container').addEventListener("scroll", lazyload);
		}
    }
    if(window.location.href.indexOf('manage') == -1) {
        i.img.lazyload();
    }
    window.Chiaki = i;
    typeof ($) === "undefined" ? $ = i: NaN;
    return i;
}(window, document, true);

Title=document.title,
document.addEventListener(
    "visibilitychange",
    function(){
        var e=[
            "╭(′▽`)╯","( ͡° ͜ʖ ͡°)", "(ÒܫÓױ)", "ヽ( ^∀^)ﾉ",
            "(╯°□°)╯︵","(´・ω・`)","(`皿´)",
            "(¬_¬)","(￣▽￣)\"","(〒︿〒)"];
        document.hidden?
            (document.title=e[parseInt(10*Math.random(),10)]+" "+document.title,clearTimeout(2e3)):
            document.title=Title;
{'fraction_non_alphanumeric': 0.1773716275021758, 'fraction_numerical': 0.012184508268059183, 'mean_word_length': 1.675046554934823, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7189807', 'n_tokens_mistral': 2140, 'n_tokens_neox': 1887, 'n_words': 365}