2016-06-20 08:28:28 +12:00
|
|
|
|
2016-06-28 09:19:01 +12:00
|
|
|
import FimFic2Epub from './FimFic2Epub'
|
2016-06-20 08:28:28 +12:00
|
|
|
|
2016-06-21 09:04:08 +12:00
|
|
|
const STORY_ID = document.location.pathname.match(/^\/story\/(\d*)/)[1]
|
2016-06-20 08:28:28 +12:00
|
|
|
|
2016-06-28 09:19:01 +12:00
|
|
|
const ffc = new FimFic2Epub(STORY_ID)
|
2016-06-20 08:28:28 +12:00
|
|
|
|
2016-06-28 09:19:01 +12:00
|
|
|
const epubButton = document.querySelector('.story_container ul.chapters li.bottom a[title="Download Story (.epub)"]')
|
2016-06-21 09:04:08 +12:00
|
|
|
|
|
|
|
if (epubButton) {
|
2016-06-21 18:39:26 +12:00
|
|
|
epubButton.addEventListener('click', function (e) {
|
|
|
|
e.preventDefault()
|
2016-06-28 09:19:01 +12:00
|
|
|
ffc.download()
|
2016-06-21 18:39:26 +12:00
|
|
|
}, false)
|
2016-06-21 09:04:08 +12:00
|
|
|
}
|