<commit_before>//——————————————————————————————————新窗口浏览主题——————————————————————————————————


var nwe_window;
chrome.runtime.sendMessage({action: "get_newWindow_status"}, function(response) {
    if ( response.newWindow_status ){
        $(".item_title a").attr("target", "_blank");
        $(".item_hot_topic_title a").attr("target", "_blank");
        nwe_window = "target='_blank'";
    }
});

//——————————————————————————————————新窗口浏览主题——————————————————————————————————


//——————————————————————————————————预览功能——————————————————————————————————

chrome.runtime.sendMessage({action: "get_preview_status"}, function(response) {
    if (!response.preview_status)
        return;

    $("div#Main > div:nth-of-type(2) .cell").each(function(){
        if($(this).find(".fade").text().indexOf("...")!=-1){
            return ;
        }
        $(this).find(".fade").append(" &nbsp;•&nbsp; <span class='preview'>预览</span>");
    });

    var btn_id = 0;
    $(".preview").click(function(){
        var _this = $(this);
        var _cell = _this.parents(".cell");
        if (_this.text() == "预览"){
            _this.text("加载中...");
            _cell.after("<div class='previewWindow'></div>");
            var _href = _cell.find(".item_title a").attr("href");
            _href = location.origin + _href;
            $.get(_href, function(data){
                var _previewWindow = _cell.next(".previewWindow");
                data = data.substr(data.indexOf("header")+8);
                //当匹配不到topic_conten时返回-1 substring 按0处理，既显示整个标题头部
                data = data.substring(data.indexOf("<div class=\"topic_content\">"), data.indexOf("<div class=\"topic_buttons\">"));
                data = data.replace("hljs.initHighlightingOnLoad();", "");
                _this.addClass("btn_id"+btn_id);
                _previewWindow.html(data+"<p class='previewWindowEnd'>\
                                                <a class='item_node' href='"+ _href +"' "+ nwe_window +">详细</a>\
                                                <span class='item_node' onclick='\
                                                    $(\".btn_id"+ btn_id +"\").click();$(\"html, body\").animate({scrollTop: ($(\".btn_id"+ btn_id++ +"\").offset().top-200)}, 600);'>收起\
                                                </span>\
                                              </p>");
                var _next_cell = _previewWindow.next();
                _next_cell.css("borderTop", _next_cell.css("borderBottom"));
                _this.text("收起");
                _previewWindow.slideDown(800);

            });
        }else{
            _this.text("预览");
            var _previewWindow = _cell.next(".previewWindow");
            setTimeout(function(){
                _previewWindow.next().css("borderTop", "none");
                _previewWindow.remove();
            },800);
            _previewWindow.slideUp(800);
        }
    });

});

//——————————————————————————————————预览功能——————————————————————————————————


//——————————————————————————————————一键领取登陆奖励——————————————————————————————————
var _mission_btn = $('div#Rightbar > div:nth-of-type(4) a');
if ( _mission_btn.text() == '领取今日的登录奖励' ){
    _mission_btn.html('一键领取今日的登录奖励 by vPlus<br/>Take your passion and make it come true. ')
}

    //Enable Gift ClickOnce Feature
    //From v2excellent.js
    $('a[href="/mission/daily"]')
    .attr('id', 'gift_v2excellent')
    .attr('href', '#')
    .click(function() {
        $('#gift_v2excellent').text('正在领取......');
        giftLink = ("/mission/daily/redeem" + RegExp("/signout(\\?once=[0-9]+)").exec($('div#Top').html())[1]);
        $.get(giftLink, function(checkResult) {
            var okSign = $('<output>')
            .append($.parseHTML(checkResult))
            .find('li.fa.fa-ok-sign');
            if (okSign.length > 0) {
            $.get('/balance', function(result) {
                var amount = $('<output>')
                .append($.parseHTML(result))
                .find('table>tbody>tr:contains("每日登录"):first>td:nth(2)')
                .text();
                $('#gift_v2excellent').html(
                '已领取 <strong>' + amount + '</strong> 铜币。'
                );
                setTimeout(function() {
                $('#Rightbar>.sep20:nth(1)').remove();
                $('#Rightbar>.box:nth(1)').remove();
                }, 2000);
            });
            }
        });
        return false;
    });<commit_msg>Compatible with Firefox<commit_after>//——————————————————————————————————新窗口浏览主题——————————————————————————————————


