{"size": 2200, "ext": "js", "max_stars_repo_path": "src/MarkPad/Themes/FunnelWeb/site.js", "max_stars_repo_name": "asine/DownmarkerWPF", "max_stars_repo_stars_event_min_datetime": "2015-01-01T17:40:09.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T08:19:09.000Z", "max_issues_repo_path": "src/MarkPad/Themes/FunnelWeb/site.js", "max_issues_repo_name": "asine/DownmarkerWPF", "max_issues_repo_issues_event_min_datetime": "2015-01-09T03:54:18.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T01:21:04.000Z", "max_forks_repo_path": "src/MarkPad/Themes/FunnelWeb/site.js", "max_forks_repo_name": "asine/DownmarkerWPF", "max_forks_repo_forks_event_min_datetime": "2015-01-04T01:28:01.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-26T11:36:47.000Z"}
{"max_stars_count": 817, "max_issues_count": 52, "max_forks_count": 342, "avg_line_length": 25.5813953488, "max_line_length": 86, "alphanum_fraction": 0.4863636364}
$(function () {
    function enablePrettyPrinting() {
        $("pre").each(
        function () {
            $(this).attr("class", "prettyprint");
        });
        prettyPrint();
    }

    function enablePrettyDates() {
        $("span.date").each(function () {
            var utc = $(this).html();
            var utcDate = new Date(Date.parse(utc));

            var utcDateValue = utcDate.getTime();
            var localTimeOffset = utcDate.getTimezoneOffset() * 60000;

            var localDate = new Date(utcDateValue - (localTimeOffset));
            $(this).attr("title", Date.Format(localDate, "dd MMM, yyyy hh:nn"));

            var pretty = prettyDate(localDate);
            if (pretty == undefined) {
                var local = Date.Format(localDate, "dd MMM, yyyy");
                localTimeOffset / 360000;
                $(this).html(local);
            } else {
                $(this).html(pretty);
            }

        });
    }

    var changes = 0;
    function enableChangeDetection() {
        $("input[type=text]:not(#q)").click(function () {
            changes++;
        });

        $("textarea").click(function () {
            changes++;
        });

        $("input[type=submit]").click(function () {
            changes = 0;
        });

        window.onbeforeunload = function () {
            if (changes > 0) {
                return "Navigating away will lose the unsaved changes you have made.";
            }
        };
    }

    $.expr[':'].external = function (obj) {
        return !(obj.href == "")
            && !obj.href.match(/^mailto\:/)
            && !(obj.hostname == location.hostname);
    };

    function enableNewWindowLinks() {
        $(".content a:external")
        .not(".comment-author a")
        .addClass("new-window");

        $('a.new-window').click(function () {
            window.open(this.href);
            return false;
        });
    }

    function hideFlashes() {
        $(".flash").delay(3000).fadeOut('slow');
    }


    enablePrettyPrinting();
    enablePrettyDates();
    enableNewWindowLinks();

    enableChangeDetection();

    if ($("#wmd-input").size() > 0) {
        initializeWmd();
    }
});
