DeviantArt Friend List Helper

Allows better management of users in dA friend lists.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @id             dAFriendListHelper
// @name           DeviantArt Friend List Helper
// @version        1.1
// @namespace      http://www.puramaldad.com/dAFLH
// @author         Willy Galleta
// @description    Allows better management of users in dA friend lists.
// @match        *.deviantart.com/deviants/*
// @require    	http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @run-at         document-end
// @grant          none
// ==/UserScript==

// var $ = unsafeWindow.jQuery,holder,query,offset,fPage,pPage.lPage;
function addClicks()
{
    $("body").append('<style>table.zebra tr:hover{background-color: rgb(231,213,255)} .friend-selected{background-color:rgb(250,200,250) !important}</style>');
    var selectFriend = function() {
        var e;
        var checks = [$(),
                      $("#friend_attr_friend"),
                      $("#friend_attr_deviations"),
                      $("#friend_attr_journals"),
                      $("#friend_attr_forums"),
                      $("#friend_attr_critiques"),
                      $("#friend_attr_scr"+"aps")];
        $("#username").val($(this).find(".u").text());
        for(i in checks)
        {
            if($(this).find("td").eq(i).find(".checkbox").hasClass("checked"))
            {
                e = true;
            } else {
                e = false;
            }
            checks[i].attr("checked",e);
        };
        $(".friend").removeClass("friend-selected");
        $(this).addClass("friend-selected");
    }
    $(".friend").click(selectFriend);
    $("#add-deviant form").submit(function()
    {
        $.post($(this).attr("action"), $(this).serialize(), function() {alert("Actualizado.")});
        return false;
    });
    $("#deviantspager a").click(function()
    {
        $(".friends").unbind("click", selectFriend);
        setTimeout(checkFriends, 500);
    });
}
function checkFriends()
{
    if($(".friend").length>1)
    {
        addClicks();
    } else {
        setTimeout(checkFriends, 200);
    }
}
$(function()
{
    checkFriends();
});