mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
outline is closed by default, and will be opened by pdf2htmlEX.js if not empty
This commit is contained in:
parent
2f1c8170bf
commit
9efa67681b
@ -1,4 +1,4 @@
|
||||
# manifest
|
||||
# pdf2htmlEX manifest
|
||||
# by WangLu
|
||||
# 2012.09.12
|
||||
#
|
||||
@ -21,39 +21,53 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="generator" content="pdf2htmlEX"/>
|
||||
"""
|
||||
|
||||
# base CSS styles
|
||||
@base.css
|
||||
|
||||
# PDF specific CSS styles
|
||||
$css
|
||||
|
||||
# necessary Javascript codes
|
||||
@jquery.js
|
||||
@pdf2htmlEX.js
|
||||
|
||||
# entry point of pdf2htmlEX
|
||||
"""
|
||||
<script type="text/javascript">
|
||||
new pdf2htmlEX.Viewer('pdf-main', 'pdf-outline');
|
||||
</script>
|
||||
"""
|
||||
|
||||
"""
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="pdf-outline" class="opened">
|
||||
"""
|
||||
|
||||
# The container of outline
|
||||
# By default this is hidden, pdf2htmlEX.js will add the 'opened' class if it is not empty
|
||||
# You can add a class 'opened' here if you want it always opened or you don't use pdf2htmlEX.js
|
||||
# e.g.
|
||||
# <div id="pdf-outline" class="opened">
|
||||
"""
|
||||
<div id="pdf-outline">
|
||||
"""
|
||||
$outline
|
||||
|
||||
"""
|
||||
</div>
|
||||
"""
|
||||
|
||||
# The container of PDF pages
|
||||
# check base.css for an example and requirements of its CSS styles
|
||||
"""
|
||||
<div id="pdf-main">
|
||||
"""
|
||||
|
||||
# PDF pages
|
||||
$pages
|
||||
|
||||
"""
|
||||
</div>
|
||||
"""
|
||||
|
||||
|
||||
"""
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
@ -118,8 +118,8 @@ var pdf2htmlEX = (function(){
|
||||
this.container = $('#'+this.container_id);
|
||||
|
||||
// need a better design
|
||||
if(this.outline.children().length == 0) {
|
||||
this.outline.toggleClass('opened');
|
||||
if(this.outline.children().length > 0) {
|
||||
this.outline.addClass('opened');
|
||||
}
|
||||
|
||||
var new_pages = new Array();
|
||||
|
@ -392,7 +392,9 @@ void HTMLRenderer::post_process()
|
||||
continue;
|
||||
}
|
||||
|
||||
if(line.empty() || line[0] == '#')
|
||||
if(line.empty()
|
||||
|| (line.find_first_not_of(' ') == string::npos)
|
||||
|| line[0] == '#')
|
||||
continue;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user