Skip to content

Instantly share code, notes, and snippets.

@yukixz
Created August 5, 2013 12:47
Show Gist options
  • Save yukixz/6155666 to your computer and use it in GitHub Desktop.
Save yukixz/6155666 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name 修改 Bangumi 绿标
// @description 修改当日放送为绿标、去除默认绿标
// @namespace http://dazzyd.org/
// @version 0.2
// @include http://bangumi.tv/
// @include http://bgm.tv/
// @include http://chii.in/
// @run-at document-end
// ==/UserScript==
// http://stackoverflow.com/questions/6617361/are-chrome-user-scripts-separated-from-the-global-namespace-like-greasemonkey-sc
var today = new Date();
var yyyy = today.getFullYear();
var mm = today.getMonth()+1; if(mm<10) {mm='0'+mm};
var dd = today.getDate(); if(dd<10) {dd='0'+dd};
today = yyyy+'-'+mm+'-'+dd;
$('a.load-epinfo.epBtnToday')
.removeClass('epBtnToday').addClass('epBtnNA');
$('ul#prgSubjectList').find('li.clearit.onAir')
.removeClass('onAir');
$('span.rr.onAir')
.remove();
sub = $('#prgSubjectList').find('.clearit');
$('a.load-epinfo.epBtnAir').each(function() {
if ( $($(this).attr('rel')).text().indexOf(today) > -1) {
$(this).removeClass('epBtnAir').addClass('epBtnToday');
sid = $(this).attr('subject_id');
sub.each(function() {
if ($(this).find('.gridThumb').attr('subject_id') == sid)
$(this).addClass('onAir');
});
$('#subjectPanel_'+sid).find('.header')
.prepend('<span class="onAir rr">放送中</span>');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment