-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathamanteanime.js
108 lines (108 loc) · 3.5 KB
/
amanteanime.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
var amanteanime = {
mirrorName : "amanteanime",
canListFullMangas : false,
mirrorIcon : "img/amanteanime.png",
languages : "en,es",
isMe : function (url) {
return (url.indexOf("online.amanteanime.net") != -1);
},
getMangaList : function (search, callback) {
$.ajax({
url : "http://online.amanteanime.net/reader/search/",
type : 'POST',
data : {
'search' : search
},
beforeSend : function (xhr) {
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.setRequestHeader("Pragma", "no-cache");
},
success : function (objResponse) {
var div = document.createElement("div");
div.innerHTML = objResponse;
var res = [];
$('.list > .group > .title > a', div).each(function (index) {
res[res.length] = [$(this).attr('title'), $(this).attr('href')];
});
callback("amanteanime", res);
}
});
},
getListChaps : function (urlManga, mangaName, obj, callback) {
$.ajax({
url : urlManga,
beforeSend : function (xhr) {
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.setRequestHeader("Pragma", "no-cache");
},
success : function (objResponse) {
var div = document.createElement("div");
div.innerHTML = objResponse;
var res = [];
$('.list > .element > .title > a', div).each(function (index) {
res[res.length] = [$(this).attr('title'), $(this).attr('href')];
});
callback(res, obj);
}
});
},
getInformationsFromCurrentPage : function (doc, curUrl, callback) {
var name = $('.tbtitle div a', doc)[0].title;
var currentChapter = $('.tbtitle div a', doc)[1].text;
var currentMangaURL = $('.tbtitle div a', doc)[0].href;
var currentChapterURL = $('.tbtitle div a', doc)[1].href;
callback({
"name" : name,
"currentChapter" : currentChapter,
"currentMangaURL" : currentMangaURL,
"currentChapterURL" : currentChapterURL
});
},
removeBanners : function(doc, curUrl) {
},
isCurrentPageAChapterPage : function (doc, curUrl) {
return (curUrl.search('online.amanteanime.net/reader/read/') > -1);
},
getListImages : function(doc, curUrl) {
return null;
},
doSomethingBeforeWritingScans : function (doc, curUrl) {
$("#page", doc).before($("<div class='navAMR'></div>"));
$("#page", doc).after($("<div class='navAMR'></div>"));
$(".navAMR").css("text-align", "center");
},
whereDoIWriteScans : function(doc, curUrl) {
return null;
},
whereDoIWriteNavigation : function (doc, curUrl) {
return $(".navAMR", doc);
},
nextChapterUrl : function (select, doc, curUrl) {
if ($(select).children("option:selected").prev().size() != 0) {
return $(select).children("option:selected").prev().val();
}
return null;
},
whereDoIWriteScans : function(doc, curUrl) {
return $('#page', doc);
},
getImageFromPageAndWrite : function(urlImg, image, doc, curUrl) {
$(image).attr("src", urlImg);
},
isImageInOneCol : function(img, doc, curUrl) {
return false;
},
previousChapterUrl : function (select, doc, curUrl) {
if ($(select).children("option:selected").next().size() != 0) {
return $(select).children("option:selected").next().val();
}
return null;
},
getMangaSelectFromPage : function (doc, curUrl) {
return null;
},
}
// Call registerMangaObject to be known by includer
if (typeof registerMangaObject == 'function') {
registerMangaObject("amanteanime", amanteanime);
}