Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P4289
(An Untitled Masterwork)
Active
Public
Actions
Authored by
Ladsgroup
on Oct 23 2016, 8:53 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
MediaWiki-extensions-ORES
Referenced Files
F4645635:
Oct 23 2016, 8:53 AM
2016-10-23 08:53:09 (UTC+0)
Subscribers
None
/**
* Created by amir on 10/23/16.
*/
(
function
(
mw
,
$
)
{
'use strict'
;
var
colors
=
{
0.40
:
'#750787'
,
0.50
:
'#004DFF'
,
0.60
:
'#008026'
,
0.70
:
'#FFED00'
,
0.80
:
'#FF8C00'
,
0.90
:
'#E40303'
}
$
(
'li'
).
each
(
function
(){
if
(
$
(
this
).
children
(
'a'
).
attr
(
'href'
)
)
{
var
reg
=
/diff=(\d+)/ig
var
res
=
reg
.
exec
(
$
(
this
).
children
(
'a'
).
attr
(
'href'
)
);
if
(
res
&&
res
[
1
]
in
mw
.
config
.
get
(
'oresData'
))
{
var
score
=
mw
.
config
.
get
(
'oresData'
)[
res
[
1
]][
'damaging'
];
var
threshold
=
0
;
for
(
threshold
in
colors
)
{
if
(
score
>
threshold
)
{
$
(
this
).
css
(
'background-color'
,
colors
[
threshold
]);
}
}
}
}
}
)
}(
mediaWiki
,
jQuery
)
);
Event Timeline
Ladsgroup
created this paste.
Oct 23 2016, 8:53 AM
2016-10-23 08:53:09 (UTC+0)
Ladsgroup
mentioned this in
T144922: Visually report damaging confidence
.
Oct 23 2016, 8:56 AM
2016-10-23 08:56:31 (UTC+0)
Log In to Comment