@@ -221,7 +221,7 @@ function topTime_search()
221221 // 完整显示时间
222222 if ( menu_allTime )
223223 {
224- if ( $ ( this ) . find ( ".ContentItem-time" ) . text ( ) . indexOf ( "发布于" ) == - 1 && $ ( this ) . find ( ".ContentItem-time" ) . text ( ) . indexOf ( "编辑于" ) > - 1 ) //只有"编辑于"时,增加具体发布时间data-tooltip
224+ if ( $ ( this ) . find ( ".ContentItem-time" ) . text ( ) . indexOf ( "发布于" ) == - 1 && $ ( this ) . find ( ".ContentItem-time" ) . text ( ) . indexOf ( "编辑于" ) > - 1 ) //只有"编辑于"时,增加具体发布时间data-tooltip
225225 {
226226 let data_tooltip = $ ( this ) . find ( ".ContentItem-time" ) . find ( "span" ) . attr ( "data-tooltip" ) ;
227227 var oldtext = $ ( this ) . find ( ".ContentItem-time" ) . find ( "span" ) . text ( ) ;
@@ -298,19 +298,18 @@ function directLink () {
298298 if ( $ ( this ) . find ( "span" ) . length > 0 ) {
299299 new_href = $ ( this ) . text ( ) ;
300300 $ ( this ) . attr ( "href" , new_href ) ;
301- }
302- else if ( $ ( this ) . attr ( "href" ) . indexOf ( "link.zhihu.com/?target=" ) > - 1 ) {
301+ } else if ( $ ( this ) . attr ( "href" ) . indexOf ( "link.zhihu.com/?target=" ) > - 1 ) {
303302 external_href = $ ( this ) . attr ( "href" ) ;
304303 new_href = external_href . substring ( external_href = $ ( this ) . attr ( "href" ) . indexOf ( "link.zhihu.com/?target=" ) + "link.zhihu.com/?target=" . length ) ;
305304 //console.log(`${new_href}`)
306305 $ ( this ) . attr ( "href" , decodeURIComponent ( new_href ) ) ;
307- }
308- else {
306+ } else {
309307 external_href = $ ( this ) . attr ( "href" ) ;
310- if ( external_href . lastIndexOf ( "https%3A" ) )
308+ if ( external_href . lastIndexOf ( "https%3A" ) ) {
311309 new_href = $ ( this ) . attr ( "href" ) . substring ( $ ( this ) . attr ( "href" ) . lastIndexOf ( "https%3A" ) ) ;
312- else if ( external_href . lastIndexOf ( "http%3A%2F%2F" ) )
310+ } else if ( external_href . lastIndexOf ( "http%3A%2F%2F" ) ) {
313311 new_href = $ ( this ) . attr ( "href" ) . substring ( $ ( this ) . attr ( "href" ) . lastIndexOf ( "http%3A" ) ) ;
312+ }
314313 $ ( this ) . attr ( "href" , decodeURIComponent ( new_href ) ) ;
315314 }
316315 } ) ;
@@ -320,18 +319,17 @@ function directLink () {
320319 if ( $ ( this ) . find ( "LinkCard-title" ) . length > 0 && $ ( this ) . find ( "LinkCard-title" ) . indexOf ( "http" ) > - 1 ) {
321320 new_href = $ ( this ) . find ( "LinkCard-title" ) . text ( ) ;
322321 $ ( this ) . attr ( "href" , new_href ) ;
323- }
324- else if ( $ ( this ) . attr ( "href" ) . indexOf ( "link.zhihu.com/?target=" ) > - 1 ) {
322+ } else if ( $ ( this ) . attr ( "href" ) . indexOf ( "link.zhihu.com/?target=" ) > - 1 ) {
325323 external_href = $ ( this ) . attr ( "href" ) ;
326324 new_href = external_href . substring ( external_href = $ ( this ) . attr ( "href" ) . indexOf ( "link.zhihu.com/?target=" ) + "link.zhihu.com/?target=" . length ) ;
327325 $ ( this ) . attr ( "href" , decodeURIComponent ( new_href ) ) ;
328- }
329- else {
326+ } else {
330327 external_href = $ ( this ) . attr ( "href" ) ;
331- if ( external_href . lastIndexOf ( "https%3A" ) )
328+ if ( external_href . lastIndexOf ( "https%3A" ) ) {
332329 new_href = $ ( this ) . attr ( "href" ) . substring ( $ ( this ) . attr ( "href" ) . lastIndexOf ( "https%3A" ) ) ;
333- else if ( external_href . lastIndexOf ( "http%3A%2F%2F" ) )
330+ } else if ( external_href . lastIndexOf ( "http%3A%2F%2F" ) ) {
334331 new_href = $ ( this ) . attr ( "href" ) . substring ( $ ( this ) . attr ( "href" ) . lastIndexOf ( "http%3A" ) ) ;
332+ }
335333 $ ( this ) . attr ( "href" , decodeURIComponent ( new_href ) ) ;
336334 }
337335 } ) ;
@@ -356,10 +354,10 @@ function directLink () {
356354// 默认高清原图,来自:https://greasyfork.org/scripts/402808
357355function originalPic ( ) {
358356 $ ( "img" ) . each ( function ( ) {
359- if ( $ ( this ) . attr ( "data-original" ) != undefined && ! $ ( this ) . hasClass ( "comment_sticker" ) )
360- {
361- if ( $ ( this ) . attr ( "src" ) != $ ( this ) . attr ( "data-original" ) )
357+ if ( $ ( this ) . attr ( "data-original" ) != undefined && ! $ ( this ) . hasClass ( "comment_sticker" ) ) {
358+ if ( $ ( this ) . attr ( "src" ) != $ ( this ) . attr ( "data-original" ) ) {
362359 $ ( this ) . attr ( "src" , $ ( this ) . attr ( "data-original" ) )
360+ }
363361 }
364362 } )
365363 $ ( ".Modal-inner" ) . css ( { "overflow-y" :"hidden" } )
@@ -464,16 +462,16 @@ function addTypeTips() {
464462 //console.log(`${postList.length} ${postNum.length}`)
465463 if ( postList . length > postNum . length ) {
466464 for ( let num = postNum . length ; num < postList . length ; num ++ ) {
467- if ( ! patt_tip . test ( postList [ num ] . innerHTML ) ) { // 判断是否已添加
468- if ( patt_zhuanlan . test ( postList [ num ] . href ) ) { // 如果是文章
465+ if ( ! patt_tip . test ( postList [ num ] . innerHTML ) ) { // 判断是否已添加
466+ if ( patt_zhuanlan . test ( postList [ num ] . href ) ) { // 如果是文章
469467 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
470- } else if ( patt_question . test ( postList [ num ] . href ) ) { // 如果是问题
468+ } else if ( patt_question . test ( postList [ num ] . href ) ) { // 如果是问题
471469 if ( patt_question_answer . test ( postList [ num ] . href ) ) { // 如果是指向回答的问题(而非指向纯问题的链接)
472470 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
473471 } else {
474472 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
475473 }
476- } else if ( patt_video . test ( postList [ num ] . href ) ) { // 如果是视频
474+ } else if ( patt_video . test ( postList [ num ] . href ) ) { // 如果是视频
477475 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
478476 }
479477 //postNum += 1;
0 commit comments