@@ -42,7 +42,7 @@ function registerMenuCommand() {
menu _ALL [ i ] [ 3 ] = GM _getValue ( menu _ALL [ i ] [ 0 ] ) ;
menu _ID [ i ] = GM _registerMenuCommand ( ` [ ${ menu _ALL [ i ] [ 3 ] ? '√' : '× ' } ] ${ menu _ALL [ i ] [ 1 ] } ` , function ( ) { menu _switch ( ` ${ menu _ALL [ i ] [ 3 ] } ` , ` ${ menu _ALL [ i ] [ 0 ] } ` , ` ${ menu _ALL [ i ] [ 2 ] } ` ) } ) ;
}
menu _ID [ menu _ID . length ] = GM _registerMenuCommand ( '反馈 & 建议' , function ( ) { window . GM _openInTab ( 'https://github.com/XIU2/UserScript#xiu2userscript' , { active : true , insert : true , setParent : true } ) ; } ) ;
menu _ID [ menu _ID . length ] = GM _registerMenuCommand ( '反馈 & 建议' , function ( ) { window . GM _openInTab ( 'https://github.com/XIU2/UserScript#xiu2userscript' , { active : true , insert : true , setParent : true } ) ; window . GM _openInTab ( 'https://greasyfork.org/zh-CN/scripts/419081/feedback' , { active : true , insert : true , setParent : true } ) ; } ) ;
}
@@ -70,90 +70,88 @@ function menu_value(menuName) {
// 一键收起回答
function collapsedAnswer ( ) {
if ( menu _value ( 'menu_collapsedAnswer' ) ) {
let button _Add = ` <button id="collapsed-button" data-tooltip="收起回答" data-tooltip-position="left" data-tooltip-will-hide-on-click="false" aria-label="收起回答" type="button" class="Button CornerButton Button--plain"><svg class="ContentItem-arrowIcon is-active" aria-label="收起回答" fill="currentColor" viewBox="0 0 24 24" width="24" height="24"><path d="M16.036 19.59a1 1 0 0 1-.997.995H9.032a.996.996 0 0 1-.997-.996v-7.005H5.03c-1.1 0-1.36-.633-.578-1.416L11.33 4.29a1.003 1.003 0 0 1 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.005z"></path></svg></button> `
let style _Add = document . createElement ( 'style' ) ;
style _Add . innerHTML = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}' ;
document . head . appendChild ( style _Add ) ;
document . querySelector ( '.CornerAnimayedFlex' ) . insertAdjacentHTML ( 'afterBegin' , button _Add ) ;
document . getElementById ( 'collapsed-button' ) . onclick = function ( ) {
document . querySelectorAll ( '.ContentItem-rightButton' ) . forEach ( function ( el ) {
if ( el . hasAttribute ( 'data-zop-retract-question' ) ) {
el . click ( )
}
} ) ;
}
function collapsedAnswer ( ) {
if ( ! menu _value ( 'menu_collapsedAnswer' ) ) return
let button _Add = ` <button id="collapsed-button" data-tooltip="收起回答" data-tooltip-position="left" data-tooltip-will-hide-on-click="false" aria-label="收起回答" type="button" class="Button CornerButton Button--plain"><svg class="ContentItem-arrowIcon is-active" aria-label="收起回答" fill="currentColor" viewBox="0 0 24 24" width="24" height="24"><path d="M16.036 19.59a1 1 0 0 1-.997.995H9.032a.996.996 0 0 1-.997-.996v-7.005H5.03c-1.1 0-1.36-.633-.578-1.416L11.33 4.29a1.003 1.003 0 0 1 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.005z"></path></svg></button> `
let style _Add = document . createElement ( 'style' ) ;
style _Add . innerHTML = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}' ;
document . head . appendChild ( style _Add ) ;
document . querySelector ( '.CornerAnimayedFlex' ) . insertAdjacentHTML ( 'afterBegin' , button _Add ) ;
document . getElementById ( 'collapsed-button' ) . onclick = function ( ) {
document . querySelectorAll ( '.ContentItem-rightButton' ) . forEach ( function ( el ) {
if ( el . hasAttribute ( 'data-zop-retract-question' ) ) {
el . click ( )
}
} ) ;
}
}
// 收起当前回答、评论(监听点击事件,点击网页两侧空白处)
function collapsedNowAnswer ( selectors ) {
backToTop ( selectors )
if ( menu _value ( 'menu_collapsedNowAnswer' ) ) {
document . querySelector ( selectors ) . onclick = function ( event ) {
if ( event . target == this ) {
let rightButton = document . querySelector ( '.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom' )
if ( rightButton ) { // 悬浮的 [收起回答](此时正在浏览回答内容 [头部区域 + 中间区域])
// 固定的 [收起评论](先看看是否展开评论)
let commentCollapseButton = rightButton . querySelector ( 'button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel' )
if ( commentCollapseButton && commentCollapseButton . innerText . indexOf ( "收起评论" ) > - 1 ) {
commentCollapseButton . click ( ) ;
function collapsedNowAnswer ( selectors ) {
backToTop ( selectors ) // 快捷回到顶部
if ( ! menu _value ( 'menu_collapsedNowAnswer' ) ) return
document . querySelector ( selectors ) . onclick = function ( event ) {
if ( event . target == this ) {
let rightButton = document . querySelector ( '.ContentItem-actions.Sticky.RichContent-actions.is-fixed.is-bottom' )
if ( rightButton ) { // 悬浮的 [收起回答](此时正在浏览回答内容 [头部区域 + 中间区域])
// 固定的 [收起评论](先看看是否展开评论)
let commentCollapseButton = rightButton . querySelector ( 'button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel' )
if ( commentCollapseButton && commentCollapseButton . innerText . indexOf ( "收起评论" ) > - 1 ) {
commentCollapseButton . click ( ) ;
}
// 再去收起回答
rightButton = rightButton . querySelector ( '.ContentItem-rightButton' )
if ( rightButton && rightButton . hasAttribute ( 'data-zop-retract-question' ) ) {
rightButton . click ( ) ;
}
} else { // 固定的 [收起回答](此时正在浏览回答内容 [尾部区域])
for ( let el of document . querySelectorAll ( '.ContentItem-rightButton' ) ) {
if ( el . hasAttribute ( 'data-zop-retract-question' ) ) {
if ( isElementInViewport ( el ) ) {
// 固定的 [收起评论](先看看是否展开评论)
let commentCollapseButton = el . parentNode . querySelector ( 'button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel' )
if ( commentCollapseButton && commentCollapseButton . innerText . indexOf ( "收起评论" ) > - 1 ) {
commentCollapseButton . click ( ) ;
}
el . click ( ) // 再去收起回答
break
}
}
// 再去收起回答
rightButton = rightButton . querySelector ( '.ContentItem-rightButton' )
if ( rightButton && rightButton . hasAttribute ( 'data-zop-retract-question' ) ) {
rightButton . click ( ) ;
}
} else { // 固定的 [收起回答](此时正在浏览回答内容 [尾部区域])
for ( let el of document . querySelectorAll ( '.ContentItem-rightButton' ) ) {
if ( el . hasAttribute ( 'data-zop-retract-question' ) ) {
}
}
var commentCollapseButton _ = false ;
// 悬浮的 [收起评论](此时正在浏览评论内容 [中间区域])
let commentCollapseButton = document . querySelector ( '.CommentCollapseButton' )
if ( commentCollapseButton ) {
commentCollapseButton . click ( ) ;
} else { // 固定的 [收起评论](此时正在浏览评论内容 [头部区域])
let commentCollapseButton _1 = document . querySelectorAll ( 'button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel' )
if ( commentCollapseButton _1 . length > 0 ) {
for ( let el of commentCollapseButton _1 ) {
if ( el . innerText . indexOf ( "收起评论" ) > - 1 ) {
if ( isElementInViewport ( el ) ) {
// 固定的 [收起评论](先看看是否展开评论)
let commentCollapseButton = el . parentNode . querySelector ( 'button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel' )
if ( commentCollapseButton && commentCollapseButton . innerText . indexOf ( "收起评论" ) > - 1 ) {
commentCollapseButton . click ( ) ;
}
el . click ( ) // 再去收起回答
el . click ( )
commentCollapseButton _ = true // 如果找到并点击了,就没必要执行下面的代码了(可视区域中没有 [收起评论] 时)
break
}
}
}
}
var commentCollapseButton _ = false ;
// 悬浮的 [收起评论](此时正在浏览评论内容 [中间区域])
let commentCollapseButton = document . querySelector ( '.CommentCollapseButton' )
if ( commentCollapseButton ) {
commentCollapseButton . click ( ) ;
} else { // 固定的 [收起评论](此时正在浏览评论内容 [头部区域])
let commentCollapseButton _1 = document . querySelectorAll ( 'button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel' )
if ( commentCollapseButton _ == false ) { // 可视区域中没有 [收起评论] 时(此时正在浏览评论内容 [头部区域] + [尾部区域](不上不下的,既看不到固定的 [收起评论] 又看不到悬浮的 [收起评论])),需要判断可视区域中是否存在评论元素
let commentCollapseButton _1 = document . querySelectorAll ( '.NestComment' )
if ( commentCollapseButton _1 . length > 0 ) {
for ( let el of commentCollapseButton _1 ) {
if ( el . innerText . indexOf ( "收起评论" ) > - 1 ) {
if ( isElementInViewport ( el ) ) {
el . click ( )
commentCollapseButton _ = true // 如果找到并点击了,就没必要执行下面的代码了(可视区域中没有 [收起评论] 时)
if ( isElementInViewport ( el ) ) {
let commentCollapseButton = el . parentNode . parentNode . parentNode . parentNode . parentNode . querySelector ( 'button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel' )
if ( commentCollapseButton . innerText . indexOf ( "收起评论" ) > - 1 ) {
commentCollapseButton . click ( )
break
}
}
}
}
if ( commentCollapseButton _ == false ) { // 可视区域中没有 [收起评论] 时(此时正在浏览评论内容 [头部区域] + [尾部区域](不上不下的,既看不到固定的 [收起评论] 又看不到悬浮的 [收起评论])),需要判断可视区域中是否存在评论元素
let commentCollapseButton _1 = document . querySelectorAll ( '.NestComment' )
if ( commentCollapseButton _1 . length > 0 ) {
for ( let el of commentCollapseButton _1 ) {
if ( isElementInViewport ( el ) ) {
let commentCollapseButton = el . parentNode . parentNode . parentNode . parentNode . parentNode . querySelector ( 'button.Button.ContentItem-action.Button--plain.Button--withIcon.Button--withLabel' )
if ( commentCollapseButton . innerText . indexOf ( "收起评论" ) > - 1 ) {
commentCollapseButton . click ( )
break
}
}
}
}
}
}
}
}
@@ -162,13 +160,12 @@ function collapsedNowAnswer(selectors){
// 回到顶部(监听点击事件,鼠标右键点击网页两侧空白处)
function backToTop ( selectors ) {
if ( menu _value ( 'menu_backToTop' ) ) {
document . querySelector ( selectors ) . oncontextmenu = function ( event ) {
if ( event . target == this ) {
event . preventDefault ( ) ;
window . scrollTo ( 0 , 0 )
}
function backToTop ( selectors ) {
if ( ! menu _value ( 'menu_backToTop' ) ) return
document . querySelector ( selectors ) . oncontextmenu = function ( event ) {
if ( event . target == this ) {
event . preventDefault ( ) ;
window . scrollTo ( 0 , 0 )
}
}
}
@@ -191,32 +188,31 @@ function isElementInViewport(el) {
var postNum ;
// 区分问题文章
function addTypeTips ( ) {
if ( menu _value ( 'menu_typeTips' ) ) {
// URL 匹配正则表达式
let patt _zhuanlan = /zhuanlan.zhihu.com/ ,
patt _question = /question\/\d+/ ,
patt _question _answer = /answer\/\d+/ ,
patt _video = /\/zvideo\// ,
patt _tip = /zhihu_e_tips/
let postList = document . querySelectorAll ( 'h2.ContentItem-title a' ) ;
postNum = document . querySelectorAll ( 'small.zhihu_e_tips' ) ;
//console.log(`${postList.length} ${postNum.length}`)
if ( postList . length > postNum . length ) {
for ( let num = postNum . length ; num < postList . length ; num ++ ) {
if ( ! patt _tip . test ( postList [ num ] . innerHTML ) ) { // 判断是否已添加
if ( patt _zhuanlan . test ( postList [ num ] . href ) ) { // 如果是文章
postList [ num ] . innerHTML = ` <small class="zhihu_e_tips" style="color: #ffffff;font-weight: normal;font-size: 12px;padding: 0 3px;border-radius: 2px;background-color: #2196F3;display: inline-block;height: 18px;">文章</small> ` + postList [ num ] . innerHTML
} else if ( patt _question . test ( postList [ num ] . href ) ) { // 如果是问题
if ( patt _question _answer . test ( postList [ num ] . href ) ) { // 如果是指向回答的问题(而非指向纯问题的链接)
postList [ num ] . innerHTML = ` <small class="zhihu_e_tips" style="color: #ffffff;font-weight: normal;font-size: 12px;padding: 0 3px;border-radius: 2px;background-color: #f68b83;display: inline-block;height: 18px;">问题</small> ` + postList [ num ] . innerHTML
} else {
postList [ num ] . innerHTML = ` <small class="zhihu_e_tips" style="color: #ffffff;font-weight: normal;font-size: 12px;padding: 0 3px;border-radius: 2px;background-color: #ff5a4e;display: inline-block;height: 18px;">问题</small> ` + postList [ num ] . innerHTML
}
} else if ( patt _video . test ( postList [ num ] . href ) ) { // 如果是视频
postList [ num ] . innerHTML = ` <small class="zhihu_e_tips" style="color: #ffffff;font-weight: normal;font-size: 12px;padding: 0 3px;border-radius: 2px;background-color: #00BCD4;display: inline-block;height: 18px;">视频</small> ` + postList [ num ] . innerHTML
if ( ! menu _value ( 'menu_typeTips' ) ) return
// URL 匹配正则表达式
let patt _zhuanlan = /zhuanlan.zhihu.com/ ,
patt _question = /question\/\d+/ ,
patt _question _answer = /answer\/\d+/ ,
patt _video = /\/zvideo\// ,
patt _tip = /zhihu_e_tips/
let postList = document . querySelectorAll ( 'h2.ContentItem-title a' ) ;
postNum = document . querySelectorAll ( 'small.zhihu_e_tips' ) ;
//console.log(`${postList.length} ${postNum.length}`)
if ( postList . length > postNum . length ) {
for ( let num = postNum . length ; num < postList . length ; num ++ ) {
if ( ! patt _tip . test ( postList [ num ] . innerHTML ) ) { // 判断是否已添加
if ( patt _zhuanlan . test ( postList [ num ] . href ) ) { // 如果是文章
postList [ num ] . innerHTML = ` <small class="zhihu_e_tips" style="color: #ffffff;font-weight: normal;font-size: 12px;padding: 0 3px;border-radius: 2px;background-color: #2196F3;display: inline-block;height: 18px;">文章</small> ` + postList [ num ] . innerHTML
} else if ( patt _question . test ( postList [ num ] . href ) ) { // 如果是问题
if ( patt _question _answer . test ( postList [ num ] . href ) ) { // 如果是指向回答的问题(而非指向纯问题的链接)
postList [ num ] . innerHTML = ` <small class="zhihu_e_tips" style="color: #ffffff;font-weight: normal;font-size: 12px;padding: 0 3px;border-radius: 2px;background-color: #f68b83;display: inline-block;height: 18px;">问题</small> ` + postList [ num ] . innerHTML
} else {
postList [ num ] . innerHTML = ` <small class="zhihu_e_tips" style="color: #ffffff;font-weight: normal;font-size: 12px;padding: 0 3px;border-radius: 2px;background-color: #ff5a4e;display: inline-block;height: 18px;">问题</small> ` + postList [ num ] . innerHTML
}
//postNum += 1;
} else if ( patt _video . test ( postList [ num ] . href ) ) { // 如果是视频
postList [ num ] . innerHTML = ` <small class="zhihu_e_tips" style="color: #ffffff;font-weight: normal;font-size: 12px;padding: 0 3px;border-radius: 2px;background-color: #00BCD4;display: inline-block;height: 18px;">视频</small> ` + postList [ num ] . innerHTML
}
//postNum += 1;
}
}
}
@@ -284,7 +280,7 @@ function topTime_index() {
// 发布时间置顶
topTime _publishTop ( ContentItemTime , _this , 'ContentItem-meta' )
}
} )
} ) ;
}
@@ -300,7 +296,7 @@ function topTime_question() {
topTime _publishTop ( ContentItemTime , _this , 'ContentItem-meta' )
}
} )
} ) ;
// 问题创建时间
if ( ! ( document . querySelector ( '.QuestionPage .QuestionHeader-side p' ) ) && window . location . href . indexOf ( "log" ) == - 1 ) { // 没有执行过 且 非问题日志页
@@ -326,7 +322,7 @@ function topTime_search() {
topTime _publishTop ( ContentItemTime , _this , 'SearchItem-meta' )
}
} )
} ) ;
}
@@ -342,7 +338,7 @@ function topTime_people() {
topTime _publishTop ( ContentItemTime , _this , 'ContentItem-meta' )
}
} )
} ) ;
}
@@ -375,29 +371,27 @@ function topTime_zhuanlan() {
// 完整显示时间
function topTime _allTime ( ContentItemTime ) {
if ( menu _value ( 'menu_allTime' ) ) {
if ( ContentItemTime . innerText . indexOf ( "发布于" ) == - 1 && ContentItemTime . innerText . indexOf ( "编辑于" ) > - 1 ) { //只有 "编辑于" 时增加具体发布时间 data-tooltip
let data _tooltip = ContentItemTime . querySelector ( 'span' ) . getAttribute ( 'data-tooltip' ) ;
let oldtext = ContentItemTime . querySelector ( 'span' ) . innerText ;
ContentItemTime . querySelector ( 'span' ) . innerText = data _tooltip + ", " + oldtext ;
ContentItemTime . classList . add ( 'full' ) ;
} else if ( ContentItemTime . innerText . indexOf ( "发布于" ) > - 1 && ContentItemTime . innerText . indexOf ( "编辑于" ) == - 1 ) { //只有 "发布于" 时替换为具体发布时间 data-tooltip
let data _tooltip = ContentItemTime . querySelector ( 'span' ) . getAttribute ( 'data-tooltip' ) ;
ContentItemTime . querySelector ( 'span' ) . innerText = data _tooltip ;
ContentItemTime . classList . add ( 'full' ) ;
}
if ( ! menu _value ( 'menu_allTime' ) ) return
if ( ContentItemTime . innerText . indexOf ( "发布于" ) == - 1 && ContentItemTime . innerText . indexOf ( "编辑于" ) > - 1 ) { //只有 "编辑于" 时增加具体发布时间 data-tooltip
let data _tooltip = ContentItemTime . querySelector ( 'span' ) . getAttribute ( 'data-tooltip' ) ;
let oldtext = ContentItemTime . querySelector ( 'span' ) . innerText ;
ContentItemTime . querySelector ( 'span' ) . innerText = data _tooltip + ", " + oldtext ;
ContentItemTime . classList . add ( 'full' ) ;
} else if ( ContentItemTime . innerText . indexOf ( "发布于" ) > - 1 && ContentItemTime . innerText . indexOf ( "编辑于" ) == - 1 ) { //只有 "发布于" 时替换为具体发布时间 data-tooltip
let data _tooltip = ContentItemTime . querySelector ( 'span' ) . getAttribute ( 'data-tooltip' ) ;
ContentItemTime . querySelector ( 'span' ) . innerText = data _tooltip ;
ContentItemTime . classList . add ( 'full' ) ;
}
}
// 发布时间置顶
function topTime _publishTop ( ContentItemTime , _this , class _ ) {
if ( menu _value ( 'menu_publishTop' ) ) {
if ( ! ContentItemTime . parentNode . classList . contains ( class _ ) ) {
let temp _time = ContentItemTime . cloneNode ( true ) ;
//_this.querySelector('.RichContent .ContentItem-time').style.display = 'none';
_this . querySelector ( '.' + class _ ) . insertAdjacentElement ( 'beforeEnd' , temp _time ) ;
}
if ( ! menu _value ( 'menu_publishTop' ) ) return
if ( ! ContentItemTime . parentNode . classList . contains ( class _ ) ) {
let temp _time = ContentItemTime . cloneNode ( true ) ;
//_this.querySelector('.RichContent .ContentItem-time').style.display = 'none';
_this . querySelector ( '.' + class _ ) . insertAdjacentElement ( 'beforeEnd' , temp _time ) ;
}
}
@@ -489,14 +483,12 @@ function originalPic(){
pic1 . setAttribute ( 'src' , pic1 . getAttribute ( 'data-original' ) )
}
}
} )
} ) ;
}
( function ( ) {
addEventListener _DOMNodeInserted ( ) ; // 监听 网页插入元素 事件
// 默认折叠邀请,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript)
// 默认折叠邀请,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript)
function questionInvitation ( ) {
let timer = setInterval ( function ( ) {
let QuestionInvitation = document . querySelector ( '.QuestionInvitation-content' ) ; if ( ! QuestionInvitation ) return
clearInterval ( timer ) ;
@@ -511,51 +503,54 @@ function originalPic(){
QuestionInvitation . style . display = 'none'
}
}
} )
} ) ;
}
( function ( ) {
addEventListener _DOMNodeInserted ( ) ; // 监听 网页插入元素 事件
questionInvitation ( ) ; // 默认折叠邀请
setInterval ( originalPic , 100 ) ; // 默认高清原图
if ( menu _value ( 'menu_directLink' ) ) setInterval ( directLink , 100 ) ; // 默认站外直链
if ( menu _value ( 'menu_directLink' ) ) setInterval ( directLink , 100 ) ; // 默认站外直链
if ( window . location . href . indexOf ( "question " ) > - 1 ) { // 回答页 //
if ( window . location . href . indexOf ( "waiting" ) == - 1 ) {
if ( window . location . href . indexOf ( "question" ) > - 1 ) { // 回答页 //
if ( window . location . href . indexOf ( "waiting " ) == - 1 ) {
collapsedAnswer ( ) ; // 一键收起回答
collapsedNowAnswer ( ".QuestionPage" ) ;
collapsedNowAnswer ( ".Question-main" ) ;
collapsedNowAnswer ( ".QuestionPage" ) ; // 收起当前回答 + 快捷返回顶部
collapsedNowAnswer ( ".Question-main" ) ; // 收起当前回答 + 快捷返回顶部
}
setInterval ( topTime _question , 300 ) ; // 置顶显示时间
} else if ( window . location . href . indexOf ( "search" ) > - 1 ) { // 搜索结果页 //
} else if ( window . location . href . indexOf ( "search" ) > - 1 ) { // 搜索结果页 //
collapsedAnswer ( ) ; // 一键收起回答
collapsedNowAnswer ( "main div" ) ;
collapsedNowAnswer ( ".Search-container" ) ;
collapsedNowAnswer ( "main div" ) ; // 收起当前回答 + 快捷返回顶部
collapsedNowAnswer ( ".Search-container" ) ; // 收起当前回答 + 快捷返回顶部
setInterval ( topTime _search , 300 ) ; // 置顶显示时间
EventXMLHttpRequest ( ) ; // 区分问题文章
} else if ( window . location . href . indexOf ( "topic" ) > - 1 ) { // 话题页 //
if ( window . location . href . indexOf ( "hot" ) > - 1 || window . location . href . indexOf ( "top-answers" ) > - 1 ) {
} else if ( window . location . href . indexOf ( "topic" ) > - 1 ) { // 话题页 //
if ( window . location . href . indexOf ( "hot" ) > - 1 || window . location . href . indexOf ( "top-answers" ) > - 1 ) { // 仅限 [讨论] [精华]
collapsedAnswer ( ) ; // 一键收起回答
collapsedNowAnswer ( "main.App-main" ) ;
collapsedNowAnswer ( ".ContentLayout" ) ;
collapsedNowAnswer ( "main.App-main" ) ; // 收起当前回答 + 快捷返回顶部
collapsedNowAnswer ( ".ContentLayout" ) ; // 收起当前回答 + 快捷返回顶部
setInterval ( topTime _people , 300 ) ; // 置顶显示时间
EventXMLHttpRequest ( ) ; // 区分问题文章
}
} else if ( window . location . href . indexOf ( "zhuanlan" ) > - 1 ) { // 文章 //
backToTop ( "article.Post-Main.Post-NormalMain" )
backToTop ( "div.Post-Sub.Post-NormalSub" )
} else if ( window . location . href . indexOf ( "zhuanlan" ) > - 1 ) { // 文章 //
backToTop ( "article.Post-Main.Post-NormalMain" ) ; // 快捷返回顶部
backToTop ( "div.Post-Sub.Post-NormalSub" ) ; // 快捷返回顶部
setInterval ( topTime _zhuanlan , 300 ) ; // 置顶显示时间
} else if ( window . location . href . indexOf ( "column" ) > - 1 ) { // 专栏 //
} else if ( window . location . href . indexOf ( "column" ) > - 1 ) { // 专栏 //
collapsedAnswer ( ) ; // 一键收起回答
collapsedNowAnswer ( "main div" ) ;
collapsedNowAnswer ( "main div" ) ; // 收起当前回答 + 快捷返回顶部
setInterval ( topTime _zhuanlan , 300 ) ; // 置顶显示时间
} else if ( window . location . href . indexOf ( "people" ) > - 1 || window . location . href . indexOf ( "org" ) > - 1 ) { // 用户主页 //
} else if ( window . location . href . indexOf ( "people" ) > - 1 || window . location . href . indexOf ( "org" ) > - 1 ) { // 用户主页 //
collapsedAnswer ( ) ; // 一键收起回答
collapsedNowAnswer ( "main div" ) ;
collapsedNowAnswer ( ".Profile-main" ) ;
collapsedNowAnswer ( "main div" ) ; // 收起当前回答 + 快捷返回顶部
collapsedNowAnswer ( ".Profile-main" ) ; // 收起当前回答 + 快捷返回顶部
setInterval ( topTime _people , 300 ) ; // 置顶显示时间
} else { // 首页 //
} else { // 首页 //
collapsedAnswer ( ) ; // 一键收起回答
collapsedNowAnswer ( "main div" ) ;
collapsedNowAnswer ( ".Topstory-container" ) ;
collapsedNowAnswer ( "main div" ) ; // 收起当前回答 + 快捷返回顶部
collapsedNowAnswer ( ".Topstory-container" ) ; // 收起当前回答 + 快捷返回顶部
setInterval ( topTime _index , 300 ) ; // 置顶显示时间
EventXMLHttpRequest ( ) ; // 区分问题文章
}