-
Notifications
You must be signed in to change notification settings - Fork 2
/
acfun_report_onekey.user.js
112 lines (103 loc) · 2.8 KB
/
acfun_report_onekey.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// ==UserScript==
// @name acfun举报
// @namespace 1
// @include http://www.acfun.tv/*
// @include http://acfun.tudou.com/*
// @version 1
// @grant none
// ==/UserScript==
window.getjubk = function(data) {
var d = new Array();
d[0] = $(data).parent().parent().find(".name").html();
d[1] = location.href;
d[2] = 2;
d[3] = $(data).parent().find(".xrze").val();
d[4] = $(data).parent().parent().find(".index-comment").html();
d[5] = $.parseSafe($(data).parent().parent().find(".content-comment").html());
d[6] = 'acyw';
d[7] = getNum($(data).parent().parent().attr("id"));
console.log(d);
$.post("/report.aspx", {
defendantUsername: d[0],
url: d[1],
type: d[2],
crime: d[3],
description: d[4]+'楼,评论内容违规。',
proof: d[5],
captcha: d[6],
objectId: d[7]
}).done(function(t) {
//return t.success ? console.log("success") : console.log("fail")
if(t.success){
$(data).parent().parent().find(".jubk_su").fadeIn();
setTimeout(function(){
$(data).parent().parent().find(".jubk_su").fadeOut();
},3000);
}
else{
$(data).parent().parent().find(".jubk_fa").fadeIn();
setTimeout(function(){
$(data).parent().parent().find(".jubk_fa").fadeOut();
},3000);
}
})
}
window.run = function(){
var str = "<div class='jubk'><select class='xrze'><option value='1'>色情</option><option value='2'>血腥</option><option value='3'>暴力</option>";
str += "<option value='4'>猎奇</option><option value='5'>政治</option>";
str += "<option value='6'>辱骂</option><option selected='selected' value='7'>广告</option><option value='8'>挖坟</option><option value='9'>其他</option></select>";
str += "<button class='jubk_this' onclick='getjubk(this)'>提交</button></div>";
str += "<div class='jubk_su'>举报成功</div><div class='jubk_fa'>举报失败</div>"
$(".item-comment").append(str);
$(".xrze").css({
"width": "60px",
"min-width": "60px",
"border-radius": "5px"
})
$(".jubk").css({
"position": "absolute",
"right": 0,
"bottom": "25px",
"opacity": 0.3
})
$(".jubk_su").css({
"position": "absolute",
"background-color": "#3a9bd9",
"right": 0,
"bottom": "55px",
"color": "#fff",
"padding": "2px",
"display":"none"
})
$(".jubk_fa").css({
"position": "absolute",
"background-color": "#ff3a35",
"right": 0,
"bottom": "55px",
"color": "#fff",
"padding": "2px",
"display": "none"
})
$(".jubk").hover(function() {
$(this).css("opacity", 1);
})
$(".jubk").mouseleave(function() {
$(this).css("opacity", 0.1);
})
}
window.getNum = function(text){
var value = text.replace(/[^0-9]/ig,"");
return value;
}
//setTimeout("run()",5000);
$("html body").animate({
scrollTop:0
})
$(window).scroll(function(){
if($(document).scrollTop()>200){
var obj = $(".jubk").html();
if(!obj){
run();
}
}
})