Skip to content

Instantly share code, notes, and snippets.

@micromaomao
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micromaomao/24b8e3f38efbf4af63e2 to your computer and use it in GitHub Desktop.
Save micromaomao/24b8e3f38efbf4af63e2 to your computer and use it in GitHub Desktop.
Baidu Online Input methods looks better
// ==UserScript==
// @name BaiduShurufa better look
// @match http://shurufa.baidu.com/online.html
// @grant none
// ==/UserScript==
(function(){
var tld = function(){
$('.header, .onl_cques, .online_c_split, .maincont, .up_cont-bottom, #footer, #feedback, .btn').remove();
$('#experience').css({margin: "0"});
$('.online_banner').children('div').css({width: ""});
$('.online_title').remove();
$('#oTarget, #onlinemain, .online_banner').css({width: "100%", height: "100%"});
$('#oTarget').css({height: ($(window).height() - 10) + "px"});
$('#oTarget').click();
$('body').css({overflow: "hidden"});
var ts = ' B A I D U O N L I N E I N P U T M E T H O D \n'+
'Redesigned by Wtm, Enjoy this simplify interface!\n'+
' Input text here:\n';
if($('#oTarget').val().substr(0, ts.length) != ts){
$('#oTarget').val(ts);
}
if($('#oTarget')[0].selectionStart < ts.length){
$('#oTarget')[0].selectionStart = ts.length;
}
requestAnimationFrame(tld);
};
requestAnimationFrame(tld);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment