Skip to content

Instantly share code, notes, and snippets.

@h2ero
Last active April 13, 2017 02:39
Show Gist options
  • Save h2ero/1586123a0dcdf17550f7964444a23be0 to your computer and use it in GitHub Desktop.
Save h2ero/1586123a0dcdf17550f7964444a23be0 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name light
// @namespace blog.h2ero.cn
// @include https://www.hi-pda.com/*
// @version 1
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
// @grant none
// ==/UserScript==
var m = function (f) {
return f.toString().split('\n').slice(1, - 1).join('\n');
}
loadCss = function () {
var style = document.createElement('style');
style.type = 'text/css';
style.textContent = m(function () { /*
.postauthor .avatar,.postauthor .profile, .postbottom {
display:none;
}
.t_msgfontfix {
min-height:0px !important;
}
body{
margin: 0 auto;
width: 960px;
}
.wrap, #nav{
width:100%;
}
a:visited{
color:#aaa;
}
*/
});
var head = document.querySelector('head')
head.appendChild(style);
};
loadCss();
$(function () {
$('.threadlist tr').each(function () {
var num = parseInt($('.nums strong', this).text());
if (num > 20) {
$(this).css('background', '#FFEBEB')
}
if (num > 50) {
$(this).css('background', '#FFCDCD')
}
if (num > 100) {
$(this).css('background', '#FBAAAA')
}
$(this).attr('target', '_blank');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment