-
-
Save gloomy/c2cda4f03f51d825bf1f to your computer and use it in GitHub Desktop.
This file contains 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
appAPI.ready(function($){ | |
appAPI.contextMenu.add( | |
"clean_ignore", | |
"Clear Traders.LT ignore list", | |
function(data){ | |
appAPI.db.remove('forum_ignore_list'); | |
alert('Ignore list cleared, please reload the page.'); | |
}, | |
["all"] | |
); | |
}); |
This file contains 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
appAPI.ready(function($) { | |
if(!appAPI.isMatchPages("*.traders.lt/*")) return; | |
appAPI.resources.includeCSS('traders.css'); | |
// remove top ad blank space | request by la^ | |
$('#container').children().eq(8).remove(); | |
/* old code | |
var container = document.getElementById('container'); | |
var empty_div = container.children[8]; | |
container.removeChild(empty_div); | |
*/ | |
if(!appAPI.isMatchPages("*.traders.lt/forums.php*")) return; | |
var ignore_user_data = function(ignore_user_name){ | |
$('td.tit').each(function(){ | |
var row_element = $(this).find('a').first(); | |
var user_name = row_element.text(); | |
if(ignore_user_name == user_name){ | |
var row = row_element.parent().parent().parent().parent(); | |
$('table.cells').find('tr').each(function(){ | |
if($(this).html() == row.html()){ | |
next = $(this).next(); | |
next.remove(); | |
$(this).remove(); | |
} | |
}); | |
} | |
}); | |
} | |
forum_ignore_list = appAPI.db.get('forum_ignore_list'); | |
if(!forum_ignore_list){ | |
var forum_ignore_list = {}; | |
} | |
if(forum_ignore_list){ | |
$.each(forum_ignore_list, function(i, user_name){ | |
ignore_user_data(user_name); | |
}); | |
} | |
var add_username_to_db = function(user_name){ | |
forum_ignore_list = appAPI.db.get('forum_ignore_list'); | |
if(!forum_ignore_list){ | |
var forum_ignore_list = {user_name:user_name}; | |
}else{ | |
forum_ignore_list[user_name] = user_name; | |
} | |
appAPI.db.set('forum_ignore_list', forum_ignore_list); | |
} | |
$('td.tit').not('.small').each(function(){ | |
var user_part = $(this).find('a').first(); | |
var user_part_html = user_part.parent().html(); | |
var user_name = user_part.text(); | |
user_part.parent().html(user_part_html + ' (<a href="#" rel="' + user_name + '" class="plugin_ignore">i</a>)'); | |
}); | |
$('a.plugin_ignore').click(function(){ | |
var user_name = $(this).attr('rel'); | |
add_username_to_db(user_name); | |
ignore_user_data(user_name); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment