-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
101 lines (100 loc) · 3.29 KB
/
index.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Epub Editor</title>
<style>
#drop_zone {
border: 5px solid blue;
width: 200px;
height: 100px;
}
</style>
</head>
<body>
<h1>Epub Editor</h1>
<table id="inputsTable">
<tr>
<td>
<div id="drop_zone">
<p>Drag epub file to this Drop Zone ...</p>
</div>
<input type="file" id="fileNameInput" />
</td>
<td><textarea id="mutatorScriptInput" rows="7" cols="70">// example: remove "chapter" from title of each chapter
// dom is the dom for each chapter
// return true if chapter modified, false if not changed
let title = dom.querySelector("h1");
let changed = (title != null);
if (changed) {
title.textContent = title.textContent.replace("Chapter", "");
}
return changed;
</textarea></td>
</tr>
</table>
<table id="controls" hidden="true">
<tr>
<td></td>
<td><button id="runScriptButton">Run script above to modify Epub</button></td>
</tr>
<tr>
<td></td>
<td><button id="checkForInvalidXhtmlButton">Check for Invalid XHTML</button></td>
</tr>
<tr>
<td></td>
<td><button id="checkForZeroSizeImagesButton">Check for Zero Size Images</button></td>
</tr>
<tr>
<td></td>
<td><button id="removeZeroSizeImagesButton">Remove Zero Size images</button></td>
</tr>
<tr>
<td></td>
<td><button id="removeAllImagesButton">Remove All Images (except cover)</button></td>
</tr>
<tr hidden="true">
<td></td>
<td><button id="listImagesButton">List Images in view order</button></td>
</tr>
<tr hidden="true">
<td>Watermark</td>
<td><textarea id="watermark" type="text" name="watermark" rows="6" cols="70"><a href="www.novelparadise.com">This EPUB was downloaded from www.novelparadise.com</a></textarea></td>
</tr>
<tr hidden="true">
<td></td>
<td><button id="watermarkButton">Apply Watermark</button></td>
</tr>
<tr>
<td></td>
<td><button id="extractImagesButton">Extract Images</button></td>
</tr>
<tr>
<td></td>
<td><button id="removeElementsButton">Delete elements matching CSS</button><input id="removeCssInput" type="text" value="div.m-thou.mb48"></td>
</tr>
<tr>
<td></td>
<td><button id="cleanChrysanthemumGardenButton">Clean ChrysanthemumGarden</button></td>
</tr>
<tr>
<td></td>
<td><button id="sanitizeButton">Sanitize XHTML</button></td>
</tr>
<tr>
<td></td>
<td><button id="convertTableToDivButton">Convert royalroad Table to Div (better tolino readability)</button></td>
</tr>
</table>
<div id="outputTarget">
<h4 id="listHeader"></h4>
<ol id="fileList">
</ol>
</div>
<script src="jszip.min.js"></script>
<script src="Epub.js"></script>
<script src="Sanitize.js"></script>
<script src="main.js"></script>
</body>
</html>