Old: v1.5.11 - 2015-03-19 - fixed senmanga, dm5 and mangajoy; implemented hitomi.la
New: v1.5.12 - 2015-03-19 - added doujin-moe.us and improved logic for lazy image loading (now takes into account image height instead of using a hard-coded value)
- @@ -1,7 +1,7 @@
- // ==UserScript==
- // @name Manga Loader
- // @namespace http://www.fuzetsu.com/MangaLoader
-// @version 1.5.11
- +// @version 1.5.12
- // @description Loads manga chapter into one page in a long strip format, supports switching chapters and works for a variety of sites, minimal script with no dependencies, easy to implement new sites
- // @copyright 2014+, fuzetsu
- // @noframes
- @@ -45,6 +45,7 @@
- // @match http://www.dmzj.com/view/*/*
- // @match http://mangaindo.co/*/*
- // @match *://hitomi.la/reader/*
- +// @match http://www.doujin-moe.us/*
- // ==/UserScript==
-
- // set to true for manga load without prompt
- @@ -515,6 +516,25 @@
- pages: function(url, num, cb, ex) {
- cb(W.images[num - 1].path, num);
- }
- +}, { // doujin-moe
- + _pages: null,
- + match: "http://www.doujin-moe.us/.+",
- + img: 'img.picture',
- + next: 'img.picture',
- + numpages: function() {
- + if(!this._pages) {
- + this._pages = getEls('#gallery djm').map(function(file) {
- + return file.getAttribute('file');
- + });
- + }
- + return this._pages.length;
- + },
- + curpage: function() {
- + return parseInt(getEl('.counter').textContent.match(/^[0-9]+/)[0]);
- + },
- + pages: function(url, num, cb, ex) {
- + cb(this._pages[num - 1], num);
- + }
- }];
-
- var log = function(msg, type) {
- @@ -910,8 +930,11 @@
- if (mLoadLess) {
- window.addEventListener('scroll', throttle(function(e) {
- if (!resumeUrl) return; // exit early if we don't have a position to resume at
- + if(!UI.imageHeight) {
- + UI.imageHeight = getEl('.ml-images img').clientHeight;
- + }
- var scrollBottom = document.body.scrollHeight - ((document.body.scrollTop || document.documentElement.scrollTop) + window.innerHeight);
- if (scrollBottom < 4500) {
- + if (scrollBottom < UI.imageHeight * 2) {
- log('user scroll nearing end, loading more images starting from ' + resumeUrl);
- loadNextPage(resumeUrl);
- }