var nwe_window;
chrome.runtime.sendMessage({action: "get_newWindow_status"}, function(response) {
    if ( response.newWindow_status ){
        $(".item_title a").attr("target", "_blank");
        $(".item_hot_topic_title a").attr("target", "_blank");
        nwe_window = "target='_blank'";
    }
});

//——————————————————————————————————新窗口浏览主题——————————————————————————————————


//——————————————————————————————————预览功能——————————————————————————————————

chrome.runtime.sendMessage({action: "get_preview_status"}, function(response) {
    if (!response.preview_status)
        return;

    $("div#Main > div:nth-of-type(2) .cell").each(function(){
        if($(this).find(".fade").text().indexOf("...")!=-1){
            return ;
        }
        $(this).find(".fade").append(" &nbsp;•&nbsp; <span class='preview'>预览</span>");
    });

    var btn_id = 0;
    $(".preview").click(function(){
        var _this = $(this);
        var _cell = _this.parents(".cell");
        if (_this.text() == "预览"){
            _this.text("加载中...");
            _cell.after("<div class='previewWindow'></div>");
            var _href = _cell.find(".item_title a").attr("href");
            _href = location.origin + _href;
            $.get(_href, function(data){
                var _previewWindow = _cell.next(".previewWindow");
                data = data.substr(data.indexOf("header")+8);
                //当匹配不到topic_conten时返回-1 substring 按0处理，既显示整个标题头部
                data = data.substring(data.indexOf("<div class=\"topic_content\">"), data.indexOf("<div class=\"topic_buttons\">"));
                data = data.replace("hljs.initHighlightingOnLoad();", "");
                _this.addClass("btn_id"+btn_id);
                _previewWindow.html(data+"<p class='previewWindowEnd'>\
                                                <a class='item_node' href='"+ _href +"' "+ nwe_window +">详细</a>\
                                                <span class='item_node' onclick='\
                                                    $(\".btn_id"+ btn_id +"\").click();$(\"html, body\").animate({scrollTop: ($(\".btn_id"+ btn_id++ +"\").offset().top-200)}, 600);'>收起\
                                                </span>\
                                              </p>");
                var _next_cell = _previewWindow.next();
                _next_cell.css("borderTop", _next_cell.css("borderBottom"));
                _this.text("收起");
                _previewWindow.slideDown(800);

            });
        }else{
            _this.text("预览");
            var _previewWindow = _cell.next(".previewWindow");
            setTimeout(function(){
                _previewWindow.next().css("borderTop", "none");
                _previewWindow.remove();
            },800);
            _previewWindow.slideUp(800);
        }
    });

});

//——————————————————————————————————预览功能——————————————————————————————————


//——————————————————————————————————一键领取登陆奖励——————————————————————————————————
var _mission_btn = $('div#Rightbar > div:nth-of-type(4) a');
if ( _mission_btn.text() == '领取今日的登录奖励' ){
    _mission_btn.html('一键领取今日的登录奖励 by vPlus<br/>Take your passion and make it come true. ')
}

    //Enable Gift ClickOnce Feature
    //From v2excellent.js
    $('a[href="/mission/daily"]')
    .attr('id', 'gift_v2excellent')
    .attr('href', '#')
    .click(function() {
        $('#gift_v2excellent').text('正在领取......');
        giftLink = ("https://www.v2ex.com/mission/daily/redeem" + RegExp("/signout(\\?once=[0-9]+)").exec($('div#Top').html())[1]);
        $.get(giftLink, function(checkResult) {
            var okSign = $('<output>')
            .append($.parseHTML(checkResult))
            .find('li.fa.fa-ok-sign');
            if (okSign.length > 0) {
            $.get('/balance', function(result) {
                var amount = $('<output>')
                .append($.parseHTML(result))
                .find('table>tbody>tr:contains("每日登录"):first>td:nth(2)')
                .text();
                $('#gift_v2excellent').html(
                '已领取 <strong>' + amount + '</strong> 铜币。'
                );
                setTimeout(function() {
                $('#Rightbar>.sep20:nth(1)').remove();
                $('#Rightbar>.box:nth(1)').remove();
                }, 2000);
            });
            }
        });
        return false;
    });
{'fraction_non_alphanumeric': 0.2536962365591398, 'fraction_numerical': 0.008848566308243728, 'mean_word_length': 2.054738282586384, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 53, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5027818', 'n_tokens_mistral': 2806, 'n_tokens_neox': 2728, 'n_words': 358}