Skip to content

Instantly share code, notes, and snippets.

@mescoda
Last active January 3, 2016 20:29
Show Gist options
  • Save mescoda/8515624 to your computer and use it in GitHub Desktop.
Save mescoda/8515624 to your computer and use it in GitHub Desktop.
auto select for hold.baidu.com
// ==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