PDF rausgenommen
This commit is contained in:
111
msd2/wordpress/wp-content/plugins/antispam-bee/js/dashboard.js
Normal file
111
msd2/wordpress/wp-content/plugins/antispam-bee/js/dashboard.js
Normal file
@ -0,0 +1,111 @@
|
||||
(function () {
|
||||
|
||||
// Grab the data
|
||||
var labels = [],
|
||||
data = [];
|
||||
jQuery("#ab_chart_data tfoot th").each(function () {
|
||||
labels.push(jQuery(this).text());
|
||||
});
|
||||
jQuery("#ab_chart_data tbody td").each(function () {
|
||||
data.push(jQuery(this).text());
|
||||
});
|
||||
|
||||
// Draw
|
||||
var width = jQuery('#ab_chart').parent().width() + 8,
|
||||
height = 140,
|
||||
leftgutter = 0,
|
||||
bottomgutter = 22,
|
||||
topgutter = 22,
|
||||
color = '#0073aa',
|
||||
r = Raphael("ab_chart", width, height),
|
||||
txt = {font: 'bold 12px "Open Sans", sans-serif', fill: "#32373c"},
|
||||
X = (width - leftgutter * 2) / labels.length,
|
||||
max = Math.max.apply(Math, data),
|
||||
Y = (height - bottomgutter - topgutter) / max;
|
||||
|
||||
// Max value
|
||||
r
|
||||
.text(16, 16, max)
|
||||
.attr(
|
||||
{
|
||||
'font': 'normal 10px "Open Sans", sans-serif',
|
||||
fill: "#b4b9be"
|
||||
}
|
||||
);
|
||||
|
||||
var path = r.path().attr({stroke: color, "stroke-width": 2, "stroke-linejoin": "round"}),
|
||||
bgp = r.path().attr({stroke: "none", opacity: .3, fill: color}),
|
||||
label = r.set(),
|
||||
lx = 0, ly = 0,
|
||||
is_label_visible = false,
|
||||
leave_timer,
|
||||
blanket = r.set();
|
||||
label.push(r.text(60, 12, "").attr(txt));
|
||||
label.push(r.text(60, 27, "").attr(txt).attr({fill: color}));
|
||||
label.hide();
|
||||
var frame = r.popup(100, 100, label, "right").attr({fill: "#fff", stroke: "#444", "stroke-width": 1}).hide();
|
||||
|
||||
var p, bgpp;
|
||||
for (var i = 0, ii = labels.length; i < ii; i++) {
|
||||
var y = Math.round(height - bottomgutter - Y * data[i]),
|
||||
x = Math.round(leftgutter + X * (i + .5));
|
||||
if (!i) {
|
||||
p = ["M", x, y, "C", x, y];
|
||||
bgpp = ["M", leftgutter + X * .5, height - bottomgutter, "L", x, y, "C", x, y];
|
||||
}
|
||||
if (i && i < ii - 1) {
|
||||
var Y0 = Math.round(height - bottomgutter - Y * data[i - 1]),
|
||||
X0 = Math.round(leftgutter + X * (i - .5)),
|
||||
Y2 = Math.round(height - bottomgutter - Y * data[i + 1]),
|
||||
X2 = Math.round(leftgutter + X * (i + 1.5));
|
||||
var a = getAnchors(X0, Y0, x, y, X2, Y2);
|
||||
p = p.concat([a.x1, a.y1, x, y, a.x2, a.y2]);
|
||||
bgpp = bgpp.concat([a.x1, a.y1, x, y, a.x2, a.y2]);
|
||||
}
|
||||
var dot = r.circle(x, y, 4).attr({fill: "#fff", stroke: color, "stroke-width": 1});
|
||||
blanket.push(r.rect(leftgutter + X * i, 0, X, height - bottomgutter).attr({stroke: "none", fill: '#fff', opacity: .2}));
|
||||
var rect = blanket[blanket.length - 1];
|
||||
(function (x, y, data, date, dot) {
|
||||
var timer, i = 0;
|
||||
rect.hover(function () {
|
||||
clearTimeout(leave_timer);
|
||||
var side = "right";
|
||||
if (x + frame.getBBox().width > width) {
|
||||
side = "left";
|
||||
}
|
||||
// set label content to determine correct dimensions
|
||||
label[0].attr({text: date });
|
||||
label[1].attr({text: data + "× Spam"});
|
||||
var ppp = r.popup(x, y, label, side, 1),
|
||||
anim = Raphael.animation({
|
||||
path: ppp.path,
|
||||
transform: ["t", ppp.dx, ppp.dy]
|
||||
}, 200 * is_label_visible);
|
||||
lx = label[0].transform()[0][1] + ppp.dx;
|
||||
ly = label[0].transform()[0][2] + ppp.dy;
|
||||
frame.show().stop().animate(anim);
|
||||
|
||||
label[0].show().stop().animateWith(frame, anim, {transform: ["t", lx, ly]}, 200 * is_label_visible);
|
||||
label[1].show().stop().animateWith(frame, anim, {transform: ["t", lx, ly]}, 200 * is_label_visible);
|
||||
dot.attr("r", 6);
|
||||
is_label_visible = true;
|
||||
}, function () {
|
||||
dot.attr("r", 4);
|
||||
leave_timer = setTimeout(function () {
|
||||
frame.hide();
|
||||
label[0].hide();
|
||||
label[1].hide();
|
||||
is_label_visible = false;
|
||||
}, 1);
|
||||
});
|
||||
})(x, y, data[i], labels[i], dot);
|
||||
}
|
||||
p = p.concat([x, y, x, y]);
|
||||
bgpp = bgpp.concat([x, y, x, y, "L", x, height - bottomgutter, "z"]);
|
||||
path.attr({path: p});
|
||||
bgp.attr({path: bgpp});
|
||||
frame.toFront();
|
||||
label[0].toFront();
|
||||
label[1].toFront();
|
||||
blanket.toFront();
|
||||
})();
|
5
msd2/wordpress/wp-content/plugins/antispam-bee/js/dashboard.min.js
vendored
Normal file
5
msd2/wordpress/wp-content/plugins/antispam-bee/js/dashboard.min.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
(function(){var labels=[],data=[];jQuery("#ab_chart_data tfoot th").each(function(){labels.push(jQuery(this).text())});jQuery("#ab_chart_data tbody td").each(function(){data.push(jQuery(this).text())});var width=jQuery('#ab_chart').parent().width()+8,height=140,leftgutter=0,bottomgutter=22,topgutter=22,color='#0073aa',r=Raphael("ab_chart",width,height),txt={font:'bold 12px "Open Sans", sans-serif',fill:"#32373c"},X=(width-leftgutter*2)/labels.length,max=Math.max.apply(Math,data),Y=(height-bottomgutter-topgutter)/max;r.text(16,16,max).attr({'font':'normal 10px "Open Sans", sans-serif',fill:"#b4b9be"});var path=r.path().attr({stroke:color,"stroke-width":2,"stroke-linejoin":"round"}),bgp=r.path().attr({stroke:"none",opacity:.3,fill:color}),label=r.set(),lx=0,ly=0,is_label_visible=!1,leave_timer,blanket=r.set();label.push(r.text(60,12,"").attr(txt));label.push(r.text(60,27,"").attr(txt).attr({fill:color}));label.hide();var frame=r.popup(100,100,label,"right").attr({fill:"#fff",stroke:"#444","stroke-width":1}).hide();var p,bgpp;for(var i=0,ii=labels.length;i<ii;i++){var y=Math.round(height-bottomgutter-Y*data[i]),x=Math.round(leftgutter+X*(i+.5));if(!i){p=["M",x,y,"C",x,y];bgpp=["M",leftgutter+X*.5,height-bottomgutter,"L",x,y,"C",x,y]}
|
||||
if(i&&i<ii-1){var Y0=Math.round(height-bottomgutter-Y*data[i-1]),X0=Math.round(leftgutter+X*(i-.5)),Y2=Math.round(height-bottomgutter-Y*data[i+1]),X2=Math.round(leftgutter+X*(i+1.5));var a=getAnchors(X0,Y0,x,y,X2,Y2);p=p.concat([a.x1,a.y1,x,y,a.x2,a.y2]);bgpp=bgpp.concat([a.x1,a.y1,x,y,a.x2,a.y2])}
|
||||
var dot=r.circle(x,y,4).attr({fill:"#fff",stroke:color,"stroke-width":1});blanket.push(r.rect(leftgutter+X*i,0,X,height-bottomgutter).attr({stroke:"none",fill:'#fff',opacity:.2}));var rect=blanket[blanket.length-1];(function(x,y,data,date,dot){var timer,i=0;rect.hover(function(){clearTimeout(leave_timer);var side="right";if(x+frame.getBBox().width>width){side="left"}
|
||||
label[0].attr({text:date});label[1].attr({text:data+"× Spam"});var ppp=r.popup(x,y,label,side,1),anim=Raphael.animation({path:ppp.path,transform:["t",ppp.dx,ppp.dy]},200*is_label_visible);lx=label[0].transform()[0][1]+ppp.dx;ly=label[0].transform()[0][2]+ppp.dy;frame.show().stop().animate(anim);label[0].show().stop().animateWith(frame,anim,{transform:["t",lx,ly]},200*is_label_visible);label[1].show().stop().animateWith(frame,anim,{transform:["t",lx,ly]},200*is_label_visible);dot.attr("r",6);is_label_visible=!0},function(){dot.attr("r",4);leave_timer=setTimeout(function(){frame.hide();label[0].hide();label[1].hide();is_label_visible=!1},1)})})(x,y,data[i],labels[i],dot)}
|
||||
p=p.concat([x,y,x,y]);bgpp=bgpp.concat([x,y,x,y,"L",x,height-bottomgutter,"z"]);path.attr({path:p});bgp.attr({path:bgpp});frame.toFront();label[0].toFront();label[1].toFront();blanket.toFront()})()
|
@ -0,0 +1,142 @@
|
||||
var tokenRegex = /\{([^\}]+)\}/g,
|
||||
objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,
|
||||
replacer = function (all, key, obj) {
|
||||
var res = obj;
|
||||
key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {
|
||||
name = name || quotedName;
|
||||
if (res) {
|
||||
if (name in res) {
|
||||
res = res[name];
|
||||
}
|
||||
typeof res == "function" && isFunc && (res = res());
|
||||
}
|
||||
});
|
||||
res = (res == null || res == obj ? all : res) + "";
|
||||
return res;
|
||||
},
|
||||
fill = function (str, obj) {
|
||||
return String(str).replace(tokenRegex, function (all, key) {
|
||||
return replacer(all, key, obj);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Raphael.fn.popup = function (X, Y, set, pos, ret) {
|
||||
pos = String(pos || "top-middle").split("-");
|
||||
pos[1] = pos[1] || "middle";
|
||||
var r = 5,
|
||||
bb = set.getBBox(),
|
||||
w = Math.round(bb.width),
|
||||
h = Math.round(bb.height),
|
||||
x = Math.round(bb.x) - r,
|
||||
y = Math.round(bb.y) - r,
|
||||
gap = Math.min(h / 2, w / 2, 10),
|
||||
shapes = {
|
||||
top: "M{x},{y}h{w4},{w4},{w4},{w4}a{r},{r},0,0,1,{r},{r}v{h4},{h4},{h4},{h4}a{r},{r},0,0,1,-{r},{r}l-{right},0-{gap},{gap}-{gap}-{gap}-{left},0a{r},{r},0,0,1-{r}-{r}v-{h4}-{h4}-{h4}-{h4}a{r},{r},0,0,1,{r}-{r}z",
|
||||
bottom: "M{x},{y}l{left},0,{gap}-{gap},{gap},{gap},{right},0a{r},{r},0,0,1,{r},{r}v{h4},{h4},{h4},{h4}a{r},{r},0,0,1,-{r},{r}h-{w4}-{w4}-{w4}-{w4}a{r},{r},0,0,1-{r}-{r}v-{h4}-{h4}-{h4}-{h4}a{r},{r},0,0,1,{r}-{r}z",
|
||||
right: "M{x},{y}h{w4},{w4},{w4},{w4}a{r},{r},0,0,1,{r},{r}v{h4},{h4},{h4},{h4}a{r},{r},0,0,1,-{r},{r}h-{w4}-{w4}-{w4}-{w4}a{r},{r},0,0,1-{r}-{r}l0-{bottom}-{gap}-{gap},{gap}-{gap},0-{top}a{r},{r},0,0,1,{r}-{r}z",
|
||||
left: "M{x},{y}h{w4},{w4},{w4},{w4}a{r},{r},0,0,1,{r},{r}l0,{top},{gap},{gap}-{gap},{gap},0,{bottom}a{r},{r},0,0,1,-{r},{r}h-{w4}-{w4}-{w4}-{w4}a{r},{r},0,0,1-{r}-{r}v-{h4}-{h4}-{h4}-{h4}a{r},{r},0,0,1,{r}-{r}z"
|
||||
},
|
||||
offset = {
|
||||
hx0: X - (x + r + w - gap * 2),
|
||||
hx1: X - (x + r + w / 2 - gap),
|
||||
hx2: X - (x + r + gap),
|
||||
vhy: Y - (y + r + h + r + gap),
|
||||
"^hy": Y - (y - gap)
|
||||
|
||||
},
|
||||
mask = [{
|
||||
x: x + r,
|
||||
y: y,
|
||||
w: w,
|
||||
w4: w / 4,
|
||||
h4: h / 4,
|
||||
right: 0,
|
||||
left: w - gap * 2,
|
||||
bottom: 0,
|
||||
top: h - gap * 2,
|
||||
r: r,
|
||||
h: h,
|
||||
gap: gap
|
||||
}, {
|
||||
x: x + r,
|
||||
y: y,
|
||||
w: w,
|
||||
w4: w / 4,
|
||||
h4: h / 4,
|
||||
left: w / 2 - gap,
|
||||
right: w / 2 - gap,
|
||||
top: h / 2 - gap,
|
||||
bottom: h / 2 - gap,
|
||||
r: r,
|
||||
h: h,
|
||||
gap: gap
|
||||
}, {
|
||||
x: x + r,
|
||||
y: y,
|
||||
w: w,
|
||||
w4: w / 4,
|
||||
h4: h / 4,
|
||||
left: 0,
|
||||
right: w - gap * 2,
|
||||
top: 0,
|
||||
bottom: h - gap * 2,
|
||||
r: r,
|
||||
h: h,
|
||||
gap: gap
|
||||
}][pos[1] == "middle" ? 1 : (pos[1] == "top" || pos[1] == "left") * 2];
|
||||
var dx = 0,
|
||||
dy = 0,
|
||||
out = this.path(fill(shapes[pos[0]], mask)).insertBefore(set);
|
||||
switch (pos[0]) {
|
||||
case "top":
|
||||
dx = X - (x + r + mask.left + gap);
|
||||
dy = Y - (y + r + h + r + gap);
|
||||
break;
|
||||
case "bottom":
|
||||
dx = X - (x + r + mask.left + gap);
|
||||
dy = Y - (y - gap);
|
||||
break;
|
||||
case "left":
|
||||
dx = X - (x + r + w + r + gap);
|
||||
dy = Y - (y + r + mask.top + gap);
|
||||
break;
|
||||
case "right":
|
||||
dx = X - (x - gap);
|
||||
dy = Y - (y + r + mask.top + gap);
|
||||
break;
|
||||
}
|
||||
out.translate(dx, dy);
|
||||
if (ret) {
|
||||
ret = out.attr("path");
|
||||
out.remove();
|
||||
return {
|
||||
path: ret,
|
||||
dx: dx,
|
||||
dy: dy
|
||||
};
|
||||
}
|
||||
set.translate(dx, dy);
|
||||
return out;
|
||||
};
|
||||
|
||||
|
||||
function getAnchors(p1x, p1y, p2x, p2y, p3x, p3y) {
|
||||
var l1 = (p2x - p1x) / 2,
|
||||
l2 = (p3x - p2x) / 2,
|
||||
a = Math.atan((p2x - p1x) / Math.abs(p2y - p1y)),
|
||||
b = Math.atan((p3x - p2x) / Math.abs(p2y - p3y));
|
||||
a = p1y < p2y ? Math.PI - a : a;
|
||||
b = p3y < p2y ? Math.PI - b : b;
|
||||
var alpha = Math.PI / 2 - ((a + b) % (Math.PI * 2)) / 2,
|
||||
dx1 = l1 * Math.sin(alpha + a),
|
||||
dy1 = l1 * Math.cos(alpha + a),
|
||||
dx2 = l2 * Math.sin(alpha + b),
|
||||
dy2 = l2 * Math.cos(alpha + b);
|
||||
return {
|
||||
x1: p2x - dx1,
|
||||
y1: p2y + dy1,
|
||||
x2: p2x + dx2,
|
||||
y2: p2y + dy2
|
||||
};
|
||||
}
|
5
msd2/wordpress/wp-content/plugins/antispam-bee/js/raphael.helper.min.js
vendored
Normal file
5
msd2/wordpress/wp-content/plugins/antispam-bee/js/raphael.helper.min.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
var tokenRegex=/\{([^\}]+)\}/g,objNotationRegex=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,replacer=function(c,h,g){var a=g;h.replace(objNotationRegex,function(c,b,f,d,g){b=b||d;a&&(b in a&&(a=a[b]),"function"==typeof a&&g&&(a=a()))});return a=(null==a||a==g?c:a)+""},fill=function(c,h){return String(c).replace(tokenRegex,function(c,a){return replacer(c,a,h)})};
|
||||
Raphael.fn.popup=function(c,h,g,a,k){a=String(a||"top-middle").split("-");a[1]=a[1]||"middle";var b=g.getBBox(),f=Math.round(b.width),d=Math.round(b.height),l=Math.round(b.x)-5,b=Math.round(b.y)-5,e=Math.min(d/2,f/2,10),p=[{x:l+5,y:b,w:f,w4:f/4,h4:d/4,right:0,left:f-2*e,bottom:0,top:d-2*e,r:5,h:d,gap:e},{x:l+5,y:b,w:f,w4:f/4,h4:d/4,left:f/2-e,right:f/2-e,top:d/2-e,bottom:d/2-e,r:5,h:d,gap:e},{x:l+5,y:b,w:f,w4:f/4,h4:d/4,left:0,right:f-2*e,top:0,bottom:d-2*e,r:5,h:d,gap:e}]["middle"==a[1]?1:2*("top"==
|
||||
a[1]||"left"==a[1])],m=0,n=0,q=this.path(fill({top:"M{x},{y}h{w4},{w4},{w4},{w4}a{r},{r},0,0,1,{r},{r}v{h4},{h4},{h4},{h4}a{r},{r},0,0,1,-{r},{r}l-{right},0-{gap},{gap}-{gap}-{gap}-{left},0a{r},{r},0,0,1-{r}-{r}v-{h4}-{h4}-{h4}-{h4}a{r},{r},0,0,1,{r}-{r}z",bottom:"M{x},{y}l{left},0,{gap}-{gap},{gap},{gap},{right},0a{r},{r},0,0,1,{r},{r}v{h4},{h4},{h4},{h4}a{r},{r},0,0,1,-{r},{r}h-{w4}-{w4}-{w4}-{w4}a{r},{r},0,0,1-{r}-{r}v-{h4}-{h4}-{h4}-{h4}a{r},{r},0,0,1,{r}-{r}z",right:"M{x},{y}h{w4},{w4},{w4},{w4}a{r},{r},0,0,1,{r},{r}v{h4},{h4},{h4},{h4}a{r},{r},0,0,1,-{r},{r}h-{w4}-{w4}-{w4}-{w4}a{r},{r},0,0,1-{r}-{r}l0-{bottom}-{gap}-{gap},{gap}-{gap},0-{top}a{r},{r},0,0,1,{r}-{r}z",
|
||||
left:"M{x},{y}h{w4},{w4},{w4},{w4}a{r},{r},0,0,1,{r},{r}l0,{top},{gap},{gap}-{gap},{gap},0,{bottom}a{r},{r},0,0,1,-{r},{r}h-{w4}-{w4}-{w4}-{w4}a{r},{r},0,0,1-{r}-{r}v-{h4}-{h4}-{h4}-{h4}a{r},{r},0,0,1,{r}-{r}z"}[a[0]],p)).insertBefore(g);switch(a[0]){case "top":m=c-(l+5+p.left+e);n=h-(b+5+d+5+e);break;case "bottom":m=c-(l+5+p.left+e);n=h-(b-e);break;case "left":m=c-(l+5+f+5+e);n=h-(b+5+p.top+e);break;case "right":m=c-(l-e),n=h-(b+5+p.top+e)}q.translate(m,n);if(k)return k=q.attr("path"),q.remove(),
|
||||
{path:k,dx:m,dy:n};g.translate(m,n);return q};function getAnchors(c,h,g,a,k,b){var f=(g-c)/2,d=(k-g)/2;c=Math.atan((g-c)/Math.abs(a-h));k=Math.atan((k-g)/Math.abs(a-b));c=h<a?Math.PI-c:c;k=b<a?Math.PI-k:k;b=Math.PI/2-(c+k)%(2*Math.PI)/2;h=f*Math.sin(b+c);f*=Math.cos(b+c);c=d*Math.sin(b+k);d*=Math.cos(b+k);return{x1:g-h,y1:a+f,x2:g+c,y2:a+d}};
|
3
msd2/wordpress/wp-content/plugins/antispam-bee/js/raphael.min.js
vendored
Normal file
3
msd2/wordpress/wp-content/plugins/antispam-bee/js/raphael.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
20
msd2/wordpress/wp-content/plugins/antispam-bee/js/scripts.js
Normal file
20
msd2/wordpress/wp-content/plugins/antispam-bee/js/scripts.js
Normal file
@ -0,0 +1,20 @@
|
||||
jQuery(document).ready(
|
||||
function($) {
|
||||
function ab_flag_spam() {
|
||||
var $$ = $('#ab_flag_spam'),
|
||||
nextAll = $$.parent('li').nextAll( '.ab_flag_spam_child' );
|
||||
|
||||
nextAll.css(
|
||||
'display',
|
||||
( $$.is(':checked') ? 'list-item' : 'none' )
|
||||
);
|
||||
}
|
||||
|
||||
$('#ab_flag_spam').on(
|
||||
'change',
|
||||
ab_flag_spam
|
||||
);
|
||||
|
||||
ab_flag_spam();
|
||||
}
|
||||
);
|
1
msd2/wordpress/wp-content/plugins/antispam-bee/js/scripts.min.js
vendored
Normal file
1
msd2/wordpress/wp-content/plugins/antispam-bee/js/scripts.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
jQuery(document).ready(function(a){function b(){var b=a("#ab_flag_spam"),c=b.parent("li").nextAll(".ab_flag_spam_child");c.css("display",b.is(":checked")?"list-item":"none")}a("#ab_flag_spam").on("change",b),b()});
|
Reference in New Issue
Block a user