Greasy Fork

Greasy Fork is available in English.

Acfun楼层一键折叠

文章区评论楼层一件折叠

当前为 2018-09-20 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Acfun楼层一键折叠
// @version     1.0
// @description 文章区评论楼层一件折叠
// @match       http*://www.acfun.cn/a/ac*

// @author      冲锋
// @require        http://code.jquery.com/jquery-1.6.1.min.js
// @namespace http://greasyfork.icu/users/63731
// ==/UserScript==

(function() {
    'use strict';


         //判断楼层加载成功
    var flag=setInterval(function(){
                    if($(".item-comment-quote").length!=0){

                        clearInterval(flag)


                        $(".item-comment-quote").each(function(index,e){
                            //第一层添加按钮
                           if( $(e).attr("data-qid")==0){

                               var flodButton=$("<a>点击折叠</a>")
                                flodButton.css({
                                    float:"right",

                                    color:"#f01414",
                                    marginRight:"0px"

                                });
                               var openBar=$("<span class='item-quote-hidden open-bar'>此楼已手动折叠[点击展开]</span>")

                               if($(e).parents(".item-comment:last").length!=0)
                                   $(e).find(".top").append(flodButton)
                               $(e).parents(".item-comment:last").before(openBar)
                               openBar.hide()


                               //展开折叠按钮动作
                               flodButton.click(function(){
                                    openBar.show()

                                   $(e).parents(".item-comment:last").hide()
                               })

                               openBar.click(function(){
                                   openBar.hide()

                                    $(e).parents(".item-comment:last").show()
                               })
                           }

                        })


                    }

    },
             500 )








})();