Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
Apply containerWrap('arc') if breadcrumb has storyarc link
Browse files Browse the repository at this point in the history
  • Loading branch information
scooterpsu committed Mar 24, 2019
1 parent a9fab67 commit 30408df
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions comixology2/themeScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ loadScript(proxyPrefix+"/theme/js/jquery-3.3.1.min.js", function(){
}
}

/* Story Arc/Series page with json.cbr/json.epub */
if($('.cellcontainer .label:contains("json")').length){
var type;
if(window.location.href.indexOf("/comics/") != -1){
Expand All @@ -208,7 +209,7 @@ loadScript(proxyPrefix+"/theme/js/jquery-3.3.1.min.js", function(){
arcRunner(type);
}

/* Authors Page */
/* Authors page */
if(window.location.pathname== proxyPrefix+'/books/'+booksBaseID+'/'){
$('<div class="breadcrumb" id="cmx_breadcrumb"><a href="../">Books</a> &gt; <h2 class="hinline">Authors</h2></div>').insertBefore('#group');
$('<img id="publishers" src="'+proxyPrefix+'/theme/authors.jpg">').insertBefore('#group');
Expand Down Expand Up @@ -367,7 +368,6 @@ loadScript(proxyPrefix+"/theme/js/jquery-3.3.1.min.js", function(){
}
}
$('#group br').remove();

}

/* All pages */
Expand Down Expand Up @@ -491,12 +491,10 @@ loadScript(proxyPrefix+"/theme/js/jquery-3.3.1.min.js", function(){
$('#cmx_breadcrumb a:eq(0)').text('Books');
$('#cmx_breadcrumb a:eq(0)').attr('href', '/books/');
buildBreadcrumb(window.location.pathname);
containerWrap();
}else if(window.location.href.indexOf("/comics/") != -1){
$('#cmx_breadcrumb a:eq(0)').text('Comics');
$('#cmx_breadcrumb a:eq(0)').attr('href', '/comics/');
buildBreadcrumb(window.location.pathname);
containerWrap();
}
}
}else{
Expand Down Expand Up @@ -1274,14 +1272,19 @@ function buildBreadcrumb(pageURL,pageNum){
$('<div>').load(pageURL+" #arrowup", function(parentData){
var parentURL = $(parentData).find('#arrowup').attr('href');
if(parentURL == proxyPrefix+'/'){
if($('.breadcrumb a').length < 2){
if($('#cmx_breadcrumb a').length < 2){
if(booksBaseID&&(pageURL == proxyPrefix+'/books/'+booksBaseID+'/')){
$('.breadcrumb a:first-of-type').after(' > <a href="'+proxyPrefix+'/books/'+booksBaseID+'/">Authors</a> ');
$('#cmx_breadcrumb a:first-of-type').after(' > <a href="'+proxyPrefix+'/books/'+booksBaseID+'/">Authors</a> ');
}
if(comicsBaseID&&(pageURL == proxyPrefix+'/comics/'+comicsBaseID+'/')){
$('.breadcrumb a:first-of-type').after(' > <a href="'+proxyPrefix+'/comics/'+comicsBaseID+'/">Publishers</a> ');
$('#cmx_breadcrumb a:first-of-type').after(' > <a href="'+proxyPrefix+'/comics/'+comicsBaseID+'/">Publishers</a> ');
}
}
if($('#cmx_breadcrumb').find('a[href*="'+storyArcID+'"]').length){
containerWrap('arc');
}else{
containerWrap();
}
return true;
}
$('<div>').load($(parentData).find('#arrowup').attr('href')+"?index="+(pageNum * itemsPerPage)+' #group', function(parentPage){
Expand Down

0 comments on commit 30408df

Please sign in to comment.