Last active
January 3, 2016 20:29
-
-
Save mescoda/8515624 to your computer and use it in GitHub Desktop.
auto select for hold.baidu.com
This file contains hidden or 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 bdhold-autoselect | |
// @namespace bdhold-autoselect | |
// @version 0.4 | |
// @reason add qiang-btn support | |
// @author mescoda on http://mescoda.com/ | |
// @description auto select for hold.baidu.com | |
// @include http://hold.baidu.com | |
// @include http://hold.baidu.com/* | |
// @grant GM_xmlhttpRequest | |
// ==/UserScript== | |
(function($) { | |
window._bdholdTimer = setInterval(function() { | |
$('.qiang-btn').trigger('click'); | |
$('.white-btn').trigger('click'); | |
$('#checkBox').attr('checked', 'true'); | |
$('#imgIpt').focus(); | |
// use bind insteadof on becauseof jquery-1.6.2 | |
$('#imgIpt').bind('keydown', function (e) { | |
// 13: enter | |
if (e.keyCode === 13) { | |
$Qiang.beforeSubmit(); | |
} | |
}); | |
}, 100); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment