// ==UserScript==
// @name 知乎 显示匿名按钮、查看问题日志按钮、快捷键帮助按钮、知乎跳转改为直链
// @namespace http://tampermonkey.net/
// @version 0.8.6.5
// @description 显示匿名按钮、查看问题日志按钮、快捷键帮助按钮、知乎跳转改为直链
// @author AN drew
// @match https://www.zhihu.com/*
// @match https://zhuanlan.zhihu.com/*
// @require https://code.jquery.com/jquery-3.1.1.min.js
// @grant none
// ==/UserScript==
var $hint =$('<div>'+
' <div>'+
' <div>'+
' <div class="Modal-wrapper Modal-enter-done">'+
' <div class="Modal-backdrop"></div>'+
' <div class="Modal Modal--default ShortcutHintModal" tabindex="0">'+
' <div class="Modal-inner">'+
' <h3 class="Modal-title">快捷键帮助</h3>'+
' <div class="Modal-content">'+
' <div class="ShortcutHintModal-content">'+
' <div class="ShortcutHintModal-hintListContainer">'+
' <div class="ShortcutHintModal-hintList">'+
' <div class="ShortcutHintModal-hintTitle">'+
' 操作'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">V</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :赞同'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">D</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :反对'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">L</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :喜欢'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">C</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :展开 / 收起评论'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">Shift</kbd>'+
' <div class="KeyHint-separator">'+
' +'+
' </div>'+
' </div>'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">C</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :聚焦到评论框'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">O</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :展开 / 收起全文'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">S</kbd>'+
' <div class="KeyHint-separator KeyHint-separator--space"> '+
' </div>'+
' </div>'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">C</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :收藏'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">F</kbd>'+
' <div class="KeyHint-separator KeyHint-separator--space"> '+
' </div>'+
' </div>'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">X</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :分享'+
' </div>'+
' </div>'+
' </div>'+
' <div class="ShortcutHintModal-hintList">'+
' <div class="ShortcutHintModal-hintTitle">'+
' 导航'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">J</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :下一项'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">K</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :上一项'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">G</kbd>'+
' <div class="KeyHint-separator KeyHint-separator--space"> '+
' </div>'+
' </div>'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">G</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :第一项'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">Shift</kbd>'+
' <div class="KeyHint-separator">'+
' +'+
' </div>'+
' </div>'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">G</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :最后一项'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">Shift</kbd>'+
' <div class="KeyHint-separator">'+
' +'+
' </div>'+
' </div>'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">U</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :向上滚动半屏'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">Shift</kbd>'+
' <div class="KeyHint-separator">'+
' +'+
' </div>'+
' </div>'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">D</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :向下滚动半屏'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">/</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :搜索'+
' </div>'+
' </div>'+
' <div class="KeyHint">'+
' <div class="KeyHint-keyContainer">'+
' <div class="KeyHint-key">'+
' <kbd class="KeyHint-kbd">?</kbd>'+
' </div>'+
' </div>'+
' <div>'+
' :快捷键帮助'+
' </div>'+
' </div>'+
' </div>'+
' </div>'+
' </div>'+
' </div>'+
' </div>'+
' <button aria-label="关闭" type="button" class="Button Modal-closeButton Button--plain">'+
' <svg class="Zi Zi--Close Modal-closeIcon" fill="currentColor" viewbox="0 0 24 24" width="24" height="24">'+
' <path d="M13.486 12l5.208-5.207a1.048 1.048 0 0 0-.006-1.483 1.046 1.046 0 0 0-1.482-.005L12 10.514 6.793 5.305a1.048 1.048 0 0 0-1.483.005 1.046 1.046 0 0 0-.005 1.483L10.514 12l-5.208 5.207a1.048 1.048 0 0 0 .006 1.483 1.046 1.046 0 0 0 1.482.005L12 13.486l5.207 5.208a1.048 1.048 0 0 0 1.483-.006 1.046 1.046 0 0 0 .005-1.482L13.486 12z" fill-rule="evenodd"></path>'+
' </svg></button>'+
' </div>'+
' </div>'+
' </div>'+
' </div>'+
'</div>')
function addReport($QuestionHeaderActions,$more)
{
var r ='<button type="button" class="Button Button--plain Button--withIcon Button--withLabel"><span style="display: inline-flex; align-items: center; vertical-align:middle;"><svg class="Title Zi--Report " fill="currentColor" viewBox="0 0 24 24" width="14" height="14"><path d="M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z" fill-rule="evenodd"></path></svg></span> 举报</button>'
var $report = $(r)
$report.bind("click",function(){
$more.find("button").click();
$(".Menu.QuestionHeader-menu").children().eq(2).click();
})
$more.after($report)
}
function addAnonymous($QuestionHeaderActions,$more)
{
var a ='<button type="button" class="Button Button--plain Button--withIcon Button--withLabel">'+
'<span style="display: inline-flex; align-items: center; vertical-align:middle;">'+
'<svg class="Zi Zi--Anonymous Button-zi" fill="currentColor" viewBox="0 0 1024 1024" width="1.2em" height="1.2em">'+
'<path d="M831.994 442.66v436.364c0 24.906 7.312 45.124 42.654 45.124 35.344 0 42.656-20.218 42.656-45.124V442.66h-85.31z"></path>'+
'<path d="M895.992 582.814c0 11.78 9.532 21.342 21.312 21.342v-42.654a21.3 21.3 0 0 0-21.312 21.312zM895.992 668.156c0 11.78 9.532 21.342 21.312 21.342v-42.686c-11.78 0-21.312 9.564-21.312 21.344zM895.992 753.496a21.3 21.3 0 0 0 21.312 21.312v-42.656c-11.78 0-21.312 9.562-21.312 21.344zM895.992 838.806c0 11.812 9.532 21.344 21.312 21.344v-42.654c-11.78 0-21.312 9.562-21.312 21.31zM853.306 582.814c0 11.78-9.532 21.342-21.312 21.342v-42.654a21.3 21.3 0 0 1 21.312 21.312zM853.306 668.156c0 11.78-9.532 21.342-21.312 21.342v-42.686c11.782 0 21.312 9.564 21.312 21.344zM853.306 753.496a21.3 21.3 0 0 1-21.312 21.312v-42.656c11.782 0 21.312 9.562 21.312 21.344zM853.306 838.806c0 11.812-9.532 21.344-21.312 21.344v-42.654c11.782 0 21.312 9.562 21.312 21.31z"></path><path d="M831.994 590.688c26.25-14.124 56.592-34.404 85.31-62.402V442.66h-85.31v148.028z"></path>'+
'<path d="M1021.52 168.916c-15.532-160.26-413.238 8.594-509.516 8.594S17.986 8.656 2.486 168.916c-29.436 303.68 212.838 396.178 254.65 405.772 147.84 33.904 201.15-48.044 254.868-48.044 53.686 0 107.028 81.95 254.836 48.044 41.812-9.592 284.086-102.092 254.68-405.772zM392.85 399.318c-23.624 8.328-52.154 12.906-80.342 12.906-24.78 0-47.904-3.594-66.904-10.39-18.75-6.718-32.812-16.204-41.842-28.202-14.75-19.67-16.906-48.578-6.436-85.95 2.5-1.156 9.342-3.532 23.592-3.532 36.062 0 88.216 15.03 132.84 38.28 44.75 23.312 66.342 46.624 71.81 59.25-3.97 3.904-13.844 10.982-32.718 17.638z m427.364-25.688c-9 12-23.094 21.484-41.844 28.202-18.968 6.796-42.124 10.39-66.874 10.39-28.218 0-56.748-4.578-80.342-12.906-18.906-6.656-28.75-13.734-32.75-17.64 5.468-12.624 27.062-35.936 71.812-59.25 44.622-23.25 96.778-38.28 132.872-38.28 14.25 0 21.06 2.376 23.56 3.532 10.502 37.376 8.314 66.282-6.434 85.952z" ></path>'+
'<path d="M867.71 276.15a42.61 42.61 0 0 0-22.998-27.124c-10.718-5-24.716-7.546-41.624-7.546-43.094 0-101.56 16.516-152.59 43.11-46.406 24.186-79.688 53.404-91.248 80.154a42.642 42.642 0 0 0 9.342 47.466c7.532 7.344 22.032 18.062 48.376 27.342 28.032 9.89 61.592 15.344 94.53 15.344 29.592 0 57.716-4.468 81.28-12.89 26.75-9.578 47.436-23.968 61.56-42.764 12.31-16.406 19.404-36.186 21.124-58.764 1.436-19.284-1.158-40.938-7.752-64.328z m-47.496 97.48c-9 12-23.094 21.484-41.844 28.202-18.968 6.796-42.124 10.39-66.874 10.39-28.218 0-56.748-4.578-80.342-12.906-18.906-6.656-28.75-13.734-32.75-17.64 5.468-12.624 27.062-35.936 71.812-59.25 44.622-23.25 96.778-38.28 132.872-38.28 14.25 0 21.06 2.376 23.56 3.532 10.502 37.376 8.314 66.282-6.434 85.952zM464.722 364.742c-11.562-26.75-44.81-55.968-91.248-80.154-51.03-26.594-109.498-43.11-152.558-43.11-16.906 0-30.906 2.532-41.624 7.532a42.69 42.69 0 0 0-23.03 27.14c-6.562 23.39-9.156 45.044-7.718 64.326 1.688 22.578 8.782 42.358 21.092 58.764 14.124 18.796 34.842 33.188 61.592 42.764 23.562 8.422 51.654 12.89 81.278 12.89 32.906 0 66.468-5.454 94.53-15.344 26.312-9.28 40.812-20 48.342-27.342a42.638 42.638 0 0 0 9.344-47.466z m-71.872 34.576c-23.624 8.328-52.154 12.906-80.342 12.906-24.78 0-47.904-3.594-66.904-10.39-18.75-6.718-32.812-16.204-41.842-28.202-14.75-19.67-16.906-48.578-6.436-85.95 2.5-1.156 9.342-3.532 23.592-3.532 36.062 0 88.216 15.03 132.84 38.28 44.75 23.312 66.342 46.624 71.81 59.25-3.97 3.904-13.844 10.982-32.718 17.638z"></path>'+
'</svg></span> 匿名</button>'
var $anonymous = $(a)
$anonymous.bind("click",function(){
$more.find("button").click();
$(".Menu.QuestionHeader-menu").children().eq(0).click();
})
$QuestionHeaderActions.append($anonymous)
}
function addLog($QuestionHeaderActions)
{
var url = window.location.href;
var end,href;
if(url.indexOf("answer")>-1)
{
end=url.indexOf("answer")
href = url.substring(0,end);
}
else
{
href=url+"/"
}
var L='<button type="button" class="Button Button--plain Button--withIcon Button--withLabel"><a href="'+href+'log" target="_self"><span style="display: inline-flex; align-items: center; vertical-align:middle;"><svg class="Zi Zi--Log Button-zi" fill="currentColor" viewBox="0 0 1024 1024" width="1.2em" height="1.2em"><path d="M733.129568 1.700997H1.700997v1020.598006h1020.598006v-765.448505z m204.119601 935.548172h-850.498338v-850.498338h614.910299l235.588039 206.671096z"></path><path d="M170.099668 171.800664h279.813953v85.049834H170.099668zM170.099668 372.518272h683.800664v85.049834H170.099668zM170.099668 567.282392h683.800664v85.049834H170.099668zM170.099668 762.046512h683.800664v85.049834H170.099668z"></path></svg></span>问题日志</a></button>'
var $log = $(L);
$QuestionHeaderActions.append($log)
}
function addShortCut($QuestionHeaderActions)
{
var s ='<button type="button" class="Button Button--plain Button--withIcon Button--withLabel"><span style="display: inline-flex; align-items: center; vertical-align:middle;"><svg class="Zi Zi--ShortCut Button-zi" fill="currentColor" viewBox="0 0 1024 1024" width="1.5em" height="1.2em"><path d="M1088 128H64C28.8 128 0 156.8 0 192v640c0 35.2 28.8 64 64 64h1024c35.2 0 64-28.8 64-64V192c0-35.2-28.8-64-64-64zM640 256h128v128h-128V256z m192 192v128h-128v-128h128zM448 256h128v128h-128V256z m192 192v128h-128v-128h128zM256 256h128v128H256V256z m192 192v128h-128v-128h128zM128 256h64v128H128V256z m0 192h128v128H128v-128z m64 320H128v-128h64v128z m576 0H256v-128h512v128z m256 0h-192v-128h192v128z m0-192h-128v-128h128v128z m0-192h-192V256h192v128z"></path></svg></span> 快捷键</button>'
var $shortcut = $(s)
$shortcut.css({"margin-left":"10px"})
$shortcut.click(function(){
$(".Modal-wrapper").show()
});
$QuestionHeaderActions.append($shortcut)
}
function addReport1($more)
{
$more.hide()
var r = '<button type="button" class="Button ContentItem-action Button--plain Button--withIcon Button--withLabel"><span style="display: inline-flex; align-items: center;"><svg class="Zi Zi--Report" fill="currentColor" viewBox="0 0 24 24" width="14" height="14"><path d="M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z" fill-rule="evenodd"></path></svg></span> 举报</button>'
var $report = $(r)
$report.bind("click",function(){
$more.find("button").click();
$(".Menu.AnswerItem-selfMenu").find("button").click();
})
$more.after($report)
}
function question()
{
if($(".Modal-wrapper").length==0)
{
$(document.body).append($hint)
$(".Modal-wrapper").hide()
$(".Modal-closeButton").click(function(){
$(".Modal-wrapper").hide()
})
}
var $QuestionHeaderActions = $("div.QuestionHeaderActions")
var $more = $(".Zi--Dots").parent().parent().parent() //更多
var $report = $(".Title.Zi--Report") //举报
var $anonymous = $(".Zi--Anonymous")//匿名
var $log = $(".Zi--Log") //日志
var $shortcut = $(".Zi--ShortCut") //快捷键
$more.attr("style","display:none")
if($(".AppHeader-profileAvatar").length>0) //已登录(不可用)
{
if($report.length == 0) //未添加举报
{
addReport($QuestionHeaderActions,$more)
}
if($anonymous.length == 0) //未添加匿名
{
addAnonymous($QuestionHeaderActions,$more)
}
if($log.length == 0) //未添加查看问题日志
{
addLog($QuestionHeaderActions)
}
if($shortcut.length == 0) //未添加快捷键帮助
{
addShortCut($QuestionHeaderActions)
}
var $ContentItem_actions = $(".ContentItem-actions")
$ContentItem_actions.each(function(){
var $Content_child5 = $(this).children().eq(5-1) //喜欢
var $Content_child6 = $(this).children().eq(6-1) //更多
var $Content_child7 = $(this).children().eq(7-1) //举报
if($Content_child5.length>0 && $Content_child5.text().indexOf("喜欢")==-1)
{
return true;
}
else if($Content_child7.length==0 || $Content_child7.text().indexOf("举报")==-1 ) //未添加举报
{
addReport1($Content_child6)
}
})
}
else //未登录(不可用)
{
$log = $(".Zi--Log") //日志
$shortcut = $(".Zi--ShortCut") //快捷键
if($log.length == 0) //未添加查看问题日志
{
addLog($QuestionHeaderActions)
}
if($shortcut.length == 0) //未添加快捷键帮助
{
addShortCut($QuestionHeaderActions)
}
}
$(".CommentCollapseButton").on("click",function(){
$(this).parent().parent().parent().prev().find(".Zi--Comment").attr("fill","currentColor")
})
$(".ContentItem-time").each(function(){
if($(this).text().indexOf("发布于")==-1)
{
var data_tooltip = $(this).find("span").attr("data-tooltip");
var oldtext = $(this).find("span").text();
$(this).find("span").text(data_tooltip+"\xa0\xa0,\xa0\xa0"+oldtext);
}
})
var $QuestionButtonGroup = $(".QuestionHeader-footer-main").find(".QuestionButtonGroup")
$QuestionButtonGroup.children().eq(0).css({"margin": "0px 0px 0px 8px"})
$QuestionButtonGroup.children().eq(1).css({"margin": "0px 0px 0px 8px"})
$(".QuestionHeaderActions").children().eq(0).css({"margin": "0px 8px 0px 0px"})
$(".GoodQuestionAction-commonBtn").css("margin","0")
$(".GoodQuestionAction-commonBtn").css("margin-right","10px")
$(".Pc-card.Card").attr("style","display:none")
$(".Card.ViewAll").attr("style","background-color:#0084FF")
$(".QuestionMainAction.ViewAll-QuestionMainAction").attr("style","color:white")
}
function directLink()
{
var equal,colon,external_href,protocol,path,new_href;
$("a[class*='external']").each(function(){
if($(this).find("span").length>0)
{
new_href = $(this).text()
$(this).attr("href",decodeURIComponent(new_href))
}
else if($(this).attr("href").indexOf("https://link.zhihu.com/?target=") > -1)
{
external_href=$(this).attr("href")
equal = external_href.lastIndexOf("http")
colon = external_href.lastIndexOf("%3A")
protocol = external_href.substring(equal,colon)
path = external_href.substring(colon+5,external_href.length)
new_href = protocol+"://"+path
$(this).attr("href",decodeURIComponent(new_href))
}
})
$("a[class*='LinkCard']").each(function(){
if($(this).find("LinkCard-title").length>0 && $(this).find("LinkCard-title").indexOf("http")>-1 )
{
new_href = $(this).find("LinkCard-title").text()
$(this).attr("href",decodeURIComponent(new_href))
}
else if($(this).attr("href").indexOf("https://link.zhihu.com/?target=") > -1)
{
external_href=$(this).attr("href")
equal = external_href.lastIndexOf("http")
colon = external_href.lastIndexOf("%3A")
protocol = external_href.substring(equal,colon)
path = external_href.substring(colon+5,external_href.length)
new_href = protocol+"://"+path
$(this).attr("href",decodeURIComponent(new_href))
}
})
$(".TopstoryItem--advertCard").hide()
}
function addReport2($more)
{
$more.hide()
var r = '<button type="button" class="Button ContentItem-action Button--plain"><span style="display: inline-flex; align-items: center;"><svg class="Zi Zi--Report" fill="currentColor" viewBox="0 0 24 24" width="14" height="14"><path d="M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z" fill-rule="evenodd"></path></svg></span> 举报</button>'
var $report = $(r)
$report.bind("click",function(){
$more.find("button").click();
$(".Menu.Post-ActionMenu").find("button").click();
})
$more.after($report)
}
function zhuanlan()
{
$(".Recommendations-Main").hide()
var $ContentItem_actions = $(".ContentItem-actions")
var $child5 = $ContentItem_actions.children().eq(5-1)
var $child6 = $ContentItem_actions.children().eq(6-1)
if($child6.length == 0) //未添加举报
{
addReport2($child5)
}
}
function zvideo()
{
$(".ZVideo-sideColumn").hide()
}
function addReport3($more)
{
$more.hide()
var r ='<button class="ClubJoinOrCheckinButton" style="margin-right:20px"><img src="https://gitee.com/AN_drew/picBed/raw/master/img/exit.svg"/><span style="color:red"> 退出圈子</span></button>';
var $report = $(r)
$report.bind("click",function(){
$more.find("button").click();
$(".ClubHeaderInfoMoreButton-item").click();
})
$more.after($report)
}
function addReport4($more)
{
$more.hide()
var r = '<button type="button" class="Button PostWebActionButtons-comment Button--plain Button--withIcon Button--withLabel"><span style="display: inline-flex; align-items: center;"><svg class="Zi Zi--Report" fill="currentColor" viewBox="0 0 24 24" width="14" height="14"><path d="M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z" fill-rule="evenodd"></path></svg></span> 举报</button>'
var $report = $(r)
$report.bind("click",function(){
$more.find("button").click();
$(".PostWebActionButtons-item").click();
})
$more.after($report)
}
function club()
{
var $ClubHeaderInfo_buttonGroup = $(".ClubHeaderInfo-buttonGroup")
var $child1 = $ClubHeaderInfo_buttonGroup.children().eq(1-1)
var $child2 = $ClubHeaderInfo_buttonGroup.children().eq(2-1)
if($child2.length > 0 && $child2.text().indexOf("签到") > -1 && $child2.text().indexOf("加入") == -1) //退出圈子
{
addReport3($child1)
}
$(".PostReaction").each(function(){
var post_child5 = $(this).children().eq(5-1)
var post_child6 = $(this).children().eq(6-1)
if(post_child6.length==0 || post_child6.text().indexOf("举报")==-1 ) //未添加举报
{
addReport4(post_child5)
}
})
}
function addReport5($more)
{
$more.hide()
var r = '<button type="button" class="Button ContentItem-action Button--plain"><span style="display: inline-flex; align-items: center;"><svg class="Zi Zi--Report" fill="currentColor" viewBox="0 0 24 24" width="14" height="14"><path d="M19.947 3.129c-.633.136-3.927.639-5.697.385-3.133-.45-4.776-2.54-9.949-.888-.997.413-1.277 1.038-1.277 2.019L3 20.808c0 .3.101.54.304.718a.97.97 0 0 0 .73.304c.275 0 .519-.102.73-.304.202-.179.304-.418.304-.718v-6.58c4.533-1.235 8.047.668 8.562.864 2.343.893 5.542.008 6.774-.657.397-.178.596-.474.596-.887V3.964c0-.599-.42-.972-1.053-.835z" fill-rule="evenodd"></path></svg></span> 举报</button>'
var $report = $(r)
$report.bind("click",function(){
$more.find("button").click();
$(".AnswerItem-selfMenu").children().eq(1).click();
})
$more.after($report)
}
function search()
{
$(".ContentItem-actions").each(function(){
var $child6 = $(this).children().eq(6-1)
var $child7 = $(this).children().eq(7-1)
if($child7.text().indexOf("收起") > -1)
{
addReport5($child6)
}
})
}
function lives()
{
$("[class*='LiveWechatSpread']").remove()
}
function collection()
{
$(".ContentItem-actions").each(function(){
var $child6 = $(this).children().eq(6-1)
var $child7 = $(this).children().eq(7-1)
if($child7.length==0 || $child7.text().indexOf("收起") > -1)
{
addReport5($child6)
}
})
}
function iconColor()
{
$(".Zi--List").parent().parent().hover(function(){
$(this).find(".Zi--List").attr("fill","#0084FF")
},function(){
$(this).find(".Zi--List").attr("fill","currentColor")
})
$(".Zi--Comment").parent().parent().hover(function(){
$(this).find(".Zi--Comment").attr("fill","#0084FF")
},function(){
if($(this).prop('lastChild').nodeValue!=null && $(this).prop('lastChild').nodeValue.indexOf("收起评论")==-1)
$(this).find(".Zi--Comment").attr("fill","currentColor")
})
$(".Zi--Comment").parent().parent().on("click",function(){
if($(this).prop('lastChild').nodeValue!=null && $(this).prop('lastChild').nodeValue.indexOf("收起评论")==-1)
$(this).find(".Zi--Comment").attr("fill","#0084FF")
else
$(this).find(".Zi--Comment").attr("fill","currentColor")
})
$(".Zi--Comments").parent().parent().hover(function(){
$(this).find(".Zi--Comments").attr("fill","#00FF7F")
},function(){
if($(".Messages-content").length==0)
$(this).find(".Zi--Comments").attr("fill","currentColor")
})
$(".Zi--Comments").parent().parent().on("click",function(){
if($(".Messages-content").length==0)
$(this).find(".Zi--Comments").attr("fill","#00FF7F")
else
$(this).find(".Zi--Comments").attr("fill","currentColor")
})
$(".Zi--Reply").parent().parent().hover(function(){
$(this).find(".Zi--Reply").attr("fill","#32CD32")
},function(){
if($(this).prop('lastChild').nodeValue!=null && $(this).prop('lastChild').nodeValue.indexOf("取消回复")==-1)
$(this).find(".Zi--Reply").attr("fill","currentColor")
})
$(".Zi--Reply").parent().parent().on("click",function(){
if($(this).prop('lastChild').nodeValue!=null && $(this).prop('lastChild').nodeValue.indexOf("取消回复")==-1)
$(this).find(".Zi--Reply").attr("fill","#32CD32")
else
$(this).find(".Zi--Reply").attr("fill","currentColor")
})
$(".Zi--Reply").parent().parent().each(function(){
if($(this).prop('lastChild').nodeValue!=null && $(this).prop('lastChild').nodeValue.indexOf("取消回复") > -1)
$(this).find(".Zi--Reply").attr("fill","#32CD32")
})
$(".Zi--Like").parent().parent().hover(function(){
if($(this).prop('lastChild').nodeValue!=null && $(this).prop('lastChild').nodeValue.indexOf("踩") > -1 || $(this).attr("data-tooltip")=="不推荐")
$(this).find(".Zi--Like").attr("fill","black")
else
$(this).find(".Zi--Like").attr("fill","#0084FF")
},function(){
if($(this).find("#topic-recommend").length>0 ||$(this).find("#topic-against").length>0 || $(this).prop('lastChild').nodeValue!=null && $(this).prop('lastChild').nodeValue.indexOf("取消踩") == -1)
$(this).find(".Zi--Like").attr("fill","currentColor")
})
$(".Zi--Like").parent().parent().each(function(){
if($(this).prop('lastChild').nodeValue!=null && $(this).prop('lastChild').nodeValue=="取消踩")
$(this).find(".Zi--Like").attr("fill","black")
})
$(".Zi--Share").parent().parent().hover(function(){
$(this).find(".Zi--Share").attr("fill","blue")
},function(){
$(this).find(".Zi--Share").attr("fill","currentColor")
})
$(".Zi--Star").parent().parent().hover(function(){
$(this).find(".Zi--Star").attr("fill","orange")
},function(){
$(this).find(".Zi--Star").attr("fill","currentColor")
})
$(".Zi--Heart").parent().parent().hover(function(){
$(this).find(".Zi--Heart").attr("fill","red")
},function(){
if($(this).prop('lastChild').nodeValue=="喜欢")
$(this).find(".Zi--Heart").attr("fill","currentColor")
})
$(".Zi--Heart").parent().parent().on("click",function(){
if($(this).prop('lastChild').nodeValue=="喜欢")
$(this).find(".Zi--Heart").attr("fill","red")
else
$(this).find(".Zi--Heart").attr("fill","currentColor")
})
$(".Zi--Heart").parent().parent().each(function(){
if($(this).prop('lastChild').nodeValue!=null && $(this).prop('lastChild').nodeValue=="取消喜欢")
$(this).prop('lastChild').nodeValue="已喜欢"
if($(this).prop('lastChild').nodeValue!=null && $(this).prop('lastChild').nodeValue=="已喜欢")
$(this).find(".Zi--Heart").attr("fill","red")
})
$(".Zi--Report").parent().parent().hover(function(){
$(this).find(".Zi--Report").attr("fill","brown")
},function(){
$(this).find(".Zi--Report").attr("fill","currentColor")
})
$(".Zi--Bell").parent().parent().hover(function(){
$(this).find(".Zi--Bell").attr("fill","#FACB62")
},function(){
if($(".PushNotifications-content").length==0)
$(this).find(".Zi--Bell").attr("fill","currentColor")
})
$(".Zi--Bell").parent().parent().on("click",function(){
if($(".PushNotifications-content").length==0)
$(this).find(".Zi--Bell").attr("fill","#FACB62")
else
$(this).find(".Zi--Bell").attr("fill","currentColor")
})
$(".Zi--Heart.PushNotifications-tabIcon").parent().parent().hover(function(){
$(this).find(".Zi--Heart").attr("fill","#0084FF")
},function(){
$(this).find(".Zi--Heart").attr("fill","currentColor")
})
$(".Zi--Users").parent().parent().hover(function(){
$(this).find(".Zi--Users").attr("fill","#0084FF")
},function(){
$(this).find(".Zi--Users").attr("fill","currentColor")
})
$(".Zi--Anonymous").parent().parent().hover(function(){
$(this).find(".Zi--Anonymous").attr("fill","black")
},function(){
$(this).find(".Zi--Anonymous").attr("fill","currentColor")
})
$(".Zi--Log").parent().parent().hover(function(){
$(this).find(".Zi--Log").attr("fill","blue")
},function(){
$(this).find(".Zi--Log").attr("fill","currentColor")
})
$(".Zi--ShortCut").parent().parent().hover(function(){
$(this).find(".Zi--ShortCut").attr("fill","#6D6D6D")
},function(){
$(this).find(".Zi--ShortCut").attr("fill","currentColor")
})
$(".Zi--Trash").parent().parent().hover(function(){
$(this).find(".Zi--Trash").attr("fill","#C70000")
},function(){
$(this).find(".Zi--Trash").attr("fill","currentColor")
})
$(".Zi--Emotion").parent().parent().hover(function(){
$(this).find(".Zi--Emotion").find("path").attr("fill","#0084FF")
},function(){
$(this).find(".Zi--Emotion").find("path").removeAttr("fill")
})
$(".Zi--AddImage").parent().parent().hover(function(){
$(this).find(".Zi--AddImage").find("path").attr("fill","#0084FF")
},function(){
$(this).find(".Zi--AddImage").find("path").removeAttr("fill")
})
$(".Zi--Switch").attr("fill","#0084FF")
$(".Zi--Switch").parent().parent().css("color","black")
}
(function() {
'use strict';
setInterval(directLink,100)
setInterval(iconColor,100)
if(window.location.href.indexOf("question") > -1)
setInterval(question, 300);
else if(window.location.href.indexOf("zvideo") > -1)
setInterval(zvideo, 300);
else if(window.location.href.indexOf("club") > -1)
setInterval(club, 300);
else if(window.location.href.indexOf("search") > -1)
setInterval(search, 300);
else if(window.location.href.indexOf("lives") > -1)
setInterval(lives, 300);
else if(window.location.href.indexOf("collection") > -1)
setInterval(collection, 300);
else if(window.location.href.indexOf("zhuanlan") > -1)
setInterval(zhuanlan, 300);
// Your code here...
})();