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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to get.py.

    83     83                   return False,None
    84     84   
    85     85               # Here's your chapter
    86     86               nm = book.titles[0] if book.titles else parts[-2]
    87     87               head = "%s chapter %d" % (nm, chapnum)
    88     88               buf = self.build_header(head)
    89     89               buf += '<script src="/js/reader.js"></script>\n'
           90  +            if chapnum > 0:
           91  +                buf += '<a href="%d">Previous Chapter</a>\n' % \
           92  +                 (chapnum-1,)
    90     93               buf += '<div id="textview"\n'
    91     94               buf += '  style="color: white; background: black; width: 100%;">\n'
    92     95               buf += chap.read()
    93     96               buf += '</div>\n'
           97  +            if chapnum < len(book.chapters)-1:
           98  +                buf += '<a href="%d">Next Chapter</a>\n' % \
           99  +                 (chapnum+1,)
    94    100               doc.close()
    95    101               buf += '<script>reading("%s", "%s", "%s");</script>\n' % \
    96    102                   (self.user, docpath, "textview")
    97    103               buf = self.build_tailer(buf)
    98    104   
    99    105               return True,self.send_result(buf, "text/html")
   100    106