[1.2] Fix the order by number of comment

This commit is contained in:
vermillion-dev committed 2019-05-30 23:34:14 +02:00
1 parent c87c36f4b3
commit 527500a438
3 files changed
+11 -7

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
var commentaryWrongLink = $('a:contains(Comm.)')[0];
var hrefArray = commentaryWrongLink.href.split('&');
var searchArray = document.location.search.split('&');
if (searchArray.includes('order=desc') && searchArray.includes('sort=comment')) {
hrefArray[hrefArray.length - 2] = 'order=asc';
}
hrefArray[hrefArray.length - 1] = 'sort=comment';
commentaryWrongLink.href = hrefArray.join('&');
+2 -7
View File
@@ -1,10 +1,5 @@
var path = window.location.toString();
var args = path.split('&');
if (args[args.length -1] === 'do=search') {
window.location.replace(path + '&order=desc&sort=publish_date');
}
else {
var table = document.getElementsByTagName('tbody')[1];
/* Inject scripts don't forget to add them to web_accessible_resources in manifest */
injectScript(chrome.extension.getURL('contentScripts/search/accessSearch.js'), 'head');
function addDlButton(idx, torrentId, yggToken) {
var cell = table.rows[idx].cells[2];