猫史档案馆


【开源发布】猫站样式优化工具cmgreener代码

用户:Albert钟Albert钟查看:247 回复:8 评论:25 创建时间:2022-03-12T14:01:59


演示和介绍:shequ.codemao.cn/community/429927 代码下载:greasyfork.org/zh-CN/scripts/441381-cmgreener 代码 //==UserScript== //@namecmgreener //@namespacehttp://tampermonkey.net/ //@version1.0.1 //@descriptiongreenerforshequ.codemao.cn //@authorAlbertZ //@include*://shequ.codemao.cn/* //@iconhttps://static.codemao.cn/whitef/favicon.ico //@licenseMIT //@grantnone //==/UserScript== varremoves={}; removes['shequ.codemao.cn/course']=['r-course--banner']; removes['shequ.codemao.cn/discover']=[]; removes['shequ.codemao.cn/work_shop']=['r-work_shop--banner']; removes['shequ.codemao.cn/community']=['r-community--bulletin_container','r-community--notic_item_icon_hot', 'c-post_list--status_iconc-post_list--hot','c-post_list--status_iconc-post_list--up','r-community--roules_btn' ]; removes['shequ.codemao.cn/mall']=['r-mall-r-home--banner']; removes['shequ.codemao.cn/gallery']=['r-gallery--banner']; removes['shequ.codemao.cn']=['r-home--guide_part','r-home-c-workshop_area--workshop_work']; window.onload=function(){ //重定向anchor标签 varanchors=[...document.getElementsByClassName('c-navigator--nav_wrap')[0].getElementsByTagName('a')].slice(0,7); for(vari=0;i<anchors.length;i++){ vara=anchors[i]; leturl=a.href; a.onclick=function(){window.location.href=url;}; } //论坛区延迟执行(适应XHR) if(window.location.href.indexOf('shequ.codemao.cn/community')>-1){ setTimeout(function(){ leturl='shequ.codemao.cn/community'; for(letcninremoves[url]){ varele=document.getElementsByClassName(removes[url][cn]); if(ele.length){ //隐藏元素 for(vari=0;i<ele.length;i++){ ele[i].style.display='none'; } //增加上边距 if(window.location.href!='https://shequ.codemao.cn/community'){ varmain=document.getElementsByClassName('r-index--main_cont')[0]; main.style.marginTop='5%'; } } } },1000); //解析屏蔽词 if(window.location.href.startsWith('https://shequ.codemao.cn/community/')){ varid=window.location.href.replace('https://shequ.codemao.cn/community/',''); varhttpRequest=newXMLHttpRequest(); httpRequest.open('GET','https://api.codemao.cn/web/forums/posts/'+id+'/details',true); httpRequest.send(); httpRequest.onreadystatechange=function(){ if(httpRequest.readyState==4&&httpRequest.status==200){ vardata=eval('('+httpRequest.responseText+')'); varcontent=document.getElementsByClassName('r-community-r-detail--forum_content')[0]; content.innerH喵L=data.content; } }; //重新高亮代码 setTimeout(function(){ Pri喵.highlightAll(); },1000); } //其余页面 }else{ for(leturlinremoves){ if(window.location.href.indexOf(url)>-1){ for(letcninremoves[url]){ varele=document.getElementsByClassName(removes[url][cn]); if(ele.length){ //隐藏部分元素 for(vari=0;i<ele.length;i++){ ele[i].style.display='none'; } //增加上边距 if(window.location.href!='https://shequ.codemao.cn/'&&window.location.href!='https://shequ.codemao.cn/community'){ varmain=document.getElementsByClassName('r-index--main_cont')[0]; main.style.marginTop='5%'; } } } } } } };  


回复

上一页第 1 页 / 共 1 页下一页
Albert钟Albert钟

ddd

点赞0


评论


一个STUB用户_14302596一个STUB用户_14302596

顶顶顶

点赞0


评论


我是伊柒我是伊柒

顶顶顶!

点赞0


评论

谢()

话说最近工作室被猴子搞的乱套了,您可以去观猴,

好的()有空帮忙喷()

谢谢。


Albert钟Albert钟

ddd

点赞0


评论


用户_869149用户_869149

顶顶顶

点赞0


评论


用户_869149用户_869149

Albert钟大佬的帖绝对要顶!

点赞0


评论

谢()


伴雪纷飞伴雪纷飞

没看但还是要顶一下()

点赞0


评论

就是排版....

可以去那个链接()

找一个api

??

api测试

成功了yeah (我要写个跟嗯哼君的晓涵一样的自动回复()())

这个额()好主意我也要搞

竞争下()

还是合作?

-_-||可怜我马上要走了()

我连qq都没有,还合作()

没事用gitee

并且可以在我那个原来的机器人基础上做

我也没有-_-||()

我想你应该需要我那个多轮询算法()

那去注册呀

或者在这里说

或者()还是竞争吧

算了吧aa()

嗯


Albert钟Albert钟

ddd

点赞0


评论