Skip to content

Commit

Permalink
First pass on selectors for cover and list view per gboudreau#141
Browse files Browse the repository at this point in the history
  • Loading branch information
ppslim committed May 19, 2016
1 parent 8831d6c commit 218d9b8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions scripts/content/newznab.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,22 @@
});
}

if ($('a.addSABnzbd').length == 0) {
// Cover view: For use in te Bootstrap theme
$('div.movcover').parent().parent().each(function() {
var $dr = $(this);
$("a.downloadnzb", $dr).each(function() {
var href = $(this).attr("href");
var insertLoc = $($(this).parent().parent().parent().parent().parent().children()[1]).children()[0]
$(insertLoc).before('<div class="icon"><a class="addSABnzbd" href="' + href + '">' + oneClickImgTag + '</a></div>')
});
$dr.find('a.addSABnzbd').on('click', function() {
addOne($(this).closest('div'));
return false;
});
});
}

if ($('a.addSABnzbd').length == 0) {
// List view: Loop through all the td.check items and add a one-click link next the nearby title
$('td.check').each(function() {
Expand All @@ -76,6 +92,19 @@
});
}

if ($('a.addSABnzbd').length == 0) {
// List view: For use in te Bootstrap theme
$('div.data-row').each(function() {
var $dr = $(this);
var href = $dr.find('a.downloadnzb').attr('href')
$dr.find('a.title').parent().prepend('<a class="addSABnzbd" href="' + href + '">' + oneClickImgTag + '</a>');
$dr.find('a.addSABnzbd').on('click', function() {
addOne($dr);
return false;
});
});
}

if ($('a.addSABnzbd').length == 0) {
// Details view (etc.)
$('div.icon_nzb').each(function() {
Expand Down

0 comments on commit 218d9b8

Please sign in to comment.