Created
May 3, 2015 12:24
-
-
Save sorz/7b594aafb24ce6628ed3 to your computer and use it in GitHub Desktop.
Apply correct Chinese name on AcFun.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 缺B乐 | |
// @namespace org.sorz.lab.queble | |
// @include http://www.acfun.tv/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
String.prototype.correct = function () { | |
return this.toString() | |
.replace(/AcFun/gi, '缺B乐') | |
.replace(/\bAC\b/g, '缺B'); | |
} | |
function correctText() { | |
var $this = $(this); | |
$this.text($this.text().correct()); | |
} | |
$(document).ready(function () { | |
document.title = document.title.correct(); | |
$('.title').each(correctText); | |
$('a.tag').each(correctText); | |
$('h1').each(correctText); | |
$('h2').each(correctText); | |
$('#footer-inner').find('a').each(correctText); | |
$('.bottom-footer').find('p').each(correctText); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment