Your comments
Cool, thanks for info. I'll give it a shot based on the github code.
Hey Jace,
Nice work on the count feature. I couldn't get the info to render properly though based on the above code snippet. Kept getting parsing errors around the modified_thumb_content code, and my javascript skills aren't very good (ok, my javascript is crap, I'm a data warehouse developer). I wasn't able to get it to work properly on my system.
However, I was able to hack together your counting code with the original to provide a less fancy version that gives a little more info than lostndessence's original. No progress bar, but a page x of y and completed status text.

Here's the hacked together code if anyone's interested:
// Anonymous "self-invoking" function
(function() {
var startingTime = new Date().getTime();
// Load the script
var script = document.createElement("SCRIPT");
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js';
script.type = 'text/javascript';
document.getElementsByTagName("head")[0].appendChild(script);
// Poll for jQuery to come into existance
var checkReady = function(callback) {
if (window.jQuery) {
callback(jQuery);
} else {
window.setTimeout(function() { checkReady(callback); }, 20);
}
};
// Start polling...
checkReady(function($) {
//////////////////////////////////
//Add currently reading condition to comic
//////////////////////////////////
$('.thumb a img').each(function(){
raw_src = $(this).attr('src')
page_num = '0';
//sort comics from folders
if (raw_src.search("folder") >= 0){
//console.log("raw_src: "+raw_src);
} else {
//extract Comic ID
thing = $(this);
src = $(this).attr('src'); //console.log("source: "+src);
$(this).closest('.thumb').append('<div class="numberblock"><div class="number"><span></span></div></div>');
var comicid = src.split('/'); //console.log("Comic ID: "+comicid[2]);
//get comic meta from server
json_url = window.location.origin+"/user-api/bookmark?docId="+comicid[2]; //console.log("url: "+json_url);
$.getJSON( json_url, function() {
console.log( "json_url success" );
}).done(function( data ) {
current_this = thing;
if (data != null){
var items = [];
var c_id = '';
var c_pages = '';
var page_num = '';
$.each( data, function( key, val ) {
if (key == 'docId'){c_id = val;}
if (key == 'mark'){page_num = val;}
});
if (page_num != '0'){
// get total pages from server
content_url = window.location.origin+"/comicdetails/"+c_id; //console.log("url: "+content_url);
$.get( content_url, function() {
//console.log( "content_url success" );
}).done(function( data ) {
details = $('<details>').append($.parseHTML(data));
size_div = $('#details_size', details).html();
c_pages = size_div.match(/\d+/)[0];
if (page_num >= (c_pages-1)) {
progress_percent = 100;
progress_string = "Completed";
} else {
progress_percent = ((page_num/c_pages) * 100);
page_int = Number(page_num)+1;
progress_string = (page_int++) + " of " + c_pages;
}
$("img[src*='"+c_id+"']").closest('.thumb').find('.number').html(progress_string);
$("img[src*='"+c_id+"']").closest('.thumb').find('.numberblock').addClass("reading");
});
}
console.log("page_num "+page_num);
}
}).fail(function(){});
}
console.log("triggered");
});
});
})();
// end Anonymous "self-invoking" function</details>Love the reading tag, nice work! Any updates on whether completed or a progress bar will be possible?
Thx!
Customer support service by UserEcho
I'd love to see this in Comixology V2 as well! Not having a working page count is the main reason I haven't switched over, and it seems like most of the enhancement work is going into that theme.
Working great for me in Chrome and on a kiosk browser app I use for Android (works well as a full-screen web based reader). Can confirm the issue with Firefox.
At first glance I wasn't too sure about the unread on each book as it made it a bit busy. But having the page count for trades and collections is really helpful. Appreciate the work!