<commit_before>/**
 * @class SearchingList
 */
function SearchingList(iZhihu) {
    if ( typeof iZhihu === 'undefined' || !iZhihu) {
        return null
    }
    iZhihu.SearchingList = this
    
    this.$topSearch = $('#zh-top-search')
    this.$topSearchInput = $('#zh-top-search-form > input#q')
    if (!this.$topSearch.length) return

    this.SearchEngineOutsideList = {
        'google': {icon:'https://www.google.com/favicon.ico',url:'https://www.google.com/?q=site:zhihu.com%20{0}#q=site:zhihu.com+{0}'}
      , 'baidu': {icon:'http://www.baidu.com/favicon.ico',url:'http://www.baidu.com/s?wd={0}'}
    }

    utils.observeDOMNodeAdded(this.$topSearch[0],function(event){
        var _a = event.addedNodes || []
        if (!_a.length) return
        utils.observeDOMNodeAdded(_a[0],function(event){console.log(iZhihu.config['SearchEngineOutside'])
            var _a = event.addedNodes || [null]
              , $item = $(_a[0])
              , seoKey = iZhihu.config['SearchEngineOutside'] || 'baidu'
              , seo = iZhihu.SearchingList.SearchEngineOutsideList[seoKey] || {icon:'',url:''}
              , strSearchUrl = seo.url.replace(/\{0\}/g, function(){return iZhihu.SearchingList.$topSearchInput.val()})
            console.log(seoKey)
            if ($item.is('.ac-row[role=option]')){
                var $a = $item.children('a')
                  , href = $a.attr('href')
                  , css = 'float:right;'
                  , $aNew = $('<a>', {class:'zg-icon zg-icon-sidenav-debuts',style:css,href:href,target:'_blank',click:function(event){
                        event.stopPropagation()
                    }})
                if (href.indexOf('/search?') === 0) {
                    $aNew.css({marginTop:'0.5em'})
                    $item.append($('<a>', {class:'icon',style:'margin-top:0.5em;float:left',href:strSearchUrl,target:'_blank',click:function(event){
                        event.stopPropagation()<commit_msg>Fixed SearchEngineOutsideList<commit_after>/**
 * @class SearchingList
 */
function SearchingList(iZhihu) {
    if ( typeof iZhihu === 'undefined' || !iZhihu) {
        return null
    }
    iZhihu.SearchingList = this
    
    this.$topSearch = $('#zh-top-search')
    this.$topSearchInput = $('#zh-top-search-form > input#q')
    if (!this.$topSearch.length) return

    this.SearchEngineOutsideList = {
        'google': {icon:'https://www.google.com/favicon.ico',url:'https://www.google.com/?q=site:zhihu.com%20{0}#q=site:zhihu.com+{0}'}
      , 'baidu': {icon:'http://www.baidu.com/favicon.ico',url:'http://www.baidu.com/s?wd=site:zhihu.com%20{0}'}
    }

    utils.observeDOMNodeAdded(this.$topSearch[0],function(event){
        var _a = event.addedNodes || []
        if (!_a.length) return
        utils.observeDOMNodeAdded(_a[0],function(event){console.log(iZhihu.config['SearchEngineOutside'])
            var _a = event.addedNodes || [null]
              , $item = $(_a[0])
              , seoKey = iZhihu.config['SearchEngineOutside'] || 'baidu'
              , seo = iZhihu.SearchingList.SearchEngineOutsideList[seoKey] || {icon:'',url:''}
              , strSearchUrl = seo.url.replace(/\{0\}/g, function(){return iZhihu.SearchingList.$topSearchInput.val()})
            console.log(seoKey)
            if ($item.is('.ac-row[role=option]')){
                var $a = $item.children('a')
                  , href = $a.attr('href')
                  , css = 'float:right;'
                  , $aNew = $('<a>', {class:'zg-icon zg-icon-sidenav-debuts',style:css,href:href,target:'_blank',click:function(event){
                        event.stopPropagation()
                    }})
                if (href.indexOf('/search?') === 0) {
                    $aNew.css({marginTop:'0.5em'})
                    $item.append($('<a>', {class:'icon',style:'margin-top:0.5em;float:left',href:strSearchUrl,target:'_blank',click:function(event){
                        event.stopPropagation()
{'fraction_non_alphanumeric': 0.1868520859671302, 'fraction_numerical': 0.007585335018963337, 'mean_word_length': 2.4854625550660794, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 8, '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': '5297557', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1316, 'n_words': 146}