Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ytzong committed May 8, 2015
1 parent d1d300c commit a753237
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions btkitty-magnet-to-torrent.user.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// ==UserScript==
// @name BTKitty Magnet to Torrent
// @namespace http://twitter.com//ytzong
// @version 0.3
// @version 0.4
// @description BTKitty Magnet to Torrent
// @author ytzong
// @match http://btkitty.org/t/*
// @match http://btkitty.org/search/*
// @match http://btkitty.org/*
// @match http://storebt.com/torrent/*
// @grant none
// @grant GM_addStyle
// ==/UserScript==

GM_addStyle('.list-box .list dl:nth-child(1), .topbar{display: none !important} .midbox .search .searchBox .kwd input {margin-top:0 !important;font-size:20px !important;padding:9px 1% !important}');

function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "//ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.3.min.js");
Expand All @@ -25,8 +26,10 @@ function main() {
window.location.href = $('.down a').attr('href');
}
else {
$('#kwd').focus();

var sort = $('.search-option a:nth-last-child(2)');
if (sort && sort.attr('class') != 'active') {
if (sort.length > 0 && sort.attr('class') != 'active') {
window.location.href = sort.attr('href');
}
$('.detail a').each(function(){
Expand All @@ -36,4 +39,4 @@ function main() {
})
}
}
addJQuery(window.setTimeout(main, 300));
addJQuery(window.setTimeout(main, 500));

0 comments on commit a753237

Please sign in to comment.