1
0
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:
Lu Wang 2013-01-29 22:23:59 +08:00
parent 2f1c8170bf
commit 9efa67681b
3 changed files with 27 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# manifest # pdf2htmlEX manifest
# by WangLu # by WangLu
# 2012.09.12 # 2012.09.12
# #
@ -21,39 +21,53 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX"/> <meta name="generator" content="pdf2htmlEX"/>
""" """
# base CSS styles # base CSS styles
@base.css @base.css
# PDF specific CSS styles # PDF specific CSS styles
$css $css
# necessary Javascript codes # necessary Javascript codes
@jquery.js @jquery.js
@pdf2htmlEX.js @pdf2htmlEX.js
# entry point of pdf2htmlEX
""" """
<script type="text/javascript"> <script type="text/javascript">
new pdf2htmlEX.Viewer('pdf-main', 'pdf-outline'); new pdf2htmlEX.Viewer('pdf-main', 'pdf-outline');
</script> </script>
"""
"""
<title></title> <title></title>
</head> </head>
<body> <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 $outline
""" """
</div> </div>
"""
# The container of PDF pages
# check base.css for an example and requirements of its CSS styles
"""
<div id="pdf-main"> <div id="pdf-main">
""" """
# PDF pages
$pages $pages
""" """
</div> </div>
"""
"""
</body> </body>
</html> </html>
""" """

View File

@ -118,8 +118,8 @@ var pdf2htmlEX = (function(){
this.container = $('#'+this.container_id); this.container = $('#'+this.container_id);
// need a better design // need a better design
if(this.outline.children().length == 0) { if(this.outline.children().length > 0) {
this.outline.toggleClass('opened'); this.outline.addClass('opened');
} }
var new_pages = new Array(); var new_pages = new Array();

View File

@ -392,7 +392,9 @@ void HTMLRenderer::post_process()
continue; continue;
} }
if(line.empty() || line[0] == '#') if(line.empty()
|| (line.find_first_not_of(' ') == string::npos)
|| line[0] == '#')
continue; continue;