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

Commit

Permalink
Switch audiobook/filebrowser icons to pull from theme variant folders…
Browse files Browse the repository at this point in the history
…, and include 2 theme variants from elmerfdz
  • Loading branch information
scooterpsu committed Mar 27, 2019
1 parent 0081003 commit 16b4d91
Show file tree
Hide file tree
Showing 27 changed files with 848 additions and 30 deletions.
59 changes: 29 additions & 30 deletions comixology2/themeScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ loadScript(proxyPrefix+"/theme/js/jquery-3.3.1.min.js", function(){
$('head').append('<link rel="stylesheet" href="'+proxyPrefix+'/theme/comixology.css" type="text/css" />');

/* Theme variant load/store. */
var themeVariants = ['dark'];
var themeVariants = ['dark-a', 'dark-b'];
if(typeof themeVariant === "undefined"){
var themeVariant='default';
}
Expand Down Expand Up @@ -375,7 +375,6 @@ loadScript(proxyPrefix+"/theme/js/jquery-3.3.1.min.js", function(){
/*</ Books or Comics module >*/
/*< Files and Audiobooks module >*/
}else if(location.pathname.startsWith(proxyPrefix+'/files/')){

$('body').contents().wrapAll($('<div>', {
id: 'group'
}));
Expand Down Expand Up @@ -408,10 +407,6 @@ loadScript(proxyPrefix+"/theme/js/jquery-3.3.1.min.js", function(){
$('<div>').load(proxyPrefix+"/theme/templates/player.html #audiobooks", function(){
loadScript(proxyPrefix+"/theme/audiobook.js", function(){
loadScript(proxyPrefix+"/theme/js/jsmediatags.min.js", function(){
$('#sb img').attr('src',proxyPrefix+'/theme/filebrowser/rewind-symbol.png');
$('#pp img').attr('src',proxyPrefix+'/theme/filebrowser/pause-play-button.png');
$('#sf img').attr('src',proxyPrefix+'/theme/filebrowser/fast-forward-media-control-button.png');
$('#dl img').attr('src',proxyPrefix+'/theme/filebrowser/download-arrow.png');
$('#audioPlayer .controlButton').show();
$('#group').addClass('audiobook');
checkAudio();
Expand All @@ -438,24 +433,24 @@ loadScript(proxyPrefix+"/theme/js/jquery-3.3.1.min.js", function(){
$(this).parent().appendTo('#group');
if($(this).attr('href').match("/$")){
$(this).text($(this).text().replace('/', ''));
$(this).prepend('<img src="'+proxyPrefix+'/theme/filebrowser/black-folder.png">');
$(this).prepend('<img class="folder">');
}else if($(this).attr('href').match(".cbz$")||$(this).attr('href').match(".cbr$")){
$(this).prepend('<img src="'+proxyPrefix+'/theme/filebrowser/file-interface-symbol.png">');
$(this).prepend('<img class="cbz">');
}else if($(this).attr('href').match(".png$")||$(this).attr('href').match(".jpg$")||$(this).attr('href').match(".gif$")){
$(this).prepend('<img src="'+proxyPrefix+'/theme/filebrowser/file-interface-symbol.png">');
$(this).prepend('<img class="png">');
}else if($(this).attr('href').match(".htm$")||$(this).attr('href').match(".html$")||$(this).attr('href').match(".css$")){
$(this).prepend('<img src="'+proxyPrefix+'/theme/filebrowser/file-interface-symbol.png">');
$(this).prepend('<img class="htm">');
}else if($(this).attr('href').match(".pdf$")){
$(this).prepend('<img src="'+proxyPrefix+'/theme/filebrowser/file-interface-symbol.png">');
$(this).prepend('<img class="pdf">');
}else if($(this).attr('href').match(".epub$")){
$(this).prepend('<img src="'+proxyPrefix+'/theme/filebrowser/file-interface-symbol.png">');
$(this).prepend('<img class="epub">');
}else if($(this).attr('href').match("cvinfo$")){
$(this).prepend('<img src="'+proxyPrefix+'/theme/filebrowser/file-interface-symbol.png">');
$(this).prepend('<img class="cvinfo">');
}else{
$(this).prepend('<img src="'+proxyPrefix+'/theme/filebrowser/file-interface-symbol.png">');
$(this).prepend('<img class="genericFile">');
}
});
$('#group a img').first().attr("src",proxyPrefix+"/theme/filebrowser/black-open-folder-shape.png");
$('#group a img').first().removeClass().addClass('openFolder');
if(audiobookShare){
$('a[href="'+proxyPrefix+'/files/'+audiobookShare+'/"]').parent().remove();
}
Expand Down Expand Up @@ -856,26 +851,30 @@ function switchTheme(theme){
}
localStorage.setItem('UbooquityThemeVariant', theme);
themeVariant = theme;
var themePath = "";
if((theme != "")&&(theme != "default")){
themePath = 'themes/'+themeVariant+'/';
$('body').addClass(theme);
$('body').addClass('themed');
$('head').append('<link rel="stylesheet" title="themeVariant" href="'+proxyPrefix+'/theme/themes/'+theme+'/'+theme+'.css" type="text/css" />');
if(settingsJSON['isComicsProviderEnabled']&&!settingsJSON['isBooksProviderEnabled']){
$('.comixology-logo').css("background-image", "url('"+proxyPrefix+"/theme/themes/"+theme+"/Ubooquity-logo_1_comic.png')");
}else if(settingsJSON['isBooksProviderEnabled']&&!settingsJSON['isComicsProviderEnabled']){
$('.comixology-logo').css("background-image", "url('"+proxyPrefix+"/theme/themes/"+theme+"/Ubooquity-logo_1_ebook.png')");
}else{
$('.comixology-logo').css("background-image", "url('"+proxyPrefix+"/theme/themes/"+theme+"/Ubooquity-logo_1_comic_ebook.png')");
}
}
if(settingsJSON['isComicsProviderEnabled']&&!settingsJSON['isBooksProviderEnabled']){
$('.comixology-logo').css("background-image", "url('"+proxyPrefix+"/theme/"+themePath+"Ubooquity-logo_1_comic.png')");
}else if(settingsJSON['isBooksProviderEnabled']&&!settingsJSON['isComicsProviderEnabled']){
$('.comixology-logo').css("background-image", "url('"+proxyPrefix+"/theme/"+themePath+"Ubooquity-logo_1_ebook.png')");
}else{
if(settingsJSON['isComicsProviderEnabled']&&!settingsJSON['isBooksProviderEnabled']){
$('.comixology-logo').css("background-image", "url('"+proxyPrefix+"/theme/Ubooquity-logo_1_comic.png')");
}else if(settingsJSON['isBooksProviderEnabled']&&!settingsJSON['isComicsProviderEnabled']){
$('.comixology-logo').css("background-image", "url('"+proxyPrefix+"/theme/Ubooquity-logo_1_ebook.png')");
}else{
$('.comixology-logo').css("background-image", "url('"+proxyPrefix+"/theme/Ubooquity-logo_1_comic_ebook.png')");
}
$('.comixology-logo').css("background-image", "url('"+proxyPrefix+"/theme/"+themePath+"Ubooquity-logo_1_comic_ebook.png')");
}
/* Audiobook controls */
$('#sb img').attr('src',proxyPrefix+'/theme/'+themePath+'filebrowser/rewind-symbol.png');
$('#pp img').attr('src',proxyPrefix+'/theme/'+themePath+'filebrowser/pause-play-button.png');
$('#sf img').attr('src',proxyPrefix+'/theme/'+themePath+'filebrowser/fast-forward-media-control-button.png');
$('#dl img').attr('src',proxyPrefix+'/theme/'+themePath+'filebrowser/download-arrow.png');

/* Filebrowser icons */
$('.filePage .openFolder').attr('src', proxyPrefix+'/theme/'+themePath+'filebrowser/black-open-folder-shape.png');
$('.filePage .genericFile, .filePage .cbz, .filePage .png, .filePage .htm, .filePage .pdf, .filePage .epub, .filePage .cvinfo').attr('src', proxyPrefix+'/theme/'+themePath+'filebrowser/file-interface-symbol.png');
$('.filePage .folder').attr('src', proxyPrefix+'/theme/'+themePath+'filebrowser/black-folder.png');
}

function fixPaths(parent, attr, extraPath){
Expand Down Expand Up @@ -1779,7 +1778,7 @@ function rebuildBookDetails(rootPath, xmlhttp, whichPage){
});
}
var authors = $(whichPage+' #details_authors').text().split(' - ');
if((authors.length > 0)&&($(whichPage+' #details_authors').length)){
if((authors.length > 0)&&($(whichPage+' #details_authors').length)&&($(whichPage+' #details_authors').text().length)){
$(whichPage+' #column3 #container').append('<div class="credits"><dt>Written by</dt><h2 title="Written by">'+authors[0]+'</h2></div>');
}
if(authors.length > 1){
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added comixology2/themes/dark-a/arrow-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added comixology2/themes/dark-a/arrow-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 16b4d91

Please sign in to comment.