Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name name
- // @namespace name@aklim007
- // @include http://torrents.local/*
- // ==/UserScript==
- (function(){
- var aWind = (typeof unsafeWindow != 'undefined')? unsafeWindow: window;
- //проверка для хрома, чтоб скрипт не обрабатывался на сторонних страницах
- String.prototype.bool = function() {
- return (/^true$/i).test(this);
- };
- if(aWind.console){
- var Log = aWind.console.log;
- }else var Log = alert;
- $ = unsafeWindow.jQuery;
- //добавляем кнопки на страницу
- $('img[src $="/post.gif"]').parent().parent().after('<td><input type="button" value="" class="bSellNoTorrent" >'
- +'<input type="button" value="" class="bSellDelete" ></td>');
- //названия кнопок
- var valNoT = "Sel. No T-file";
- var valX = "Sel. X";
- //кнопки
- var bNoT = $('.bSellNoTorrent');
- var bX = $('.bSellDelete');
- //прописываем названия
- bNoT.val( valNoT );
- bX.val( valX );
- //навешиваем события на кнопки
- bNoT.click(function (){
- var row = $('#forum-table tr:has(".torTopic")');
- var count = 0;
- row.each(function(indx, elem){
- if($(elem).find('.torTopic a b').length == 0 && $(elem).find('.torTopic').parent().next().children().length == 0) {
- $(elem).find('.topic-chbox').attr('checked','true');
- $(elem).addClass("hl-selected-topic");
- count++;
- }
- });
- bNoT.val( valNoT + " (" + count + ")");
- });
- bX.click(function (){
- var row = $('#forum-table tr:has(".torTopic")');
- var count = 0;
- row.each(function(indx, elem){
- if($(elem).find('.torTopic b span').html() == "x" ) {
- $(elem).find('.topic-chbox').attr('checked','true');
- $(elem).addClass("hl-selected-topic");
- count++;
- }
- });
- bX.val( valX + " (" + count + ")");
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment