wepub

Check-in [3a8bcbbe3f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add next/prev chapter buttons
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:3a8bcbbe3f02aabf40f6efd2dd7dd00a4e881ebed625448969aecb8b580dff7c
User & Date: ajv-899-334-8894@vsta.org 2016-11-20 01:06:02
Context
2016-11-20
15:20
Make dir/file lists ordered check-in: d66eb4ae50 user: ajv-899-334-8894@vsta.org tags: master, trunk
01:06
Add next/prev chapter buttons check-in: 3a8bcbbe3f user: ajv-899-334-8894@vsta.org tags: master, trunk
01:05
Directly register w. account server, so we get a service directory. check-in: eb1051541a user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to get.py.

83
84
85
86
87
88
89



90
91
92
93



94
95
96
97
98
99
100
                return False,None

            # Here's your chapter
            nm = book.titles[0] if book.titles else parts[-2]
            head = "%s chapter %d" % (nm, chapnum)
            buf = self.build_header(head)
            buf += '<script src="/js/reader.js"></script>\n'



            buf += '<div id="textview"\n'
            buf += '  style="color: white; background: black; width: 100%;">\n'
            buf += chap.read()
            buf += '</div>\n'



            doc.close()
            buf += '<script>reading("%s", "%s", "%s");</script>\n' % \
                (self.user, docpath, "textview")
            buf = self.build_tailer(buf)

            return True,self.send_result(buf, "text/html")








>
>
>




>
>
>







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
                return False,None

            # Here's your chapter
            nm = book.titles[0] if book.titles else parts[-2]
            head = "%s chapter %d" % (nm, chapnum)
            buf = self.build_header(head)
            buf += '<script src="/js/reader.js"></script>\n'
            if chapnum > 0:
                buf += '<a href="%d">Previous Chapter</a>\n' % \
                 (chapnum-1,)
            buf += '<div id="textview"\n'
            buf += '  style="color: white; background: black; width: 100%;">\n'
            buf += chap.read()
            buf += '</div>\n'
            if chapnum < len(book.chapters)-1:
                buf += '<a href="%d">Next Chapter</a>\n' % \
                 (chapnum+1,)
            doc.close()
            buf += '<script>reading("%s", "%s", "%s");</script>\n' % \
                (self.user, docpath, "textview")
            buf = self.build_tailer(buf)

            return True,self.send_result(buf, "text/html")