Greasy Fork

Greasy Fork is available in English.

epubjsgood

放大calibre-web版epubjs阅读器的字体,增加进度显示

当前为 2020-11-26 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         epubjsgood
// @namespace    http://tampermonkey.net/
// @version      0.12
// @description  放大calibre-web版epubjs阅读器的字体,增加进度显示
// @author       You
// @match        http://140.238.41.74:8083/read/*
// @match        https://bbs.nga.cn/*
// @grant        none
// ==/UserScript==
(function () {
    'use strict';
    var that = reader.book;
    var rdt = reader.rendition;
    var chapter = $("#chapter-title")[0].innerText
    reader.rendition.themes.fontSize('1.3em')
        //console.log(reader.rendition.currentLocation())


    $(document).keydown(function (e) {
        // $("#chapter-title")[0].innerText;
        //alert($("#chapter-title")[0].innerText);
        //console.log(reader.rendition.currentLocation())
        var lct = reader.book.locations
        var currentLocation = reader.rendition.currentLocation();
        var progress = Math.floor(((lct.percentageFromCfi(currentLocation.start.cfi)).toFixed(5)) * 10000) / 100;
        $("#chapter-title")[0].innerText = chapter + '[' + progress + '%]'

    });

    $(document).mousedown(function (e) {
        // $("#chapter-title")[0].innerText;
        //alert($("#chapter-title")[0].innerText);
        //console.log(reader.rendition.currentLocation())
        var lct = reader.book.locations
        var currentLocation = reader.rendition.currentLocation();
        var progress = Math.floor(((lct.percentageFromCfi(currentLocation.start.cfi)).toFixed(5)) * 10000) / 100;
        $("#chapter-title")[0].innerText = chapter + '[' + progress + '%]'

    });

    $(document).ready(function () {
        that.ready.then(() => {
            return that.locations.generate()
        }).then(result => {
            //console.log(result.locations);
            var lct = reader.book.locations
            var currentLocation = reader.rendition.currentLocation();
            var progress = Math.floor(((lct.percentageFromCfi(currentLocation.start.cfi)).toFixed(5)) * 10000) / 100;
            $("#chapter-title")[0].innerText = chapter + '[' + progress + '%]'
        })
    });
})();