From 1f7d5a356661fffcae36a650f2fb3121c9d0c739 Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Thu, 2 May 2019 00:10:02 +0800 Subject: [PATCH] include www.biquge5200.cc --- scripts/MyNovelReader.user.js | 701 +++++++++++++++++----------------- 1 file changed, 351 insertions(+), 350 deletions(-) diff --git a/scripts/MyNovelReader.user.js b/scripts/MyNovelReader.user.js index cddab93d..19b21fb4 100755 --- a/scripts/MyNovelReader.user.js +++ b/scripts/MyNovelReader.user.js @@ -1,7 +1,7 @@ -/* This script build by rollup. */ -(function (Vue) { -'use strict'; - +/* This script build by rollup. */ +(function (Vue) { +'use strict'; + function __$styleInject ( css ) { if(!css) return ; @@ -13,10 +13,10 @@ function __$styleInject ( css ) { style.innerHTML = css; document.head.appendChild(style); return css; -} - -Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue; - +} + +Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue; + // ==UserScript== // @id mynovelreader@ywzhaiqi@gmail.com // @name My Novel Reader @@ -227,6 +227,7 @@ Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue; // @include *://www.biquge.tw/*_*/*.html // @include *://www.biquge.tv/*/*.html // @include *://www.biquge5200.com/*/*.html +// @include *://www.biquge5200.cc/*/*.html // @include *://www.biqugezw.com/*/*.html // @include *://www.bequgezw.com/*/*/*.html // @include *://www.biquzi.com/*_*/*.html @@ -435,8 +436,8 @@ Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue; // @exclude */Default.shtml // @run-at document-end -// ==/UserScript== - +// ==/UserScript== + // 其它设置 const config = { lang: 'zh-CN', @@ -451,8 +452,8 @@ const config = { xhr_time: 15 * 1000, download_delay: 0, // 毫秒。0 毫秒下载起点 vip 限时免费章节会被封 dumpContentMinLength: 3, // 检测重复内容的最小行数 -}; - +}; + var uiTrans = { "将小说网页文本转换为繁体。\n\n注意:内置的繁简转换表,只收录了简单的单字转换,启用本功能后,如有错误转换的情形,请利用脚本的自订字词取代规则来修正。\n例如:「千里之外」,会错误转换成「千里之外」,你可以加入规则「千里之外=千里之外」来自行修正。": "將小說網頁文字轉換為繁體。\n\n注意:內建的繁簡轉換表,只收錄了簡單的單字轉換,啟用本功能後,如有錯誤轉換的情形,請利用腳本的自訂字詞取代規則來修正。\n例如:「千里之外」,會錯誤轉換成「千裡之外」,你可以加入規則「千裡之外=千里之外」來自行修正。", "图片章节用夜间模式没法看,这个选项在启动时会自动切换到缺省皮肤": "圖片章節無法以夜間模式觀看,這個選項在啟動時會自動切換到預設佈景", @@ -542,8 +543,8 @@ if(!String.prototype.uiTrans){ }, enumerable: false }); -} - +} + // 参考 https://github.com/madrobby/zepto/blob/master/src/detect.js const ua = navigator.userAgent; @@ -553,8 +554,8 @@ const isFirefox = ua.match(/Firefox\/([\d.]+)/); const isChrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/); -const isWindows = /Win\d{2}|Windows/.test(platform); - +const isWindows = /Win\d{2}|Windows/.test(platform); + //------------------- 辅助函数 ---------------------------------------- var nullFn = function() {}; @@ -713,8 +714,8 @@ if (!String.prototype.includes) { */ jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return 0==b?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;return 0==b?c:1==(b/=e)?c+d:(g||(g=.3*e),hb?-.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c:.5*h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+d+c)},easeInBack:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){return void 0==f&&(f=1.70158),(b/=e/2)<1?d/2*b*b*(((f*=1.525)+1)*b-f)+c:d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:2/2.75>b?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:2.5/2.75>b?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(a,b,c,d,e){return e/2>b?.5*jQuery.easing.easeInBounce(a,2*b,0,d,e)+c:.5*jQuery.easing.easeOutBounce(a,2*b-e,0,d,e)+.5*d+c}}); -/* jshint ignore: end */ - +/* jshint ignore: end */ + // ===== 自定义站点规则 ===== const sites = [ @@ -2860,8 +2861,8 @@ const sites = [ } }, -]; - +]; + // ===== 小说拼音字、屏蔽字修复 ===== // 运行在未替换
之前,.* 可能会造成全部替换 const replace = { @@ -3169,8 +3170,8 @@ const replace = { '小biao砸': '小婊砸', '牛1b': '牛b', '微1博': '微博', '内1衣': '内衣', -}; - +}; + const replaceAll = [ // 长文字替换 // 排序代码:newArr = arr.sort((a, b) => { var diff = a.charCodeAt(1) - b.charCodeAt(1); if (diff == 0) return b.length - a.length; return diff; }) @@ -3297,8 +3298,8 @@ const replaceAll = [ '小說,.biquge5200.', /'ads_wz_txt;',|百度搜索|无弹窗小说网|更新快无弹窗纯文字|高品质更新|小说章节更新最快|\(百度搜.\)|全文字手打|“” 看|无.弹.窗.小.说.网|追书网|〖∷∷无弹窗∷纯文字∷ 〗/g, -]; - +]; + // import _ from 'underscore' // 单字替换,可能会误替换,所以需要特殊处理 @@ -3359,8 +3360,8 @@ function extendRule(replaceRule) { -// test() - +// test() + var CHAR_ALIAS = { '\\P': '[\\u2000-\\u2FFF\\u3004-\\u303F\\uFE00-\\uFF60\\uFFC0-\\uFFFF]', // 小说中添加的特殊符号 }; @@ -3450,11 +3451,11 @@ Rule.parseCustomReplaceRules = function(str) { rules[key] = value; }); return rules; -}; - +}; + // 内容需要 ajax 的 className -const READER_AJAX = "reader-ajax"; - +const READER_AJAX = "reader-ajax"; + const autoBookTitleSelector = Rule.bookTitleSelector; function autoGetBookTitle($doc) { @@ -3472,8 +3473,8 @@ function autoGetBookTitle($doc) { C.log('autoGetBookTitle', bookTitle); return bookTitle -} - +} + function getElemFontSize(_heading) { var fontSize = 0; var _heading_style = window.getComputedStyle(_heading, null); @@ -4392,14 +4393,14 @@ Parser.prototype = { return a.href; }, -}; - -var tpl_mainCss = "@font-face {\r\n font-family: 'FontAwesome';\r\n src: url('https://cdn.bootcss.com/font-awesome/4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');\r\n src: url('https://cdn.bootcss.com/font-awesome/4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.bootcss.com/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.bootcss.com/font-awesome/4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.bootcss.com/font-awesome/4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.bootcss.com/font-awesome/4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');\r\n font-weight: normal;\r\n font-style: normal;\r\n }\r\n\r\nbody > a { display:none !important; }\r\n.hidden {\r\n display: none;\r\n}\r\n.quiet-mode {\r\n display: none;\r\n}\r\nbody {\r\n background: #F3F2EE;\r\n color: #1F0909;\r\n padding: 0px;\r\n margin: 0px;\r\n font-family: \"Microsoft YaHei UI\", 微软雅黑, 新宋体, 宋体, arial;\r\n}\r\na { color: #065488; }\r\na:link { text-decoration: none; }\r\n\r\n#mynovelreader-content {\r\n width: {content_width};\r\n font-size: {font_size};\r\n font-family: {font_family};\r\n line-height: {text_line_height};\r\n margin-left:auto;\r\n margin-right:auto;\r\n padding-bottom: 15px;\r\n}\r\n#mynovelreader-content img{\r\n max-width: 100%;\r\n}\r\n\r\narticle {\r\n margin-top: 55px;\r\n word-wrap: break-word;\r\n}\r\n\r\narticle h1 {\r\n clear: both;\r\n line-height: 50px;\r\n font-size: {title_font_size};\r\n font-weight: normal;\r\n margin: 25px -20px;\r\n padding: 0 20px 10px;\r\n border-bottom: 1px solid rgba(0,0,0,.25);\r\n font-weight: normal;\r\n text-transform: none;\r\n}\r\n\r\narticle li {\r\n list-style: none;\r\n}\r\n\r\n.chapter-footer-nav {\r\n text-align:center;\r\n font-size:0.9em;\r\n margin:-10px 0px 30px 0px;\r\n}\r\n#loading {\r\n color: white;\r\n text-align: center;\r\n font: 12px \"微软雅黑\", \"宋体\", \"Times New Roman\", \"Verdana\";\r\n margin-top: 20px;\r\n margin-left: auto;\r\n margin-right: auto;\r\n width: 376px;\r\n height: 32px;\r\n line-height: 32px;\r\n border-radius: 20px;\r\n border: 1px solid #666;\r\n background-color: #333;\r\n}\r\n#loading img {\r\n vertical-align: middle;\r\n}\r\n#loading a {\r\n color: white;\r\n}\r\n#preferencesBtn{\r\n position: fixed;\r\n top: 10px;\r\n right: 10px;\r\n z-index: 1597;\r\n}\r\n\r\n#alert {\r\n position: fixed;\r\n z-index: 100;\r\n float: auto;\r\n width: auto;\r\n height: auto;\r\n top: 10px;\r\n left: 500px;\r\n background: rgba(215, 240, 253, 0.65);\r\n color: #2d7091;\r\n border: 1px solid rgba(45,112,145,0.3);\r\n border-radius: 4px;\r\n}\r\n#alert p {\r\n font-size: 15px;\r\n margin: 6px;\r\n}\r\n\r\n#message {\r\n position: fixed;\r\n z-index: 1010;\r\n width: auto;\r\n height: auto;\r\n top: 10px;\r\n left: 500px;\r\n\r\n padding: 8px 16px;\r\n border-radius: 4px;\r\n box-shadow: 0 2px 8px rgba(0,0,0,.2);\r\n background: #fff;\r\n display: inline-block;\r\n pointer-events: all;\r\n\r\n font-size: 12px;\r\n}\r\n#message .fa-spinner {\r\n font-size: 13px;\r\n margin-right: 4px;\r\n}\r\n#message p {\r\n margin: 0;\r\n}\r\n\r\nimg.blockImage {clear: both;float: none;display: block;margin-left: auto;margin-right: auto;}\r\n\r\n#menu-bar {\r\n border: solid rgba(0, 100, 255, .9);\r\n border-width: 3px 2px 3px 0px;\r\n position: fixed;\r\n left: 0px;\r\n top: 40%;\r\n height: 100px;\r\n width: 2px;\r\n z-index: 199;\r\n {menu-bar-hidden}\r\n}\r\n#menu-bar {\r\n top: 0px;\r\n height: 100%;\r\n width: 1px;\r\n background: transparent;\r\n border: none;\r\n}\r\n#menu {\r\n position: fixed;\r\n top: 0;\r\n bottom: 0;\r\n left: 0;\r\n z-index: 100;\r\n width: 270px;\r\n max-width: 100%;\r\n background: #333;\r\n overflow-y: auto;\r\n}\r\n#menu:after {\r\n content: \"\";\r\n display: block;\r\n position: absolute;\r\n top: 46px;\r\n bottom: 0;\r\n right: 0;\r\n width: 1px;\r\n background: rgba(0,0,0,0.6);\r\n box-shadow: 0 0 5px 2px rgba(0,0,0,0.6);\r\n}\r\n#header{\r\n color: #777;\r\n margin-top: 0;\r\n border-top: 1px solid rgba(0,0,0,0.3);\r\n background: #404040;\r\n box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);\r\n text-shadow: 0 1px 0 rgba(0,0,0,0.5);\r\n padding: 10px 12px;\r\n text-transform: uppercase;\r\n font-weight: bold;\r\n font-size: 20px;\r\n}\r\n#header a {\r\n color: #777777;\r\n}\r\n#divider {\r\n position: relative;\r\n z-index: 300;\r\n border-top: 1px solid rgba(255,255,255,0.01);\r\n border-bottom: 1px solid rgba(0,0,0,0.3);\r\n margin: 0;\r\n height: 4px;\r\n background: rgba(0,0,0,0.2);\r\n box-shadow: 0 1px 0 rgba(255,255,255,0.05), inset 0 1px 3px rgba(0,0,0,0.3);\r\n}\r\n#chapter-list {\r\n position: relative;\r\n bottom: 0;\r\n left: 0;\r\n right: 0;\r\n z-index: 200;\r\n margin: 0;\r\n padding: 0;\r\n cursor: pointer;\r\n list-style: none;\r\n overflow-y: auto;\r\n}\r\n.chapter {\r\n list-style: none;\r\n}\r\n.chapter:last-child {\r\n border-bottom: 1px solid rgba(0,0,0,0.3);\r\n box-shadow: 0 1px 0 rgba(255,255,255,0.05);\r\n}\r\n.chapter div {\r\n color: #ccc;\r\n font-size: 15px;\r\n padding: 8px 20px;\r\n border-top: 1px solid rgba(0,0,0,0.3);\r\n box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);\r\n text-shadow: 0 1px 0 rgba(0,0,0,0.5);\r\n display: block;\r\n text-decoration: none;\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n cursor: pointer;\r\n}\r\n.chapter div:before {\r\n content: \"\\f105\";\r\n width: 20px;\r\n margin-left: -10px;\r\n float: left;\r\n font-family: \"FontAwesome\" !important;\r\n text-align: center;\r\n}\r\n.chapter div:hover {\r\n background: #404040;\r\n color: #fff;\r\n outline: 0;\r\n}\r\n.chapter.active div {\r\n background: #1a1a1a;\r\n color: #fff;\r\n font-size: 16px;\r\n box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);\r\n}\r\n::-webkit-scrollbar {\r\n height: 9px !important;\r\n width: 9px !important;\r\n}\r\n::-webkit-scrollbar-thumb {\r\n background-color: #7D7D7D !important;\r\n border-radius: 3px !important;\r\n}\r\n::-webkit-scrollbar-track-piece {\r\n background-color: rgba(0,0,0,.25) !important;\r\n}\r\n"; - -var tpl_preferencesHTML = "
\n
\n \n \n \n \n
\n \n \n \n
\n
\n \n \n \n 反馈地址\n
\n
\n \n \n
\n
\n \n \n \n
\n
\n \n \n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n
\n \n \n

\n \n \n \n
\n
\n \n \n
\n
\n
自定义样式
\n \n
\n
\n
\n
\n
自定义站点规则
\n \n
\n
\n
\n
\n
自定义站点规则
\n