optimize code
This commit is contained in:
parent
5745a51a21
commit
de16f18b11
104
tieba page.js
104
tieba page.js
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name tieba page
|
||||
// @namespace http://tampermonkey.net/
|
||||
// @version 1.025
|
||||
// @version 1.026
|
||||
// @author fthvgb1
|
||||
// @match https://tieba.baidu.com/*
|
||||
// @match https://tiebac.baidu.com/*
|
||||
@ -1247,51 +1247,61 @@
|
||||
document.querySelector('body').appendChild(d);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
|
||||
if (!check()) {
|
||||
return;
|
||||
}
|
||||
let x = location.href.match(/\/p\/(\d+)(\?|\#)?/);
|
||||
if (x) {
|
||||
location.href = `/mo/q/m?kz=${x[1]}`;
|
||||
return;
|
||||
}
|
||||
fnav();
|
||||
clickControl();
|
||||
let css = document.createElement('style');
|
||||
css.textContent = `
|
||||
.class_hide_flag{display:block!important;}.father-cut-pager-class-no-page>#list_pager{visibility: visible!important;height: 44px!important;}#glob,body{margin-top: 0px!important;}.father_cut_list_class{padding-bottom: 0px!important;}.father-cut-recommend-normal-box,.father-cut-daoliu-normal-box,.fixed_bar,.pb,.frs,.no_mean,.addbodybottom,.img_desc,.top-guide-wrap,.open-style,.index-feed-cards .hot-topic,.appPromote_wrapper,.ui_image_header_bottom,.videoFooter,#diversBanner,.tb-footer-wrap,.interest-bar,.footer-wrap,.client-btn,.daoliu{display:none!important;}.tl_shadow:not([data-tid]),#pblist>li:not([data-tid]){display:none!important;}.navbar-view{top:24px!important;}.navbar-box{top:44px!important;}
|
||||
.footer_logo,.footer-version { display:none!important}
|
||||
.fr_list .list_item_floor { padding-top: 8px;
|
||||
letter-spacing: 1px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 2px
|
||||
border: 1px solid rgba(0,0,0,.1);
|
||||
box-shadow: 5px 5px 5px rgba(0,0,0,0.2);}
|
||||
.floor_footer_item .user_name,.floor_footer_item .user_name:visited { color:#125bc7; }
|
||||
.floor_content a,.floor_content a:visited { color:#498bef; }
|
||||
.fr_list .list_item_floor:nth-child(odd){ background-color:rgba(180, 228, 207, 0.2); }
|
||||
.fr_list .list_item_floor:nth-child(even){ background-color:rgba(168, 191, 157, 0.16); }
|
||||
.nav-bar-wrapper { display:none; }
|
||||
.tb-threadlist__item.tb-banner { display:none; }
|
||||
.tb-threadlist__item.tb-hotthread-wrapper{ display:none; }
|
||||
|
||||
`;
|
||||
document.querySelector('head').append(css);
|
||||
//debugger
|
||||
|
||||
delElement(['.ui_image_header_bottom']);
|
||||
|
||||
if (document.querySelector('#pblist')) {
|
||||
detail();
|
||||
}
|
||||
if (document.querySelector('#tlist')) {
|
||||
list();
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
startFn();
|
||||
});
|
||||
} else {
|
||||
startFn();
|
||||
}
|
||||
|
||||
const startFn = () => {
|
||||
try {
|
||||
|
||||
if (!check()) {
|
||||
return;
|
||||
}
|
||||
let x = location.href.match(/\/p\/(\d+)(\?|\#)?/);
|
||||
if (x) {
|
||||
location.href = `/mo/q/m?kz=${x[1]}`;
|
||||
return;
|
||||
}
|
||||
fnav();
|
||||
clickControl();
|
||||
let css = document.createElement('style');
|
||||
css.textContent = `
|
||||
.class_hide_flag{display:block!important;}.father-cut-pager-class-no-page>#list_pager{visibility: visible!important;height: 44px!important;}#glob,body{margin-top: 0px!important;}.father_cut_list_class{padding-bottom: 0px!important;}.father-cut-recommend-normal-box,.father-cut-daoliu-normal-box,.fixed_bar,.pb,.frs,.no_mean,.addbodybottom,.img_desc,.top-guide-wrap,.open-style,.index-feed-cards .hot-topic,.appPromote_wrapper,.ui_image_header_bottom,.videoFooter,#diversBanner,.tb-footer-wrap,.interest-bar,.footer-wrap,.client-btn,.daoliu{display:none!important;}.tl_shadow:not([data-tid]),#pblist>li:not([data-tid]){display:none!important;}.navbar-view{top:24px!important;}.navbar-box{top:44px!important;}
|
||||
.footer_logo,.footer-version { display:none!important}
|
||||
.fr_list .list_item_floor { padding-top: 8px;
|
||||
letter-spacing: 1px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 2px
|
||||
border: 1px solid rgba(0,0,0,.1);
|
||||
box-shadow: 5px 5px 5px rgba(0,0,0,0.2);}
|
||||
.floor_footer_item .user_name,.floor_footer_item .user_name:visited { color:#125bc7; }
|
||||
.floor_content a,.floor_content a:visited { color:#498bef; }
|
||||
.fr_list .list_item_floor:nth-child(odd){ background-color:rgba(180, 228, 207, 0.2); }
|
||||
.fr_list .list_item_floor:nth-child(even){ background-color:rgba(168, 191, 157, 0.16); }
|
||||
.nav-bar-wrapper { display:none; }
|
||||
.tb-threadlist__item.tb-banner { display:none; }
|
||||
.tb-threadlist__item.tb-hotthread-wrapper{ display:none; }
|
||||
|
||||
`;
|
||||
document.querySelector('head').append(css);
|
||||
//debugger
|
||||
|
||||
delElement(['.ui_image_header_bottom']);
|
||||
|
||||
if (document.querySelector('#pblist')) {
|
||||
detail();
|
||||
}
|
||||
if (document.querySelector('#tlist')) {
|
||||
list();
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user